This is enough to probe and initiate I/O to multiple LUNs on mpii(4)
and lets robert@ attach (but not use) his tape library where LUN 0
is an st(4) and LUN 1 is a ch(4).  OK?

The reason we limit it to 255 is that LUN numbers larger than 255
need to be encoded in a fairly complicated manner and this can be
done later: http://bxr.su/FreeBSD/sys/dev/mps/mps_sas.h#118

P.S.
TASK_MGMT command theoretically needs to care about LUNs as well,
but not the TARGET_RESET that we're using since it resets all of
them (which is actually a wrong thing to do according to the mps(4)
driver from LSI in FreeBSD, but it's a different story).


diff --git sys/dev/pci/mpii.c sys/dev/pci/mpii.c
index 1633c8f5ae4..13a39c654b5 100644
--- sys/dev/pci/mpii.c
+++ sys/dev/pci/mpii.c
@@ -579,11 +579,11 @@ mpii_attach(struct device *parent, struct device *self, 
void *aux)
        /* we should be good to go now, attach scsibus */
        sc->sc_link.adapter = &mpii_switch;
        sc->sc_link.adapter_softc = sc;
        sc->sc_link.adapter_target = -1;
        sc->sc_link.adapter_buswidth = sc->sc_max_devices;
-       sc->sc_link.luns = 1;
+       sc->sc_link.luns = 255;
        sc->sc_link.openings = sc->sc_max_cmds - 1;
        sc->sc_link.pool = &sc->sc_iopool;
 
        memset(&saa, 0, sizeof(saa));
        saa.saa_sc_link = &sc->sc_link;

Reply via email to