#define MODEL_DW 4
-typedef struct SCCBcard {
+struct sccb_card {
struct sccb * currentSCCB;
struct sccb_mgr_info * cardInfo;
struct nvram_info * pNvRamInfo;
struct sccb * discQ_Tbl[QUEUE_DEPTH];
-}SCCBCARD;
+};
-typedef struct SCCBcard *PSCCBcard;
#define F_TAG_STARTED 0x01
static unsigned char FPT_sisyncn(unsigned long port, unsigned char p_card, unsigned char syncFlag);
static void FPT_ssel(unsigned long port, unsigned char p_card);
-static void FPT_sres(unsigned long port, unsigned char p_card, PSCCBcard pCurrCard);
+static void FPT_sres(unsigned long port, unsigned char p_card, struct sccb_card * pCurrCard);
static void FPT_shandem(unsigned long port, unsigned char p_card,struct sccb * pCurrSCCB);
static void FPT_stsyncn(unsigned long port, unsigned char p_card);
static void FPT_sisyncr(unsigned long port,unsigned char sync_pulse, unsigned char offset);
static void FPT_siwidr(unsigned long port, unsigned char width);
-static void FPT_queueSelectFail(PSCCBcard pCurrCard, unsigned char p_card);
+static void FPT_queueSelectFail(struct sccb_card * pCurrCard, unsigned char p_card);
static void FPT_queueDisconnect(struct sccb * p_SCCB, unsigned char p_card);
-static void FPT_queueCmdComplete(PSCCBcard pCurrCard, struct sccb * p_SCCB,
+static void FPT_queueCmdComplete(struct sccb_card * pCurrCard, struct sccb * p_SCCB,
unsigned char p_card);
-static void FPT_queueSearchSelect(PSCCBcard pCurrCard, unsigned char p_card);
+static void FPT_queueSearchSelect(struct sccb_card * pCurrCard, unsigned char p_card);
static void FPT_queueFlushSccb(unsigned char p_card, unsigned char error_code);
static void FPT_queueAddSccb(struct sccb * p_SCCB, unsigned char card);
static unsigned char FPT_queueFindSccb(struct sccb * p_SCCB, unsigned char p_card);
-static void FPT_dataXferProcessor(unsigned long port, PSCCBcard pCurrCard);
+static void FPT_dataXferProcessor(unsigned long port, struct sccb_card * pCurrCard);
static void FPT_busMstrSGDataXferStart(unsigned long port, struct sccb * pCurrSCCB);
static void FPT_busMstrDataXferStart(unsigned long port, struct sccb * pCurrSCCB);
static void FPT_hostDataXferAbort(unsigned long port, unsigned char p_card, struct sccb * pCurrSCCB);
static unsigned char FPT_SccbMgr_bad_isr(unsigned long p_port, unsigned char p_card,
- PSCCBcard pCurrCard, unsigned short p_int);
+ struct sccb_card * pCurrCard, unsigned short p_int);
static void FPT_SccbMgrTableInitAll(void);
-static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, unsigned char p_card);
+static void FPT_SccbMgrTableInitCard(struct sccb_card * pCurrCard, unsigned char p_card);
static void FPT_SccbMgrTableInitTarget(unsigned char p_card, unsigned char target);
static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] = { { { 0 } } };
-static SCCBCARD FPT_BL_Card[MAX_CARDS] = { { 0 } };
+static struct sccb_card FPT_BL_Card[MAX_CARDS] = { { 0 } };
static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { { { 0 } } };
static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { { 0 } };
static unsigned long FlashPoint_HardwareResetHostAdapter(struct sccb_mgr_info * pCardInfo)
{
- PSCCBcard CurrCard = NULL;
+ struct sccb_card * CurrCard = NULL;
struct nvram_info * pCurrNvRam;
unsigned char i,j,thisCard, ScamFlg;
unsigned short temp,sync_bit_map,id;
unsigned long *pScamTbl;
struct nvram_info * pCurrNvRam;
- pCurrNvRam = ((PSCCBcard)pCurrCard)->pNvRamInfo;
+ pCurrNvRam = ((struct sccb_card *)pCurrCard)->pNvRamInfo;
if(pCurrNvRam){
FPT_WrStack(pCurrNvRam->niBaseAddr, 0, pCurrNvRam->niModel);
}
}else{
- FPT_WrStack(((PSCCBcard)pCurrCard)->ioPort, 0, 0);
+ FPT_WrStack(((struct sccb_card *)pCurrCard)->ioPort, 0, 0);
}
}
struct sccb * pSaveSccb;
CALL_BK_FN callback;
- thisCard = ((PSCCBcard) pCurrCard)->cardIndex;
- ioport = ((PSCCBcard) pCurrCard)->ioPort;
+ thisCard = ((struct sccb_card *) pCurrCard)->cardIndex;
+ ioport = ((struct sccb_card *) pCurrCard)->ioPort;
if((p_Sccb->TargID > MAX_SCSI_TAR) || (p_Sccb->Lun > MAX_LUN))
{
FPT_sinits(p_Sccb,thisCard);
- if (!((PSCCBcard) pCurrCard)->cmdCounter)
+ if (!((struct sccb_card *) pCurrCard)->cmdCounter)
{
WR_HARPOON(ioport+hp_semaphore, (RD_HARPOON(ioport+hp_semaphore)
| SCCB_MGR_ACTIVE));
- if (((PSCCBcard) pCurrCard)->globalFlags & F_GREEN_PC)
+ if (((struct sccb_card *) pCurrCard)->globalFlags & F_GREEN_PC)
{
WR_HARPOON(ioport+hp_clkctrl_0, CLKCTRL_DEFAULT);
WR_HARPOON(ioport+hp_sys_ctrl, 0x00);
}
}
- ((PSCCBcard)pCurrCard)->cmdCounter++;
+ ((struct sccb_card *)pCurrCard)->cmdCounter++;
if (RD_HARPOON(ioport+hp_semaphore) & BIOS_IN_USE) {
| TICKLE_ME));
if(p_Sccb->OperationCode == RESET_COMMAND)
{
- pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;
- ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
+ pSaveSccb = ((struct sccb_card *) pCurrCard)->currentSCCB;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = p_Sccb;
FPT_queueSelectFail(&FPT_BL_Card[thisCard], thisCard);
- ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = pSaveSccb;
}
else
{
if(p_Sccb->OperationCode == RESET_COMMAND)
{
- pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;
- ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
+ pSaveSccb = ((struct sccb_card *) pCurrCard)->currentSCCB;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = p_Sccb;
FPT_queueSelectFail(&FPT_BL_Card[thisCard], thisCard);
- ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = pSaveSccb;
}
else
{
MDISABLE_INT(ioport);
- if((((PSCCBcard) pCurrCard)->globalFlags & F_CONLUN_IO) &&
+ if((((struct sccb_card *) pCurrCard)->globalFlags & F_CONLUN_IO) &&
((FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarStatus & TAR_TAG_Q_MASK) != TAG_Q_TRYING))
lun = p_Sccb->Lun;
else
lun = 0;
- if ((((PSCCBcard) pCurrCard)->currentSCCB == NULL) &&
+ if ((((struct sccb_card *) pCurrCard)->currentSCCB == NULL) &&
(FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarSelQ_Cnt == 0) &&
(FPT_sccbMgrTbl[thisCard][p_Sccb->TargID].TarLUNBusy[lun]
== 0)) {
- ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = p_Sccb;
FPT_ssel(p_Sccb->SccbIOPort,thisCard);
}
if(p_Sccb->OperationCode == RESET_COMMAND)
{
- pSaveSccb = ((PSCCBcard) pCurrCard)->currentSCCB;
- ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
+ pSaveSccb = ((struct sccb_card *) pCurrCard)->currentSCCB;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = p_Sccb;
FPT_queueSelectFail(&FPT_BL_Card[thisCard], thisCard);
- ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSccb;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = pSaveSccb;
}
else
{
struct sccb_mgr_tar_info * currTar_Info;
- ioport = ((PSCCBcard) pCurrCard)->ioPort;
+ ioport = ((struct sccb_card *) pCurrCard)->ioPort;
- thisCard = ((PSCCBcard)pCurrCard)->cardIndex;
+ thisCard = ((struct sccb_card *)pCurrCard)->cardIndex;
if (!(RD_HARPOON(ioport+hp_page_ctrl) & G_INT_DISABLE))
{
if (FPT_queueFindSccb(p_Sccb,thisCard))
{
- ((PSCCBcard)pCurrCard)->cmdCounter--;
+ ((struct sccb_card *)pCurrCard)->cmdCounter--;
- if (!((PSCCBcard)pCurrCard)->cmdCounter)
+ if (!((struct sccb_card *)pCurrCard)->cmdCounter)
WR_HARPOON(ioport+hp_semaphore,(RD_HARPOON(ioport+hp_semaphore)
& (unsigned char)(~(SCCB_MGR_ACTIVE | TICKLE_ME)) ));
else
{
- if (((PSCCBcard)pCurrCard)->currentSCCB == p_Sccb)
+ if (((struct sccb_card *)pCurrCard)->currentSCCB == p_Sccb)
{
p_Sccb->SccbStatus = SCCB_ABORT;
return(0);
if(p_Sccb->Sccb_tag)
{
MDISABLE_INT(ioport);
- if (((PSCCBcard) pCurrCard)->discQ_Tbl[p_Sccb->Sccb_tag]==p_Sccb)
+ if (((struct sccb_card *) pCurrCard)->discQ_Tbl[p_Sccb->Sccb_tag]==p_Sccb)
{
p_Sccb->SccbStatus = SCCB_ABORT;
p_Sccb->Sccb_scsistat = ABORT_ST;
p_Sccb->Sccb_scsimsg = SMABORT_TAG;
- if(((PSCCBcard) pCurrCard)->currentSCCB == NULL)
+ if(((struct sccb_card *) pCurrCard)->currentSCCB == NULL)
{
- ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = p_Sccb;
FPT_ssel(ioport, thisCard);
}
else
{
- pSaveSCCB = ((PSCCBcard) pCurrCard)->currentSCCB;
- ((PSCCBcard) pCurrCard)->currentSCCB = p_Sccb;
- FPT_queueSelectFail((PSCCBcard) pCurrCard, thisCard);
- ((PSCCBcard) pCurrCard)->currentSCCB = pSaveSCCB;
+ pSaveSCCB = ((struct sccb_card *) pCurrCard)->currentSCCB;
+ ((struct sccb_card *) pCurrCard)->currentSCCB = p_Sccb;
+ FPT_queueSelectFail((struct sccb_card *) pCurrCard, thisCard);
+ ((struct sccb_card *) pCurrCard)->currentSCCB = pSaveSCCB;
}
}
MENABLE_INT(ioport);
{
unsigned long ioport;
- ioport = ((PSCCBcard)pCurrCard)->ioPort;
+ ioport = ((struct sccb_card *)pCurrCard)->ioPort;
if (RD_HARPOON(ioport+hp_int_status) & INT_ASSERTED)
{
unsigned char i, target;
unsigned long ioport;
- thisCard = ((PSCCBcard)pCurrCard)->cardIndex;
- ioport = ((PSCCBcard)pCurrCard)->ioPort;
+ thisCard = ((struct sccb_card *)pCurrCard)->cardIndex;
+ ioport = ((struct sccb_card *)pCurrCard)->ioPort;
MDISABLE_INT(ioport);
bm_status)
{
- currSCCB = ((PSCCBcard)pCurrCard)->currentSCCB;
+ currSCCB = ((struct sccb_card *)pCurrCard)->currentSCCB;
if (hp_int & (FIFO | TIMEOUT | RESET | SCAM_SEL) || bm_status) {
- result = FPT_SccbMgr_bad_isr(ioport,thisCard,((PSCCBcard)pCurrCard),hp_int);
+ result = FPT_SccbMgr_bad_isr(ioport,thisCard,((struct sccb_card *)pCurrCard),hp_int);
WRW_HARPOON((ioport+hp_intstat), (FIFO | TIMEOUT | RESET | SCAM_SEL));
bm_status = 0;
while (!(RDW_HARPOON((ioport+hp_intstat)) & (BUS_FREE | RSEL))) ;
}
- if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT)
+ if (((struct sccb_card *)pCurrCard)->globalFlags & F_HOST_XFER_ACT)
FPT_phaseChkFifo(ioport, thisCard);
else if (hp_int & ITAR_DISC)
{
- if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) {
+ if (((struct sccb_card *)pCurrCard)->globalFlags & F_HOST_XFER_ACT) {
FPT_phaseChkFifo(ioport, thisCard);
WRW_HARPOON((ioport+hp_intstat), (BUS_FREE | ITAR_DISC));
- ((PSCCBcard)pCurrCard)->globalFlags |= F_NEW_SCCB_CMD;
+ ((struct sccb_card *)pCurrCard)->globalFlags |= F_NEW_SCCB_CMD;
}
if (RDW_HARPOON((ioport+hp_intstat)) & ITAR_DISC)
{
- if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT)
+ if (((struct sccb_card *)pCurrCard)->globalFlags & F_HOST_XFER_ACT)
{
FPT_phaseChkFifo(ioport, thisCard);
}
FPT_queueDisconnect(currSCCB,thisCard);
}
- FPT_sres(ioport,thisCard,((PSCCBcard)pCurrCard));
+ FPT_sres(ioport,thisCard,((struct sccb_card *)pCurrCard));
FPT_phaseDecode(ioport,thisCard);
}
WRW_HARPOON((ioport+hp_intstat), BUS_FREE);
- if (((PSCCBcard)pCurrCard)->globalFlags & F_HOST_XFER_ACT) {
+ if (((struct sccb_card *)pCurrCard)->globalFlags & F_HOST_XFER_ACT) {
FPT_hostDataXferAbort(ioport,thisCard,currSCCB);
}
else if (hp_int & ITICKLE) {
WRW_HARPOON((ioport+hp_intstat), ITICKLE);
- ((PSCCBcard)pCurrCard)->globalFlags |= F_NEW_SCCB_CMD;
+ ((struct sccb_card *)pCurrCard)->globalFlags |= F_NEW_SCCB_CMD;
}
- if (((PSCCBcard)pCurrCard)->globalFlags & F_NEW_SCCB_CMD) {
+ if (((struct sccb_card *)pCurrCard)->globalFlags & F_NEW_SCCB_CMD) {
- ((PSCCBcard)pCurrCard)->globalFlags &= ~F_NEW_SCCB_CMD;
+ ((struct sccb_card *)pCurrCard)->globalFlags &= ~F_NEW_SCCB_CMD;
- if (((PSCCBcard)pCurrCard)->currentSCCB == NULL) {
+ if (((struct sccb_card *)pCurrCard)->currentSCCB == NULL) {
- FPT_queueSearchSelect(((PSCCBcard)pCurrCard),thisCard);
+ FPT_queueSearchSelect(((struct sccb_card *)pCurrCard),thisCard);
}
- if (((PSCCBcard)pCurrCard)->currentSCCB != NULL) {
- ((PSCCBcard)pCurrCard)->globalFlags &= ~F_NEW_SCCB_CMD;
+ if (((struct sccb_card *)pCurrCard)->currentSCCB != NULL) {
+ ((struct sccb_card *)pCurrCard)->globalFlags &= ~F_NEW_SCCB_CMD;
FPT_ssel(ioport,thisCard);
}
*
*---------------------------------------------------------------------*/
static unsigned char FPT_SccbMgr_bad_isr(unsigned long p_port, unsigned char p_card,
- PSCCBcard pCurrCard, unsigned short p_int)
+ struct sccb_card * pCurrCard, unsigned short p_int)
{
unsigned char temp, ScamFlg;
struct sccb_mgr_tar_info * currTar_Info;
*
*---------------------------------------------------------------------*/
-static void FPT_SccbMgrTableInitCard(PSCCBcard pCurrCard, unsigned char p_card)
+static void FPT_SccbMgrTableInitCard(struct sccb_card * pCurrCard, unsigned char p_card)
{
unsigned char scsiID, qtag;
unsigned char auto_loaded, i, target, *theCCB;
unsigned long cdb_reg;
- PSCCBcard CurrCard;
+ struct sccb_card * CurrCard;
struct sccb * currSCCB;
struct sccb_mgr_tar_info * currTar_Info;
unsigned char lastTag, lun;
*
*---------------------------------------------------------------------*/
-static void FPT_sres(unsigned long port, unsigned char p_card, PSCCBcard pCurrCard)
+static void FPT_sres(unsigned long port, unsigned char p_card, struct sccb_card * pCurrCard)
{
unsigned char our_target, message, lun = 0, tag, msgRetryCount;
static void FPT_sdecm(unsigned char message, unsigned long port, unsigned char p_card)
{
struct sccb * currSCCB;
- PSCCBcard CurrCard;
+ struct sccb_card * CurrCard;
struct sccb_mgr_tar_info * currTar_Info;
CurrCard = &FPT_BL_Card[p_card];
* Description: Setup for the Auto Sense command.
*
*---------------------------------------------------------------------*/
-static void FPT_ssenss(PSCCBcard pCurrCard)
+static void FPT_ssenss(struct sccb_card * pCurrCard)
{
unsigned char i;
struct sccb * currSCCB;
*
*---------------------------------------------------------------------*/
-static void FPT_dataXferProcessor(unsigned long port, PSCCBcard pCurrCard)
+static void FPT_dataXferProcessor(unsigned long port, struct sccb_card * pCurrCard)
{
struct sccb * currSCCB;
unsigned long p_port;
unsigned char i,k,ScamFlg ;
- PSCCBcard currCard;
+ struct sccb_card * currCard;
struct nvram_info * pCurrNvRam;
currCard = &FPT_BL_Card[p_card];
*
*---------------------------------------------------------------------*/
-static void FPT_queueSearchSelect(PSCCBcard pCurrCard, unsigned char p_card)
+static void FPT_queueSearchSelect(struct sccb_card * pCurrCard, unsigned char p_card)
{
unsigned char scan_ptr, lun;
struct sccb_mgr_tar_info * currTar_Info;
*
*---------------------------------------------------------------------*/
-static void FPT_queueSelectFail(PSCCBcard pCurrCard, unsigned char p_card)
+static void FPT_queueSelectFail(struct sccb_card * pCurrCard, unsigned char p_card)
{
unsigned char thisTarg;
struct sccb_mgr_tar_info * currTar_Info;
*
*---------------------------------------------------------------------*/
-static void FPT_queueCmdComplete(PSCCBcard pCurrCard, struct sccb * p_sccb,
+static void FPT_queueCmdComplete(struct sccb_card * pCurrCard, struct sccb * p_sccb,
unsigned char p_card)
{