From patchwork Wed Apr 13 05:52:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 702681 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3D5obaK024607 for ; Wed, 13 Apr 2011 05:50:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752822Ab1DMFug (ORCPT ); Wed, 13 Apr 2011 01:50:36 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:48067 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752455Ab1DMFuf (ORCPT ); Wed, 13 Apr 2011 01:50:35 -0400 Received: by mail-iy0-f174.google.com with SMTP id 14so274186iyb.19 for ; Tue, 12 Apr 2011 22:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:x-mailer:cc:subject; bh=1Z2kwcHUhIIXUWOVC7KQ4Z9XlElfNHgt82qgTMuz2/A=; b=fiu0SJaKDbazxoi69cWGdp1qEf82shiHGBPC7OHZRSMP5ppw+hX/9qT6bkFXFEc5ox KbxhTk4geu9JIGeuWRQbax92akB7E0+SbtDdC2d6fp1Ql9YEZNWiLh1LNIHDjvDEBo02 eC1QbTc+jEr0+kYwQzbAThnQqRqBv/7Z4NAbo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:content-transfer-encoding:message-id :date:to:x-mailer:cc:subject; b=qDJl67lFyilSFoyd8RIkpWCOP+Uh/1X0elsqlqeGhhKIr4lUuymObqZZZFJrSKgn0N 0Q2lSWTfOWRLF2XlJDUuRb5poFQNkHb+YVi9kEDkH+oUS7cwih1nt2J0NQI999uMvb6s hlUSfIKl6yRobdRElm9Vt5zYoX0UdG9ekqQ1M= Received: by 10.43.57.202 with SMTP id wh10mr11147889icb.96.1302673835533; Tue, 12 Apr 2011 22:50:35 -0700 (PDT) Received: from atheros-test ([182.72.177.186]) by mx.google.com with ESMTPS id y10sm185620iba.12.2011.04.12.22.50.32 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Apr 2011 22:50:34 -0700 (PDT) From: Sujith MIME-Version: 1.0 Message-ID: <19877.14907.856518.900271@gargle.gargle.HOWL> Date: Wed, 13 Apr 2011 11:22:59 +0530 To: linville@tuxdriver.com X-Mailer: VM 8.1.1 under 23.3.1 (x86_64-unknown-linux-gnu) CC: linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net Subject: [PATCH 04/40] ath9k_htc: Fix WMI and beacon header Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Apr 2011 05:50:37 +0000 (UTC) From: Sujith Manoharan Match the beacon header with that of the firmware. Also, the firmware reports the TSF for an SWBA, so store it. Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/htc.h | 2 +- drivers/net/wireless/ath/ath9k/wmi.c | 7 ++++++- drivers/net/wireless/ath/ath9k/wmi.h | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 9544cd7..cf7909e 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -96,8 +96,8 @@ struct tx_mgmt_hdr { } __packed; struct tx_beacon_header { - u8 len_changed; u8 vif_index; + u8 len_changed; u16 rev; } __packed; diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c index 267a98f..96171a2 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.c +++ b/drivers/net/wireless/ath/ath9k/wmi.c @@ -156,6 +156,7 @@ static void ath9k_wmi_ctrl_rx(void *priv, struct sk_buff *skb, struct wmi_cmd_hdr *hdr; u16 cmd_id; void *wmi_event; + struct wmi_event_swba *swba; #ifdef CONFIG_ATH9K_HTC_DEBUGFS __be32 txrate; #endif @@ -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)); switch (cmd_id) { 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); break; case WMI_FATAL_EVENTID: diff --git a/drivers/net/wireless/ath/ath9k/wmi.h b/drivers/net/wireless/ath/ath9k/wmi.h index 6a36572..2fa91a9 100644 --- a/drivers/net/wireless/ath/ath9k/wmi.h +++ b/drivers/net/wireless/ath/ath9k/wmi.h @@ -36,6 +36,11 @@ struct wmi_fw_version { __be16 minor; } __packed; + +struct wmi_event_swba { + __be64 tsf; + u8 beacon_pending; +}; enum wmi_cmd_id { WMI_ECHO_CMDID = 0x0001, WMI_ACCESS_MEMORY_CMDID, @@ -106,6 +111,7 @@ struct wmi { u32 cmd_rsp_len; bool stopped; + u64 tsf; u8 beacon_pending; spinlock_t wmi_lock;