Re: [PATCH] Sis900 bug fixes 2/4

From: Daniele Venzano
Date: Tue May 18 2004 - 07:23:29 EST


Patch 2 of 4

Add new ISA bridge PCI ID

I added some constants to make the code more readable and modified the if
body to check for another ID in case the first check fails.

Any comment is highly appreciated.

--
-----------------------------
Daniele Venzano
Web: http://teg.homeunix.org

diff -Naru -X /home/venza/kernel/dontdiff linux-2.6.6/drivers/net/sis900.c linux-sis900/drivers/net/sis900.c
--- linux-2.6.6/drivers/net/sis900.c 2004-04-04 22:31:55.000000000 +0200
+++ linux-sis900/drivers/net/sis900.c 2004-05-18 10:51:39.000000000 +0200
@@ -260,9 +260,13 @@
u8 reg;
int i;

- if ((isa_bridge = pci_find_device(0x1039, 0x0008, isa_bridge)) == NULL) {
- printk("%s: Can not find ISA bridge\n", net_dev->name);
- return 0;
+ isa_bridge = pci_find_device(PCI_VENDOR_ID_SI, SIS630E_ISA_BRIDGE_ID_1, isa_bridge);
+ if (!isa_bridge) {
+ isa_bridge = pci_find_device(PCI_VENDOR_ID_SI, SIS630E_ISA_BRIDGE_ID_2, isa_bridge);
+ if (!isa_bridge) {
+ printk("%s: Can not find ISA bridge\n", net_dev->name);
+ return 0;
+ }
}
pci_read_config_byte(isa_bridge, 0x48, &reg);
pci_write_config_byte(isa_bridge, 0x48, reg | 0x40);
diff -Naru -X /home/venza/kernel/dontdiff linux-2.6.6/drivers/net/sis900.h linux-sis900/drivers/net/sis900.h
--- linux-2.6.6/drivers/net/sis900.h 2003-06-17 06:19:41.000000000 +0200
+++ linux-sis900/drivers/net/sis900.h 2004-05-18 10:49:50.000000000 +0200
@@ -274,6 +274,9 @@
#define TX_TOTAL_SIZE NUM_TX_DESC*sizeof(BufferDesc)
#define RX_TOTAL_SIZE NUM_RX_DESC*sizeof(BufferDesc)

+#define SIS630E_ISA_BRIDGE_ID_1 0x0008
+#define SIS630E_ISA_BRIDGE_ID_2 0x0018
+
/* PCI stuff, should be move to pci.h */
#define SIS630_VENDOR_ID 0x1039
#define SIS630_DEVICE_ID 0x0630

Attachment: signature.asc
Description: Digital signature