@@ -218,13 +218,24 @@ static int txgbe_request_irq(struct wx *wx)
218218
219219static void txgbe_up_complete (struct wx * wx )
220220{
221+ u32 reg ;
222+
221223 wx_control_hw (wx , true);
222224 wx_configure_vectors (wx );
223225
224226 /* clear any pending interrupts, may auto mask */
225227 rd32 (wx , WX_PX_IC );
226228 rd32 (wx , WX_PX_MISC_IC );
227229 txgbe_irq_enable (wx , true);
230+
231+ /* Configure MAC Rx and Tx when link is up */
232+ reg = rd32 (wx , WX_MAC_RX_CFG );
233+ wr32 (wx , WX_MAC_RX_CFG , reg );
234+ wr32 (wx , WX_MAC_PKT_FLT , WX_MAC_PKT_FLT_PR );
235+ reg = rd32 (wx , WX_MAC_WDG_TIMEOUT );
236+ wr32 (wx , WX_MAC_WDG_TIMEOUT , reg );
237+ reg = rd32 (wx , WX_MAC_TX_CFG );
238+ wr32 (wx , WX_MAC_TX_CFG , (reg & ~WX_MAC_TX_CFG_SPEED_MASK ) | WX_MAC_TX_CFG_SPEED_10G );
228239}
229240
230241static void txgbe_reset (struct wx * wx )
@@ -246,11 +257,17 @@ static void txgbe_reset(struct wx *wx)
246257static void txgbe_disable_device (struct wx * wx )
247258{
248259 struct net_device * netdev = wx -> netdev ;
260+ u32 i ;
249261
250262 wx_disable_pcie_master (wx );
251263 /* disable receives */
252264 wx_disable_rx (wx );
253265
266+ /* disable all enabled rx queues */
267+ for (i = 0 ; i < wx -> num_rx_queues ; i ++ )
268+ /* this call also flushes the previous write */
269+ wx_disable_rx_queue (wx , wx -> rx_ring [i ]);
270+
254271 netif_carrier_off (netdev );
255272 netif_tx_disable (netdev );
256273
@@ -268,6 +285,13 @@ static void txgbe_disable_device(struct wx *wx)
268285 wr32m (wx , WX_MAC_TX_CFG , WX_MAC_TX_CFG_TE , 0 );
269286 }
270287
288+ /* disable transmits in the hardware now that interrupts are off */
289+ for (i = 0 ; i < wx -> num_tx_queues ; i ++ ) {
290+ u8 reg_idx = wx -> tx_ring [i ]-> reg_idx ;
291+
292+ wr32 (wx , WX_PX_TR_CFG (reg_idx ), WX_PX_TR_CFG_SWFLSH );
293+ }
294+
271295 /* Disable the Tx DMA engine */
272296 wr32m (wx , WX_TDM_CTL , WX_TDM_CTL_TE , 0 );
273297}
@@ -291,6 +315,8 @@ static int txgbe_sw_init(struct wx *wx)
291315 wx -> mac .max_tx_queues = TXGBE_SP_MAX_TX_QUEUES ;
292316 wx -> mac .max_rx_queues = TXGBE_SP_MAX_RX_QUEUES ;
293317 wx -> mac .mcft_size = TXGBE_SP_MC_TBL_SIZE ;
318+ wx -> mac .rx_pb_size = TXGBE_SP_RX_PB_SIZE ;
319+ wx -> mac .tx_pb_size = TXGBE_SP_TDB_PB_SZ ;
294320
295321 /* PCI config space info */
296322 err = wx_sw_init (wx );
@@ -345,7 +371,7 @@ static int txgbe_open(struct net_device *netdev)
345371 struct wx * wx = netdev_priv (netdev );
346372 int err ;
347373
348- err = wx_setup_isb_resources (wx );
374+ err = wx_setup_resources (wx );
349375 if (err )
350376 goto err_reset ;
351377
@@ -379,7 +405,7 @@ static void txgbe_close_suspend(struct wx *wx)
379405 txgbe_disable_device (wx );
380406
381407 wx_free_irq (wx );
382- wx_free_isb_resources (wx );
408+ wx_free_resources (wx );
383409}
384410
385411/**
@@ -399,7 +425,7 @@ static int txgbe_close(struct net_device *netdev)
399425
400426 txgbe_down (wx );
401427 wx_free_irq (wx );
402- wx_free_isb_resources (wx );
428+ wx_free_resources (wx );
403429 wx_control_hw (wx , false);
404430
405431 return 0 ;
@@ -445,6 +471,7 @@ static const struct net_device_ops txgbe_netdev_ops = {
445471 .ndo_open = txgbe_open ,
446472 .ndo_stop = txgbe_close ,
447473 .ndo_start_xmit = txgbe_xmit_frame ,
474+ .ndo_set_rx_mode = wx_set_rx_mode ,
448475 .ndo_validate_addr = eth_validate_addr ,
449476 .ndo_set_mac_address = wx_set_mac ,
450477};
@@ -549,6 +576,16 @@ static int txgbe_probe(struct pci_dev *pdev,
549576 }
550577
551578 netdev -> features |= NETIF_F_HIGHDMA ;
579+ netdev -> features = NETIF_F_SG ;
580+
581+ /* copy netdev features into list of user selectable features */
582+ netdev -> hw_features |= netdev -> features | NETIF_F_RXALL ;
583+
584+ netdev -> priv_flags |= IFF_UNICAST_FLT ;
585+ netdev -> priv_flags |= IFF_SUPP_NOFCS ;
586+
587+ netdev -> min_mtu = ETH_MIN_MTU ;
588+ netdev -> max_mtu = TXGBE_MAX_JUMBO_FRAME_SIZE - (ETH_HLEN + ETH_FCS_LEN );
552589
553590 /* make sure the EEPROM is good */
554591 err = txgbe_validate_eeprom_checksum (wx , NULL );
0 commit comments