stuff-up in pcmcia/cardbus stuff

stuff-up in pcmcia/cardbus stuff

Post by Dominik Brodowsk » Thu, 20 Feb 2003 00:20:17





> >Indeed. socket->pcmcia_socket (old) == socket->cls_d.s_info[0] (new)

> If this is true...
<snip>

> 2) why are multiple s_info records allocated, when you hardcode use of
> record #0 ?

Indeed, the allocation of MAX_SOCK_PER_DEV s_info[] pointers is pointless.

        Dominik

diff -ruN linux-original/drivers/pcmcia/cs.c linux-pcmcia/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c  2003-02-18 09:08:00.000000000 +0100

                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;

diff -ruN linux-original/drivers/pcmcia/pci_socket.c linux-pcmcia/drivers/pcmcia/pci_socket.c
--- linux-original/drivers/pcmcia/pci_socket.c  2003-02-18 22:54:34.000000000 +0100

 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-pcmcia/drivers/pcmcia/pci_socket.h
--- linux-original/drivers/pcmcia/pci_socket.h  2003-02-18 22:54:34.000000000 +0100

        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-pcmcia/include/pcmcia/ss.h
--- linux-original/include/pcmcia/ss.h  2003-02-18 09:08:02.000000000 +0100

  *  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 */
        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;
 };

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. stuff-up in pcmcia/cardbus stuff

Indeed. socket->pcmcia_socket (old) == socket->cls_d.s_info[0] (new)
Could you please check whether this patch helps?

        Dominik

diff -ruN linux-original/drivers/pcmcia/pci_socket.c linux/drivers/pcmcia/pci_socket.c
--- linux-original/drivers/pcmcia/pci_socket.c  2003-02-18 09:08:00.000000000 +0100

 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[0])
+               pcmcia_suspend_socket (socket->cls_d.s_info[0]);
        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[0])
+               pcmcia_resume_socket (socket->cls_d.s_info[0]);
        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-18 09:08:00.000000000 +0100

        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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. How to change case of filenames under bash or Bourne???

3. apache web server question for help

4. only show the PCMCIA/CardBus submenu if "PCMCIA/CardBus support" is selected

5. Dosemu0.49 - Raw Keyboard Mode double echo

6. Good stuff Bad Stuff

7. CD-ROM problem

8. Hinds Pcmcia stuff

9. Richochet 128kbs Wireless PCMCIA card stuff

10. PCI-2-Cardbus bridge, Kernel PCMCIA services and Cardbus

11. PCMCIA stuff, what to get...

12. Frustrated..net stuff..PCMCIA