From patchwork Wed Sep 25 09:38:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Markowski X-Patchwork-Id: 2941181 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 C790FBFF05 for ; Wed, 25 Sep 2013 09:38:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E8082057E for ; Wed, 25 Sep 2013 09:38:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA09420580 for ; Wed, 25 Sep 2013 09:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754735Ab3IYJim (ORCPT ); Wed, 25 Sep 2013 05:38:42 -0400 Received: from ebb05.tieto.com ([131.207.168.36]:55912 "EHLO ebb05.tieto.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267Ab3IYJid (ORCPT ); Wed, 25 Sep 2013 05:38:33 -0400 X-AuditID: 83cfa824-b7f348e000004c45-10-5242af1570e5 Received: from FIVLA-EXHUB02.eu.tieto.com ( [131.207.136.42]) by ebb05.tieto.com (SMTP Mailer) with SMTP id 46.A6.19525.51FA2425; Wed, 25 Sep 2013 12:38:29 +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; Wed, 25 Sep 2013 12:38:28 +0300 From: Bartosz Markowski To: CC: , Bartosz Markowski Subject: [PATCH 13/13] ath10k: handle FW API differences for scan structures Date: Wed, 25 Sep 2013 11:38:11 +0200 Message-ID: <1380101891-18312-14-git-send-email-bartosz.markowski@tieto.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1380101891-18312-1-git-send-email-bartosz.markowski@tieto.com> References: <1380101891-18312-1-git-send-email-bartosz.markowski@tieto.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBIsWRmVeSWpSXmKPExsXSfL5DS1d0vVOQwemLQhaPLh1jtngy+TuL xZsVd9gdmD0+z7zL5rF5Sb3H501yAcxRXDYpqTmZZalF+nYJXBnvVx1jKbikWvG8h6uBsVuu i5GDQ0LARGLNJ/4uRk4gU0ziwr31bF2MXBxCAqsYJd59+8EI4SxjlHi49y4LSBWbgKnE/Q0r WEFsEQEFiV+TPrKB2MwC4RKvtv4CqxEW8JFY8foUmM0ioCqx+SVEDS9QfGvnfGaIbfIST+/3 gcU5geJH971mB7GFBLwlmqZfZ4WoF5Q4OfMJC8R8CYmDL14wQ9RoSMzZ+ZJlAqPALCRls5CU LWBkWsXIn5qUZGCqV5KZWpKvl5yfu4kRHIArVHYwnn0gdYhRgINRiYf3xULHICHWxLLiytxD jJIcTEqivHfWOgUJ8SXlp1RmJBZnxBeV5qQWH2KU4GBWEuENXwyU401JrKxKLcqHSUlzsCiJ 827sAJokkJ5YkpqdmlqQWgSTleHgUJLgfQYyVLAoNT21Ii0zpwQhzcTBCTKcB2j4B5Aa3uKC xNzizHSI/ClGRSlx3rcgCQGQREZpHlwvLEG8YhQHekWYl20dUBUPMLnAdb8CGswENNihA2xw SSJCSqqBkWfpy2ev5dWEWjg/9639w8+it+Dlgx3F3Wmc11VTQoqb1jlH8jeETmeZ5VvQ5VDG ylwYn7szu2vDup2V+1KnKLCs9WfbpxT7+WF2xWkfpmU/7F/3Nx10X/3p2O0dvk3G1w8p3now a43ER+4nDRnuO//8nag33/KrSun/j37X9sanRH+qybjuocRSnJFoqMVcVJwIABG67vHrAgAA Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.9 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 2a55bc8..d4ba78546 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -2377,11 +2377,15 @@ out: return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->wmi_init_cmdid); } -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_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) @@ -2441,7 +2445,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 */ @@ -2473,7 +2477,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_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 fcada27..75b9978 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;