diff options
Diffstat (limited to 'stand/uboot')
-rw-r--r-- | stand/uboot/common/main.c | 18 | ||||
-rw-r--r-- | stand/uboot/lib/devicename.c | 10 | ||||
-rw-r--r-- | stand/uboot/lib/disk.c | 10 | ||||
-rw-r--r-- | stand/uboot/lib/libuboot.h | 5 |
4 files changed, 20 insertions, 23 deletions
diff --git a/stand/uboot/common/main.c b/stand/uboot/common/main.c index a88a8bd0ae46..ffc76cae537d 100644 --- a/stand/uboot/common/main.c +++ b/stand/uboot/common/main.c @@ -318,7 +318,7 @@ print_disk_probe_info() strcpy(partition, "<auto>"); printf(" Checking unit=%d slice=%s partition=%s...", - currdev.d_unit, slice, partition); + currdev.dd.d_unit, slice, partition); } @@ -338,8 +338,8 @@ probe_disks(int devidx, int load_type, int load_unit, int load_slice, if (load_type == -1) { printf(" Probing all disk devices...\n"); /* Try each disk in succession until one works. */ - for (currdev.d_unit = 0; currdev.d_unit < UB_MAX_DEV; - currdev.d_unit++) { + for (currdev.dd.d_unit = 0; currdev.dd.d_unit < UB_MAX_DEV; + currdev.dd.d_unit++) { print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f, &currdev); if (open_result == 0) { @@ -355,8 +355,8 @@ probe_disks(int devidx, int load_type, int load_unit, int load_slice, printf(" Probing all %s devices...\n", device_typename(load_type)); /* Try each disk of given type in succession until one works. */ for (unit = 0; unit < UB_MAX_DEV; unit++) { - currdev.d_unit = uboot_diskgetunit(load_type, unit); - if (currdev.d_unit == -1) + currdev.dd.d_unit = uboot_diskgetunit(load_type, unit); + if (currdev.dd.d_unit == -1) break; print_disk_probe_info(); open_result = devsw[devidx]->dv_open(&f, &currdev); @@ -369,7 +369,7 @@ probe_disks(int devidx, int load_type, int load_unit, int load_slice, return (-1); } - if ((currdev.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(); open_result = devsw[devidx]->dv_open(&f,&currdev); if (open_result == 0) { @@ -459,9 +459,9 @@ main(int argc, char **argv) printf("Found U-Boot device: %s\n", devsw[i]->dv_name); - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; + currdev.dd.d_dev = devsw[i]; + currdev.dd.d_type = currdev.dd.d_dev->dv_type; + currdev.dd.d_unit = 0; if ((load_type == -1 || (load_type & DEV_TYP_STOR)) && strcmp(devsw[i]->dv_name, "disk") == 0) { diff --git a/stand/uboot/lib/devicename.c b/stand/uboot/lib/devicename.c index 9e68f9df9eb8..095a57f3dcc4 100644 --- a/stand/uboot/lib/devicename.c +++ b/stand/uboot/lib/devicename.c @@ -136,7 +136,7 @@ uboot_parsedev(struct uboot_devdesc **dev, const char *devspec, err = EINVAL; goto fail; } - idev->d_unit = unit; + idev->dd.d_unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; @@ -146,8 +146,8 @@ uboot_parsedev(struct uboot_devdesc **dev, const char *devspec, err = EINVAL; goto fail; } - idev->d_dev = dv; - idev->d_type = dv->dv_type; + idev->dd.d_dev = dv; + idev->dd.d_type = dv->dv_type; if (dev == NULL) { free(idev); } else { @@ -167,7 +167,7 @@ uboot_fmtdev(void *vdev) struct uboot_devdesc *dev = (struct uboot_devdesc *)vdev; static char buf[128]; - switch(dev->d_type) { + switch(dev->dd.d_type) { case DEVT_NONE: strcpy(buf, "(no device)"); break; @@ -178,7 +178,7 @@ uboot_fmtdev(void *vdev) #endif case DEVT_NET: - sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit); + sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit); break; } return(buf); diff --git a/stand/uboot/lib/disk.c b/stand/uboot/lib/disk.c index f5e44c749ba3..bf07d04f7e36 100644 --- a/stand/uboot/lib/disk.c +++ b/stand/uboot/lib/disk.c @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "libuboot.h" #define stor_printf(fmt, args...) do { \ - printf("%s%d: ", dev->d_dev->dv_name, dev->d_unit); \ + printf("%s%d: ", dev->dd.d_dev->dv_name, dev->dd.d_unit); \ printf(fmt, ##args); \ } while (0) @@ -65,7 +65,7 @@ static struct { u_int bsize; /* block size */ } stor_info[UB_MAX_DEV]; -#define SI(dev) (stor_info[(dev)->d_unit]) +#define SI(dev) (stor_info[(dev)->dd.d_unit]) static int stor_info_no = 0; static int stor_opendev(struct disk_devdesc *); @@ -190,7 +190,7 @@ stor_opendev(struct disk_devdesc *dev) { int err; - if (dev->d_unit < 0 || dev->d_unit >= stor_info_no) + if (dev->dd.d_unit < 0 || dev->dd.d_unit >= stor_info_no) return (EIO); if (SI(dev).opened == 0) { @@ -252,8 +252,8 @@ stor_print(int verbose) return (ret); for (i = 0; i < stor_info_no; i++) { - dev.d_dev = &uboot_storage; - dev.d_unit = i; + dev.dd.d_dev = &uboot_storage; + dev.dd.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, diff --git a/stand/uboot/lib/libuboot.h b/stand/uboot/lib/libuboot.h index efb789099e46..221f48f78784 100644 --- a/stand/uboot/lib/libuboot.h +++ b/stand/uboot/lib/libuboot.h @@ -29,10 +29,7 @@ /* Note: Must match the 'struct devdesc' in stand.h */ struct uboot_devdesc { - struct devsw *d_dev; - int d_type; - int d_unit; - void *d_opendata; + struct devdesc dd; union { struct { int slice; |