diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-07-26 16:07:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-27 14:15:25 -0400 |
commit | 4f96b988e8d404b8b32aefed27503b4538949a3c (patch) | |
tree | 22d6aa87665cd02c4f3815357e9242bc50ff428e /drivers/net/netxen | |
parent | 24767ab16913bc27ba7a85698e5c0f591368647d (diff) |
netxen: clean up firmware version checks
NX2031 firmware version will never be > 4.0.0, so replace
(adapter->fw_major < 4) checks with pci revision ID check.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 2 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ctx.c | 6 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 2 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 6 |
5 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index e017827472ac..b58d0b217424 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1299,7 +1299,7 @@ struct netxen_adapter { | |||
1299 | 1299 | ||
1300 | nx_nic_intr_coalesce_t coal; | 1300 | nx_nic_intr_coalesce_t coal; |
1301 | 1301 | ||
1302 | u32 fw_major; | 1302 | u32 resv5; |
1303 | u32 fw_version; | 1303 | u32 fw_version; |
1304 | const struct firmware *fw; | 1304 | const struct firmware *fw; |
1305 | }; | 1305 | }; |
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 9f8ae4719e2f..9e0469643d34 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c | |||
@@ -647,7 +647,7 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter) | |||
647 | } | 647 | } |
648 | rds_ring->desc_head = (struct rcv_desc *)addr; | 648 | rds_ring->desc_head = (struct rcv_desc *)addr; |
649 | 649 | ||
650 | if (adapter->fw_major < 4) | 650 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) |
651 | rds_ring->crb_rcv_producer = | 651 | rds_ring->crb_rcv_producer = |
652 | recv_crb_registers[port].crb_rcv_producer[ring]; | 652 | recv_crb_registers[port].crb_rcv_producer[ring]; |
653 | } | 653 | } |
@@ -675,7 +675,7 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter) | |||
675 | } | 675 | } |
676 | 676 | ||
677 | 677 | ||
678 | if (adapter->fw_major >= 4) { | 678 | if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
679 | err = nx_fw_cmd_create_rx_ctx(adapter); | 679 | err = nx_fw_cmd_create_rx_ctx(adapter); |
680 | if (err) | 680 | if (err) |
681 | goto err_out_free; | 681 | goto err_out_free; |
@@ -705,7 +705,7 @@ void netxen_free_hw_resources(struct netxen_adapter *adapter) | |||
705 | 705 | ||
706 | int port = adapter->portnum; | 706 | int port = adapter->portnum; |
707 | 707 | ||
708 | if (adapter->fw_major >= 4) { | 708 | if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
709 | nx_fw_cmd_destroy_rx_ctx(adapter); | 709 | nx_fw_cmd_destroy_rx_ctx(adapter); |
710 | nx_fw_cmd_destroy_tx_ctx(adapter); | 710 | nx_fw_cmd_destroy_tx_ctx(adapter); |
711 | } else { | 711 | } else { |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 088611bb5bdb..ddb9deb12b33 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -2045,7 +2045,6 @@ void netxen_nic_get_firmware_info(struct netxen_adapter *adapter) | |||
2045 | fw_minor = NXRD32(adapter, NETXEN_FW_VERSION_MINOR); | 2045 | fw_minor = NXRD32(adapter, NETXEN_FW_VERSION_MINOR); |
2046 | fw_build = NXRD32(adapter, NETXEN_FW_VERSION_SUB); | 2046 | fw_build = NXRD32(adapter, NETXEN_FW_VERSION_SUB); |
2047 | 2047 | ||
2048 | adapter->fw_major = fw_major; | ||
2049 | adapter->fw_version = NETXEN_VERSION_CODE(fw_major, fw_minor, fw_build); | 2048 | adapter->fw_version = NETXEN_VERSION_CODE(fw_major, fw_minor, fw_build); |
2050 | 2049 | ||
2051 | if (adapter->portnum == 0) { | 2050 | if (adapter->portnum == 0) { |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 91358459adb4..ef7f1b1b8454 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -1477,7 +1477,7 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid, | |||
1477 | NXWR32(adapter, rds_ring->crb_rcv_producer, | 1477 | NXWR32(adapter, rds_ring->crb_rcv_producer, |
1478 | (producer-1) & (rds_ring->num_desc-1)); | 1478 | (producer-1) & (rds_ring->num_desc-1)); |
1479 | 1479 | ||
1480 | if (adapter->fw_major < 4) { | 1480 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
1481 | /* | 1481 | /* |
1482 | * Write a doorbell msg to tell phanmon of change in | 1482 | * Write a doorbell msg to tell phanmon of change in |
1483 | * receive ring producer | 1483 | * receive ring producer |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 1aa850a0b895..5d52630ecd88 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -932,7 +932,7 @@ netxen_nic_attach(struct netxen_adapter *adapter) | |||
932 | goto err_out_free_sw; | 932 | goto err_out_free_sw; |
933 | } | 933 | } |
934 | 934 | ||
935 | if (adapter->fw_major < 4) { | 935 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
936 | tx_ring = adapter->tx_ring; | 936 | tx_ring = adapter->tx_ring; |
937 | tx_ring->crb_cmd_producer = crb_cmd_producer[adapter->portnum]; | 937 | tx_ring->crb_cmd_producer = crb_cmd_producer[adapter->portnum]; |
938 | tx_ring->crb_cmd_consumer = crb_cmd_consumer[adapter->portnum]; | 938 | tx_ring->crb_cmd_consumer = crb_cmd_consumer[adapter->portnum]; |
@@ -1103,7 +1103,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1103 | * See if the firmware gave us a virtual-physical port mapping. | 1103 | * See if the firmware gave us a virtual-physical port mapping. |
1104 | */ | 1104 | */ |
1105 | adapter->physical_port = adapter->portnum; | 1105 | adapter->physical_port = adapter->portnum; |
1106 | if (adapter->fw_major < 4) { | 1106 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
1107 | i = NXRD32(adapter, CRB_V2P(adapter->portnum)); | 1107 | i = NXRD32(adapter, CRB_V2P(adapter->portnum)); |
1108 | if (i != 0x55555555) | 1108 | if (i != 0x55555555) |
1109 | adapter->physical_port = i; | 1109 | adapter->physical_port = i; |
@@ -1727,7 +1727,7 @@ static irqreturn_t netxen_intr(int irq, void *data) | |||
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | /* clear interrupt */ | 1729 | /* clear interrupt */ |
1730 | if (adapter->fw_major < 4) | 1730 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) |
1731 | netxen_nic_disable_int(sds_ring); | 1731 | netxen_nic_disable_int(sds_ring); |
1732 | 1732 | ||
1733 | adapter->pci_write_immediate(adapter, | 1733 | adapter->pci_write_immediate(adapter, |