aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dc395x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/dc395x.c')
-rw-r--r--drivers/scsi/dc395x.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 13aeca3d51f2..865c64fa923c 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -489,7 +489,7 @@ struct ParameterData {
489 int def; /* default value */ 489 int def; /* default value */
490 int safe; /* safe value */ 490 int safe; /* safe value */
491}; 491};
492static struct ParameterData __devinitdata cfg_data[] = { 492static struct ParameterData cfg_data[] = {
493 { /* adapter id */ 493 { /* adapter id */
494 CFG_PARAM_UNSET, 494 CFG_PARAM_UNSET,
495 0, 495 0,
@@ -574,7 +574,7 @@ MODULE_PARM_DESC(reset_delay, "Reset delay in seconds. Default 1 (0-180)");
574 * set_safe_settings - if the use_safe_settings option is set then 574 * set_safe_settings - if the use_safe_settings option is set then
575 * set all values to the safe and slow values. 575 * set all values to the safe and slow values.
576 **/ 576 **/
577static void __devinit set_safe_settings(void) 577static void set_safe_settings(void)
578{ 578{
579 if (use_safe_settings) 579 if (use_safe_settings)
580 { 580 {
@@ -593,7 +593,7 @@ static void __devinit set_safe_settings(void)
593 * fix_settings - reset any boot parameters which are out of range 593 * fix_settings - reset any boot parameters which are out of range
594 * back to the default values. 594 * back to the default values.
595 **/ 595 **/
596static void __devinit fix_settings(void) 596static void fix_settings(void)
597{ 597{
598 int i; 598 int i;
599 599
@@ -620,7 +620,7 @@ static void __devinit fix_settings(void)
620 * Mapping from the eeprom delay index value (index into this array) 620 * Mapping from the eeprom delay index value (index into this array)
621 * to the number of actual seconds that the delay should be for. 621 * to the number of actual seconds that the delay should be for.
622 */ 622 */
623static char __devinitdata eeprom_index_to_delay_map[] = 623static char eeprom_index_to_delay_map[] =
624 { 1, 3, 5, 10, 16, 30, 60, 120 }; 624 { 1, 3, 5, 10, 16, 30, 60, 120 };
625 625
626 626
@@ -630,7 +630,7 @@ static char __devinitdata eeprom_index_to_delay_map[] =
630 * 630 *
631 * @eeprom: The eeprom structure in which we find the delay index to map. 631 * @eeprom: The eeprom structure in which we find the delay index to map.
632 **/ 632 **/
633static void __devinit eeprom_index_to_delay(struct NvRamType *eeprom) 633static void eeprom_index_to_delay(struct NvRamType *eeprom)
634{ 634{
635 eeprom->delay_time = eeprom_index_to_delay_map[eeprom->delay_time]; 635 eeprom->delay_time = eeprom_index_to_delay_map[eeprom->delay_time];
636} 636}
@@ -643,7 +643,7 @@ static void __devinit eeprom_index_to_delay(struct NvRamType *eeprom)
643 * 643 *
644 * @delay: The delay, in seconds, to find the eeprom index for. 644 * @delay: The delay, in seconds, to find the eeprom index for.
645 **/ 645 **/
646static int __devinit delay_to_eeprom_index(int delay) 646static int delay_to_eeprom_index(int delay)
647{ 647{
648 u8 idx = 0; 648 u8 idx = 0;
649 while (idx < 7 && eeprom_index_to_delay_map[idx] < delay) 649 while (idx < 7 && eeprom_index_to_delay_map[idx] < delay)
@@ -659,7 +659,7 @@ static int __devinit delay_to_eeprom_index(int delay)
659 * 659 *
660 * @eeprom: The eeprom data to override with command line options. 660 * @eeprom: The eeprom data to override with command line options.
661 **/ 661 **/
662static void __devinit eeprom_override(struct NvRamType *eeprom) 662static void eeprom_override(struct NvRamType *eeprom)
663{ 663{
664 u8 id; 664 u8 id;
665 665
@@ -3938,7 +3938,7 @@ static void dc395x_slave_destroy(struct scsi_device *scsi_device)
3938 * 3938 *
3939 * @io_port: base I/O address 3939 * @io_port: base I/O address
3940 **/ 3940 **/
3941static void __devinit trms1040_wait_30us(unsigned long io_port) 3941static void trms1040_wait_30us(unsigned long io_port)
3942{ 3942{
3943 /* ScsiPortStallExecution(30); wait 30 us */ 3943 /* ScsiPortStallExecution(30); wait 30 us */
3944 outb(5, io_port + TRM_S1040_GEN_TIMER); 3944 outb(5, io_port + TRM_S1040_GEN_TIMER);
@@ -3955,7 +3955,7 @@ static void __devinit trms1040_wait_30us(unsigned long io_port)
3955 * @cmd: SB + op code (command) to send 3955 * @cmd: SB + op code (command) to send
3956 * @addr: address to send 3956 * @addr: address to send
3957 **/ 3957 **/
3958static void __devinit trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr) 3958static void trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr)
3959{ 3959{
3960 int i; 3960 int i;
3961 u8 send_data; 3961 u8 send_data;
@@ -4000,7 +4000,7 @@ static void __devinit trms1040_write_cmd(unsigned long io_port, u8 cmd, u8 addr)
4000 * @addr: offset into EEPROM 4000 * @addr: offset into EEPROM
4001 * @byte: bytes to write 4001 * @byte: bytes to write
4002 **/ 4002 **/
4003static void __devinit trms1040_set_data(unsigned long io_port, u8 addr, u8 byte) 4003static void trms1040_set_data(unsigned long io_port, u8 addr, u8 byte)
4004{ 4004{
4005 int i; 4005 int i;
4006 u8 send_data; 4006 u8 send_data;
@@ -4054,7 +4054,7 @@ static void __devinit trms1040_set_data(unsigned long io_port, u8 addr, u8 byte)
4054 * @eeprom: the data to write 4054 * @eeprom: the data to write
4055 * @io_port: the base io port 4055 * @io_port: the base io port
4056 **/ 4056 **/
4057static void __devinit trms1040_write_all(struct NvRamType *eeprom, unsigned long io_port) 4057static void trms1040_write_all(struct NvRamType *eeprom, unsigned long io_port)
4058{ 4058{
4059 u8 *b_eeprom = (u8 *)eeprom; 4059 u8 *b_eeprom = (u8 *)eeprom;
4060 u8 addr; 4060 u8 addr;
@@ -4094,7 +4094,7 @@ static void __devinit trms1040_write_all(struct NvRamType *eeprom, unsigned long
4094 * 4094 *
4095 * Returns the byte read. 4095 * Returns the byte read.
4096 **/ 4096 **/
4097static u8 __devinit trms1040_get_data(unsigned long io_port, u8 addr) 4097static u8 trms1040_get_data(unsigned long io_port, u8 addr)
4098{ 4098{
4099 int i; 4099 int i;
4100 u8 read_byte; 4100 u8 read_byte;
@@ -4132,7 +4132,7 @@ static u8 __devinit trms1040_get_data(unsigned long io_port, u8 addr)
4132 * @eeprom: where to store the data 4132 * @eeprom: where to store the data
4133 * @io_port: the base io port 4133 * @io_port: the base io port
4134 **/ 4134 **/
4135static void __devinit trms1040_read_all(struct NvRamType *eeprom, unsigned long io_port) 4135static void trms1040_read_all(struct NvRamType *eeprom, unsigned long io_port)
4136{ 4136{
4137 u8 *b_eeprom = (u8 *)eeprom; 4137 u8 *b_eeprom = (u8 *)eeprom;
4138 u8 addr; 4138 u8 addr;
@@ -4162,7 +4162,7 @@ static void __devinit trms1040_read_all(struct NvRamType *eeprom, unsigned long
4162 * @eeprom: caller allocated strcuture to read the eeprom data into 4162 * @eeprom: caller allocated strcuture to read the eeprom data into
4163 * @io_port: io port to read from 4163 * @io_port: io port to read from
4164 **/ 4164 **/
4165static void __devinit check_eeprom(struct NvRamType *eeprom, unsigned long io_port) 4165static void check_eeprom(struct NvRamType *eeprom, unsigned long io_port)
4166{ 4166{
4167 u16 *w_eeprom = (u16 *)eeprom; 4167 u16 *w_eeprom = (u16 *)eeprom;
4168 u16 w_addr; 4168 u16 w_addr;
@@ -4232,7 +4232,7 @@ static void __devinit check_eeprom(struct NvRamType *eeprom, unsigned long io_po
4232 * 4232 *
4233 * @eeprom: The eeprom data strucutre to show details for. 4233 * @eeprom: The eeprom data strucutre to show details for.
4234 **/ 4234 **/
4235static void __devinit print_eeprom_settings(struct NvRamType *eeprom) 4235static void print_eeprom_settings(struct NvRamType *eeprom)
4236{ 4236{
4237 dprintkl(KERN_INFO, "Used settings: AdapterID=%02i, Speed=%i(%02i.%01iMHz), dev_mode=0x%02x\n", 4237 dprintkl(KERN_INFO, "Used settings: AdapterID=%02i, Speed=%i(%02i.%01iMHz), dev_mode=0x%02x\n",
4238 eeprom->scsi_id, 4238 eeprom->scsi_id,
@@ -4260,7 +4260,7 @@ static void adapter_sg_tables_free(struct AdapterCtlBlk *acb)
4260/* 4260/*
4261 * Allocate SG tables; as we have to pci_map them, an SG list (struct SGentry*) 4261 * Allocate SG tables; as we have to pci_map them, an SG list (struct SGentry*)
4262 * should never cross a page boundary */ 4262 * should never cross a page boundary */
4263static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) 4263static int adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)
4264{ 4264{
4265 const unsigned mem_needed = (DC395x_MAX_SRB_CNT+1) 4265 const unsigned mem_needed = (DC395x_MAX_SRB_CNT+1)
4266 *SEGMENTX_LEN; 4266 *SEGMENTX_LEN;
@@ -4306,7 +4306,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)
4306 * 4306 *
4307 * @acb: The adapter to print the information for. 4307 * @acb: The adapter to print the information for.
4308 **/ 4308 **/
4309static void __devinit adapter_print_config(struct AdapterCtlBlk *acb) 4309static void adapter_print_config(struct AdapterCtlBlk *acb)
4310{ 4310{
4311 u8 bval; 4311 u8 bval;
4312 4312
@@ -4350,7 +4350,7 @@ static void __devinit adapter_print_config(struct AdapterCtlBlk *acb)
4350 * 4350 *
4351 * @acb: The adapter to initialize. 4351 * @acb: The adapter to initialize.
4352 **/ 4352 **/
4353static void __devinit adapter_init_params(struct AdapterCtlBlk *acb) 4353static void adapter_init_params(struct AdapterCtlBlk *acb)
4354{ 4354{
4355 struct NvRamType *eeprom = &acb->eeprom; 4355 struct NvRamType *eeprom = &acb->eeprom;
4356 int i; 4356 int i;
@@ -4412,7 +4412,7 @@ static void __devinit adapter_init_params(struct AdapterCtlBlk *acb)
4412 * 4412 *
4413 * @host: The scsi host instance to fill in the values for. 4413 * @host: The scsi host instance to fill in the values for.
4414 **/ 4414 **/
4415static void __devinit adapter_init_scsi_host(struct Scsi_Host *host) 4415static void adapter_init_scsi_host(struct Scsi_Host *host)
4416{ 4416{
4417 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata; 4417 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)host->hostdata;
4418 struct NvRamType *eeprom = &acb->eeprom; 4418 struct NvRamType *eeprom = &acb->eeprom;
@@ -4453,7 +4453,7 @@ static void __devinit adapter_init_scsi_host(struct Scsi_Host *host)
4453 * 4453 *
4454 * @acb: The adapter which we are to init. 4454 * @acb: The adapter which we are to init.
4455 **/ 4455 **/
4456static void __devinit adapter_init_chip(struct AdapterCtlBlk *acb) 4456static void adapter_init_chip(struct AdapterCtlBlk *acb)
4457{ 4457{
4458 struct NvRamType *eeprom = &acb->eeprom; 4458 struct NvRamType *eeprom = &acb->eeprom;
4459 4459
@@ -4506,8 +4506,8 @@ static void __devinit adapter_init_chip(struct AdapterCtlBlk *acb)
4506 * Returns 0 if the initialization succeeds, any other value on 4506 * Returns 0 if the initialization succeeds, any other value on
4507 * failure. 4507 * failure.
4508 **/ 4508 **/
4509static int __devinit adapter_init(struct AdapterCtlBlk *acb, 4509static int adapter_init(struct AdapterCtlBlk *acb, unsigned long io_port,
4510 unsigned long io_port, u32 io_port_len, unsigned int irq) 4510 u32 io_port_len, unsigned int irq)
4511{ 4511{
4512 if (!request_region(io_port, io_port_len, DC395X_NAME)) { 4512 if (!request_region(io_port, io_port_len, DC395X_NAME)) {
4513 dprintkl(KERN_ERR, "Failed to reserve IO region 0x%lx\n", io_port); 4513 dprintkl(KERN_ERR, "Failed to reserve IO region 0x%lx\n", io_port);
@@ -4794,8 +4794,7 @@ static void banner_display(void)
4794 * 4794 *
4795 * Returns 0 on success, or an error code (-ve) on failure. 4795 * Returns 0 on success, or an error code (-ve) on failure.
4796 **/ 4796 **/
4797static int __devinit dc395x_init_one(struct pci_dev *dev, 4797static int dc395x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
4798 const struct pci_device_id *id)
4799{ 4798{
4800 struct Scsi_Host *scsi_host = NULL; 4799 struct Scsi_Host *scsi_host = NULL;
4801 struct AdapterCtlBlk *acb = NULL; 4800 struct AdapterCtlBlk *acb = NULL;
@@ -4861,7 +4860,7 @@ fail:
4861 * 4860 *
4862 * @dev: The PCI device to initialize. 4861 * @dev: The PCI device to initialize.
4863 **/ 4862 **/
4864static void __devexit dc395x_remove_one(struct pci_dev *dev) 4863static void dc395x_remove_one(struct pci_dev *dev)
4865{ 4864{
4866 struct Scsi_Host *scsi_host = pci_get_drvdata(dev); 4865 struct Scsi_Host *scsi_host = pci_get_drvdata(dev);
4867 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)(scsi_host->hostdata); 4866 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)(scsi_host->hostdata);
@@ -4892,7 +4891,7 @@ static struct pci_driver dc395x_driver = {
4892 .name = DC395X_NAME, 4891 .name = DC395X_NAME,
4893 .id_table = dc395x_pci_table, 4892 .id_table = dc395x_pci_table,
4894 .probe = dc395x_init_one, 4893 .probe = dc395x_init_one,
4895 .remove = __devexit_p(dc395x_remove_one), 4894 .remove = dc395x_remove_one,
4896}; 4895};
4897 4896
4898 4897