Commit 1c165c97 authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville

ath9k_htc: Fix WMI and beacon header

Match the beacon header with that of the firmware.
Also, the firmware reports the TSF for an SWBA, so
store it.
Signed-off-by: default avatarSujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 29bbfb24
...@@ -96,8 +96,8 @@ struct tx_mgmt_hdr { ...@@ -96,8 +96,8 @@ struct tx_mgmt_hdr {
} __packed; } __packed;
struct tx_beacon_header { struct tx_beacon_header {
u8 len_changed;
u8 vif_index; u8 vif_index;
u8 len_changed;
u16 rev; u16 rev;
} __packed; } __packed;
......
...@@ -156,6 +156,7 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb, ...@@ -156,6 +156,7 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
struct wmi_cmd_hdr *hdr; struct wmi_cmd_hdr *hdr;
u16 cmd_id; u16 cmd_id;
void *wmi_event; void *wmi_event;
struct wmi_event_swba *swba;
#ifdef CONFIG_ATH9K_HTC_DEBUGFS #ifdef CONFIG_ATH9K_HTC_DEBUGFS
__be32 txrate; __be32 txrate;
#endif #endif
...@@ -170,7 +171,11 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb, ...@@ -170,7 +171,11 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb,
wmi_event = skb_pull(skb, sizeof(struct wmi_cmd_hdr)); wmi_event = skb_pull(skb, sizeof(struct wmi_cmd_hdr));
switch (cmd_id) { switch (cmd_id) {
case WMI_SWBA_EVENTID: case WMI_SWBA_EVENTID:
wmi->beacon_pending = *(u8 *)wmi_event; swba = (struct wmi_event_swba *) wmi_event;
wmi->tsf = be64_to_cpu(swba->tsf);
wmi->beacon_pending = swba->beacon_pending;
tasklet_schedule(&wmi->drv_priv->swba_tasklet); tasklet_schedule(&wmi->drv_priv->swba_tasklet);
break; break;
case WMI_FATAL_EVENTID: case WMI_FATAL_EVENTID:
......
...@@ -36,6 +36,11 @@ struct wmi_fw_version { ...@@ -36,6 +36,11 @@ struct wmi_fw_version {
__be16 minor; __be16 minor;
} __packed; } __packed;
struct wmi_event_swba {
__be64 tsf;
u8 beacon_pending;
};
enum wmi_cmd_id { enum wmi_cmd_id {
WMI_ECHO_CMDID = 0x0001, WMI_ECHO_CMDID = 0x0001,
WMI_ACCESS_MEMORY_CMDID, WMI_ACCESS_MEMORY_CMDID,
...@@ -106,6 +111,7 @@ struct wmi { ...@@ -106,6 +111,7 @@ struct wmi {
u32 cmd_rsp_len; u32 cmd_rsp_len;
bool stopped; bool stopped;
u64 tsf;
u8 beacon_pending; u8 beacon_pending;
spinlock_t wmi_lock; spinlock_t wmi_lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment