From a355f43ed206c103eb3e07e4d36ed988060dbc8e Mon Sep 17 00:00:00 2001 From: Doug Ambrisko Date: Sat, 22 Mar 2008 02:57:49 +0000 Subject: [PATCH] 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. --- sys/dev/mfi/mfi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index 8eb3c92c2f66..1528e8ad95be 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 @@ mfi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td) } break; + } case MFI_SET_AEN: aen = (struct mfi_ioc_aen *)arg; error = mfi_aen_register(sc, aen->aen_seq_num,