aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e100.c
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2007-06-08 18:46:36 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:02:10 -0400
commit44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (patch)
tree6e16d3ec80c87490dc743f72da086356f2906ace /drivers/net/e100.c
parentb8a3a5214d7cc115f1ca3a3967b7229d97c46f4a (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/e100.c')
-rw-r--r--drivers/net/e100.c8
1 files changed, 3 insertions, 5 deletions
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);