diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-12-05 07:23:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-08 23:37:46 -0500 |
commit | 634d7df89a93a52561f598bf9512f4cf72946954 (patch) | |
tree | 45c9dcfb4ef96f076997db0e14068b2d76507e3e /drivers/net | |
parent | f2251f668e9527b87c9ba7256e7497cb49abbc20 (diff) |
netxen: fix firmware type check
Unified firmware image may not contain MN type of firmware.
Driver should fall back to NOMN firmware type instead
of going to flash.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 80a667460514..02f8d4b4db63 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -619,17 +619,20 @@ nx_set_product_offs(struct netxen_adapter *adapter) | |||
619 | uint32_t i; | 619 | uint32_t i; |
620 | __le32 entries; | 620 | __le32 entries; |
621 | 621 | ||
622 | int mn_present = (NX_IS_REVISION_P2(adapter->ahw.revision_id)) ? | ||
623 | 1 : netxen_p3_has_mn(adapter); | ||
624 | |||
622 | ptab_descr = nx_get_table_desc(unirom, NX_UNI_DIR_SECT_PRODUCT_TBL); | 625 | ptab_descr = nx_get_table_desc(unirom, NX_UNI_DIR_SECT_PRODUCT_TBL); |
623 | if (ptab_descr == NULL) | 626 | if (ptab_descr == NULL) |
624 | return -1; | 627 | return -1; |
625 | 628 | ||
626 | entries = cpu_to_le32(ptab_descr->num_entries); | 629 | entries = cpu_to_le32(ptab_descr->num_entries); |
627 | 630 | ||
631 | nomn: | ||
628 | for (i = 0; i < entries; i++) { | 632 | for (i = 0; i < entries; i++) { |
629 | 633 | ||
630 | __le32 flags, file_chiprev, offs; | 634 | __le32 flags, file_chiprev, offs; |
631 | u8 chiprev = adapter->ahw.revision_id; | 635 | u8 chiprev = adapter->ahw.revision_id; |
632 | int mn_present = netxen_p3_has_mn(adapter); | ||
633 | uint32_t flagbit; | 636 | uint32_t flagbit; |
634 | 637 | ||
635 | offs = cpu_to_le32(ptab_descr->findex) + | 638 | offs = cpu_to_le32(ptab_descr->findex) + |
@@ -647,6 +650,11 @@ nx_set_product_offs(struct netxen_adapter *adapter) | |||
647 | } | 650 | } |
648 | } | 651 | } |
649 | 652 | ||
653 | if (mn_present && NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | ||
654 | mn_present = 0; | ||
655 | goto nomn; | ||
656 | } | ||
657 | |||
650 | return -1; | 658 | return -1; |
651 | } | 659 | } |
652 | 660 | ||
@@ -1021,6 +1029,10 @@ netxen_p3_has_mn(struct netxen_adapter *adapter) | |||
1021 | u32 capability, flashed_ver; | 1029 | u32 capability, flashed_ver; |
1022 | capability = 0; | 1030 | capability = 0; |
1023 | 1031 | ||
1032 | /* NX2031 always had MN */ | ||
1033 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) | ||
1034 | return 1; | ||
1035 | |||
1024 | netxen_rom_fast_read(adapter, | 1036 | netxen_rom_fast_read(adapter, |
1025 | NX_FW_VERSION_OFFSET, (int *)&flashed_ver); | 1037 | NX_FW_VERSION_OFFSET, (int *)&flashed_ver); |
1026 | flashed_ver = NETXEN_DECODE_VERSION(flashed_ver); | 1038 | flashed_ver = NETXEN_DECODE_VERSION(flashed_ver); |