64 #define ALL_CHANNELS '\0'
65 #define ALL_TARGETS_MASK 0xFFFF
66 #define INITIATOR_WILDCARD (~0)
68 #define SCSIID_TARGET(ahc, scsiid) \
69 (((scsiid) & ((((ahc)->features & AHC_TWIN) != 0) ? TWIN_TID : TID)) \
71 #define SCSIID_OUR_ID(scsiid) \
73 #define SCSIID_CHANNEL(ahc, scsiid) \
74 ((((ahc)->features & AHC_TWIN) != 0) \
75 ? ((((scsiid) & TWIN_CHNLB) != 0) ? 'B' : 'A') \
77 #define SCB_IS_SCSIBUS_B(ahc, scb) \
78 (SCSIID_CHANNEL(ahc, (scb)->hscb->scsiid) == 'B')
79 #define SCB_GET_OUR_ID(scb) \
80 SCSIID_OUR_ID((scb)->hscb->scsiid)
81 #define SCB_GET_TARGET(ahc, scb) \
82 SCSIID_TARGET((ahc), (scb)->hscb->scsiid)
83 #define SCB_GET_CHANNEL(ahc, scb) \
84 SCSIID_CHANNEL(ahc, (scb)->hscb->scsiid)
85 #define SCB_GET_LUN(scb) \
86 ((scb)->hscb->lun & LID)
87 #define SCB_GET_TARGET_OFFSET(ahc, scb) \
88 (SCB_GET_TARGET(ahc, scb) + (SCB_IS_SCSIBUS_B(ahc, scb) ? 8 : 0))
89 #define SCB_GET_TARGET_MASK(ahc, scb) \
90 (0x01 << (SCB_GET_TARGET_OFFSET(ahc, scb)))
92 #define SCB_IS_SILENT(scb) \
93 ((ahc_debug & AHC_SHOW_MASKED_ERRORS) == 0 \
94 && (((scb)->flags & SCB_SILENT) != 0))
96 #define SCB_IS_SILENT(scb) \
97 (((scb)->flags & SCB_SILENT) != 0)
99 #define TCL_TARGET_OFFSET(tcl) \
100 ((((tcl) >> 4) & TID) >> 4)
101 #define TCL_LUN(tcl) \
102 (tcl & (AHC_NUM_LUNS - 1))
103 #define BUILD_TCL(scsiid, lun) \
104 ((lun) | (((scsiid) & TID) << 4))
106 #ifndef AHC_TARGET_MODE
107 #undef AHC_TMODE_ENABLE
108 #define AHC_TMODE_ENABLE 0
115 #define AHC_NUM_TARGETS 16
123 #define AHC_NUM_LUNS 64
128 #define AHC_MAXTRANSFER_SIZE 0x00ffffff
135 #define AHC_SCB_MAX 255
155 #define AHC_MAX_QUEUE 253
162 #define AHC_SCB_MAX_ALLOC (AHC_MAX_QUEUE+1)
169 #define AHC_TMODE_CMDS 256
172 #define AHC_BUSRESET_DELAY 25
461 #define SG_PTR_MASK 0xFFFFFFF8
507 #define AHC_DMA_LAST_SEG 0x80000000
508 #define AHC_SG_HIGH_ADDR_MASK 0x7F000000
509 #define AHC_SG_LEN_MASK 0x00FFFFFF
586 struct scb *scbindex[256];
649 #define AHC_TMODE_EVENT_BUFFER_SIZE 8
653 #define EVENT_TYPE_BUS_RESET 0xFF
664 #ifdef AHC_TARGET_MODE
665 struct ahc_tmode_lstate {
666 struct cam_path *
path;
667 struct ccb_hdr_slist accept_tios;
668 struct ccb_hdr_slist immed_notifies;
674 struct ahc_tmode_lstate;
678 #define AHC_TRANS_CUR 0x01
679 #define AHC_TRANS_ACTIVE 0x03
680 #define AHC_TRANS_GOAL 0x04
681 #define AHC_TRANS_USER 0x08
683 #define AHC_WIDTH_UNKNOWN 0xFF
684 #define AHC_PERIOD_UNKNOWN 0xFF
685 #define AHC_OFFSET_UNKNOWN 0xFF
686 #define AHC_PPR_OPTS_UNKNOWN 0xFF
735 #define ULTRA_SXFR 0x100
736 #define ST_SXFR 0x010
737 #define DT_SXFR 0x040
743 #define AHC_ASYNC_XFER_PERIOD 0x45
744 #define AHC_ULTRA2_XFER_PERIOD 0x0a
749 #define AHC_SYNCRATE_DT 0
750 #define AHC_SYNCRATE_ULTRA2 1
751 #define AHC_SYNCRATE_ULTRA 3
752 #define AHC_SYNCRATE_FAST 6
753 #define AHC_SYNCRATE_MAX AHC_SYNCRATE_DT
754 #define AHC_SYNCRATE_MIN 13
774 #define CFXFER 0x0007
775 #define CFSYNCH 0x0008
776 #define CFDISC 0x0010
777 #define CFWIDEB 0x0020
778 #define CFSYNCHISULTRA 0x0040
779 #define CFSYNCSINGLE 0x0080
780 #define CFSTART 0x0100
781 #define CFINCBIOS 0x0200
782 #define CFRNFOUND 0x0400
783 #define CFMULTILUNDEV 0x0800
784 #define CFWBCACHEENB 0x4000
785 #define CFWBCACHENOP 0xc000
791 #define CFSUPREM 0x0001
792 #define CFSUPREMB 0x0002
793 #define CFBIOSEN 0x0004
794 #define CFBIOS_BUSSCAN 0x0008
795 #define CFSM2DRV 0x0010
796 #define CFSTPWLEVEL 0x0010
797 #define CF284XEXTEND 0x0020
798 #define CFCTRL_A 0x0020
799 #define CFTERM_MENU 0x0040
800 #define CFEXTEND 0x0080
801 #define CFSCAMEN 0x0100
802 #define CFMSG_LEVEL 0x0600
803 #define CFMSG_VERBOSE 0x0000
804 #define CFMSG_SILENT 0x0200
805 #define CFMSG_DIAG 0x0400
806 #define CFBOOTCD 0x0800
813 #define CFAUTOTERM 0x0001
814 #define CFULTRAEN 0x0002
815 #define CF284XSELTO 0x0003
816 #define CF284XFIFO 0x000C
817 #define CFSTERM 0x0004
818 #define CFWSTERM 0x0008
819 #define CFSPARITY 0x0010
820 #define CF284XSTERM 0x0020
821 #define CFMULTILUN 0x0020
822 #define CFRESETB 0x0040
823 #define CFCLUSTERENB 0x0080
824 #define CFBOOTCHAN 0x0300
825 #define CFBOOTCHANSHIFT 8
826 #define CFSEAUTOTERM 0x0400
827 #define CFSELOWTERM 0x0800
828 #define CFSEHIGHTERM 0x1000
829 #define CFENABLEDV 0x4000
835 #define CFSCSIID 0x000f
837 #define CFBRTIME 0xff00
843 #define CFMAXTARG 0x00ff
844 #define CFBOOTLUN 0x0f00
845 #define CFBOOTID 0xf000
848 #define CFSIGNATURE 0x250
849 #define CFSIGNATURE2 0x300
1018 int unsolicited_ints;
1073 #define AHC_PCI_TARGET_PERR_THRESH 10
1131 #define AHC_EISA_SLOT_OFFSET 0xc00
1132 #define AHC_EISA_IOSIZE 0x100
1143 void ahc_pci_resume(
struct ahc_softc *ahc);
1194 int stop_on_first,
int remove,
1197 int initiate_reset);
1239 #ifdef AHC_TARGET_MODE
1240 void ahc_send_lstate_events(
struct ahc_softc *,
1241 struct ahc_tmode_lstate *);
1242 void ahc_handle_en_lun(
struct ahc_softc *ahc,
1243 struct cam_sim *sim,
union ccb *
ccb);
1245 struct cam_sim *sim,
union ccb *
ccb,
1247 struct ahc_tmode_lstate **lstate,
1248 int notfound_failure);
1249 #ifndef AHC_TMODE_ENABLE
1250 #define AHC_TMODE_ENABLE 0
1256 #define AHC_SHOW_MISC 0x0001
1257 #define AHC_SHOW_SENSE 0x0002
1258 #define AHC_DUMP_SEEPROM 0x0004
1259 #define AHC_SHOW_TERMCTL 0x0008
1260 #define AHC_SHOW_MEMORY 0x0010
1261 #define AHC_SHOW_MESSAGES 0x0020
1262 #define AHC_SHOW_DV 0x0040
1263 #define AHC_SHOW_SELTO 0x0080
1264 #define AHC_SHOW_QFULL 0x0200
1265 #define AHC_SHOW_QUEUE 0x0400
1266 #define AHC_SHOW_TQIN 0x0800
1267 #define AHC_SHOW_MASKED_ERRORS 0x1000
1268 #define AHC_DEBUG_SEQUENCER 0x2000