@@ -218,13 +218,24 @@ static int txgbe_request_irq(struct wx *wx)
218
218
219
219
static void txgbe_up_complete (struct wx * wx )
220
220
{
221
+ u32 reg ;
222
+
221
223
wx_control_hw (wx , true);
222
224
wx_configure_vectors (wx );
223
225
224
226
/* clear any pending interrupts, may auto mask */
225
227
rd32 (wx , WX_PX_IC );
226
228
rd32 (wx , WX_PX_MISC_IC );
227
229
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 );
228
239
}
229
240
230
241
static void txgbe_reset (struct wx * wx )
@@ -246,11 +257,17 @@ static void txgbe_reset(struct wx *wx)
246
257
static void txgbe_disable_device (struct wx * wx )
247
258
{
248
259
struct net_device * netdev = wx -> netdev ;
260
+ u32 i ;
249
261
250
262
wx_disable_pcie_master (wx );
251
263
/* disable receives */
252
264
wx_disable_rx (wx );
253
265
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
+
254
271
netif_carrier_off (netdev );
255
272
netif_tx_disable (netdev );
256
273
@@ -268,6 +285,13 @@ static void txgbe_disable_device(struct wx *wx)
268
285
wr32m (wx , WX_MAC_TX_CFG , WX_MAC_TX_CFG_TE , 0 );
269
286
}
270
287
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
+
271
295
/* Disable the Tx DMA engine */
272
296
wr32m (wx , WX_TDM_CTL , WX_TDM_CTL_TE , 0 );
273
297
}
@@ -291,6 +315,8 @@ static int txgbe_sw_init(struct wx *wx)
291
315
wx -> mac .max_tx_queues = TXGBE_SP_MAX_TX_QUEUES ;
292
316
wx -> mac .max_rx_queues = TXGBE_SP_MAX_RX_QUEUES ;
293
317
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 ;
294
320
295
321
/* PCI config space info */
296
322
err = wx_sw_init (wx );
@@ -345,7 +371,7 @@ static int txgbe_open(struct net_device *netdev)
345
371
struct wx * wx = netdev_priv (netdev );
346
372
int err ;
347
373
348
- err = wx_setup_isb_resources (wx );
374
+ err = wx_setup_resources (wx );
349
375
if (err )
350
376
goto err_reset ;
351
377
@@ -379,7 +405,7 @@ static void txgbe_close_suspend(struct wx *wx)
379
405
txgbe_disable_device (wx );
380
406
381
407
wx_free_irq (wx );
382
- wx_free_isb_resources (wx );
408
+ wx_free_resources (wx );
383
409
}
384
410
385
411
/**
@@ -399,7 +425,7 @@ static int txgbe_close(struct net_device *netdev)
399
425
400
426
txgbe_down (wx );
401
427
wx_free_irq (wx );
402
- wx_free_isb_resources (wx );
428
+ wx_free_resources (wx );
403
429
wx_control_hw (wx , false);
404
430
405
431
return 0 ;
@@ -445,6 +471,7 @@ static const struct net_device_ops txgbe_netdev_ops = {
445
471
.ndo_open = txgbe_open ,
446
472
.ndo_stop = txgbe_close ,
447
473
.ndo_start_xmit = txgbe_xmit_frame ,
474
+ .ndo_set_rx_mode = wx_set_rx_mode ,
448
475
.ndo_validate_addr = eth_validate_addr ,
449
476
.ndo_set_mac_address = wx_set_mac ,
450
477
};
@@ -549,6 +576,16 @@ static int txgbe_probe(struct pci_dev *pdev,
549
576
}
550
577
551
578
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 );
552
589
553
590
/* make sure the EEPROM is good */
554
591
err = txgbe_validate_eeprom_checksum (wx , NULL );
0 commit comments