aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuo-Fu Tseng <cooldavid@cooldavid.org>2011-02-13 13:27:34 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-13 23:43:20 -0500
commit19d96017d1b5b1c9b709bc21a398ea793256644c (patch)
tree646eb220082285d32e7530dcc6260c881d69c1cb
parentafc6151a78a43bdca5f64a8bd3e3c13837580c54 (diff)
jme: Extract main and sub chip revision
Get the main and sub chip revision for later workaround use. Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/jme.c8
-rw-r--r--drivers/net/jme.h8
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index e97ebef3cf47..d44716e804b6 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -2731,6 +2731,8 @@ jme_check_hw_ver(struct jme_adapter *jme)
2731 2731
2732 jme->fpgaver = (chipmode & CM_FPGAVER_MASK) >> CM_FPGAVER_SHIFT; 2732 jme->fpgaver = (chipmode & CM_FPGAVER_MASK) >> CM_FPGAVER_SHIFT;
2733 jme->chiprev = (chipmode & CM_CHIPREV_MASK) >> CM_CHIPREV_SHIFT; 2733 jme->chiprev = (chipmode & CM_CHIPREV_MASK) >> CM_CHIPREV_SHIFT;
2734 jme->chip_main_rev = jme->chiprev & 0xF;
2735 jme->chip_sub_rev = (jme->chiprev >> 4) & 0xF;
2734} 2736}
2735 2737
2736static const struct net_device_ops jme_netdev_ops = { 2738static const struct net_device_ops jme_netdev_ops = {
@@ -2937,7 +2939,7 @@ jme_init_one(struct pci_dev *pdev,
2937 2939
2938 jme_clear_pm(jme); 2940 jme_clear_pm(jme);
2939 jme_set_phyfifoa(jme); 2941 jme_set_phyfifoa(jme);
2940 pci_read_config_byte(pdev, PCI_REVISION_ID, &jme->rev); 2942 pci_read_config_byte(pdev, PCI_REVISION_ID, &jme->pcirev);
2941 if (!jme->fpgaver) 2943 if (!jme->fpgaver)
2942 jme_phy_init(jme); 2944 jme_phy_init(jme);
2943 jme_phy_off(jme); 2945 jme_phy_off(jme);
@@ -2964,14 +2966,14 @@ jme_init_one(struct pci_dev *pdev,
2964 goto err_out_unmap; 2966 goto err_out_unmap;
2965 } 2967 }
2966 2968
2967 netif_info(jme, probe, jme->dev, "%s%s ver:%x rev:%x macaddr:%pM\n", 2969 netif_info(jme, probe, jme->dev, "%s%s chiprev:%x pcirev:%x macaddr:%pM\n",
2968 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ? 2970 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ?
2969 "JMC250 Gigabit Ethernet" : 2971 "JMC250 Gigabit Ethernet" :
2970 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ? 2972 (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ?
2971 "JMC260 Fast Ethernet" : "Unknown", 2973 "JMC260 Fast Ethernet" : "Unknown",
2972 (jme->fpgaver != 0) ? " (FPGA)" : "", 2974 (jme->fpgaver != 0) ? " (FPGA)" : "",
2973 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev, 2975 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev,
2974 jme->rev, netdev->dev_addr); 2976 jme->pcirev, netdev->dev_addr);
2975 2977
2976 return 0; 2978 return 0;
2977 2979
diff --git a/drivers/net/jme.h b/drivers/net/jme.h
index eac09264bf2a..32b2a9ddbcd6 100644
--- a/drivers/net/jme.h
+++ b/drivers/net/jme.h
@@ -411,8 +411,10 @@ struct jme_adapter {
411 u32 rx_ring_mask; 411 u32 rx_ring_mask;
412 u8 mrrs; 412 u8 mrrs;
413 unsigned int fpgaver; 413 unsigned int fpgaver;
414 unsigned int chiprev; 414 u8 chiprev;
415 u8 rev; 415 u8 chip_main_rev;
416 u8 chip_sub_rev;
417 u8 pcirev;
416 u32 msg_enable; 418 u32 msg_enable;
417 struct ethtool_cmd old_ecmd; 419 struct ethtool_cmd old_ecmd;
418 unsigned int old_mtu; 420 unsigned int old_mtu;
@@ -1184,7 +1186,7 @@ enum jme_phy_reg17_vals {
1184/* 1186/*
1185 * Workaround 1187 * Workaround
1186 */ 1188 */
1187static inline int is_buggy250(unsigned short device, unsigned int chiprev) 1189static inline int is_buggy250(unsigned short device, u8 chiprev)
1188{ 1190{
1189 return device == PCI_DEVICE_ID_JMICRON_JMC250 && chiprev == 0x11; 1191 return device == PCI_DEVICE_ID_JMICRON_JMC250 && chiprev == 0x11;
1190} 1192}