[PATCH] libertas: make mesh functionality configurable

Holger Schurig hs4233 at mail.mn-solutions.de
Sat Feb 17 13:33:40 EST 2007


> Yeah; that's what I'd like to see too, and it should be pretty easy.

I just have a few questions:

1. Do I need one bit for MESH capability and one bit for FWT capability?

2. How do I detect this?  I think this is not possible in wlan_add_card,
   because at this time not all things are setup (e.g. USB stuff).

3. I want to remove the creation of mshX out of wlan_add_card(). It should
   get created only when the firmware has this capability. Where do I
   then create it best?




Currently, I'm basically doing this all over the place:

* define some bits for the features (here we can put
  5.0 vica 5.1 firmware bits as well)
* reserver a field in the adapter for fwbits
* detect somewhere what the firmware supports (omitted)
* check for this bit at various places


Except from the patch:


--- libertas-2.6.orig/drivers/net/wireless/libertas/defs.h
+++ libertas-2.6/drivers/net/wireless/libertas/defs.h
@@ -76,6 +76,11 @@
 #define        WLAN_UPLD_SIZE                  2312
 #define DEV_NAME_LEN                   32

+/* Firmware capabilities */
+/* schurig: not sure, but I think mesh and FWT are the same? */
+#define MRVDRV_FW_BIT_MESH             (1<<0)
+#define MRVDRV_FW_BIT_FWT              (1<<1)
+
 /** Misc constants */
 /* This section defines 802.11 specific contants */

--- libertas-2.6.orig/drivers/net/wireless/libertas/dev.h
+++ libertas-2.6/drivers/net/wireless/libertas/dev.h
@@ -203,13 +203,14 @@
        u8 wpa_ie_len;
 };

-/** Wlan adapter data structure*/
+/** WLAN adapter data structure*/
 struct _wlan_adapter {
        /** STATUS variables */
        u32 fwreleasenumber;
        u32 fwcapinfo;
-       /* protected with big lock */
+       u32 fwbits;

+       /* protected with big lock */
        struct mutex lock;

        u8 tmptxbuf[WLAN_UPLD_SIZE];
--- libertas-2.6.orig/drivers/net/wireless/libertas/cmd.c
+++ libertas-2.6/drivers/net/wireless/libertas/cmd.c
@@ -871,6 +871,10 @@
                               u16 cmd_action, void *pdata_buf)
 {
        struct cmd_ds_fwt_access *fwt_access = &cmd->params.fwt;
+
+       if (!priv->adapter->fwbits & MRVDRV_FW_BIT_FWT)
+               return -EFAULT;
+
        lbs_pr_debug(1, "FWT CMD(%d)\n", cmd_action);

        cmd->command = cpu_to_le16(cmd_fwt_access);



More information about the libertas-dev mailing list