? .dc395x_trm.o.flags ? dc395x_trm.c.flc ? Rules.make Index: dc395x_trm.c =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- dc395x_trm.c 2000/10/12 17:01:09 1.63 +++ dc395x_trm.c 2000/11/22 22:40:57 1.64 @@ -12,7 +12,7 @@ //* Kurt Garloff //* (C) 1999-2000 Kurt Garloff //* License: GNU GPL -//* $Id: dc395x_trm.c,v 1.63 2000/10/12 17:01:09 garloff Exp $ +//* $Id: dc395x_trm.c,v 1.64 2000/11/22 22:40:57 garloff Exp $ //*********************************************************************** //* Tekram PCI SCSI adapter (DC395/U/UW/F or DC315/U) revision history //* @@ -81,6 +81,8 @@ //* to be capable of doing so. 2.4 fixes: //* New scanning sequence ... Fix typo //* 1.29 00/10/12 KG Allow in kernel compilation w/ 2.4 +//* 1.30 00/11/22 KG Use DCB field for reported INQ flags +//* 2.4: Use get_options(). Add pci_dev_tbl[]. //*********************************************************************** /* ************************************************************************* @@ -236,6 +238,23 @@ # include #endif +#define PCI_VendorID_TEKRAM 0x1DE1 /* Vendor ID */ +#define PCI_DeviceID_TRMS1040 0x0391 /* Device ID */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,99) +static struct pci_device_id dc395x_pci_tbl[] __initdata = { + { + vendor: PCI_VendorID_TEKRAM, + device: PCI_DeviceID_TRMS1040, + subvendor: PCI_ANY_ID, + subdevice: PCI_ANY_ID, + }, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(pci, dc395x_pci_tbl); +#endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,70) # define NEW_PCI 1 #endif @@ -447,10 +466,9 @@ BYTE IdentifyMsg; BYTE DevMode; - BYTE InqDataBuf[8]; - BYTE CapacityBuf[8]; -/* 0x3c: */ - BYTE AdpMode; +/* 0x2c: */ + //BYTE AdpMode; + BYTE Inquiry7; /* To store Inquiry flags */ BYTE SyncMode; /* 0:async mode */ BYTE MinNegoPeriod; /* for nego. */ BYTE SyncPeriod; /* for reg. */ @@ -461,7 +479,7 @@ BYTE DevType; unsigned long last_derated; /* last time, when features were turned off in abort */ -/* 0x48: */ +/* 0x38: */ /* BYTE Reserved2[3]; for dword alignment */ }; typedef struct _DCB DC395x_DCB, *PDCB; @@ -545,9 +563,6 @@ /*-----------------------------------------------------------------------*/ -#define PCI_VendorID_TEKRAM 0x1DE1 /* Vendor ID */ -#define PCI_DeviceID_TRMS1040 0x0391 /* Device ID */ - #define BIT31 0x80000000 #define BIT30 0x40000000 #define BIT29 0x20000000 @@ -1468,7 +1483,7 @@ void __init DC395x_trm_setup (char *str) { int i, im; - int ints[6]; + int ints[8]; (void)get_options (str, ARRAY_SIZE(ints), ints); #else void __init DC395x_trm_setup (char *str, int *ints) @@ -2527,7 +2542,7 @@ pEEpromBuf = &dc395x_trm_eepromBuf[index]; pDCB->DevMode = pEEpromBuf->NvramTarget[pDCB->TargetID].NvmTarCfg0; - pDCB->AdpMode = pEEpromBuf->NvramChannelCfg; + //pDCB->AdpMode = pEEpromBuf->NvramChannelCfg; PeriodIndex = pEEpromBuf->NvramTarget[pDCB->TargetID].NvmTarPeriod & 0x07; pDCB->MinNegoPeriod = dc395x_clock_period[ PeriodIndex ]; if (!(pDCB->DevMode & NTC_DO_WIDE_NEGO) || !(pACB->Config & HCC_WIDE_CARD)) @@ -2820,20 +2835,20 @@ pSRB->SRBState = SRB_MSGOUT; #ifndef SYNC_FIRST if (pDCB->SyncMode & WIDE_NEGO_ENABLE && - pSRB->pcmd->device->wide) + pDCB->Inquiry7 & 0x20) { DC395x_Build_WDTR (pACB, pDCB, pSRB); goto no_cmd; } #endif if (pDCB->SyncMode & SYNC_NEGO_ENABLE && - pSRB->pcmd->device->sync) + pDCB->Inquiry7 & 0x10) { DC395x_Build_SDTR (pACB, pDCB, pSRB); goto no_cmd; } if (pDCB->SyncMode & WIDE_NEGO_ENABLE && - pSRB->pcmd->device->wide) + pDCB->Inquiry7 & 0x20) { DC395x_Build_WDTR (pACB, pDCB, pSRB); goto no_cmd; @@ -5141,6 +5156,8 @@ ((PBYTE)ptr)[96] = 0; printk ("\nDC395x: %s\n", (char*)ptr + 8); #endif + if ( (ptr->Vers & 0x07) >= 2 || (ptr->RDF & 0x0F) == 2 ) + pDCB->Inquiry7 = ptr->Flags; if ((ptr->DevType & SCSI_DEVTYPE) == TYPE_NODEV) { printk ("DC395x: Device %02i-%i: TYPE_NODEV?\n", @@ -5538,7 +5555,8 @@ index = pACB->AdapterIndex; pEEpromBuf = &dc395x_trm_eepromBuf[index]; pDCB->DevMode = pEEpromBuf->NvramTarget[target].NvmTarCfg0; - pDCB->AdpMode = pEEpromBuf->NvramChannelCfg; + //pDCB->AdpMode = pEEpromBuf->NvramChannelCfg; + pDCB->Inquiry7 = 0; pDCB->SyncMode = 0; pDCB->last_derated = pACB->pScsiHost->last_reset - 2; /* $$$$$$$ */ @@ -5578,6 +5596,7 @@ pDCB->SyncPeriod = prevDCB->SyncPeriod; pDCB->MinNegoPeriod = prevDCB->MinNegoPeriod; pDCB->SyncOffset = prevDCB->SyncOffset; + pDCB->Inquiry7 = prevDCB->Inquiry7; }; pACB->DCBmap[target] |= (1 << lun); Index: dc395x_trm.h =================================================================== RCS file: /home/cvsroot/dc395/dc395x_trm.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- dc395x_trm.h 2000/10/12 17:01:10 1.28 +++ dc395x_trm.h 2000/11/22 22:40:58 1.29 @@ -8,7 +8,7 @@ ** ********************************************************************** */ -/* $Id: dc395x_trm.h,v 1.28 2000/10/12 17:01:10 garloff Exp $ */ +/* $Id: dc395x_trm.h,v 1.29 2000/11/22 22:40:58 garloff Exp $ */ /* ***************************************************** ** Tekram TRM_S1040 for DC395x driver, header file @@ -20,7 +20,7 @@ #include #define DC395x_BANNER "Tekram DC395U/UW/F DC315/U" -#define DC395x_VERSION "1.29, 2000-10-12" +#define DC395x_VERSION "1.30, 2000-11-22" /* Kernel version autodetection */ #include