ixgbe: Drop unused code for setting up unicast addresses
authorEmil Tantilov <emil.s.tantilov@intel.com>
Sat, 19 Feb 2011 08:43:34 +0000 (08:43 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 3 Mar 2011 11:31:01 +0000 (03:31 -0800)
This change removes the unused code that was setting up the uc_addr_list.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ixgbe/ixgbe_82598.c
drivers/net/ixgbe/ixgbe_82599.c
drivers/net/ixgbe/ixgbe_common.c
drivers/net/ixgbe/ixgbe_common.h
drivers/net/ixgbe/ixgbe_type.h
drivers/net/ixgbe/ixgbe_x540.c

index bff7011f919f14251efd06abde68ac10ea1adeb1..a5b83b775b6cf32135a2c524dc15253d38aaa3bb 100644 (file)
@@ -1198,7 +1198,6 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
        .set_vmdq               = &ixgbe_set_vmdq_82598,
        .clear_vmdq             = &ixgbe_clear_vmdq_82598,
        .init_rx_addrs          = &ixgbe_init_rx_addrs_generic,
-       .update_uc_addr_list    = &ixgbe_update_uc_addr_list_generic,
        .update_mc_addr_list    = &ixgbe_update_mc_addr_list_generic,
        .enable_mc              = &ixgbe_enable_mc_generic,
        .disable_mc             = &ixgbe_disable_mc_generic,
index 126a06fa2a12ca57d442bc16f55bead4d57a4b86..69d345b1ecf4a2b7b0f4420af509bc77d621dce3 100644 (file)
@@ -2035,7 +2035,6 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
        .set_vmdq               = &ixgbe_set_vmdq_generic,
        .clear_vmdq             = &ixgbe_clear_vmdq_generic,
        .init_rx_addrs          = &ixgbe_init_rx_addrs_generic,
-       .update_uc_addr_list    = &ixgbe_update_uc_addr_list_generic,
        .update_mc_addr_list    = &ixgbe_update_mc_addr_list_generic,
        .enable_mc              = &ixgbe_enable_mc_generic,
        .disable_mc             = &ixgbe_disable_mc_generic,
index b94634f4168950d8750bfb7ee4076a2ffbb7e57e..4fa195e88f3e46a5521fb2fbcc1d40f7cfac36b3 100644 (file)
@@ -47,7 +47,6 @@ static void ixgbe_lower_eeprom_clk(struct ixgbe_hw *hw, u32 *eec);
 static void ixgbe_release_eeprom(struct ixgbe_hw *hw);
 
 static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr);
