aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_main.c
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit@netxen.com>2009-07-27 14:15:54 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-27 14:15:54 -0400
commit7042cd8f148345bfca6c336f009c96a416674f5e (patch)
tree4a37459aeb3696283f29106abee7d50ab3ed6916 /drivers/net/netxen/netxen_nic_main.c
parent028afe719855a157e32450c36b7a12e1f9e85abe (diff)
netxen: support for ethtool set ringparam
Add support for ethtool -G to tune rx and tx ring sizes per interface basis. This is only supported for NX3031 based cards. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index ff7ee9c43ef5..2bbefa6a37bc 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -910,6 +910,9 @@ netxen_nic_attach(struct netxen_adapter *adapter)
910 struct nx_host_rds_ring *rds_ring; 910 struct nx_host_rds_ring *rds_ring;
911 struct nx_host_tx_ring *tx_ring; 911 struct nx_host_tx_ring *tx_ring;
912 912
913 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC)
914 return 0;
915
913 err = netxen_init_firmware(adapter); 916 err = netxen_init_firmware(adapter);
914 if (err != 0) { 917 if (err != 0) {
915 printk(KERN_ERR "Failed to init firmware\n"); 918 printk(KERN_ERR "Failed to init firmware\n");
@@ -973,6 +976,9 @@ err_out_free_sw:
973static void 976static void
974netxen_nic_detach(struct netxen_adapter *adapter) 977netxen_nic_detach(struct netxen_adapter *adapter)
975{ 978{
979 if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
980 return;
981
976 netxen_free_hw_resources(adapter); 982 netxen_free_hw_resources(adapter);
977 netxen_release_rx_buffers(adapter); 983 netxen_release_rx_buffers(adapter);
978 netxen_nic_free_irq(adapter); 984 netxen_nic_free_irq(adapter);
@@ -981,6 +987,30 @@ netxen_nic_detach(struct netxen_adapter *adapter)
981 adapter->is_up = 0; 987 adapter->is_up = 0;
982} 988}
983 989
990int
991netxen_nic_reset_context(struct netxen_adapter *adapter)
992{
993 int err = 0;
994 struct net_device *netdev = adapter->netdev;
995
996 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) {
997
998 if (netif_running(netdev))
999 netxen_nic_down(adapter, netdev);
1000
1001 netxen_nic_detach(adapter);
1002
1003 err = netxen_nic_attach(adapter);
1004 if (err)
1005 goto done;
1006
1007 if (netif_running(netdev))
1008 err = netxen_nic_up(adapter, netdev);
1009 }
1010done:
1011 return err;
1012}
1013
984static int 1014static int
985netxen_setup_netdev(struct netxen_adapter *adapter, 1015netxen_setup_netdev(struct netxen_adapter *adapter,
986 struct net_device *netdev) 1016 struct net_device *netdev)
@@ -1202,9 +1232,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
1202 1232
1203 unregister_netdev(netdev); 1233 unregister_netdev(netdev);
1204 1234
1205 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) { 1235 netxen_nic_detach(adapter);
1206 netxen_nic_detach(adapter);
1207 }
1208 1236
1209 if (adapter->portnum == 0) 1237 if (adapter->portnum == 0)
1210 netxen_free_dummy_dma(adapter); 1238 netxen_free_dummy_dma(adapter);
@@ -1236,8 +1264,7 @@ netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state)
1236 if (netif_running(netdev)) 1264 if (netif_running(netdev))
1237 netxen_nic_down(adapter, netdev); 1265 netxen_nic_down(adapter, netdev);
1238 1266
1239 if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) 1267 netxen_nic_detach(adapter);
1240 netxen_nic_detach(adapter);
1241 1268
1242 pci_save_state(pdev); 1269 pci_save_state(pdev);
1243 1270
@@ -1298,11 +1325,9 @@ static int netxen_nic_open(struct net_device *netdev)
1298 if (adapter->driver_mismatch) 1325 if (adapter->driver_mismatch)
1299 return -EIO; 1326 return -EIO;
1300 1327
1301 if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { 1328 err = netxen_nic_attach(adapter);
1302 err = netxen_nic_attach(adapter); 1329 if (err)
1303 if (err) 1330 return err;
1304 return err;
1305 }
1306 1331
1307 err = netxen_nic_up(adapter, netdev); 1332 err = netxen_nic_up(adapter, netdev);
1308 if (err) 1333 if (err)