aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_common.c
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-02-19 03:43:34 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-03 06:31:01 -0500
commit79d5892521144d455114e4820eb30fec802b9c39 (patch)
tree4d90c7a51b9b632ac8b84d1c6b37d15a9cadb06c /drivers/net/ixgbe/ixgbe_common.c
parent80960ab040dd6b3a82bfb2db9b1aaf5d6ccffbb7 (diff)
ixgbe: Drop unused code for setting up unicast addresses
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>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_common.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_common.c99
1 files changed, 0 insertions, 99 deletions
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index b94634f41689..4fa195e88f3e 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -47,7 +47,6 @@ static void ixgbe_lower_eeprom_clk(struct ixgbe_hw *hw, u32 *eec);
47static void ixgbe_release_eeprom(struct ixgbe_hw *hw); 47static void ixgbe_release_eeprom(struct ixgbe_hw *hw);
48 48
49static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr); 49static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr);
50static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
51static s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num); 50static s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num);
52 51
53/** 52/**
@@ -1367,104 +1366,6 @@ s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw)
1367} 1366}
1368 1367
1369/** 1368/**
1370 * ixgbe_add_uc_addr - Adds a secondary unicast address.
1371 * @hw: pointer to hardware structure
1372 * @addr: new address
1373 *
1374 * Adds it to unused receive address register or goes into promiscuous mode.
1375 **/
1376static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
1377{
1378 u32 rar_entries = hw->mac.num_rar_entries;
1379 u32 rar;
1380
1381 hw_dbg(hw, " UC Addr = %.2X %.2X %.2X %.2X %.2X %.2X\n",
1382 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
1383
1384 /*
1385 * Place this address in the RAR if there is room,
1386 * else put the controller into promiscuous mode
1387 */
1388 if (hw->addr_ctrl.rar_used_count < rar_entries) {
1389 rar = hw->addr_ctrl.rar_used_count;
1390 hw->mac.ops.set_rar(hw, rar, addr, vmdq, IXGBE_RAH_AV);
1391 hw_dbg(hw, "Added a secondary address to RAR[%d]\n", rar);
1392 hw->addr_ctrl.rar_used_count++;
1393 } else {
1394 hw->addr_ctrl.overflow_promisc++;
1395 }
1396
1397 hw_dbg(hw, "ixgbe_add_uc_addr Complete\n");
1398}
1399
1400/**
1401 * ixgbe_update_uc_addr_list_generic - Updates MAC list of secondary addresses
1402 * @hw: pointer to hardware structure
1403 * @netdev: pointer to net device structure
1404 *
1405 * The given list replaces any existing list. Clears the secondary addrs from
1406 * receive address registers. Uses unused receive address registers for the
1407 * first secondary addresses, and falls back to promiscuous mode as needed.
1408 *
1409 * Drivers using secondary unicast addresses must set user_set_promisc when
1410 * manually putting the device into promiscuous mode.
1411 **/
1412s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw,
1413 struct net_device *netdev)
1414{
1415 u32 i;
1416 u32 old_promisc_setting = hw->addr_ctrl.overflow_promisc;
1417 u32 uc_addr_in_use;
1418 u32 fctrl;
1419 struct netdev_hw_addr *ha;
1420
1421 /*
1422 * Clear accounting of old secondary address list,
1423 * don't count RAR[0]
1424 */
1425 uc_addr_in_use = hw->addr_ctrl.rar_used_count - 1;
1426 hw->addr_ctrl.rar_used_count -= uc_addr_in_use;
1427 hw->addr_ctrl.overflow_promisc = 0;
1428
1429 /* Zero out the other receive addresses */
1430 hw_dbg(hw, "Clearing RAR[1-%d]\n", uc_addr_in_use + 1);
1431 for (i = 0; i < uc_addr_in_use; i++) {
1432 IXGBE_WRITE_REG(hw, IXGBE_RAL(1+i), 0);
1433 IXGBE_WRITE_REG(hw, IXGBE_RAH(1+i), 0);
1434 }
1435
1436 /* Add the new addresses */
1437 netdev_for_each_uc_addr(ha, netdev) {
1438 hw_dbg(hw, " Adding the secondary addresses:\n");
1439 ixgbe_add_uc_addr(hw, ha->addr, 0);
1440 }
1441
1442 if (hw->addr_ctrl.overflow_promisc) {
1443 /* enable promisc if not already in overflow or set by user */
1444 if (!old_promisc_setting && !hw->addr_ctrl.user_set_promisc) {
1445 hw_dbg(hw, " Entering address overflow promisc mode\n");
1446 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
1447 fctrl |= IXGBE_FCTRL_UPE;
1448 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
1449 hw->addr_ctrl.uc_set_promisc = true;
1450 }
1451 } else {
1452 /* only disable if set by overflow, not by user */
1453 if ((old_promisc_setting && hw->addr_ctrl.uc_set_promisc) &&
1454 !(hw->addr_ctrl.user_set_promisc)) {
1455 hw_dbg(hw, " Leaving address overflow promisc mode\n");
1456 fctrl = IXGBE_READ_REG(hw, IXGBE_FCTRL);
1457 fctrl &= ~IXGBE_FCTRL_UPE;
1458 IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
1459 hw->addr_ctrl.uc_set_promisc = false;
1460 }
1461 }
1462
1463 hw_dbg(hw, "ixgbe_update_uc_addr_list_generic Complete\n");
1464 return 0;
1465}
1466
1467/**
1468 * ixgbe_mta_vector - Determines bit-vector in multicast table to set 1369 * ixgbe_mta_vector - Determines bit-vector in multicast table to set
1469 * @hw: pointer to hardware structure 1370 * @hw: pointer to hardware structure
1470 * @mc_addr: the multicast address 1371 * @mc_addr: the multicast address