rds_ring = &recv_ctx->rds_rings[i];
reg = le32_to_cpu(prsp_rds[i].host_producer_crb);
- if (adapter->fw_hal_version == QLCNIC_FW_BASE)
- rds_ring->crb_rcv_producer = qlcnic_get_ioaddr(adapter,
- QLCNIC_REG(reg - 0x200));
- else
- rds_ring->crb_rcv_producer = adapter->ahw.pci_base0 +
- reg;
+ rds_ring->crb_rcv_producer = adapter->ahw.pci_base0 + reg;
}
prsp_sds = ((struct qlcnic_cardrsp_sds_ring *)
reg = le32_to_cpu(prsp_sds[i].host_consumer_crb);
reg2 = le32_to_cpu(prsp_sds[i].interrupt_crb);
- if (adapter->fw_hal_version == QLCNIC_FW_BASE) {
- sds_ring->crb_sts_consumer = qlcnic_get_ioaddr(adapter,
- QLCNIC_REG(reg - 0x200));
- sds_ring->crb_intr_mask = qlcnic_get_ioaddr(adapter,
- QLCNIC_REG(reg2 - 0x200));
- } else {
- sds_ring->crb_sts_consumer = adapter->ahw.pci_base0 +
- reg;
- sds_ring->crb_intr_mask = adapter->ahw.pci_base0 + reg2;
- }
+ sds_ring->crb_sts_consumer = adapter->ahw.pci_base0 + reg;
+ sds_ring->crb_intr_mask = adapter->ahw.pci_base0 + reg2;
}
recv_ctx->state = le32_to_cpu(prsp->host_ctx_state);
if (err == QLCNIC_RCODE_SUCCESS) {
temp = le32_to_cpu(prsp->cds_ring.host_producer_crb);
- if (adapter->fw_hal_version == QLCNIC_FW_BASE)
- tx_ring->crb_cmd_producer = qlcnic_get_ioaddr(adapter,
- QLCNIC_REG(temp - 0x200));
- else
- tx_ring->crb_cmd_producer = adapter->ahw.pci_base0 +
- temp;
+ tx_ring->crb_cmd_producer = adapter->ahw.pci_base0 + temp;
adapter->tx_context_id =
le16_to_cpu(prsp->context_id);
QLCNIC_NON_PRIV_FUNC = 2
};
-/* FW HAL api version */
-enum {
- QLCNIC_FW_BASE = 1,
- QLCNIC_FW_NPAR = 2
-};
-
#define QLC_DEV_DRV_DEFAULT 0x11111111
#define LSB(x) ((uint8_t)(x))
int timeo;
u32 val;
- if (adapter->fw_hal_version == QLCNIC_FW_BASE) {
- val = QLCRD32(adapter, QLCNIC_CRB_DEV_PARTITION_INFO);
- val = QLC_DEV_GET_DRV(val, adapter->portnum);
- if ((val & 0x3) != QLCNIC_TYPE_NIC) {
- dev_err(&adapter->pdev->dev,
- "Not an Ethernet NIC func=%u\n", val);
- return -EIO;
- }
- adapter->physical_port = (val >> 2);
+ val = QLCRD32(adapter, QLCNIC_CRB_DEV_PARTITION_INFO);
+ val = QLC_DEV_GET_DRV(val, adapter->portnum);
+ if ((val & 0x3) != QLCNIC_TYPE_NIC) {
+ dev_err(&adapter->pdev->dev,
+ "Not an Ethernet NIC func=%u\n", val);
+ return -EIO;
}
+ adapter->physical_port = (val >> 2);
if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo))
timeo = 30;
};
static struct qlcnic_nic_template qlcnic_ops = {
- .get_mac_addr = qlcnic_get_mac_addr,
- .config_bridged_mode = qlcnic_config_bridged_mode,
- .config_led = qlcnic_config_led,
- .set_ilb_mode = qlcnic_set_ilb_mode,
- .clear_ilb_mode = qlcnic_clear_ilb_mode,
- .start_firmware = qlcnic_start_firmware
-};
-
-static struct qlcnic_nic_template qlcnic_pf_ops = {
.get_mac_addr = qlcnic_get_mac_address,
.config_bridged_mode = qlcnic_config_bridged_mode,
.config_led = qlcnic_config_led,
/* Determine FW API version */
adapter->fw_hal_version = readl(adapter->ahw.pci_base0 + QLCNIC_FW_API);
- if (adapter->fw_hal_version == ~0) {
- adapter->nic_ops = &qlcnic_ops;
- adapter->fw_hal_version = QLCNIC_FW_BASE;
- adapter->ahw.pci_func = PCI_FUNC(adapter->pdev->devfn);
- adapter->capabilities = QLCRD32(adapter, CRB_FW_CAPABILITIES_1);
- dev_info(&adapter->pdev->dev,
- "FW does not support nic partion\n");
- return adapter->fw_hal_version;
- }
/* Find PCI function number */
pci_read_config_dword(adapter->pdev, QLCNIC_MSIX_TABLE_OFFSET, &func);
switch (priv_level) {
case QLCNIC_MGMT_FUNC:
adapter->op_mode = QLCNIC_MGMT_FUNC;
- adapter->nic_ops = &qlcnic_pf_ops;
+ adapter->nic_ops = &qlcnic_ops;
qlcnic_get_pci_info(adapter);
/* Set privilege level for other functions */
qlcnic_set_function_modes(adapter);
dev_info(&adapter->pdev->dev,
"HAL Version: %d, Privileged function\n",
adapter->fw_hal_version);
- adapter->nic_ops = &qlcnic_pf_ops;
+ adapter->nic_ops = &qlcnic_ops;
break;
case QLCNIC_NON_PRIV_FUNC:
adapter->op_mode = QLCNIC_NON_PRIV_FUNC;