From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Following changes have been made:
1. Obtain capabilities of a NIC partition,
2. Configure tx bandwidth of particular NIC partition.
3. Configure the eswitch for setting port mirroring, enable mac
learning, promiscuous mode.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
drivers/net/qlcnic/qlcnic.h | 77 ++++++-
drivers/net/qlcnic/qlcnic_ctx.c | 90 ++------
drivers/net/qlcnic/qlcnic_main.c | 450 +++++++++++++++++++++++++++++++++++++-
3 files changed, 542 insertions(+), 75 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 3675678..60ea7cb 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -959,8 +959,6 @@ struct qlcnic_adapter {
u16 switch_mode;
u16 max_tx_ques;
u16 max_rx_ques;
- u16 min_tx_bw;
- u16 max_tx_bw;
u16 max_mtu;
u32 fw_hal_version;
@@ -984,7 +982,7 @@ struct qlcnic_adapter {
u64 dev_rst_time;
- struct qlcnic_pci_info *npars;
+ struct qlcnic_npar_info *npars;
struct qlcnic_eswitch *eswitch;
struct qlcnic_nic_template *nic_ops;
@@ -1042,6 +1040,18 @@ struct qlcnic_pci_info {
u8 reserved2[106];
};
+struct qlcnic_npar_info {
+ u16 vlan_id;
+ u8 phy_port;
+ u8 type;
+ u8 active;
+ u8 enable_pm;
+ u8 dest_npar;
+ u8 host_vlan_tag;
+ u8 promisc_mode;
+ u8 discard_tagged;
+ u8 mac_learning;
+};
struct qlcnic_eswitch {
u8 port;
u8 active_vports;
@@ -1057,6 +1067,63 @@ struct qlcnic_eswitch {
#define QLCNIC_SWITCH_PORT_MIRRORING BIT_4
};
+
+/* Return codes for Error handling */
+#define QL_STATUS_INVALID_PARAM -1
+
+#define MAX_BW 10000
+#define MIN_BW ...