@@ -150,7 +150,6 @@ struct rteth_ctrl {
150150 struct rtl838x_rx_q rx_qs [RTETH_RX_RINGS ];
151151 struct phylink * phylink ;
152152 struct phylink_config phylink_config ;
153- struct phylink_pcs pcs ;
154153 const struct rteth_config * r ;
155154 u32 lastEvent ;
156155 /* receive handling */
@@ -1078,74 +1077,6 @@ static void rteth_mac_config(struct phylink_config *config,
10781077 pr_info ("In %s, mode %x\n" , __func__ , mode );
10791078}
10801079
1081- static void rteth_pcs_an_restart (struct phylink_pcs * pcs )
1082- {
1083- struct rteth_ctrl * ctrl = container_of (pcs , struct rteth_ctrl , pcs );
1084-
1085- /* This works only on RTL838x chips */
1086- if (ctrl -> r -> family_id != RTL8380_FAMILY_ID )
1087- return ;
1088-
1089- pr_debug ("In %s\n" , __func__ );
1090- /* Restart by disabling and re-enabling link */
1091- sw_w32 (0x6192D , ctrl -> r -> mac_force_mode_ctrl );
1092- mdelay (20 );
1093- sw_w32 (0x6192F , ctrl -> r -> mac_force_mode_ctrl );
1094- }
1095-
1096- static void rteth_pcs_get_state (struct phylink_pcs * pcs ,
1097- struct phylink_link_state * state )
1098- {
1099- u32 speed ;
1100- struct rteth_ctrl * ctrl = container_of (pcs , struct rteth_ctrl , pcs );
1101- int port = ctrl -> r -> cpu_port ;
1102-
1103- pr_info ("In %s\n" , __func__ );
1104-
1105- state -> link = ctrl -> r -> get_mac_link_sts (port ) ? 1 : 0 ;
1106- state -> duplex = ctrl -> r -> get_mac_link_dup_sts (port ) ? 1 : 0 ;
1107-
1108- pr_info ("%s link status is %d\n" , __func__ , state -> link );
1109- speed = ctrl -> r -> get_mac_link_spd_sts (port );
1110- switch (speed ) {
1111- case 0 :
1112- state -> speed = SPEED_10 ;
1113- break ;
1114- case 1 :
1115- state -> speed = SPEED_100 ;
1116- break ;
1117- case 2 :
1118- state -> speed = SPEED_1000 ;
1119- break ;
1120- case 5 :
1121- state -> speed = SPEED_2500 ;
1122- break ;
1123- case 6 :
1124- state -> speed = SPEED_5000 ;
1125- break ;
1126- case 4 :
1127- state -> speed = SPEED_10000 ;
1128- break ;
1129- default :
1130- state -> speed = SPEED_UNKNOWN ;
1131- break ;
1132- }
1133-
1134- state -> pause &= (MLO_PAUSE_RX | MLO_PAUSE_TX );
1135- if (ctrl -> r -> get_mac_rx_pause_sts (port ))
1136- state -> pause |= MLO_PAUSE_RX ;
1137- if (ctrl -> r -> get_mac_tx_pause_sts (port ))
1138- state -> pause |= MLO_PAUSE_TX ;
1139- }
1140-
1141- static int rteth_pcs_config (struct phylink_pcs * pcs , unsigned int neg_mode ,
1142- phy_interface_t interface ,
1143- const unsigned long * advertising ,
1144- bool permit_pause_to_mac )
1145- {
1146- return 0 ;
1147- }
1148-
11491080static void rteth_mac_link_down (struct phylink_config * config ,
11501081 unsigned int mode ,
11511082 phy_interface_t interface )
@@ -1318,15 +1249,6 @@ static int rteth_93xx_set_features(struct net_device *dev, netdev_features_t fea
13181249 return 0 ;
13191250}
13201251
1321- static struct phylink_pcs * rteth_mac_select_pcs (struct phylink_config * config ,
1322- phy_interface_t interface )
1323- {
1324- struct net_device * dev = to_net_dev (config -> dev );
1325- struct rteth_ctrl * ctrl = netdev_priv (dev );
1326-
1327- return & ctrl -> pcs ;
1328- }
1329-
13301252static int rteth_setup_tc (struct net_device * dev , enum tc_setup_type type , void * type_data )
13311253{
13321254 struct dsa_switch * ds ;
@@ -1376,11 +1298,6 @@ static const struct rteth_config rteth_838x_cfg = {
13761298 .dma_if_rx_ring_size = rtl838x_dma_if_rx_ring_size ,
13771299 .dma_if_rx_ring_cntr = rtl838x_dma_if_rx_ring_cntr ,
13781300 .rst_glb_ctrl = RTL838X_RST_GLB_CTRL_0 ,
1379- .get_mac_link_sts = rtl838x_get_mac_link_sts ,
1380- .get_mac_link_dup_sts = rtl838x_get_mac_link_dup_sts ,
1381- .get_mac_link_spd_sts = rtl838x_get_mac_link_spd_sts ,
1382- .get_mac_rx_pause_sts = rtl838x_get_mac_rx_pause_sts ,
1383- .get_mac_tx_pause_sts = rtl838x_get_mac_tx_pause_sts ,
13841301 .mac_reg = { RTETH_838X_MAC_ADDR_CTRL ,
13851302 RTETH_838X_MAC_ADDR_CTRL_ALE ,
13861303 RTETH_838X_MAC_ADDR_CTRL_MAC },
@@ -1425,11 +1342,6 @@ static const struct rteth_config rteth_839x_cfg = {
14251342 .dma_if_rx_ring_size = rtl839x_dma_if_rx_ring_size ,
14261343 .dma_if_rx_ring_cntr = rtl839x_dma_if_rx_ring_cntr ,
14271344 .rst_glb_ctrl = RTL839X_RST_GLB_CTRL ,
1428- .get_mac_link_sts = rtl839x_get_mac_link_sts ,
1429- .get_mac_link_dup_sts = rtl839x_get_mac_link_dup_sts ,
1430- .get_mac_link_spd_sts = rtl839x_get_mac_link_spd_sts ,
1431- .get_mac_rx_pause_sts = rtl839x_get_mac_rx_pause_sts ,
1432- .get_mac_tx_pause_sts = rtl839x_get_mac_tx_pause_sts ,
14331345 .mac_reg = { RTETH_839X_MAC_ADDR_CTRL },
14341346 .l2_tbl_flush_ctrl = RTL839X_L2_TBL_FLUSH_CTRL ,
14351347 .update_counter = rteth_83xx_update_counter ,
@@ -1473,11 +1385,6 @@ static const struct rteth_config rteth_930x_cfg = {
14731385 .dma_if_rx_ring_size = rtl930x_dma_if_rx_ring_size ,
14741386 .dma_if_rx_ring_cntr = rtl930x_dma_if_rx_ring_cntr ,
14751387 .rst_glb_ctrl = RTL930X_RST_GLB_CTRL_0 ,
1476- .get_mac_link_sts = rtl930x_get_mac_link_sts ,
1477- .get_mac_link_dup_sts = rtl930x_get_mac_link_dup_sts ,
1478- .get_mac_link_spd_sts = rtl930x_get_mac_link_spd_sts ,
1479- .get_mac_rx_pause_sts = rtl930x_get_mac_rx_pause_sts ,
1480- .get_mac_tx_pause_sts = rtl930x_get_mac_tx_pause_sts ,
14811388 .mac_reg = { RTETH_930X_MAC_L2_ADDR_CTRL },
14821389 .l2_tbl_flush_ctrl = RTL930X_L2_TBL_FLUSH_CTRL ,
14831390 .update_counter = rteth_93xx_update_counter ,
@@ -1521,11 +1428,6 @@ static const struct rteth_config rteth_931x_cfg = {
15211428 .dma_if_rx_ring_size = rtl931x_dma_if_rx_ring_size ,
15221429 .dma_if_rx_ring_cntr = rtl931x_dma_if_rx_ring_cntr ,
15231430 .rst_glb_ctrl = RTL931X_RST_GLB_CTRL ,
1524- .get_mac_link_sts = rtldsa_931x_get_mac_link_sts ,
1525- .get_mac_link_dup_sts = rtl931x_get_mac_link_dup_sts ,
1526- .get_mac_link_spd_sts = rtl931x_get_mac_link_spd_sts ,
1527- .get_mac_rx_pause_sts = rtl931x_get_mac_rx_pause_sts ,
1528- .get_mac_tx_pause_sts = rtl931x_get_mac_tx_pause_sts ,
15291431 .mac_reg = { RTETH_930X_MAC_L2_ADDR_CTRL },
15301432 .l2_tbl_flush_ctrl = RTL931X_L2_TBL_FLUSH_CTRL ,
15311433 .update_counter = rteth_93xx_update_counter ,
@@ -1536,14 +1438,7 @@ static const struct rteth_config rteth_931x_cfg = {
15361438 .netdev_ops = & rteth_931x_netdev_ops ,
15371439};
15381440
1539- static const struct phylink_pcs_ops rteth_pcs_ops = {
1540- .pcs_get_state = rteth_pcs_get_state ,
1541- .pcs_an_restart = rteth_pcs_an_restart ,
1542- .pcs_config = rteth_pcs_config ,
1543- };
1544-
15451441static const struct phylink_mac_ops rteth_mac_ops = {
1546- .mac_select_pcs = rteth_mac_select_pcs ,
15471442 .mac_config = rteth_mac_config ,
15481443 .mac_link_down = rteth_mac_link_down ,
15491444 .mac_link_up = rteth_mac_link_up ,
@@ -1678,7 +1573,6 @@ static int rtl838x_eth_probe(struct platform_device *pdev)
16781573 return - EINVAL ;
16791574 }
16801575
1681- ctrl -> pcs .ops = & rteth_pcs_ops ;
16821576 ctrl -> phylink_config .dev = & dev -> dev ;
16831577 ctrl -> phylink_config .type = PHYLINK_NETDEV ;
16841578 ctrl -> phylink_config .mac_capabilities =
0 commit comments