From: Joshua Kwan <joshk@triplehelix.org>
To: John Weber <weber@nyc.rr.com>
Subject: Re: 2.5 weirdness
Date: Sun, 23 Feb 2003 11:52:00 -0800 [thread overview]
Message-ID: <20030223195200.GA10668@triplehelix.org> (raw)
In-Reply-To: <3E592431.3080606@nyc.rr.com>
[-- 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 --]
next prev parent reply other threads:[~2003-02-23 19:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2003-02-23 19:59 ` Russell King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030223195200.GA10668@triplehelix.org \
--to=joshk@triplehelix.org \
--cc=weber@nyc.rr.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox