diff options
author | ambrisko <ambrisko@FreeBSD.org> | 2008-03-22 02:57:49 +0000 |
---|---|---|
committer | ambrisko <ambrisko@FreeBSD.org> | 2008-03-22 02:57:49 +0000 |
commit | 085cbdfe5d7e4a21819dfad6f4687bdad50ec2d6 (patch) | |
tree | a9ce57c43213070417373a33f01181d3493ea5cb /sys/dev | |
parent | 5541a160b603ad5bc76d92e57bc79fb4085d6fdb (diff) | |
download | FreeBSD-src-085cbdfe5d7e4a21819dfad6f4687bdad50ec2d6.zip FreeBSD-src-085cbdfe5d7e4a21819dfad6f4687bdad50ec2d6.tar.gz |
Add in a compat. mode so you can either open the card's device
node or directly open mfi0 and specify the card you want to talk to
in the ioctl.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/mfi/mfi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index 8eb3c92..1528e8a 100644 --- a/sys/dev/mfi/mfi.c +++ b/sys/dev/mfi/mfi.c @@ -2075,8 +2075,16 @@ mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td) break; } case MFI_CMD: + { + devclass_t devclass; ioc = (struct mfi_ioc_packet *)arg; + int adapter; + adapter = ioc->mfi_adapter_no; + if (device_get_unit(sc->mfi_dev) == 0 && adapter != 0) { + devclass = devclass_find("mfi"); + sc = devclass_get_softc(devclass, adapter); + } mtx_lock(&sc->mfi_io_lock); if ((cm = mfi_dequeue_free(sc)) == NULL) { mtx_unlock(&sc->mfi_io_lock); @@ -2196,6 +2204,7 @@ out: } break; + } case MFI_SET_AEN: aen = (struct mfi_ioc_aen *)arg; error = mfi_aen_register(sc, aen->aen_seq_num, |