aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/sta_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmd.c')
-rw-r--r--drivers/net/wireless/mwifiex/sta_cmd.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 40e025da6bc..b9cd9ed48c4 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -260,6 +260,23 @@ static int mwifiex_cmd_tx_power_cfg(struct host_cmd_ds_command *cmd,
260} 260}
261 261
262/* 262/*
263 * This function prepares command to get RF Tx power.
264 */
265static int mwifiex_cmd_rf_tx_power(struct mwifiex_private *priv,
266 struct host_cmd_ds_command *cmd,
267 u16 cmd_action, void *data_buf)
268{
269 struct host_cmd_ds_rf_tx_pwr *txp = &cmd->params.txp;
270
271 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_rf_tx_pwr)
272 + S_DS_GEN);
273 cmd->command = cpu_to_le16(HostCmd_CMD_RF_TX_PWR);
274 txp->action = cpu_to_le16(cmd_action);
275
276 return 0;
277}
278
279/*
263 * This function prepares command to set Host Sleep configuration. 280 * This function prepares command to set Host Sleep configuration.
264 * 281 *
265 * Preparation includes - 282 * Preparation includes -
@@ -793,8 +810,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
793 struct host_cmd_ds_mac_reg_access *mac_reg; 810 struct host_cmd_ds_mac_reg_access *mac_reg;
794 811
795 cmd->size = cpu_to_le16(sizeof(*mac_reg) + S_DS_GEN); 812 cmd->size = cpu_to_le16(sizeof(*mac_reg) + S_DS_GEN);
796 mac_reg = (struct host_cmd_ds_mac_reg_access *) &cmd-> 813 mac_reg = &cmd->params.mac_reg;
797 params.mac_reg;
798 mac_reg->action = cpu_to_le16(cmd_action); 814 mac_reg->action = cpu_to_le16(cmd_action);
799 mac_reg->offset = 815 mac_reg->offset =
800 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 816 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -806,8 +822,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
806 struct host_cmd_ds_bbp_reg_access *bbp_reg; 822 struct host_cmd_ds_bbp_reg_access *bbp_reg;
807 823
808 cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN); 824 cmd->size = cpu_to_le16(sizeof(*bbp_reg) + S_DS_GEN);
809 bbp_reg = (struct host_cmd_ds_bbp_reg_access *) 825 bbp_reg = &cmd->params.bbp_reg;
810 &cmd->params.bbp_reg;
811 bbp_reg->action = cpu_to_le16(cmd_action); 826 bbp_reg->action = cpu_to_le16(cmd_action);
812 bbp_reg->offset = 827 bbp_reg->offset =
813 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 828 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -819,8 +834,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
819 struct host_cmd_ds_rf_reg_access *rf_reg; 834 struct host_cmd_ds_rf_reg_access *rf_reg;
820 835
821 cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN); 836 cmd->size = cpu_to_le16(sizeof(*rf_reg) + S_DS_GEN);
822 rf_reg = (struct host_cmd_ds_rf_reg_access *) 837 rf_reg = &cmd->params.rf_reg;
823 &cmd->params.rf_reg;
824 rf_reg->action = cpu_to_le16(cmd_action); 838 rf_reg->action = cpu_to_le16(cmd_action);
825 rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 839 rf_reg->offset = cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
826 rf_reg->value = (u8) le32_to_cpu(reg_rw->value); 840 rf_reg->value = (u8) le32_to_cpu(reg_rw->value);
@@ -831,8 +845,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
831 struct host_cmd_ds_pmic_reg_access *pmic_reg; 845 struct host_cmd_ds_pmic_reg_access *pmic_reg;
832 846
833 cmd->size = cpu_to_le16(sizeof(*pmic_reg) + S_DS_GEN); 847 cmd->size = cpu_to_le16(sizeof(*pmic_reg) + S_DS_GEN);
834 pmic_reg = (struct host_cmd_ds_pmic_reg_access *) &cmd-> 848 pmic_reg = &cmd->params.pmic_reg;
835 params.pmic_reg;
836 pmic_reg->action = cpu_to_le16(cmd_action); 849 pmic_reg->action = cpu_to_le16(cmd_action);
837 pmic_reg->offset = 850 pmic_reg->offset =
838 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 851 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -844,8 +857,7 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
844 struct host_cmd_ds_rf_reg_access *cau_reg; 857 struct host_cmd_ds_rf_reg_access *cau_reg;
845 858
846 cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN); 859 cmd->size = cpu_to_le16(sizeof(*cau_reg) + S_DS_GEN);
847 cau_reg = (struct host_cmd_ds_rf_reg_access *) 860 cau_reg = &cmd->params.rf_reg;
848 &cmd->params.rf_reg;
849 cau_reg->action = cpu_to_le16(cmd_action); 861 cau_reg->action = cpu_to_le16(cmd_action);
850 cau_reg->offset = 862 cau_reg->offset =
851 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset)); 863 cpu_to_le16((u16) le32_to_cpu(reg_rw->offset));
@@ -856,7 +868,6 @@ static int mwifiex_cmd_reg_access(struct host_cmd_ds_command *cmd,
856 { 868 {
857 struct mwifiex_ds_read_eeprom *rd_eeprom = data_buf; 869 struct mwifiex_ds_read_eeprom *rd_eeprom = data_buf;
858 struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom = 870 struct host_cmd_ds_802_11_eeprom_access *cmd_eeprom =
859 (struct host_cmd_ds_802_11_eeprom_access *)
860 &cmd->params.eeprom; 871 &cmd->params.eeprom;
861 872
862 cmd->size = cpu_to_le16(sizeof(*cmd_eeprom) + S_DS_GEN); 873 cmd->size = cpu_to_le16(sizeof(*cmd_eeprom) + S_DS_GEN);
@@ -1055,6 +1066,10 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no,
1055 ret = mwifiex_cmd_tx_power_cfg(cmd_ptr, cmd_action, 1066 ret = mwifiex_cmd_tx_power_cfg(cmd_ptr, cmd_action,
1056 data_buf); 1067 data_buf);
1057 break; 1068 break;
1069 case HostCmd_CMD_RF_TX_PWR:
1070 ret = mwifiex_cmd_rf_tx_power(priv, cmd_ptr, cmd_action,
1071 data_buf);
1072 break;
1058 case HostCmd_CMD_802_11_PS_MODE_ENH: 1073 case HostCmd_CMD_802_11_PS_MODE_ENH:
1059 ret = mwifiex_cmd_enh_power_mode(priv, cmd_ptr, cmd_action, 1074 ret = mwifiex_cmd_enh_power_mode(priv, cmd_ptr, cmd_action,
1060 (uint16_t)cmd_oid, data_buf); 1075 (uint16_t)cmd_oid, data_buf);
@@ -1283,7 +1298,7 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
1283 priv->data_rate = 0; 1298 priv->data_rate = 0;
1284 1299
1285 /* get tx power */ 1300 /* get tx power */
1286 ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_TXPWR_CFG, 1301 ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_RF_TX_PWR,
1287 HostCmd_ACT_GEN_GET, 0, NULL); 1302 HostCmd_ACT_GEN_GET, 0, NULL);
1288 if (ret) 1303 if (ret)
1289 return -1; 1304 return -1;