xref: /linux/drivers/net/wireless/microchip/wilc1000/fw.h (revision c771600c6af14749609b49565ffb4cac2959710d)
1c5295d1aSAjay Singh /* SPDX-License-Identifier: GPL-2.0 */
2c5295d1aSAjay Singh /*
3c5295d1aSAjay Singh  * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
4c5295d1aSAjay Singh  * All rights reserved.
5c5295d1aSAjay Singh  */
6c5295d1aSAjay Singh 
7c5295d1aSAjay Singh #ifndef WILC_FW_H
8c5295d1aSAjay Singh #define WILC_FW_H
9c5295d1aSAjay Singh 
10c5295d1aSAjay Singh #include <linux/ieee80211.h>
11c5295d1aSAjay Singh 
12c5295d1aSAjay Singh #define WILC_MAX_NUM_STA			9
13c5295d1aSAjay Singh #define WILC_MAX_RATES_SUPPORTED		12
14c5295d1aSAjay Singh #define WILC_MAX_NUM_PMKIDS			16
15c5295d1aSAjay Singh #define WILC_MAX_NUM_SCANNED_CH			14
1659cf9277SAlexis Lothoré #define WILC_NVMEM_MAX_NUM_BANK			6
1759cf9277SAlexis Lothoré #define WILC_NVMEM_BANK_BASE			0x30000000
1859cf9277SAlexis Lothoré #define WILC_NVMEM_LOW_BANK_OFFSET		0x102c
1959cf9277SAlexis Lothoré #define WILC_NVMEM_HIGH_BANK_OFFSET		0x1380
2059cf9277SAlexis Lothoré #define WILC_NVMEM_IS_BANK_USED			BIT(31)
2159cf9277SAlexis Lothoré #define WILC_NVMEM_IS_BANK_INVALID		BIT(30)
22c5295d1aSAjay Singh 
231d58fec4SAjay Singh struct wilc_assoc_resp {
24c5295d1aSAjay Singh 	__le16 capab_info;
25c5295d1aSAjay Singh 	__le16 status_code;
26c5295d1aSAjay Singh 	__le16 aid;
27c5295d1aSAjay Singh } __packed;
28c5295d1aSAjay Singh 
29c5295d1aSAjay Singh struct wilc_pmkid {
30c5295d1aSAjay Singh 	u8 bssid[ETH_ALEN];
31c5295d1aSAjay Singh 	u8 pmkid[WLAN_PMKID_LEN];
32c5295d1aSAjay Singh } __packed;
33c5295d1aSAjay Singh 
34c5295d1aSAjay Singh struct wilc_pmkid_attr {
35c5295d1aSAjay Singh 	u8 numpmkid;
36c5295d1aSAjay Singh 	struct wilc_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
37c5295d1aSAjay Singh } __packed;
38c5295d1aSAjay Singh 
39c5295d1aSAjay Singh struct wilc_reg_frame {
40c5295d1aSAjay Singh 	u8 reg;
41c5295d1aSAjay Singh 	u8 reg_id;
42c5295d1aSAjay Singh 	__le16 frame_type;
43c5295d1aSAjay Singh } __packed;
44c5295d1aSAjay Singh 
45c5295d1aSAjay Singh struct wilc_drv_handler {
46c5295d1aSAjay Singh 	__le32 handler;
47c5295d1aSAjay Singh 	u8 mode;
48c5295d1aSAjay Singh } __packed;
49c5295d1aSAjay Singh 
50c5295d1aSAjay Singh struct wilc_sta_wpa_ptk {
51c5295d1aSAjay Singh 	u8 mac_addr[ETH_ALEN];
52c5295d1aSAjay Singh 	u8 key_len;
53098238e8STian Tao 	u8 key[];
54c5295d1aSAjay Singh } __packed;
55c5295d1aSAjay Singh 
56c5295d1aSAjay Singh struct wilc_ap_wpa_ptk {
57c5295d1aSAjay Singh 	u8 mac_addr[ETH_ALEN];
58c5295d1aSAjay Singh 	u8 index;
59c5295d1aSAjay Singh 	u8 key_len;
60098238e8STian Tao 	u8 key[];
61c5295d1aSAjay Singh } __packed;
62c5295d1aSAjay 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 
71c5295d1aSAjay Singh struct wilc_gtk_key {
72c5295d1aSAjay Singh 	u8 mac_addr[ETH_ALEN];
73c5295d1aSAjay Singh 	u8 rsc[8];
74c5295d1aSAjay Singh 	u8 index;
75c5295d1aSAjay Singh 	u8 key_len;
76098238e8STian Tao 	u8 key[];
77c5295d1aSAjay Singh } __packed;
78c5295d1aSAjay Singh 
79c5295d1aSAjay Singh struct wilc_op_mode {
80c5295d1aSAjay Singh 	__le32 mode;
81c5295d1aSAjay Singh } __packed;
82c5295d1aSAjay Singh 
83c5295d1aSAjay Singh struct wilc_noa_opp_enable {
84c5295d1aSAjay Singh 	u8 ct_window;
85c5295d1aSAjay Singh 	u8 cnt;
86c5295d1aSAjay Singh 	__le32 duration;
87c5295d1aSAjay Singh 	__le32 interval;
88c5295d1aSAjay Singh 	__le32 start_time;
89c5295d1aSAjay Singh } __packed;
90c5295d1aSAjay Singh 
91c5295d1aSAjay Singh struct wilc_noa_opp_disable {
92c5295d1aSAjay Singh 	u8 cnt;
93c5295d1aSAjay Singh 	__le32 duration;
94c5295d1aSAjay Singh 	__le32 interval;
95c5295d1aSAjay Singh 	__le32 start_time;
96c5295d1aSAjay Singh } __packed;
97c5295d1aSAjay Singh 
98c5295d1aSAjay Singh struct wilc_join_bss_param {
99c5295d1aSAjay Singh 	char ssid[IEEE80211_MAX_SSID_LEN];
100c5295d1aSAjay Singh 	u8 ssid_terminator;
101c5295d1aSAjay Singh 	u8 bss_type;
102c5295d1aSAjay Singh 	u8 ch;
103c5295d1aSAjay Singh 	__le16 cap_info;
104c5295d1aSAjay Singh 	u8 sa[ETH_ALEN];
105c5295d1aSAjay Singh 	u8 bssid[ETH_ALEN];
106c5295d1aSAjay Singh 	__le16 beacon_period;
107c5295d1aSAjay Singh 	u8 dtim_period;
108c5295d1aSAjay Singh 	u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1];
109c5295d1aSAjay Singh 	u8 wmm_cap;
110c5295d1aSAjay Singh 	u8 uapsd_cap;
111c5295d1aSAjay Singh 	u8 ht_capable;
112c5295d1aSAjay Singh 	u8 rsn_found;
113c5295d1aSAjay Singh 	u8 rsn_grp_policy;
114c5295d1aSAjay Singh 	u8 mode_802_11i;
115c5295d1aSAjay Singh 	u8 p_suites[3];
116c5295d1aSAjay Singh 	u8 akm_suites[3];
117c5295d1aSAjay Singh 	u8 rsn_cap[2];
118c5295d1aSAjay Singh 	u8 noa_enabled;
119c5295d1aSAjay Singh 	__le32 tsf_lo;
120c5295d1aSAjay Singh 	u8 idx;
121c5295d1aSAjay Singh 	u8 opp_enabled;
122c5295d1aSAjay Singh 	union {
123c5295d1aSAjay Singh 		struct wilc_noa_opp_disable opp_dis;
124c5295d1aSAjay Singh 		struct wilc_noa_opp_enable opp_en;
125c5295d1aSAjay Singh 	};
126c5295d1aSAjay 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;
13659cf9277SAlexis Lothoré 
get_bank_offset_from_bank_index(unsigned int i)13759cf9277SAlexis Lothoré static inline u32 get_bank_offset_from_bank_index(unsigned int i)
13859cf9277SAlexis Lothoré {
13959cf9277SAlexis Lothoré 	return (((i) < 2) ? WILC_NVMEM_LOW_BANK_OFFSET + ((i) * 32) :
14059cf9277SAlexis Lothoré 		WILC_NVMEM_HIGH_BANK_OFFSET + ((i) - 2) * 16);
14159cf9277SAlexis Lothoré }
14259cf9277SAlexis Lothoré 
143c5295d1aSAjay Singh #endif
144