Lines Matching +full:adc +full:- +full:use +full:- +full:external +full:- +full:triggers
4 * Copyright (c) 1994-2001 Justin T. Gibbs.
5 * Copyright (c) 2000-2001 Adaptec Inc.
8 * Redistribution and use in source and binary forms, with or without
19 * 3. Neither the names of the above-listed copyright holders nor the names
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60 * use byte 27 of the SCB as a pseudo-next pointer and to thread a list
61 * of SCBs that are awaiting selection. Since 0-0xfe are valid SCB indexes,
63 * this list every time a request sense occurs or after completing a non-tagged
78 if ((ahc->features & AHC_ULTRA2) != 0) {
82 if ((ahc->features & AHC_TWIN) != 0) {
88 if ((ahc->features & AHC_TWIN) != 0) {
95 if ((ahc->features & AHC_QUEUE_REGS) != 0) {
108 if ((ahc->flags & AHC_PAGESCBS) != 0) {
111 /* In the non-paging case, the SCBID == hardware SCB index */
131 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
138 if ((ahc->features & AHC_QUEUE_REGS) != 0) {
167 if ((ahc->features & AHC_DT) == 0) {
179 if ((ahc->flags & AHC_TARGETROLE) != 0) {
180 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
199 if ((ahc->features & AHC_CMD_CHAN) != 0) {
212 if ((ahc->features & AHC_MULTI_TID) != 0) {
214 } else if ((ahc->features & AHC_ULTRA2) != 0) {
220 if ((ahc->features & AHC_TWIN) != 0) {
224 if ((ahc->features & AHC_CMD_CHAN) != 0) {
233 * XXX SCSI-1 may require us to assume lun 0 if
241 * of the SCSI-2 spec for what messages are allowed when.
251 if ((ahc->features & AHC_CMD_CHAN) != 0) {
271 add A, -MSG_SIMPLE_Q_TAG, DINDEX;
273 add A, -MSG_IGN_WIDE_RESIDUE, DINDEX;
277 if ((ahc->features & AHC_CMD_CHAN) != 0) {
294 if ((ahc->features & AHC_CMD_CHAN) != 0) {
304 if ((ahc->features & AHC_CMD_CHAN) != 0) {
331 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
340 if ((ahc->features & AHC_ULTRA2) != 0) {
346 if ((ahc->features & AHC_TWIN) != 0) {
361 * reset), re-enable them now. Resets are only of interest
363 * defer re-enabling the interrupt until, as an initiator,
369 if ((ahc->features & AHC_TWIN) != 0) {
376 if ((ahc->features & AHC_ULTRA2) != 0) {
378 } else if ((ahc->features & AHC_TWIN) != 0) {
383 if ((ahc->flags & AHC_TARGETROLE) != 0) {
396 if ((ahc->features & AHC_ULTRA) != 0) {
403 if ((ahc->features & AHC_ULTRA2) != 0) {
409 if ((ahc->flags & AHC_TARGETROLE) != 0) {
442 if ((ahc->flags & AHC_TARGETROLE) != 0) {
454 * We've just re-selected an initiator.
500 if ((ahc->flags & AHC_PAGESCBS) != 0) {
530 if ((ahc->features & AHC_ULTRA2) != 0) {
544 if ((ahc->features & AHC_HS_MAILBOX) != 0) {
561 if ((ahc->features & AHC_CMD_CHAN) != 0) {
585 if ((ahc->features & AHC_CMD_CHAN) != 0) {
622 if ((ahc->features & AHC_CMD_CHAN) != 0) {
643 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
678 if ((ahc->features & AHC_ULTRA2) != 0) {
702 if ((ahc->features & AHC_ULTRA2) != 0) {
706 if ((ahc->features & AHC_ULTRA) != 0) {
717 adc SCB_RESIDUAL_SGPTR[1],A;
718 adc SCB_RESIDUAL_SGPTR[2],A;
719 adc SCB_RESIDUAL_SGPTR[3],A ret;
721 if ((ahc->features & AHC_CMD_CHAN) != 0) {
755 * so we don't end up referencing a non-existent page.
768 if ((ahc->features & AHC_ULTRA2) != 0) {
773 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
787 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0 && ahc->pci_cachesize != 0) {
817 adc HCNT[1], -1;
818 adc HCNT[2], -1 ret;
825 if ((ahc->features & AHC_ULTRA2) != 0) {
832 if ((ahc->features & AHC_CMD_CHAN) != 0) {
839 * If we re-enter the data phase after going through another
841 * corrupted by the interveining, non-data, transfers. Ask
858 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
862 if ((ahc->features & AHC_CMD_CHAN) != 0) {
871 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0 && ahc->pci_cachesize != 0) {
876 if ((ahc->features & AHC_ULTRA2) == 0) {
877 if ((ahc->features & AHC_CMD_CHAN) != 0) {
895 if ((ahc->features & AHC_DT) == 0) {
905 if ((ahc->features & AHC_ULTRA2) != 0) {
918 if ((ahc->features & AHC_DT) == 0) {
919 if ((ahc->flags & AHC_TARGETROLE) != 0) {
926 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
943 if ((ahc->bugs & AHC_AUTOFLUSH_BUG) != 0) {
945 * On chips with broken auto-flush, start
998 add SCB_RESIDUAL_SGPTR[1], -1;
999 adc SCB_RESIDUAL_SGPTR[2], -1;
1000 adc SCB_RESIDUAL_SGPTR[3], -1;
1010 * requires similar restructuring for pre-ULTRA2
1015 if ((ahc->features & AHC_DT) == 0) {
1016 if ((ahc->bugs & AHC_AUTOFLUSH_BUG) != 0) {
1026 * and for FIFOEMP to de-assert. Here we
1040 * We enable the auto-ack feature on DT capable
1046 * and then test to see if the data FIFO is non-empty.
1069 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
1094 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0
1095 && ahc->pci_cachesize != 0) {
1099 if ((ahc->flags & AHC_TARGETROLE) != 0) {
1101 if ((ahc->bugs & AHC_TMODE_WIDEODD_BUG) != 0) {
1111 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1121 * PHASEMIS is active). If we are doing a SCSI->Host transfer,
1122 * the data FIFO should be flushed auto-magically on STCNT=0
1149 if ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0) {
1160 * Advance the scatter-gather pointers if needed
1162 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0
1163 && ahc->pci_cachesize != 0) {
1169 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1192 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1196 test CCSGCTL, CCSGEN jnz . - 1;
1199 * Workaround for flaky external SCB RAM
1207 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
1224 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
1229 * last as it triggers the computation of
1235 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0
1236 && ahc->pci_cachesize != 0) {
1244 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1250 if ((ahc->flags & AHC_TARGETROLE) != 0) {
1262 if ((ahc->flags & AHC_TARGETROLE) != 0) {
1265 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
1267 if ((ahc->features & AHC_DT) == 0) {
1277 * the SCB. We use STCNT instead of HCNT, since it's a reflection
1281 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1286 if ((ahc->features & AHC_ULTRA2) == 0) {
1289 * operations, which use 32bit addressing, can assume
1292 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
1304 if ((ahc->bugs & AHC_PCI_MWI_BUG) != 0
1305 && ahc->pci_cachesize != 0) {
1306 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1312 adc SCB_RESIDUAL_DATACNT[1], A, STCNT[1];
1313 adc SCB_RESIDUAL_DATACNT[2], A, STCNT[2];
1315 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1320 } else if ((ahc->features & AHC_CMD_CHAN) != 0) {
1334 if ((ahc->features & AHC_ULTRA2) != 0) {
1340 if ((ahc->flags & AHC_TARGETROLE) != 0) {
1344 * For data-in phases, wait for any pending acks from the
1346 * send Ignore Wide Residue messages for data-in phases.
1363 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
1372 if ((ahc->features & AHC_ULTRA2) != 0) {
1376 } else if ((ahc->features & AHC_CMD_CHAN) != 0) {
1384 add NONE, -13, SCB_CDB_LEN;
1387 if ((ahc->features & AHC_ULTRA2) != 0) {
1391 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1410 if ((ahc->features & AHC_ULTRA2) != 0) {
1413 } else if ((ahc->features & AHC_CMD_CHAN) != 0) {
1414 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1418 * data from external SCB memory into
1428 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1441 if ((ahc->features & AHC_DT) == 0) {
1443 test SSTAT1, PHASEMIS jz . - 1;
1445 * Wait for our ACK to go-away on it's own
1500 if ((ahc->features & AHC_DT) == 0) {
1515 * Use SCB_TAG (the position in the kernel's SCB array) as the tag value.
1581 if ((ahc->features & AHC_WIDE) != 0) {
1619 * and then attempt to complete the command again. We should use a
1679 if ((ahc->features & AHC_QUEUE_REGS) != 0) {
1686 if ((ahc->features & AHC_QUEUE_REGS) == 0) {
1691 if ((ahc->flags & AHC_INITIATORROLE) != 0) {
1705 * XXX - Wait for more testing.
1711 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1731 if ((ahc->features & AHC_ULTRA2) != 0) {
1745 if ((ahc->features & AHC_ULTRA2) != 0) {
1756 * Use the residual number since STCNT is corrupted by
1759 if ((ahc->features & AHC_CMD_CHAN) != 0) {
1761 if ((ahc->features & AHC_ULTRA2) == 0) {
1795 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1805 * that the reconnection is for - find the correct SCB and switch to it,
1810 * Determine whether a target is using tagged or non-tagged
1818 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1821 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1822 add NONE, -SCB_64_BTT, SINDEX;
1826 add NONE, -(SCB_64_BTT + 16), SINDEX;
1833 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1834 add NONE, -BUSY_TARGETS, SINDEX;
1838 add NONE, -(BUSY_TARGETS + 16), SINDEX;
1846 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1851 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1855 * We only allow one untagged command per-target
1861 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1874 * If we get one, we use the tag returned to find the proper
1875 * SCB. With SCB paging, we must search for non-tagged
1877 * using SCB paging, we can use the tag as the direct index to the
1881 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1886 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1890 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1895 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1908 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1913 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1920 if ((ahc->flags & AHC_SEQUENCER_DEBUG) != 0) {
1926 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1931 if ((ahc->flags & AHC_SCB_BTT) != 0) {
1943 if ((ahc->flags & AHC_PAGESCBS) != 0) {
1951 if ((ahc->features & AHC_DT) == 0) {
1971 * use the same calling convention as inb.
1996 if ((ahc->flags & AHC_TARGETROLE) != 0) {
2043 if ((ahc->flags & AHC_PAGESCBS) != 0) {
2083 if ((ahc->features & AHC_CMD_CHAN) != 0) {
2096 if ((ahc->features & AHC_CMD_CHAN) != 0) {
2118 if ((ahc->features & AHC_DT) == 0) {
2123 if ((ahc->features & AHC_CMD_CHAN) == 0) {
2150 if ((ahc->flags & AHC_TARGETROLE) != 0) {
2185 adc DINDIR, A, SINDIR;
2187 adc DINDIR, A, SINDIR;
2188 adc DINDIR, A, SINDIR ret;
2196 if ((ahc->features & AHC_CMD_CHAN) != 0) {
2201 if ((ahc->flags & AHC_SCB_BTT) != 0) {
2211 if ((ahc->features & AHC_ULTRA2) == 0) {
2216 } else if ((ahc->bugs & AHC_SCBCHAN_UPLOAD_BUG) != 0) {
2247 if ((ahc->bugs & AHC_PCI_2_1_RETRY_BUG) != 0) {
2281 cmp DINDEX, A jne . - 1;
2285 add A, -SCB_BASE, DINDEX;
2343 if ((ahc->flags & AHC_PAGESCBS) != 0) {
2347 if ((ahc->flags & AHC_PAGESCBS) != 0) {
2357 if ((ahc->flags & AHC_39BIT_ADDRESSING) != 0) {
2364 if ((ahc->flags & AHC_PAGESCBS) != 0) {