2.5 weirdness
Hi,
I was wondering if any people might know what is going on here. This happens in 2.5.62, using CardBus pcmcia support within my kernel and the latest pcmcia-cs snapshot.
Just to clarify, I have only one wifi card - wlan0.
cardmgr[99]: starting, version is 3.2.4
cs: memory probe 0xa0000000-0xa0ffffff: clean.
cardmgr[99]: socket 0: U.S. Robotics IEEE 802.11b PC-CARD cardmgr[99]: executing: 'modprobe hostap_crypt'
cardmgr[99]: executing: 'modprobe hostap'
cardmgr[99]: executing: 'modprobe hostap_cs'hostap_cs: 0.0.0 CVS (Jouni Malinen <[email protected]>)hostap_cs: index 0x01: Vcc 5.0, irq 3, io 0x0100-0x013fhostap_cs: Registered netdevice wlan0
wlan0: NIC: id=0x8002 v1.0.0
wlan0: PRI: id=0x15 v0.3.0
wlan0: STA: id=0x1f v1.4.9
cardmgr[99]: executing: './network start wlan0'
Setting up IP spoofing protection: rp_filter.
Configuring network interfaces... spurious 8259A interrupt: IRQ7. cardmgr[99]: + Debian network setup
done.
cardmgr[99]: + /sbin/pump -i wlan0
cardmgr[99]: + /sbin/ifup wlan0
cardmgr[99]: + /sbin/ifup: interface wlan0 already configured cardmgr[99]: socket 1: U.S. Robotics IEEE 802.11b PC-CARD
wlan0: Interrupt, but SWSUPPORT0 does not match: FFFF != 8A32 - card removed?hostap_cs: index 0x01: Vcc 5.0, irq 5, io 0x0180-0x01bfhostap_cs: wlan0: resetting card
wlan0: hfa384x_cmd - timeout - reg=0xffffhostap_cs: first command failed - is the card compatible?hostap_cs: Initialization failedhostap_cs: Registered netdevice wlan1
wlan1: NIC: id=0x8002 v1.0.0
wlan1: PRI: id=0x15 v0.3.0
wlan1: STA: id=0x1f v1.4.9
cardmgr[99]: executing: './network start wlan1'
cardmgr[99]: + Debian network setup
cardmgr[99]: + /sbin/pump -i wlan1
It worked well in 2.5.61, I think. What changed? (Actually, in 2.5.60, it had a different kind of problem, it would recognize the card as a memory_cs device, but that was fixed.)
Regards
Josh
Signature · 1 line
New PGP public key: 0x27AFC3EE
Quoted 6 lines · Joshua Kwan
I was wondering if any people might know what is going on here. This happens in 2.5.62, using CardBus pcmcia support within my kernel and the latest pcmcia-cs snapshot.
Just to clarify, I have only one wifi card - wlan0.
It appears that someone broke the code for keeping track of sockets, since the PCMCIA drivers are telling cardmgr that the same card is inserted twice.
-- Dave
Quoted 6 lines · David Hinds
Quoted 4 lines · Joshua Kwan
I was wondering if any people might know what is going on here. This happens in 2.5.62, using CardBus pcmcia support within my kernel and the latest pcmcia-cs snapshot.
Quoted 8 lines
Quoted 1 line
Just to clarify, I have only one wifi card - wlan0.
It appears that someone broke the code for keeping track of sockets, since the PCMCIA drivers are telling cardmgr that the same card is inserted twice.
-- Dave
The problem is a little stranger than that. On my system, cardmgr only "believes" a card is inserted twice if a card is in the pccard slot when
cardmgr is intially run. Otherwise, cardmgr and the drivers appear to
function correctly. Josh, can you try this?
I posted a message about this earlier, but I didn't receive a response so I still don't understand what's going on.
Subject: PCMCIA: cardmgr setting up two interfaces for one card?
If you need any more information, please let me know.
(o- j o h n e w e b e r
//\ [email protected]
v_/_ aim/yahoo/msn: worldwidwebers
Quoted 4 lines · John Weber
The problem is a little stranger than that. On my system, cardmgr only "believes" a card is inserted twice if a card is in the pccard slot when
cardmgr is intially run. Otherwise, cardmgr and the drivers appear to
function correctly. Josh, can you try this?
This was true.
Dominik's patch which is attached has fixed that for me, at least. This applies with some offset to 2.5.62, but it works.
Regards
Josh
Signature · 1 line
New PGP public key: 0x27AFC3EE
drivers/pcmcia/cs.c +3 -2
@@ -337,13 +337,14 @@return -ENOMEM ;memset (s_info,0 , cls_d->nsock *sizeof (socket_info_t)); + cls_d->s_info = s_info; +/* socket initialization */ for (i =0 ; i < cls_d->nsock; i++) {socket_info_t *s = &s_info[i]; - cls_d->s_info[i] = s; s->ss_entry = cls_d->ops; - s->sock = i; + s->sock = i + cls_d->sock_offset;/* base address = 0, map = 0 */ s->cis_mem.flags =0 ;
drivers/pcmcia/pci_socket.c +14 -14
@@ -171,6 +171,16 @@int err;memset (socket,0 ,sizeof (*socket)); + +/* prepare class_data */ + socket->cls_d.sock_offset = nr; + socket->cls_d.nsock =1 ;/* yenta is 1, no other low-level driver uses +this yet */ + socket->cls_d.ops = &pci_socket_operations; + socket->cls_d.use_bus_pm =1 ; + dev->dev.class_data = &socket->cls_d; + +/* prepare pci_socket_t */ socket->dev = dev; socket->op = ops;pci_set_drvdata (dev, socket);
@@ -186,18 +196,6 @@int cardbus_register (struct pci_dev *p_dev) { -pci_socket_t *socket =pci_get_drvdata (p_dev); -struct pcmcia_socket_class_data *cls_d; - -if (!socket) -return -EINVAL ; - - cls_d = &socket->cls_d; - cls_d->nsock =1 ;/* yenta is 1, no other low-level driver uses -this yet */ - cls_d->ops = &pci_socket_operations; - cls_d->use_bus_pm =1 ; - p_dev->dev.class_data = cls_d;return 0 ; }
@@ -227,14 +225,16 @@static int cardbus_suspend (struct pci_dev *dev,u32 state) {pci_socket_t *socket =pci_get_drvdata (dev); -pcmcia_suspend_socket (socket->pcmcia_socket); +if (socket && socket->cls_d.s_info) +pcmcia_suspend_socket (socket->cls_d.s_info);return 0 ; }static int cardbus_resume (struct pci_dev *dev) {pci_socket_t *socket =pci_get_drvdata (dev); -pcmcia_resume_socket (socket->pcmcia_socket); +if (socket && socket->cls_d.s_info) +pcmcia_resume_socket (socket->cls_d.s_info);return 0 ; }
drivers/pcmcia/pci_socket.h +0 -1
@@ -20,7 +20,6 @@socket_cap_t cap;spinlock_t event_lock;unsigned int events; -struct socket_info_t *pcmcia_socket;struct work_struct tq_task;struct timer_list poll_timer;
include/pcmcia/ss.h +3 -3
@@ -145,12 +145,12 @@* Calls to set up low-level "Socket Services" drivers */ -#define MAX_SOCKETS_PER_DEV 8 -struct pcmcia_socket_class_data {unsigned int nsock;/* number of sockets */ +unsigned int sock_offset;/* socket # (which is +* returned to driver) = sock_offset + (0, 1, .. , (nsock-1) */ struct pccard_operations *ops;/* see above */ -void *s_info[MAX_SOCKETS_PER_DEV ];/* socket_info_t */ +void *s_info;/* socket_info_t */ unsigned int use_bus_pm; };
Quoted 10 lines · Joshua Kwan
Quoted 4 lines · John Weber
The problem is a little stranger than that. On my system, cardmgr only "believes" a card is inserted twice if a card is in the pccard slot when
cardmgr is intially run. Otherwise, cardmgr and the drivers appear to
function correctly. Josh, can you try this?This was true.
Dominik's patch which is attached has fixed that for me, at least. This applies with some offset to 2.5.62, but it works.
This is his old patch which has issues with cardbus cards. If you use this, you also need to add the patch Dominik just posted:
Date: Sun, 23 Feb 2003 20:52:07 +0100
From: Dominik Brodowski <[email protected]>
Subject: [PATCH] pcmcia: cs.c bugfix (Russell King)
Message-ID: <[email protected]>
Or just use his second patch in the same thread this patch came from.
Date: Sun, 23 Feb 2003 13:15:53 +0100
From: Dominik Brodowski <[email protected]>
Subject: [UPDATED PATCH] pcmcia: add socket_offset for multiple pci_sockets,
correct suspend&resume
Message-ID: <[email protected]>
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html