Skip to contentSkip to conversation

2.5.45-ac1 CardBus compile Fix

PATCH In review Osamu Tomita 2 participants 3 messages Nov 7, 2002 Pcmcia

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.45-ac1 CardBus compile Fix

I couldn't compile cistpl.c, that call obsolete function.

Here is trivial patch. This works fine for me.

Regards,
Osamu Tomita

drivers/pcmcia/cistpl.c renamed from drivers/pcmcia/cistpl.c.orig +1 -1
@@ -429,7 +429,7 @@
 #ifdef CONFIG_CARDBUS
     if (s->state & SOCKET_CARDBUS) {
 	u_int ptr;
-	pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
+	pci_bus_read_config_dword(s->cap.cb_dev->bus, 0, 0x28, &ptr);
 	tuple->CISOffset = ptr & ~7;
 	SPACE(tuple->Flags) = (ptr & 7);
     } else
#1 lore raw
Quoted 9 lines · Osamu Tomita

I couldn't compile cistpl.c, that call obsolete function.

Here is trivial patch. This works fine for me.

Regards,
Osamu Tomita

drivers/pcmcia/cistpl.c line 435

Quoted 8 lines
drivers/pcmcia/cistpl.c renamed from drivers/pcmcia/cistpl.c.orig +1 -1
@@ -429,7 +429,7 @@
 #ifdef CONFIG_CARDBUS
     if (s->state & SOCKET_CARDBUS) {
 	u_int ptr;
-	pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
+	pci_bus_read_config_dword(s->cap.cb_dev->bus, 0, 0x28, &ptr);
 	tuple->CISOffset = ptr & ~7;
 	SPACE(tuple->Flags) = (ptr & 7);
     } else

I think dev->bus the bus number for the bus that the Cardbus controller is connected to? If so, this change is wrong.

bus:device.function = 0:0.0

+--------+
| host   |
| bridge >--------+------------------ dev->bus
+--------+        |
                  |
             +----v----+ dev
             | Cardbus |
             | Bridge  |
             +---------+
                  |
                  | bus number = dev->subordinate->number
                  |
                  |
             +----v----+ bus = dev->subordinate->number
             | Cardbus | device = 0
             |   card  |
             +---------+

The device we want to read the CIS offset from is the cardbus card. In the above case, your change means we'll try to read the CIS offset from the host bridge, which is obviously wrong.

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#2 lore raw
Quoted 42 lines · Russell King
Quoted 9 lines · Osamu Tomita

I couldn't compile cistpl.c, that call obsolete function.

Here is trivial patch. This works fine for me.

Regards,
Osamu Tomita

drivers/pcmcia/cistpl.c Thu Nov 7 01:03:55 2002 line 435

Quoted 8 lines
drivers/pcmcia/cistpl.c Thu Nov 7 01:03:55 2002 renamed from drivers/pcmcia/cistpl.c.orig Thu Oct 31 09:42:24 2002 +1 -1
@@ -429,7 +429,7 @@
 #ifdef CONFIG_CARDBUS
     if (s->state & SOCKET_CARDBUS) {
      u_int ptr;
-     pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
+     pci_bus_read_config_dword(s->cap.cb_dev->bus, 0, 0x28, &ptr);
      tuple->CISOffset = ptr & ~7;
      SPACE(tuple->Flags) = (ptr & 7);
     } else

I think dev->bus the bus number for the bus that the Cardbus controller is connected to? If so, this change is wrong.

bus:device.function = 0:0.0

+--------+
| host   |
| bridge >--------+------------------ dev->bus
+--------+        |
                  |
             +----v----+ dev
             | Cardbus |
             | Bridge  |
             +---------+
                  |
                  | bus number = dev->subordinate->number
                  |
                  |
             +----v----+ bus = dev->subordinate->number
             | Cardbus | device = 0
             |   card  |
             +---------+
Quoted 3 lines

The device we want to read the CIS offset from is the cardbus card. In the above case, your change means we'll try to read the CIS offset from the host bridge, which is obviously wrong.

Thanks for exposition.
Is this right?

drivers/pcmcia/cistpl.c Fri Nov 8 01:19:32 2002 renamed from drivers/pcmcia/cistpl.c.orig Thu Oct 31 09:42:24 2002 +1 -1
@@ -429,7 +429,7 @@
 #ifdef CONFIG_CARDBUS
     if (s->state & SOCKET_CARDBUS) {
        u_int ptr;
-       pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
+       pci_bus_read_config_dword(s->cap.cb_dev->subordinate, 0, 0x28, &ptr);
        tuple->CISOffset = ptr & ~7;
        SPACE(tuple->Flags) = (ptr & 7);
     } else