From c5295d1a41fe2f1bd0877f74817a3b63b989b10e Mon Sep 17 00:00:00 2001 From: Ajay Singh Date: Fri, 17 Jan 2020 10:31:25 +0000 Subject: [PATCH] staging: wilc1000: move firmware API struct's to separate header file It's recommended to keep the 'struct' used for passing data to firmware in separate header file. So added 'fw.h' header file to keep struct's used to pass data to firmware. Signed-off-by: Ajay Singh Link: https://lore.kernel.org/r/20200117160157.8706-3-ajay.kathat@microchip.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wilc1000/fw.h | 119 +++++++++++++++++++++++++++++++++++++ drivers/staging/wilc1000/hif.c | 88 --------------------------- drivers/staging/wilc1000/hif.h | 19 ------ drivers/staging/wilc1000/netdev.h | 1 - drivers/staging/wilc1000/wlan_if.h | 1 + 5 files changed, 120 insertions(+), 108 deletions(-) create mode 100644 drivers/staging/wilc1000/fw.h diff --git a/drivers/staging/wilc1000/fw.h b/drivers/staging/wilc1000/fw.h new file mode 100644 index 0000000..21d71a9 --- /dev/null +++ b/drivers/staging/wilc1000/fw.h @@ -0,0 +1,119 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries. + * All rights reserved. + */ + +#ifndef WILC_FW_H +#define WILC_FW_H + +#include + +#define WILC_MAX_NUM_STA 9 +#define WILC_MAX_RATES_SUPPORTED 12 +#define WILC_MAX_NUM_PMKIDS 16 +#define WILC_MAX_NUM_SCANNED_CH 14 + +struct assoc_resp { + __le16 capab_info; + __le16 status_code; + __le16 aid; +} __packed; + +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 wilc_reg_frame { + u8 reg; + u8 reg_id; + __le16 frame_type; +} __packed; + +struct wilc_drv_handler { + __le32 handler; + u8 mode; +} __packed; + +struct wilc_wep_key { + u8 index; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_sta_wpa_ptk { + u8 mac_addr[ETH_ALEN]; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_ap_wpa_ptk { + u8 mac_addr[ETH_ALEN]; + u8 index; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_gtk_key { + u8 mac_addr[ETH_ALEN]; + u8 rsc[8]; + u8 index; + u8 key_len; + u8 key[0]; +} __packed; + +struct wilc_op_mode { + __le32 mode; +} __packed; + +struct wilc_noa_opp_enable { + u8 ct_window; + u8 cnt; + __le32 duration; + __le32 interval; + __le32 start_time; +} __packed; + +struct wilc_noa_opp_disable { + u8 cnt; + __le32 duration; + __le32 interval; + __le32 start_time; +} __packed; + +struct wilc_join_bss_param { + char ssid[IEEE80211_MAX_SSID_LEN]; + u8 ssid_terminator; + u8 bss_type; + u8 ch; + __le16 cap_info; + u8 sa[ETH_ALEN]; + u8 bssid[ETH_ALEN]; + __le16 beacon_period; + u8 dtim_period; + u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1]; + u8 wmm_cap; + u8 uapsd_cap; + u8 ht_capable; + u8 rsn_found; + u8 rsn_grp_policy; + u8 mode_802_11i; + u8 p_suites[3]; + u8 akm_suites[3]; + u8 rsn_cap[2]; + u8 noa_enabled; + __le32 tsf_lo; + u8 idx; + u8 opp_enabled; + union { + struct wilc_noa_opp_disable opp_dis; + struct wilc_noa_opp_enable opp_en; + }; +} __packed; +#endif diff --git a/drivers/staging/wilc1000/hif.c b/drivers/staging/wilc1000/hif.c index 349e45d..1ee3d72 100644 --- a/drivers/staging/wilc1000/hif.c +++ b/drivers/staging/wilc1000/hif.c @@ -10,7 +10,6 @@ #define WILC_HIF_CONNECT_TIMEOUT_MS 9500 #define WILC_FALSE_FRMWR_CHANNEL 100 -#define WILC_MAX_RATES_SUPPORTED 12 struct wilc_rcvd_mac_info { u8 status; @@ -27,48 +26,6 @@ struct wilc_del_all_sta { u8 mac[WILC_MAX_NUM_STA][ETH_ALEN]; }; -struct wilc_op_mode { - __le32 mode; -}; - -struct wilc_reg_frame { - u8 reg; - u8 reg_id; - __le16 frame_type; -} __packed; - -struct wilc_drv_handler { - __le32 handler; - u8 mode; -} __packed; - -struct wilc_wep_key { - u8 index; - u8 key_len; - u8 key[0]; -} __packed; - -struct wilc_sta_wpa_ptk { - u8 mac_addr[ETH_ALEN]; - u8 key_len; - u8 key[0]; -} __packed; - -struct wilc_ap_wpa_ptk { - u8 mac_addr[ETH_ALEN]; - u8 index; - u8 key_len; - u8 key[0]; -} __packed; - -struct wilc_gtk_key { - u8 mac_addr[ETH_ALEN]; - u8 rsc[8]; - u8 index; - u8 key_len; - u8 key[0]; -} __packed; - union wilc_message_body { struct wilc_rcvd_net_info net_info; struct wilc_rcvd_mac_info mac_info; @@ -86,51 +43,6 @@ struct host_if_msg { bool is_sync; }; -struct wilc_noa_opp_enable { - u8 ct_window; - u8 cnt; - __le32 duration; - __le32 interval; - __le32 start_time; -} __packed; - -struct wilc_noa_opp_disable { - u8 cnt; - __le32 duration; - __le32 interval; - __le32 start_time; -} __packed; - -struct wilc_join_bss_param { - char ssid[IEEE80211_MAX_SSID_LEN]; - u8 ssid_terminator; - u8 bss_type; - u8 ch; - __le16 cap_info; - u8 sa[ETH_ALEN]; - u8 bssid[ETH_ALEN]; - __le16 beacon_period; - u8 dtim_period; - u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1]; - u8 wmm_cap; - u8 uapsd_cap; - u8 ht_capable; - u8 rsn_found; - u8 rsn_grp_policy; - u8 mode_802_11i; - u8 p_suites[3]; - u8 akm_suites[3]; - u8 rsn_cap[2]; - u8 noa_enabled; - __le32 tsf_lo; - u8 idx; - u8 opp_enabled; - union { - struct wilc_noa_opp_disable opp_dis; - struct wilc_noa_opp_enable opp_en; - }; -} __packed; - /* 'msg' should be free by the caller for syc */ static struct host_if_msg* wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *), diff --git a/drivers/staging/wilc1000/hif.h b/drivers/staging/wilc1000/hif.h index 22ee6ff..db91791 100644 --- a/drivers/staging/wilc1000/hif.h +++ b/drivers/staging/wilc1000/hif.h @@ -17,14 +17,11 @@ enum { WILC_CLIENT_MODE = 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 @@ -35,12 +32,6 @@ enum { #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; @@ -59,16 +50,6 @@ enum host_if_state { HOST_IF_FORCE_32BIT = 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; diff --git a/drivers/staging/wilc1000/netdev.h b/drivers/staging/wilc1000/netdev.h index cd8f0d7..d5f7a60 100644 --- a/drivers/staging/wilc1000/netdev.h +++ b/drivers/staging/wilc1000/netdev.h @@ -21,7 +21,6 @@ #define FLOW_CONTROL_LOWER_THRESHOLD 128 #define FLOW_CONTROL_UPPER_THRESHOLD 256 -#define WILC_MAX_NUM_PMKIDS 16 #define PMKID_FOUND 1 #define NUM_STA_ASSOCIATED 8 diff --git a/drivers/staging/wilc1000/wlan_if.h b/drivers/staging/wilc1000/wlan_if.h index 7c7ee66..f85fd57 100644 --- a/drivers/staging/wilc1000/wlan_if.h +++ b/drivers/staging/wilc1000/wlan_if.h @@ -8,6 +8,7 @@ #define WILC_WLAN_IF_H #include +#include "fw.h" /******************************************** * -- 2.7.4