Changeset View
Changeset View
Standalone View
Standalone View
stand/uboot/main.c
Show First 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | probe_disks(int devidx, int load_type, int load_unit, int load_slice, | ||||
open_result = -1; | open_result = -1; | ||||
if (load_type == -1) { | if (load_type == -1) { | ||||
printf(" Probing all disk devices...\n"); | printf(" Probing all disk devices...\n"); | ||||
/* Try each disk in succession until one works. */ | /* Try each disk in succession until one works. */ | ||||
for (currdev.dd.d_unit = 0; currdev.dd.d_unit < UB_MAX_DEV; | for (currdev.dd.d_unit = 0; currdev.dd.d_unit < UB_MAX_DEV; | ||||
currdev.dd.d_unit++) { | currdev.dd.d_unit++) { | ||||
print_disk_probe_info(); | print_disk_probe_info(); | ||||
open_result = devsw[devidx]->dv_open(&f, &currdev); | open_result = devsw[devidx]->dv_open(&f); | ||||
if (open_result == 0) { | if (open_result == 0) { | ||||
printf(" good.\n"); | printf(" good.\n"); | ||||
return (0); | return (0); | ||||
} | } | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
return (-1); | return (-1); | ||||
} | } | ||||
if (load_unit == -1) { | if (load_unit == -1) { | ||||
printf(" Probing all %s devices...\n", device_typename(load_type)); | printf(" Probing all %s devices...\n", device_typename(load_type)); | ||||
/* Try each disk of given type in succession until one works. */ | /* Try each disk of given type in succession until one works. */ | ||||
for (unit = 0; unit < UB_MAX_DEV; unit++) { | for (unit = 0; unit < UB_MAX_DEV; unit++) { | ||||
currdev.dd.d_unit = uboot_diskgetunit(load_type, unit); | currdev.dd.d_unit = uboot_diskgetunit(load_type, unit); | ||||
if (currdev.dd.d_unit == -1) | if (currdev.dd.d_unit == -1) | ||||
break; | break; | ||||
print_disk_probe_info(); | print_disk_probe_info(); | ||||
open_result = devsw[devidx]->dv_open(&f, &currdev); | open_result = devsw[devidx]->dv_open(&f); | ||||
if (open_result == 0) { | if (open_result == 0) { | ||||
printf(" good.\n"); | printf(" good.\n"); | ||||
return (0); | return (0); | ||||
} | } | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
return (-1); | return (-1); | ||||
} | } | ||||
if ((currdev.dd.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { | if ((currdev.dd.d_unit = uboot_diskgetunit(load_type, load_unit)) != -1) { | ||||
print_disk_probe_info(); | print_disk_probe_info(); | ||||
open_result = devsw[devidx]->dv_open(&f,&currdev); | open_result = devsw[devidx]->dv_open(&f); | ||||
if (open_result == 0) { | if (open_result == 0) { | ||||
printf(" good.\n"); | printf(" good.\n"); | ||||
return (0); | return (0); | ||||
} | } | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
printf(" Requested disk type/unit/slice/partition not found\n"); | printf(" Requested disk type/unit/slice/partition not found\n"); | ||||
▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines |