From patchwork Tue Oct 31 01:04:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mitsyanko X-Patchwork-Id: 10033513 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 30DCC60291 for ; Tue, 31 Oct 2017 01:05:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2304E286FB for ; Tue, 31 Oct 2017 01:05:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1805528961; Tue, 31 Oct 2017 01:05:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D302286FB for ; Tue, 31 Oct 2017 01:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107AbdJaBFP (ORCPT ); Mon, 30 Oct 2017 21:05:15 -0400 Received: from mail-by2nam03on0048.outbound.protection.outlook.com ([104.47.42.48]:45504 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752898AbdJaBFI (ORCPT ); Mon, 30 Oct 2017 21:05:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=B4WIWDPHU27ceKEAGUfqAY7RYvK9UyCStUAyO0+kY28=; b=hXbkCJIdbIWXIWY22uHSQO7+Thwfri74oaYmBeZhKWiTy8wBLCMhPV70dXYx33UVofyVnDrBqDR10g+L7YoJfdVC+mu6PAcstIgYwFKXz9x5oe5AgBo75TqHaZTFZ6x0Uuh0u0wCT0q8cp6NenMHb5CZXPIPOmXfvOfuG+jYaG0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=igor.mitsyanko.os@quantenna.com; Received: from dodo-dell.quantenna.com (12.131.200.68) by BLUPR0501MB2036.namprd05.prod.outlook.com (10.164.23.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.4; Tue, 31 Oct 2017 01:05:05 +0000 From: igor.mitsyanko.os@quantenna.com To: linux-wireless@vger.kernel.org Cc: sergey.matyukevich.os@quantenna.com, vulyanov@quantenna.com, johannes@sipsolutions.net Subject: [PATCH V2 5/9] qtnfmac: SCAN results: retreive frame type information from "IE set" TLV Date: Mon, 30 Oct 2017 18:04:51 -0700 Message-Id: <20171031010455.27772-6-igor.mitsyanko.os@quantenna.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171031010455.27772-1-igor.mitsyanko.os@quantenna.com> References: <20171031010455.27772-1-igor.mitsyanko.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [12.131.200.68] X-ClientProxiedBy: MWHPR19CA0008.namprd19.prod.outlook.com (10.173.246.146) To BLUPR0501MB2036.namprd05.prod.outlook.com (10.164.23.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c8e9283-ad73-48da-539c-08d51ffb6c7f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:BLUPR0501MB2036; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2036; 3:VGetPN4FVtAZpUUPRgU7ZokG7uRel4yp5ut6nzGAo+H+MC4qXlDhlix7EmZE4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IkZ22NRNcHdtq6Zi06v3+ROYyIfYhvkL7YjnwN+xklzD6GUy15XtA1wmkxhaUm2oLgUtiV0XLvVJEwa+RCK8H2fXC9x98wPhqCKQ+88Ee7O8avdqTOzHQpOqjVUGG94AD20S7u5H7CnceLRsbeJwT9MUoQ80gNKrdAsuQT1RxlKWvzmVF3xOeFVYThLHuniX/AlTeooIQCKn0A15a5EIK8fk1z2MSw2pA++IbwzHP9Q1TgO79p5Yj7lZ+yo9nNRMkH6G59bV61ESSkBm1AM08EFZnMnaInixbgHhFd0VGqC0739AW9w6r5bEnOakADR3Kk2DHx9PZ+quAJMp0OEUyPWOxpZ9fs7M50v99dR0T4she/c3v7/+L1EQmbKar8ul3m+1Ignn8rQvEhA=; 4:sGVpvNa9KgzwqMuypmrDKDbd3b1MsW0UrJ9yugTKYKujiQeElKQNPbttoJZQfwQT9LMn4SsLKRv2hYzHF5hhdHOaYbc0U0LMXbB4ZIulKbEDN0Puvobx5uq6BGUGYgw5gWpRRktb9DtQWp8cwgLmuaSV/prImPsbyMGlqBaXeLCJHEa5i0cm3vWA0dYZYTrD9zN9nNXrqv+2XHc65mzWVY/hUfT5sa7LA19P8t+AibU6X9TZSo4yuOQ6Hl3GEe98HjtxXp/b1aLb4pseHN+o+w== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(3231020)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0501MB2036; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0501MB2036; X-Forefront-PRVS: 04772EA191 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39830400002)(346002)(199003)(189002)(9686003)(5660300001)(6916009)(6666003)(2950100002)(478600001)(25786009)(53936002)(36756003)(6486002)(33646002)(85782001)(50466002)(103116003)(48376002)(4326008)(81166006)(81156014)(8936002)(305945005)(7736002)(97736004)(68736007)(50986999)(76176999)(101416001)(6116002)(50226002)(8676002)(2906002)(2361001)(53416004)(3846002)(86362001)(189998001)(1076002)(16586007)(316002)(2351001)(105586002)(106356001)(66066001)(47776003)(16526018)(5003940100001)(69596002)(85772001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0501MB2036; H:dodo-dell.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0501MB2036; 23:LQJUpS6ThoE4KkPETF2q8MSzN1EaaRzuzyv1mWb?= =?us-ascii?Q?69HZpxyZaLUBydtfmKBgPYApEVSSxXRqPvq95GH4QSVTLAihH3khcHJPqJeb?= =?us-ascii?Q?r6v/9AHKBiWXH//eBMAJfN9xK4RjG2IT4aWUQ88NcM2oz0kvmUFPmwIzXPWG?= =?us-ascii?Q?0NLT7Mb3QtVjPawJzs+jm6CgUJd+zlsbfEfl5cASIKbu31t5IVVJMVSgkMkp?= =?us-ascii?Q?5YrsWSAno2m1fbcokMzjQdMdfjv5csMSfsptAO6Zxf2+IaCRd9haqdzpvOHJ?= =?us-ascii?Q?15RIrx3i7MQHq2W4p0nsQZrSx+ViZ9Vwm25xGKB+1AkVOznPFS6tnS57YXlS?= =?us-ascii?Q?Ty2kNWFZ/6IgSqcTARoMk3gfKeaxidruCPjObj5gz9oODwvdRaB4kCM8iein?= =?us-ascii?Q?5MCX9nqVfkERdblU/qaHyVaa/Yqp4c2dF1s4jxPN1ORSz/ZjvdorWXVk1Dua?= =?us-ascii?Q?tvzRZRVstOWi0Ggr0YMiQRIxsBNo9gycj308p+My7bSrwCvdf1GyUZi5boUJ?= =?us-ascii?Q?FNJKfBtxMZrQWhoTQFmHUtNohrhwBaC10DHOaQxkKwBwhegW2DsxpULAB9hF?= =?us-ascii?Q?w6TzfIDcAHy0zZNVBVwkMdy2VTXzpZR1Zot5d2CbBfth9WALqelyg9UABBN+?= =?us-ascii?Q?yu3Lj03RyTlzpkisZIpscdXVJUV4K0S/TWQUARJAp42ZPMtTHOvq6skQX7/R?= =?us-ascii?Q?/LQ/SOWopGWfBjxqOrb0kn+duT1tXEw2rDo7bDzDWhCFs74Jz2boNGFf1FWA?= =?us-ascii?Q?FPJYE+J0F/q/ixEwT/0y/9OOkrEPxnoG2gO6FxCyCOwuld/i0wJ1APtVj6cY?= =?us-ascii?Q?o4BgFAfIT1OQLAhfYlaQhFiiTeQFxF/mNqRIgXYu5jUnWNUeeF5kiUrLzBPG?= =?us-ascii?Q?7xgusBzfcLwLnueOMuI4DFy2FiLB/+dJQuX/dtWUX9qZdQqdPiEV33XI3sFm?= =?us-ascii?Q?nnwpZKmVkUJacsKKcnP4REcls5GnWvu+uHDImpEKo1WO5wRlQA9BZJr/FomM?= =?us-ascii?Q?NAIDgqV6xTdLnwYTXSgIy5zynZVUZe81UJTlephoP4NaViRFkfU5YnWnLkhC?= =?us-ascii?Q?BEjtPOwEgX6JRB3a7ARrx99C6IFb6Xd4fDy/igfh//B9UauvjwX/ekA1RXCS?= =?us-ascii?Q?R881imGb9/sRxQzcw8Pdepbs8Uvisj9OJzA7VUj85ek18yQl7yJB7VARchzf?= =?us-ascii?Q?okt6ZQ8DJa3jw+pJnLgEZ+aPKwaLc5BfaXDXEw6FZgwMUckKY2QUmxAT3mA?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB2036; 6:uqLYFm7ypY+Vei307pwTvbim4iWpuMMVeIaGU2XMSy+LY5tw1L8UZEXB8xyTSyIhf2mTeLRxh3HbeAeAu+MRmLMUPBIyv2IAfw58qD6apbOMWZUAFYE/WQOWmREX1+izRRH6Z5S044Jj7Jwfo4EKl1SXkeZOMXUdB6JOPEQzwUZ/iHROYan7QwQbV7ytW6hszU+7oUHui6/zGlx4/rogWpxoLhBeOluOEoqKSgXi4+pxbRLbD6jvBRf9kMxSA/MRv9PkXtwFekjfdevWht+nVw+ldjQH0P7WPTzIdNjQ9LBtYvvFhlTgbWI4NlVsb4ywLmUlysuaNdzE6Sj52XIf90WeBGFsvG1PEIB3YHZ5280=; 5:QDAiSb1wYGlnWzfJxcC259arDTU82EO57uLmSOGp0/csnUouokjgIxYwgq6831g88YdXvngLQ1evE/+L68xQhI0WJ/tOPM9h+W0nyX9KOkxb8l1vChz/0UEJFA5WkDwGEId4qwRmuif3A/5+Aodiipg40NMj51uVi2jHIj3AlGo=; 24:P74erGsqt4gLTZ1BeuU/7kkY1mJL8z/+mJ1PqzH+OzEyfEdDqpLBbHVWE2j5lhO2JCz5Ettaeu2o1yIz/2mVMKYKp20sSk7rtR5WKdxwml4=; 7:RaDilYdXmk5MadFCKY95Qme4aWdU2WNSDfB3DGnsBT4EtU/EYc6opF1inx92N4NYURSSdej3Yl96MieCbrhLVbfzZhkJyqdTVoAvCGKmMs/oZtAfeIyForgDWzyIBG+6YgPvUe2Q9vKjKNYdL8xRQqeZw4rFWC8x54PfbCtg76WM1o8hEOEP61ZB7w+mAqcRj5ByfnD9/KIXQxBoFl/UDnj5/PMS2SBzr+QHypALsm9LwW2PZ9w9M1lpr0ZLl9gz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2017 01:05:05.3922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c8e9283-ad73-48da-539c-08d51ffb6c7f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0501MB2036 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mitsyanko "IE set" TLV carries the same information as qlink_event_scan_result::frame_type. Convert the event to make use of TLV and drop frame_type member. While at it, make qlink_event_scan_result structure alignement-safe. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/event.c | 25 ++++++++++++------------- drivers/net/wireless/quantenna/qtnfmac/qlink.h | 11 ++--------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index b67a082..4abc6d9 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -252,13 +252,12 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, struct cfg80211_bss *bss; struct ieee80211_channel *channel; struct wiphy *wiphy = priv_to_wiphy(vif->mac); - enum cfg80211_bss_frame_type frame_type; + enum cfg80211_bss_frame_type frame_type = CFG80211_BSS_FTYPE_UNKNOWN; size_t payload_len; u16 tlv_type; u16 tlv_value_len; size_t tlv_full_len; const struct qlink_tlv_hdr *tlv; - const u8 *ies = NULL; size_t ies_len = 0; @@ -275,17 +274,6 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, return -EINVAL; } - switch (sr->frame_type) { - case QLINK_BSS_FTYPE_BEACON: - frame_type = CFG80211_BSS_FTYPE_BEACON; - break; - case QLINK_BSS_FTYPE_PRESP: - frame_type = CFG80211_BSS_FTYPE_PRESP; - break; - default: - frame_type = CFG80211_BSS_FTYPE_UNKNOWN; - } - payload_len = len - sizeof(*sr); tlv = (struct qlink_tlv_hdr *)sr->payload; @@ -308,6 +296,17 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif, ie_len = tlv_value_len - (sizeof(*ie_set) - sizeof(ie_set->hdr)); + switch (ie_set->type) { + case QLINK_IE_SET_BEACON_IES: + frame_type = CFG80211_BSS_FTYPE_BEACON; + break; + case QLINK_IE_SET_PROBE_RESP_IES: + frame_type = CFG80211_BSS_FTYPE_PRESP; + break; + default: + frame_type = CFG80211_BSS_FTYPE_UNKNOWN; + } + if (ie_len) { ies = ie_set->ie_data; ies_len = ie_len; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index f491942..81effd2 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -881,12 +881,6 @@ struct qlink_event_rxmgmt { u8 frame_data[0]; } __packed; -enum qlink_frame_type { - QLINK_BSS_FTYPE_UNKNOWN, - QLINK_BSS_FTYPE_BEACON, - QLINK_BSS_FTYPE_PRESP, -}; - /** * struct qlink_event_scan_result - data for QLINK_EVENT_SCAN_RESULTS event * @@ -896,7 +890,6 @@ enum qlink_frame_type { * @capab: capabilities field. * @bintval: beacon interval announced by discovered BSS. * @signal: signal strength. - * @frame_type: frame type used to get scan result, see &enum qlink_frame_type. * @bssid: BSSID announced by discovered BSS. * @ssid_len: length of SSID announced by BSS. * @ssid: SSID announced by discovered BSS. @@ -909,10 +902,10 @@ struct qlink_event_scan_result { __le16 capab; __le16 bintval; s8 signal; - u8 frame_type; - u8 bssid[ETH_ALEN]; u8 ssid_len; u8 ssid[IEEE80211_MAX_SSID_LEN]; + u8 bssid[ETH_ALEN]; + u8 rsvd[2]; u8 payload[0]; } __packed;