diff options
Diffstat (limited to 'sys/boot/i386/libi386/devicename.c')
-rw-r--r-- | sys/boot/i386/libi386/devicename.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/boot/i386/libi386/devicename.c b/sys/boot/i386/libi386/devicename.c index dfa685e..31259c1 100644 --- a/sys/boot/i386/libi386/devicename.c +++ b/sys/boot/i386/libi386/devicename.c @@ -147,10 +147,11 @@ i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path) if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; - + + case DEVT_CD: case DEVT_NET: unit = 0; - + if (*np && (*np != ':')) { unit = strtol(np, &cp, 0); /* get unit number if present */ if (cp == np) { @@ -162,8 +163,11 @@ i386_parsedev(struct i386_devdesc **dev, const char *devspec, const char **path) err = EINVAL; goto fail; } - - idev->d_kind.netif.unit = unit; + + if (dv->dv_type == DEVT_NET) + idev->d_kind.netif.unit = unit; + else + idev->d_kind.bioscd.unit = unit; if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; @@ -199,6 +203,10 @@ i386_fmtdev(void *vdev) strcpy(buf, "(no device)"); break; + case DEVT_CD: + sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_kind.bioscd.unit); + break; + case DEVT_DISK: cp = buf; cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_kind.biosdisk.unit); |