Skip to content

Commit c5295d1

Browse files
ajaykathatgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9d442d2 commit c5295d1

File tree

5 files changed

+120
-108
lines changed

5 files changed

+120
-108
lines changed

drivers/staging/wilc1000/fw.h

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
4+
* All rights reserved.
5+
*/
6+
7+
#ifndef WILC_FW_H
8+
#define WILC_FW_H
9+
10+
#include <linux/ieee80211.h>
11+
12+
#define WILC_MAX_NUM_STA 9
13+
#define WILC_MAX_RATES_SUPPORTED 12
14+
#define WILC_MAX_NUM_PMKIDS 16
15+
#define WILC_MAX_NUM_SCANNED_CH 14
16+
17+
struct assoc_resp {
18+
__le16 capab_info;
19+
__le16 status_code;
20+
__le16 aid;
21+
} __packed;
22+
23+
struct wilc_pmkid {
24+
u8 bssid[ETH_ALEN];
25+
u8 pmkid[WLAN_PMKID_LEN];
26+
} __packed;
27+
28+
struct wilc_pmkid_attr {
29+
u8 numpmkid;
30+
struct wilc_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
31+
} __packed;
32+
33+
struct wilc_reg_frame {
34+
u8 reg;
35+
u8 reg_id;
36+
__le16 frame_type;
37+
} __packed;
38+
39+
struct wilc_drv_handler {
40+
__le32 handler;
41+
u8 mode;
42+
} __packed;
43+
44+
struct wilc_wep_key {
45+
u8 index;
46+
u8 key_len;
47+
u8 key[0];
48+
} __packed;
49+
50+
struct wilc_sta_wpa_ptk {
51+
u8 mac_addr[ETH_ALEN];
52+
u8 key_len;
53+
u8 key[0];
54+
} __packed;
55+
56+
struct wilc_ap_wpa_ptk {
57+
u8 mac_addr[ETH_ALEN];
58+
u8 index;
59+
u8 key_len;
60+
u8 key[0];
61+
} __packed;
62+
63+
struct wilc_gtk_key {
64+
u8 mac_addr[ETH_ALEN];
65+
u8 rsc[8];
66+
u8 index;
67+
u8 key_len;
68+
u8 key[0];
69+
} __packed;
70+
71+
struct wilc_op_mode {
72+
__le32 mode;
73+
} __packed;
74+
75+
struct wilc_noa_opp_enable {
76+
u8 ct_window;
77+
u8 cnt;
78+
__le32 duration;
79+
__le32 interval;
80+
__le32 start_time;
81+
} __packed;
82+
83+
struct wilc_noa_opp_disable {
84+
u8 cnt;
85+
__le32 duration;
86+
__le32 interval;
87+
__le32 start_time;
88+
} __packed;
89+
90+
struct wilc_join_bss_param {
91+
char ssid[IEEE80211_MAX_SSID_LEN];
92+
u8 ssid_terminator;
93+
u8 bss_type;
94+
u8 ch;
95+
__le16 cap_info;
96+
u8 sa[ETH_ALEN];
97+
u8 bssid[ETH_ALEN];
98+
__le16 beacon_period;
99+
u8 dtim_period;
100+
u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1];
101+
u8 wmm_cap;
102+
u8 uapsd_cap;
103+
u8 ht_capable;
104+
u8 rsn_found;
105+
u8 rsn_grp_policy;
106+
u8 mode_802_11i;
107+
u8 p_suites[3];
108+
u8 akm_suites[3];
109+
u8 rsn_cap[2];
110+
u8 noa_enabled;
111+
__le32 tsf_lo;
112+
u8 idx;
113+
u8 opp_enabled;
114+
union {
115+
struct wilc_noa_opp_disable opp_dis;
116+
struct wilc_noa_opp_enable opp_en;
117+
};
118+
} __packed;
119+
#endif

drivers/staging/wilc1000/hif.c

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define WILC_HIF_CONNECT_TIMEOUT_MS 9500
1111

1212
#define WILC_FALSE_FRMWR_CHANNEL 100
13-
#define WILC_MAX_RATES_SUPPORTED 12
1413

