Signed-off-by: Holger Schurig <[email protected]>
--- linux.orig/drivers/net/wireless/libertas/if_cs.c
+++ linux/drivers/net/wireless/libertas/if_cs.c
@@ -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);
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.
On Thu, 2008-06-05 at 13:08 +0200, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <[email protected]>
Looks OK to me; how old are the B1 and earlier chips? Do we just not
have any samples to work with?
Acked-by: Dan Williams <[email protected]>
> --- linux.orig/drivers/net/wireless/libertas/if_cs.c
> +++ linux/drivers/net/wireless/libertas/if_cs.c
> @@ -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);
On Thu, 2008-06-05 at 14:02 +0200, Holger Schurig wrote:
> 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.
> 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?
> * 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