[PATCH 05/13] Update probe response template
Kalle Valo
kvalo at qca.qualcomm.com
Thu May 23 07:06:58 EDT 2013
Needed for probe response offload support in AP mode. But
it's not properly working and hence not enabled yet, to do that we have to add:
wcn_priv->hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>
---
hal.h | 2 +-
main.c | 6 ++++++
smd.c | 32 ++++++++++++++++++++++++++++++++
smd.h | 1 +
4 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/hal.h b/hal.h
index d82c50b..a2eb4fb 100644
--- a/hal.h
+++ b/hal.h
@@ -2827,7 +2827,7 @@ struct wcn36xx_hal_get_tpc_report_rsp_msg {
u32 status;
};
-struct send_probe_resp_req_msg {
+struct wcn36xx_hal_send_probe_resp_req_msg {
struct wcn36xx_hal_msg_header header;
u8 probe_resp_template[BEACON_TEMPLATE_SIZE];
diff --git a/main.c b/main.c
index 902ecd2..3e8d1c8 100644
--- a/main.c
+++ b/main.c
@@ -201,6 +201,12 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
}
}
+ if (changed & BSS_CHANGED_AP_PROBE_RESP) {
+ wcn36xx_dbg(WCN36XX_DBG_MAC, "mac bss changed ap probe resp");
+ skb = ieee80211_proberesp_get(hw, vif);
+ wcn36xx_smd_update_proberesp_tmpl(wcn, skb);
+ }
+
if (changed & BSS_CHANGED_BEACON_ENABLED){
if(!wcn->beacon_enable) {
wcn->beacon_enable = true;
diff --git a/smd.c b/smd.c
index 4154680..74814a1 100644
--- a/smd.c
+++ b/smd.c
@@ -676,6 +676,37 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct sk_buff *skb_beacon, u16
return wcn36xx_smd_send_and_wait(wcn, msg_body.header.len);
};
+int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn, struct sk_buff *skb)
+{
+ struct wcn36xx_hal_send_probe_resp_req_msg msg;
+
+ INIT_HAL_MSG(msg, WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_REQ);
+
+ /* // TODO need to find out why this is needed? */
+ /* msg_body.beacon_length = skb_beacon->len + 6; */
+
+ if (skb->len > BEACON_TEMPLATE_SIZE) {
+ wcn36xx_warn("probe response template is too big: %d",
+ skb->len);
+ return -E2BIG;
+ }
+
+ msg.probe_resp_template_len = skb->len;
+ memcpy(&msg.probe_resp_template, skb->data, skb->len);
+
+ memcpy(&msg.bssid, &wcn->addresses[0], ETH_ALEN);
+
+ PREPARE_HAL_BUF(wcn->smd_buf, msg);
+
+ wcn36xx_dbg(WCN36XX_DBG_HAL,
+ "hal update probe rsp len %d bssid %pM",
+ msg.probe_resp_template_len, msg.bssid);
+
+ dev_kfree_skb(skb);
+
+ return wcn36xx_smd_send_and_wait(wcn, msg.header.len);
+};
+
static void wcn36xx_smd_notify(void *data, unsigned event)
{
struct wcn36xx *wcn = (struct wcn36xx *)data;
@@ -721,6 +752,7 @@ static void wcn36xx_smd_rsp_process(struct wcn36xx *wcn, void *buf, size_t len)
case WCN36XX_HAL_CONFIG_STA_RSP:
case WCN36XX_HAL_SEND_BEACON_RSP:
case WCN36XX_HAL_SET_LINK_ST_RSP:
+ case WCN36XX_HAL_UPDATE_PROBE_RSP_TEMPLATE_RSP:
if(wcn36xx_smd_rsp_status_check(buf, len)) {
wcn36xx_warn("error response from hal request %d",
msg_header->msg_type);
diff --git a/smd.h b/smd.h
index db09945..e6ad2d0 100644
--- a/smd.h
+++ b/smd.h
@@ -64,6 +64,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, bool sta_mode, u8 *bssid, u8 upd
int wcn36xx_smd_delete_bss(struct wcn36xx *wcn);
int wcn36xx_smd_config_sta(struct wcn36xx *wcn, u8 *bssid, u16 ass_id, u8 *sta_mac);
int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct sk_buff *skb_beacon, u16 tim_off, u16 p2p_off);
+int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn, struct sk_buff *skb);
// WCN36XX configuration parameters
struct wcn36xx_fw_cfg {
More information about the wcn36xx
mailing list