diff options
Diffstat (limited to 'drivers/scsi/aic94xx/aic94xx_hwi.c')
-rw-r--r-- | drivers/scsi/aic94xx/aic94xx_hwi.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.c b/drivers/scsi/aic94xx/aic94xx_hwi.c index 098b5f39cd31..83a78222896d 100644 --- a/drivers/scsi/aic94xx/aic94xx_hwi.c +++ b/drivers/scsi/aic94xx/aic94xx_hwi.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/pci.h> | 27 | #include <linux/pci.h> |
28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/firmware.h> | ||
30 | 31 | ||
31 | #include "aic94xx.h" | 32 | #include "aic94xx.h" |
32 | #include "aic94xx_reg.h" | 33 | #include "aic94xx_reg.h" |
@@ -38,16 +39,14 @@ u32 MBAR0_SWB_SIZE; | |||
38 | 39 | ||
39 | /* ---------- Initialization ---------- */ | 40 | /* ---------- Initialization ---------- */ |
40 | 41 | ||
41 | static void asd_get_user_sas_addr(struct asd_ha_struct *asd_ha) | 42 | static int asd_get_user_sas_addr(struct asd_ha_struct *asd_ha) |
42 | { | 43 | { |
43 | extern char sas_addr_str[]; | 44 | /* adapter came with a sas address */ |
44 | /* If the user has specified a WWN it overrides other settings | 45 | if (asd_ha->hw_prof.sas_addr[0]) |
45 | */ | 46 | return 0; |
46 | if (sas_addr_str[0] != '\0') | 47 | |
47 | asd_destringify_sas_addr(asd_ha->hw_prof.sas_addr, | 48 | return sas_request_addr(asd_ha->sas_ha.core.shost, |
48 | sas_addr_str); | 49 | asd_ha->hw_prof.sas_addr); |
49 | else if (asd_ha->hw_prof.sas_addr[0] != 0) | ||
50 | asd_stringify_sas_addr(sas_addr_str, asd_ha->hw_prof.sas_addr); | ||
51 | } | 50 | } |
52 | 51 | ||
53 | static void asd_propagate_sas_addr(struct asd_ha_struct *asd_ha) | 52 | static void asd_propagate_sas_addr(struct asd_ha_struct *asd_ha) |
@@ -251,7 +250,7 @@ static int asd_init_scbs(struct asd_ha_struct *asd_ha) | |||
251 | return 0; | 250 | return 0; |
252 | } | 251 | } |
253 | 252 | ||
254 | static inline void asd_get_max_scb_ddb(struct asd_ha_struct *asd_ha) | 253 | static void asd_get_max_scb_ddb(struct asd_ha_struct *asd_ha) |
255 | { | 254 | { |
256 | asd_ha->hw_prof.max_scbs = asd_get_cmdctx_size(asd_ha)/ASD_SCB_SIZE; | 255 | asd_ha->hw_prof.max_scbs = asd_get_cmdctx_size(asd_ha)/ASD_SCB_SIZE; |
257 | asd_ha->hw_prof.max_ddbs = asd_get_devctx_size(asd_ha)/ASD_DDB_SIZE; | 256 | asd_ha->hw_prof.max_ddbs = asd_get_devctx_size(asd_ha)/ASD_DDB_SIZE; |
@@ -657,8 +656,7 @@ int asd_init_hw(struct asd_ha_struct *asd_ha) | |||
657 | 656 | ||
658 | asd_init_ctxmem(asd_ha); | 657 | asd_init_ctxmem(asd_ha); |
659 | 658 | ||
660 | asd_get_user_sas_addr(asd_ha); | 659 | if (asd_get_user_sas_addr(asd_ha)) { |
661 | if (!asd_ha->hw_prof.sas_addr[0]) { | ||
662 | asd_printk("No SAS Address provided for %s\n", | 660 | asd_printk("No SAS Address provided for %s\n", |
663 | pci_name(asd_ha->pcidev)); | 661 | pci_name(asd_ha->pcidev)); |
664 | err = -ENODEV; | 662 | err = -ENODEV; |
@@ -773,7 +771,7 @@ static void asd_dl_tasklet_handler(unsigned long data) | |||
773 | * asd_process_donelist_isr -- schedule processing of done list entries | 771 | * asd_process_donelist_isr -- schedule processing of done list entries |
774 | * @asd_ha: pointer to host adapter structure | 772 | * @asd_ha: pointer to host adapter structure |
775 | */ | 773 | */ |
776 | static inline void asd_process_donelist_isr(struct asd_ha_struct *asd_ha) | 774 | static void asd_process_donelist_isr(struct asd_ha_struct *asd_ha) |
777 | { | 775 | { |
778 | tasklet_schedule(&asd_ha->seq.dl_tasklet); | 776 | tasklet_schedule(&asd_ha->seq.dl_tasklet); |
779 | } | 777 | } |
@@ -782,7 +780,7 @@ static inline void asd_process_donelist_isr(struct asd_ha_struct *asd_ha) | |||
782 | * asd_com_sas_isr -- process device communication interrupt (COMINT) | 780 | * asd_com_sas_isr -- process device communication interrupt (COMINT) |
783 | * @asd_ha: pointer to host adapter structure | 781 | * @asd_ha: pointer to host adapter structure |
784 | */ | 782 | */ |
785 | static inline void asd_com_sas_isr(struct asd_ha_struct *asd_ha) | 783 | static void asd_com_sas_isr(struct asd_ha_struct *asd_ha) |
786 | { | 784 | { |
787 | u32 comstat = asd_read_reg_dword(asd_ha, COMSTAT); | 785 | u32 comstat = asd_read_reg_dword(asd_ha, COMSTAT); |
788 | 786 | ||
@@ -821,7 +819,7 @@ static inline void asd_com_sas_isr(struct asd_ha_struct *asd_ha) | |||
821 | asd_chip_reset(asd_ha); | 819 | asd_chip_reset(asd_ha); |
822 | } | 820 | } |
823 | 821 | ||
824 | static inline void asd_arp2_err(struct asd_ha_struct *asd_ha, u32 dchstatus) | 822 | static void asd_arp2_err(struct asd_ha_struct *asd_ha, u32 dchstatus) |
825 | { | 823 | { |
826 | static const char *halt_code[256] = { | 824 | static const char *halt_code[256] = { |
827 | "UNEXPECTED_INTERRUPT0", | 825 | "UNEXPECTED_INTERRUPT0", |
@@ -908,7 +906,7 @@ static inline void asd_arp2_err(struct asd_ha_struct *asd_ha, u32 dchstatus) | |||
908 | * asd_dch_sas_isr -- process device channel interrupt (DEVINT) | 906 | * asd_dch_sas_isr -- process device channel interrupt (DEVINT) |
909 | * @asd_ha: pointer to host adapter structure | 907 | * @asd_ha: pointer to host adapter structure |
910 | */ | 908 | */ |
911 | static inline void asd_dch_sas_isr(struct asd_ha_struct *asd_ha) | 909 | static void asd_dch_sas_isr(struct asd_ha_struct *asd_ha) |
912 | { | 910 | { |
913 | u32 dchstatus = asd_read_reg_dword(asd_ha, DCHSTATUS); | 911 | u32 dchstatus = asd_read_reg_dword(asd_ha, DCHSTATUS); |
914 | 912 | ||
@@ -923,7 +921,7 @@ static inline void asd_dch_sas_isr(struct asd_ha_struct *asd_ha) | |||
923 | * ads_rbi_exsi_isr -- process external system interface interrupt (INITERR) | 921 | * ads_rbi_exsi_isr -- process external system interface interrupt (INITERR) |
924 | * @asd_ha: pointer to host adapter structure | 922 | * @asd_ha: pointer to host adapter structure |
925 | */ | 923 | */ |
926 | static inline void asd_rbi_exsi_isr(struct asd_ha_struct *asd_ha) | 924 | static void asd_rbi_exsi_isr(struct asd_ha_struct *asd_ha) |
927 | { | 925 | { |
928 | u32 stat0r = asd_read_reg_dword(asd_ha, ASISTAT0R); | 926 | u32 stat0r = asd_read_reg_dword(asd_ha, ASISTAT0R); |
929 | 927 | ||
@@ -971,7 +969,7 @@ static inline void asd_rbi_exsi_isr(struct asd_ha_struct *asd_ha) | |||
971 | * | 969 | * |
972 | * Asserted on PCIX errors: target abort, etc. | 970 | * Asserted on PCIX errors: target abort, etc. |
973 | */ | 971 | */ |
974 | static inline void asd_hst_pcix_isr(struct asd_ha_struct *asd_ha) | 972 | static void asd_hst_pcix_isr(struct asd_ha_struct *asd_ha) |
975 | { | 973 | { |
976 | u16 status; | 974 | u16 status; |
977 | u32 pcix_status; | 975 | u32 pcix_status; |
@@ -1044,8 +1042,8 @@ irqreturn_t asd_hw_isr(int irq, void *dev_id) | |||
1044 | 1042 | ||
1045 | /* ---------- SCB handling ---------- */ | 1043 | /* ---------- SCB handling ---------- */ |
1046 | 1044 | ||
1047 | static inline struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha, | 1045 | static struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha, |
1048 | gfp_t gfp_flags) | 1046 | gfp_t gfp_flags) |
1049 | { | 1047 | { |
1050 | extern struct kmem_cache *asd_ascb_cache; | 1048 | extern struct kmem_cache *asd_ascb_cache; |
1051 | struct asd_seq_data *seq = &asd_ha->seq; | 1049 | struct asd_seq_data *seq = &asd_ha->seq; |
@@ -1144,8 +1142,8 @@ struct asd_ascb *asd_ascb_alloc_list(struct asd_ha_struct | |||
1144 | * | 1142 | * |
1145 | * LOCKING: called with the pending list lock held. | 1143 | * LOCKING: called with the pending list lock held. |
1146 | */ | 1144 | */ |
1147 | static inline void asd_swap_head_scb(struct asd_ha_struct *asd_ha, | 1145 | static void asd_swap_head_scb(struct asd_ha_struct *asd_ha, |
1148 | struct asd_ascb *ascb) | 1146 | struct asd_ascb *ascb) |
1149 | { | 1147 | { |
1150 | struct asd_seq_data *seq = &asd_ha->seq; | 1148 | struct asd_seq_data *seq = &asd_ha->seq; |
1151 | struct asd_ascb *last = list_entry(ascb->list.prev, | 1149 | struct asd_ascb *last = list_entry(ascb->list.prev, |
@@ -1171,7 +1169,7 @@ static inline void asd_swap_head_scb(struct asd_ha_struct *asd_ha, | |||
1171 | * intended to be called from asd_post_ascb_list(), just prior to | 1169 | * intended to be called from asd_post_ascb_list(), just prior to |
1172 | * posting the SCBs to the sequencer. | 1170 | * posting the SCBs to the sequencer. |
1173 | */ | 1171 | */ |
1174 | static inline void asd_start_scb_timers(struct list_head *list) | 1172 | static void asd_start_scb_timers(struct list_head *list) |
1175 | { | 1173 | { |
1176 | struct asd_ascb *ascb; | 1174 | struct asd_ascb *ascb; |
1177 | list_for_each_entry(ascb, list, list) { | 1175 | list_for_each_entry(ascb, list, list) { |