aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_hw.c
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2010-06-01 07:28:51 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-02 05:24:03 -0400
commit2e9d722db6617ed10204bfa9cd60552620592a43 (patch)
treeda905f18459e55a8cb534d757f5b14a3e9da73d5 /drivers/net/qlcnic/qlcnic_hw.c
parentdd8f61d7ff92eb8a4626565ca37b209b3a8a9ce2 (diff)
qlcnic: NIC Partitioning - Add basic infrastructure support
Following changes have been added to enable the adapter to work in NIC partitioning mode where multiple PCI functions of an adapter port can be configured to work as NIC functions. The first function that is enumerated on the PCI bus assumes the role of management function which, besides being able to do all the NIC functionality, can configure other NIC partitions. Other NIC functions can be configured as privileged or non privileged functions. Privileged function can not configure other NIC functions but can do all the NIC functionality including any firmware initialization, chip reset etc. Non privileged functions can do only basic IO. For chip reset etc, it depends on the privilege or management function. 1. Added code to determine PCI function number independent of kernel API. 2. Added Driver - FW version 2.0 support. 3. Changed producer and consumer register offset calculation. 4. Added management and privileged operation modes for npar functions. A module parameter has been added to control it. 5. Added support for configuring the eswitch in the adapter. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_hw.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_hw.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c
index 0c2e1f08f459..f776956d2d6c 100644
--- a/drivers/net/qlcnic/qlcnic_hw.c
+++ b/drivers/net/qlcnic/qlcnic_hw.c
@@ -538,7 +538,7 @@ int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
538 return rv; 538 return rv;
539} 539}
540 540
541int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, int enable) 541int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable)
542{ 542{
543 struct qlcnic_nic_req req; 543 struct qlcnic_nic_req req;
544 u64 word; 544 u64 word;
@@ -704,21 +704,15 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu)
704 return rc; 704 return rc;
705} 705}
706 706
707int qlcnic_get_mac_addr(struct qlcnic_adapter *adapter, u64 *mac) 707int qlcnic_get_mac_addr(struct qlcnic_adapter *adapter, u8 *mac)
708{ 708{
709 u32 crbaddr, mac_hi, mac_lo; 709 u32 crbaddr;
710 int pci_func = adapter->ahw.pci_func; 710 int pci_func = adapter->ahw.pci_func;
711 711
712 crbaddr = CRB_MAC_BLOCK_START + 712 crbaddr = CRB_MAC_BLOCK_START +
713 (4 * ((pci_func/2) * 3)) + (4 * (pci_func & 1)); 713 (4 * ((pci_func/2) * 3)) + (4 * (pci_func & 1));
714 714
715 mac_lo = QLCRD32(adapter, crbaddr); 715 qlcnic_fetch_mac(adapter, crbaddr, crbaddr+4, pci_func & 1, mac);
716 mac_hi = QLCRD32(adapter, crbaddr+4);
717
718 if (pci_func & 1)
719 *mac = le64_to_cpu((mac_lo >> 16) | ((u64)mac_hi << 16));
720 else
721 *mac = le64_to_cpu((u64)mac_lo | ((u64)mac_hi << 32));
722 716
723 return 0; 717 return 0;
724} 718}