diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2016-06-20 02:19:48 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2016-07-08 09:58:31 -0400 |
commit | 86ceae90d3f9580d8c69f814d252cde80f85b404 (patch) | |
tree | bb069a351106ef324cf88c72a37797c6fddf6708 | |
parent | 6f10b4e1e6adaa8679a719a636e9310b65b7d993 (diff) |
wcn36xx: Fix up wcn36xx_smd_update_scan_params()
Fix up the wcn36xx_smd_update_scan_params() to work with non-ancient
versions of the firmware and support actually specifying the list of
channels.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/wcn36xx/hal.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wcn36xx/smd.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wcn36xx/smd.h | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 658bfb8baabe..4f87ef1e1eb8 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h | |||
@@ -4123,7 +4123,7 @@ struct wcn36xx_hal_update_scan_params_req { | |||
4123 | 4123 | ||
4124 | /* Update scan params - sent from host to PNO to be used during PNO | 4124 | /* Update scan params - sent from host to PNO to be used during PNO |
4125 | * scanningx */ | 4125 | * scanningx */ |
4126 | struct update_scan_params_req_ex { | 4126 | struct wcn36xx_hal_update_scan_params_req_ex { |
4127 | 4127 | ||
4128 | struct wcn36xx_hal_msg_header header; | 4128 | struct wcn36xx_hal_msg_header header; |
4129 | 4129 | ||
@@ -4151,7 +4151,7 @@ struct update_scan_params_req_ex { | |||
4151 | 4151 | ||
4152 | /* Cb State */ | 4152 | /* Cb State */ |
4153 | enum phy_chan_bond_state state; | 4153 | enum phy_chan_bond_state state; |
4154 | }; | 4154 | } __packed; |
4155 | 4155 | ||
4156 | /* Update scan params - sent from host to PNO to be used during PNO | 4156 | /* Update scan params - sent from host to PNO to be used during PNO |
4157 | * scanningx */ | 4157 | * scanningx */ |
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index b2108076f5c0..feebaae1c867 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c | |||
@@ -674,22 +674,25 @@ static int wcn36xx_smd_update_scan_params_rsp(void *buf, size_t len) | |||
674 | return 0; | 674 | return 0; |
675 | } | 675 | } |
676 | 676 | ||
677 | int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn) | 677 | int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn, |
678 | u8 *channels, size_t channel_count) | ||
678 | { | 679 | { |
679 | struct wcn36xx_hal_update_scan_params_req msg_body; | 680 | struct wcn36xx_hal_update_scan_params_req_ex msg_body; |
680 | int ret = 0; | 681 | int ret = 0; |
681 | 682 | ||
682 | mutex_lock(&wcn->hal_mutex); | 683 | mutex_lock(&wcn->hal_mutex); |
683 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_UPDATE_SCAN_PARAM_REQ); | 684 | INIT_HAL_MSG(msg_body, WCN36XX_HAL_UPDATE_SCAN_PARAM_REQ); |
684 | 685 | ||
685 | msg_body.dot11d_enabled = 0; | 686 | msg_body.dot11d_enabled = false; |
686 | msg_body.dot11d_resolved = 0; | 687 | msg_body.dot11d_resolved = true; |
687 | msg_body.channel_count = 26; | 688 | |
689 | msg_body.channel_count = channel_count; | ||
690 | memcpy(msg_body.channels, channels, channel_count); | ||
688 | msg_body.active_min_ch_time = 60; | 691 | msg_body.active_min_ch_time = 60; |
689 | msg_body.active_max_ch_time = 120; | 692 | msg_body.active_max_ch_time = 120; |
690 | msg_body.passive_min_ch_time = 60; | 693 | msg_body.passive_min_ch_time = 60; |
691 | msg_body.passive_max_ch_time = 110; | 694 | msg_body.passive_max_ch_time = 110; |
692 | msg_body.state = 0; | 695 | msg_body.state = PHY_SINGLE_CHANNEL_CENTERED; |
693 | 696 | ||
694 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); | 697 | PREPARE_HAL_BUF(wcn->hal_buf, msg_body); |
695 | 698 | ||
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h index c4375ce1019a..df80cbbd9d1b 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.h +++ b/drivers/net/wireless/ath/wcn36xx/smd.h | |||
@@ -63,7 +63,7 @@ int wcn36xx_smd_start_scan(struct wcn36xx *wcn); | |||
63 | int wcn36xx_smd_end_scan(struct wcn36xx *wcn); | 63 | int wcn36xx_smd_end_scan(struct wcn36xx *wcn); |
64 | int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, | 64 | int wcn36xx_smd_finish_scan(struct wcn36xx *wcn, |
65 | enum wcn36xx_hal_sys_mode mode); | 65 | enum wcn36xx_hal_sys_mode mode); |
66 | int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn); | 66 | int wcn36xx_smd_update_scan_params(struct wcn36xx *wcn, u8 *channels, size_t channel_count); |
67 | int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif); | 67 | int wcn36xx_smd_add_sta_self(struct wcn36xx *wcn, struct ieee80211_vif *vif); |
68 | int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr); | 68 | int wcn36xx_smd_delete_sta_self(struct wcn36xx *wcn, u8 *addr); |
69 | int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index); | 69 | int wcn36xx_smd_delete_sta(struct wcn36xx *wcn, u8 sta_index); |