mwifiex: add sta_list firmware command
authorXinming Hu <huxm@marvell.com>
Wed, 3 Jun 2015 11:29:39 +0000 (16:59 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 8 Jun 2015 08:41:54 +0000 (11:41 +0300)
This patch add sta_list firmware command, which can be used
to get power status and rssi for the stations associated to
mwifiex micro AP.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/cmdevt.c
drivers/net/wireless/mwifiex/fw.h
drivers/net/wireless/mwifiex/sta_cmdresp.c
drivers/net/wireless/mwifiex/uap_cmd.c

index b5033d1bbc746c47777ae9b08c4ab0b1294d3662..a51feac6bd36242a8298dda9898e13a65d661318 100644 (file)
@@ -575,6 +575,7 @@ int mwifiex_send_cmd(struct mwifiex_private *priv, u16 cmd_no,
                case HostCmd_CMD_UAP_BSS_STOP:
                case HostCmd_CMD_UAP_STA_DEAUTH:
                case HOST_CMD_APCMD_SYS_RESET:
+               case HOST_CMD_APCMD_STA_LIST:
                        ret = mwifiex_uap_prepare_cmd(priv, cmd_no, cmd_action,
                                                      cmd_oid, data_buf,
                                                      cmd_ptr);
index b6bbf9ae57b63c29f12a2020f54be19cacc96840..bcf08c95db832e21edaea174167bc9ad62b3d5f3 100644 (file)
@@ -334,6 +334,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
 #define HostCmd_CMD_UAP_SYS_CONFIG                    0x00b0
 #define HostCmd_CMD_UAP_BSS_START                     0x00b1
 #define HostCmd_CMD_UAP_BSS_STOP                      0x00b2
+#define HOST_CMD_APCMD_STA_LIST                       0x00b3
 #define HostCmd_CMD_UAP_STA_DEAUTH                    0x00b5
 #define HostCmd_CMD_11N_CFG                           0x00cd
 #define HostCmd_CMD_11N_ADDBA_REQ                     0x00ce
@@ -1465,6 +1466,18 @@ struct host_cmd_ds_sta_deauth {
        __le16 reason;
 } __packed;
 
+struct mwifiex_ie_types_sta_info {
+       struct mwifiex_ie_types_header header;
+       u8 mac[ETH_ALEN];
+       u8 power_mfg_status;
+       s8 rssi;
+};
+
+struct host_cmd_ds_sta_list {
+       u16 sta_count;
+       u8 tlv[0];
+} __packed;
+
 struct mwifiex_ie_types_pwr_capability {
        struct mwifiex_ie_types_header header;
        s8 min_pwr;
@@ -1994,6 +2007,7 @@ struct host_cmd_ds_command {
                struct host_cmd_ds_802_11_subsc_evt subsc_evt;
                struct host_cmd_ds_sys_config uap_sys_config;
                struct host_cmd_ds_sta_deauth sta_deauth;
+               struct host_cmd_ds_sta_list sta_list;
                struct host_cmd_11ac_vht_cfg vht_cfg;
                struct host_cmd_ds_coalesce_cfg coalesce_cfg;
                struct host_cmd_ds_tdls_oper tdls_oper;
index f20a09e0c774b1d7c2964d7f1016bb87bc61ad82..b645884b3b97a2c1491f745e436d217dec3b5f4d 100644 (file)
@@ -958,6 +958,27 @@ static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv,
        return 0;
 }
 
+static int mwifiex_ret_uap_sta_list(struct mwifiex_private *priv,
+                                   struct host_cmd_ds_command *resp)
+{
+       struct host_cmd_ds_sta_list *sta_list =
+               &resp->params.sta_list;
+       struct mwifiex_ie_types_sta_info *sta_info = (void *)&sta_list->tlv;
+       int i;
+       struct mwifiex_sta_node *sta_node;
+
+       for (i = 0; i < sta_list->sta_count; i++) {
+               sta_node = mwifiex_get_sta_entry(priv, sta_info->mac);
+               if (unlikely(!sta_node))
+                       continue;
+
+               sta_node->stats.rssi = sta_info->rssi;
+               sta_info++;
+       }
+
+       return 0;
+}
+
 /* This function handles the command response of set_cfg_data */
 static int mwifiex_ret_cfg_data(struct mwifiex_private *priv,
                                struct host_cmd_ds_command *resp)
@@ -1148,6 +1169,9 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no,
                break;
        case HostCmd_CMD_UAP_SYS_CONFIG:
                break;
+       case HOST_CMD_APCMD_STA_LIST:
+               ret = mwifiex_ret_uap_sta_list(priv, resp);
+               break;
        case HostCmd_CMD_UAP_BSS_START:
                adapter->tx_lock_flag = false;
                adapter->pps_uapsd_mode = false;
index 68fbdf69f94bfae39de20e87824b1699f1f62a44..9510f1e4d8265736f0f7f23a8514f1c6e8bc0c44 100644 (file)
@@ -755,6 +755,7 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no,
        case HostCmd_CMD_UAP_BSS_START:
        case HostCmd_CMD_UAP_BSS_STOP:
        case HOST_CMD_APCMD_SYS_RESET:
+       case HOST_CMD_APCMD_STA_LIST:
                cmd->command = cpu_to_le16(cmd_no);
                cmd->size = cpu_to_le16(S_DS_GEN);
                break;