From patchwork Thu Sep 26 09:29:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 2947321 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EA876BFF05 for ; Thu, 26 Sep 2013 09:30:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6D0620322 for ; Thu, 26 Sep 2013 09:30:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21F5D20333 for ; Thu, 26 Sep 2013 09:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756259Ab3IZJaW (ORCPT ); Thu, 26 Sep 2013 05:30:22 -0400 Received: from ebb05.tieto.com ([131.207.168.36]:63675 "EHLO ebb05.tieto.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756245Ab3IZJaO (ORCPT ); Thu, 26 Sep 2013 05:30:14 -0400 X-AuditID: 83cfa824-b7f348e000004c45-b4-5243fe9f03d9 Received: from FIVLA-EXHUB02.eu.tieto.com ( [131.207.136.42]) by ebb05.tieto.com (SMTP Mailer) with SMTP id 55.71.19525.F9EF3425; Thu, 26 Sep 2013 12:30:08 +0300 (EEST) Received: from uw000975.eu.tieto.com (10.28.19.100) by inbound.tieto.com (131.207.136.49) with Microsoft SMTP Server id 8.3.298.1; Thu, 26 Sep 2013 12:30:03 +0300 From: Bartosz Markowski To: CC: , Bartosz Markowski Subject: [PATCH v2 13/13] ath10k: handle FW API differences for scan structures Date: Thu, 26 Sep 2013 11:29:52 +0200 Message-ID: <1380187792-25626-14-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com> References: <1380187792-25626-1-git-send-email-bartosz.markowski@tieto.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJIsWRmVeSWpSXmKPExsXSfL5DS3fBP+cgg/dvxSweXTrGbPFk8ncW izcr7rA7MHt8nnmXzWPzknqPz5vkApijuGxSUnMyy1KL9O0SuDLufXvNUnBCtWLt551sDYwN cl2MnBwSAiYSO++tYIWwxSQu3FvP1sXIxSEksIpRYtu084wgCSGBZYwSc3+LgdhsAqYS9zdA NIgIKEj8mvSRDcRmFgiXeLX1FwuILSzgL3H+w3dmEJtFQFXi57t/YDavgI/E7YsrmCGWyUs8 vd8H1ssJFD+9/wzULm+JCR8PsEDUC0qcnPmEBWK+hMTBFy+YIWo0JObsfMkygVFgFpKyWUjK FjAyrWLkT01KMjDVK8lMLcnXS87P3cQIDsEVKjsYzz6QOsQowMGoxMO7851TkBBrYllxZe4h RkkOJiVRXu2/zkFCfEn5KZUZicUZ8UWlOanFhxglOJiVRHjXfQTK8aYkVlalFuXDpKQ5WJTE eTd2OAYJCaQnlqRmp6YWpBbBZGU4OJQkeHf+AWoULEpNT61Iy8wpQUgzcXCCDOcBGi4Aspi3 uCAxtzgzHSJ/ilFRSpy3B6RZACSRUZoH1wtLEa8YxYFeEebtBWnnAaYXuO5XQIOZgAY7dDiB DC5JREhJNTBGNgnsV2R64Sq1Ypne3Njd6R+23Dgqp2rHc4TryyHV0Nt8nF+kf3v9Ptmf8Hiu ZLFfx/+bGifOHvEUmS2mFx17sVMqLjooYloF38KONzcrX/BKsXRe6Io6ze6g75/2S4ul2q1s ScK+jZ53LJdWMj9P3O9m0uYZvuWwRI/yh1mcNqtOne/UWarEUpyRaKjFXFScCADjvb0I7AIA AA== Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The wmi_start_scan_cmd has an extra filed in our main firmware track, reflact that to not have a mismatch in case of 10.x track. Signed-off-by: Bartosz Markowski --- drivers/net/wireless/ath/ath10k/wmi.c | 19 ++++++-- drivers/net/wireless/ath/ath10k/wmi.h | 82 +++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 8c3316d..328d4eb 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -2341,11 +2341,15 @@ int ath10k_wmi_cmd_init(struct ath10k *ar) return ret; } -static int ath10k_wmi_start_scan_calc_len(const struct wmi_start_scan_arg *arg) +static int ath10k_wmi_start_scan_calc_len(struct ath10k *ar, + const struct wmi_start_scan_arg *arg) { int len; - len = sizeof(struct wmi_start_scan_cmd); + if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) + len = sizeof(struct wmi_start_scan_cmd_10x); + else + len = sizeof(struct wmi_start_scan_cmd); if (arg->ie_len) { if (!arg->ie) @@ -2405,7 +2409,7 @@ int ath10k_wmi_start_scan(struct ath10k *ar, int len = 0; int i; - len = ath10k_wmi_start_scan_calc_len(arg); + len = ath10k_wmi_start_scan_calc_len(ar, arg); if (len < 0) return len; /* len contains error code here */ @@ -2437,7 +2441,14 @@ int ath10k_wmi_start_scan(struct ath10k *ar, cmd->scan_ctrl_flags = __cpu_to_le32(arg->scan_ctrl_flags); /* TLV list starts after fields included in the struct */ - off = sizeof(*cmd); + /* There's just one filed that differes the two start_scan + * structures - burst_duration, which we are not using btw, + no point to make the split here, just shift the buffer to fit with + given FW */ + if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) + off = sizeof(struct wmi_start_scan_cmd_10x); + else + off = sizeof(struct wmi_start_scan_cmd); if (arg->n_channels) { channels = (void *)skb->data + off; diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 80ab2f0..7692c14 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -1715,6 +1715,88 @@ struct wmi_start_scan_cmd { */ } __packed; +/* This is the definition from 10.X firmware branch */ +struct wmi_start_scan_cmd_10x { + /* Scan ID */ + __le32 scan_id; + + /* Scan requestor ID */ + __le32 scan_req_id; + + /* VDEV id(interface) that is requesting scan */ + __le32 vdev_id; + + /* Scan Priority, input to scan scheduler */ + __le32 scan_priority; + + /* Scan events subscription */ + __le32 notify_scan_events; + + /* dwell time in msec on active channels */ + __le32 dwell_time_active; + + /* dwell time in msec on passive channels */ + __le32 dwell_time_passive; + + /* + * min time in msec on the BSS channel,only valid if atleast one + * VDEV is active + */ + __le32 min_rest_time; + + /* + * max rest time in msec on the BSS channel,only valid if at least + * one VDEV is active + */ + /* + * the scanner will rest on the bss channel at least min_rest_time + * after min_rest_time the scanner will start checking for tx/rx + * activity on all VDEVs. if there is no activity the scanner will + * switch to off channel. if there is activity the scanner will let + * the radio on the bss channel until max_rest_time expires.at + * max_rest_time scanner will switch to off channel irrespective of + * activity. activity is determined by the idle_time parameter. + */ + __le32 max_rest_time; + + /* + * time before sending next set of probe requests. + * The scanner keeps repeating probe requests transmission with + * period specified by repeat_probe_time. + * The number of probe requests specified depends on the ssid_list + * and bssid_list + */ + __le32 repeat_probe_time; + + /* time in msec between 2 consequetive probe requests with in a set. */ + __le32 probe_spacing_time; + + /* + * data inactivity time in msec on bss channel that will be used by + * scanner for measuring the inactivity. + */ + __le32 idle_time; + + /* maximum time in msec allowed for scan */ + __le32 max_scan_time; + + /* + * delay in msec before sending first probe request after switching + * to a channel + */ + __le32 probe_delay; + + /* Scan control flags */ + __le32 scan_ctrl_flags; + + /* + * TLV (tag length value ) paramerters follow the scan_cmd structure. + * TLV can contain channel list, bssid list, ssid list and + * ie. the TLV tags are defined above; + */ +} __packed; + + struct wmi_ssid_arg { int len; const u8 *ssid;