@@ -64,6 +64,10 @@ static bool pm8001_use_tasklet = true;
64
64
module_param_named (use_tasklet , pm8001_use_tasklet , bool , 0444 );
65
65
MODULE_PARM_DESC (zoned , "Use MSIX interrupts. Default: true" );
66
66
67
+ static bool pm8001_read_wwn = true;
68
+ module_param_named (read_wwn , pm8001_read_wwn , bool , 0444 );
69
+ MODULE_PARM_DESC (zoned , "Get WWN from the controller. Default: true" );
70
+
67
71
static struct scsi_transport_template * pm8001_stt ;
68
72
static int pm8001_init_ccb_tag (struct pm8001_hba_info * );
69
73
@@ -683,19 +687,30 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost,
683
687
*/
684
688
static int pm8001_init_sas_add (struct pm8001_hba_info * pm8001_ha )
685
689
{
686
- u8 i , j ;
687
- u8 sas_add [8 ];
688
- #ifdef PM8001_READ_VPD
689
- /* For new SPC controllers WWN is stored in flash vpd
690
- * For SPC/SPCve controllers WWN is stored in EEPROM
691
- * For Older SPC WWN is stored in NVMD
692
- */
693
690
DECLARE_COMPLETION_ONSTACK (completion );
694
691
struct pm8001_ioctl_payload payload ;
692
+ unsigned long time_remaining ;
693
+ u8 sas_add [8 ];
695
694
u16 deviceid ;
696
695
int rc ;
697
- unsigned long time_remaining ;
696
+ u8 i , j ;
697
+
698
+ if (!pm8001_read_wwn ) {
699
+ __be64 dev_sas_addr = cpu_to_be64 (0x50010c600047f9d0ULL );
700
+
701
+ for (i = 0 ; i < pm8001_ha -> chip -> n_phy ; i ++ )
702
+ memcpy (& pm8001_ha -> phy [i ].dev_sas_addr , & dev_sas_addr ,
703
+ SAS_ADDR_SIZE );
704
+ memcpy (pm8001_ha -> sas_addr , & pm8001_ha -> phy [0 ].dev_sas_addr ,
705
+ SAS_ADDR_SIZE );
706
+ return 0 ;
707
+ }
698
708
709
+ /*
710
+ * For new SPC controllers WWN is stored in flash vpd. For SPC/SPCve
711
+ * controllers WWN is stored in EEPROM. And for Older SPC WWN is stored
712
+ * in NVMD.
713
+ */
699
714
if (PM8001_CHIP_DISP -> fatal_errors (pm8001_ha )) {
700
715
pm8001_dbg (pm8001_ha , FAIL , "controller is in fatal error state\n" );
701
716
return - EIO ;
@@ -769,16 +784,7 @@ static int pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
769
784
pm8001_ha -> phy [i ].dev_sas_addr );
770
785
}
771
786
kfree (payload .func_specific );
772
- #else
773
- for (i = 0 ; i < pm8001_ha -> chip -> n_phy ; i ++ ) {
774
- pm8001_ha -> phy [i ].dev_sas_addr = 0x50010c600047f9d0ULL ;
775
- pm8001_ha -> phy [i ].dev_sas_addr =
776
- cpu_to_be64 ((u64 )
777
- (* (u64 * )& pm8001_ha -> phy [i ].dev_sas_addr ));
778
- }
779
- memcpy (pm8001_ha -> sas_addr , & pm8001_ha -> phy [0 ].dev_sas_addr ,
780
- SAS_ADDR_SIZE );
781
- #endif
787
+
782
788
return 0 ;
783
789
}
784
790
@@ -788,13 +794,13 @@ static int pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha)
788
794
*/
789
795
static int pm8001_get_phy_settings_info (struct pm8001_hba_info * pm8001_ha )
790
796
{
791
-
792
- #ifdef PM8001_READ_VPD
793
- /*OPTION ROM FLASH read for the SPC cards */
794
797
DECLARE_COMPLETION_ONSTACK (completion );
795
798
struct pm8001_ioctl_payload payload ;
796
799
int rc ;
797
800
801
+ if (!pm8001_read_wwn )
802
+ return 0 ;
803
+
798
804
pm8001_ha -> nvmd_completion = & completion ;
799
805
/* SAS ADDRESS read from flash / EEPROM */
800
806
payload .minor_function = 6 ;
@@ -813,7 +819,7 @@ static int pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha)
813
819
wait_for_completion (& completion );
814
820
pm8001_set_phy_profile (pm8001_ha , sizeof (u8 ), payload .func_specific );
815
821
kfree (payload .func_specific );
816
- #endif
822
+
817
823
return 0 ;
818
824
}
819
825
0 commit comments