From patchwork Tue Jan 27 13:08:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sylvain ROGER RIEUNIER X-Patchwork-Id: 5717951 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CA7899F1D6 for ; Tue, 27 Jan 2015 13:09:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B31F320212 for ; Tue, 27 Jan 2015 13:09:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD2812020E for ; Tue, 27 Jan 2015 13:09:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YG5sv-0006c2-2f; Tue, 27 Jan 2015 13:08:49 +0000 Received: from mail-ie0-x22e.google.com ([2607:f8b0:4001:c03::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YG5ss-0006UW-IN for ath10k@lists.infradead.org; Tue, 27 Jan 2015 13:08:47 +0000 Received: by mail-ie0-f174.google.com with SMTP id vy18so14984436iec.5 for ; Tue, 27 Jan 2015 05:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IiumoPioT5AYFVhTdrny7wBK9tDmg0VUjlnnB8qD8bg=; b=y9LVzNc3dfgaqWFt8uxUb+K4Vr1iVDLXLM9ks+h0yTGF+JJTrHUEkhsCTYR7ibiKRf f2Q3EW4+TZczULiAFiDtH6eHeDIaDGAY8+UPmeRbkJmb7JCUdk7YdSxvI8bA0GKNpn5v Uqs1Y+r2sJwmWt9tM/znY1ZO1GDNfUiyMffzaxp/tJC1MRfpWDfyIpmSEwfdQFCJ9EfT tHUE9F/H43YnDXskxLFBIqYq5cQnHqqLt76RDf3Y90LlEMfLhQCKXTrPoNbNQzPiflZu m8U+fsxN8jBiLcRq0HUhjOzAxirKCGqTje09KDln7V2fmw7ftZ+myDXrbbUfbaFSa4FT f0YA== MIME-Version: 1.0 X-Received: by 10.42.250.82 with SMTP id mn18mr2290681icb.1.1422364104571; Tue, 27 Jan 2015 05:08:24 -0800 (PST) Received: by 10.36.121.129 with HTTP; Tue, 27 Jan 2015 05:08:24 -0800 (PST) Date: Tue, 27 Jan 2015 14:08:24 +0100 Message-ID: Subject: [ath10k] IBSS mode From: Sylvain ROGER RIEUNIER To: ath10k X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150127_050846_713735_00655C8D X-CRM114-Status: GOOD ( 14.52 ) X-Spam-Score: -0.8 (/) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I just made some tests with the ath10k driver in IBSS mode and I found several problems: 1) TSF management can't be done correctly. You can't make GET, SET or RESET actions, because no command is sent to the firmware. However the WMI_RTT_TSF_CMDID command exists. I tried some changes (see patch), but they did not produce any effect. 2) Rate control update is not functional in the firmware. Data rate is stuck at 25 Mbit/s between an ath10k IBSS station and an ath9k IBSS station. However the rate control update works fine in mac80211 (I checked it thanks to IBSS debug msg) and IE HT settings are correctly transmitted on both side (I checked it using a third interface in monitor mode). The ath10k_wmi_peer_assoc command does not seem to work for reassoc state to update data rate. Conclusion: the firmware seems incomplete for IBSS mode operation. Is there any planned development on the IBSS mode in the firmware? Note: I did my tests with the firmware-2.bin_999.999.0.636 firmware. Thank, Sylvain --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4467,6 +4467,13 @@ static void ath10k_sta_rc_update(struct static u64 ath10k_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { + struct ath10k *ar = hw->priv; + struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); + + mutex_lock(&ar->conf_mutex); + ath10k_wmi_get_tsf( ar, arvif->vdev_id, arvif->vif->addr); + mutex_unlock(&ar->conf_mutex); + /* * FIXME: Return 0 for time being. Need to figure out whether FW * has the API to fetch 64-bit local TSF @@ -4475,6 +4482,27 @@ static u64 ath10k_get_tsf(struct ieee802 return 0; } +static void ath10k_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u64 tsf) +{ + struct ath10k *ar = hw->priv; + struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); + + mutex_lock(&ar->conf_mutex); + ath10k_wmi_set_tsf( ar, arvif->vdev_id, arvif->vif->addr, tsf); + mutex_unlock(&ar->conf_mutex); +} + +static void ath10k_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) +{ + struct ath10k *ar = hw->priv; + struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); + + mutex_lock(&ar->conf_mutex); + ath10k_wmi_reset_tsf( ar, arvif->vdev_id, arvif->vif->addr); + mutex_unlock(&ar->conf_mutex); +} + static int ath10k_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, enum ieee80211_ampdu_mlme_action action, @@ -4535,6 +4563,8 @@ static const struct ieee80211_ops ath10k .set_bitrate_mask = ath10k_set_bitrate_mask, .sta_rc_update = ath10k_sta_rc_update, .get_tsf = ath10k_get_tsf, + .reset_tsf = ath10k_reset_tsf, + .set_tsf = ath10k_set_tsf, .ampdu_action = ath10k_ampdu_action, .get_et_sset_count = ath10k_debug_get_et_sset_count, .get_et_stats = ath10k_debug_get_et_stats, --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1322,9 +1322,17 @@ static void ath10k_wmi_event_echo(struct static int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb) { + int i; + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event debug mesg len %d\n", skb->len); + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi event data :"); + for (i = 4; i < skb->len; i++) { + ath10k_dbg(ar, ATH10K_DBG_WMI, " %x", skb->data[i]); + } + ath10k_dbg(ar, ATH10K_DBG_WMI, "\n"); + trace_ath10k_wmi_dbglog(ar, skb->data, skb->len); return 0; @@ -4417,3 +4425,64 @@ void ath10k_wmi_detach(struct ath10k *ar ar->wmi.num_mem_chunks = 0; } + +int ath10k_wmi_set_tsf(struct ath10k *ar, u32 vdev_id, const u8 *mac, u64 tsf) +{ + struct sk_buff *skb; + struct wmi_rtt_tsf_cmd *cmd; + + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); + if (!skb) + return -ENOMEM; + + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi SET TSF %Lu\n", tsf); + cmd = (struct wmi_rtt_tsf_cmd *) skb->data; + cmd->vdev_id = __cpu_to_le32(vdev_id); + cmd->cmd = WMI_TSF_FW_SET; + cmd->tsf_u32 = cpu_to_le32(tsf >> 32); + cmd->tsf_l32 = cpu_to_le32(tsf & 0xffffffff); + + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi SET TSF %u(l) %u(u)\n", + cmd->tsf_l32, cmd->tsf_u32); + + return ath10k_wmi_cmd_send(ar, skb, + ar->wmi.cmd->rtt_tsf_cmdid); +} + +int ath10k_wmi_reset_tsf(struct ath10k *ar, u32 vdev_id, const u8 *mac) +{ + struct sk_buff *skb; + struct wmi_rtt_tsf_cmd *cmd; + + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); + if (!skb) + return -ENOMEM; + + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi RESET TSF \n"); + cmd = (struct wmi_rtt_tsf_cmd *) skb->data; + cmd->vdev_id = __cpu_to_le32(vdev_id); + cmd->cmd = WMI_TSF_FW_RESET; + cmd->tsf_u32 = 0; + cmd->tsf_l32 = 0; + + return ath10k_wmi_cmd_send(ar, skb, + ar->wmi.cmd->rtt_tsf_cmdid); +} + +int ath10k_wmi_get_tsf(struct ath10k *ar, u32 vdev_id, const u8 *mac) +{ + struct sk_buff *skb; + struct wmi_rtt_measreq_cmd *cmd; + + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); + if (!skb) + return -ENOMEM; + + ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi GET TSF\n"); + cmd = (struct wmi_rtt_measreq_cmd *) skb->data; + cmd->vdev_id = __cpu_to_le32(vdev_id); + cmd->cmd = WMI_RTT_FW_TSF; + + return ath10k_wmi_cmd_send(ar, skb, + ar->wmi.cmd->rtt_measreq_cmdid); +} --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -4547,6 +4547,32 @@ struct wmi_dbglog_cfg_cmd { __le32 config_valid; } __packed; + +enum wmi_rtt_fw_cmd { + WMI_RTT_FW_RTT = 1, + WMI_RTT_FW_TSF = 2, +}; + +struct wmi_rtt_measreq_cmd { + __le32 vdev_id; + __le32 cmd; +// struct wmi_mac_addr macaddr; +} __packed; + +enum wmi_tsf_fw_cmd { + WMI_TSF_FW_RESET = 1, + WMI_TSF_FW_SET = 2, + WMI_TSF_FW_GET = 3, +}; + +struct wmi_rtt_tsf_cmd { + __le32 vdev_id; + __le32 cmd; + __le32 tsf_l32; + __le32 tsf_u32; +} __packed; + + #define ATH10K_RTS_MAX 2347 #define ATH10K_FRAGMT_THRESHOLD_MIN 540 #define ATH10K_FRAGMT_THRESHOLD_MAX 2346 @@ -4653,5 +4679,8 @@ int ath10k_wmi_pull_fw_stats(struct ath1 struct ath10k_fw_stats *stats); int ath10k_wmi_pdev_pktlog_enable(struct ath10k *ar, u32 ev_list); int ath10k_wmi_pdev_pktlog_disable(struct ath10k *ar); +int ath10k_wmi_set_tsf(struct ath10k *ar, u32 vdev_id, const u8 *mac, u64 tsf); +int ath10k_wmi_reset_tsf(struct ath10k *ar, u32 vdev_id, const u8 *mac); +int ath10k_wmi_get_tsf(struct ath10k *ar, u32 vdev_id, const u8 *mac); #endif /* _WMI_H_ */