diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmdresp.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmdresp.c | 81 |
1 files changed, 66 insertions, 15 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index a79ed9bd9695..97715dfbdf58 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c | |||
@@ -227,7 +227,7 @@ static int mwifiex_ret_get_log(struct mwifiex_private *priv, | |||
227 | struct mwifiex_ds_get_stats *stats) | 227 | struct mwifiex_ds_get_stats *stats) |
228 | { | 228 | { |
229 | struct host_cmd_ds_802_11_get_log *get_log = | 229 | struct host_cmd_ds_802_11_get_log *get_log = |
230 | (struct host_cmd_ds_802_11_get_log *) &resp->params.get_log; | 230 | &resp->params.get_log; |
231 | 231 | ||
232 | if (stats) { | 232 | if (stats) { |
233 | stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame); | 233 | stats->mcast_tx_frame = le32_to_cpu(get_log->mcast_tx_frame); |
@@ -282,7 +282,7 @@ static int mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv, | |||
282 | u32 i; | 282 | u32 i; |
283 | int ret = 0; | 283 | int ret = 0; |
284 | 284 | ||
285 | tlv_buf = (u8 *) ((u8 *) rate_cfg) + | 285 | tlv_buf = ((u8 *)rate_cfg) + |
286 | sizeof(struct host_cmd_ds_tx_rate_cfg); | 286 | sizeof(struct host_cmd_ds_tx_rate_cfg); |
287 | tlv_buf_len = *(u16 *) (tlv_buf + sizeof(u16)); | 287 | tlv_buf_len = *(u16 *) (tlv_buf + sizeof(u16)); |
288 | 288 | ||
@@ -451,6 +451,57 @@ static int mwifiex_ret_tx_power_cfg(struct mwifiex_private *priv, | |||
451 | } | 451 | } |
452 | 452 | ||
453 | /* | 453 | /* |
454 | * This function handles the command response of get RF Tx power. | ||
455 | */ | ||
456 | static int mwifiex_ret_rf_tx_power(struct mwifiex_private *priv, | ||
457 | struct host_cmd_ds_command *resp) | ||
458 | { | ||
459 | struct host_cmd_ds_rf_tx_pwr *txp = &resp->params.txp; | ||
460 | u16 action = le16_to_cpu(txp->action); | ||
461 | |||
462 | priv->tx_power_level = le16_to_cpu(txp->cur_level); | ||
463 | |||
464 | if (action == HostCmd_ACT_GEN_GET) { | ||
465 | priv->max_tx_power_level = txp->max_power; | ||
466 | priv->min_tx_power_level = txp->min_power; | ||
467 | } | ||
468 | |||
469 | dev_dbg(priv->adapter->dev, | ||
470 | "Current TxPower Level=%d, Max Power=%d, Min Power=%d\n", | ||
471 | priv->tx_power_level, priv->max_tx_power_level, | ||
472 | priv->min_tx_power_level); | ||
473 | |||
474 | return 0; | ||
475 | } | ||
476 | |||
477 | /* | ||
478 | * This function handles the command response of set rf antenna | ||
479 | */ | ||
480 | static int mwifiex_ret_rf_antenna(struct mwifiex_private *priv, | ||
481 | struct host_cmd_ds_command *resp) | ||
482 | { | ||
483 | struct host_cmd_ds_rf_ant_mimo *ant_mimo = &resp->params.ant_mimo; | ||
484 | struct host_cmd_ds_rf_ant_siso *ant_siso = &resp->params.ant_siso; | ||
485 | struct mwifiex_adapter *adapter = priv->adapter; | ||
486 | |||
487 | if (adapter->hw_dev_mcs_support == HT_STREAM_2X2) | ||
488 | dev_dbg(adapter->dev, | ||
489 | "RF_ANT_RESP: Tx action = 0x%x, Tx Mode = 0x%04x" | ||
490 | " Rx action = 0x%x, Rx Mode = 0x%04x\n", | ||
491 | le16_to_cpu(ant_mimo->action_tx), | ||
492 | le16_to_cpu(ant_mimo->tx_ant_mode), | ||
493 | le16_to_cpu(ant_mimo->action_rx), | ||
494 | le16_to_cpu(ant_mimo->rx_ant_mode)); | ||
495 | else | ||
496 | dev_dbg(adapter->dev, | ||
497 | "RF_ANT_RESP: action = 0x%x, Mode = 0x%04x\n", | ||
498 | le16_to_cpu(ant_siso->action), | ||
499 | le16_to_cpu(ant_siso->ant_mode)); | ||
500 | |||
501 | return 0; | ||
502 | } | ||
503 | |||
504 | /* | ||
454 | * This function handles the command response of set/get MAC address. | 505 | * This function handles the command response of set/get MAC address. |
455 | * | 506 | * |
456 | * Handling includes saving the MAC address in driver. | 507 | * Handling includes saving the MAC address in driver. |
@@ -679,39 +730,33 @@ static int mwifiex_ret_reg_access(u16 type, struct host_cmd_ds_command *resp, | |||
679 | eeprom = data_buf; | 730 | eeprom = data_buf; |
680 | switch (type) { | 731 | switch (type) { |
681 | case HostCmd_CMD_MAC_REG_ACCESS: | 732 | case HostCmd_CMD_MAC_REG_ACCESS: |
682 | r.mac = (struct host_cmd_ds_mac_reg_access *) | 733 | r.mac = &resp->params.mac_reg; |
683 | &resp->params.mac_reg; | ||
684 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset)); | 734 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.mac->offset)); |
685 | reg_rw->value = r.mac->value; | 735 | reg_rw->value = r.mac->value; |
686 | break; | 736 | break; |
687 | case HostCmd_CMD_BBP_REG_ACCESS: | 737 | case HostCmd_CMD_BBP_REG_ACCESS: |
688 | r.bbp = (struct host_cmd_ds_bbp_reg_access *) | 738 | r.bbp = &resp->params.bbp_reg; |
689 | &resp->params.bbp_reg; | ||
690 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset)); | 739 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.bbp->offset)); |
691 | reg_rw->value = cpu_to_le32((u32) r.bbp->value); | 740 | reg_rw->value = cpu_to_le32((u32) r.bbp->value); |
692 | break; | 741 | break; |
693 | 742 | ||
694 | case HostCmd_CMD_RF_REG_ACCESS: | 743 | case HostCmd_CMD_RF_REG_ACCESS: |
695 | r.rf = (struct host_cmd_ds_rf_reg_access *) | 744 | r.rf = &resp->params.rf_reg; |
696 | &resp->params.rf_reg; | ||
697 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); | 745 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); |
698 | reg_rw->value = cpu_to_le32((u32) r.bbp->value); | 746 | reg_rw->value = cpu_to_le32((u32) r.bbp->value); |
699 | break; | 747 | break; |
700 | case HostCmd_CMD_PMIC_REG_ACCESS: | 748 | case HostCmd_CMD_PMIC_REG_ACCESS: |
701 | r.pmic = (struct host_cmd_ds_pmic_reg_access *) | 749 | r.pmic = &resp->params.pmic_reg; |
702 | &resp->params.pmic_reg; | ||
703 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset)); | 750 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.pmic->offset)); |
704 | reg_rw->value = cpu_to_le32((u32) r.pmic->value); | 751 | reg_rw->value = cpu_to_le32((u32) r.pmic->value); |
705 | break; | 752 | break; |
706 | case HostCmd_CMD_CAU_REG_ACCESS: | 753 | case HostCmd_CMD_CAU_REG_ACCESS: |
707 | r.rf = (struct host_cmd_ds_rf_reg_access *) | 754 | r.rf = &resp->params.rf_reg; |
708 | &resp->params.rf_reg; | ||
709 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); | 755 | reg_rw->offset = cpu_to_le32((u32) le16_to_cpu(r.rf->offset)); |
710 | reg_rw->value = cpu_to_le32((u32) r.rf->value); | 756 | reg_rw->value = cpu_to_le32((u32) r.rf->value); |
711 | break; | 757 | break; |
712 | case HostCmd_CMD_802_11_EEPROM_ACCESS: | 758 | case HostCmd_CMD_802_11_EEPROM_ACCESS: |
713 | r.eeprom = (struct host_cmd_ds_802_11_eeprom_access *) | 759 | r.eeprom = &resp->params.eeprom; |
714 | &resp->params.eeprom; | ||
715 | pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count); | 760 | pr_debug("info: EEPROM read len=%x\n", r.eeprom->byte_count); |
716 | if (le16_to_cpu(eeprom->byte_count) < | 761 | if (le16_to_cpu(eeprom->byte_count) < |
717 | le16_to_cpu(r.eeprom->byte_count)) { | 762 | le16_to_cpu(r.eeprom->byte_count)) { |
@@ -787,7 +832,7 @@ static int mwifiex_ret_subsc_evt(struct mwifiex_private *priv, | |||
787 | struct mwifiex_ds_misc_subsc_evt *sub_event) | 832 | struct mwifiex_ds_misc_subsc_evt *sub_event) |
788 | { | 833 | { |
789 | struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = | 834 | struct host_cmd_ds_802_11_subsc_evt *cmd_sub_event = |
790 | (struct host_cmd_ds_802_11_subsc_evt *)&resp->params.subsc_evt; | 835 | &resp->params.subsc_evt; |
791 | 836 | ||
792 | /* For every subscribe event command (Get/Set/Clear), FW reports the | 837 | /* For every subscribe event command (Get/Set/Clear), FW reports the |
793 | * current set of subscribed events*/ | 838 | * current set of subscribed events*/ |
@@ -847,6 +892,12 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *priv, u16 cmdresp_no, | |||
847 | case HostCmd_CMD_TXPWR_CFG: | 892 | case HostCmd_CMD_TXPWR_CFG: |
848 | ret = mwifiex_ret_tx_power_cfg(priv, resp); | 893 | ret = mwifiex_ret_tx_power_cfg(priv, resp); |
849 | break; | 894 | break; |
895 | case HostCmd_CMD_RF_TX_PWR: | ||
896 | ret = mwifiex_ret_rf_tx_power(priv, resp); | ||
897 | break; | ||
898 | case HostCmd_CMD_RF_ANTENNA: | ||
899 | ret = mwifiex_ret_rf_antenna(priv, resp); | ||
900 | break; | ||
850 | case HostCmd_CMD_802_11_PS_MODE_ENH: | 901 | case HostCmd_CMD_802_11_PS_MODE_ENH: |
851 | ret = mwifiex_ret_enh_power_mode(priv, resp, data_buf); | 902 | ret = mwifiex_ret_enh_power_mode(priv, resp, data_buf); |
852 | break; | 903 | break; |