#define WCN36XX_HAL_BSS_INVALID_IDX 0xFF
/* Default Beacon template size. */
-#define BEACON_TEMPLATE_SIZE 0x17C
+#define BEACON_TEMPLATE_SIZE 0x180
/* Minimum PVM size that the FW expects. See comment in smd.c for details. */
#define TIM_MIN_PVM_SIZE 6
struct wcn36xx_hal_send_beacon_req_msg {
struct wcn36xx_hal_msg_header header;
- /* length of the template + 6. Only qcom knows why */
- u32 beacon_length6;
-
- /* length of the template. */
- u32 beacon_length;
+ /* length of the template + sizeof(beacon_length) */
+ u32 template_length;
/* Beacon data. */
- u8 beacon[BEACON_TEMPLATE_SIZE];
+ u32 beacon_length;
+ u8 beacon[BEACON_TEMPLATE_SIZE - sizeof(u32)];
u8 bssid[ETH_ALEN];
{
struct wcn36xx_hal_send_beacon_req_msg msg_body;
int ret = 0, pad, pvm_len;
+ u32 beacon_length;
mutex_lock(&wcn->hal_mutex);
INIT_HAL_MSG(msg_body, WCN36XX_HAL_SEND_BEACON_REQ);
if (vif->type == NL80211_IFTYPE_MESH_POINT)
pad = 0;
- msg_body.beacon_length = skb_beacon->len + pad;
- /* TODO need to find out why + 6 is needed */
- msg_body.beacon_length6 = msg_body.beacon_length + 6;
+ beacon_length = skb_beacon->len + pad;
+ msg_body.template_length = beacon_length + sizeof(beacon_length);
- if (msg_body.beacon_length > BEACON_TEMPLATE_SIZE) {
+ if (msg_body.template_length > BEACON_TEMPLATE_SIZE) {
wcn36xx_err("Beacon is to big: beacon size=%d\n",
- msg_body.beacon_length);
+ msg_body.template_length);
ret = -ENOMEM;
goto out;
}
+ msg_body.beacon_length = beacon_length;
memcpy(msg_body.beacon, skb_beacon->data, skb_beacon->len);
memcpy(msg_body.bssid, vif->addr, ETH_ALEN);