[patches 1/5] pcmcia: match "anonymous" cards

Dominik Brodowski linux at dominikbrodowski.net
Wed Mar 2 16:24:39 EST 2005


If a card doesn't provide _any_ information about itself, assume it is
a so-called "anonymous" card. pcmciamtd will bind to it if it is configured
to do so.

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
Index: 2.6.11/drivers/pcmcia/ds.c
===================================================================
--- 2.6.11.orig/drivers/pcmcia/ds.c	2005-03-02 20:54:12.000000000 +0100
+++ 2.6.11/drivers/pcmcia/ds.c	2005-03-02 20:54:45.000000000 +0100
@@ -746,6 +746,15 @@
 		}
 	}
 
+	if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) {
+		int i;
+		for (i=0; i<4; i++)
+			if (dev->prod_id[i])
+				return 0;
+		if (dev->has_manf_id || dev->has_card_id || dev->has_func_id)
+			return 0;
+	}
+
 	dev->dev.driver_data = (void *) did;
 
 	return 1;
Index: 2.6.11/include/linux/mod_devicetable.h
===================================================================
--- 2.6.11.orig/include/linux/mod_devicetable.h	2005-03-02 20:51:26.000000000 +0100
+++ 2.6.11/include/linux/mod_devicetable.h	2005-03-02 20:54:46.000000000 +0100
@@ -199,5 +199,6 @@
 #define PCMCIA_DEV_ID_MATCH_PROD_ID4	0x0080
 #define PCMCIA_DEV_ID_MATCH_DEVICE_NO	0x0100
 #define PCMCIA_DEV_ID_MATCH_FAKE_CIS	0x0200
+#define PCMCIA_DEV_ID_MATCH_ANONYMOUS	0x0400
 
 #endif /* LINUX_MOD_DEVICETABLE_H */



More information about the linux-pcmcia mailing list