]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] libertas: updated mesh commands for 5.220.9.p11
authorLuis Carlos Cobo <luisca@cozybit.com>
Fri, 25 May 2007 17:53:26 +0000 (13:53 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 11 Jun 2007 18:28:41 +0000 (14:28 -0400)
Updated commands fwt_add and fwt_list, bt_list.
New commands: bt_get_invert, bt_set_invert, to invert the blinding table,
i.e., receive only frames from nodes listed in the BT.

This patch needs/is needed for firmware 5.220.9.p11.

Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/defs.h
drivers/net/wireless/libertas/host.h
drivers/net/wireless/libertas/hostcmd.h
drivers/net/wireless/libertas/ioctl.c
drivers/net/wireless/libertas/wext.c
drivers/net/wireless/libertas/wext.h

index 5aaeb91418b4d4f778f2cc13173018ae92f90f2a..910706c54def05c8521a2530f89dcc32affe7b32 100644 (file)
@@ -861,6 +861,11 @@ static int wlan_cmd_bt_access(wlan_private * priv,
                break;
        case cmd_act_bt_access_reset:
                break;
+       case cmd_act_bt_access_set_invert:
+               bt_access->id = cpu_to_le32(*(u32 *) pdata_buf);
+               break;
+       case cmd_act_bt_access_get_invert:
+               break;
        default:
                break;
        }
index b189d3bce2e803d84c6afa19b2831cbb3f0c5ffc..e78421fce4eb04878e88b045f65483f462b813d4 100644 (file)
@@ -374,6 +374,8 @@ enum SNMP_MIB_VALUE_e {
 /* Default values for fwt commands. */
 #define FWT_DEFAULT_METRIC 0
 #define FWT_DEFAULT_DIR 1
+/* Default Rate, 11Mbps */
+#define FWT_DEFAULT_RATE 3
 #define FWT_DEFAULT_SSN 0xffffffff
 #define FWT_DEFAULT_DSN 0
 #define FWT_DEFAULT_HOPCOUNT 0
index b7acdc2b1aeeef8fa84a8faee70f09fb187b86cb..e12dbc65acccaf83777d72dd6bd817a98fe5d673 100644 (file)
@@ -287,7 +287,9 @@ enum cmd_bt_access_opts {
        cmd_act_bt_access_add = 5,
        cmd_act_bt_access_del,
        cmd_act_bt_access_list,
-       cmd_act_bt_access_reset
+       cmd_act_bt_access_reset,
+       cmd_act_bt_access_set_invert,
+       cmd_act_bt_access_get_invert
 };
 
 /* Define action or option for cmd_fwt_access */
index e7745fc2865e172cc9cae1f4ddde64ae8fca7580..581b9a37d7b7f4b0960510b212ebeb52dc059509 100644 (file)
@@ -607,18 +607,21 @@ struct cmd_ds_bt_access {
 struct cmd_ds_fwt_access {
        u16 action;
        u32 id;
+       u8 valid;
        u8 da[ETH_ALEN];
        u8 dir;
        u8 ra[ETH_ALEN];
        u32 ssn;
        u32 dsn;
        u32 metric;
+       u8 rate;
        u8 hopcount;
        u8 ttl;
        u32 expiration;
        u8 sleepmode;
        u32 snr;
        u32 references;
+       u8 prec[ETH_ALEN];
 } __attribute__ ((packed));
 
 struct cmd_ds_mesh_access {
index 3f95e97a309ef77064cce676cdad67712c3b721e..5a5863239067ec27ae96d7d6360b83703fa7733e 100644 (file)
@@ -241,7 +241,7 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req)
        if (ret == 0) {
                addr1 = param.addr1addr2;
 
-               pos = sprintf(pbuf, "ignoring traffic from ");
+               pos = sprintf(pbuf, "BT includes node ");
                pbuf += pos;
                pos = eth_addr2str(addr1, pbuf);
                pbuf += pos;
@@ -257,6 +257,64 @@ static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req)
                return -EFAULT;
        }
 
+       lbs_deb_leave(LBS_DEB_IOCTL);
+       return 0 ;
+}
+
+/**
+ *  @brief          Sets inverted state of blacklist (non-zero if inverted)
+ *  @param priv     A pointer to wlan_private structure
+ *  @param req      A pointer to ifreq structure
+ *  @return         0 --success, otherwise fail
+ */
+static int wlan_bt_set_invert_ioctl(wlan_private * priv, struct ifreq *req)
+{
+       int ret;
+       struct iwreq *wrq = (struct iwreq *)req;
+       union {
+               int id;
+               char addr1addr2[2 * ETH_ALEN];
+       } param;
+
+       lbs_deb_enter(LBS_DEB_IOCTL);
+
+       param.id = SUBCMD_DATA(wrq) ;
+       ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
+                                   cmd_act_bt_access_set_invert,
+                                   cmd_option_waitforrsp, 0,
+                                   (char *)&param);
+       if (ret != 0)
+               return -EFAULT;
+       lbs_deb_leave(LBS_DEB_IOCTL);
+       return 0;
+}
+
+/**
+ *  @brief          Gets inverted state of blacklist (non-zero if inverted)
+ *  @param priv     A pointer to wlan_private structure
+ *  @param req      A pointer to ifreq structure
+ *  @return         0 --success, otherwise fail
+ */
+static int wlan_bt_get_invert_ioctl(wlan_private * priv, struct ifreq *req)
+{
+       int ret;
+       union {
+               int id;
+               char addr1addr2[2 * ETH_ALEN];
+       } param;
+
+       lbs_deb_enter(LBS_DEB_IOCTL);
+
+       ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
+                                   cmd_act_bt_access_get_invert,
+                                   cmd_option_waitforrsp, 0,
+                                   (char *)&param);
+
+       if (ret == 0)
+               req->ifr_data = (char *)(le32_to_cpu(param.id));
+       else
+               return -EFAULT;
+
        lbs_deb_leave(LBS_DEB_IOCTL);
        return 0;
 }
