@@ -113,15 +113,10 @@ static void wx_intr_disable(struct wx *wx, u64 qmask)
113113 if (mask )
114114 wr32 (wx , WX_PX_IMS (0 ), mask );
115115
116- switch (wx -> mac .type ) {
117- case wx_mac_sp :
118- case wx_mac_aml :
116+ if (test_bit (WX_FLAG_MULTI_64_FUNC , wx -> flags )) {
119117 mask = (qmask >> 32 );
120118 if (mask )
121119 wr32 (wx , WX_PX_IMS (1 ), mask );
122- break ;
123- default :
124- break ;
125120 }
126121}
127122
@@ -133,15 +128,10 @@ void wx_intr_enable(struct wx *wx, u64 qmask)
133128 if (mask )
134129 wr32 (wx , WX_PX_IMC (0 ), mask );
135130
136- switch (wx -> mac .type ) {
137- case wx_mac_sp :
138- case wx_mac_aml :
131+ if (test_bit (WX_FLAG_MULTI_64_FUNC , wx -> flags )) {
139132 mask = (qmask >> 32 );
140133 if (mask )
141134 wr32 (wx , WX_PX_IMC (1 ), mask );
142- break ;
143- default :
144- break ;
145135 }
146136}
147137EXPORT_SYMBOL (wx_intr_enable );
@@ -705,6 +695,7 @@ void wx_init_eeprom_params(struct wx *wx)
705695 switch (wx -> mac .type ) {
706696 case wx_mac_sp :
707697 case wx_mac_aml :
698+ case wx_mac_aml40 :
708699 if (wx_read_ee_hostif (wx , WX_SW_REGION_PTR , & data )) {
709700 wx_err (wx , "NVM Read Error\n" );
710701 return ;
@@ -774,14 +765,8 @@ static int wx_set_rar(struct wx *wx, u32 index, u8 *addr, u64 pools,
774765 /* setup VMDq pool mapping */
775766 wr32 (wx , WX_PSR_MAC_SWC_VM_L , pools & 0xFFFFFFFF );
776767
777- switch (wx -> mac .type ) {
778- case wx_mac_sp :
779- case wx_mac_aml :
768+ if (test_bit (WX_FLAG_MULTI_64_FUNC , wx -> flags ))
780769 wr32 (wx , WX_PSR_MAC_SWC_VM_H , pools >> 32 );
781- break ;
782- default :
783- break ;
784- }
785770
786771 /* HW expects these in little endian so we reverse the byte
787772 * order from network order (big endian) to little endian
@@ -919,14 +904,9 @@ void wx_init_rx_addrs(struct wx *wx)
919904
920905 wx_set_rar (wx , 0 , wx -> mac .addr , 0 , WX_PSR_MAC_SWC_AD_H_AV );
921906
922- switch (wx -> mac .type ) {
923- case wx_mac_sp :
924- case wx_mac_aml :
907+ if (test_bit (WX_FLAG_MULTI_64_FUNC , wx -> flags )) {
925908 /* clear VMDq pool/queue selection for RAR 0 */
926909 wx_clear_vmdq (wx , 0 , WX_CLEAR_VMDQ_ALL );
927- break ;
928- default :
929- break ;
930910 }
931911 }
932912
@@ -1512,7 +1492,7 @@ static void wx_configure_virtualization(struct wx *wx)
15121492 wr32m (wx , WX_PSR_VM_L2CTL (pool ),
15131493 WX_PSR_VM_L2CTL_AUPE , WX_PSR_VM_L2CTL_AUPE );
15141494
1515- if (wx -> mac . type == wx_mac_em ) {
1495+ if (! test_bit ( WX_FLAG_MULTI_64_FUNC , wx -> flags ) ) {
15161496 vf_shift = BIT (VMDQ_P (0 ));
15171497 /* Enable only the PF pools for Tx/Rx */
15181498 wr32 (wx , WX_RDM_VF_RE (0 ), vf_shift );
@@ -1543,7 +1523,7 @@ static void wx_configure_port(struct wx *wx)
15431523{
15441524 u32 value , i ;
15451525
1546- if (wx -> mac . type == wx_mac_em ) {
1526+ if (! test_bit ( WX_FLAG_MULTI_64_FUNC , wx -> flags ) ) {
15471527 value = (wx -> num_vfs == 0 ) ?
15481528 WX_CFG_PORT_CTL_NUM_VT_NONE :
15491529 WX_CFG_PORT_CTL_NUM_VT_8 ;
@@ -2074,7 +2054,7 @@ static void wx_setup_psrtype(struct wx *wx)
20742054 WX_RDB_PL_CFG_TUN_OUTL2HDR |
20752055 WX_RDB_PL_CFG_TUN_TUNHDR ;
20762056
2077- if (wx -> mac . type == wx_mac_em ) {
2057+ if (! test_bit ( WX_FLAG_MULTI_64_FUNC , wx -> flags ) ) {
20782058 for_each_set_bit (pool , & wx -> fwd_bitmask , 8 )
20792059 wr32 (wx , WX_RDB_PL_CFG (VMDQ_P (pool )), psrtype );
20802060 } else {
@@ -2272,10 +2252,8 @@ int wx_stop_adapter(struct wx *wx)
22722252}
22732253EXPORT_SYMBOL (wx_stop_adapter );
22742254
2275- void wx_reset_misc (struct wx * wx )
2255+ void wx_reset_mac (struct wx * wx )
22762256{
2277- int i ;
2278-
22792257 /* receive packets that size > 2048 */
22802258 wr32m (wx , WX_MAC_RX_CFG , WX_MAC_RX_CFG_JE , WX_MAC_RX_CFG_JE );
22812259
@@ -2287,6 +2265,14 @@ void wx_reset_misc(struct wx *wx)
22872265 WX_MAC_RX_FLOW_CTRL_RFE , WX_MAC_RX_FLOW_CTRL_RFE );
22882266
22892267 wr32 (wx , WX_MAC_PKT_FLT , WX_MAC_PKT_FLT_PR );
2268+ }
2269+ EXPORT_SYMBOL (wx_reset_mac );
2270+
2271+ void wx_reset_misc (struct wx * wx )
2272+ {
2273+ int i ;
2274+
2275+ wx_reset_mac (wx );
22902276
22912277 wr32m (wx , WX_MIS_RST_ST ,
22922278 WX_MIS_RST_ST_RST_INIT , 0x1E00 );
0 commit comments