aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2012-07-16 12:23:59 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-17 02:10:30 -0400
commit165f4d1cb3d7a10c5bc8c0fdae63323354f5a225 (patch)
treee15e391f1dff26d1f2ed0d75d7304409fd5e009a /drivers/net/ethernet/broadcom
parent5a308f40bfe27fcfd1db3970afe18b635f23c182 (diff)
tg3: Fix the setting of the APE_HAS_NCSI flag
The driver currently skips setting this flag if the VPD contains the firmware version string. We fix this by separating the probing of NCSI from the reading of the NCSI version string. The APE_HAS_NCSI flag is needed to properly read sensor data. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index ac9091f9d42b..45dc6f5c52cf 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -13858,14 +13858,9 @@ static void __devinit tg3_read_mgmtfw_ver(struct tg3 *tp)
13858 } 13858 }
13859} 13859}
13860 13860
13861static void __devinit tg3_read_dash_ver(struct tg3 *tp) 13861static void __devinit tg3_probe_ncsi(struct tg3 *tp)
13862{ 13862{
13863 int vlen;
13864 u32 apedata; 13863 u32 apedata;
13865 char *fwtype;
13866
13867 if (!tg3_flag(tp, ENABLE_APE) || !tg3_flag(tp, ENABLE_ASF))
13868 return;
13869 13864
13870 apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG); 13865 apedata = tg3_ape_read32(tp, TG3_APE_SEG_SIG);
13871 if (apedata != APE_SEG_SIG_MAGIC) 13866 if (apedata != APE_SEG_SIG_MAGIC)
@@ -13875,14 +13870,22 @@ static void __devinit tg3_read_dash_ver(struct tg3 *tp)
13875 if (!(apedata & APE_FW_STATUS_READY)) 13870 if (!(apedata & APE_FW_STATUS_READY))
13876 return; 13871 return;
13877 13872
13873 if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI)
13874 tg3_flag_set(tp, APE_HAS_NCSI);
13875}
13876
13877static void __devinit tg3_read_dash_ver(struct tg3 *tp)
13878{
13879 int vlen;
13880 u32 apedata;
13881 char *fwtype;
13882
13878 apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION); 13883 apedata = tg3_ape_read32(tp, TG3_APE_FW_VERSION);
13879 13884
13880 if (tg3_ape_read32(tp, TG3_APE_FW_FEATURES) & TG3_APE_FW_FEATURE_NCSI) { 13885 if (tg3_flag(tp, APE_HAS_NCSI))
13881 tg3_flag_set(tp, APE_HAS_NCSI);
13882 fwtype = "NCSI"; 13886 fwtype = "NCSI";
13883 } else { 13887 else
13884 fwtype = "DASH"; 13888 fwtype = "DASH";
13885 }
13886 13889
13887 vlen = strlen(tp->fw_ver); 13890 vlen = strlen(tp->fw_ver);
13888 13891
@@ -13916,20 +13919,17 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
13916 tg3_read_sb_ver(tp, val); 13919 tg3_read_sb_ver(tp, val);
13917 else if ((val & TG3_EEPROM_MAGIC_HW_MSK) == TG3_EEPROM_MAGIC_HW) 13920 else if ((val & TG3_EEPROM_MAGIC_HW_MSK) == TG3_EEPROM_MAGIC_HW)
13918 tg3_read_hwsb_ver(tp); 13921 tg3_read_hwsb_ver(tp);
13919 else
13920 return;
13921 13922
13922 if (vpd_vers) 13923 if (tg3_flag(tp, ENABLE_ASF)) {
13923 goto done; 13924 if (tg3_flag(tp, ENABLE_APE)) {
13924 13925 tg3_probe_ncsi(tp);
13925 if (tg3_flag(tp, ENABLE_APE)) { 13926 if (!vpd_vers)
13926 if (tg3_flag(tp, ENABLE_ASF)) 13927 tg3_read_dash_ver(tp);
13927 tg3_read_dash_ver(tp); 13928 } else if (!vpd_vers) {
13928 } else if (tg3_flag(tp, ENABLE_ASF)) { 13929 tg3_read_mgmtfw_ver(tp);
13929 tg3_read_mgmtfw_ver(tp); 13930 }
13930 } 13931 }
13931 13932
13932done:
13933 tp->fw_ver[TG3_VER_SIZE - 1] = 0; 13933 tp->fw_ver[TG3_VER_SIZE - 1] = 0;
13934} 13934}
13935 13935