Skip to contentSkip to conversation

libertas: check for old, unsupported hardware

PATCH In review Holger Schurig 2 participants 4 messages Jun 5, 2008 – Aug 19, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 libertas: check for old, unsupported hardware

drivers/net/wireless/libertas/if_cs.c +12 -0
@@ -268,6 +268,12 @@
 #define IF_CS_SCRATCH_BOOT_OK		0x00
 #define IF_CS_SCRATCH_HELPER_OK		0x5a
 
+/*
+ * Used to detect ancient chips:
+ */
+#define IF_CS_PRODUCT_ID		0x0000001C
+#define IF_CS_CF8385_B1_REV		0x12
+
 
 /********************************************************************/
 /* I/O and interrupt handling                                       */
@@ -864,6 +871,12 @@
 	       p_dev->irq.AssignedIRQ, p_dev->io.BasePort1,
 	       p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1);
 
+	/* Check if we have a current silicon */
+	if (if_cs_read8(card, IF_CS_PRODUCT_ID) < IF_CS_CF8385_B1_REV) {
+		lbs_pr_err("old chips like 8385 rev B1 aren't supported\n");
+		ret = -ENODEV;
+		goto out2;
+	}
 
 	/* Load the firmware early, before calling into libertas.ko */
 	ret = if_cs_prog_helper(card);
Acked-by on v1 3/4
#1 lore raw
Quoted 1 line · Holger Schurig

Looks OK to me; how old are the B1 and earlier chips? Do we just not have any samples to work with?

Quoted 28 lines
drivers/net/wireless/libertas/if_cs.c +12 -0
@@ -268,6 +268,12 @@
 #define IF_CS_SCRATCH_BOOT_OK		0x00
 #define IF_CS_SCRATCH_HELPER_OK		0x5a
 
+/*
+ * Used to detect ancient chips:
+ */
+#define IF_CS_PRODUCT_ID		0x0000001C
+#define IF_CS_CF8385_B1_REV		0x12
+
 
 /********************************************************************/
 /* I/O and interrupt handling                                       */
@@ -864,6 +871,12 @@
 	       p_dev->irq.AssignedIRQ, p_dev->io.BasePort1,
 	       p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1);
 
+	/* Check if we have a current silicon */
+	if (if_cs_read8(card, IF_CS_PRODUCT_ID) < IF_CS_CF8385_B1_REV) {
+		lbs_pr_err("old chips like 8385 rev B1 aren't supported\n");
+		ret = -ENODEV;
+		goto out2;
+	}
 
 	/* Load the firmware early, before calling into libertas.ko */
 	ret = if_cs_prog_helper(card);
#2 lore raw

I got this piece of code from the 5.0.16 GPL driver, but implemented it differently. I mainly put it in to find out if YOU have such an old silicon. When people yell "my card isn't supported, I get this kernel error" we can still add the necessary support.

I don't want to add the support right now because I don't have this old hardware and don't know anyone with it. So no-one could test this.

The 5.0.16 source mentions two things needed for this old hardware:

* doing read-modify-write instead of just setting bits, this applies to IF_CS_HOST_STATUS and IF_CS_HOST_INT_CAUSE
* and an interrupt workaround

The interrupt workaround isn't in the 5.0.16 source.

#3 lore raw
Quoted 9 lines · Holger Schurig

I got this piece of code from the 5.0.16 GPL driver, but implemented it differently. I mainly put it in to find out if YOU have such an old silicon. When people yell "my card isn't supported, I get this kernel error" we can still add the necessary support.

I don't want to add the support right now because I don't have this old hardware and don't know anyone with it. So no-one could test this.

So it turns out I have two of these cards, which are the ones I've been using for testing since last year. Which might explain why I've been having so many problems that you're not having. They are AmbiCom WL54-CF rev 1.0 cards which I believe are B0 revision looking at the FCC internal photos. The card returns 0x10 as the revision.

Quoted 5 lines

The 5.0.16 source mentions two things needed for this old hardware:

* doing read-modify-write instead of just setting bits, this applies to IF_CS_HOST_STATUS and IF_CS_HOST_INT_CAUSE

Any chance you could whip up a quick test patch for this one?

Quoted 1 line

* and an interrupt workaround

I'll try to figure out what needs to happen for this, lack of it might be the cause of the hangs I've been seeing with my B0 hardware.

Dan