From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D0EFC742A2 for ; Fri, 12 Jul 2019 01:58:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C35321019 for ; Fri, 12 Jul 2019 01:58:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="lSg9LojB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729036AbfGLB6o (ORCPT ); Thu, 11 Jul 2019 21:58:44 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:22911 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728849AbfGLB6o (ORCPT ); Thu, 11 Jul 2019 21:58:44 -0400 Received-SPF: Pass (esa3.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa3.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa3.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dkim=pass (signature verified) header.i=@microchiptechnology.onmicrosoft.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: bt9qqDB18ueIx7E6useBaiu/8PbKjNPUcYy+ygXkp/K0TR0zHscETfXUwmyZatxEPRwZwBbLpr dDFFEimpM3X/USFCKeXXRgNTErSQg8UO+lByYkI6YfZL+K4KVYO6FPcQo3iA4xF2sHM9v4/OpL /kJXIPKnz73FMQO5W7Lu7tz2pA0YL+yRrHC//nklKcsTMICkPPd6lonbS9iRczFDBT9Jb91HKd 1sx7xMOJDsgmQPIys48S1x6fTi3wWHTm2UOyRRQeMaPO9QmbdMyELSLGFxU7zm/pbN5xemm7om Xf8= X-IronPort-AV: E=Sophos;i="5.63,480,1557212400"; d="scan'208";a="41020047" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Jul 2019 18:58:43 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex01.mchp-main.com (10.10.87.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 11 Jul 2019 18:58:42 -0700 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 11 Jul 2019 18:58:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+SJJdlC1G7nvmHy3eedL74Lueu09OkhpU3EsYP/G8mqAJ1wULcZmPuj1qVASVctYXgrxJwDhlGE+2GcPLaqKl8LavsYpLt+Fj9uAQC3iaOLdMsJJDK3czNjQHtaQeJ0Vo43HOjQaoVwBoBhjzV7MzlBjgVm5iwlKKRKmuV9q/qpzHgC5xpk5TxC4lQcwF8itCkXb85+JAJ4W/Z+8Ah7IowteIaNZSthgrwXWTZR+8DTTP5JWj2jd/BsUmZpf18GIO7sKNy+1rOFFfTInyharGQnGVEIRqFaTt2DCRURdOfhkCPOcK+QEh1aIANXWQAtcs7DmkjU2Pyd3h5lNqdEDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9fIrkTLA1NyRY0YZ4v84AwTYmfshdK9owe1halvycug=; b=RXnzF/DFVG54xyajSUMJdC0U8161sWLPTFtzZNDUcZnXgpQIoEHnRrDf0sWmlnzlhhlDTQLz24UVEP/5UPPFS7wVbU4KpizvAEj2cnjCN/e5jaUsEcQPwlCIDmJl0KGk7WBL+vK7x7KESMmnDQpJfc7bFYh/bPnvgsfAf6JtQzQ1vRHIgwqBgKXoM6JTDG0/yAc/CrcZWbzOQFg0XJGPOl889Rjel57AAK/dfHcxzd2TCJtZAOoXV6Bcx3abKayWPOcH8RSlz3JpW+ZkJZAnfzEIzMMufCRjufqLIP38dIbbeYvbCX8YfqtmnnWVevI9fRd5/ig9Y2lk4o9QfAunOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=microchip.com;dmarc=pass action=none header.from=microchip.com;dkim=pass header.d=microchip.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9fIrkTLA1NyRY0YZ4v84AwTYmfshdK9owe1halvycug=; b=lSg9LojBKaYWvmyRRu8Q/pghAya75LUQq1INxkS8IAavXGvAhGyspHrt71UIDyy4U5pMYla7K2OhhHeYVpJN0GQZbO/51/cVrdLFl899bmTKwbXsncXbGPpfRiUnBcRPK1Mu1Lu6AqTUqnlH32nPkT+lhMEJzcPfbfufSeyUng0= Received: from BN6PR11MB3985.namprd11.prod.outlook.com (10.255.129.78) by BN6PR11MB4179.namprd11.prod.outlook.com (10.255.128.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.10; Fri, 12 Jul 2019 01:58:39 +0000 Received: from BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::54db:507:e9da:5086]) by BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::54db:507:e9da:5086%6]) with mapi id 15.20.2052.020; Fri, 12 Jul 2019 01:58:39 +0000 From: To: CC: , , , , , , , Subject: [PATCH v2 01/16] wilc1000: add wilc_hif.h Thread-Topic: [PATCH v2 01/16] wilc1000: add wilc_hif.h Thread-Index: AQHVOFVSvFylpvJTGEe21rymW5xTlQ== Date: Fri, 12 Jul 2019 01:58:38 +0000 Message-ID: <1562896697-8002-2-git-send-email-ajay.kathat@microchip.com> References: <1562896697-8002-1-git-send-email-ajay.kathat@microchip.com> In-Reply-To: <1562896697-8002-1-git-send-email-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BM1PR0101CA0026.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::12) To BN6PR11MB3985.namprd11.prod.outlook.com (2603:10b6:405:7b::14) x-mailer: git-send-email 2.7.4 x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [49.205.218.233] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4c1716a4-108d-4635-beb4-08d7066c7501 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:BN6PR11MB4179; x-ms-traffictypediagnostic: BN6PR11MB4179: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:127; x-forefront-prvs: 00963989E5 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(366004)(376002)(39860400002)(189003)(199004)(486006)(71190400001)(71200400001)(54906003)(102836004)(86362001)(316002)(36756003)(305945005)(6506007)(6916009)(99286004)(2616005)(478600001)(2351001)(476003)(446003)(11346002)(78486014)(7736002)(68736007)(386003)(3846002)(66446008)(66476007)(8676002)(52116002)(8936002)(4326008)(66556008)(26005)(5660300002)(2906002)(50226002)(14454004)(66946007)(6116002)(6486002)(6436002)(81166006)(186003)(6512007)(81156014)(66066001)(53936002)(256004)(25786009)(14444005)(107886003)(76176011)(5640700003)(2501003)(64756008);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB4179;H:BN6PR11MB3985.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Ow+h7F0mxQtiA3LNwT3AyPrKrnoqbvFfsnjbtidgzC3U1oECag9P67GExr6BNMKHZhWj7lfw2azRftRjHvq+j1WUbPrs5UmP0EURkqsFf2UYzbPuC2msxZa5eaBbhvlp7BmstT0q8WkRG8CNVQxUndgXhV10Q2ysbajCZPqv5ECBjlPq7Y7W8VIVAQBhK7TLM+d3FFzAPfD6rDzccoPUPZnj9OLkjr11gFHbP0dulCkHmVciCO1RQYFOLq+gb6RN4UN5SFafEkszVgawOh0a9BuYPuw6a+hpU0AjO4himWk/h6UH9pyxmufuzF3b71QXSxsF/a00ySO1va5DfMs0U/31XPCE9ufRFACGw/puMqxg4WltBQPhzH8ubyh0eFPek96uNL6tvaZFGJRJoXyQ1w+LtGfuNKIvU3Y7+4TKPqI= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4c1716a4-108d-4635-beb4-08d7066c7501 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jul 2019 01:58:38.9745 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ajay.kathat@microchip.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB4179 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Moved '/driver/staging/wilc1000/wilc_hif.h' to '/driver/net/wireless/mirochip/wilc1000/wilc_hif.h'. Signed-off-by: Ajay Singh --- drivers/net/wireless/microchip/wilc1000/wilc_hif.h | 235 +++++++++++++++++= ++++ 1 file changed, 235 insertions(+) create mode 100644 drivers/net/wireless/microchip/wilc1000/wilc_hif.h diff --git a/drivers/net/wireless/microchip/wilc1000/wilc_hif.h b/drivers/n= et/wireless/microchip/wilc1000/wilc_hif.h new file mode 100644 index 0000000..be1d249 --- /dev/null +++ b/drivers/net/wireless/microchip/wilc1000/wilc_hif.h @@ -0,0 +1,235 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiari= es + * All rights reserved. + */ + +#ifndef HOST_INT_H +#define HOST_INT_H +#include +#include "wilc_wlan_if.h" + +enum { + WILC_IDLE_MODE =3D 0x0, + WILC_AP_MODE =3D 0x1, + WILC_STATION_MODE =3D 0x2, + WILC_GO_MODE =3D 0x3, + WILC_CLIENT_MODE =3D 0x4 +}; + +#define WILC_MAX_NUM_STA 9 +#define WILC_MAX_NUM_SCANNED_CH 14 +#define WILC_MAX_NUM_PROBED_SSID 10 + +#define WILC_TX_MIC_KEY_LEN 8 +#define WILC_RX_MIC_KEY_LEN 8 + +#define WILC_MAX_NUM_PMKIDS 16 +#define WILC_ADD_STA_LENGTH 40 +#define WILC_NUM_CONCURRENT_IFC 2 + +enum { + WILC_SET_CFG =3D 0, + WILC_GET_CFG +}; + +#define WILC_MAX_ASSOC_RESP_FRAME_SIZE 256 + +struct assoc_resp { + __le16 capab_info; + __le16 status_code; + __le16 aid; +} __packed; + +struct rf_info { + u8 link_speed; + s8 rssi; + u32 tx_cnt; + u32 rx_cnt; + u32 tx_fail_cnt; +}; + +enum host_if_state { + HOST_IF_IDLE =3D 0, + HOST_IF_SCANNING =3D 1, + HOST_IF_CONNECTING =3D 2, + HOST_IF_WAITING_CONN_RESP =3D 3, + HOST_IF_CONNECTED =3D 4, + HOST_IF_P2P_LISTEN =3D 5, + HOST_IF_FORCE_32BIT =3D 0xFFFFFFFF +}; + +struct wilc_pmkid { + u8 bssid[ETH_ALEN]; + u8 pmkid[WLAN_PMKID_LEN]; +} __packed; + +struct wilc_pmkid_attr { + u8 numpmkid; + struct wilc_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; +} __packed; + +struct cfg_param_attr { + u32 flag; + u16 short_retry_limit; + u16 long_retry_limit; + u16 frag_threshold; + u16 rts_threshold; +}; + +enum cfg_param { + WILC_CFG_PARAM_RETRY_SHORT =3D BIT(0), + WILC_CFG_PARAM_RETRY_LONG =3D BIT(1), + WILC_CFG_PARAM_FRAG_THRESHOLD =3D BIT(2), + WILC_CFG_PARAM_RTS_THRESHOLD =3D BIT(3) +}; + +enum scan_event { + SCAN_EVENT_NETWORK_FOUND =3D 0, + SCAN_EVENT_DONE =3D 1, + SCAN_EVENT_ABORTED =3D 2, + SCAN_EVENT_FORCE_32BIT =3D 0xFFFFFFFF +}; + +enum conn_event { + CONN_DISCONN_EVENT_CONN_RESP =3D 0, + CONN_DISCONN_EVENT_DISCONN_NOTIF =3D 1, + CONN_DISCONN_EVENT_FORCE_32BIT =3D 0xFFFFFFFF +}; + +enum { + WILC_HIF_SDIO =3D 0, + WILC_HIF_SPI =3D BIT(0) +}; + +enum { + WILC_MAC_STATUS_INIT =3D -1, + WILC_MAC_STATUS_DISCONNECTED =3D 0, + WILC_MAC_STATUS_CONNECTED =3D 1 +}; + +struct wilc_rcvd_net_info { + s8 rssi; + u8 ch; + u16 frame_len; + struct ieee80211_mgmt *mgmt; +}; + +struct wilc_user_scan_req { + void (*scan_result)(enum scan_event evt, + struct wilc_rcvd_net_info *info, void *priv); + void *arg; + u32 ch_cnt; +}; + +struct wilc_conn_info { + u8 bssid[ETH_ALEN]; + u8 security; + enum authtype auth_type; + u8 ch; + u8 *req_ies; + size_t req_ies_len; + u8 *resp_ies; + u16 resp_ies_len; + u16 status; + void (*conn_result)(enum conn_event evt, u8 status, void *priv_data); + void *arg; + void *param; +}; + +struct wilc_remain_ch { + u16 ch; + u32 duration; + void (*expired)(void *priv, u64 cookie); + void *arg; + u32 cookie; +}; + +struct wilc; +struct host_if_drv { + struct wilc_user_scan_req usr_scan_req; + struct wilc_conn_info conn_info; + struct wilc_remain_ch remain_on_ch; + u64 p2p_timeout; + + enum host_if_state hif_state; + + u8 assoc_bssid[ETH_ALEN]; + + struct timer_list scan_timer; + struct wilc_vif *scan_timer_vif; + + struct timer_list connect_timer; + struct wilc_vif *connect_timer_vif; + + struct timer_list remain_on_ch_timer; + struct wilc_vif *remain_on_ch_timer_vif; + + bool ifc_up; + u8 assoc_resp[WILC_MAX_ASSOC_RESP_FRAME_SIZE]; +}; + +struct wilc_vif; +int wilc_remove_wep_key(struct wilc_vif *vif, u8 index); +int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index); +int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len, + u8 index); +int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len, + u8 index, u8 mode, enum authtype auth_type); +int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, + const u8 *mac_addr, const u8 *rx_mic, const u8 *tx_mic, + u8 mode, u8 cipher_mode, u8 index); +s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, + u32 *out_val); +int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len= , + u8 index, u32 key_rsc_len, const u8 *key_rsc, + const u8 *rx_mic, const u8 *tx_mic, u8 mode, + u8 cipher_mode); +int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmki= d); +int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); +int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies, + size_t ies_len); +int wilc_disconnect(struct wilc_vif *vif); +int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); +int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level); +int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type, + u8 *ch_freq_list, u8 ch_list_len, + void (*scan_result_fn)(enum scan_event, + struct wilc_rcvd_net_info *, void *), + void *user_arg, struct cfg80211_scan_request *request); +int wilc_hif_set_cfg(struct wilc_vif *vif, + struct cfg_param_attr *cfg_param); +int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler= ); +int wilc_deinit(struct wilc_vif *vif); +int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, + struct cfg80211_beacon_data *params); +int wilc_del_beacon(struct wilc_vif *vif); +int wilc_add_station(struct wilc_vif *vif, const u8 *mac, + struct station_parameters *params); +int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]); +int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr); +int wilc_edit_station(struct wilc_vif *vif, const u8 *mac, + struct station_parameters *params); +int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout); +int wilc_setup_multicast_filter(struct wilc_vif *vif, u32 enabled, u32 cou= nt, + u8 *mc_list); +int wilc_remain_on_channel(struct wilc_vif *vif, u64 cookie, + u32 duration, u16 chan, + void (*expired)(void *, u64), + void *user_arg); +int wilc_listen_state_expired(struct wilc_vif *vif, u64 cookie); +void wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg); +int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, + u8 ifc_id); +int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode); +int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats); +void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); +int wilc_get_vif_idx(struct wilc_vif *vif); +int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power); +int wilc_get_tx_power(struct wilc_vif *vif, u8 *tx_power); +void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length= ); +void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length)= ; +void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 leng= th); +void *wilc_parse_join_bss_param(struct cfg80211_bss *bss, + struct cfg80211_crypto_settings *crypto); +#endif --=20 2.7.4