]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
mwifiex: configure inactivity timeout for TDLS link
authorAvinash Patil <patila@marvell.com>
Wed, 7 May 2014 05:02:43 +0000 (22:02 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 May 2014 20:08:07 +0000 (16:08 -0400)
This patch adds configuration timeout for TDLS link. This is
configuered at the time of TDLS link configuration. If TDLS link
is inactive for more than timeout, FW will tear this link.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/fw.h
drivers/net/wireless/mwifiex/sta_cmd.c

index b485dc1ae5ebc42c5606e37723189d20e7d98b16..28994ab46e15cee9f9875ae7f700fcfa93390294 100644 (file)
@@ -169,6 +169,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define TLV_TYPE_GWK_CIPHER         (PROPRIETARY_TLV_BASE_ID + 146)
 #define TLV_TYPE_COALESCE_RULE      (PROPRIETARY_TLV_BASE_ID + 154)
 #define TLV_TYPE_KEY_PARAM_V2       (PROPRIETARY_TLV_BASE_ID + 156)
+#define TLV_TYPE_TDLS_IDLE_TIMEOUT  (PROPRIETARY_TLV_BASE_ID + 194)
 #define TLV_TYPE_FW_API_REV         (PROPRIETARY_TLV_BASE_ID + 199)
 
 #define MWIFIEX_TX_DATA_BUF_SIZE_2K        2048
@@ -708,6 +709,13 @@ struct mwifiex_ie_types_vendor_param_set {
        u8 ie[MWIFIEX_MAX_VSIE_LEN];
 };
 
+#define MWIFIEX_TDLS_IDLE_TIMEOUT      60
+
+struct mwifiex_ie_types_tdls_idle_timeout {
+       struct mwifiex_ie_types_header header;
+       __le16 value;
+} __packed;
+
 struct mwifiex_ie_types_rsn_param_set {
        struct mwifiex_ie_types_header header;
        u8 rsn_ie[1];
index e3cac1495cc705bcf3c05b479a16981578deff98..88202ce0c13965fdff679c506a3772ef287e6d54 100644 (file)
@@ -1546,6 +1546,7 @@ mwifiex_cmd_tdls_oper(struct mwifiex_private *priv,
        struct mwifiex_ie_types_extcap *extcap;
        struct mwifiex_ie_types_vhtcap *vht_capab;
        struct mwifiex_ie_types_aid *aid;
+       struct mwifiex_ie_types_tdls_idle_timeout *timeout;
        u8 *pos, qos_info;
        u16 config_len = 0;
        struct station_parameters *params = priv->sta_params;
@@ -1643,6 +1644,12 @@ mwifiex_cmd_tdls_oper(struct mwifiex_private *priv,
                        config_len += sizeof(struct mwifiex_ie_types_aid);
                }
 
+               timeout = (void *)(pos + config_len);
+               timeout->header.type = cpu_to_le16(TLV_TYPE_TDLS_IDLE_TIMEOUT);
+               timeout->header.len = cpu_to_le16(sizeof(timeout->value));
+               timeout->value = cpu_to_le16(MWIFIEX_TDLS_IDLE_TIMEOUT);
+               config_len += sizeof(struct mwifiex_ie_types_tdls_idle_timeout);
+
                break;
        default:
                dev_err(priv->adapter->dev, "Unknown TDLS operation\n");