patch-2.3.16 linux/drivers/scsi/advansys.c
Next file: linux/drivers/scsi/atari_NCR5380.c
Previous file: linux/drivers/scsi/Makefile
Back to the patch index
Back to the overall index
- Lines: 847
- Date:
Thu Aug 26 14:02:45 1999
- Orig file:
v2.3.15/linux/drivers/scsi/advansys.c
- Orig date:
Thu Aug 5 15:07:42 1999
diff -u --recursive --new-file v2.3.15/linux/drivers/scsi/advansys.c linux/drivers/scsi/advansys.c
@@ -3203,11 +3203,9 @@
* are not used when the driver is built as a module, cf. linux/init.h.
*/
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,23)
-#define ASC_INITFUNC(func) func
#define ASC_INITDATA
#define ASC_INIT
#else /* version >= v2.1.23 */
-#define ASC_INITFUNC(func) __initfunc(func)
#define ASC_INITDATA __initdata
#define ASC_INIT __init
#endif /* version >= v2.1.23 */
@@ -4168,10 +4166,8 @@
* it must not call SCSI mid-level functions including scsi_malloc()
* and scsi_free().
*/
-ASC_INITFUNC(
-int
+int ASC_INIT
advansys_detect(Scsi_Host_Template *tpnt)
-)
{
static int detect_called = ASC_FALSE;
int iop;
@@ -6192,10 +6188,8 @@
* ints[2] - second argument
* ...
*/
-ASC_INITFUNC(
-void
+void ASC_INIT
advansys_setup(char *str, int *ints)
-)
{
int i;
@@ -7454,10 +7448,8 @@
/*
* Search for an AdvanSys PCI device in the PCI configuration space.
*/
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
asc_srch_pci_dev(PCI_DEVICE *pciDevice)
-)
{
int ret = PCI_DEVICE_NOT_FOUND;
@@ -7494,10 +7486,8 @@
/*
* Determine the access method to be used for 'pciDevice'.
*/
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
asc_scan_method(void)
-)
{
ushort data;
PCI_DATA pciData;
@@ -7526,10 +7516,8 @@
*
* Return PCI_DEVICE_FOUND if found, otherwise return PCI_DEVICE_NOT_FOUND.
*/
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
asc_pci_find_dev(PCI_DEVICE *pciDevice)
-)
{
PCI_DATA pciData;
ushort vendorid, deviceid;
@@ -7578,10 +7566,8 @@
/*
* Read PCI configuration data into 'pciConfig'.
*/
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
asc_get_pci_cfg(PCI_DEVICE *pciDevice, PCI_CONFIG_SPACE *pciConfig)
-)
{
PCI_DATA pciData;
uchar counter;
@@ -7610,10 +7596,8 @@
*
* The configuration mechanism is checked for the correct access method.
*/
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
asc_get_cfg_word(PCI_DATA *pciData)
-)
{
ushort tmp;
ulong address;
@@ -7693,10 +7677,8 @@
*
* The configuration mechanism is checked for the correct access method.
*/
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
asc_get_cfg_byte(PCI_DATA *pciData)
-)
{
uchar tmp;
ulong address;
@@ -7773,10 +7755,8 @@
/*
* Write a byte to the PCI configuration space.
*/
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
asc_put_cfg_byte(PCI_DATA *pciData, uchar byte_data)
-)
{
ulong tmpl;
ulong address;
@@ -9366,12 +9346,10 @@
/*
* Read a PCI configuration byte.
*/
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
DvcReadPCIConfigByte(
ASC_DVC_VAR asc_ptr_type *asc_dvc,
ushort offset)
-)
{
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93)
#ifdef ASC_CONFIG_PCI
@@ -9403,13 +9381,11 @@
/*
* Write a PCI configuration byte.
*/
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
DvcWritePCIConfigByte(
ASC_DVC_VAR asc_ptr_type *asc_dvc,
ushort offset,
uchar byte_data)
-)
{
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93)
#ifdef ASC_CONFIG_PCI
@@ -9436,13 +9412,11 @@
* Return the BIOS address of the adapter at the specified
* I/O port and with the specified bus type.
*/
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscGetChipBiosAddress(
PortAddr iop_base,
ushort bus_type
)
-)
{
ushort cfg_lsw ;
ushort bios_addr ;
@@ -9519,12 +9493,10 @@
/*
* Read a PCI configuration byte.
*/
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
DvcAdvReadPCIConfigByte(
ADV_DVC_VAR *asc_dvc,
ushort offset)
-)
{
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93)
#ifdef ASC_CONFIG_PCI
@@ -9556,13 +9528,11 @@
/*
* Write a PCI configuration byte.
*/
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
DvcAdvWritePCIConfigByte(
ADV_DVC_VAR *asc_dvc,
ushort offset,
uchar byte_data)
-)
{
#if LINUX_VERSION_CODE < ASC_LINUX_VERSION(2,1,93)
#ifdef ASC_CONFIG_PCI
@@ -10206,12 +10176,10 @@
* --- Asc Library Functions
*/
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscGetEisaChipCfg(
PortAddr iop_base
)
-)
{
PortAddr eisa_cfg_iop;
@@ -10220,13 +10188,11 @@
return (inpw(eisa_cfg_iop));
}
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
AscSetChipScsiID(
PortAddr iop_base,
uchar new_host_id
)
-)
{
ushort cfg_lsw;
@@ -10240,12 +10206,10 @@
return (AscGetChipScsiID(iop_base));
}
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
AscGetChipScsiCtrl(
PortAddr iop_base
)
-)
{
uchar sc;
@@ -10255,13 +10219,11 @@
return (sc);
}
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
AscGetChipVersion(
PortAddr iop_base,
ushort bus_type
)
-)
{
if ((bus_type & ASC_IS_EISA) != 0) {
PortAddr eisa_iop;
@@ -10274,12 +10236,10 @@
return (AscGetChipVerNo(iop_base));
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscGetChipBusType(
PortAddr iop_base
)
-)
{
ushort chip_ver;
@@ -10309,15 +10269,13 @@
return (0);
}
-ASC_INITFUNC(
-STATIC ulong
+STATIC ulong ASC_INIT
AscLoadMicroCode(
PortAddr iop_base,
ushort s_addr,
ushort *mcode_buf,
ushort mcode_size
)
-)
{
ulong chksum;
ushort mcode_word_size;
@@ -10335,12 +10293,10 @@
return (chksum);
}
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
AscFindSignature(
PortAddr iop_base
)
-)
{
ushort sig_word;
@@ -10361,13 +10317,11 @@
ASC_IOADR_5, ASC_IOADR_6, ASC_IOADR_7, ASC_IOADR_8
};
-ASC_INITFUNC(
-STATIC PortAddr
+STATIC PortAddr ASC_INIT
AscSearchIOPortAddr(
PortAddr iop_beg,
ushort bus_type
)
-)
{
if (bus_type & ASC_IS_VL) {
while ((iop_beg = AscSearchIOPortAddr11(iop_beg)) != 0) {
@@ -10398,12 +10352,10 @@
return (0);
}
-ASC_INITFUNC(
-STATIC PortAddr
+STATIC PortAddr ASC_INIT
AscSearchIOPortAddr11(
PortAddr s_addr
)
-)
{
int i;
PortAddr iop_base;
@@ -10429,36 +10381,30 @@
return (0);
}
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AscToggleIRQAct(
PortAddr iop_base
)
-)
{
AscSetChipStatus(iop_base, CIW_IRQ_ACT);
AscSetChipStatus(iop_base, 0);
return;
}
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AscSetISAPNPWaitForKey(
void)
-)
{
outp(ASC_ISA_PNP_PORT_ADDR, 0x02);
outp(ASC_ISA_PNP_PORT_WRITE, 0x02);
return;
}
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
AscGetChipIRQ(
PortAddr iop_base,
ushort bus_type
)
-)
{
ushort cfg_lsw;
uchar chip_irq;
@@ -10488,14 +10434,12 @@
return ((uchar) (chip_irq + ASC_MIN_IRQ_NO));
}
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
AscSetChipIRQ(
PortAddr iop_base,
uchar irq_no,
ushort bus_type
)
-)
{
ushort cfg_lsw;
@@ -10529,12 +10473,10 @@
return (0);
}
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AscEnableIsaDma(
uchar dma_channel
)
-)
{
if (dma_channel < 4) {
outp(0x000B, (ushort) (0xC0 | dma_channel));
@@ -12396,12 +12338,10 @@
udelay((nano_sec + 999)/1000);
}
-ASC_INITFUNC(
-STATIC ulong
+STATIC ulong ASC_INIT
AscGetEisaProductID(
PortAddr iop_base
)
-)
{
PortAddr eisa_iop;
ushort product_id_high, product_id_low;
@@ -12414,12 +12354,10 @@
return (product_id);
}
-ASC_INITFUNC(
-STATIC PortAddr
+STATIC PortAddr ASC_INIT
AscSearchIOPortAddrEISA(
PortAddr iop_base
)
-)
{
ulong eisa_product_id;
@@ -12608,12 +12546,10 @@
return (AscIsChipHalted(iop_base));
}
-ASC_INITFUNC(
-STATIC ulong
+STATIC ulong ASC_INIT
AscGetMaxDmaCount(
ushort bus_type
)
-)
{
if (bus_type & ASC_IS_ISA)
return (ASC_MAX_ISA_DMA_COUNT);
@@ -12622,12 +12558,10 @@
return (ASC_MAX_PCI_DMA_COUNT);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscGetIsaDmaChannel(
PortAddr iop_base
)
-)
{
ushort channel;
@@ -12639,13 +12573,11 @@
return (channel + 4);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscSetIsaDmaChannel(
PortAddr iop_base,
ushort dma_channel
)
-)
{
ushort cfg_lsw;
uchar value;
@@ -12663,13 +12595,11 @@
return (0);
}
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
AscSetIsaDmaSpeed(
PortAddr iop_base,
uchar speed_value
)
-)
{
speed_value &= 0x07;
AscSetBank(iop_base, 1);
@@ -12678,12 +12608,10 @@
return (AscGetIsaDmaSpeed(iop_base));
}
-ASC_INITFUNC(
-STATIC uchar
+STATIC uchar ASC_INIT
AscGetIsaDmaSpeed(
PortAddr iop_base
)
-)
{
uchar speed_value;
@@ -12694,12 +12622,10 @@
return (speed_value);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscReadPCIConfigWord(
ASC_DVC_VAR asc_ptr_type *asc_dvc,
ushort pci_config_offset)
-)
{
uchar lsb, msb;
@@ -12708,12 +12634,10 @@
return ((ushort) ((msb << 8) | lsb));
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscInitGetConfig(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
ushort warn_code;
PortAddr iop_base;
@@ -12793,12 +12717,10 @@
return(warn_code);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscInitSetConfig(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
ushort warn_code = 0;
@@ -12814,12 +12736,10 @@
return (warn_code);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscInitFromAscDvcVar(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
PortAddr iop_base;
ushort cfg_msw;
@@ -12877,12 +12797,10 @@
return (warn_code);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscInitAsc1000Driver(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
ushort warn_code;
PortAddr iop_base;
@@ -12919,12 +12837,10 @@
return (warn_code);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscInitAscDvcVar(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
int i;
PortAddr iop_base;
@@ -13034,12 +12950,10 @@
return (warn_code);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscInitFromEEP(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
ASCEEP_CONFIG eep_config_buf;
ASCEEP_CONFIG *eep_config;
@@ -13189,12 +13103,10 @@
return (warn_code);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscInitMicroCodeVar(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
int i;
ushort warn_code;
@@ -13239,12 +13151,10 @@
return (warn_code);
}
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
AscTestExternalLram(
ASC_DVC_VAR asc_ptr_type * asc_dvc
)
-)
{
PortAddr iop_base;
ushort q_addr;
@@ -13266,13 +13176,11 @@
return (sta);
}
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
AscWriteEEPCmdReg(
PortAddr iop_base,
uchar cmd_reg
)
-)
{
uchar read_back;
int retry;
@@ -13291,13 +13199,11 @@
}
}
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
AscWriteEEPDataReg(
PortAddr iop_base,
ushort data_reg
)
-)
{
ushort read_back;
int retry;
@@ -13316,35 +13222,29 @@
}
}
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AscWaitEEPRead(
void
)
-)
{
DvcSleepMilliSecond(1);
return;
}
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AscWaitEEPWrite(
void
)
-)
{
DvcSleepMilliSecond(20);
return;
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscReadEEPWord(
PortAddr iop_base,
uchar addr
)
-)
{
ushort read_wval;
uchar cmd_reg;
@@ -13359,14 +13259,12 @@
return (read_wval);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscWriteEEPWord(
PortAddr iop_base,
uchar addr,
ushort word_val
)
-)
{
ushort read_wval;
@@ -13386,13 +13284,11 @@
return (read_wval);
}
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AscGetEEPConfig(
PortAddr iop_base,
ASCEEP_CONFIG * cfg_buf, ushort bus_type
)
-)
{
ushort wval;
ushort sum;
@@ -13427,13 +13323,11 @@
return (sum);
}
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
AscSetEEPConfigOnce(
PortAddr iop_base,
ASCEEP_CONFIG * cfg_buf, ushort bus_type
)
-)
{
int n_error;
ushort *wbuf;
@@ -13484,13 +13378,11 @@
return (n_error);
}
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
AscSetEEPConfig(
PortAddr iop_base,
ASCEEP_CONFIG * cfg_buf, ushort bus_type
)
-)
{
int retry;
int n_error;
@@ -14175,10 +14067,8 @@
* For a non-fatal error return a warning code. If there are no warnings
* then 0 is returned.
*/
-ASC_INITFUNC(
-int
+int ASC_INIT
AdvInitGetConfig(ADV_DVC_VAR *asc_dvc)
-)
{
ushort warn_code;
AdvPortAddr iop_base;
@@ -14285,10 +14175,8 @@
* For a non-fatal error return a warning code. If there are no warnings
* then 0 is returned.
*/
-ASC_INITFUNC(
-int
+int ASC_INIT
AdvInitAsc3550Driver(ADV_DVC_VAR *asc_dvc)
-)
{
AdvPortAddr iop_base;
ushort warn_code;
@@ -14620,10 +14508,8 @@
*
* Note: Chip is stopped on entry.
*/
-ASC_INITFUNC(
-STATIC int
+STATIC int ASC_INIT
AdvInitFromEEP(ADV_DVC_VAR *asc_dvc)
-)
{
AdvPortAddr iop_base;
ushort warn_code;
@@ -14786,10 +14672,8 @@
*
* Return a checksum based on the EEPROM configuration read.
*/
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AdvGetEEPConfig(AdvPortAddr iop_base, ADVEEP_CONFIG *cfg_buf)
-)
{
ushort wval, chksum;
ushort *wbuf;
@@ -14820,10 +14704,8 @@
/*
* Read the EEPROM from specified location
*/
-ASC_INITFUNC(
-STATIC ushort
+STATIC ushort ASC_INIT
AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr)
-)
{
AdvWriteWordRegister(iop_base, IOPW_EE_CMD,
ASC_EEP_CMD_READ | eep_word_addr);
@@ -14834,10 +14716,8 @@
/*
* Wait for EEPROM command to complete
*/
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AdvWaitEEPCmd(AdvPortAddr iop_base)
-)
{
int eep_delay_ms;
@@ -14859,10 +14739,8 @@
/*
* Write the EEPROM from 'cfg_buf'.
*/
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AdvSetEEPConfig(AdvPortAddr iop_base, ADVEEP_CONFIG *cfg_buf)
-)
{
ushort *wbuf;
ushort addr, chksum;
@@ -14923,10 +14801,8 @@
* configuration is read to determine whether SCSI Bus Resets
* should be performed.
*/
-ASC_INITFUNC(
-STATIC void
+STATIC void ASC_INIT
AdvResetChip(ADV_DVC_VAR *asc_dvc)
-)
{
AdvPortAddr iop_base;
ushort word;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)