xref: /linux/drivers/net/wireless/microchip/wilc1000/fw.h (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
15625f965SAjay Singh /* SPDX-License-Identifier: GPL-2.0 */
25625f965SAjay Singh /*
35625f965SAjay Singh  * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
45625f965SAjay Singh  * All rights reserved.
55625f965SAjay Singh  */
65625f965SAjay Singh 
75625f965SAjay Singh #ifndef WILC_FW_H
85625f965SAjay Singh #define WILC_FW_H
95625f965SAjay Singh 
105625f965SAjay Singh #include <linux/ieee80211.h>
115625f965SAjay Singh 
125625f965SAjay Singh #define WILC_MAX_NUM_STA			9
135625f965SAjay Singh #define WILC_MAX_RATES_SUPPORTED		12
145625f965SAjay Singh #define WILC_MAX_NUM_PMKIDS			16
155625f965SAjay Singh #define WILC_MAX_NUM_SCANNED_CH			14
16*59cf9277SAlexis Lothoré #define WILC_NVMEM_MAX_NUM_BANK			6
17*59cf9277SAlexis Lothoré #define WILC_NVMEM_BANK_BASE			0x30000000
18*59cf9277SAlexis Lothoré #define WILC_NVMEM_LOW_BANK_OFFSET		0x102c
19*59cf9277SAlexis Lothoré #define WILC_NVMEM_HIGH_BANK_OFFSET		0x1380
20*59cf9277SAlexis Lothoré #define WILC_NVMEM_IS_BANK_USED			BIT(31)
21*59cf9277SAlexis Lothoré #define WILC_NVMEM_IS_BANK_INVALID		BIT(30)
225625f965SAjay Singh 
235625f965SAjay Singh struct wilc_assoc_resp {
245625f965SAjay Singh 	__le16 capab_info;
255625f965SAjay Singh 	__le16 status_code;
265625f965SAjay Singh 	__le16 aid;
275625f965SAjay Singh } __packed;
285625f965SAjay Singh 
295625f965SAjay Singh struct wilc_pmkid {
305625f965SAjay Singh 	u8 bssid[ETH_ALEN];
315625f965SAjay Singh 	u8 pmkid[WLAN_PMKID_LEN];
325625f965SAjay Singh } __packed;
335625f965SAjay Singh 
345625f965SAjay Singh struct wilc_pmkid_attr {
355625f965SAjay Singh 	u8 numpmkid;
365625f965SAjay Singh 	struct wilc_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
375625f965SAjay Singh } __packed;
385625f965SAjay Singh 
395625f965SAjay Singh struct wilc_reg_frame {
405625f965SAjay Singh 	u8 reg;
415625f965SAjay Singh 	u8 reg_id;
425625f965SAjay Singh 	__le16 frame_type;
435625f965SAjay Singh } __packed;
445625f965SAjay Singh 
455625f965SAjay Singh struct wilc_drv_handler {
465625f965SAjay Singh 	__le32 handler;
475625f965SAjay Singh 	u8 mode;
485625f965SAjay Singh } __packed;
495625f965SAjay Singh 
505625f965SAjay Singh struct wilc_sta_wpa_ptk {
515625f965SAjay Singh 	u8 mac_addr[ETH_ALEN];
525625f965SAjay Singh 	u8 key_len;
53098238e8STian Tao 	u8 key[];
545625f965SAjay Singh } __packed;
555625f965SAjay Singh 
565625f965SAjay Singh struct wilc_ap_wpa_ptk {
575625f965SAjay Singh 	u8 mac_addr[ETH_ALEN];
585625f965SAjay Singh 	u8 index;
595625f965SAjay Singh 	u8 key_len;
60098238e8STian Tao 	u8 key[];
615625f965SAjay Singh } __packed;
625625f965SAjay Singh 
630e703de3SAjay Singh struct wilc_wpa_igtk {
640e703de3SAjay Singh 	u8 index;
650e703de3SAjay Singh 	u8 pn_len;
660e703de3SAjay Singh 	u8 pn[6];
670e703de3SAjay Singh 	u8 key_len;
680e703de3SAjay Singh 	u8 key[];
690e703de3SAjay Singh } __packed;
700e703de3SAjay Singh 
715625f965SAjay Singh struct wilc_gtk_key {
725625f965SAjay Singh 	u8 mac_addr[ETH_ALEN];
735625f965SAjay Singh 	u8 rsc[8];
745625f965SAjay Singh 	u8 index;
755625f965SAjay Singh 	u8 key_len;
76098238e8STian Tao 	u8 key[];
775625f965SAjay Singh } __packed;
785625f965SAjay Singh 
795625f965SAjay Singh struct wilc_op_mode {
805625f965SAjay Singh 	__le32 mode;
815625f965SAjay Singh } __packed;
825625f965SAjay Singh 
835625f965SAjay Singh struct wilc_noa_opp_enable {
845625f965SAjay Singh 	u8 ct_window;
855625f965SAjay Singh 	u8 cnt;
865625f965SAjay Singh 	__le32 duration;
875625f965SAjay Singh 	__le32 interval;
885625f965SAjay Singh 	__le32 start_time;
895625f965SAjay Singh } __packed;
905625f965SAjay Singh 
915625f965SAjay Singh struct wilc_noa_opp_disable {
925625f965SAjay Singh 	u8 cnt;
935625f965SAjay Singh 	__le32 duration;
945625f965SAjay Singh 	__le32 interval;
955625f965SAjay Singh 	__le32 start_time;
965625f965SAjay Singh } __packed;
975625f965SAjay Singh 
985625f965SAjay Singh struct wilc_join_bss_param {
995625f965SAjay Singh 	char ssid[IEEE80211_MAX_SSID_LEN];
1005625f965SAjay Singh 	u8 ssid_terminator;
1015625f965SAjay Singh 	u8 bss_type;
1025625f965SAjay Singh 	u8 ch;
1035625f965SAjay Singh 	__le16 cap_info;
1045625f965SAjay Singh 	u8 sa[ETH_ALEN];
1055625f965SAjay Singh 	u8 bssid[ETH_ALEN];
1065625f965SAjay Singh 	__le16 beacon_period;
1075625f965SAjay Singh 	u8 dtim_period;
1085625f965SAjay Singh 	u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1];
1095625f965SAjay Singh 	u8 wmm_cap;
1105625f965SAjay Singh 	u8 uapsd_cap;
1115625f965SAjay Singh 	u8 ht_capable;
1125625f965SAjay Singh 	u8 rsn_found;
1135625f965SAjay Singh 	u8 rsn_grp_policy;
1145625f965SAjay Singh 	u8 mode_802_11i;
1155625f965SAjay Singh 	u8 p_suites[3];
1165625f965SAjay Singh 	u8 akm_suites[3];
1175625f965SAjay Singh 	u8 rsn_cap[2];
1185625f965SAjay Singh 	u8 noa_enabled;
1195625f965SAjay Singh 	__le32 tsf_lo;
1205625f965SAjay Singh 	u8 idx;
1215625f965SAjay Singh 	u8 opp_enabled;
1225625f965SAjay Singh 	union {
1235625f965SAjay Singh 		struct wilc_noa_opp_disable opp_dis;
1245625f965SAjay Singh 		struct wilc_noa_opp_enable opp_en;
1255625f965SAjay Singh 	};
1265625f965SAjay Singh } __packed;
127c5b331d4SAjay Singh 
128c5b331d4SAjay Singh struct wilc_external_auth_param {
129c5b331d4SAjay Singh 	u8 action;
130c5b331d4SAjay Singh 	u8 bssid[ETH_ALEN];
131c5b331d4SAjay Singh 	u8 ssid[IEEE80211_MAX_SSID_LEN];
132c5b331d4SAjay Singh 	u8 ssid_len;
133c5b331d4SAjay Singh 	__le32 key_mgmt_suites;
134c5b331d4SAjay Singh 	__le16 status;
135c5b331d4SAjay Singh } __packed;
136*59cf9277SAlexis Lothoré 
get_bank_offset_from_bank_index(unsigned int i)137*59cf9277SAlexis Lothoré static inline u32 get_bank_offset_from_bank_index(unsigned int i)
138*59cf9277SAlexis Lothoré {
139*59cf9277SAlexis Lothoré 	return (((i) < 2) ? WILC_NVMEM_LOW_BANK_OFFSET + ((i) * 32) :
140*59cf9277SAlexis Lothoré 		WILC_NVMEM_HIGH_BANK_OFFSET + ((i) - 2) * 16);
141*59cf9277SAlexis Lothoré }
142*59cf9277SAlexis Lothoré 
1435625f965SAjay Singh #endif
144