aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
authorPJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>2009-05-17 08:32:25 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-18 00:04:07 -0400
commit0365e6e4373a5a447746fd7ac26074b92f180311 (patch)
treebe64a7a7cdc95dc3651655f3c09783a13fba629f /drivers/net/ixgbe/ixgbe_main.c
parentebc06eeb7260ecad3bd69202ba6291138691d27b (diff)
ixgbe: Add FCoE Storage MAC Address support
This patch implements the Storage Address entrypoint from the net device. It will read the SAN MAC addresses from the EEPROM of the 82599 hardware, and make them available to the FCoE stack through the net device. Also, add/del the SAN MAC address to the netdev dev_addr_list via the kernel api dev_addr_add()/dev_addr_del() when there is a valid SAN MAC supported by the HW. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index d69a0526f24d..fe0ac8bdb10b 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4799,6 +4799,48 @@ static int ixgbe_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
4799 return mdio_mii_ioctl(&adapter->hw.phy.mdio, if_mii(req), cmd); 4799 return mdio_mii_ioctl(&adapter->hw.phy.mdio, if_mii(req), cmd);
4800} 4800}
4801 4801
4802/**
4803 * ixgbe_add_sanmac_netdev - Add the SAN MAC address to the corresponding
4804 * netdev->dev_addr_list
4805 * @netdev: network interface device structure
4806 *
4807 * Returns non-zero on failure
4808 **/
4809static int ixgbe_add_sanmac_netdev(struct net_device *dev)
4810{
4811 int err = 0;
4812 struct ixgbe_adapter *adapter = netdev_priv(dev);
4813 struct ixgbe_mac_info *mac = &adapter->hw.mac;
4814
4815 if (is_valid_ether_addr(mac->san_addr)) {
4816 rtnl_lock();
4817 err = dev_addr_add(dev, mac->san_addr, NETDEV_HW_ADDR_T_SAN);
4818 rtnl_unlock();
4819 }
4820 return err;
4821}
4822
4823/**
4824 * ixgbe_del_sanmac_netdev - Removes the SAN MAC address to the corresponding
4825 * netdev->dev_addr_list
4826 * @netdev: network interface device structure
4827 *
4828 * Returns non-zero on failure
4829 **/
4830static int ixgbe_del_sanmac_netdev(struct net_device *dev)
4831{
4832 int err = 0;
4833 struct ixgbe_adapter *adapter = netdev_priv(dev);
4834 struct ixgbe_mac_info *mac = &adapter->hw.mac;
4835
4836 if (is_valid_ether_addr(mac->san_addr)) {
4837 rtnl_lock();
4838 err = dev_addr_del(dev, mac->san_addr, NETDEV_HW_ADDR_T_SAN);
4839 rtnl_unlock();
4840 }
4841 return err;
4842}
4843
4802#ifdef CONFIG_NET_POLL_CONTROLLER 4844#ifdef CONFIG_NET_POLL_CONTROLLER
4803/* 4845/*
4804 * Polling 'interrupt' - used by things like netconsole to send skbs 4846 * Polling 'interrupt' - used by things like netconsole to send skbs
@@ -5159,6 +5201,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5159 ixgbe_setup_dca(adapter); 5201 ixgbe_setup_dca(adapter);
5160 } 5202 }
5161#endif 5203#endif
5204 /* add san mac addr to netdev */
5205 ixgbe_add_sanmac_netdev(netdev);
5162 5206
5163 dev_info(&pdev->dev, "Intel(R) 10 Gigabit Network Connection\n"); 5207 dev_info(&pdev->dev, "Intel(R) 10 Gigabit Network Connection\n");
5164 cards_found++; 5208 cards_found++;
@@ -5229,6 +5273,10 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
5229 ixgbe_cleanup_fcoe(adapter); 5273 ixgbe_cleanup_fcoe(adapter);
5230 5274
5231#endif /* IXGBE_FCOE */ 5275#endif /* IXGBE_FCOE */
5276
5277 /* remove the added san mac */
5278 ixgbe_del_sanmac_netdev(netdev);
5279
5232 if (netdev->reg_state == NETREG_REGISTERED) 5280 if (netdev->reg_state == NETREG_REGISTERED)
5233 unregister_netdev(netdev); 5281 unregister_netdev(netdev);
5234 5282