1514
struct wilc_rcvd_mac_info {
1615
u8 status;
@@ -27,48 +26,6 @@ struct wilc_del_all_sta {
2726
u8 mac[WILC_MAX_NUM_STA][ETH_ALEN];
2827
};
2928

30-
struct wilc_op_mode {
31-
__le32 mode;
32-
};
33-
34-
struct wilc_reg_frame {
35-
u8 reg;
36-
u8 reg_id;
37-
__le16 frame_type;
38-
} __packed;
39-
40-
struct wilc_drv_handler {
41-
__le32 handler;
42-
u8 mode;
43-
} __packed;
44-
45-
struct wilc_wep_key {
46-
u8 index;
47-
u8 key_len;
48-
u8 key[0];
49-
} __packed;
50-
51-
struct wilc_sta_wpa_ptk {
52-
u8 mac_addr[ETH_ALEN];
53-
u8 key_len;
54-
u8 key[0];
55-
} __packed;
56-
57-
struct wilc_ap_wpa_ptk {
58-
u8 mac_addr[ETH_ALEN];
59-
u8 index;
60-
u8 key_len;
61-
u8 key[0];
62-
} __packed;
63-
64-
struct wilc_gtk_key {
65-
u8 mac_addr[ETH_ALEN];
66-
u8 rsc[8];
67-
u8 index;
68-
u8 key_len;
69-
u8 key[0];
70-
} __packed;
71-
7229
union wilc_message_body {
7330
struct wilc_rcvd_net_info net_info;
7431
struct wilc_rcvd_mac_info mac_info;
@@ -86,51 +43,6 @@ struct host_if_msg {
8643
bool is_sync;
8744
};
8845

89-
struct wilc_noa_opp_enable {
90-
u8 ct_window;
91-
u8 cnt;
92-
__le32 duration;
93-
__le32 interval;
94-
__le32 start_time;
95-
} __packed;
96-
97-
struct wilc_noa_opp_disable {
98-
u8 cnt;
99-
__le32 duration;
100-
__le32 interval;
101-
__le32 start_time;
102-
} __packed;
103-
104-
struct wilc_join_bss_param {
105-
char ssid[IEEE80211_MAX_SSID_LEN];
106-
u8 ssid_terminator;
107-
u8 bss_type;
108-
u8 ch;
109-
__le16 cap_info;
110-
u8 sa[ETH_ALEN];
111-
u8 bssid[ETH_ALEN];
112-
__le16 beacon_period;
113-
u8 dtim_period;
114-
u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1];
115-
u8 wmm_cap;
116-
u8 uapsd_cap;
117-
u8 ht_capable;
118-
u8 rsn_found;
119-
u8 rsn_grp_policy;
120-
u8 mode_802_11i;
121-
u8 p_suites[3];
122-
u8 akm_suites[3];
123-
u8 rsn_cap[2];
124-
u8 noa_enabled;
125-
__le32 tsf_lo;
126-
u8 idx;
127-
u8 opp_enabled;
128-
union {
129-
struct wilc_noa_opp_disable opp_dis;
130-
struct wilc_noa_opp_enable opp_en;
131-
};
132-
} __packed;
133-
13446
/* 'msg' should be free by the caller for syc */
13547
static struct host_if_msg*
13648
wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *),

drivers/staging/wilc1000/hif.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@ enum {
1717
WILC_CLIENT_MODE = 0x4
1818
};
1919

20-
#define WILC_MAX_NUM_STA 9
21-
#define WILC_MAX_NUM_SCANNED_CH 14
2220
#define WILC_MAX_NUM_PROBED_SSID 10
2321

2422
#define WILC_TX_MIC_KEY_LEN 8
2523
#define WILC_RX_MIC_KEY_LEN 8
2624

27-
#define WILC_MAX_NUM_PMKIDS 16
2825
#define WILC_ADD_STA_LENGTH 40
2926
#define WILC_NUM_CONCURRENT_IFC 2
3027

@@ -35,12 +32,6 @@ enum {
3532

3633
#define WILC_MAX_ASSOC_RESP_FRAME_SIZE 256
3734

38-
struct assoc_resp {
39-
__le16 capab_info;
40-
__le16 status_code;
41-
__le16 aid;
42-
} __packed;
43-
4435
struct rf_info {
4536
u8 link_speed;
4637
s8 rssi;
@@ -59,16 +50,6 @@ enum host_if_state {
5950
HOST_IF_FORCE_32BIT = 0xFFFFFFFF
6051
};
6152

62-
struct wilc_pmkid {
63-
u8 bssid[ETH_ALEN];
64-
u8 pmkid[WLAN_PMKID_LEN];
65-
} __packed;
66-
67-
struct wilc_pmkid_attr {
68-
u8 numpmkid;
69-
struct wilc_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
70-
} __packed;
71-
7253
struct cfg_param_attr {
7354
u32 flag;
7455
u16 short_retry_limit;

drivers/staging/wilc1000/netdev.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#define FLOW_CONTROL_LOWER_THRESHOLD 128
2222
#define FLOW_CONTROL_UPPER_THRESHOLD 256
2323

24-
#define WILC_MAX_NUM_PMKIDS 16
2524
#define PMKID_FOUND 1
2625
#define NUM_STA_ASSOCIATED 8
2726

drivers/staging/wilc1000/wlan_if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define WILC_WLAN_IF_H
99

1010
#include <linux/netdevice.h>
11+
#include "fw.h"
1112

1213
/********************************************
1314
*

0 commit comments

Comments
 (0)