aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cassini.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/cassini.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/cassini.c')
-rw-r--r--drivers/net/cassini.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 59b9943b077..805924fc077 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -3422,21 +3422,19 @@ done:
3422static void cas_check_pci_invariants(struct cas *cp) 3422static 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. */