@@ -1295,6 +1295,22 @@ static void topctrl_flush(struct bcm_sysport_priv *priv)
1295
1295
topctrl_writel (priv , 0 , TX_FLUSH_CNTL );
1296
1296
}
1297
1297
1298
+ static void bcm_sysport_netif_start (struct net_device * dev )
1299
+ {
1300
+ struct bcm_sysport_priv * priv = netdev_priv (dev );
1301
+
1302
+ /* Enable NAPI */
1303
+ napi_enable (& priv -> napi );
1304
+
1305
+ phy_start (priv -> phydev );
1306
+
1307
+ /* Enable TX interrupts for the 32 TXQs */
1308
+ intrl2_1_mask_clear (priv , 0xffffffff );
1309
+
1310
+ /* Last call before we start the real business */
1311
+ netif_tx_start_all_queues (dev );
1312
+ }
1313
+
1298
1314
static int bcm_sysport_open (struct net_device * dev )
1299
1315
{
1300
1316
struct bcm_sysport_priv * priv = netdev_priv (dev );
@@ -1394,19 +1410,10 @@ static int bcm_sysport_open(struct net_device *dev)
1394
1410
if (ret )
1395
1411
goto out_clear_rx_int ;
1396
1412
1397
- /* Enable NAPI */
1398
- napi_enable (& priv -> napi );
1399
-
1400
1413
/* Turn on UniMAC TX/RX */
1401
1414
umac_enable_set (priv , CMD_RX_EN | CMD_TX_EN , 1 );
1402
1415
1403
- phy_start (priv -> phydev );
1404
-
1405
- /* Enable TX interrupts for the 32 TXQs */
1406
- intrl2_1_mask_clear (priv , 0xffffffff );
1407
-
1408
- /* Last call before we start the real business */
1409
- netif_tx_start_all_queues (dev );
1416
+ bcm_sysport_netif_start (dev );
1410
1417
1411
1418
return 0 ;
1412
1419
@@ -1425,11 +1432,9 @@ static int bcm_sysport_open(struct net_device *dev)
1425
1432
return ret ;
1426
1433
}
1427
1434
1428
- static int bcm_sysport_stop (struct net_device * dev )
1435
+ static void bcm_sysport_netif_stop (struct net_device * dev )
1429
1436
{
1430
1437
struct bcm_sysport_priv * priv = netdev_priv (dev );
1431
- unsigned int i ;
1432
- int ret ;
1433
1438
1434
1439
/* stop all software from updating hardware */
1435
1440
netif_tx_stop_all_queues (dev );
@@ -1441,6 +1446,15 @@ static int bcm_sysport_stop(struct net_device *dev)
1441
1446
intrl2_0_writel (priv , 0xffffffff , INTRL2_CPU_CLEAR );
1442
1447
intrl2_1_mask_set (priv , 0xffffffff );
1443
1448
intrl2_1_writel (priv , 0xffffffff , INTRL2_CPU_CLEAR );
1449
+ }
1450
+
1451
+ static int bcm_sysport_stop (struct net_device * dev )
1452
+ {
1453
+ struct bcm_sysport_priv * priv = netdev_priv (dev );
1454
+ unsigned int i ;
1455
+ int ret ;
1456
+
1457
+ bcm_sysport_netif_stop (dev );
1444
1458
1445
1459
/* Disable UniMAC RX */
1446
1460
umac_enable_set (priv , CMD_RX_EN , 0 );
0 commit comments