@@ -313,6 +371,11 @@ static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req)
        else
                fwt_access.dir = FWT_DEFAULT_DIR;
 
+       if ((ptr = next_param(ptr)))
+               fwt_access.rate = (u8) simple_strtoul(ptr, &ptr, 10);
+       else
+               fwt_access.rate = FWT_DEFAULT_RATE;
+
        if ((ptr = next_param(ptr)))
                fwt_access.ssn =
                        cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
@@ -441,15 +504,18 @@ static void print_route(struct cmd_ds_fwt_access fwt_access, char *buf)
        buf += eth_addr2str(fwt_access.da, buf);
        buf += sprintf(buf, " ");
        buf += eth_addr2str(fwt_access.ra, buf);
+       buf += sprintf(buf, " %u", fwt_access.valid);
        buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.metric));
        buf += sprintf(buf, " %u", fwt_access.dir);
+       buf += sprintf(buf, " %u", fwt_access.rate);
        buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.ssn));
        buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.dsn));
        buf += sprintf(buf, " %u", fwt_access.hopcount);
        buf += sprintf(buf, " %u", fwt_access.ttl);
        buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.expiration));
        buf += sprintf(buf, " %u", fwt_access.sleepmode);
-       buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.snr));
+       buf += sprintf(buf, " %u ", le32_to_cpu(fwt_access.snr));
+       buf += eth_addr2str(fwt_access.prec, buf);
 }
 
 /**
@@ -866,6 +932,10 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
                        ret = wlan_mesh_set_ttl_ioctl(priv, idata);
                        break;
 
+               case WLAN_SUBCMD_BT_SET_INVERT:
+                       ret = wlan_bt_set_invert_ioctl(priv, req);
+                       break ;
+
                default:
                        ret = -EOPNOTSUPP;
                        break;
@@ -923,6 +993,10 @@ int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
                        ret = wlan_mesh_get_ttl_ioctl(priv, req);
                        break;
 
+               case WLAN_SUBCMD_BT_GET_INVERT:
+                       ret = wlan_bt_get_invert_ioctl(priv, req);
+                       break ;
+
                default:
                        ret = -EOPNOTSUPP;
 
index 1bc2fbfe730f84f705857e5143673623b7a07260..4f0ae8026b0ec400f875a9303e4fa49458d492c3 100644 (file)
@@ -1066,6 +1066,16 @@ static const struct iw_priv_args wlan_private_args[] = {
         IW_PRIV_TYPE_CHAR | 128,
         IW_PRIV_TYPE_CHAR | 128,
         "bt_list"},
+       {
+        WLAN_SUBCMD_BT_SET_INVERT,
+        IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+        IW_PRIV_TYPE_NONE,
+        "bt_set_invert"},
+       {
+        WLAN_SUBCMD_BT_GET_INVERT,
+        IW_PRIV_TYPE_NONE,
+        IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
+        "bt_get_invert"},
        /* FWT Management */
        {
         WLAN_SUBCMD_FWT_ADD,
index 15cfaaf0797ff7b43faee11f376fe45c9e79657d..fb7e828dd9beb09d18e6e42f29698e19c84ecef6 100644 (file)
 #define WLAN_SUBCMD_FWT_CLEANUP                        15
 #define WLAN_SUBCMD_FWT_TIME                   16
 #define WLAN_SUBCMD_MESH_GET_TTL               17
+#define WLAN_SUBCMD_BT_GET_INVERT              18
 
 #define WLAN_SETONEINT_GETNONE         (WLANIOCTL + 24)
 #define WLANSETREGION                          8
 #define WLAN_SUBCMD_MESH_SET_TTL               18
+#define WLAN_SUBCMD_BT_SET_INVERT              19
 
 #define WLAN_SET128CHAR_GET128CHAR     (WLANIOCTL + 25)
 #define WLAN_SUBCMD_BT_ADD                     18
 #define WLAN_SUBCMD_BT_DEL                     19
 #define WLAN_SUBCMD_BT_LIST                    20
-#define WLAN_SUBCMD_FWT_ADD                            21
-#define WLAN_SUBCMD_FWT_DEL            22
-#define WLAN_SUBCMD_FWT_LOOKUP         23
-#define WLAN_SUBCMD_FWT_LIST_NEIGHBOR                  24
+#define WLAN_SUBCMD_FWT_ADD                    21
+#define WLAN_SUBCMD_FWT_DEL                    22
+#define WLAN_SUBCMD_FWT_LOOKUP                 23
+#define WLAN_SUBCMD_FWT_LIST_NEIGHBOR          24
 #define WLAN_SUBCMD_FWT_LIST                   25
-#define WLAN_SUBCMD_FWT_LIST_ROUTE                     26
+#define WLAN_SUBCMD_FWT_LIST_ROUTE             26
 
 #define WLAN_SET_GET_SIXTEEN_INT       (WLANIOCTL + 29)
 #define WLAN_LED_GPIO_CTRL                     5