diff options
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index a4ce80e776b6..3dc68034c21d 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -549,47 +549,32 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) | |||
549 | be_vid_config(netdev); | 549 | be_vid_config(netdev); |
550 | } | 550 | } |
551 | 551 | ||
552 | static void be_set_multicast_filter(struct net_device *netdev) | 552 | static void be_set_multicast_list(struct net_device *netdev) |
553 | { | 553 | { |
554 | struct be_adapter *adapter = netdev_priv(netdev); | 554 | struct be_adapter *adapter = netdev_priv(netdev); |
555 | struct dev_mc_list *mc_ptr; | 555 | struct be_ctrl_info *ctrl = &adapter->ctrl; |
556 | u8 mac_addr[32][ETH_ALEN]; | ||
557 | int i = 0; | ||
558 | 556 | ||
559 | if (netdev->flags & IFF_ALLMULTI) { | 557 | if (netdev->flags & IFF_PROMISC) { |
560 | /* set BE in Multicast promiscuous */ | 558 | be_cmd_promiscuous_config(ctrl, adapter->port_num, 1); |
561 | be_cmd_mcast_mac_set(&adapter->ctrl, | 559 | adapter->promiscuous = true; |
562 | adapter->if_handle, NULL, 0, true); | 560 | goto done; |
563 | return; | ||
564 | } | 561 | } |
565 | 562 | ||
566 | for (mc_ptr = netdev->mc_list; mc_ptr; mc_ptr = mc_ptr->next) { | 563 | /* BE was previously in promiscous mode; disable it */ |
567 | memcpy(&mac_addr[i][0], mc_ptr->dmi_addr, ETH_ALEN); | 564 | if (adapter->promiscuous) { |
568 | if (++i >= 32) { | 565 | adapter->promiscuous = false; |
569 | be_cmd_mcast_mac_set(&adapter->ctrl, | 566 | be_cmd_promiscuous_config(ctrl, adapter->port_num, 0); |
570 | adapter->if_handle, &mac_addr[0][0], i, false); | ||
571 | i = 0; | ||
572 | } | ||
573 | |||
574 | } | 567 | } |
575 | 568 | ||
576 | if (i) { | 569 | if (netdev->flags & IFF_ALLMULTI) { |
577 | /* reset the promiscuous mode also. */ | 570 | be_cmd_multicast_set(ctrl, adapter->if_handle, NULL, 0); |
578 | be_cmd_mcast_mac_set(&adapter->ctrl, | 571 | goto done; |
579 | adapter->if_handle, &mac_addr[0][0], i, false); | ||
580 | } | 572 | } |
581 | } | ||
582 | |||
583 | static void be_set_multicast_list(struct net_device *netdev) | ||
584 | { | ||
585 | struct be_adapter *adapter = netdev_priv(netdev); | ||
586 | 573 | ||
587 | if (netdev->flags & IFF_PROMISC) { | 574 | be_cmd_multicast_set(ctrl, adapter->if_handle, netdev->mc_list, |
588 | be_cmd_promiscuous_config(&adapter->ctrl, adapter->port_num, 1); | 575 | netdev->mc_count); |
589 | } else { | 576 | done: |
590 | be_cmd_promiscuous_config(&adapter->ctrl, adapter->port_num, 0); | 577 | return; |
591 | be_set_multicast_filter(netdev); | ||
592 | } | ||
593 | } | 578 | } |
594 | 579 | ||
595 | static void be_rx_rate_update(struct be_adapter *adapter) | 580 | static void be_rx_rate_update(struct be_adapter *adapter) |