aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2011-02-28 14:57:33 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-28 14:57:33 -0500
commitff938e43d39e926de74b32a3656c190f979ab642 (patch)
treeb914a3f7cc9923013133462a55f5dbe9e7a7799c /drivers
parent63d8ea7f93e1fb9d1aa9509ab3e1a71199245c80 (diff)
net: use pci_dev->revision, again
Several more network drivers that read the device's revision ID from the PCI configuration register were merged after the commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all drivers to use pci_device->revision), so it's time to do another pass of conversion to using the 'revision' field of 'struct pci_dev'... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Acked-by: "John W. Linville" <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/atl1e/atl1e_main.c2
-rw-r--r--drivers/net/atlx/atl2.c2
-rw-r--r--drivers/net/cnic.c14
-rw-r--r--drivers/net/e1000e/ethtool.c6
-rw-r--r--drivers/net/igbvf/ethtool.c6
-rw-r--r--drivers/net/igbvf/netdev.c3
-rw-r--r--drivers/net/ipg.c4
-rw-r--r--drivers/net/ixgbevf/ixgbevf_main.c2
-rw-r--r--drivers/net/jme.c2
-rw-r--r--drivers/net/vxge/vxge-main.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c4
13 files changed, 19 insertions, 50 deletions
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index 21f501184023..1ff001a8270c 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -547,8 +547,8 @@ static int __devinit atl1e_sw_init(struct atl1e_adapter *adapter)
547 hw->device_id = pdev->device; 547 hw->device_id = pdev->device;
548 hw->subsystem_vendor_id = pdev->subsystem_vendor; 548 hw->subsystem_vendor_id = pdev->subsystem_vendor;
549 hw->subsystem_id = pdev->subsystem_device; 549 hw->subsystem_id = pdev->subsystem_device;
550 hw->revision_id = pdev->revision;
550 551
551 pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
552 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); 552 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
553 553
554 phy_status_data = AT_READ_REG(hw, REG_PHY_STATUS); 554 phy_status_data = AT_READ_REG(hw, REG_PHY_STATUS);
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index 4e6f4e95a5a0..e637e9f28fd4 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -93,8 +93,8 @@ static int __devinit atl2_sw_init(struct atl2_adapter *adapter)
93 hw->device_id = pdev->device; 93 hw->device_id = pdev->device;
94 hw->subsystem_vendor_id = pdev->subsystem_vendor; 94 hw->subsystem_vendor_id = pdev->subsystem_vendor;
95 hw->subsystem_id = pdev->subsystem_device; 95 hw->subsystem_id = pdev->subsystem_device;
96 hw->revision_id = pdev->revision;
96 97
97 pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
98 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); 98 pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
99 99
100 adapter->wol = 0; 100 adapter->wol = 0;
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 2d2d28f58e91..5274de3e1bb9 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -5158,15 +5158,11 @@ static struct cnic_dev *init_bnx2_cnic(struct net_device *dev)
5158 5158
5159 dev_hold(dev); 5159 dev_hold(dev);
5160 pci_dev_get(pdev); 5160 pci_dev_get(pdev);
5161 if (pdev->device == PCI_DEVICE_ID_NX2_5709 || 5161 if ((pdev->device == PCI_DEVICE_ID_NX2_5709 ||
5162 pdev->device == PCI_DEVICE_ID_NX2_5709S) { 5162 pdev->device == PCI_DEVICE_ID_NX2_5709S) &&
5163 u8 rev; 5163 (pdev->revision < 0x10)) {
5164 5164 pci_dev_put(pdev);
5165 pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); 5165 goto cnic_err;
5166 if (rev < 0x10) {
5167 pci_dev_put(pdev);
5168 goto cnic_err;
5169 }
5170 } 5166 }
5171 pci_dev_put(pdev); 5167 pci_dev_put(pdev);
5172 5168
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 65ef9b5548d8..d4e51aa231b9 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -433,13 +433,11 @@ static void e1000_get_regs(struct net_device *netdev,
433 struct e1000_hw *hw = &adapter->hw; 433 struct e1000_hw *hw = &adapter->hw;
434 u32 *regs_buff = p; 434 u32 *regs_buff = p;
435 u16 phy_data; 435 u16 phy_data;
436 u8 revision_id;
437 436
438 memset(p, 0, E1000_REGS_LEN * sizeof(u32)); 437 memset(p, 0, E1000_REGS_LEN * sizeof(u32));
439 438
440 pci_read_config_byte(adapter->pdev, PCI_REVISION_ID, &revision_id); 439 regs->version = (1 << 24) | (adapter->pdev->revision << 16) |
441 440 adapter->pdev->device;
442 regs->version = (1 << 24) | (revision_id << 16) | adapter->pdev->device;
443 441
444 regs_buff[0] = er32(CTRL); 442 regs_buff[0] = er32(CTRL);
445 regs_buff[1] = er32(STATUS); 443 regs_buff[1] = er32(STATUS);
diff --git a/drivers/net/igbvf/ethtool.c b/drivers/net/igbvf/ethtool.c
index ed6e3d910247..1d943aa7c7a6 100644
--- a/drivers/net/igbvf/ethtool.c
+++ b/drivers/net/igbvf/ethtool.c
@@ -201,13 +201,11 @@ static void igbvf_get_regs(struct net_device *netdev,
201 struct igbvf_adapter *adapter = netdev_priv(netdev); 201 struct igbvf_adapter *adapter = netdev_priv(netdev);
202 struct e1000_hw *hw = &adapter->hw; 202 struct e1000_hw *hw = &adapter->hw;
203 u32 *regs_buff = p; 203 u32 *regs_buff = p;
204 u8 revision_id;
205 204
206 memset(p, 0, IGBVF_REGS_LEN * sizeof(u32)); 205 memset(p, 0, IGBVF_REGS_LEN * sizeof(u32));
207 206
208 pci_read_config_byte(adapter->pdev, PCI_REVISION_ID, &revision_id); 207 regs->version = (1 << 24) | (adapter->pdev->revision << 16) |
209 208 adapter->pdev->device;
210 regs->version = (1 << 24) | (revision_id << 16) | adapter->pdev->device;
211 209
212 regs_buff[0] = er32(CTRL); 210 regs_buff[0] = er32(CTRL);
213 regs_buff[1] = er32(STATUS); 211 regs_buff[1] = er32(STATUS);
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 42fdf5977be9..6ccc32fd7338 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -2639,8 +2639,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
2639 hw->device_id = pdev->device; 2639 hw->device_id = pdev->device;
2640 hw->subsystem_vendor_id = pdev->subsystem_vendor; 2640 hw->subsystem_vendor_id = pdev->subsystem_vendor;
2641 hw->subsystem_device_id = pdev->subsystem_device; 2641 hw->subsystem_device_id = pdev->subsystem_device;
2642 2642 hw->revision_id = pdev->revision;
2643 pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
2644 2643
2645 err = -EIO; 2644 err = -EIO;
2646 adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, 0), 2645 adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, 0),
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index aa93655c3aa7..a5b0f0e194bb 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -2025,7 +2025,6 @@ static void ipg_init_mii(struct net_device *dev)
2025 2025
2026 if (phyaddr != 0x1f) { 2026 if (phyaddr != 0x1f) {
2027 u16 mii_phyctrl, mii_1000cr; 2027 u16 mii_phyctrl, mii_1000cr;
2028 u8 revisionid = 0;
2029 2028
2030 mii_1000cr = mdio_read(dev, phyaddr, MII_CTRL1000); 2029 mii_1000cr = mdio_read(dev, phyaddr, MII_CTRL1000);
2031 mii_1000cr |= ADVERTISE_1000FULL | ADVERTISE_1000HALF | 2030 mii_1000cr |= ADVERTISE_1000FULL | ADVERTISE_1000HALF |
@@ -2035,8 +2034,7 @@ static void ipg_init_mii(struct net_device *dev)
2035 mii_phyctrl = mdio_read(dev, phyaddr, MII_BMCR); 2034 mii_phyctrl = mdio_read(dev, phyaddr, MII_BMCR);
2036 2035
2037 /* Set default phyparam */ 2036 /* Set default phyparam */
2038 pci_read_config_byte(sp->pdev, PCI_REVISION_ID, &revisionid); 2037 ipg_set_phy_default_param(sp->pdev->revision, dev, phyaddr);
2039 ipg_set_phy_default_param(revisionid, dev, phyaddr);
2040 2038
2041 /* Reset PHY */ 2039 /* Reset PHY */
2042 mii_phyctrl |= BMCR_RESET | BMCR_ANRESTART; 2040 mii_phyctrl |= BMCR_RESET | BMCR_ANRESTART;
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 43af761cdb16..1e735a14091c 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -2221,7 +2221,7 @@ static int __devinit ixgbevf_sw_init(struct ixgbevf_adapter *adapter)
2221 2221
2222 hw->vendor_id = pdev->vendor; 2222 hw->vendor_id = pdev->vendor;
2223 hw->device_id = pdev->device; 2223 hw->device_id = pdev->device;
2224 pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id); 2224 hw->revision_id = pdev->revision;
2225 hw->subsystem_vendor_id = pdev->subsystem_vendor; 2225 hw->subsystem_vendor_id = pdev->subsystem_vendor;
2226 hw->subsystem_device_id = pdev->subsystem_device; 2226 hw->subsystem_device_id = pdev->subsystem_device;
2227 2227
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 5b441b75e138..f690474f4409 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -3095,7 +3095,7 @@ jme_init_one(struct pci_dev *pdev,
3095 3095
3096 jme_clear_pm(jme); 3096 jme_clear_pm(jme);
3097 jme_set_phyfifo_5level(jme); 3097 jme_set_phyfifo_5level(jme);
3098 pci_read_config_byte(pdev, PCI_REVISION_ID, &jme->pcirev); 3098 jme->pcirev = pdev->revision;
3099 if (!jme->fpgaver) 3099 if (!jme->fpgaver)
3100 jme_phy_init(jme); 3100 jme_phy_init(jme);
3101 jme_phy_off(jme); 3101 jme_phy_off(jme);
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index e40f619b62b1..395423aeec00 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -3387,19 +3387,6 @@ static const struct net_device_ops vxge_netdev_ops = {
3387#endif 3387#endif
3388}; 3388};
3389 3389
3390static int __devinit vxge_device_revision(struct vxgedev *vdev)
3391{
3392 int ret;
3393 u8 revision;
3394
3395 ret = pci_read_config_byte(vdev->pdev, PCI_REVISION_ID, &revision);
3396 if (ret)
3397 return -EIO;
3398
3399 vdev->titan1 = (revision == VXGE_HW_TITAN1_PCI_REVISION);
3400 return 0;
3401}
3402
3403static int __devinit vxge_device_register(struct __vxge_hw_device *hldev, 3390static int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
3404 struct vxge_config *config, 3391 struct vxge_config *config,
3405 int high_dma, int no_of_vpath, 3392 int high_dma, int no_of_vpath,
@@ -3439,10 +3426,7 @@ static int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
3439 memcpy(&vdev->config, config, sizeof(struct vxge_config)); 3426 memcpy(&vdev->config, config, sizeof(struct vxge_config));
3440 vdev->rx_csum = 1; /* Enable Rx CSUM by default. */ 3427 vdev->rx_csum = 1; /* Enable Rx CSUM by default. */
3441 vdev->rx_hwts = 0; 3428 vdev->rx_hwts = 0;
3442 3429 vdev->titan1 = (vdev->pdev->revision == VXGE_HW_TITAN1_PCI_REVISION);
3443 ret = vxge_device_revision(vdev);
3444 if (ret < 0)
3445 goto _out1;
3446 3430
3447 SET_NETDEV_DEV(ndev, &vdev->pdev->dev); 3431 SET_NETDEV_DEV(ndev, &vdev->pdev->dev);
3448 3432
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 166e9f742596..f4cd9370e7fa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -898,13 +898,11 @@ static void iwl3945_nic_config(struct iwl_priv *priv)
898{ 898{
899 struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom; 899 struct iwl3945_eeprom *eeprom = (struct iwl3945_eeprom *)priv->eeprom;
900 unsigned long flags; 900 unsigned long flags;
901 u8 rev_id = 0; 901 u8 rev_id = priv->pci_dev->revision;
902 902
903 spin_lock_irqsave(&priv->lock, flags); 903 spin_lock_irqsave(&priv->lock, flags);
904 904
905 /* Determine HW type */ 905 /* Determine HW type */
906 pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
907
908 IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", rev_id); 906 IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", rev_id);
909 907
910 if (rev_id & PCI_CFG_REV_ID_BIT_RTP) 908 if (rev_id & PCI_CFG_REV_ID_BIT_RTP)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index abd0461bd307..8025c62d4d0c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -4056,7 +4056,7 @@ static void iwl_hw_detect(struct iwl_priv *priv)
4056{ 4056{
4057 priv->hw_rev = _iwl_read32(priv, CSR_HW_REV); 4057 priv->hw_rev = _iwl_read32(priv, CSR_HW_REV);
4058 priv->hw_wa_rev = _iwl_read32(priv, CSR_HW_REV_WA_REG); 4058 priv->hw_wa_rev = _iwl_read32(priv, CSR_HW_REV_WA_REG);
4059 pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &priv->rev_id); 4059 priv->rev_id = priv->pci_dev->revision;
4060 IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", priv->rev_id); 4060 IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", priv->rev_id);
4061} 4061}
4062 4062
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 1f18bf7df741..9cd7703c2a30 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1477,13 +1477,11 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1477 struct pci_dev *bridge_pdev = pdev->bus->self; 1477 struct pci_dev *bridge_pdev = pdev->bus->self;
1478 u16 venderid; 1478 u16 venderid;
1479 u16 deviceid; 1479 u16 deviceid;
1480 u8 revisionid;
1481 u16 irqline; 1480 u16 irqline;
1482 u8 tmp; 1481 u8 tmp;
1483 1482
1484 venderid = pdev->vendor; 1483 venderid = pdev->vendor;
1485 deviceid = pdev->device; 1484 deviceid = pdev->device;
1486 pci_read_config_byte(pdev, 0x8, &revisionid);
1487 pci_read_config_word(pdev, 0x3C, &irqline); 1485 pci_read_config_word(pdev, 0x3C, &irqline);
1488 1486
1489 if (deviceid == RTL_PCI_8192_DID || 1487 if (deviceid == RTL_PCI_8192_DID ||
@@ -1494,7 +1492,7 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev,
1494 deviceid == RTL_PCI_8173_DID || 1492 deviceid == RTL_PCI_8173_DID ||
1495 deviceid == RTL_PCI_8172_DID || 1493 deviceid == RTL_PCI_8172_DID ||
1496 deviceid == RTL_PCI_8171_DID) { 1494 deviceid == RTL_PCI_8171_DID) {
1497 switch (revisionid) { 1495 switch (pdev->revision) {
1498 case RTL_PCI_REVISION_ID_8192PCIE: 1496 case RTL_PCI_REVISION_ID_8192PCIE:
1499 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, 1497 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
1500 ("8192 PCI-E is found - " 1498 ("8192 PCI-E is found - "