...so the io path doesnt have to do it EVERY TIME FOR EVERY IO.
Index: isp_openbsd.c =================================================================== RCS file: /cvs/src/sys/dev/ic/isp_openbsd.c,v retrieving revision 1.45 diff -u -p -r1.45 isp_openbsd.c --- isp_openbsd.c 31 Dec 2010 19:20:42 -0000 1.45 +++ isp_openbsd.c 5 Apr 2011 11:28:57 -0000 @@ -61,6 +61,7 @@ #define _XT(xs) ((((xs)->timeout/1000) * hz) + (3 * hz)) static void ispminphys(struct buf *, struct scsi_link *); +static int isp_scsi_probe(struct scsi_link *); static void ispcmd_slow(XS_T *); static void ispcmd(XS_T *); @@ -94,6 +95,7 @@ isp_attach(struct ispsoftc *isp) struct scsibus_attach_args saa; struct scsi_link *lptr = &isp->isp_osinfo._link[0]; isp->isp_osinfo._adapter.scsi_minphys = ispminphys; + isp->isp_osinfo._adapter.dev_probe = isp_scsi_probe; isp->isp_state = ISP_RUNSTATE; @@ -283,6 +285,17 @@ isp_add2_blocked_queue(struct ispsoftc * xs->free_list.le_next = NULL; } +int +isp_scsi_probe(struct scsi_link *link) +{ + struct ispsoftc *isp = (struct ispsoftc *)link->adapter_softc; + + if (link->lun >= isp->isp_maxluns) + return (ENXIO); + + return (0); +} + void ispcmd(XS_T *xs) { @@ -298,13 +311,6 @@ ispcmd(XS_T *xs) ISP_LOCK(isp); - if (XS_LUN(xs) >= isp->isp_maxluns) { - xs->error = XS_SELTIMEOUT; - scsi_done(xs); - ISP_UNLOCK(isp); - return; - } - if (isp->isp_state < ISP_RUNSTATE) { ISP_DISABLE_INTS(isp); isp_init(isp);