PCMCIA patches - unsuccessful so far

Dominik Brodowski linux at brodo.de
Wed Apr 16 01:38:38 BST 2003


Hi Pavel!

On Tue, Apr 15, 2003 at 06:07:42PM -0400, Pavel Roskin wrote:
> Hi, Dominik!
> 
> I've tested your PCMCIA patches.  I applied pcmcia-2.5.67-all_debug to
> Linux 2.5.67-bk6 and recompiled it.  There were no compile problems.

Except the pcmcia-cs compile problem I'll address in the 2.5.68 cycle (or
during the Easter weekend)
 
> After reboot, I inserted modules pcmcia_core, yenta_socket and ds.
> cardmgr won't start:
> 
> # cardmgr
> cardmgr[1031]: no pcmcia driver in /proc/devices

That's correct. cardmgr should not be needed any more.

> ds: pcmcia_add_card(0):<7>no resources available
> ds: pcmcia_remove_card()
> ds: pcmcia_add_card(0):<7>no resources available
> ds: pcmcia_remove_card()
> ds: pcmcia_add_card(0):<7>no resources available
> 
> resources_available is only set in store_resources_done(), but I haven't
> seen the debug message from that function.

Yes - and that's the "problem": currently, cardmgr tells the kernel on what
resources are available for usage by pcmcia cards (DS_ADJUST_RESOURCE_INFO).
As the current (and long-term) approach of my pcmcia patches is the
deprecation of cardmgr, there needs to be a different interface on how to
inform the kernel of available resources: and that's done using a script
which can be found in the top of this file:

http://www.brodo.de/pcmcia/pcmcia-2.5.67-sysfs_resource


Two further comments:
a) IIRC Russell is re-working the handling of resources by PCMCIA. This
means that this interface will likely need to be adapted in future - don't
take it for granted (yet).

b) As said in my last e-mail, I'll re-enable cardmgr support in the next
series of my pcmcia patches. Then I'll also offer an option where all
cardmgr input except the setting of the resources is ignored. So the
transition to the new PCMCIA core will ease a lot.


Oh, and a few bugfixes for the 2.5.67 have accumulated. As I'm too lazy to
put these on my website this late, I've attached them.

	Dominik
-------------- next part --------------
diff -ruN linux-original/drivers/serial/8250_cs.c linux/drivers/serial/8250_cs.c
--- linux-original/drivers/serial/8250_cs.c	2003-04-11 08:27:25.000000000 +0200
+++ linux/drivers/serial/8250_cs.c	2003-04-11 08:27:01.000000000 +0200
@@ -765,6 +765,7 @@
 	{ PCMCIA_MFC_DEVICE_VERS13(1, "Xircom", "XEM5600", 0x2e3ee845, 0xf1403719) },
 	{},
 };
+MODULE_DEVICE_TABLE(pcmcia, serial_id);
 
 static struct pcmcia_driver serial_cs_driver = {
 	.owner		= THIS_MODULE,
-------------- next part --------------
diff -ruN linux-original/drivers/serial/8250_cs.c linux/drivers/serial/8250_cs.c
--- linux-original/drivers/serial/8250_cs.c	2003-04-09 20:21:27.000000000 +0200
+++ linux/drivers/serial/8250_cs.c	2003-04-10 09:16:56.000000000 +0200
@@ -691,6 +691,9 @@
 }
 
 static struct pcmcia_device_id serial_id[] = {
+/* NOTE: most modems do not need explicit entries here, because they
+ * are correctly identified using the following generic entry. */
+	{ PCMCIA_DEVICE_FUNC_ID(2) },
 	{ PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0057, 0x0021) },
 	{ PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002) },
 	{ PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0039) },
-------------- next part --------------
diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c	2003-04-15 10:24:00.000000000 +0200
+++ linux/drivers/pcmcia/ds.c	2003-04-15 10:22:56.000000000 +0200
@@ -610,27 +610,25 @@
 	if (!dev->has_cis)
 		return 0;
 	
-	if (dev->has_manfid) {
-		if (did->match_flags & PCMCIA_DEV_ID_MATCH_MANF_ID &&
-		    dev->manfid.manf != did->manf_id)
-			return 0;
-		if (did->match_flags & PCMCIA_DEV_ID_MATCH_CARD_ID &&
-		    dev->manfid.card != did->card_id)
-			return 0;
-	} else if (did->match_flags & (PCMCIA_DEV_ID_MATCH_MANF_ID |
-				       PCMCIA_DEV_ID_MATCH_CARD_ID))
-		return 0;
+	if (did->match_flags & PCMCIA_DEV_ID_MATCH_MANF_ID) {
+		if ((!dev->has_manfid) || (dev->manfid.manf != did->manf_id))
+			return 0;			
+	}
 
-	if (dev->has_funcid) {
-		if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID &&
-		    dev->funcid.func != did->func_id)
-			return 0;
-	} else if (did->match_flags & (PCMCIA_DEV_ID_MATCH_FUNC_ID))
-		return 0;
+	if (did->match_flags & PCMCIA_DEV_ID_MATCH_CARD_ID) {
+		if ((!dev->has_manfid) || (dev->manfid.card != did->card_id))
+			return 0;			
+	}
 
-	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNCTION &&
-	    dev->func != did->function)
-		return 0;
+	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID) {
+		if ((!dev->has_funcid) || (dev->funcid.func != did->func_id))
+			return 0;			
+	}
+
+	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNCTION) {
+		if (dev->func != did->function)
+			return 0;
+	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_VERS1) {
 		if (dev->vers1.ns < 1)
@@ -657,13 +655,6 @@
 			return 0;
 	}
 
-	if (dev->has_funcid) {
-		if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID &&
-		    dev->funcid.func != did->func_id)
-			return 0;
-	} else if (did->match_flags & (PCMCIA_DEV_ID_MATCH_FUNC_ID))
-		return 0;
-
 	dev->dev.driver_data = (void *) did;
 
 	return 1;


More information about the linux-pcmcia mailing list