* 2.5 weirdness @ 2003-02-21 22:18 Joshua Kwan 2003-02-21 23:25 ` David Hinds 0 siblings, 1 reply; 5+ messages in thread From: Joshua Kwan @ 2003-02-21 22:18 UTC (permalink / raw) To: hostap; +Cc: linux-kernel, dhinds [-- Attachment #1: Type: text/plain, Size: 1952 bytes --] 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 <jkmaline@cc.hut.fi>) hostap_cs: index 0x01: Vcc 5.0, irq 3, io 0x0100-0x013f hostap_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-0x01bf hostap_cs: wlan0: resetting card wlan0: hfa384x_cmd - timeout - reg=0xffff hostap_cs: first command failed - is the card compatible? hostap_cs: Initialization failed hostap_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 -- New PGP public key: 0x27AFC3EE [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.5 weirdness 2003-02-21 22:18 2.5 weirdness Joshua Kwan @ 2003-02-21 23:25 ` David Hinds 2003-02-23 19:42 ` John Weber 0 siblings, 1 reply; 5+ messages in thread From: David Hinds @ 2003-02-21 23:25 UTC (permalink / raw) To: joshk; +Cc: hostap, linux-kernel On Fri, Feb 21, 2003 at 02:18:14PM -0800, Joshua Kwan wrote: > > 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.5 weirdness 2003-02-21 23:25 ` David Hinds @ 2003-02-23 19:42 ` John Weber 2003-02-23 19:52 ` Joshua Kwan 0 siblings, 1 reply; 5+ messages in thread From: John Weber @ 2003-02-23 19:42 UTC (permalink / raw) To: joshk, linux-kernel David Hinds wrote: > On Fri, Feb 21, 2003 at 02:18:14PM -0800, Joshua Kwan wrote: > >>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 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 //\ weber@nyc.rr.com v_/_ aim/yahoo/msn: worldwidwebers ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.5 weirdness 2003-02-23 19:42 ` John Weber @ 2003-02-23 19:52 ` Joshua Kwan 2003-02-23 19:59 ` Russell King 0 siblings, 1 reply; 5+ messages in thread From: Joshua Kwan @ 2003-02-23 19:52 UTC (permalink / raw) To: John Weber [-- Attachment #1.1: Type: text/plain, Size: 538 bytes --] On Sun, Feb 23, 2003 at 02:42:41PM -0500, John Weber wrote: > 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 -- New PGP public key: 0x27AFC3EE [-- Attachment #1.2: pcmcia.patch --] [-- Type: text/plain, Size: 3525 bytes --] diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c --- linux-original/drivers/pcmcia/cs.c 2003-02-23 10:04:03.000000000 +0100 +++ linux/drivers/pcmcia/cs.c 2003-02-23 10:04:25.000000000 +0100 @@ -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; diff -ruN linux-original/drivers/pcmcia/pci_socket.c linux/drivers/pcmcia/pci_socket.c --- linux-original/drivers/pcmcia/pci_socket.c 2003-02-23 10:04:03.000000000 +0100 +++ linux/drivers/pcmcia/pci_socket.c 2003-02-23 10:04:25.000000000 +0100 @@ -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; } diff -ruN linux-original/drivers/pcmcia/pci_socket.h linux/drivers/pcmcia/pci_socket.h --- linux-original/drivers/pcmcia/pci_socket.h 2003-02-23 10:04:03.000000000 +0100 +++ linux/drivers/pcmcia/pci_socket.h 2003-02-23 10:04:25.000000000 +0100 @@ -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; diff -ruN linux-original/include/pcmcia/ss.h linux/include/pcmcia/ss.h --- linux-original/include/pcmcia/ss.h 2003-02-23 10:04:12.000000000 +0100 +++ linux/include/pcmcia/ss.h 2003-02-23 10:04:25.000000000 +0100 @@ -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; }; [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.5 weirdness 2003-02-23 19:52 ` Joshua Kwan @ 2003-02-23 19:59 ` Russell King 0 siblings, 0 replies; 5+ messages in thread From: Russell King @ 2003-02-23 19:59 UTC (permalink / raw) To: Joshua Kwan; +Cc: John Weber On Sun, Feb 23, 2003 at 11:52:00AM -0800, Joshua Kwan wrote: > On Sun, Feb 23, 2003 at 02:42:41PM -0500, John Weber wrote: > > 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 <linux@brodo.de> Subject: [PATCH] pcmcia: cs.c bugfix (Russell King) Message-ID: <20030223195207.GA3227@brodo.de> 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 <linux@brodo.de> Subject: [UPDATED PATCH] pcmcia: add socket_offset for multiple pci_sockets, correct suspend&resume Message-ID: <20030223121553.GA10719@brodo.de> -- Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-02-23 19:50 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2003-02-21 22:18 2.5 weirdness Joshua Kwan 2003-02-21 23:25 ` David Hinds 2003-02-23 19:42 ` John Weber 2003-02-23 19:52 ` Joshua Kwan 2003-02-23 19:59 ` Russell King
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox