aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/advansys.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/scsi/advansys.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/scsi/advansys.c')
-rw-r--r--drivers/scsi/advansys.c153
1 files changed, 78 insertions, 75 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index dcfaee66a8b..bfd618a6949 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -41,6 +41,7 @@
41#include <linux/firmware.h> 41#include <linux/firmware.h>
42 42
43#include <asm/io.h> 43#include <asm/io.h>
44#include <asm/system.h>
44#include <asm/dma.h> 45#include <asm/dma.h>
45 46
46#include <scsi/scsi_cmnd.h> 47#include <scsi/scsi_cmnd.h>
@@ -9526,7 +9527,7 @@ advansys_queuecommand_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *
9526 9527
9527static DEF_SCSI_QCMD(advansys_queuecommand) 9528static DEF_SCSI_QCMD(advansys_queuecommand)
9528 9529
9529static ushort AscGetEisaChipCfg(PortAddr iop_base) 9530static ushort __devinit AscGetEisaChipCfg(PortAddr iop_base)
9530{ 9531{
9531 PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | 9532 PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) |
9532 (PortAddr) (ASC_EISA_CFG_IOP_MASK); 9533 (PortAddr) (ASC_EISA_CFG_IOP_MASK);
@@ -9537,8 +9538,8 @@ static ushort AscGetEisaChipCfg(PortAddr iop_base)
9537 * Return the BIOS address of the adapter at the specified 9538 * Return the BIOS address of the adapter at the specified
9538 * I/O port and with the specified bus type. 9539 * I/O port and with the specified bus type.
9539 */ 9540 */
9540static unsigned short AscGetChipBiosAddress(PortAddr iop_base, 9541static unsigned short __devinit
9541 unsigned short bus_type) 9542AscGetChipBiosAddress(PortAddr iop_base, unsigned short bus_type)
9542{ 9543{
9543 unsigned short cfg_lsw; 9544 unsigned short cfg_lsw;
9544 unsigned short bios_addr; 9545 unsigned short bios_addr;
@@ -9569,7 +9570,7 @@ static unsigned short AscGetChipBiosAddress(PortAddr iop_base,
9569 return bios_addr; 9570 return bios_addr;
9570} 9571}
9571 9572
9572static uchar AscSetChipScsiID(PortAddr iop_base, uchar new_host_id) 9573static uchar __devinit AscSetChipScsiID(PortAddr iop_base, uchar new_host_id)
9573{ 9574{
9574 ushort cfg_lsw; 9575 ushort cfg_lsw;
9575 9576
@@ -9583,7 +9584,7 @@ static uchar AscSetChipScsiID(PortAddr iop_base, uchar new_host_id)
9583 return (AscGetChipScsiID(iop_base)); 9584 return (AscGetChipScsiID(iop_base));
9584} 9585}
9585 9586
9586static unsigned char AscGetChipScsiCtrl(PortAddr iop_base) 9587static unsigned char __devinit AscGetChipScsiCtrl(PortAddr iop_base)
9587{ 9588{
9588 unsigned char sc; 9589 unsigned char sc;
9589 9590
@@ -9593,8 +9594,8 @@ static unsigned char AscGetChipScsiCtrl(PortAddr iop_base)
9593 return sc; 9594 return sc;
9594} 9595}
9595 9596
9596static unsigned char AscGetChipVersion(PortAddr iop_base, 9597static unsigned char __devinit
9597 unsigned short bus_type) 9598AscGetChipVersion(PortAddr iop_base, unsigned short bus_type)
9598{ 9599{
9599 if (bus_type & ASC_IS_EISA) { 9600 if (bus_type & ASC_IS_EISA) {
9600 PortAddr eisa_iop; 9601 PortAddr eisa_iop;
@@ -9608,7 +9609,7 @@ static unsigned char AscGetChipVersion(PortAddr iop_base,
9608} 9609}
9609 9610
9610#ifdef CONFIG_ISA 9611#ifdef CONFIG_ISA
9611static void AscEnableIsaDma(uchar dma_channel) 9612static void __devinit AscEnableIsaDma(uchar dma_channel)
9612{ 9613{
9613 if (dma_channel < 4) { 9614 if (dma_channel < 4) {
9614 outp(0x000B, (ushort)(0xC0 | dma_channel)); 9615 outp(0x000B, (ushort)(0xC0 | dma_channel));
@@ -9638,7 +9639,7 @@ static int AscStopQueueExe(PortAddr iop_base)
9638 return (0); 9639 return (0);
9639} 9640}
9640 9641
9641static ASC_DCNT AscGetMaxDmaCount(ushort bus_type) 9642static ASC_DCNT __devinit AscGetMaxDmaCount(ushort bus_type)
9642{ 9643{
9643 if (bus_type & ASC_IS_ISA) 9644 if (bus_type & ASC_IS_ISA)
9644 return ASC_MAX_ISA_DMA_COUNT; 9645 return ASC_MAX_ISA_DMA_COUNT;
@@ -9648,7 +9649,7 @@ static ASC_DCNT AscGetMaxDmaCount(ushort bus_type)
9648} 9649}
9649 9650
9650#ifdef CONFIG_ISA 9651#ifdef CONFIG_ISA
9651static ushort AscGetIsaDmaChannel(PortAddr iop_base) 9652static ushort __devinit AscGetIsaDmaChannel(PortAddr iop_base)
9652{ 9653{
9653 ushort channel; 9654 ushort channel;
9654 9655
@@ -9660,7 +9661,7 @@ static ushort AscGetIsaDmaChannel(PortAddr iop_base)
9660 return (channel + 4); 9661 return (channel + 4);
9661} 9662}
9662 9663
9663static ushort AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel) 9664static ushort __devinit AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel)
9664{ 9665{
9665 ushort cfg_lsw; 9666 ushort cfg_lsw;
9666 uchar value; 9667 uchar value;
@@ -9678,7 +9679,7 @@ static ushort AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel)
9678 return 0; 9679 return 0;
9679} 9680}
9680 9681
9681static uchar AscGetIsaDmaSpeed(PortAddr iop_base) 9682static uchar __devinit AscGetIsaDmaSpeed(PortAddr iop_base)
9682{ 9683{
9683 uchar speed_value; 9684 uchar speed_value;
9684 9685
@@ -9689,7 +9690,7 @@ static uchar AscGetIsaDmaSpeed(PortAddr iop_base)
9689 return speed_value; 9690 return speed_value;
9690} 9691}
9691 9692
9692static uchar AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value) 9693static uchar __devinit AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value)
9693{ 9694{
9694 speed_value &= 0x07; 9695 speed_value &= 0x07;
9695 AscSetBank(iop_base, 1); 9696 AscSetBank(iop_base, 1);
@@ -9699,7 +9700,7 @@ static uchar AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value)
9699} 9700}
9700#endif /* CONFIG_ISA */ 9701#endif /* CONFIG_ISA */
9701 9702
9702static ushort AscInitAscDvcVar(ASC_DVC_VAR *asc_dvc) 9703static ushort __devinit AscInitAscDvcVar(ASC_DVC_VAR *asc_dvc)
9703{ 9704{
9704 int i; 9705 int i;
9705 PortAddr iop_base; 9706 PortAddr iop_base;
@@ -9786,7 +9787,7 @@ static ushort AscInitAscDvcVar(ASC_DVC_VAR *asc_dvc)
9786 return warn_code; 9787 return warn_code;
9787} 9788}
9788 9789
9789static int AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg) 9790static int __devinit AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg)
9790{ 9791{
9791 int retry; 9792 int retry;
9792 9793
@@ -9801,12 +9802,12 @@ static int AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg)
9801 return 0; 9802 return 0;
9802} 9803}
9803 9804
9804static void AscWaitEEPRead(void) 9805static void __devinit AscWaitEEPRead(void)
9805{ 9806{
9806 mdelay(1); 9807 mdelay(1);
9807} 9808}
9808 9809
9809static ushort AscReadEEPWord(PortAddr iop_base, uchar addr) 9810static ushort __devinit AscReadEEPWord(PortAddr iop_base, uchar addr)
9810{ 9811{
9811 ushort read_wval; 9812 ushort read_wval;
9812 uchar cmd_reg; 9813 uchar cmd_reg;
@@ -9821,8 +9822,8 @@ static ushort AscReadEEPWord(PortAddr iop_base, uchar addr)
9821 return read_wval; 9822 return read_wval;
9822} 9823}
9823 9824
9824static ushort AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, 9825static ushort __devinit
9825 ushort bus_type) 9826AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type)
9826{ 9827{
9827 ushort wval; 9828 ushort wval;
9828 ushort sum; 9829 ushort sum;
@@ -9868,7 +9869,7 @@ static ushort AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf,
9868 return sum; 9869 return sum;
9869} 9870}
9870 9871
9871static int AscTestExternalLram(ASC_DVC_VAR *asc_dvc) 9872static int __devinit AscTestExternalLram(ASC_DVC_VAR *asc_dvc)
9872{ 9873{
9873 PortAddr iop_base; 9874 PortAddr iop_base;
9874 ushort q_addr; 9875 ushort q_addr;
@@ -9890,12 +9891,12 @@ static int AscTestExternalLram(ASC_DVC_VAR *asc_dvc)
9890 return (sta); 9891 return (sta);
9891} 9892}
9892 9893
9893static void AscWaitEEPWrite(void) 9894static void __devinit AscWaitEEPWrite(void)
9894{ 9895{
9895 mdelay(20); 9896 mdelay(20);
9896} 9897}
9897 9898
9898static int AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg) 9899static int __devinit AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg)
9899{ 9900{
9900 ushort read_back; 9901 ushort read_back;
9901 int retry; 9902 int retry;
@@ -9914,7 +9915,8 @@ static int AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg)
9914 } 9915 }
9915} 9916}
9916 9917
9917static ushort AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val) 9918static ushort __devinit
9919AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val)
9918{ 9920{
9919 ushort read_wval; 9921 ushort read_wval;
9920 9922
@@ -9934,8 +9936,8 @@ static ushort AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val)
9934 return (read_wval); 9936 return (read_wval);
9935} 9937}
9936 9938
9937static int AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, 9939static int __devinit
9938 ushort bus_type) 9940AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type)
9939{ 9941{
9940 int n_error; 9942 int n_error;
9941 ushort *wbuf; 9943 ushort *wbuf;
@@ -10030,8 +10032,8 @@ static int AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf,
10030 return n_error; 10032 return n_error;
10031} 10033}
10032 10034
10033static int AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, 10035static int __devinit
10034 ushort bus_type) 10036AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, ushort bus_type)
10035{ 10037{
10036 int retry; 10038 int retry;
10037 int n_error; 10039 int n_error;
@@ -10049,7 +10051,7 @@ static int AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf,
10049 return n_error; 10051 return n_error;
10050} 10052}
10051 10053
10052static ushort AscInitFromEEP(ASC_DVC_VAR *asc_dvc) 10054static ushort __devinit AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
10053{ 10055{
10054 ASCEEP_CONFIG eep_config_buf; 10056 ASCEEP_CONFIG eep_config_buf;
10055 ASCEEP_CONFIG *eep_config; 10057 ASCEEP_CONFIG *eep_config;
@@ -10214,7 +10216,7 @@ static ushort AscInitFromEEP(ASC_DVC_VAR *asc_dvc)
10214 return (warn_code); 10216 return (warn_code);
10215} 10217}
10216 10218
10217static int AscInitGetConfig(struct Scsi_Host *shost) 10219static int __devinit AscInitGetConfig(struct Scsi_Host *shost)
10218{ 10220{
10219 struct asc_board *board = shost_priv(shost); 10221 struct asc_board *board = shost_priv(shost);
10220 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var; 10222 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var;
@@ -10268,7 +10270,7 @@ static int AscInitGetConfig(struct Scsi_Host *shost)
10268 return asc_dvc->err_code; 10270 return asc_dvc->err_code;
10269} 10271}
10270 10272
10271static int AscInitSetConfig(struct pci_dev *pdev, struct Scsi_Host *shost) 10273static int __devinit AscInitSetConfig(struct pci_dev *pdev, struct Scsi_Host *shost)
10272{ 10274{
10273 struct asc_board *board = shost_priv(shost); 10275 struct asc_board *board = shost_priv(shost);
10274 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var; 10276 ASC_DVC_VAR *asc_dvc = &board->dvc_var.asc_dvc_var;
@@ -10382,7 +10384,7 @@ static int AscInitSetConfig(struct pci_dev *pdev, struct Scsi_Host *shost)
10382 * on big-endian platforms so char fields read as words are actually being 10384 * on big-endian platforms so char fields read as words are actually being
10383 * unswapped on big-endian platforms. 10385 * unswapped on big-endian platforms.
10384 */ 10386 */
10385static ADVEEP_3550_CONFIG Default_3550_EEPROM_Config = { 10387static ADVEEP_3550_CONFIG Default_3550_EEPROM_Config __devinitdata = {
10386 ADV_EEPROM_BIOS_ENABLE, /* cfg_lsw */ 10388 ADV_EEPROM_BIOS_ENABLE, /* cfg_lsw */
10387 0x0000, /* cfg_msw */ 10389 0x0000, /* cfg_msw */
10388 0xFFFF, /* disc_enable */ 10390 0xFFFF, /* disc_enable */
@@ -10420,7 +10422,7 @@ static ADVEEP_3550_CONFIG Default_3550_EEPROM_Config = {
10420 0 /* num_of_err */ 10422 0 /* num_of_err */
10421}; 10423};
10422 10424
10423static ADVEEP_3550_CONFIG ADVEEP_3550_Config_Field_IsChar = { 10425static ADVEEP_3550_CONFIG ADVEEP_3550_Config_Field_IsChar __devinitdata = {
10424 0, /* cfg_lsw */ 10426 0, /* cfg_lsw */
10425 0, /* cfg_msw */ 10427 0, /* cfg_msw */
10426 0, /* -disc_enable */ 10428 0, /* -disc_enable */
@@ -10458,7 +10460,7 @@ static ADVEEP_3550_CONFIG ADVEEP_3550_Config_Field_IsChar = {
10458 0 /* num_of_err */ 10460 0 /* num_of_err */
10459}; 10461};
10460 10462
10461static ADVEEP_38C0800_CONFIG Default_38C0800_EEPROM_Config = { 10463static ADVEEP_38C0800_CONFIG Default_38C0800_EEPROM_Config __devinitdata = {
10462 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */ 10464 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */
10463 0x0000, /* 01 cfg_msw */ 10465 0x0000, /* 01 cfg_msw */
10464 0xFFFF, /* 02 disc_enable */ 10466 0xFFFF, /* 02 disc_enable */
@@ -10523,7 +10525,7 @@ static ADVEEP_38C0800_CONFIG Default_38C0800_EEPROM_Config = {
10523 0 /* 63 reserved */ 10525 0 /* 63 reserved */
10524}; 10526};
10525 10527
10526static ADVEEP_38C0800_CONFIG ADVEEP_38C0800_Config_Field_IsChar = { 10528static ADVEEP_38C0800_CONFIG ADVEEP_38C0800_Config_Field_IsChar __devinitdata = {
10527 0, /* 00 cfg_lsw */ 10529 0, /* 00 cfg_lsw */
10528 0, /* 01 cfg_msw */ 10530 0, /* 01 cfg_msw */
10529 0, /* 02 disc_enable */ 10531 0, /* 02 disc_enable */
@@ -10588,7 +10590,7 @@ static ADVEEP_38C0800_CONFIG ADVEEP_38C0800_Config_Field_IsChar = {
10588 0 /* 63 reserved */ 10590 0 /* 63 reserved */
10589}; 10591};
10590 10592
10591static ADVEEP_38C1600_CONFIG Default_38C1600_EEPROM_Config = { 10593static ADVEEP_38C1600_CONFIG Default_38C1600_EEPROM_Config __devinitdata = {
10592 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */ 10594 ADV_EEPROM_BIOS_ENABLE, /* 00 cfg_lsw */
10593 0x0000, /* 01 cfg_msw */ 10595 0x0000, /* 01 cfg_msw */
10594 0xFFFF, /* 02 disc_enable */ 10596 0xFFFF, /* 02 disc_enable */
@@ -10653,7 +10655,7 @@ static ADVEEP_38C1600_CONFIG Default_38C1600_EEPROM_Config = {
10653 0 /* 63 reserved */ 10655 0 /* 63 reserved */
10654}; 10656};
10655 10657
10656static ADVEEP_38C1600_CONFIG ADVEEP_38C1600_Config_Field_IsChar = { 10658static ADVEEP_38C1600_CONFIG ADVEEP_38C1600_Config_Field_IsChar __devinitdata = {
10657 0, /* 00 cfg_lsw */ 10659 0, /* 00 cfg_lsw */
10658 0, /* 01 cfg_msw */ 10660 0, /* 01 cfg_msw */
10659 0, /* 02 disc_enable */ 10661 0, /* 02 disc_enable */
@@ -10722,7 +10724,7 @@ static ADVEEP_38C1600_CONFIG ADVEEP_38C1600_Config_Field_IsChar = {
10722/* 10724/*
10723 * Wait for EEPROM command to complete 10725 * Wait for EEPROM command to complete
10724 */ 10726 */
10725static void AdvWaitEEPCmd(AdvPortAddr iop_base) 10727static void __devinit AdvWaitEEPCmd(AdvPortAddr iop_base)
10726{ 10728{
10727 int eep_delay_ms; 10729 int eep_delay_ms;
10728 10730
@@ -10741,7 +10743,7 @@ static void AdvWaitEEPCmd(AdvPortAddr iop_base)
10741/* 10743/*
10742 * Read the EEPROM from specified location 10744 * Read the EEPROM from specified location
10743 */ 10745 */
10744static ushort AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr) 10746static ushort __devinit AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr)
10745{ 10747{
10746 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, 10748 AdvWriteWordRegister(iop_base, IOPW_EE_CMD,
10747 ASC_EEP_CMD_READ | eep_word_addr); 10749 ASC_EEP_CMD_READ | eep_word_addr);
@@ -10752,8 +10754,8 @@ static ushort AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr)
10752/* 10754/*
10753 * Write the EEPROM from 'cfg_buf'. 10755 * Write the EEPROM from 'cfg_buf'.
10754 */ 10756 */
10755static void AdvSet3550EEPConfig(AdvPortAddr iop_base, 10757static void __devinit
10756 ADVEEP_3550_CONFIG *cfg_buf) 10758AdvSet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf)
10757{ 10759{
10758 ushort *wbuf; 10760 ushort *wbuf;
10759 ushort addr, chksum; 10761 ushort addr, chksum;
@@ -10819,8 +10821,8 @@ static void AdvSet3550EEPConfig(AdvPortAddr iop_base,
10819/* 10821/*
10820 * Write the EEPROM from 'cfg_buf'. 10822 * Write the EEPROM from 'cfg_buf'.
10821 */ 10823 */
10822static void AdvSet38C0800EEPConfig(AdvPortAddr iop_base, 10824static void __devinit
10823 ADVEEP_38C0800_CONFIG *cfg_buf) 10825AdvSet38C0800EEPConfig(AdvPortAddr iop_base, ADVEEP_38C0800_CONFIG *cfg_buf)
10824{ 10826{
10825 ushort *wbuf; 10827 ushort *wbuf;
10826 ushort *charfields; 10828 ushort *charfields;
@@ -10886,8 +10888,8 @@ static void AdvSet38C0800EEPConfig(AdvPortAddr iop_base,
10886/* 10888/*
10887 * Write the EEPROM from 'cfg_buf'. 10889 * Write the EEPROM from 'cfg_buf'.
10888 */ 10890 */
10889static void AdvSet38C1600EEPConfig(AdvPortAddr iop_base, 10891static void __devinit
10890 ADVEEP_38C1600_CONFIG *cfg_buf) 10892AdvSet38C1600EEPConfig(AdvPortAddr iop_base, ADVEEP_38C1600_CONFIG *cfg_buf)
10891{ 10893{
10892 ushort *wbuf; 10894 ushort *wbuf;
10893 ushort *charfields; 10895 ushort *charfields;
@@ -10955,8 +10957,8 @@ static void AdvSet38C1600EEPConfig(AdvPortAddr iop_base,
10955 * 10957 *
10956 * Return a checksum based on the EEPROM configuration read. 10958 * Return a checksum based on the EEPROM configuration read.
10957 */ 10959 */
10958static ushort AdvGet3550EEPConfig(AdvPortAddr iop_base, 10960static ushort __devinit
10959 ADVEEP_3550_CONFIG *cfg_buf) 10961AdvGet3550EEPConfig(AdvPortAddr iop_base, ADVEEP_3550_CONFIG *cfg_buf)
10960{ 10962{
10961 ushort wval, chksum; 10963 ushort wval, chksum;
10962 ushort *wbuf; 10964 ushort *wbuf;
@@ -10998,8 +11000,8 @@ static ushort AdvGet3550EEPConfig(AdvPortAddr iop_base,
10998 * 11000 *
10999 * Return a checksum based on the EEPROM configuration read. 11001 * Return a checksum based on the EEPROM configuration read.
11000 */ 11002 */
11001static ushort AdvGet38C0800EEPConfig(AdvPortAddr iop_base, 11003static ushort __devinit
11002 ADVEEP_38C0800_CONFIG *cfg_buf) 11004AdvGet38C0800EEPConfig(AdvPortAddr iop_base, ADVEEP_38C0800_CONFIG *cfg_buf)
11003{ 11005{
11004 ushort wval, chksum; 11006 ushort wval, chksum;
11005 ushort *wbuf; 11007 ushort *wbuf;
@@ -11041,8 +11043,8 @@ static ushort AdvGet38C0800EEPConfig(AdvPortAddr iop_base,
11041 * 11043 *
11042 * Return a checksum based on the EEPROM configuration read. 11044 * Return a checksum based on the EEPROM configuration read.
11043 */ 11045 */
11044static ushort AdvGet38C1600EEPConfig(AdvPortAddr iop_base, 11046static ushort __devinit
11045 ADVEEP_38C1600_CONFIG *cfg_buf) 11047AdvGet38C1600EEPConfig(AdvPortAddr iop_base, ADVEEP_38C1600_CONFIG *cfg_buf)
11046{ 11048{
11047 ushort wval, chksum; 11049 ushort wval, chksum;
11048 ushort *wbuf; 11050 ushort *wbuf;
@@ -11091,7 +11093,7 @@ static ushort AdvGet38C1600EEPConfig(AdvPortAddr iop_base,
11091 * 11093 *
11092 * Note: Chip is stopped on entry. 11094 * Note: Chip is stopped on entry.
11093 */ 11095 */
11094static int AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc) 11096static int __devinit AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc)
11095{ 11097{
11096 AdvPortAddr iop_base; 11098 AdvPortAddr iop_base;
11097 ushort warn_code; 11099 ushort warn_code;
@@ -11241,7 +11243,7 @@ static int AdvInitFrom3550EEP(ADV_DVC_VAR *asc_dvc)
11241 * 11243 *
11242 * Note: Chip is stopped on entry. 11244 * Note: Chip is stopped on entry.
11243 */ 11245 */
11244static int AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc) 11246static int __devinit AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc)
11245{ 11247{
11246 AdvPortAddr iop_base; 11248 AdvPortAddr iop_base;
11247 ushort warn_code; 11249 ushort warn_code;
@@ -11440,7 +11442,7 @@ static int AdvInitFrom38C0800EEP(ADV_DVC_VAR *asc_dvc)
11440 * 11442 *
11441 * Note: Chip is stopped on entry. 11443 * Note: Chip is stopped on entry.
11442 */ 11444 */
11443static int AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc) 11445static int __devinit AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
11444{ 11446{
11445 AdvPortAddr iop_base; 11447 AdvPortAddr iop_base;
11446 ushort warn_code; 11448 ushort warn_code;
@@ -11660,7 +11662,8 @@ static int AdvInitFrom38C1600EEP(ADV_DVC_VAR *asc_dvc)
11660 * For a non-fatal error return a warning code. If there are no warnings 11662 * For a non-fatal error return a warning code. If there are no warnings
11661 * then 0 is returned. 11663 * then 0 is returned.
11662 */ 11664 */
11663static int AdvInitGetConfig(struct pci_dev *pdev, struct Scsi_Host *shost) 11665static int __devinit
11666AdvInitGetConfig(struct pci_dev *pdev, struct Scsi_Host *shost)
11664{ 11667{
11665 struct asc_board *board = shost_priv(shost); 11668 struct asc_board *board = shost_priv(shost);
11666 ADV_DVC_VAR *asc_dvc = &board->dvc_var.adv_dvc_var; 11669 ADV_DVC_VAR *asc_dvc = &board->dvc_var.adv_dvc_var;
@@ -11767,7 +11770,7 @@ static struct scsi_host_template advansys_template = {
11767 .use_clustering = ENABLE_CLUSTERING, 11770 .use_clustering = ENABLE_CLUSTERING,
11768}; 11771};
11769 11772
11770static int advansys_wide_init_chip(struct Scsi_Host *shost) 11773static int __devinit advansys_wide_init_chip(struct Scsi_Host *shost)
11771{ 11774{
11772 struct asc_board *board = shost_priv(shost); 11775 struct asc_board *board = shost_priv(shost);
11773 struct adv_dvc_var *adv_dvc = &board->dvc_var.adv_dvc_var; 11776 struct adv_dvc_var *adv_dvc = &board->dvc_var.adv_dvc_var;
@@ -11880,8 +11883,8 @@ static void advansys_wide_free_mem(struct asc_board *board)
11880 } 11883 }
11881} 11884}
11882 11885
11883static int advansys_board_found(struct Scsi_Host *shost, unsigned int iop, 11886static int __devinit advansys_board_found(struct Scsi_Host *shost,
11884 int bus_type) 11887 unsigned int iop, int bus_type)
11885{ 11888{
11886 struct pci_dev *pdev; 11889 struct pci_dev *pdev;
11887 struct asc_board *boardp = shost_priv(shost); 11890 struct asc_board *boardp = shost_priv(shost);
@@ -12426,7 +12429,7 @@ static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] = {
12426 * 10: 12 12429 * 10: 12
12427 * 11: 15 12430 * 11: 15
12428 */ 12431 */
12429static unsigned int advansys_isa_irq_no(PortAddr iop_base) 12432static unsigned int __devinit advansys_isa_irq_no(PortAddr iop_base)
12430{ 12433{
12431 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); 12434 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base);
12432 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x03) + 10; 12435 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x03) + 10;
@@ -12435,7 +12438,7 @@ static unsigned int advansys_isa_irq_no(PortAddr iop_base)
12435 return chip_irq; 12438 return chip_irq;
12436} 12439}
12437 12440
12438static int advansys_isa_probe(struct device *dev, unsigned int id) 12441static int __devinit advansys_isa_probe(struct device *dev, unsigned int id)
12439{ 12442{
12440 int err = -ENODEV; 12443 int err = -ENODEV;
12441 PortAddr iop_base = _asc_def_iop_base[id]; 12444 PortAddr iop_base = _asc_def_iop_base[id];
@@ -12475,7 +12478,7 @@ static int advansys_isa_probe(struct device *dev, unsigned int id)
12475 return err; 12478 return err;
12476} 12479}
12477 12480
12478static int advansys_isa_remove(struct device *dev, unsigned int id) 12481static int __devexit advansys_isa_remove(struct device *dev, unsigned int id)
12479{ 12482{
12480 int ioport = _asc_def_iop_base[id]; 12483 int ioport = _asc_def_iop_base[id];
12481 advansys_release(dev_get_drvdata(dev)); 12484 advansys_release(dev_get_drvdata(dev));
@@ -12485,7 +12488,7 @@ static int advansys_isa_remove(struct device *dev, unsigned int id)
12485 12488
12486static struct isa_driver advansys_isa_driver = { 12489static struct isa_driver advansys_isa_driver = {
12487 .probe = advansys_isa_probe, 12490 .probe = advansys_isa_probe,
12488 .remove = advansys_isa_remove, 12491 .remove = __devexit_p(advansys_isa_remove),
12489 .driver = { 12492 .driver = {
12490 .owner = THIS_MODULE, 12493 .owner = THIS_MODULE,
12491 .name = DRV_NAME, 12494 .name = DRV_NAME,
@@ -12503,7 +12506,7 @@ static struct isa_driver advansys_isa_driver = {
12503 * 110: 15 12506 * 110: 15
12504 * 111: invalid 12507 * 111: invalid
12505 */ 12508 */
12506static unsigned int advansys_vlb_irq_no(PortAddr iop_base) 12509static unsigned int __devinit advansys_vlb_irq_no(PortAddr iop_base)
12507{ 12510{
12508 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); 12511 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base);
12509 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x07) + 9; 12512 unsigned int chip_irq = ((cfg_lsw >> 2) & 0x07) + 9;
@@ -12512,7 +12515,7 @@ static unsigned int advansys_vlb_irq_no(PortAddr iop_base)
12512 return chip_irq; 12515 return chip_irq;
12513} 12516}
12514 12517
12515static int advansys_vlb_probe(struct device *dev, unsigned int id) 12518static int __devinit advansys_vlb_probe(struct device *dev, unsigned int id)
12516{ 12519{
12517 int err = -ENODEV; 12520 int err = -ENODEV;
12518 PortAddr iop_base = _asc_def_iop_base[id]; 12521 PortAddr iop_base = _asc_def_iop_base[id];
@@ -12559,14 +12562,14 @@ static int advansys_vlb_probe(struct device *dev, unsigned int id)
12559 12562
12560static struct isa_driver advansys_vlb_driver = { 12563static struct isa_driver advansys_vlb_driver = {
12561 .probe = advansys_vlb_probe, 12564 .probe = advansys_vlb_probe,
12562 .remove = advansys_isa_remove, 12565 .remove = __devexit_p(advansys_isa_remove),
12563 .driver = { 12566 .driver = {
12564 .owner = THIS_MODULE, 12567 .owner = THIS_MODULE,
12565 .name = "advansys_vlb", 12568 .name = "advansys_vlb",
12566 }, 12569 },
12567}; 12570};
12568 12571
12569static struct eisa_device_id advansys_eisa_table[] = { 12572static struct eisa_device_id advansys_eisa_table[] __devinitdata = {
12570 { "ABP7401" }, 12573 { "ABP7401" },
12571 { "ABP7501" }, 12574 { "ABP7501" },
12572 { "" } 12575 { "" }
@@ -12593,7 +12596,7 @@ struct eisa_scsi_data {
12593 * 110: invalid 12596 * 110: invalid
12594 * 111: invalid 12597 * 111: invalid
12595 */ 12598 */
12596static unsigned int advansys_eisa_irq_no(struct eisa_device *edev) 12599static unsigned int __devinit advansys_eisa_irq_no(struct eisa_device *edev)
12597{ 12600{
12598 unsigned short cfg_lsw = inw(edev->base_addr + 0xc86); 12601 unsigned short cfg_lsw = inw(edev->base_addr + 0xc86);
12599 unsigned int chip_irq = ((cfg_lsw >> 8) & 0x07) + 10; 12602 unsigned int chip_irq = ((cfg_lsw >> 8) & 0x07) + 10;
@@ -12602,7 +12605,7 @@ static unsigned int advansys_eisa_irq_no(struct eisa_device *edev)
12602 return chip_irq; 12605 return chip_irq;
12603} 12606}
12604 12607
12605static int advansys_eisa_probe(struct device *dev) 12608static int __devinit advansys_eisa_probe(struct device *dev)
12606{ 12609{
12607 int i, ioport, irq = 0; 12610 int i, ioport, irq = 0;
12608 int err; 12611 int err;
@@ -12675,7 +12678,7 @@ static int advansys_eisa_probe(struct device *dev)
12675 return err; 12678 return err;
12676} 12679}
12677 12680
12678static int advansys_eisa_remove(struct device *dev) 12681static __devexit int advansys_eisa_remove(struct device *dev)
12679{ 12682{
12680 int i; 12683 int i;
12681 struct eisa_scsi_data *data = dev_get_drvdata(dev); 12684 struct eisa_scsi_data *data = dev_get_drvdata(dev);
@@ -12699,12 +12702,12 @@ static struct eisa_driver advansys_eisa_driver = {
12699 .driver = { 12702 .driver = {
12700 .name = DRV_NAME, 12703 .name = DRV_NAME,
12701 .probe = advansys_eisa_probe, 12704 .probe = advansys_eisa_probe,
12702 .remove = advansys_eisa_remove, 12705 .remove = __devexit_p(advansys_eisa_remove),
12703 } 12706 }
12704}; 12707};
12705 12708
12706/* PCI Devices supported by this driver */ 12709/* PCI Devices supported by this driver */
12707static struct pci_device_id advansys_pci_tbl[] = { 12710static struct pci_device_id advansys_pci_tbl[] __devinitdata = {
12708 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A, 12711 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A,
12709 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 12712 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
12710 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940, 12713 {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940,
@@ -12722,7 +12725,7 @@ static struct pci_device_id advansys_pci_tbl[] = {
12722 12725
12723MODULE_DEVICE_TABLE(pci, advansys_pci_tbl); 12726MODULE_DEVICE_TABLE(pci, advansys_pci_tbl);
12724 12727
12725static void advansys_set_latency(struct pci_dev *pdev) 12728static void __devinit advansys_set_latency(struct pci_dev *pdev)
12726{ 12729{
12727 if ((pdev->device == PCI_DEVICE_ID_ASP_1200A) || 12730 if ((pdev->device == PCI_DEVICE_ID_ASP_1200A) ||
12728 (pdev->device == PCI_DEVICE_ID_ASP_ABP940)) { 12731 (pdev->device == PCI_DEVICE_ID_ASP_ABP940)) {
@@ -12735,8 +12738,8 @@ static void advansys_set_latency(struct pci_dev *pdev)
12735 } 12738 }
12736} 12739}
12737 12740
12738static int advansys_pci_probe(struct pci_dev *pdev, 12741static int __devinit
12739 const struct pci_device_id *ent) 12742advansys_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
12740{ 12743{
12741 int err, ioport; 12744 int err, ioport;
12742 struct Scsi_Host *shost; 12745 struct Scsi_Host *shost;
@@ -12789,7 +12792,7 @@ static int advansys_pci_probe(struct pci_dev *pdev,
12789 return err; 12792 return err;
12790} 12793}
12791 12794
12792static void advansys_pci_remove(struct pci_dev *pdev) 12795static void __devexit advansys_pci_remove(struct pci_dev *pdev)
12793{ 12796{
12794 advansys_release(pci_get_drvdata(pdev)); 12797 advansys_release(pci_get_drvdata(pdev));
12795 pci_release_regions(pdev); 12798 pci_release_regions(pdev);
@@ -12800,7 +12803,7 @@ static struct pci_driver advansys_pci_driver = {
12800 .name = DRV_NAME, 12803 .name = DRV_NAME,
12801 .id_table = advansys_pci_tbl, 12804 .id_table = advansys_pci_tbl,
12802 .probe = advansys_pci_probe, 12805 .probe = advansys_pci_probe,
12803 .remove = advansys_pci_remove, 12806 .remove = __devexit_p(advansys_pci_remove),
12804}; 12807};
12805 12808
12806static int __init advansys_init(void) 12809static int __init advansys_init(void)