Commit 634d7df89a93a52561f598bf9512f4cf72946954
Committed by
David S. Miller
1 parent
f2251f668e
Exists in
master
and in
39 other branches
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>
Showing 1 changed file with 13 additions and 1 deletions Side-by-side Diff
drivers/net/netxen/netxen_nic_init.c
... | ... | @@ -619,17 +619,20 @@ |
619 | 619 | uint32_t i; |
620 | 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 | 625 | ptab_descr = nx_get_table_desc(unirom, NX_UNI_DIR_SECT_PRODUCT_TBL); |
623 | 626 | if (ptab_descr == NULL) |
624 | 627 | return -1; |
625 | 628 | |
626 | 629 | entries = cpu_to_le32(ptab_descr->num_entries); |
627 | 630 | |
631 | +nomn: | |
628 | 632 | for (i = 0; i < entries; i++) { |
629 | 633 | |
630 | 634 | __le32 flags, file_chiprev, offs; |
631 | 635 | u8 chiprev = adapter->ahw.revision_id; |
632 | - int mn_present = netxen_p3_has_mn(adapter); | |
633 | 636 | uint32_t flagbit; |
634 | 637 | |
635 | 638 | offs = cpu_to_le32(ptab_descr->findex) + |
... | ... | @@ -647,6 +650,11 @@ |
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 | 658 | return -1; |
651 | 659 | } |
652 | 660 | |
... | ... | @@ -1020,6 +1028,10 @@ |
1020 | 1028 | { |
1021 | 1029 | u32 capability, flashed_ver; |
1022 | 1030 | capability = 0; |
1031 | + | |
1032 | + /* NX2031 always had MN */ | |
1033 | + if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) | |
1034 | + return 1; | |
1023 | 1035 | |
1024 | 1036 | netxen_rom_fast_read(adapter, |
1025 | 1037 | NX_FW_VERSION_OFFSET, (int *)&flashed_ver); |