Sierra Wireless CIS [Was: Re: Epia MII 10000, 2.6.13-mm2, cs: pcmcia_socket0: unable to apply power]

Dominik Brodowski linux at dominikbrodowski.net
Tue Dec 6 02:05:40 EST 2005


Hi,

On Fri, Nov 18, 2005 at 12:09:25PM +0100, Sander wrote:
> old utils:
> # cardctl ident
> Socket 0:
>   product info: "Sierra Wireless", "AC710/AC750", "GPRS Network Adapter", "R1"
>   manfid: 0x0192, 0x0710
>   function: 2 (serial)
> Socket 1:
>   no product info available
> 
> new utils:
> # pccardctl ident
> Socket 0:
>   product info: "Sierra Wireless", "AC710/AC750", "GPRS Network Adapter", "R1"
>   manfid: 0x0192, 0x0710
>   function: 6 (network)
> Socket 1:
>   no product info available
> 
> 
> The 'function:' is different. Could that be the reason it
> doesn't bind to serial_cs with the new PCMCIA kernel config?

Unfortunately, no.... though it _is_ strange that the function ID is
different. My current idea is that maybe the CIS override didn't propagate
properly to the PCMCIA bus driver (ds.c). Could you pleas test

2.6.15-rc5 [2.6.14.x should also work...] plus the attached debug patch

and there I'd be interested in three different dmesg outputs:

a) use pcmciautils as it is by default

b) then, manually issuing the command

cat /lib/firmware/SW_7xx_SER.cis > /sys/class/pcmcia_socket/pcmcia_socket0/cis


c) using pcmcia-cs


Thanks,
	Dominik
-------------- next part --------------
Index: working-tree/drivers/pcmcia/ds.c
===================================================================
--- working-tree.orig/drivers/pcmcia/ds.c
+++ working-tree/drivers/pcmcia/ds.c
@@ -42,18 +42,17 @@ MODULE_AUTHOR("David Hinds <dahinds at user
 MODULE_DESCRIPTION("PCMCIA Driver Services");
 MODULE_LICENSE("GPL");
 
-#ifdef DEBUG
+//#ifdef DEBUG
 int ds_pc_debug;
 
 module_param_named(pc_debug, ds_pc_debug, int, 0644);
 
 #define ds_dbg(lvl, fmt, arg...) do {				\
-	if (ds_pc_debug > (lvl))					\
 		printk(KERN_DEBUG "ds: " fmt , ## arg);		\
 } while (0)
-#else
-#define ds_dbg(lvl, fmt, arg...) do { } while (0)
-#endif
+//#else
+//#define ds_dbg(lvl, fmt, arg...) do { } while (0)
+//#endif
 
 spinlock_t pcmcia_dev_list_lock;
 
@@ -263,6 +262,8 @@ static int pcmcia_load_firmware(struct p
 	snprintf(path, 20, "%s", filename);
 
 	if (request_firmware(&fw, path, &dev->dev) == 0) {
+		ds_dbg(1, "got firmware %s, size, %u\n", filename, fw->size);
+
 		if (fw->size >= CISTPL_MAX_CIS_SIZE)
 			goto release;
 
@@ -275,12 +276,15 @@ static int pcmcia_load_firmware(struct p
 		cis->Length = fw->size + 1;
 		memcpy(cis->Data, fw->data, fw->size);
 
+		ds_dbg(1, "trying to replace CIS\n");
 		if (!pcmcia_replace_cis(s, cis))
 			ret = 0;
 	}
  release:
 	release_firmware(fw);
 
+	ds_dbg(1, "exiting load_firmware with ret %d\n", ret);
+
 	return (ret);
 }
 
@@ -428,6 +432,8 @@ static int pcmcia_device_query(struct pc
 	cistpl_vers_1_t	*vers1;
 	unsigned int i;
 
+	ds_dbg(1, "pcmcia_device_query for device %s\n", p_dev->dev.bus_id);
+
 	vers1 = kmalloc(sizeof(*vers1), GFP_KERNEL);
 	if (!vers1)
 		return -ENOMEM;
@@ -621,6 +627,9 @@ static inline void pcmcia_add_pseudo_dev
 static int pcmcia_requery(struct device *dev, void * _data)
 {
 	struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
+
+	ds_dbg(1, "pcmcia_requery\n");
+
 	if (!p_dev->dev.driver)
 		pcmcia_device_query(p_dev);
 
@@ -632,6 +641,8 @@ static void pcmcia_bus_rescan(struct pcm
 	int no_devices=0;
 	unsigned long flags;
 
+	ds_dbg(1, "bus_rescan");
+
 	/* must be called with skt_sem held */
 	spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
 	if (list_empty(&skt->devices_list))
@@ -643,6 +654,7 @@ static void pcmcia_bus_rescan(struct pcm
 	 * do this now. */
 	if (no_devices) {
 		int ret = pcmcia_card_add(skt);
+		ds_dbg(1, "bus_rescan: card_add ret %d", ret);
 		if (ret)
 			return;
 	}
@@ -663,11 +675,13 @@ static inline int pcmcia_devmatch(struct
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_MANF_ID) {
 		if ((!dev->has_manf_id) || (dev->manf_id != did->manf_id))
 			return 0;
+		ds_dbg(1, "manf_id match\n");
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_CARD_ID) {
 		if ((!dev->has_card_id) || (dev->card_id != did->card_id))
 			return 0;
+		ds_dbg(1, "card_id match\n");
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNCTION) {
@@ -737,11 +751,15 @@ static inline int pcmcia_devmatch(struct
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) {
-		if (!dev->socket->fake_cis)
+		ds_dbg(1, "fake_cis analyzing\n");
+		if (!dev->socket->fake_cis) {
+			ds_dbg(1, "requesting fake_cis\n");
 			pcmcia_load_firmware(dev, did->cisfile);
+		}
 
 		if (!dev->socket->fake_cis)
 			return 0;
+		ds_dbg(1, "fake_cis found\n");
 	}
 
 	if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) {
Index: working-tree/drivers/pcmcia/socket_sysfs.c
===================================================================
--- working-tree.orig/drivers/pcmcia/socket_sysfs.c
+++ working-tree/drivers/pcmcia/socket_sysfs.c
@@ -282,6 +282,9 @@ static ssize_t pccard_store_cis(struct k
 	struct pcmcia_socket *s = to_socket(container_of(kobj, struct class_device, kobj));
 	cisdump_t *cis;
 	ssize_t ret = count;
+	int ret2;
+
+	printk("socket_sysfs: %llu 0x%03x\n", off, count);
 
 	if (off)
 		return -EINVAL;
@@ -300,8 +303,11 @@ static ssize_t pccard_store_cis(struct k
 	cis->Length = count + 1;
 	memcpy(cis->Data, buf, count);
 
-	if (pcmcia_replace_cis(s, cis))
+	ret2 = pcmcia_replace_cis(s, cis);
+	if (ret2) {
+		printk("socket_sysfs: replace_cis failed: %i", ret);
 		ret  = -EIO;
+	}
 
 	kfree(cis);
 
@@ -317,7 +323,6 @@ static ssize_t pccard_store_cis(struct k
 		up(&s->skt_sem);
 	}
 
-
 	return (ret);
 }
 


More information about the linux-pcmcia mailing list