diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2007-06-08 18:46:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:02:10 -0400 |
commit | 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (patch) | |
tree | 6e16d3ec80c87490dc743f72da086356f2906ace /drivers/net | |
parent | b8a3a5214d7cc115f1ca3a3967b7229d97c46f4a (diff) |
PCI: Change all drivers to use pci_device->revision
Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.
This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.
In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.
Compile tested with make all{yes,mod}config on x86_64 and i386.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net')
29 files changed, 58 insertions, 138 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 58bbc3e6d0de..807e6992e614 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1799,7 +1799,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1799 | void __iomem *regs; | 1799 | void __iomem *regs; |
1800 | resource_size_t pciaddr; | 1800 | resource_size_t pciaddr; |
1801 | unsigned int addr_len, i, pci_using_dac; | 1801 | unsigned int addr_len, i, pci_using_dac; |
1802 | u8 pci_rev; | ||
1803 | 1802 | ||
1804 | #ifndef MODULE | 1803 | #ifndef MODULE |
1805 | static int version_printed; | 1804 | static int version_printed; |
@@ -1807,13 +1806,11 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1807 | printk("%s", version); | 1806 | printk("%s", version); |
1808 | #endif | 1807 | #endif |
1809 | 1808 | ||
1810 | pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev); | ||
1811 | |||
1812 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 1809 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
1813 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) { | 1810 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) { |
1814 | dev_err(&pdev->dev, | 1811 | dev_err(&pdev->dev, |
1815 | "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", | 1812 | "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", |
1816 | pdev->vendor, pdev->device, pci_rev); | 1813 | pdev->vendor, pdev->device, pdev->revision); |
1817 | dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); | 1814 | dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); |
1818 | return -ENODEV; | 1815 | return -ENODEV; |
1819 | } | 1816 | } |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index a844b1fe2dc4..77457c7c6ac2 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -931,7 +931,6 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
931 | int i, addr_len, option; | 931 | int i, addr_len, option; |
932 | void __iomem *ioaddr; | 932 | void __iomem *ioaddr; |
933 | static int board_idx = -1; | 933 | static int board_idx = -1; |
934 | u8 pci_rev; | ||
935 | 934 | ||
936 | assert (pdev != NULL); | 935 | assert (pdev != NULL); |
937 | assert (ent != NULL); | 936 | assert (ent != NULL); |
@@ -949,13 +948,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
949 | } | 948 | } |
950 | #endif | 949 | #endif |
951 | 950 | ||
952 | pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev); | ||
953 | |||
954 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 951 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
955 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) { | 952 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >= 0x20) { |
956 | dev_info(&pdev->dev, | 953 | dev_info(&pdev->dev, |
957 | "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", | 954 | "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", |
958 | pdev->vendor, pdev->device, pci_rev); | 955 | pdev->vendor, pdev->device, pdev->revision); |
959 | dev_info(&pdev->dev, | 956 | dev_info(&pdev->dev, |
960 | "Use the \"8139cp\" driver for improved performance and stability.\n"); | 957 | "Use the \"8139cp\" driver for improved performance and stability.\n"); |
961 | } | 958 | } |
diff --git a/drivers/net/atl1/atl1.h b/drivers/net/atl1/atl1.h index b1c6034e68fa..df4c1a0071aa 100644 --- a/drivers/net/atl1/atl1.h +++ b/drivers/net/atl1/atl1.h | |||
@@ -210,7 +210,6 @@ struct atl1_hw { | |||
210 | u16 phy_spd_default; | 210 | u16 phy_spd_default; |
211 | 211 | ||
212 | u16 dev_rev; | 212 | u16 dev_rev; |
213 | u8 revision_id; | ||
214 | 213 | ||
215 | /* spi flash */ | 214 | /* spi flash */ |
216 | u8 flash_vendor; | 215 | u8 flash_vendor; |
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 3bb40dd4a410..501919eb7f5e 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -118,10 +118,6 @@ static int __devinit atl1_sw_init(struct atl1_adapter *adapter) | |||
118 | { | 118 | { |
119 | struct atl1_hw *hw = &adapter->hw; | 119 | struct atl1_hw *hw = &adapter->hw; |
120 | struct net_device *netdev = adapter->netdev; | 120 | struct net_device *netdev = adapter->netdev; |
121 | struct pci_dev *pdev = adapter->pdev; | ||
122 | |||
123 | /* PCI config space info */ | ||
124 | pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id); | ||
125 | 121 | ||
126 | hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; | 122 | hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; |
127 | hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE; | 123 | hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE; |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index ce3ed67a878e..23958f73c421 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -6363,10 +6363,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
6363 | while ((amd_8132 = pci_get_device(PCI_VENDOR_ID_AMD, | 6363 | while ((amd_8132 = pci_get_device(PCI_VENDOR_ID_AMD, |
6364 | PCI_DEVICE_ID_AMD_8132_BRIDGE, | 6364 | PCI_DEVICE_ID_AMD_8132_BRIDGE, |
6365 | amd_8132))) { | 6365 | amd_8132))) { |
6366 | u8 rev; | ||
6367 | 6366 | ||
6368 | pci_read_config_byte(amd_8132, PCI_REVISION_ID, &rev); | 6367 | if (amd_8132->revision >= 0x10 && |
6369 | if (rev >= 0x10 && rev <= 0x13) { | 6368 | amd_8132->revision <= 0x13) { |
6370 | disable_msi = 1; | 6369 | disable_msi = 1; |
6371 | pci_dev_put(amd_8132); | 6370 | pci_dev_put(amd_8132); |
6372 | break; | 6371 | break; |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 59b9943b077d..805924fc077a 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -3422,21 +3422,19 @@ done: | |||
3422 | static void cas_check_pci_invariants(struct cas *cp) | 3422 | static void cas_check_pci_invariants(struct cas *cp) |
3423 | { | 3423 | { |
3424 | struct pci_dev *pdev = cp->pdev; | 3424 | struct pci_dev *pdev = cp->pdev; |
3425 | u8 rev; | ||
3426 | 3425 | ||
3427 | cp->cas_flags = 0; | 3426 | cp->cas_flags = 0; |
3428 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
3429 | if ((pdev->vendor == PCI_VENDOR_ID_SUN) && | 3427 | if ((pdev->vendor == PCI_VENDOR_ID_SUN) && |
3430 | (pdev->device == PCI_DEVICE_ID_SUN_CASSINI)) { | 3428 | (pdev->device == PCI_DEVICE_ID_SUN_CASSINI)) { |
3431 | if (rev >= CAS_ID_REVPLUS) | 3429 | if (pdev->revision >= CAS_ID_REVPLUS) |
3432 | cp->cas_flags |= CAS_FLAG_REG_PLUS; | 3430 | cp->cas_flags |= CAS_FLAG_REG_PLUS; |
3433 | if (rev < CAS_ID_REVPLUS02u) | 3431 | if (pdev->revision < CAS_ID_REVPLUS02u) |
3434 | cp->cas_flags |= CAS_FLAG_TARGET_ABORT; | 3432 | cp->cas_flags |= CAS_FLAG_TARGET_ABORT; |
3435 | 3433 | ||
3436 | /* Original Cassini supports HW CSUM, but it's not | 3434 | /* Original Cassini supports HW CSUM, but it's not |
3437 | * enabled by default as it can trigger TX hangs. | 3435 | * enabled by default as it can trigger TX hangs. |
3438 | */ | 3436 | */ |
3439 | if (rev < CAS_ID_REV2) | 3437 | if (pdev->revision < CAS_ID_REV2) |
3440 | cp->cas_flags |= CAS_FLAG_NO_HW_CSUM; | 3438 | cp->cas_flags |= CAS_FLAG_NO_HW_CSUM; |
3441 | } else { | 3439 | } else { |
3442 | /* Only sun has original cassini chips. */ | 3440 | /* Only sun has original cassini chips. */ |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 74ec64a1625d..fab4fc9f7fd0 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -250,7 +250,6 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
250 | np->an_enable = 1; | 250 | np->an_enable = 1; |
251 | mii_set_media (dev); | 251 | mii_set_media (dev); |
252 | } | 252 | } |
253 | pci_read_config_byte(pdev, PCI_REVISION_ID, &np->pci_rev_id); | ||
254 | 253 | ||
255 | err = register_netdev (dev); | 254 | err = register_netdev (dev); |
256 | if (err) | 255 | if (err) |
@@ -879,7 +878,7 @@ receive_packet (struct net_device *dev) | |||
879 | skb->protocol = eth_type_trans (skb, dev); | 878 | skb->protocol = eth_type_trans (skb, dev); |
880 | #if 0 | 879 | #if 0 |
881 | /* Checksum done by hw, but csum value unavailable. */ | 880 | /* Checksum done by hw, but csum value unavailable. */ |
882 | if (np->pci_rev_id >= 0x0c && | 881 | if (np->pdev->pci_rev_id >= 0x0c && |
883 | !(frame_status & (TCPError | UDPError | IPError))) { | 882 | !(frame_status & (TCPError | UDPError | IPError))) { |
884 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 883 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
885 | } | 884 | } |
diff --git a/drivers/net/dl2k.h b/drivers/net/dl2k.h index 814c449c359f..e443065a452e 100644 --- a/drivers/net/dl2k.h +++ b/drivers/net/dl2k.h | |||
@@ -668,7 +668,6 @@ struct netdev_private { | |||
668 | unsigned int rx_flow:1; /* Rx flow control enable */ | 668 | unsigned int rx_flow:1; /* Rx flow control enable */ |
669 | unsigned int phy_media:1; /* 1: fiber, 0: copper */ | 669 | unsigned int phy_media:1; /* 1: fiber, 0: copper */ |
670 | unsigned int link_status:1; /* Current link status */ | 670 | unsigned int link_status:1; /* Current link status */ |
671 | unsigned char pci_rev_id; /* PCI revision ID */ | ||
672 | struct netdev_desc *last_tx; /* Last Tx descriptor used. */ | 671 | struct netdev_desc *last_tx; /* Last Tx descriptor used. */ |
673 | unsigned long cur_rx, old_rx; /* Producer/consumer ring indices */ | 672 | unsigned long cur_rx, old_rx; /* Producer/consumer ring indices */ |
674 | unsigned long cur_tx, old_tx; | 673 | unsigned long cur_tx, old_tx; |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 74ea6373c7cd..6b6401e9304e 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -583,7 +583,6 @@ struct nic { | |||
583 | u32 rx_tco_frames; | 583 | u32 rx_tco_frames; |
584 | u32 rx_over_length_errors; | 584 | u32 rx_over_length_errors; |
585 | 585 | ||
586 | u8 rev_id; | ||
587 | u16 leds; | 586 | u16 leds; |
588 | u16 eeprom_wc; | 587 | u16 eeprom_wc; |
589 | u16 eeprom[256]; | 588 | u16 eeprom[256]; |
@@ -937,9 +936,8 @@ static void e100_get_defaults(struct nic *nic) | |||
937 | struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; | 936 | struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; |
938 | struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; | 937 | struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; |
939 | 938 | ||
940 | pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id); | ||
941 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ | 939 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ |
942 | nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->rev_id; | 940 | nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->pdev->revision; |
943 | if(nic->mac == mac_unknown) | 941 | if(nic->mac == mac_unknown) |
944 | nic->mac = mac_82557_D100_A; | 942 | nic->mac = mac_82557_D100_A; |
945 | 943 | ||
@@ -1279,7 +1277,7 @@ static void e100_setup_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb | |||
1279 | if (nic->flags & ich) | 1277 | if (nic->flags & ich) |
1280 | goto noloaducode; | 1278 | goto noloaducode; |
1281 | 1279 | ||
1282 | /* Search for ucode match against h/w rev_id */ | 1280 | /* Search for ucode match against h/w revision */ |
1283 | for (opts = ucode_opts; opts->mac; opts++) { | 1281 | for (opts = ucode_opts; opts->mac; opts++) { |
1284 | int i; | 1282 | int i; |
1285 | u32 *ucode = opts->ucode; | 1283 | u32 *ucode = opts->ucode; |
@@ -2238,7 +2236,7 @@ static void e100_get_regs(struct net_device *netdev, | |||
2238 | u32 *buff = p; | 2236 | u32 *buff = p; |
2239 | int i; | 2237 | int i; |
2240 | 2238 | ||
2241 | regs->version = (1 << 24) | nic->rev_id; | 2239 | regs->version = (1 << 24) | nic->pdev->revision; |
2242 | buff[0] = ioread8(&nic->csr->scb.cmd_hi) << 24 | | 2240 | buff[0] = ioread8(&nic->csr->scb.cmd_hi) << 24 | |
2243 | ioread8(&nic->csr->scb.cmd_lo) << 16 | | 2241 | ioread8(&nic->csr->scb.cmd_lo) << 16 | |
2244 | ioread16(&nic->csr->scb.status); | 2242 | ioread16(&nic->csr->scb.status); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index cf8af928a69c..f48b659e0c2b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -1266,8 +1266,7 @@ e1000_sw_init(struct e1000_adapter *adapter) | |||
1266 | hw->device_id = pdev->device; | 1266 | hw->device_id = pdev->device; |
1267 | hw->subsystem_vendor_id = pdev->subsystem_vendor; | 1267 | hw->subsystem_vendor_id = pdev->subsystem_vendor; |
1268 | hw->subsystem_id = pdev->subsystem_device; | 1268 | hw->subsystem_id = pdev->subsystem_device; |
1269 | 1269 | hw->revision_id = pdev->revision; | |
1270 | pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id); | ||
1271 | 1270 | ||
1272 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); | 1271 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); |
1273 | 1272 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 42ba1c012ee2..67046e8c21eb 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5084,15 +5084,13 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5084 | np->wolenabled = 0; | 5084 | np->wolenabled = 0; |
5085 | 5085 | ||
5086 | if (id->driver_data & DEV_HAS_POWER_CNTRL) { | 5086 | if (id->driver_data & DEV_HAS_POWER_CNTRL) { |
5087 | u8 revision_id; | ||
5088 | pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id); | ||
5089 | 5087 | ||
5090 | /* take phy and nic out of low power mode */ | 5088 | /* take phy and nic out of low power mode */ |
5091 | powerstate = readl(base + NvRegPowerState2); | 5089 | powerstate = readl(base + NvRegPowerState2); |
5092 | powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK; | 5090 | powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK; |
5093 | if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 || | 5091 | if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 || |
5094 | id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) && | 5092 | id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) && |
5095 | revision_id >= 0xA3) | 5093 | pci_dev->revision >= 0xA3) |
5096 | powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3; | 5094 | powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3; |
5097 | writel(powerstate, base + NvRegPowerState2); | 5095 | writel(powerstate, base + NvRegPowerState2); |
5098 | } | 5096 | } |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 56f8197b953b..b703ccfe040b 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -54,8 +54,6 @@ static char netxen_nic_driver_string[] = "NetXen Network Driver version " | |||
54 | #define NETXEN_ADAPTER_UP_MAGIC 777 | 54 | #define NETXEN_ADAPTER_UP_MAGIC 777 |
55 | #define NETXEN_NIC_PEG_TUNE 0 | 55 | #define NETXEN_NIC_PEG_TUNE 0 |
56 | 56 | ||
57 | u8 nx_p2_id = NX_P2_C0; | ||
58 | |||
59 | #define DMA_32BIT_MASK 0x00000000ffffffffULL | 57 | #define DMA_32BIT_MASK 0x00000000ffffffffULL |
60 | #define DMA_35BIT_MASK 0x00000007ffffffffULL | 58 | #define DMA_35BIT_MASK 0x00000007ffffffffULL |
61 | 59 | ||
@@ -307,8 +305,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
307 | goto err_out_disable_pdev; | 305 | goto err_out_disable_pdev; |
308 | 306 | ||
309 | pci_set_master(pdev); | 307 | pci_set_master(pdev); |
310 | pci_read_config_byte(pdev, PCI_REVISION_ID, &nx_p2_id); | 308 | if (pdev->revision == NX_P2_C1 && |
311 | if (nx_p2_id == NX_P2_C1 && | ||
312 | (pci_set_dma_mask(pdev, DMA_35BIT_MASK) == 0) && | 309 | (pci_set_dma_mask(pdev, DMA_35BIT_MASK) == 0) && |
313 | (pci_set_consistent_dma_mask(pdev, DMA_35BIT_MASK) == 0)) { | 310 | (pci_set_consistent_dma_mask(pdev, DMA_35BIT_MASK) == 0)) { |
314 | pci_using_dac = 1; | 311 | pci_using_dac = 1; |
@@ -552,7 +549,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
552 | INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task); | 549 | INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task); |
553 | adapter->ahw.pdev = pdev; | 550 | adapter->ahw.pdev = pdev; |
554 | adapter->proc_cmd_buf_counter = 0; | 551 | adapter->proc_cmd_buf_counter = 0; |
555 | adapter->ahw.revision_id = nx_p2_id; | 552 | adapter->ahw.revision_id = pdev->revision; |
556 | 553 | ||
557 | /* make sure Window == 1 */ | 554 | /* make sure Window == 1 */ |
558 | netxen_nic_pci_change_crbwindow(adapter, 1); | 555 | netxen_nic_pci_change_crbwindow(adapter, 1); |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index fa29a403a247..58bbfdd4f901 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -1135,7 +1135,7 @@ static int init_nic(struct s2io_nic *nic) | |||
1135 | * SXE-008 TRANSMIT DMA ARBITRATION ISSUE. | 1135 | * SXE-008 TRANSMIT DMA ARBITRATION ISSUE. |
1136 | */ | 1136 | */ |
1137 | if ((nic->device_type == XFRAME_I_DEVICE) && | 1137 | if ((nic->device_type == XFRAME_I_DEVICE) && |
1138 | (get_xena_rev_id(nic->pdev) < 4)) | 1138 | (nic->pdev->revision < 4)) |
1139 | writeq(PCC_ENABLE_FOUR, &bar0->pcc_enable); | 1139 | writeq(PCC_ENABLE_FOUR, &bar0->pcc_enable); |
1140 | 1140 | ||
1141 | val64 = readq(&bar0->tx_fifo_partition_0); | 1141 | val64 = readq(&bar0->tx_fifo_partition_0); |
@@ -1873,7 +1873,7 @@ static int verify_pcc_quiescent(struct s2io_nic *sp, int flag) | |||
1873 | herc = (sp->device_type == XFRAME_II_DEVICE); | 1873 | herc = (sp->device_type == XFRAME_II_DEVICE); |
1874 | 1874 | ||
1875 | if (flag == FALSE) { | 1875 | if (flag == FALSE) { |
1876 | if ((!herc && (get_xena_rev_id(sp->pdev) >= 4)) || herc) { | 1876 | if ((!herc && (sp->pdev->revision >= 4)) || herc) { |
1877 | if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)) | 1877 | if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)) |
1878 | ret = 1; | 1878 | ret = 1; |
1879 | } else { | 1879 | } else { |
@@ -1881,7 +1881,7 @@ static int verify_pcc_quiescent(struct s2io_nic *sp, int flag) | |||
1881 | ret = 1; | 1881 | ret = 1; |
1882 | } | 1882 | } |
1883 | } else { | 1883 | } else { |
1884 | if ((!herc && (get_xena_rev_id(sp->pdev) >= 4)) || herc) { | 1884 | if ((!herc && (sp->pdev->revision >= 4)) || herc) { |
1885 | if (((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) == | 1885 | if (((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) == |
1886 | ADAPTER_STATUS_RMAC_PCC_IDLE)) | 1886 | ADAPTER_STATUS_RMAC_PCC_IDLE)) |
1887 | ret = 1; | 1887 | ret = 1; |
@@ -7076,23 +7076,6 @@ static void s2io_link(struct s2io_nic * sp, int link) | |||
7076 | } | 7076 | } |
7077 | 7077 | ||
7078 | /** | 7078 | /** |
7079 | * get_xena_rev_id - to identify revision ID of xena. | ||
7080 | * @pdev : PCI Dev structure | ||
7081 | * Description: | ||
7082 | * Function to identify the Revision ID of xena. | ||
7083 | * Return value: | ||
7084 | * returns the revision ID of the device. | ||
7085 | */ | ||
7086 | |||
7087 | static int get_xena_rev_id(struct pci_dev *pdev) | ||
7088 | { | ||
7089 | u8 id = 0; | ||
7090 | int ret; | ||
7091 | ret = pci_read_config_byte(pdev, PCI_REVISION_ID, (u8 *) & id); | ||
7092 | return id; | ||
7093 | } | ||
7094 | |||
7095 | /** | ||
7096 | * s2io_init_pci -Initialization of PCI and PCI-X configuration registers . | 7079 | * s2io_init_pci -Initialization of PCI and PCI-X configuration registers . |
7097 | * @sp : private member of the device structure, which is a pointer to the | 7080 | * @sp : private member of the device structure, which is a pointer to the |
7098 | * s2io_nic structure. | 7081 | * s2io_nic structure. |
@@ -7550,7 +7533,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7550 | s2io_vpd_read(sp); | 7533 | s2io_vpd_read(sp); |
7551 | DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2007 Neterion Inc.\n"); | 7534 | DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2007 Neterion Inc.\n"); |
7552 | DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name, | 7535 | DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name, |
7553 | sp->product_name, get_xena_rev_id(sp->pdev)); | 7536 | sp->product_name, pdev->revision); |
7554 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, | 7537 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, |
7555 | s2io_driver_version); | 7538 | s2io_driver_version); |
7556 | DBG_PRINT(ERR_DBG, "%s: MAC ADDR: " | 7539 | DBG_PRINT(ERR_DBG, "%s: MAC ADDR: " |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 58592780f519..3887fe63a908 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -1033,7 +1033,6 @@ static void s2io_set_link(struct work_struct *work); | |||
1033 | static int s2io_set_swapper(struct s2io_nic * sp); | 1033 | static int s2io_set_swapper(struct s2io_nic * sp); |
1034 | static void s2io_card_down(struct s2io_nic *nic); | 1034 | static void s2io_card_down(struct s2io_nic *nic); |
1035 | static int s2io_card_up(struct s2io_nic *nic); | 1035 | static int s2io_card_up(struct s2io_nic *nic); |
1036 | static int get_xena_rev_id(struct pci_dev *pdev); | ||
1037 | static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit, | 1036 | static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit, |
1038 | int bit_state); | 1037 | int bit_state); |
1039 | static int s2io_add_isr(struct s2io_nic * sp); | 1038 | static int s2io_add_isr(struct s2io_nic * sp); |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index e1f912d04043..c9f7b7aa5556 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -397,7 +397,6 @@ struct netdev_private { | |||
397 | unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */ | 397 | unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */ |
398 | struct pci_dev *pci_dev; | 398 | struct pci_dev *pci_dev; |
399 | void __iomem *base; | 399 | void __iomem *base; |
400 | unsigned char pci_rev_id; | ||
401 | }; | 400 | }; |
402 | 401 | ||
403 | /* The station address location in the EEPROM. */ | 402 | /* The station address location in the EEPROM. */ |
@@ -544,8 +543,6 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev, | |||
544 | dev->change_mtu = &change_mtu; | 543 | dev->change_mtu = &change_mtu; |
545 | pci_set_drvdata(pdev, dev); | 544 | pci_set_drvdata(pdev, dev); |
546 | 545 | ||
547 | pci_read_config_byte(pdev, PCI_REVISION_ID, &np->pci_rev_id); | ||
548 | |||
549 | i = register_netdev(dev); | 546 | i = register_netdev(dev); |
550 | if (i) | 547 | if (i) |
551 | goto err_out_unmap_rx; | 548 | goto err_out_unmap_rx; |
@@ -828,7 +825,7 @@ static int netdev_open(struct net_device *dev) | |||
828 | iowrite8(100, ioaddr + RxDMAPollPeriod); | 825 | iowrite8(100, ioaddr + RxDMAPollPeriod); |
829 | iowrite8(127, ioaddr + TxDMAPollPeriod); | 826 | iowrite8(127, ioaddr + TxDMAPollPeriod); |
830 | /* Fix DFE-580TX packet drop issue */ | 827 | /* Fix DFE-580TX packet drop issue */ |
831 | if (np->pci_rev_id >= 0x14) | 828 | if (np->pci_dev->revision >= 0x14) |
832 | iowrite8(0x01, ioaddr + DebugCtrl1); | 829 | iowrite8(0x01, ioaddr + DebugCtrl1); |
833 | netif_start_queue(dev); | 830 | netif_start_queue(dev); |
834 | 831 | ||
@@ -1194,7 +1191,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
1194 | hw_frame_id = ioread8(ioaddr + TxFrameId); | 1191 | hw_frame_id = ioread8(ioaddr + TxFrameId); |
1195 | } | 1192 | } |
1196 | 1193 | ||
1197 | if (np->pci_rev_id >= 0x14) { | 1194 | if (np->pci_dev->revision >= 0x14) { |
1198 | spin_lock(&np->lock); | 1195 | spin_lock(&np->lock); |
1199 | for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) { | 1196 | for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) { |
1200 | int entry = np->dirty_tx % TX_RING_SIZE; | 1197 | int entry = np->dirty_tx % TX_RING_SIZE; |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 15146a119230..8b35f13318ea 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -3095,12 +3095,8 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev, | |||
3095 | 3095 | ||
3096 | #ifdef CONFIG_SPARC | 3096 | #ifdef CONFIG_SPARC |
3097 | hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff); | 3097 | hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff); |
3098 | if (hp->hm_revision == 0xff) { | 3098 | if (hp->hm_revision == 0xff) |
3099 | unsigned char prev; | 3099 | hp->hm_revision = 0xc0 | (pdev->revision & 0x0f); |
3100 | |||
3101 | pci_read_config_byte(pdev, PCI_REVISION_ID, &prev); | ||
3102 | hp->hm_revision = 0xc0 | (prev & 0x0f); | ||
3103 | } | ||
3104 | #else | 3100 | #else |
3105 | /* works with this on non-sparc hosts */ | 3101 | /* works with this on non-sparc hosts */ |
3106 | hp->hm_revision = 0x20; | 3102 | hp->hm_revision = 0x20; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 2f3184184ad9..b148d57ec571 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -10498,11 +10498,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
10498 | continue; | 10498 | continue; |
10499 | } | 10499 | } |
10500 | if (pci_id->rev != PCI_ANY_ID) { | 10500 | if (pci_id->rev != PCI_ANY_ID) { |
10501 | u8 rev; | 10501 | if (bridge->revision > pci_id->rev) |
10502 | |||
10503 | pci_read_config_byte(bridge, PCI_REVISION_ID, | ||
10504 | &rev); | ||
10505 | if (rev > pci_id->rev) | ||
10506 | continue; | 10502 | continue; |
10507 | } | 10503 | } |
10508 | if (bridge->subordinate && | 10504 | if (bridge->subordinate && |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 106dc1ef0acb..74eb12107e68 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -533,7 +533,6 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
533 | 533 | ||
534 | struct net_device *dev; | 534 | struct net_device *dev; |
535 | TLanPrivateInfo *priv; | 535 | TLanPrivateInfo *priv; |
536 | u8 pci_rev; | ||
537 | u16 device_id; | 536 | u16 device_id; |
538 | int reg, rc = -ENODEV; | 537 | int reg, rc = -ENODEV; |
539 | 538 | ||
@@ -577,8 +576,6 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
577 | goto err_out_free_dev; | 576 | goto err_out_free_dev; |
578 | } | 577 | } |
579 | 578 | ||
580 | pci_read_config_byte ( pdev, PCI_REVISION_ID, &pci_rev); | ||
581 | |||
582 | for ( reg= 0; reg <= 5; reg ++ ) { | 579 | for ( reg= 0; reg <= 5; reg ++ ) { |
583 | if (pci_resource_flags(pdev, reg) & IORESOURCE_IO) { | 580 | if (pci_resource_flags(pdev, reg) & IORESOURCE_IO) { |
584 | pci_io_base = pci_resource_start(pdev, reg); | 581 | pci_io_base = pci_resource_start(pdev, reg); |
@@ -595,7 +592,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
595 | 592 | ||
596 | dev->base_addr = pci_io_base; | 593 | dev->base_addr = pci_io_base; |
597 | dev->irq = pdev->irq; | 594 | dev->irq = pdev->irq; |
598 | priv->adapterRev = pci_rev; | 595 | priv->adapterRev = pdev->revision; |
599 | pci_set_master(pdev); | 596 | pci_set_master(pdev); |
600 | pci_set_drvdata(pdev, dev); | 597 | pci_set_drvdata(pdev, dev); |
601 | 598 | ||
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index 42fca26afc50..09902891a6e6 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c | |||
@@ -2134,7 +2134,7 @@ srom_search(struct net_device *dev, struct pci_dev *pdev) | |||
2134 | u_short vendor, status; | 2134 | u_short vendor, status; |
2135 | u_int irq = 0, device; | 2135 | u_int irq = 0, device; |
2136 | u_long iobase = 0; /* Clear upper 32 bits in Alphas */ | 2136 | u_long iobase = 0; /* Clear upper 32 bits in Alphas */ |
2137 | int i, j, cfrv; | 2137 | int i, j; |
2138 | struct de4x5_private *lp = netdev_priv(dev); | 2138 | struct de4x5_private *lp = netdev_priv(dev); |
2139 | struct list_head *walk; | 2139 | struct list_head *walk; |
2140 | 2140 | ||
@@ -2150,7 +2150,6 @@ srom_search(struct net_device *dev, struct pci_dev *pdev) | |||
2150 | 2150 | ||
2151 | /* Get the chip configuration revision register */ | 2151 | /* Get the chip configuration revision register */ |
2152 | pb = this_dev->bus->number; | 2152 | pb = this_dev->bus->number; |
2153 | pci_read_config_dword(this_dev, PCI_REVISION_ID, &cfrv); | ||
2154 | 2153 | ||
2155 | /* Set the device number information */ | 2154 | /* Set the device number information */ |
2156 | lp->device = PCI_SLOT(this_dev->devfn); | 2155 | lp->device = PCI_SLOT(this_dev->devfn); |
@@ -2158,7 +2157,8 @@ srom_search(struct net_device *dev, struct pci_dev *pdev) | |||
2158 | 2157 | ||
2159 | /* Set the chipset information */ | 2158 | /* Set the chipset information */ |
2160 | if (is_DC2114x) { | 2159 | if (is_DC2114x) { |
2161 | device = ((cfrv & CFRV_RN) < DC2114x_BRK ? DC21142 : DC21143); | 2160 | device = ((this_dev->revision & CFRV_RN) < DC2114x_BRK |
2161 | ? DC21142 : DC21143); | ||
2162 | } | 2162 | } |
2163 | lp->chipset = device; | 2163 | lp->chipset = device; |
2164 | 2164 | ||
@@ -2254,7 +2254,7 @@ static int __devinit de4x5_pci_probe (struct pci_dev *pdev, | |||
2254 | } | 2254 | } |
2255 | 2255 | ||
2256 | /* Get the chip configuration revision register */ | 2256 | /* Get the chip configuration revision register */ |
2257 | pci_read_config_dword(pdev, PCI_REVISION_ID, &lp->cfrv); | 2257 | lp->cfrv = pdev->revision; |
2258 | 2258 | ||
2259 | /* Set the device number information */ | 2259 | /* Set the device number information */ |
2260 | lp->device = dev_num; | 2260 | lp->device = dev_num; |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 4ed67ff0e81e..dab74feb44bc 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -181,11 +181,12 @@ | |||
181 | udelay(5); | 181 | udelay(5); |
182 | 182 | ||
183 | #define __CHK_IO_SIZE(pci_id, dev_rev) \ | 183 | #define __CHK_IO_SIZE(pci_id, dev_rev) \ |
184 | (( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x02000030) ) ? \ | 184 | (( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x30) ) ? \ |
185 | DM9102A_IO_SIZE: DM9102_IO_SIZE) | 185 | DM9102A_IO_SIZE: DM9102_IO_SIZE) |
186 | 186 | ||
187 | #define CHK_IO_SIZE(pci_dev, dev_rev) \ | 187 | #define CHK_IO_SIZE(pci_dev) \ |
188 | (__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, dev_rev)) | 188 | (__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, \ |
189 | (pci_dev)->revision)) | ||
189 | 190 | ||
190 | /* Sten Check */ | 191 | /* Sten Check */ |
191 | #define DEVICE net_device | 192 | #define DEVICE net_device |
@@ -205,7 +206,7 @@ struct rx_desc { | |||
205 | 206 | ||
206 | struct dmfe_board_info { | 207 | struct dmfe_board_info { |
207 | u32 chip_id; /* Chip vendor/Device ID */ | 208 | u32 chip_id; /* Chip vendor/Device ID */ |
208 | u32 chip_revision; /* Chip revision */ | 209 | u8 chip_revision; /* Chip revision */ |
209 | struct DEVICE *next_dev; /* next device */ | 210 | struct DEVICE *next_dev; /* next device */ |
210 | struct pci_dev *pdev; /* PCI device */ | 211 | struct pci_dev *pdev; /* PCI device */ |
211 | spinlock_t lock; | 212 | spinlock_t lock; |
@@ -359,7 +360,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
359 | { | 360 | { |
360 | struct dmfe_board_info *db; /* board information structure */ | 361 | struct dmfe_board_info *db; /* board information structure */ |
361 | struct net_device *dev; | 362 | struct net_device *dev; |
362 | u32 dev_rev, pci_pmr; | 363 | u32 pci_pmr; |
363 | int i, err; | 364 | int i, err; |
364 | 365 | ||
365 | DMFE_DBUG(0, "dmfe_init_one()", 0); | 366 | DMFE_DBUG(0, "dmfe_init_one()", 0); |
@@ -392,10 +393,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
392 | goto err_out_disable; | 393 | goto err_out_disable; |
393 | } | 394 | } |
394 | 395 | ||
395 | /* Read Chip revision */ | 396 | if (pci_resource_len(pdev, 0) < (CHK_IO_SIZE(pdev)) ) { |
396 | pci_read_config_dword(pdev, PCI_REVISION_ID, &dev_rev); | ||
397 | |||
398 | if (pci_resource_len(pdev, 0) < (CHK_IO_SIZE(pdev, dev_rev)) ) { | ||
399 | printk(KERN_ERR DRV_NAME ": Allocated I/O size too small\n"); | 397 | printk(KERN_ERR DRV_NAME ": Allocated I/O size too small\n"); |
400 | err = -ENODEV; | 398 | err = -ENODEV; |
401 | goto err_out_disable; | 399 | goto err_out_disable; |
@@ -433,7 +431,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
433 | 431 | ||
434 | db->chip_id = ent->driver_data; | 432 | db->chip_id = ent->driver_data; |
435 | db->ioaddr = pci_resource_start(pdev, 0); | 433 | db->ioaddr = pci_resource_start(pdev, 0); |
436 | db->chip_revision = dev_rev; | 434 | db->chip_revision = pdev->revision; |
437 | db->wol_mode = 0; | 435 | db->wol_mode = 0; |
438 | 436 | ||
439 | db->pdev = pdev; | 437 | db->pdev = pdev; |
@@ -455,7 +453,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
455 | 453 | ||
456 | pci_read_config_dword(pdev, 0x50, &pci_pmr); | 454 | pci_read_config_dword(pdev, 0x50, &pci_pmr); |
457 | pci_pmr &= 0x70000; | 455 | pci_pmr &= 0x70000; |
458 | if ( (pci_pmr == 0x10000) && (dev_rev == 0x02000031) ) | 456 | if ( (pci_pmr == 0x10000) && (db->chip_revision == 0x31) ) |
459 | db->chip_type = 1; /* DM9102A E3 */ | 457 | db->chip_type = 1; /* DM9102A E3 */ |
460 | else | 458 | else |
461 | db->chip_type = 0; | 459 | db->chip_type = 0; |
@@ -553,7 +551,7 @@ static int dmfe_open(struct DEVICE *dev) | |||
553 | 551 | ||
554 | /* CR6 operation mode decision */ | 552 | /* CR6 operation mode decision */ |
555 | if ( !chkmode || (db->chip_id == PCI_DM9132_ID) || | 553 | if ( !chkmode || (db->chip_id == PCI_DM9132_ID) || |
556 | (db->chip_revision >= 0x02000030) ) { | 554 | (db->chip_revision >= 0x30) ) { |
557 | db->cr6_data |= DMFE_TXTH_256; | 555 | db->cr6_data |= DMFE_TXTH_256; |
558 | db->cr0_data = CR0_DEFAULT; | 556 | db->cr0_data = CR0_DEFAULT; |
559 | db->dm910x_chk_mode=4; /* Enter the normal mode */ | 557 | db->dm910x_chk_mode=4; /* Enter the normal mode */ |
@@ -1199,9 +1197,9 @@ static void dmfe_timer(unsigned long data) | |||
1199 | tmp_cr12 = inb(db->ioaddr + DCR12); /* DM9102/DM9102A */ | 1197 | tmp_cr12 = inb(db->ioaddr + DCR12); /* DM9102/DM9102A */ |
1200 | 1198 | ||
1201 | if ( ((db->chip_id == PCI_DM9102_ID) && | 1199 | if ( ((db->chip_id == PCI_DM9102_ID) && |
1202 | (db->chip_revision == 0x02000030)) || | 1200 | (db->chip_revision == 0x30)) || |
1203 | ((db->chip_id == PCI_DM9132_ID) && | 1201 | ((db->chip_id == PCI_DM9132_ID) && |
1204 | (db->chip_revision == 0x02000010)) ) { | 1202 | (db->chip_revision == 0x10)) ) { |
1205 | /* DM9102A Chip */ | 1203 | /* DM9102A Chip */ |
1206 | if (tmp_cr12 & 2) | 1204 | if (tmp_cr12 & 2) |
1207 | link_ok = 0; | 1205 | link_ok = 0; |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 041af63f2811..1a9e911b86a2 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -1238,7 +1238,6 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1238 | }; | 1238 | }; |
1239 | static int last_irq; | 1239 | static int last_irq; |
1240 | static int multiport_cnt; /* For four-port boards w/one EEPROM */ | 1240 | static int multiport_cnt; /* For four-port boards w/one EEPROM */ |
1241 | u8 chip_rev; | ||
1242 | int i, irq; | 1241 | int i, irq; |
1243 | unsigned short sum; | 1242 | unsigned short sum; |
1244 | unsigned char *ee_data; | 1243 | unsigned char *ee_data; |
@@ -1274,10 +1273,8 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1274 | 1273 | ||
1275 | if (pdev->vendor == 0x1282 && pdev->device == 0x9100) | 1274 | if (pdev->vendor == 0x1282 && pdev->device == 0x9100) |
1276 | { | 1275 | { |
1277 | u32 dev_rev; | ||
1278 | /* Read Chip revision */ | 1276 | /* Read Chip revision */ |
1279 | pci_read_config_dword(pdev, PCI_REVISION_ID, &dev_rev); | 1277 | if (pdev->revision < 0x02000030) |
1280 | if(dev_rev < 0x02000030) | ||
1281 | { | 1278 | { |
1282 | printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n"); | 1279 | printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n"); |
1283 | return -ENODEV; | 1280 | return -ENODEV; |
@@ -1360,8 +1357,6 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1360 | if (!ioaddr) | 1357 | if (!ioaddr) |
1361 | goto err_out_free_res; | 1358 | goto err_out_free_res; |
1362 | 1359 | ||
1363 | pci_read_config_byte (pdev, PCI_REVISION_ID, &chip_rev); | ||
1364 | |||
1365 | /* | 1360 | /* |
1366 | * initialize private data structure 'tp' | 1361 | * initialize private data structure 'tp' |
1367 | * it is zeroed and aligned in alloc_etherdev | 1362 | * it is zeroed and aligned in alloc_etherdev |
@@ -1382,7 +1377,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1382 | tp->flags = tulip_tbl[chip_idx].flags; | 1377 | tp->flags = tulip_tbl[chip_idx].flags; |
1383 | tp->pdev = pdev; | 1378 | tp->pdev = pdev; |
1384 | tp->base_addr = ioaddr; | 1379 | tp->base_addr = ioaddr; |
1385 | tp->revision = chip_rev; | 1380 | tp->revision = pdev->revision; |
1386 | tp->csr0 = csr0; | 1381 | tp->csr0 = csr0; |
1387 | spin_lock_init(&tp->lock); | 1382 | spin_lock_init(&tp->lock); |
1388 | spin_lock_init(&tp->mii_lock); | 1383 | spin_lock_init(&tp->mii_lock); |
@@ -1399,7 +1394,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1399 | tulip_mwi_config (pdev, dev); | 1394 | tulip_mwi_config (pdev, dev); |
1400 | #else | 1395 | #else |
1401 | /* MWI is broken for DC21143 rev 65... */ | 1396 | /* MWI is broken for DC21143 rev 65... */ |
1402 | if (chip_idx == DC21143 && chip_rev == 65) | 1397 | if (chip_idx == DC21143 && pdev->revision == 65) |
1403 | tp->csr0 &= ~MWI; | 1398 | tp->csr0 &= ~MWI; |
1404 | #endif | 1399 | #endif |
1405 | 1400 | ||
@@ -1640,7 +1635,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1640 | #else | 1635 | #else |
1641 | "Port" | 1636 | "Port" |
1642 | #endif | 1637 | #endif |
1643 | " %#llx,", dev->name, chip_name, chip_rev, | 1638 | " %#llx,", dev->name, chip_name, pdev->revision, |
1644 | (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); | 1639 | (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); |
1645 | pci_set_drvdata(pdev, dev); | 1640 | pci_set_drvdata(pdev, dev); |
1646 | 1641 | ||
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index 2470b1ee33c0..79943cdd6337 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c | |||
@@ -205,7 +205,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
205 | { | 205 | { |
206 | struct net_device *dev = NULL; | 206 | struct net_device *dev = NULL; |
207 | struct xircom_private *private; | 207 | struct xircom_private *private; |
208 | unsigned char chip_rev; | ||
209 | unsigned long flags; | 208 | unsigned long flags; |
210 | unsigned short tmp16; | 209 | unsigned short tmp16; |
211 | enter("xircom_probe"); | 210 | enter("xircom_probe"); |
@@ -224,8 +223,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
224 | pci_read_config_word (pdev,PCI_STATUS, &tmp16); | 223 | pci_read_config_word (pdev,PCI_STATUS, &tmp16); |
225 | pci_write_config_word (pdev, PCI_STATUS,tmp16); | 224 | pci_write_config_word (pdev, PCI_STATUS,tmp16); |
226 | 225 | ||
227 | pci_read_config_byte(pdev, PCI_REVISION_ID, &chip_rev); | ||
228 | |||
229 | if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) { | 226 | if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) { |
230 | printk(KERN_ERR "xircom_probe: failed to allocate io-region\n"); | 227 | printk(KERN_ERR "xircom_probe: failed to allocate io-region\n"); |
231 | return -ENODEV; | 228 | return -ENODEV; |
@@ -286,7 +283,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
286 | goto reg_fail; | 283 | goto reg_fail; |
287 | } | 284 | } |
288 | 285 | ||
289 | printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); | 286 | printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, pdev->revision, pdev->irq); |
290 | /* start the transmitter to get a heartbeat */ | 287 | /* start the transmitter to get a heartbeat */ |
291 | /* TODO: send 2 dummy packets here */ | 288 | /* TODO: send 2 dummy packets here */ |
292 | transceiver_voodoo(private); | 289 | transceiver_voodoo(private); |
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c index f64172927377..83d69f11892f 100644 --- a/drivers/net/tulip/xircom_tulip_cb.c +++ b/drivers/net/tulip/xircom_tulip_cb.c | |||
@@ -524,7 +524,6 @@ static int __devinit xircom_init_one(struct pci_dev *pdev, const struct pci_devi | |||
524 | int chip_idx = id->driver_data; | 524 | int chip_idx = id->driver_data; |
525 | long ioaddr; | 525 | long ioaddr; |
526 | int i; | 526 | int i; |
527 | u8 chip_rev; | ||
528 | 527 | ||
529 | /* when built into the kernel, we only print version if device is found */ | 528 | /* when built into the kernel, we only print version if device is found */ |
530 | #ifndef MODULE | 529 | #ifndef MODULE |
@@ -620,9 +619,8 @@ static int __devinit xircom_init_one(struct pci_dev *pdev, const struct pci_devi | |||
620 | if (register_netdev(dev)) | 619 | if (register_netdev(dev)) |
621 | goto err_out_cleardev; | 620 | goto err_out_cleardev; |
622 | 621 | ||
623 | pci_read_config_byte(pdev, PCI_REVISION_ID, &chip_rev); | ||
624 | printk(KERN_INFO "%s: %s rev %d at %#3lx,", | 622 | printk(KERN_INFO "%s: %s rev %d at %#3lx,", |
625 | dev->name, xircom_tbl[chip_idx].chip_name, chip_rev, ioaddr); | 623 | dev->name, xircom_tbl[chip_idx].chip_name, pdev->revision, ioaddr); |
626 | for (i = 0; i < 6; i++) | 624 | for (i = 0; i < 6; i++) |
627 | printk("%c%2.2X", i ? ':' : ' ', dev->dev_addr[i]); | 625 | printk("%c%2.2X", i ? ':' : ' ', dev->dev_addr[i]); |
628 | printk(", IRQ %d.\n", dev->irq); | 626 | printk(", IRQ %d.\n", dev->irq); |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index adea290a9d5e..73e9c3dcddde 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -622,7 +622,6 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, | |||
622 | struct net_device *dev; | 622 | struct net_device *dev; |
623 | struct rhine_private *rp; | 623 | struct rhine_private *rp; |
624 | int i, rc; | 624 | int i, rc; |
625 | u8 pci_rev; | ||
626 | u32 quirks; | 625 | u32 quirks; |
627 | long pioaddr; | 626 | long pioaddr; |
628 | long memaddr; | 627 | long memaddr; |
@@ -642,27 +641,25 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, | |||
642 | printk(version); | 641 | printk(version); |
643 | #endif | 642 | #endif |
644 | 643 | ||
645 | pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev); | ||
646 | |||
647 | io_size = 256; | 644 | io_size = 256; |
648 | phy_id = 0; | 645 | phy_id = 0; |
649 | quirks = 0; | 646 | quirks = 0; |
650 | name = "Rhine"; | 647 | name = "Rhine"; |
651 | if (pci_rev < VTunknown0) { | 648 | if (pdev->revision < VTunknown0) { |
652 | quirks = rqRhineI; | 649 | quirks = rqRhineI; |
653 | io_size = 128; | 650 | io_size = 128; |
654 | } | 651 | } |
655 | else if (pci_rev >= VT6102) { | 652 | else if (pdev->revision >= VT6102) { |
656 | quirks = rqWOL | rqForceReset; | 653 | quirks = rqWOL | rqForceReset; |
657 | if (pci_rev < VT6105) { | 654 | if (pdev->revision < VT6105) { |
658 | name = "Rhine II"; | 655 | name = "Rhine II"; |
659 | quirks |= rqStatusWBRace; /* Rhine-II exclusive */ | 656 | quirks |= rqStatusWBRace; /* Rhine-II exclusive */ |
660 | } | 657 | } |
661 | else { | 658 | else { |
662 | phy_id = 1; /* Integrated PHY, phy_id fixed to 1 */ | 659 | phy_id = 1; /* Integrated PHY, phy_id fixed to 1 */ |
663 | if (pci_rev >= VT6105_B0) | 660 | if (pdev->revision >= VT6105_B0) |
664 | quirks |= rq6patterns; | 661 | quirks |= rq6patterns; |
665 | if (pci_rev < VT6105M) | 662 | if (pdev->revision < VT6105M) |
666 | name = "Rhine III"; | 663 | name = "Rhine III"; |
667 | else | 664 | else |
668 | name = "Rhine III (Management Adapter)"; | 665 | name = "Rhine III (Management Adapter)"; |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index b670b97bcfde..f331843d1102 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -890,8 +890,7 @@ static void __devinit velocity_init_info(struct pci_dev *pdev, | |||
890 | 890 | ||
891 | static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pci_dev *pdev) | 891 | static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pci_dev *pdev) |
892 | { | 892 | { |
893 | if (pci_read_config_byte(pdev, PCI_REVISION_ID, &vptr->rev_id) < 0) | 893 | vptr->rev_id = pdev->revision; |
894 | return -EIO; | ||
895 | 894 | ||
896 | pci_set_master(pdev); | 895 | pci_set_master(pdev); |
897 | 896 | ||
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 999bf71937ca..ec1c556a47ca 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -3439,7 +3439,6 @@ static int __devinit | |||
3439 | cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | 3439 | cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
3440 | { | 3440 | { |
3441 | static int first_time = 1; | 3441 | static int first_time = 1; |
3442 | ucchar cpc_rev_id; | ||
3443 | int err, eeprom_outdated = 0; | 3442 | int err, eeprom_outdated = 0; |
3444 | ucshort device_id; | 3443 | ucshort device_id; |
3445 | pc300_t *card; | 3444 | pc300_t *card; |
@@ -3480,7 +3479,6 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3480 | card->hw.falcsize = pci_resource_len(pdev, 4); | 3479 | card->hw.falcsize = pci_resource_len(pdev, 4); |
3481 | card->hw.plxphys = pci_resource_start(pdev, 5); | 3480 | card->hw.plxphys = pci_resource_start(pdev, 5); |
3482 | card->hw.plxsize = pci_resource_len(pdev, 5); | 3481 | card->hw.plxsize = pci_resource_len(pdev, 5); |
3483 | pci_read_config_byte(pdev, PCI_REVISION_ID, &cpc_rev_id); | ||
3484 | 3482 | ||
3485 | switch (device_id) { | 3483 | switch (device_id) { |
3486 | case PCI_DEVICE_ID_PC300_RX_1: | 3484 | case PCI_DEVICE_ID_PC300_RX_1: |
@@ -3498,7 +3496,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3498 | } | 3496 | } |
3499 | #ifdef PC300_DEBUG_PCI | 3497 | #ifdef PC300_DEBUG_PCI |
3500 | printk("cpc (bus=0x0%x,pci_id=0x%x,", pdev->bus->number, pdev->devfn); | 3498 | printk("cpc (bus=0x0%x,pci_id=0x%x,", pdev->bus->number, pdev->devfn); |
3501 | printk("rev_id=%d) IRQ%d\n", cpc_rev_id, card->hw.irq); | 3499 | printk("rev_id=%d) IRQ%d\n", pdev->revision, card->hw.irq); |
3502 | printk("cpc:found ramaddr=0x%08lx plxaddr=0x%08lx " | 3500 | printk("cpc:found ramaddr=0x%08lx plxaddr=0x%08lx " |
3503 | "ctladdr=0x%08lx falcaddr=0x%08lx\n", | 3501 | "ctladdr=0x%08lx falcaddr=0x%08lx\n", |
3504 | card->hw.ramphys, card->hw.plxphys, card->hw.scaphys, | 3502 | card->hw.ramphys, card->hw.plxphys, card->hw.scaphys, |
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index aff05dba720a..dfbd3b00f03b 100644 --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c | |||
@@ -311,7 +311,6 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev, | |||
311 | const struct pci_device_id *ent) | 311 | const struct pci_device_id *ent) |
312 | { | 312 | { |
313 | card_t *card; | 313 | card_t *card; |
314 | u8 rev_id; | ||
315 | u32 __iomem *p; | 314 | u32 __iomem *p; |
316 | int i; | 315 | int i; |
317 | u32 ramsize; | 316 | u32 ramsize; |
@@ -366,7 +365,6 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev, | |||
366 | return -ENOMEM; | 365 | return -ENOMEM; |
367 | } | 366 | } |
368 | 367 | ||
369 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | ||
370 | if (pci_resource_len(pdev, 0) != PC300_PLX_SIZE || | 368 | if (pci_resource_len(pdev, 0) != PC300_PLX_SIZE || |
371 | pci_resource_len(pdev, 2) != PC300_SCA_SIZE || | 369 | pci_resource_len(pdev, 2) != PC300_SCA_SIZE || |
372 | pci_resource_len(pdev, 3) < 16384) { | 370 | pci_resource_len(pdev, 3) < 16384) { |
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c index ca06a00d9d86..7f720de2e9f0 100644 --- a/drivers/net/wan/pci200syn.c +++ b/drivers/net/wan/pci200syn.c | |||
@@ -289,7 +289,6 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, | |||
289 | const struct pci_device_id *ent) | 289 | const struct pci_device_id *ent) |
290 | { | 290 | { |
291 | card_t *card; | 291 | card_t *card; |
292 | u8 rev_id; | ||
293 | u32 __iomem *p; | 292 | u32 __iomem *p; |
294 | int i; | 293 | int i; |
295 | u32 ramsize; | 294 | u32 ramsize; |
@@ -330,7 +329,6 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, | |||
330 | return -ENOMEM; | 329 | return -ENOMEM; |
331 | } | 330 | } |
332 | 331 | ||
333 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | ||
334 | if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE || | 332 | if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE || |
335 | pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE || | 333 | pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE || |
336 | pci_resource_len(pdev, 3) < 16384) { | 334 | pci_resource_len(pdev, 3) < 16384) { |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index ef6b253a92ce..c5d6753a55ea 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -3741,10 +3741,8 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) | |||
3741 | &bcm->board_type); | 3741 | &bcm->board_type); |
3742 | if (err) | 3742 | if (err) |
3743 | goto err_iounmap; | 3743 | goto err_iounmap; |
3744 | err = bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID, | 3744 | |
3745 | &bcm->board_revision); | 3745 | bcm->board_revision = bcm->pci_dev->revision; |
3746 | if (err) | ||
3747 | goto err_iounmap; | ||
3748 | 3746 | ||
3749 | err = bcm43xx_chipset_attach(bcm); | 3747 | err = bcm43xx_chipset_attach(bcm); |
3750 | if (err) | 3748 | if (err) |