-static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
 static s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num);
 
 /**
@@ -1366,104 +1365,6 @@ s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw)
        return 0;
 }
 
-/**
- *  ixgbe_add_uc_addr - Adds a secondary unicast address.
- *  @hw: pointer to hardware structure
- *  @addr: new address
- *
- *  Adds it to unused receive address register or goes into promiscuous mode.
- **/
-static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
-{
-       u32 rar_entries = hw->mac.num_rar_entries;
-       u32 rar;
-
-       hw_dbg(hw, " UC Addr = %.2X %.2X %.2X %.2X %.2X %.2X\n",
-                 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
-
-       /*
-        * Place this address in the RAR if there is room,
-        * else put the controller into promiscuous mode
-        */
-       if (hw->addr_ctrl.rar_used_count < rar_entries) {
-               rar = hw->addr_ctrl.rar_used_count;
-               hw->mac.ops.set_rar(hw, rar, addr, vmdq, IXGBE_RAH_AV);
-               hw_dbg(hw, "Added a secondary address to RAR[%d]\n", rar);
-               hw->addr_ctrl.rar_used_count++;
-       } else {
-               hw->addr_ctrl.overflow_promisc++;
-       }
-
-       hw_dbg(hw, "ixgbe_add_uc_addr Complete\n");
-}
-
-/**
- *  ixgbe_update_uc_addr_list_generic - Updates MAC list of secondary addresses
- *  @hw: pointer to hardware structure
- *  @netdev: pointer to net device structure
- *
- *  The given list replaces any existing list.  Clears the secondary addrs from
- *  receive address registers.  Uses unused receive address registers for the
- *  first secondary addresses, and falls back to promiscuous mode as needed.
- *
- *  Drivers using secondary unicast addresses must set user_set_promisc when
- *  manually putting the device into promiscuous mode.
- **/
-s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw,
-                                     struct net_device *netdev)
-{
-       u32 i;
-       u32 old_promisc_setting = hw->addr_ctrl.overflow_promisc;
-       u32 uc_addr_in_use;
-       u32 fctrl;
-       struct netdev_hw_addr *ha;
-
-       /*
-        * Clear accounting of old secondary address list,
-        * don't count RAR[0]
-        */
-       uc_addr_in_use = hw->addr_ctrl.rar_used_count - 1;
-       hw->addr_ctrl.rar_used_count -= uc_addr_in_use;
-       hw->addr_ctrl.overflow_promisc = 0;
-
-       /* Zero out the other receive addresses */
-       hw_dbg(hw, "Clearing RAR[1-%d]\n", uc_addr_in_use + 1);
-       for (i = 0; i < uc_addr_in_use; i++) {
-               IXGBE_WRITE_REG(hw, IXGBE_RAL(1+i), 0);
-               IXGBE_WRITE_REG(hw, IXGBE_RAH(1+i), 0);
-       }
-
-       /* Add the new addresses */
-       netdev_for_each_uc_addr(ha, netdev) {
-               hw_dbg(hw, " Adding the secondary addresses:\n");
-               ixgbe_add_uc_addr(hw, ha->addr, 0);
-       }
-
-       if (hw->addr_ctrl.overflow_promisc) {
-               /* enable promisc if not already in overflow or set by user */
-               if (!old_promisc_setting && !hw->addr_ctrl.user_set_promisc) {
-                       hw_dbg(hw, " Entering address overflow promisc mode\n");
-                       fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
-                       fctrl |= IXGBE_FCTRL_UPE;
-                       IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
-                       hw->addr_ctrl.uc_set_promisc = true;
-               }
-       } else {
-               /* only disable if set by overflow, not by user */
-               if ((old_promisc_setting && hw->addr_ctrl.uc_set_promisc) &&
-                  !(hw->addr_ctrl.user_set_promisc)) {
-                       hw_dbg(hw, " Leaving address overflow promisc mode\n");
-                       fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
-                       fctrl &= ~IXGBE_FCTRL_UPE;
-                       IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
-                       hw->addr_ctrl.uc_set_promisc = false;
-               }
-       }
-
-       hw_dbg(hw, "ixgbe_update_uc_addr_list_generic Complete\n");
-       return 0;
-}
-
 /**
  *  ixgbe_mta_vector - Determines bit-vector in multicast table to set
  *  @hw: pointer to hardware structure
index 90cceb4a6317085195a51c5347ec5b9266897644..90ac6095c1ca4ce7169f6e49bee770617467a310 100644 (file)
@@ -63,8 +63,6 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index);
 s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw);
 s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw,
                                      struct net_device *netdev);
-s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw,
-                                     struct net_device *netdev);
 s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw);
 s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw);
 s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
index f6d0d4d98dd442d84a51b58d759cc8295d0ef699..8e0a2130f42d2b3fff6d1812bd171aa91f2d1d4c 100644 (file)
@@ -2517,7 +2517,6 @@ struct ixgbe_mac_operations {
        s32 (*set_vmdq)(struct ixgbe_hw *, u32, u32);
        s32 (*clear_vmdq)(struct ixgbe_hw *, u32, u32);
        s32 (*init_rx_addrs)(struct ixgbe_hw *);
-       s32 (*update_uc_addr_list)(struct ixgbe_hw *, struct net_device *);
        s32 (*update_mc_addr_list)(struct ixgbe_hw *, struct net_device *);
        s32 (*enable_mc)(struct ixgbe_hw *);
        s32 (*disable_mc)(struct ixgbe_hw *);
index 3229398630f6a34fc231d4c3b877b81daf6d9f3a..fbc0a8bab396f7c5dfae8fca44b36819a8ace8b0 100644 (file)
@@ -686,7 +686,6 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
        .set_vmdq               = &ixgbe_set_vmdq_generic,
        .clear_vmdq             = &ixgbe_clear_vmdq_generic,
        .init_rx_addrs          = &ixgbe_init_rx_addrs_generic,
-       .update_uc_addr_list    = &ixgbe_update_uc_addr_list_generic,
        .update_mc_addr_list    = &ixgbe_update_mc_addr_list_generic,
        .enable_mc              = &ixgbe_enable_mc_generic,
        .disable_mc             = &ixgbe_disable_mc_generic,