diff --git a/sys/dev/cardbus/cardbus_device.c b/sys/dev/cardbus/cardbus_device.c index 513caba36c49..b930444dd506 100644 --- a/sys/dev/cardbus/cardbus_device.c +++ b/sys/dev/cardbus/cardbus_device.c @@ -118,7 +118,9 @@ cardbus_device_create(struct cardbus_softc *sc, struct cardbus_devinfo *devi, devi->sc_cisdev = make_dev(&cardbus_cdevsw, minor, 0, 0, 0666, "cardbus%d.%d.cis", device_get_unit(sc->sc_dev), devi->pci.cfg.func); - /* XXX need cardbus%d.cis compat layer here ? */ + if (devi->pci.cfg.func == 0) + devi->sc_cisdev_compat = make_dev_alias(devi->sc_cisdev, + "cardbus%d.cis", device_get_unit(sc->sc_dev)); devi->sc_cisdev->si_drv1 = devi; return (0); } @@ -128,6 +130,8 @@ cardbus_device_destroy(struct cardbus_devinfo *devi) { if (devi->sc_cisdev) destroy_dev(devi->sc_cisdev); + if (devi->sc_cisdev_compat) + destroy_dev(devi->sc_cisdev_compat); return (0); } diff --git a/sys/dev/cardbus/cardbusvar.h b/sys/dev/cardbus/cardbusvar.h index 6264f6945af9..941cc0a61b38 100644 --- a/sys/dev/cardbus/cardbusvar.h +++ b/sys/dev/cardbus/cardbusvar.h @@ -60,6 +60,7 @@ struct cardbus_devinfo } funce; uint32_t fepresent; /* bit mask of funce values present */ struct cdev *sc_cisdev; + struct cdev *sc_cisdev_compat; struct cis_buffer sc_cis; };