diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-03-23 18:58:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-26 23:10:03 -0400 |
commit | 2853eb892edb6be1ea13787d0c24fb72c1d1cca5 (patch) | |
tree | 4e8e3ca0f53fbd08cf3d3514b83f5fd2482aed1d /drivers | |
parent | b79d1d54cf0672f764402fe4711ef5306f917bd3 (diff) |
ixgbe: convert to use netdev_for_each_mc_addr
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.c | 16 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.h | 5 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 24 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 3 |
4 files changed, 12 insertions, 36 deletions
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index eb49020903c1..4d1c3a429457 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -1484,26 +1484,24 @@ static void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr) | |||
1484 | /** | 1484 | /** |
1485 | * ixgbe_update_mc_addr_list_generic - Updates MAC list of multicast addresses | 1485 | * ixgbe_update_mc_addr_list_generic - Updates MAC list of multicast addresses |
1486 | * @hw: pointer to hardware structure | 1486 | * @hw: pointer to hardware structure |
1487 | * @mc_addr_list: the list of new multicast addresses | 1487 | * @netdev: pointer to net device structure |
1488 | * @mc_addr_count: number of addresses | ||
1489 | * @next: iterator function to walk the multicast address list | ||
1490 | * | 1488 | * |
1491 | * The given list replaces any existing list. Clears the MC addrs from receive | 1489 | * The given list replaces any existing list. Clears the MC addrs from receive |
1492 | * address registers and the multicast table. Uses unused receive address | 1490 | * address registers and the multicast table. Uses unused receive address |
1493 | * registers for the first multicast addresses, and hashes the rest into the | 1491 | * registers for the first multicast addresses, and hashes the rest into the |
1494 | * multicast table. | 1492 | * multicast table. |
1495 | **/ | 1493 | **/ |
1496 | s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list, | 1494 | s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, |
1497 | u32 mc_addr_count, ixgbe_mc_addr_itr next) | 1495 | struct net_device *netdev) |
1498 | { | 1496 | { |
1497 | struct dev_addr_list *dmi; | ||
1499 | u32 i; | 1498 | u32 i; |
1500 | u32 vmdq; | ||
1501 | 1499 | ||
1502 | /* | 1500 | /* |
1503 | * Set the new number of MC addresses that we are being requested to | 1501 | * Set the new number of MC addresses that we are being requested to |
1504 | * use. | 1502 | * use. |
1505 | */ | 1503 | */ |
1506 | hw->addr_ctrl.num_mc_addrs = mc_addr_count; | 1504 | hw->addr_ctrl.num_mc_addrs = netdev_mc_count(netdev); |
1507 | hw->addr_ctrl.mta_in_use = 0; | 1505 | hw->addr_ctrl.mta_in_use = 0; |
1508 | 1506 | ||
1509 | /* Clear the MTA */ | 1507 | /* Clear the MTA */ |
@@ -1512,9 +1510,9 @@ s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list, | |||
1512 | IXGBE_WRITE_REG(hw, IXGBE_MTA(i), 0); | 1510 | IXGBE_WRITE_REG(hw, IXGBE_MTA(i), 0); |
1513 | 1511 | ||
1514 | /* Add the new addresses */ | 1512 | /* Add the new addresses */ |
1515 | for (i = 0; i < mc_addr_count; i++) { | 1513 | netdev_for_each_mc_addr(dmi, netdev) { |
1516 | hw_dbg(hw, " Adding the multicast addresses:\n"); | 1514 | hw_dbg(hw, " Adding the multicast addresses:\n"); |
1517 | ixgbe_set_mta(hw, next(hw, &mc_addr_list, &vmdq)); | 1515 | ixgbe_set_mta(hw, dmi->dmi_addr); |
1518 | } | 1516 | } |
1519 | 1517 | ||
1520 | /* Enable mta */ | 1518 | /* Enable mta */ |
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h index 13606d4809c9..264eef575cd6 100644 --- a/drivers/net/ixgbe/ixgbe_common.h +++ b/drivers/net/ixgbe/ixgbe_common.h | |||
@@ -56,9 +56,8 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, | |||
56 | u32 enable_addr); | 56 | u32 enable_addr); |
57 | s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index); | 57 | s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index); |
58 | s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw); | 58 | s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw); |
59 | s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list, | 59 | s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, |
60 | u32 mc_addr_count, | 60 | struct net_device *netdev); |
61 | ixgbe_mc_addr_itr func); | ||
62 | s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, | 61 | s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, |
63 | struct net_device *netdev); | 62 | struct net_device *netdev); |
64 | s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw); | 63 | s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 7e4e9504c012..6effa2ca157d 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2537,21 +2537,6 @@ static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) | |||
2537 | } | 2537 | } |
2538 | } | 2538 | } |
2539 | 2539 | ||
2540 | static u8 *ixgbe_addr_list_itr(struct ixgbe_hw *hw, u8 **mc_addr_ptr, u32 *vmdq) | ||
2541 | { | ||
2542 | struct dev_mc_list *mc_ptr; | ||
2543 | u8 *addr = *mc_addr_ptr; | ||
2544 | *vmdq = 0; | ||
2545 | |||
2546 | mc_ptr = container_of(addr, struct dev_mc_list, dmi_addr[0]); | ||
2547 | if (mc_ptr->next) | ||
2548 | *mc_addr_ptr = mc_ptr->next->dmi_addr; | ||
2549 | else | ||
2550 | *mc_addr_ptr = NULL; | ||
2551 | |||
2552 | return addr; | ||
2553 | } | ||
2554 | |||
2555 | /** | 2540 | /** |
2556 | * ixgbe_set_rx_mode - Unicast, Multicast and Promiscuous mode set | 2541 | * ixgbe_set_rx_mode - Unicast, Multicast and Promiscuous mode set |
2557 | * @netdev: network interface device structure | 2542 | * @netdev: network interface device structure |
@@ -2566,8 +2551,6 @@ void ixgbe_set_rx_mode(struct net_device *netdev) | |||
2566 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 2551 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
2567 | struct ixgbe_hw *hw = &adapter->hw; | 2552 | struct ixgbe_hw *hw = &adapter->hw; |
2568 | u32 fctrl, vlnctrl; | 2553 | u32 fctrl, vlnctrl; |
2569 | u8 *addr_list = NULL; | ||
2570 | int addr_count = 0; | ||
2571 | 2554 | ||
2572 | /* Check for Promiscuous and All Multicast modes */ | 2555 | /* Check for Promiscuous and All Multicast modes */ |
2573 | 2556 | ||
@@ -2596,11 +2579,8 @@ void ixgbe_set_rx_mode(struct net_device *netdev) | |||
2596 | hw->mac.ops.update_uc_addr_list(hw, netdev); | 2579 | hw->mac.ops.update_uc_addr_list(hw, netdev); |
2597 | 2580 | ||
2598 | /* reprogram multicast list */ | 2581 | /* reprogram multicast list */ |
2599 | addr_count = netdev_mc_count(netdev); | 2582 | hw->mac.ops.update_mc_addr_list(hw, netdev); |
2600 | if (addr_count) | 2583 | |
2601 | addr_list = netdev->mc_list->dmi_addr; | ||
2602 | hw->mac.ops.update_mc_addr_list(hw, addr_list, addr_count, | ||
2603 | ixgbe_addr_list_itr); | ||
2604 | if (adapter->num_vfs) | 2584 | if (adapter->num_vfs) |
2605 | ixgbe_restore_vf_multicasts(adapter); | 2585 | ixgbe_restore_vf_multicasts(adapter); |
2606 | } | 2586 | } |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 0ed5ab37cc53..c574d0a68f2a 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2416,8 +2416,7 @@ struct ixgbe_mac_operations { | |||
2416 | s32 (*clear_vmdq)(struct ixgbe_hw *, u32, u32); | 2416 | s32 (*clear_vmdq)(struct ixgbe_hw *, u32, u32); |
2417 | s32 (*init_rx_addrs)(struct ixgbe_hw *); | 2417 | s32 (*init_rx_addrs)(struct ixgbe_hw *); |
2418 | s32 (*update_uc_addr_list)(struct ixgbe_hw *, struct net_device *); | 2418 | s32 (*update_uc_addr_list)(struct ixgbe_hw *, struct net_device *); |
2419 | s32 (*update_mc_addr_list)(struct ixgbe_hw *, u8 *, u32, | 2419 | s32 (*update_mc_addr_list)(struct ixgbe_hw *, struct net_device *); |
2420 | ixgbe_mc_addr_itr); | ||
2421 | s32 (*enable_mc)(struct ixgbe_hw *); | 2420 | s32 (*enable_mc)(struct ixgbe_hw *); |
2422 | s32 (*disable_mc)(struct ixgbe_hw *); | 2421 | s32 (*disable_mc)(struct ixgbe_hw *); |
2423 | s32 (*clear_vfta)(struct ixgbe_hw *); | 2422 | s32 (*clear_vfta)(struct ixgbe_hw *); |