@@ -1180,65 +1180,6 @@ void pm8001_chip_iounmap(struct pm8001_hba_info *pm8001_ha)
11801180 }
11811181}
11821182
1183- #ifndef PM8001_USE_MSIX
1184- /**
1185- * pm8001_chip_intx_interrupt_enable - enable PM8001 chip interrupt
1186- * @pm8001_ha: our hba card information
1187- */
1188- static void
1189- pm8001_chip_intx_interrupt_enable (struct pm8001_hba_info * pm8001_ha )
1190- {
1191- pm8001_cw32 (pm8001_ha , 0 , MSGU_ODMR , ODMR_CLEAR_ALL );
1192- pm8001_cw32 (pm8001_ha , 0 , MSGU_ODCR , ODCR_CLEAR_ALL );
1193- }
1194-
1195- /**
1196- * pm8001_chip_intx_interrupt_disable - disable PM8001 chip interrupt
1197- * @pm8001_ha: our hba card information
1198- */
1199- static void
1200- pm8001_chip_intx_interrupt_disable (struct pm8001_hba_info * pm8001_ha )
1201- {
1202- pm8001_cw32 (pm8001_ha , 0 , MSGU_ODMR , ODMR_MASK_ALL );
1203- }
1204-
1205- #else
1206-
1207- /**
1208- * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
1209- * @pm8001_ha: our hba card information
1210- * @int_vec_idx: interrupt number to enable
1211- */
1212- static void
1213- pm8001_chip_msix_interrupt_enable (struct pm8001_hba_info * pm8001_ha ,
1214- u32 int_vec_idx )
1215- {
1216- u32 msi_index ;
1217- u32 value ;
1218- msi_index = int_vec_idx * MSIX_TABLE_ELEMENT_SIZE ;
1219- msi_index += MSIX_TABLE_BASE ;
1220- pm8001_cw32 (pm8001_ha , 0 , msi_index , MSIX_INTERRUPT_ENABLE );
1221- value = (1 << int_vec_idx );
1222- pm8001_cw32 (pm8001_ha , 0 , MSGU_ODCR , value );
1223-
1224- }
1225-
1226- /**
1227- * pm8001_chip_msix_interrupt_disable - disable PM8001 chip interrupt
1228- * @pm8001_ha: our hba card information
1229- * @int_vec_idx: interrupt number to disable
1230- */
1231- static void
1232- pm8001_chip_msix_interrupt_disable (struct pm8001_hba_info * pm8001_ha ,
1233- u32 int_vec_idx )
1234- {
1235- u32 msi_index ;
1236- msi_index = int_vec_idx * MSIX_TABLE_ELEMENT_SIZE ;
1237- msi_index += MSIX_TABLE_BASE ;
1238- pm8001_cw32 (pm8001_ha , 0 , msi_index , MSIX_INTERRUPT_DISABLE );
1239- }
1240- #endif
1241-
12421183/**
12431184 * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
12441185 * @pm8001_ha: our hba card information
@@ -1247,11 +1188,14 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
12471188static void
12481189pm8001_chip_interrupt_enable (struct pm8001_hba_info * pm8001_ha , u8 vec )
12491190{
1250- #ifdef PM8001_USE_MSIX
1251- pm8001_chip_msix_interrupt_enable (pm8001_ha , 0 );
1252- #else
1253- pm8001_chip_intx_interrupt_enable (pm8001_ha );
1254- #endif
1191+ if (pm8001_ha -> use_msix ) {
1192+ pm8001_cw32 (pm8001_ha , 0 , MSIX_TABLE_BASE ,
1193+ MSIX_INTERRUPT_ENABLE );
1194+ pm8001_cw32 (pm8001_ha , 0 , MSGU_ODCR , 1 );
1195+ } else {
1196+ pm8001_cw32 (pm8001_ha , 0 , MSGU_ODMR , ODMR_CLEAR_ALL );
1197+ pm8001_cw32 (pm8001_ha , 0 , MSGU_ODCR , ODCR_CLEAR_ALL );
1198+ }
12551199}
12561200
12571201/**
@@ -1262,11 +1206,11 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
12621206static void
12631207pm8001_chip_interrupt_disable (struct pm8001_hba_info * pm8001_ha , u8 vec )
12641208{
1265- #ifdef PM8001_USE_MSIX
1266- pm8001_chip_msix_interrupt_disable (pm8001_ha , 0 );
1267- #else
1268- pm8001_chip_intx_interrupt_disable ( pm8001_ha );
1269- #endif
1209+ if ( pm8001_ha -> use_msix )
1210+ pm8001_cw32 (pm8001_ha , 0 , MSIX_TABLE_BASE ,
1211+ MSIX_INTERRUPT_DISABLE );
1212+ else
1213+ pm8001_cw32 ( pm8001_ha , 0 , MSGU_ODMR , ODMR_MASK_ALL );
12701214}
12711215
12721216/**
@@ -4180,7 +4124,7 @@ pm8001_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id)
41804124 payload .sas_identify .dev_type = SAS_END_DEVICE ;
41814125 payload .sas_identify .initiator_bits = SAS_PROTOCOL_ALL ;
41824126 memcpy (payload .sas_identify .sas_addr ,
4183- pm8001_ha -> sas_addr , SAS_ADDR_SIZE );
4127+ & pm8001_ha -> phy [ phy_id ]. dev_sas_addr , SAS_ADDR_SIZE );
41844128 payload .sas_identify .phy_id = phy_id ;
41854129
41864130 return pm8001_mpi_build_cmd (pm8001_ha , 0 , opcode , & payload ,
@@ -4309,16 +4253,15 @@ static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
43094253
43104254static u32 pm8001_chip_is_our_interrupt (struct pm8001_hba_info * pm8001_ha )
43114255{
4312- #ifdef PM8001_USE_MSIX
4313- return 1 ;
4314- #else
43154256 u32 value ;
43164257
4258+ if (pm8001_ha -> use_msix )
4259+ return 1 ;
4260+
43174261 value = pm8001_cr32 (pm8001_ha , 0 , MSGU_ODR );
43184262 if (value )
43194263 return 1 ;
43204264 return 0 ;
4321- #endif
43224265}
43234266
43244267/**
0 commit comments