aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2010-06-29 03:52:12 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-29 18:12:36 -0400
commit45918e2fe582d845a2649ffa015754ae44be9a8b (patch)
tree6d5c6481b3eb301d8fa160f493daef7202fbce0f /drivers
parent51f932c4870f785d73d5fd5fed33306e63cf4efc (diff)
qlcnic: Remove obsolete code
Current driver uses FW API version 2 and thus code corresponding to FW API version 1 has become obsolete. Clean up this from the driver. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/qlcnic/qlcnic_ctx.c26
-rw-r--r--drivers/net/qlcnic/qlcnic_hdr.h6
-rw-r--r--drivers/net/qlcnic/qlcnic_init.c16
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c22
4 files changed, 13 insertions, 57 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c
index 941cd0873f87..7969a7a87c85 100644
--- a/drivers/net/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/qlcnic/qlcnic_ctx.c
@@ -224,12 +224,7 @@ qlcnic_fw_cmd_create_rx_ctx(struct qlcnic_adapter *adapter)
224 rds_ring = &recv_ctx->rds_rings[i]; 224 rds_ring = &recv_ctx->rds_rings[i];
225 225
226 reg = le32_to_cpu(prsp_rds[i].host_producer_crb); 226 reg = le32_to_cpu(prsp_rds[i].host_producer_crb);
227 if (adapter->fw_hal_version == QLCNIC_FW_BASE) 227 rds_ring->crb_rcv_producer = adapter->ahw.pci_base0 + reg;
228 rds_ring->crb_rcv_producer = qlcnic_get_ioaddr(adapter,
229 QLCNIC_REG(reg - 0x200));
230 else
231 rds_ring->crb_rcv_producer = adapter->ahw.pci_base0 +
232 reg;
233 } 228 }
234 229
235 prsp_sds = ((struct qlcnic_cardrsp_sds_ring *) 230 prsp_sds = ((struct qlcnic_cardrsp_sds_ring *)
@@ -241,16 +236,8 @@ qlcnic_fw_cmd_create_rx_ctx(struct qlcnic_adapter *adapter)
241 reg = le32_to_cpu(prsp_sds[i].host_consumer_crb); 236 reg = le32_to_cpu(prsp_sds[i].host_consumer_crb);
242 reg2 = le32_to_cpu(prsp_sds[i].interrupt_crb); 237 reg2 = le32_to_cpu(prsp_sds[i].interrupt_crb);
243 238
244 if (adapter->fw_hal_version == QLCNIC_FW_BASE) { 239 sds_ring->crb_sts_consumer = adapter->ahw.pci_base0 + reg;
245 sds_ring->crb_sts_consumer = qlcnic_get_ioaddr(adapter, 240 sds_ring->crb_intr_mask = adapter->ahw.pci_base0 + reg2;
246 QLCNIC_REG(reg - 0x200));
247 sds_ring->crb_intr_mask = qlcnic_get_ioaddr(adapter,
248 QLCNIC_REG(reg2 - 0x200));
249 } else {
250 sds_ring->crb_sts_consumer = adapter->ahw.pci_base0 +
251 reg;
252 sds_ring->crb_intr_mask = adapter->ahw.pci_base0 + reg2;
253 }
254 } 241 }
255 242
256 recv_ctx->state = le32_to_cpu(prsp->host_ctx_state); 243 recv_ctx->state = le32_to_cpu(prsp->host_ctx_state);
@@ -352,12 +339,7 @@ qlcnic_fw_cmd_create_tx_ctx(struct qlcnic_adapter *adapter)
352 339
353 if (err == QLCNIC_RCODE_SUCCESS) { 340 if (err == QLCNIC_RCODE_SUCCESS) {
354 temp = le32_to_cpu(prsp->cds_ring.host_producer_crb); 341 temp = le32_to_cpu(prsp->cds_ring.host_producer_crb);
355 if (adapter->fw_hal_version == QLCNIC_FW_BASE) 342 tx_ring->crb_cmd_producer = adapter->ahw.pci_base0 + temp;
356 tx_ring->crb_cmd_producer = qlcnic_get_ioaddr(adapter,
357 QLCNIC_REG(temp - 0x200));
358 else
359 tx_ring->crb_cmd_producer = adapter->ahw.pci_base0 +
360 temp;
361 343
362 adapter->tx_context_id = 344 adapter->tx_context_id =
363 le16_to_cpu(prsp->context_id); 345 le16_to_cpu(prsp->context_id);
diff --git a/drivers/net/qlcnic/qlcnic_hdr.h b/drivers/net/qlcnic/qlcnic_hdr.h
index 7b81cab27002..15fc32070be3 100644
--- a/drivers/net/qlcnic/qlcnic_hdr.h
+++ b/drivers/net/qlcnic/qlcnic_hdr.h
@@ -778,12 +778,6 @@ enum {
778 QLCNIC_NON_PRIV_FUNC = 2 778 QLCNIC_NON_PRIV_FUNC = 2
779}; 779};
780 780
781/* FW HAL api version */
782enum {
783 QLCNIC_FW_BASE = 1,
784 QLCNIC_FW_NPAR = 2
785};
786
787#define QLC_DEV_DRV_DEFAULT 0x11111111 781#define QLC_DEV_DRV_DEFAULT 0x11111111
788 782
789#define LSB(x) ((uint8_t)(x)) 783#define LSB(x) ((uint8_t)(x))
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 6678127ed4f2..75ba744b173c 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -548,16 +548,14 @@ qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) {
548 int timeo; 548 int timeo;
549 u32 val; 549 u32 val;
550 550
551 if (adapter->fw_hal_version == QLCNIC_FW_BASE) { 551 val = QLCRD32(adapter, QLCNIC_CRB_DEV_PARTITION_INFO);
552 val = QLCRD32(adapter, QLCNIC_CRB_DEV_PARTITION_INFO); 552 val = QLC_DEV_GET_DRV(val, adapter->portnum);
553 val = QLC_DEV_GET_DRV(val, adapter->portnum); 553 if ((val & 0x3) != QLCNIC_TYPE_NIC) {
554 if ((val & 0x3) != QLCNIC_TYPE_NIC) { 554 dev_err(&adapter->pdev->dev,
555 dev_err(&adapter->pdev->dev, 555 "Not an Ethernet NIC func=%u\n", val);
556 "Not an Ethernet NIC func=%u\n", val); 556 return -EIO;
557 return -EIO;
558 }
559 adapter->physical_port = (val >> 2);
560 } 557 }
558 adapter->physical_port = (val >> 2);
561 if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo)) 559 if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo))
562 timeo = 30; 560 timeo = 30;
563 561
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 3b71dfcd6d44..981aa91efc8c 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -377,15 +377,6 @@ static const struct net_device_ops qlcnic_netdev_ops = {
377}; 377};
378 378
379static struct qlcnic_nic_template qlcnic_ops = { 379static struct qlcnic_nic_template qlcnic_ops = {
380 .get_mac_addr = qlcnic_get_mac_addr,
381 .config_bridged_mode = qlcnic_config_bridged_mode,
382 .config_led = qlcnic_config_led,
383 .set_ilb_mode = qlcnic_set_ilb_mode,
384 .clear_ilb_mode = qlcnic_clear_ilb_mode,
385 .start_firmware = qlcnic_start_firmware
386};
387
388static struct qlcnic_nic_template qlcnic_pf_ops = {
389 .get_mac_addr = qlcnic_get_mac_address, 380 .get_mac_addr = qlcnic_get_mac_address,
390 .config_bridged_mode = qlcnic_config_bridged_mode, 381 .config_bridged_mode = qlcnic_config_bridged_mode,
391 .config_led = qlcnic_config_led, 382 .config_led = qlcnic_config_led,
@@ -534,15 +525,6 @@ qlcnic_get_driver_mode(struct qlcnic_adapter *adapter)
534 525
535 /* Determine FW API version */ 526 /* Determine FW API version */
536 adapter->fw_hal_version = readl(adapter->ahw.pci_base0 + QLCNIC_FW_API); 527 adapter->fw_hal_version = readl(adapter->ahw.pci_base0 + QLCNIC_FW_API);
537 if (adapter->fw_hal_version == ~0) {
538 adapter->nic_ops = &qlcnic_ops;
539 adapter->fw_hal_version = QLCNIC_FW_BASE;
540 adapter->ahw.pci_func = PCI_FUNC(adapter->pdev->devfn);
541 adapter->capabilities = QLCRD32(adapter, CRB_FW_CAPABILITIES_1);
542 dev_info(&adapter->pdev->dev,
543 "FW does not support nic partion\n");
544 return adapter->fw_hal_version;
545 }
546 528
547 /* Find PCI function number */ 529 /* Find PCI function number */
548 pci_read_config_dword(adapter->pdev, QLCNIC_MSIX_TABLE_OFFSET, &func); 530 pci_read_config_dword(adapter->pdev, QLCNIC_MSIX_TABLE_OFFSET, &func);
@@ -569,7 +551,7 @@ qlcnic_get_driver_mode(struct qlcnic_adapter *adapter)
569 switch (priv_level) { 551 switch (priv_level) {
570 case QLCNIC_MGMT_FUNC: 552 case QLCNIC_MGMT_FUNC:
571 adapter->op_mode = QLCNIC_MGMT_FUNC; 553 adapter->op_mode = QLCNIC_MGMT_FUNC;
572 adapter->nic_ops = &qlcnic_pf_ops; 554 adapter->nic_ops = &qlcnic_ops;
573 qlcnic_get_pci_info(adapter); 555 qlcnic_get_pci_info(adapter);
574 /* Set privilege level for other functions */ 556 /* Set privilege level for other functions */
575 qlcnic_set_function_modes(adapter); 557 qlcnic_set_function_modes(adapter);
@@ -582,7 +564,7 @@ qlcnic_get_driver_mode(struct qlcnic_adapter *adapter)
582 dev_info(&adapter->pdev->dev, 564 dev_info(&adapter->pdev->dev,
583 "HAL Version: %d, Privileged function\n", 565 "HAL Version: %d, Privileged function\n",
584 adapter->fw_hal_version); 566 adapter->fw_hal_version);
585 adapter->nic_ops = &qlcnic_pf_ops; 567 adapter->nic_ops = &qlcnic_ops;
586 break; 568 break;
587 case QLCNIC_NON_PRIV_FUNC: 569 case QLCNIC_NON_PRIV_FUNC:
588 adapter->op_mode = QLCNIC_NON_PRIV_FUNC; 570 adapter->op_mode = QLCNIC_NON_PRIV_FUNC;