Re: [CFT] 3/6 (4): add SOCKET_CARDBUS_CONFIG flag

Russell King (rmk@arm.linux.org.uk)
Wed, 12 Mar 2003 21:00:26 +0000


pcmcia-4.diff

Cardbus uses socket->cb_config to detect when the cardbus card has
been initialised. Since cb_config will eventually die, we need a
solution - introduce the SOCKET_CARDBUS_CONFIG flag, which is set
once we have initialised the cardbus socket.

diff -ur orig/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- orig/drivers/pcmcia/cs.c Sun Mar 2 16:25:15 2003
+++ linux/drivers/pcmcia/cs.c Sat Mar 1 19:20:22 2003
@@ -621,8 +621,10 @@
send_event(s, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW);
} else if (s->state & SOCKET_SETUP_PENDING) {
#ifdef CONFIG_CARDBUS
- if (s->state & SOCKET_CARDBUS)
+ if (s->state & SOCKET_CARDBUS) {
cb_alloc(s);
+ s->state |= SOCKET_CARDBUS_CONFIG;
+ }
#endif
send_event(s, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW);
s->state &= ~SOCKET_SETUP_PENDING;
@@ -1072,7 +1074,7 @@
config->Vcc = s->socket.Vcc;
config->Vpp1 = config->Vpp2 = s->socket.Vpp;
config->Option = s->cap.cb_dev->subordinate->number;
- if (s->cb_config) {
+ if (s->state & SOCKET_CARDBUS_CONFIG) {
config->Attributes = CONF_VALID_CLIENT;
config->IntType = INT_CARDBUS;
config->AssignedIRQ = s->irq.AssignedIRQ;
diff -ur orig/drivers/pcmcia/cs_internal.h linux/drivers/pcmcia/cs_internal.h
--- orig/drivers/pcmcia/cs_internal.h Sat Mar 1 20:27:30 2003
+++ linux/drivers/pcmcia/cs_internal.h Sat Mar 1 19:19:50 2003
@@ -176,6 +176,7 @@
#define SOCKET_IO_REQ(i) (0x1000<<(i))
#define SOCKET_REGION_INFO 0x4000
#define SOCKET_CARDBUS 0x8000
+#define SOCKET_CARDBUS_CONFIG 0x10000

#define CHECK_HANDLE(h) \
(((h) == NULL) || ((h)->client_magic != CLIENT_MAGIC))

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/