Diff below cleans up ahc(4) to use scsi_link::bus instead of
(mis)using scsi_link::scsibus.
If you have an ahc(4) (particularly a dual-channel one), I'd
appreciate test reports + dmesg. (As long as your devices still show
up, then it's working.)
Index: pci/ahc_pci.c
===================================================================
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/pci/ahc_pci.c,v
retrieving revision 1.53
diff -u -p -r1.53 ahc_pci.c
--- pci/ahc_pci.c 13 May 2008 02:24:08 -0000 1.53
+++ pci/ahc_pci.c 23 Jun 2011 18:08:36 -0000
@@ -737,12 +737,6 @@ ahc_pci_attach(parent, self, aux)
for (i = 0; i < AHC_NUM_TARGETS; i++)
TAILQ_INIT(&ahc->untagged_queues[i]);
- /*
- * SCSI_IS_SCSIBUS_B() must returns false until sc_channel_b
- * has been properly initialized. XXX Breaks if >254 scsi buses.
- */
- ahc->sc_channel_b.scsibus = 0xff;
-
ahc->dev_softc = pa;
ahc_set_name(ahc, ahc->sc_dev.dv_xname);
Index: ic/aic7xxx_openbsd.h
===================================================================
RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/ic/aic7xxx_openbsd.h,v
retrieving revision 1.19
diff -u -p -r1.19 aic7xxx_openbsd.h
--- ic/aic7xxx_openbsd.h 15 Sep 2007 10:10:37 -0000 1.19
+++ ic/aic7xxx_openbsd.h 23 Jun 2011 18:18:56 -0000
@@ -88,7 +88,7 @@
/****************************** Platform Macros
*******************************/
#define SCSI_IS_SCSIBUS_B(ahc, sc_link) \
- ((sc_link)->scsibus == (ahc)->sc_channel_b.scsibus)
+ ((sc_link)->bus->adapter_link == &(ahc)->sc_channel_b)
#define SCSI_SCSI_ID(ahc, sc_link) \
(SCSI_IS_SCSIBUS_B(ahc, sc_link) ? ahc->our_id_b : ahc->our_id)
#define SCSI_CHANNEL(ahc, sc_link) \