Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / mwifiex / 11ac.c
index cf43b3c29250add91bffeb663835c7e436fe7b4d..966a78f8e21a3ce974459c27a50326c7588cd270 100644 (file)
@@ -259,3 +259,44 @@ int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv,
 
        return ret_len;
 }
+
+int mwifiex_cmd_11ac_cfg(struct mwifiex_private *priv,
+                        struct host_cmd_ds_command *cmd, u16 cmd_action,
+                        struct mwifiex_11ac_vht_cfg *cfg)
+{
+       struct host_cmd_11ac_vht_cfg *vhtcfg = &cmd->params.vht_cfg;
+
+       cmd->command = cpu_to_le16(HostCmd_CMD_11AC_CFG);
+       cmd->size = cpu_to_le16(sizeof(struct host_cmd_11ac_vht_cfg) +
+                               S_DS_GEN);
+       vhtcfg->action = cpu_to_le16(cmd_action);
+       vhtcfg->band_config = cfg->band_config;
+       vhtcfg->misc_config = cfg->misc_config;
+       vhtcfg->cap_info = cpu_to_le32(cfg->cap_info);
+       vhtcfg->mcs_tx_set = cpu_to_le32(cfg->mcs_tx_set);
+       vhtcfg->mcs_rx_set = cpu_to_le32(cfg->mcs_rx_set);
+
+       return 0;
+}
+
+/* This function initializes the BlockACK setup information for given
+ * mwifiex_private structure for 11ac enabled networks.
+ */
+void mwifiex_set_11ac_ba_params(struct mwifiex_private *priv)
+{
+       priv->add_ba_param.timeout = MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT;
+
+       if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) {
+               priv->add_ba_param.tx_win_size =
+                                          MWIFIEX_11AC_UAP_AMPDU_DEF_TXWINSIZE;
+               priv->add_ba_param.rx_win_size =
+                                          MWIFIEX_11AC_UAP_AMPDU_DEF_RXWINSIZE;
+       } else {
+               priv->add_ba_param.tx_win_size =
+                                          MWIFIEX_11AC_STA_AMPDU_DEF_TXWINSIZE;
+               priv->add_ba_param.rx_win_size =
+                                          MWIFIEX_11AC_STA_AMPDU_DEF_RXWINSIZE;
+       }
+
+       return;
+}