aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-17 23:53:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-17 23:53:52 -0400
commitf205ce83a766c08965ec78342f138cdc00631fba (patch)
tree7a9d2db6c16594ef7c730ca93a87131cf0abca41 /drivers/net/benet/be_main.c
parent3dc95666df0e1ae5b7381a8ec97a583bb3ce4306 (diff)
parentb31c50a7f9e93a61d14740dedcbbf2c376998bc7 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (66 commits) be2net: fix some cmds to use mccq instead of mbox atl1e: fix 2.6.31-git4 -- ATL1E 0000:03:00.0: DMA-API: device driver frees DMA pkt_sched: Fix qstats.qlen updating in dump_stats ipv6: Log the affected address when DAD failure occurs wl12xx: Fix print_mac() conversion. af_iucv: fix race when queueing skbs on the backlog queue af_iucv: do not call iucv_sock_kill() twice af_iucv: handle non-accepted sockets after resuming from suspend af_iucv: fix race in __iucv_sock_wait() iucv: use correct output register in iucv_query_maxconn() iucv: fix iucv_buffer_cpumask check when calling IUCV functions iucv: suspend/resume error msg for left over pathes wl12xx: switch to %pM to print the mac address b44: the poll handler b44_poll must not enable IRQ unconditionally ipv6: Ignore route option with ROUTER_PREF_INVALID bonding: make ab_arp select active slaves as other modes cfg80211: fix SME connect rc80211_minstrel: fix contention window calculation ssb/sdio: fix printk format warnings p54usb: add Zcomax XG-705A usbid ...
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r--drivers/net/benet/be_main.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index ce11bba2cb67..409cf0595903 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -135,7 +135,7 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
135 return status; 135 return status;
136} 136}
137 137
138static void netdev_stats_update(struct be_adapter *adapter) 138void netdev_stats_update(struct be_adapter *adapter)
139{ 139{
140 struct be_hw_stats *hw_stats = hw_stats_from_cmd(adapter->stats.cmd.va); 140 struct be_hw_stats *hw_stats = hw_stats_from_cmd(adapter->stats.cmd.va);
141 struct be_rxf_stats *rxf_stats = &hw_stats->rxf; 141 struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
@@ -431,8 +431,7 @@ static int make_tx_wrbs(struct be_adapter *adapter,
431} 431}
432 432
433static netdev_tx_t be_xmit(struct sk_buff *skb, 433static netdev_tx_t be_xmit(struct sk_buff *skb,
434 struct net_device *netdev) 434 struct net_device *netdev)
435
436{ 435{
437 struct be_adapter *adapter = netdev_priv(netdev); 436 struct be_adapter *adapter = netdev_priv(netdev);
438 struct be_tx_obj *tx_obj = &adapter->tx_obj; 437 struct be_tx_obj *tx_obj = &adapter->tx_obj;
@@ -490,11 +489,11 @@ static int be_change_mtu(struct net_device *netdev, int new_mtu)
490 * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured, 489 * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured,
491 * set the BE in promiscuous VLAN mode. 490 * set the BE in promiscuous VLAN mode.
492 */ 491 */
493static void be_vid_config(struct net_device *netdev) 492static int be_vid_config(struct be_adapter *adapter)
494{ 493{
495 struct be_adapter *adapter = netdev_priv(netdev);
496 u16 vtag[BE_NUM_VLANS_SUPPORTED]; 494 u16 vtag[BE_NUM_VLANS_SUPPORTED];
497 u16 ntags = 0, i; 495 u16 ntags = 0, i;
496 int status;
498 497
499 if (adapter->num_vlans <= BE_NUM_VLANS_SUPPORTED) { 498 if (adapter->num_vlans <= BE_NUM_VLANS_SUPPORTED) {
500 /* Construct VLAN Table to give to HW */ 499 /* Construct VLAN Table to give to HW */
@@ -504,12 +503,13 @@ static void be_vid_config(struct net_device *netdev)
504 ntags++; 503 ntags++;
505 } 504 }
506 } 505 }
507 be_cmd_vlan_config(adapter, adapter->if_handle, 506 status = be_cmd_vlan_config(adapter, adapter->if_handle,
508 vtag, ntags, 1, 0); 507 vtag, ntags, 1, 0);
509 } else { 508 } else {
510 be_cmd_vlan_config(adapter, adapter->if_handle, 509 status = be_cmd_vlan_config(adapter, adapter->if_handle,
511 NULL, 0, 1, 1); 510 NULL, 0, 1, 1);
512 } 511 }
512 return status;
513} 513}
514 514
515static void be_vlan_register(struct net_device *netdev, struct vlan_group *grp) 515static void be_vlan_register(struct net_device *netdev, struct vlan_group *grp)
@@ -532,7 +532,7 @@ static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
532 adapter->num_vlans++; 532 adapter->num_vlans++;
533 adapter->vlan_tag[vid] = 1; 533 adapter->vlan_tag[vid] = 1;
534 534
535 be_vid_config(netdev); 535 be_vid_config(adapter);
536} 536}
537 537
538static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) 538static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
@@ -543,7 +543,7 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
543 adapter->vlan_tag[vid] = 0; 543 adapter->vlan_tag[vid] = 0;
544 544
545 vlan_group_set_device(adapter->vlan_grp, vid, NULL); 545 vlan_group_set_device(adapter->vlan_grp, vid, NULL);
546 be_vid_config(netdev); 546 be_vid_config(adapter);
547} 547}
548 548
549static void be_set_multicast_list(struct net_device *netdev) 549static void be_set_multicast_list(struct net_device *netdev)
@@ -1444,12 +1444,8 @@ static void be_worker(struct work_struct *work)
1444{ 1444{
1445 struct be_adapter *adapter = 1445 struct be_adapter *adapter =
1446 container_of(work, struct be_adapter, work.work); 1446 container_of(work, struct be_adapter, work.work);
1447 int status;
1448 1447
1449 /* Get Stats */ 1448 be_cmd_get_stats(adapter, &adapter->stats.cmd);
1450 status = be_cmd_get_stats(adapter, &adapter->stats.cmd);
1451 if (!status)
1452 netdev_stats_update(adapter);
1453 1449
1454 /* Set EQ delay */ 1450 /* Set EQ delay */
1455 be_rx_eqd_update(adapter); 1451 be_rx_eqd_update(adapter);
@@ -1622,11 +1618,6 @@ static int be_setup(struct be_adapter *adapter)
1622 if (status != 0) 1618 if (status != 0)
1623 goto do_none; 1619 goto do_none;
1624 1620
1625 be_vid_config(netdev);
1626
1627 status = be_cmd_set_flow_control(adapter, true, true);
1628 if (status != 0)
1629 goto if_destroy;
1630 1621
1631 status = be_tx_queues_create(adapter); 1622 status = be_tx_queues_create(adapter);
1632 if (status != 0) 1623 if (status != 0)
@@ -1640,8 +1631,17 @@ static int be_setup(struct be_adapter *adapter)
1640 if (status != 0) 1631 if (status != 0)
1641 goto rx_qs_destroy; 1632 goto rx_qs_destroy;
1642 1633
1634 status = be_vid_config(adapter);
1635 if (status != 0)
1636 goto mccqs_destroy;
1637
1638 status = be_cmd_set_flow_control(adapter, true, true);
1639 if (status != 0)
1640 goto mccqs_destroy;
1643 return 0; 1641 return 0;
1644 1642
1643mccqs_destroy:
1644 be_mcc_queues_destroy(adapter);
1645rx_qs_destroy: 1645rx_qs_destroy:
1646 be_rx_queues_destroy(adapter); 1646 be_rx_queues_destroy(adapter);
1647tx_qs_destroy: 1647tx_qs_destroy: