Commit 22999798 authored by Sony Chacko's avatar Sony Chacko Committed by David S. Miller

qlcnic: get board name API

Cleanup get board information API.
Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 15087c2b
...@@ -1444,7 +1444,7 @@ void qlcnic_set_eswitch_port_features(struct qlcnic_adapter *, ...@@ -1444,7 +1444,7 @@ void qlcnic_set_eswitch_port_features(struct qlcnic_adapter *,
*/ */
#define QLCNIC_MAX_BOARD_NAME_LEN 100 #define QLCNIC_MAX_BOARD_NAME_LEN 100
struct qlcnic_brdinfo { struct qlcnic_board_info {
unsigned short vendor; unsigned short vendor;
unsigned short device; unsigned short device;
unsigned short sub_vendor; unsigned short sub_vendor;
...@@ -1452,30 +1452,6 @@ struct qlcnic_brdinfo { ...@@ -1452,30 +1452,6 @@ struct qlcnic_brdinfo {
char short_name[QLCNIC_MAX_BOARD_NAME_LEN]; char short_name[QLCNIC_MAX_BOARD_NAME_LEN];
}; };
static const struct qlcnic_brdinfo qlcnic_boards[] = {
{0x1077, 0x8020, 0x1077, 0x203,
"8200 Series Single Port 10GbE Converged Network Adapter "
"(TCP/IP Networking)"},
{0x1077, 0x8020, 0x1077, 0x207,
"8200 Series Dual Port 10GbE Converged Network Adapter "
"(TCP/IP Networking)"},
{0x1077, 0x8020, 0x1077, 0x20b,
"3200 Series Dual Port 10Gb Intelligent Ethernet Adapter"},
{0x1077, 0x8020, 0x1077, 0x20c,
"3200 Series Quad Port 1Gb Intelligent Ethernet Adapter"},
{0x1077, 0x8020, 0x1077, 0x20f,
"3200 Series Single Port 10Gb Intelligent Ethernet Adapter"},
{0x1077, 0x8020, 0x103c, 0x3733,
"NC523SFP 10Gb 2-port Server Adapter"},
{0x1077, 0x8020, 0x103c, 0x3346,
"CN1000Q Dual Port Converged Network Adapter"},
{0x1077, 0x8020, 0x1077, 0x210,
"QME8242-k 10GbE Dual Port Mezzanine Card"},
{0x1077, 0x8020, 0x0, 0x0, "cLOM8214 1/10GbE Controller"},
};
#define NUM_SUPPORTED_BOARDS ARRAY_SIZE(qlcnic_boards)
static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring) static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring)
{ {
if (likely(tx_ring->producer < tx_ring->sw_consumer)) if (likely(tx_ring->producer < tx_ring->sw_consumer))
......
...@@ -118,6 +118,30 @@ static const u32 msi_tgt_status[8] = { ...@@ -118,6 +118,30 @@ static const u32 msi_tgt_status[8] = {
ISR_INT_TARGET_STATUS_F6, ISR_INT_TARGET_STATUS_F7 ISR_INT_TARGET_STATUS_F6, ISR_INT_TARGET_STATUS_F7
}; };
static const struct qlcnic_board_info qlcnic_boards[] = {
{0x1077, 0x8020, 0x1077, 0x203,
"8200 Series Single Port 10GbE Converged Network Adapter"
"(TCP/IP Networking)"},
{0x1077, 0x8020, 0x1077, 0x207,
"8200 Series Dual Port 10GbE Converged Network Adapter"
"(TCP/IP Networking)"},
{0x1077, 0x8020, 0x1077, 0x20b,
"3200 Series Dual Port 10Gb Intelligent Ethernet Adapter"},
{0x1077, 0x8020, 0x1077, 0x20c,
"3200 Series Quad Port 1Gb Intelligent Ethernet Adapter"},
{0x1077, 0x8020, 0x1077, 0x20f,
"3200 Series Single Port 10Gb Intelligent Ethernet Adapter"},
{0x1077, 0x8020, 0x103c, 0x3733,
"NC523SFP 10Gb 2-port Server Adapter"},
{0x1077, 0x8020, 0x103c, 0x3346,
"CN1000Q Dual Port Converged Network Adapter"},
{0x1077, 0x8020, 0x1077, 0x210,
"QME8242-k 10GbE Dual Port Mezzanine Card"},
{0x1077, 0x8020, 0x0, 0x0, "cLOM8214 1/10GbE Controller"},
};
#define NUM_SUPPORTED_BOARDS ARRAY_SIZE(qlcnic_boards)
static const static const
struct qlcnic_legacy_intr_set legacy_intr[] = QLCNIC_LEGACY_INTR_CONFIG; struct qlcnic_legacy_intr_set legacy_intr[] = QLCNIC_LEGACY_INTR_CONFIG;
...@@ -525,7 +549,7 @@ static int qlcnic_setup_pci_map(struct pci_dev *pdev, ...@@ -525,7 +549,7 @@ static int qlcnic_setup_pci_map(struct pci_dev *pdev,
return 0; return 0;
} }
static void get_brd_name(struct qlcnic_adapter *adapter, char *name) static void qlcnic_get_board_name(struct qlcnic_adapter *adapter, char *name)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
int i, found = 0; int i, found = 0;
...@@ -1467,7 +1491,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1467,7 +1491,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct qlcnic_adapter *adapter = NULL; struct qlcnic_adapter *adapter = NULL;
int err, pci_using_dac = -1; int err, pci_using_dac = -1;
uint8_t revision_id; uint8_t revision_id;
char brd_name[QLCNIC_MAX_BOARD_NAME_LEN]; char board_name[QLCNIC_MAX_BOARD_NAME_LEN];
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
...@@ -1547,11 +1571,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1547,11 +1571,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_warn(&pdev->dev, "failed to read mac addr\n"); dev_warn(&pdev->dev, "failed to read mac addr\n");
if (adapter->portnum == 0) { if (adapter->portnum == 0) {
get_brd_name(adapter, brd_name); qlcnic_get_board_name(adapter, board_name);
pr_info("%s: %s Board Chip rev 0x%x\n", pr_info("%s: %s Board Chip rev 0x%x\n",
module_name(THIS_MODULE), module_name(THIS_MODULE),
brd_name, adapter->ahw->revision_id); board_name, adapter->ahw->revision_id);
} }
qlcnic_clear_stats(adapter); qlcnic_clear_stats(adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment