• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/

Lines Matching refs:pDCB

270 static void dc390_SetXferRate( struct dc390_acb* pACB, struct dc390_dcb* pDCB );
273 static void dc390_SRBdone( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB );
276 static void dc390_dumpinfo(struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB);
378 struct dc390_dcb* pDCB = pACB->pLinkDCB; if (!pDCB) return NULL;
379 while (pDCB->TargetID != id || pDCB->TargetLUN != lun)
381 pDCB = pDCB->pNextDCB;
382 if (pDCB == pACB->pLinkDCB)
386 pDCB, pDCB->TargetID, pDCB->TargetLUN));
387 return pDCB;
398 static __inline__ void dc390_Going_append (struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
400 pDCB->GoingSRBCnt++;
403 if( pDCB->pGoingSRB )
404 pDCB->pGoingLast->pNextSRB = pSRB;
406 pDCB->pGoingSRB = pSRB;
408 pDCB->pGoingLast = pSRB;
413 static __inline__ void dc390_Going_remove (struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
416 if (pSRB == pDCB->pGoingSRB)
417 pDCB->pGoingSRB = pSRB->pNextSRB;
420 struct dc390_srb* psrb = pDCB->pGoingSRB;
426 if (pSRB == pDCB->pGoingLast)
427 pDCB->pGoingLast = psrb;
429 pDCB->GoingSRBCnt--;
496 dc390_freetag (struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
499 pDCB->TagMask &= ~(1 << pSRB->TagNumber); /* free tag mask */
506 dc390_StartSCSI( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
532 DC390_write8 (Scsi_Dest_ID, pDCB->TargetID);
533 DC390_write8 (Sync_Period, pDCB->SyncPeriod);
534 DC390_write8 (Sync_Offset, pDCB->SyncOffset);
535 DC390_write8 (CtrlReg1, pDCB->CtrlR1);
536 DC390_write8 (CtrlReg3, pDCB->CtrlR3);
537 DC390_write8 (CtrlReg4, pDCB->CtrlR4);
540 scmd->cmnd[0], pDCB->SyncMode));
548 disc_allowed = pDCB->DevMode & EN_DISCONNECT_;
552 if ((pDCB->SyncMode & SYNC_ENABLE) && pDCB->TargetLUN == 0 && sdev->sdtr &&
554 !(pDCB->SyncMode & SYNC_NEGO_DONE)) || scmd->cmnd[0] == INQUIRY))
561 DC390_write8 (ScsiFifo, IDENTIFY(disc_allowed, pDCB->TargetLUN));
563 if ((pDCB->SyncMode & EN_TAG_QUEUEING) && disc_allowed && scsi_populate_tag_msg(scmd, tag)) {
565 pDCB->TagMask |= 1 << tag[1];
580 u8 Sync_Off = pDCB->SyncOffset;
581 DEBUG0(printk (KERN_INFO "DC390: NEW Sync Nego code triggered (%i %i)\n", pDCB->TargetID, pDCB->TargetLUN));
585 pSRB->MsgOutBuf[3] = pDCB->NegoPeriod;
600 DC390_write8 (ScsiFifo, pDCB->TargetLUN << 5);
617 DEBUG0(if (pDCB->pActiveSRB) \
622 dc390_freetag (pDCB, pSRB);
631 pACB->pActiveDCB = pDCB;
632 pDCB->pActiveSRB = pSRB;
651 struct dc390_dcb *pDCB;
716 pDCB = pACB->pActiveDCB;
717 if (!pDCB)
722 pSRB = pDCB->pActiveSRB;
723 if( pDCB->DCBFlag & ABORT_DEV_ )
966 dc390_reprog (struct dc390_acb* pACB, struct dc390_dcb* pDCB)
968 DC390_write8 (Sync_Period, pDCB->SyncPeriod);
969 DC390_write8 (Sync_Offset, pDCB->SyncOffset);
970 DC390_write8 (CtrlReg3, pDCB->CtrlR3);
971 DC390_write8 (CtrlReg4, pDCB->CtrlR4);
972 dc390_SetXferRate (pACB, pDCB);
1010 dc390_MsgIn_QTag (struct dc390_acb* pACB, struct dc390_dcb* pDCB, s8 tag)
1012 struct dc390_srb* pSRB = pDCB->pGoingSRB;
1019 if (pDCB->DCBFlag & ABORT_DEV_)
1028 pDCB->pActiveSRB = pSRB;
1036 pDCB->pActiveSRB = pSRB;
1048 struct dc390_dcb* pDCB = pSRB->pSRBDCB;
1050 printk (KERN_INFO "DC390: Target %i initiates Non-Sync?\n", pDCB->TargetID);
1052 pDCB->SyncMode &= ~(SYNC_ENABLE+SYNC_NEGO_DONE);
1053 pDCB->SyncPeriod = 0;
1054 pDCB->SyncOffset = 0;
1055 //pDCB->NegoPeriod = 50; /* 200ns <=> 5 MHz */
1056 pDCB->CtrlR3 = FAST_CLK; /* fast clock / normal scsi */
1057 pDCB->CtrlR4 &= 0x3f;
1058 pDCB->CtrlR4 |= pACB->glitch_cfg; /* glitch eater */
1059 dc390_reprog (pACB, pDCB);
1068 struct dc390_dcb* pDCB = pSRB->pSRBDCB;
1069 u8 oldsyncperiod = pDCB->SyncPeriod;
1070 u8 oldsyncoffset = pDCB->SyncOffset;
1075 pDCB->TargetID, pSRB->MsgInBuf[3]<<2, pSRB->MsgInBuf[4]);
1087 if (pSRB->MsgInBuf[3] < pDCB->NegoPeriod)
1089 printk (KERN_INFO "DC390: Set sync nego period to %ins\n", pDCB->NegoPeriod << 2);
1090 pSRB->MsgInBuf[3] = pDCB->NegoPeriod;
1098 pDCB->SyncMode |= SYNC_ENABLE+SYNC_NEGO_DONE;
1099 pDCB->SyncOffset &= 0x0f0;
1100 pDCB->SyncOffset |= pSRB->MsgInBuf[4];
1101 pDCB->NegoPeriod = pSRB->MsgInBuf[3];
1108 pDCB->CtrlR4 &= 0x3f; /* Glitch eater: 12ns less than normal */
1110 pDCB->CtrlR4 |= NS_TO_GLITCH(((GLITCH_TO_NS(pACB->glitch_cfg)) - 1));
1112 pDCB->CtrlR4 |= NS_TO_GLITCH(0);
1113 if (wval1 < 4) pDCB->CtrlR4 |= NS_TO_GLITCH(0); /* Ultra */
1119 pDCB->CtrlR4 |= pACB->glitch_cfg; /* glitch eater */
1122 pDCB->CtrlR3 = bval;
1123 pDCB->SyncPeriod = (u8)wval1;
1125 if ((oldsyncperiod != wval1 || oldsyncoffset != pDCB->SyncOffset) && pDCB->TargetLUN == 0)
1128 printk (KERN_INFO "DC390: Target %i: Sync transfer %i.%1i MHz, Offset %i\n", pDCB->TargetID,
1129 40/wval1, ((40%wval1)*10+wval1/2)/wval1, pDCB->SyncOffset & 0x0f);
1132 dc390_reprog (pACB, pDCB);
1208 struct dc390_dcb* pDCB = pACB->pActiveDCB;
1228 pSRB = dc390_MsgIn_QTag (pACB, pDCB, pSRB->MsgInBuf[1]);
1233 pDCB->NegoPeriod = 50; /* 200ns <=> 5 MHz */
1283 struct dc390_dcb* pDCB = pACB->pActiveDCB;
1287 if (pDCB)
1288 printk(KERN_ERR "DC390: pSRB == pTmpSRB! (TagQ Error?) (%02i-%i)\n", pDCB->TargetID, pDCB->TargetLUN);
1293 if (pDCB && pACB->scan_devices && pDCB->GoingSRBCnt == 1) {
1294 pSRB = pDCB->pGoingSRB;
1295 pDCB->pActiveSRB = pSRB;
1297 pSRB->pSRBDCB = pDCB;
1299 if (pDCB)
1300 pDCB->DCBFlag |= ABORT_DEV;
1373 struct dc390_dcb* pDCB;
1389 pDCB = pACB->pActiveDCB;
1390 DC390_write8 (ScsiFifo, pDCB->TargetLUN << 5);
1415 struct dc390_dcb* pDCB;
1418 pDCB = pACB->pActiveDCB;
1428 if( (pDCB->DCBFlag & ABORT_DEV_) &&
1439 if( pDCB->SyncMode & SYNC_ENABLE )
1449 printk (KERN_ERR "DC390: OLD Sync Nego code triggered! (%i %i)\n", pDCB->TargetID, pDCB->TargetLUN);
1453 DC390_write8 (ScsiFifo, pDCB->NegoPeriod);
1454 if (pDCB->SyncOffset & 0x0f)
1455 DC390_write8 (ScsiFifo, pDCB->SyncOffset);
1488 dc390_SetXferRate( struct dc390_acb* pACB, struct dc390_dcb* pDCB )
1493 if( !(pDCB->TargetLUN) )
1499 bval = pDCB->TargetID;
1504 ptr->SyncPeriod = pDCB->SyncPeriod;
1505 ptr->SyncOffset = pDCB->SyncOffset;
1506 ptr->CtrlR3 = pDCB->CtrlR3;
1507 ptr->CtrlR4 = pDCB->CtrlR4;
1508 ptr->SyncMode = pDCB->SyncMode;
1521 struct dc390_dcb *pDCB;
1529 pDCB = pACB->pActiveDCB;
1530 if (!pDCB)
1533 pACB, pDCB, pACB->IOPortBase, pACB->IRQLevel));
1540 pSRB = pDCB->pActiveSRB;
1547 pDCB->TagMask = 0;
1548 pDCB->DCBFlag = 0;
1549 cnt = pDCB->GoingSRBCnt;
1550 pDCB->GoingSRBCnt = 0;
1551 pSRB = pDCB->pGoingSRB;
1558 pDCB->pGoingSRB = NULL;
1572 dc390_freetag (pDCB, pSRB);
1573 pDCB->pActiveSRB = NULL;
1575 dc390_SRBdone( pACB, pDCB, pSRB);
1585 struct dc390_dcb* pDCB;
1591 pDCB = pACB->pActiveDCB;
1592 if( pDCB )
1595 pSRB = pDCB->pActiveSRB;
1601 dc390_Going_remove(pDCB, pSRB);
1620 pDCB = dc390_findDCB (pACB, id, lun);
1621 if (!pDCB)
1627 pACB->pActiveDCB = pDCB;
1629 if( pDCB->SyncMode & EN_TAG_QUEUEING )
1632 pDCB->pActiveSRB = pSRB;
1636 pSRB = pDCB->pActiveSRB;
1643 pDCB->pActiveSRB = pSRB;
1648 if( pDCB->DCBFlag & ABORT_DEV_ )
1662 DC390_write8 (Scsi_Dest_ID, pDCB->TargetID);
1663 DC390_write8 (Sync_Period, pDCB->SyncPeriod);
1664 DC390_write8 (Sync_Offset, pDCB->SyncOffset);
1665 DC390_write8 (CtrlReg1, pDCB->CtrlR1);
1666 DC390_write8 (CtrlReg3, pDCB->CtrlR3);
1667 DC390_write8 (CtrlReg4, pDCB->CtrlR4); /* ; Glitch eater */
1672 dc390_RequestSense(struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
1679 pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
1692 return dc390_StartSCSI(pACB, pDCB, pSRB);
1697 dc390_SRBdone( struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB )
1741 if (dc390_RequestSense(pACB, pDCB, pSRB)) {
1749 scsi_track_queue_full(pcmd->device, pDCB->GoingSRBCnt - 1);
1800 dc390_Going_remove (pDCB, pSRB);
1815 struct dc390_dcb *pDCB, *pdcb;
1820 pDCB = pACB->pLinkDCB;
1821 pdcb = pDCB;
1837 } while( pdcb != pDCB );
1947 static void dc390_dumpinfo (struct dc390_acb* pACB, struct dc390_dcb* pDCB, struct dc390_srb* pSRB)
1952 if (!pDCB) pDCB = pACB->pActiveDCB;
1953 if (!pSRB && pDCB) pSRB = pDCB->pActiveSRB;
1996 struct dc390_dcb *pDCB = (struct dc390_dcb*) cmd->device->hostdata;
2004 dc390_dumpinfo(pACB, pDCB, NULL);
2006 pDCB->DCBFlag |= ABORT_DEV_;
2015 struct dc390_dcb *pDCB, *pdcb;
2017 pDCB = pACB->pLinkDCB;
2018 if (! pDCB) return;
2019 pdcb = pDCB;
2022 pDCB->SyncMode &= ~SYNC_NEGO_DONE;
2023 pDCB->SyncPeriod = 0;
2024 pDCB->SyncOffset = 0;
2025 pDCB->TagMask = 0;
2026 pDCB->CtrlR3 = FAST_CLK;
2027 pDCB->CtrlR4 &= NEGATE_REQACKDATA | CTRL4_RESERVED | NEGATE_REQACK;
2028 pDCB->CtrlR4 |= pACB->glitch_cfg;
2029 pDCB = pDCB->pNextDCB;
2031 while( pdcb != pDCB );
2079 struct dc390_dcb *pDCB, *pDCB2 = NULL;
2083 pDCB = kzalloc(sizeof(struct dc390_dcb), GFP_KERNEL);
2084 if (!pDCB)
2088 pACB->pLinkDCB = pDCB;
2089 pACB->pDCBRunRobin = pDCB;
2091 pACB->pLastDCB->pNextDCB = pDCB;
2094 pDCB->pNextDCB = pACB->pLinkDCB;
2095 pACB->pLastDCB = pDCB;
2097 pDCB->pDCBACB = pACB;
2098 pDCB->TargetID = id;
2099 pDCB->TargetLUN = lun;
2106 pDCB->DevMode = pDCB2->DevMode;
2107 pDCB->SyncMode = pDCB2->SyncMode & SYNC_NEGO_DONE;
2108 pDCB->SyncPeriod = pDCB2->SyncPeriod;
2109 pDCB->SyncOffset = pDCB2->SyncOffset;
2110 pDCB->NegoPeriod = pDCB2->NegoPeriod;
2112 pDCB->CtrlR3 = pDCB2->CtrlR3;
2113 pDCB->CtrlR4 = pDCB2->CtrlR4;
2118 pDCB->DevMode = prom->EE_MODE1;
2119 pDCB->NegoPeriod =
2121 pDCB->CtrlR3 = FAST_CLK;
2122 pDCB->CtrlR4 = pACB->glitch_cfg | CTRL4_RESERVED;
2124 pDCB->CtrlR4 |= NEGATE_REQACKDATA | NEGATE_REQACK;
2127 if (pDCB->DevMode & SYNC_NEGO_)
2128 pDCB->SyncMode |= SYNC_ENABLE;
2130 pDCB->SyncMode = 0;
2131 pDCB->SyncOffset &= ~0x0f;
2134 pDCB->CtrlR1 = pACB->pScsiHost->this_id;
2135 if (pDCB->DevMode & PARITY_CHK_)
2136 pDCB->CtrlR1 |= PARITY_ERR_REPO;
2139 scsi_device->hostdata = pDCB;
2152 struct dc390_dcb* pDCB = (struct dc390_dcb*) scsi_device->hostdata;
2157 BUG_ON(pDCB->GoingSRBCnt > 1);
2159 if (pDCB == pACB->pLinkDCB) {
2160 if (pACB->pLastDCB == pDCB) {
2161 pDCB->pNextDCB = NULL;
2164 pACB->pLinkDCB = pDCB->pNextDCB;
2166 while (pPrevDCB->pNextDCB != pDCB)
2168 pPrevDCB->pNextDCB = pDCB->pNextDCB;
2169 if (pDCB == pACB->pLastDCB)
2173 if (pDCB == pACB->pActiveDCB)
2175 if (pDCB == pACB->pLinkDCB)
2176 pACB->pLinkDCB = pDCB->pNextDCB;
2177 if (pDCB == pACB->pDCBRunRobin)
2178 pACB->pDCBRunRobin = pDCB->pNextDCB;
2179 kfree(pDCB);