diff mbox series

[03/19] wilc: add host_interface.h

Message ID 1537957525-11467-4-git-send-email-ajay.kathat@microchip.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series wilc: added driver for wilc module | expand

Commit Message

Ajay Singh Sept. 26, 2018, 10:25 a.m. UTC
Moved '/driver/staging/wilc1000/host_interface.h' to
'drivers/net/wireless/microchip/wilc/'.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 .../net/wireless/microchip/wilc/host_interface.h   | 362 +++++++++++++++++++++
 1 file changed, 362 insertions(+)
 create mode 100644 drivers/net/wireless/microchip/wilc/host_interface.h

Comments

Johannes Berg Oct. 8, 2018, 2:20 p.m. UTC | #1
On Wed, 2018-09-26 at 15:55 +0530, Ajay Singh wrote:

> +#include <linux/ieee80211.h>

you include it

> +#include "coreconfigurator.h"
> +
> +#define IDLE_MODE	0x00
> +#define AP_MODE		0x01
> +#define STATION_MODE	0x02
> +#define GO_MODE		0x03
> +#define CLIENT_MODE	0x04
> +#define ACTION		0xD0
> +#define PROBE_REQ	0x40
> +#define PROBE_RESP	0x50

please use it too.

> +#define ACTION_FRM_IDX				0
> +#define PROBE_REQ_IDX				1
> +#define MAX_NUM_STA				9
> +#define ACTIVE_SCAN_TIME			10
> +#define PASSIVE_SCAN_TIME			1200
> +#define MIN_SCAN_TIME				10
> +#define MAX_SCAN_TIME				1200
> +#define DEFAULT_SCAN				0
> +#define USER_SCAN				BIT(0)
> +#define OBSS_PERIODIC_SCAN			BIT(1)
> +#define OBSS_ONETIME_SCAN			BIT(2)
> +#define GTK_RX_KEY_BUFF_LEN			24
> +#define ADDKEY					0x1
> +#define REMOVEKEY				0x2
> +#define DEFAULTKEY				0x4
> +#define ADDKEY_AP				0x8
> +#define MAX_NUM_SCANNED_NETWORKS		100
> +#define MAX_NUM_SCANNED_NETWORKS_SHADOW		130
> +#define MAX_NUM_PROBED_SSID			10
> +#define CHANNEL_SCAN_TIME			250
> +
> +#define TX_MIC_KEY_LEN				8
> +#define RX_MIC_KEY_LEN				8
> +#define PTK_KEY_LEN				16
> +
> +#define TX_MIC_KEY_MSG_LEN			26
> +#define RX_MIC_KEY_MSG_LEN			48
> +#define PTK_KEY_MSG_LEN				39
> +
> +#define PMKSA_KEY_LEN				22
> +#define ETH_ALEN				6

umm?

> +#define PMKID_LEN				16

??

> +#define WILC_MAX_NUM_PMKIDS			16
> +#define WILC_ADD_STA_LENGTH			40
> +#define NUM_CONCURRENT_IFC			2
> +#define DRV_HANDLER_SIZE			5
> +#define DRV_HANDLER_MASK			0x000000FF

Also this file is strangely mixing
 * 802.11 constants (that you shouldn't have anyway)
 * driver constants/structs
 * hardware/firmware-related things (at least it seems like - e.g. the
   "REMOVEKEY" constant)

Please clean that up, separate the things, and pick a better
namespace... just having "REMOVEKEY" is probably not a good idea.

> +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
> +typedef void (*wilc_remain_on_chan_ready)(void *);

Please no typedefs.

> +struct rcvd_net_info {
> +	u8 *buffer;
> +	u32 len;
> +};
> +
> +struct hidden_net_info {
> +	u8  *ssid;
> +	u8 ssid_len;
> +};
> +
> +struct hidden_network {
> +	struct hidden_net_info *net_info;
> +	u8 n_ssids;
> +};

This seems really odd - what part doesn't cfg80211 already handle?

johannes
Ajay Singh Oct. 9, 2018, 10:34 a.m. UTC | #2
On 10/8/2018 7:50 PM, Johannes Berg wrote:
> On Wed, 2018-09-26 at 15:55 +0530, Ajay Singh wrote:
>
>> +#include <linux/ieee80211.h>
> you include it
>
>> +#include "coreconfigurator.h"
>> +
>> +#define IDLE_MODE	0x00
>> +#define AP_MODE		0x01
>> +#define STATION_MODE	0x02
>> +#define GO_MODE		0x03
>> +#define CLIENT_MODE	0x04
>> +#define ACTION		0xD0
>> +#define PROBE_REQ	0x40
>> +#define PROBE_RESP	0x50
> please use it too.
>
Ack.

>> +#define ACTION_FRM_IDX				0
>> +#define PROBE_REQ_IDX				1
>> +#define MAX_NUM_STA				9
>> +#define ACTIVE_SCAN_TIME			10
>> +#define PASSIVE_SCAN_TIME			1200
>> +#define MIN_SCAN_TIME				10
>> +#define MAX_SCAN_TIME				1200
>> +#define DEFAULT_SCAN				0
>> +#define USER_SCAN				BIT(0)
>> +#define OBSS_PERIODIC_SCAN			BIT(1)
>> +#define OBSS_ONETIME_SCAN			BIT(2)
>> +#define GTK_RX_KEY_BUFF_LEN			24
>> +#define ADDKEY					0x1
>> +#define REMOVEKEY				0x2
>> +#define DEFAULTKEY				0x4
>> +#define ADDKEY_AP				0x8
>> +#define MAX_NUM_SCANNED_NETWORKS		100
>> +#define MAX_NUM_SCANNED_NETWORKS_SHADOW		130
>> +#define MAX_NUM_PROBED_SSID			10
>> +#define CHANNEL_SCAN_TIME			250
>> +
>> +#define TX_MIC_KEY_LEN				8
>> +#define RX_MIC_KEY_LEN				8
>> +#define PTK_KEY_LEN				16
>> +
>> +#define TX_MIC_KEY_MSG_LEN			26
>> +#define RX_MIC_KEY_MSG_LEN			48
>> +#define PTK_KEY_MSG_LEN				39
>> +
>> +#define PMKSA_KEY_LEN				22
>> +#define ETH_ALEN				6
> umm?
>
>> +#define PMKID_LEN				16
> ??
>
>> +#define WILC_MAX_NUM_PMKIDS			16
>> +#define WILC_ADD_STA_LENGTH			40
>> +#define NUM_CONCURRENT_IFC			2
>> +#define DRV_HANDLER_SIZE			5
>> +#define DRV_HANDLER_MASK			0x000000FF
> Also this file is strangely mixing
>  * 802.11 constants (that you shouldn't have anyway)
>  * driver constants/structs
>  * hardware/firmware-related things (at least it seems like - e.g. the
>    "REMOVEKEY" constant)
>
> Please clean that up, separate the things, and pick a better
> namespace... just having "REMOVEKEY" is probably not a good idea.
>
Will work on this to clean it up.
>> +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
>> +typedef void (*wilc_remain_on_chan_ready)(void *);
> Please no typedefs.
>
I think as per coding style the typedef for function pointer are allowed.

>> +struct rcvd_net_info {
>> +	u8 *buffer;
>> +	u32 len;
>> +};
>> +
>> +struct hidden_net_info {
>> +	u8  *ssid;
>> +	u8 ssid_len;
>> +};
>> +
>> +struct hidden_network {
>> +	struct hidden_net_info *net_info;
>> +	u8 n_ssids;
>> +};
> This seems really odd - what part doesn't cfg80211 already handle?

If I understood your question correctly,  you meant what extra
functionality 'hidden_network' struct is providing.
Actually this structure is just used to keeps list of SSID's requested
in cfg80211 'scan' callback which is passed to firmware. The values are
extracted from 'cfg80211_scan_request[struct cfg80211_ssid *ssids 
-----  int n_ssids] received during scan.

Regards,
Ajay
Johannes Berg Oct. 9, 2018, 10:36 a.m. UTC | #3
On Tue, 2018-10-09 at 16:04 +0530, Ajay Singh wrote:

> > > +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
> > > +typedef void (*wilc_remain_on_chan_ready)(void *);

> I think as per coding style the typedef for function pointer are allowed.

True, I guess, but why do you need them?

> > > +struct rcvd_net_info {
> > > +	u8 *buffer;
> > > +	u32 len;
> > > +};
> > > +
> > > +struct hidden_net_info {
> > > +	u8  *ssid;
> > > +	u8 ssid_len;
> > > +};
> > > +
> > > +struct hidden_network {
> > > +	struct hidden_net_info *net_info;
> > > +	u8 n_ssids;
> > > +};
> > 
> > This seems really odd - what part doesn't cfg80211 already handle?
> 
> If I understood your question correctly,  you meant what extra
> functionality 'hidden_network' struct is providing.

Pretty much. It seems like you're trying to handle hidden SSIDs in some
way, but ... that's odd.

> Actually this structure is just used to keeps list of SSID's requested
> in cfg80211 'scan' callback which is passed to firmware. The values are
> extracted from 'cfg80211_scan_request[struct cfg80211_ssid *ssids 
> -----  int n_ssids] received during scan.

So then this has nothing to do with hidden SSID?

johannes
Ajay Singh Oct. 9, 2018, 11:44 a.m. UTC | #4
On 10/9/2018 4:06 PM, Johannes Berg wrote:
> On Tue, 2018-10-09 at 16:04 +0530, Ajay Singh wrote:
>
>>>> +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
>>>> +typedef void (*wilc_remain_on_chan_ready)(void *);
>> I think as per coding style the typedef for function pointer are allowed.
> True, I guess, but why do you need them?

Actually these function pointer are used in multiple places i.e inside
the struct and also for passing as the argument for the function. So i
think its better to keep them as typedef to simplify and avoid any 'line
over 80 chars' checkpatch issue. But anyway if you suggest we can modify
to remove these typedefs .

>>>> +struct rcvd_net_info {
>>>> +	u8 *buffer;
>>>> +	u32 len;
>>>> +};
>>>> +
>>>> +struct hidden_net_info {
>>>> +	u8  *ssid;
>>>> +	u8 ssid_len;
>>>> +};
>>>> +
>>>> +struct hidden_network {
>>>> +	struct hidden_net_info *net_info;
>>>> +	u8 n_ssids;
>>>> +};
>>> This seems really odd - what part doesn't cfg80211 already handle?
>> If I understood your question correctly,  you meant what extra
>> functionality 'hidden_network' struct is providing.
> Pretty much. It seems like you're trying to handle hidden SSIDs in some
> way, but ... that's odd.
>
>> Actually this structure is just used to keeps list of SSID's requested
>> in cfg80211 'scan' callback which is passed to firmware. The values are
>> extracted from 'cfg80211_scan_request[struct cfg80211_ssid *ssids 
>> -----  int n_ssids] received during scan.
> So then this has nothing to do with hidden SSID?

Yes, its not related to hidden SSID. Suppose cfg80211 scan is called
with SSID information(active scan) then SSID info will be maintained in
this structure.

Regards,
Ajay
Johannes Berg Oct. 9, 2018, 11:46 a.m. UTC | #5
On Tue, 2018-10-09 at 17:14 +0530, Ajay Singh wrote:
> On 10/9/2018 4:06 PM, Johannes Berg wrote:
> > On Tue, 2018-10-09 at 16:04 +0530, Ajay Singh wrote:
> > 
> > > > > +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
> > > > > +typedef void (*wilc_remain_on_chan_ready)(void *);
> > > 
> > > I think as per coding style the typedef for function pointer are allowed.
> > 
> > True, I guess, but why do you need them?
> 
> Actually these function pointer are used in multiple places i.e inside
> the struct and also for passing as the argument for the function. So i
> think its better to keep them as typedef to simplify and avoid any 'line
> over 80 chars' checkpatch issue. But anyway if you suggest we can modify
> to remove these typedefs .

I guess that must be part of the internal bounce buffer mechanism? I
guess leave them for now and see what falls out.

> > > > > +struct hidden_network {
> > > > > 
> Yes, its not related to hidden SSID. Suppose cfg80211 scan is called
> with SSID information(active scan) then SSID info will be maintained in
> this structure.

so maybe rename this?

johannes
Ajay Singh Oct. 9, 2018, 12:18 p.m. UTC | #6
On 10/9/2018 5:16 PM, Johannes Berg wrote:
> On Tue, 2018-10-09 at 17:14 +0530, Ajay Singh wrote:
>> On 10/9/2018 4:06 PM, Johannes Berg wrote:
>>> On Tue, 2018-10-09 at 16:04 +0530, Ajay Singh wrote:
>>>
>>>>>> +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
>>>>>> +typedef void (*wilc_remain_on_chan_ready)(void *);
>>>> I think as per coding style the typedef for function pointer are allowed.
>>> True, I guess, but why do you need them?
>> Actually these function pointer are used in multiple places i.e inside
>> the struct and also for passing as the argument for the function. So i
>> think its better to keep them as typedef to simplify and avoid any 'line
>> over 80 chars' checkpatch issue. But anyway if you suggest we can modify
>> to remove these typedefs .
> I guess that must be part of the internal bounce buffer mechanism? I
> guess leave them for now and see what falls out.
>
>>>>>> +struct hidden_network {
>>>>>>
>> Yes, its not related to hidden SSID. Suppose cfg80211 scan is called
>> with SSID information(active scan) then SSID info will be maintained in
>> this structure.
> so maybe rename this?
>
Yes, sure I will rename this struct.

Regards,
Ajay
Adham Abozaeid Oct. 9, 2018, 6:36 p.m. UTC | #7
On 10/09/2018 05:18 AM, Ajay Singh wrote:
> 
> On 10/9/2018 5:16 PM, Johannes Berg wrote:
>> On Tue, 2018-10-09 at 17:14 +0530, Ajay Singh wrote:
>>> On 10/9/2018 4:06 PM, Johannes Berg wrote:
>>>> On Tue, 2018-10-09 at 16:04 +0530, Ajay Singh wrote:
>>>>
>>>>>>> +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
>>>>>>> +typedef void (*wilc_remain_on_chan_ready)(void *);
>>>>> I think as per coding style the typedef for function pointer are allowed.
>>>> True, I guess, but why do you need them?
>>> Actually these function pointer are used in multiple places i.e inside
>>> the struct and also for passing as the argument for the function. So i
>>> think its better to keep them as typedef to simplify and avoid any 'line
>>> over 80 chars' checkpatch issue. But anyway if you suggest we can modify
>>> to remove these typedefs .
>> I guess that must be part of the internal bounce buffer mechanism? I
>> guess leave them for now and see what falls out.
>>
>>>>>>> +struct hidden_network {
>>>>>>>
>>> Yes, its not related to hidden SSID. Suppose cfg80211 scan is called
>>> with SSID information(active scan) then SSID info will be maintained in
>>> this structure.
>> so maybe rename this?
>>
> Yes, sure I will rename this struct.
> 
> Regards,
> Ajay
> 

Johannes, is the cfg80211_scan_request.ssid used for something else other than specifying the hidden networks that the controller should scan for?
Johannes Berg Oct. 9, 2018, 7:14 p.m. UTC | #8
On Tue, 2018-10-09 at 18:36 +0000, Adham.Abozaeid@microchip.com wrote:
> 
> Johannes, is the cfg80211_scan_request.ssid used for something else
> other than specifying the hidden networks that the controller should
> scan for?

Ahh, now I understand where you're coming from.

Well, it's the SSID to include in the probe request(s), the most common
thing there is the 0-length wildcard, of course.

So while it may be required for hidden networks, it's not strictly
related to that.

johannes
Adham Abozaeid Oct. 9, 2018, 8:01 p.m. UTC | #9
On 10/09/2018 12:14 PM, Johannes Berg wrote:
> On Tue, 2018-10-09 at 18:36 +0000, Adham.Abozaeid@microchip.com wrote:
>>
>> Johannes, is the cfg80211_scan_request.ssid used for something else
>> other than specifying the hidden networks that the controller should
>> scan for?
> 
> Ahh, now I understand where you're coming from.
> 
> Well, it's the SSID to include in the probe request(s), the most common
> thing there is the 0-length wildcard, of course.
> 
> So while it may be required for hidden networks, it's not strictly
> related to that.
Do you mean that it can also be used for probing specific networks even if they are broadcasting their SSID?
I think this might be a possible case if the user is trying to limit the scan results to a specific network.

> 
> johannes
>
Johannes Berg Oct. 9, 2018, 8:02 p.m. UTC | #10
On Tue, 2018-10-09 at 20:01 +0000, Adham.Abozaeid@microchip.com wrote:
> 
> Do you mean that it can also be used for probing specific networks even if they are broadcasting their SSID?

Yes.

> I think this might be a possible case if the user is trying to limit the scan results to a specific network.

No. Don't do any filtering based on this.

Basically the only thing you should do with the (list of) SSIDs is to
send a probe request containing each of them. Userspace/cfg80211 will
take care that the usual empty (wildcard) SSID is included in the list,
so don't send one with that by yourself, just iterate the list.

If you only support sending one probe request in each scan request, then
set the max # of SSIDs supported to 1, otherwise set it to the maximum
(or a reasonable limit like 20 if it's in software).

johannes
Adham Abozaeid Oct. 9, 2018, 8:06 p.m. UTC | #11
On 10/09/2018 01:02 PM, Johannes Berg wrote:
> On Tue, 2018-10-09 at 20:01 +0000, Adham.Abozaeid@microchip.com wrote:
>>
>> Do you mean that it can also be used for probing specific networks even if they are broadcasting their SSID?
> 
> Yes.
> 
>> I think this might be a possible case if the user is trying to limit the scan results to a specific network.
> 
> No. Don't do any filtering based on this.
> 
> Basically the only thing you should do with the (list of) SSIDs is to
> send a probe request containing each of them. Userspace/cfg80211 will
> take care that the usual empty (wildcard) SSID is included in the list,
> so don't send one with that by yourself, just iterate the list.
> 
> If you only support sending one probe request in each scan request, then
> set the max # of SSIDs supported to 1, otherwise set it to the maximum
> (or a reasonable limit like 20 if it's in software).
> 
> johannes
> 
Thanks Johannes. It's clear now.
Kalle Valo Oct. 29, 2018, 2:56 p.m. UTC | #12
Ajay Singh <ajay.kathat@microchip.com> writes:

> On 10/9/2018 4:06 PM, Johannes Berg wrote:
>> On Tue, 2018-10-09 at 16:04 +0530, Ajay Singh wrote:
>>
>>>>> +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
>>>>> +typedef void (*wilc_remain_on_chan_ready)(void *);
>>> I think as per coding style the typedef for function pointer are allowed.
>> True, I guess, but why do you need them?
>
> Actually these function pointer are used in multiple places i.e inside
> the struct and also for passing as the argument for the function. So i
> think its better to keep them as typedef to simplify and avoid any 'line
> over 80 chars' checkpatch issue. But anyway if you suggest we can modify
> to remove these typedefs .

Please remove them, they just make the code harder to read.
Ajay Singh Oct. 30, 2018, 3:20 a.m. UTC | #13
On 10/29/2018 8:26 PM, Kalle Valo wrote:
> Ajay Singh <ajay.kathat@microchip.com> writes:
>
>> On 10/9/2018 4:06 PM, Johannes Berg wrote:
>>> On Tue, 2018-10-09 at 16:04 +0530, Ajay Singh wrote:
>>>
>>>>>> +typedef void (*wilc_remain_on_chan_expired)(void *, u32);
>>>>>> +typedef void (*wilc_remain_on_chan_ready)(void *);
>>>> I think as per coding style the typedef for function pointer are allowed.
>>> True, I guess, but why do you need them?
>> Actually these function pointer are used in multiple places i.e inside
>> the struct and also for passing as the argument for the function. So i
>> think its better to keep them as typedef to simplify and avoid any 'line
>> over 80 chars' checkpatch issue. But anyway if you suggest we can modify
>> to remove these typedefs .
> Please remove them, they just make the code harder to read.

Sure, I will remove it.

Regards,
Ajay
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc/host_interface.h b/drivers/net/wireless/microchip/wilc/host_interface.h
new file mode 100644
index 0000000..33fb731
--- /dev/null
+++ b/drivers/net/wireless/microchip/wilc/host_interface.h
@@ -0,0 +1,362 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries
+ * All rights reserved.
+ */
+
+#ifndef HOST_INT_H
+#define HOST_INT_H
+#include <linux/ieee80211.h>
+#include "coreconfigurator.h"
+
+#define IDLE_MODE	0x00
+#define AP_MODE		0x01
+#define STATION_MODE	0x02
+#define GO_MODE		0x03
+#define CLIENT_MODE	0x04
+#define ACTION		0xD0
+#define PROBE_REQ	0x40
+#define PROBE_RESP	0x50
+
+#define ACTION_FRM_IDX				0
+#define PROBE_REQ_IDX				1
+#define MAX_NUM_STA				9
+#define ACTIVE_SCAN_TIME			10
+#define PASSIVE_SCAN_TIME			1200
+#define MIN_SCAN_TIME				10
+#define MAX_SCAN_TIME				1200
+#define DEFAULT_SCAN				0
+#define USER_SCAN				BIT(0)
+#define OBSS_PERIODIC_SCAN			BIT(1)
+#define OBSS_ONETIME_SCAN			BIT(2)
+#define GTK_RX_KEY_BUFF_LEN			24
+#define ADDKEY					0x1
+#define REMOVEKEY				0x2
+#define DEFAULTKEY				0x4
+#define ADDKEY_AP				0x8
+#define MAX_NUM_SCANNED_NETWORKS		100
+#define MAX_NUM_SCANNED_NETWORKS_SHADOW		130
+#define MAX_NUM_PROBED_SSID			10
+#define CHANNEL_SCAN_TIME			250
+
+#define TX_MIC_KEY_LEN				8
+#define RX_MIC_KEY_LEN				8
+#define PTK_KEY_LEN				16
+
+#define TX_MIC_KEY_MSG_LEN			26
+#define RX_MIC_KEY_MSG_LEN			48
+#define PTK_KEY_MSG_LEN				39
+
+#define PMKSA_KEY_LEN				22
+#define ETH_ALEN				6
+#define PMKID_LEN				16
+#define WILC_MAX_NUM_PMKIDS			16
+#define WILC_ADD_STA_LENGTH			40
+#define NUM_CONCURRENT_IFC			2
+#define DRV_HANDLER_SIZE			5
+#define DRV_HANDLER_MASK			0x000000FF
+
+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			= 0,
+	HOST_IF_SCANNING		= 1,
+	HOST_IF_CONNECTING		= 2,
+	HOST_IF_WAITING_CONN_RESP	= 3,
+	HOST_IF_CONNECTED		= 4,
+	HOST_IF_P2P_LISTEN		= 5,
+	HOST_IF_FORCE_32BIT		= 0xFFFFFFFF
+};
+
+struct host_if_pmkid {
+	u8 bssid[ETH_ALEN];
+	u8 pmkid[PMKID_LEN];
+};
+
+struct host_if_pmkid_attr {
+	u8 numpmkid;
+	struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
+};
+
+enum current_tx_rate {
+	AUTORATE	= 0,
+	MBPS_1		= 1,
+	MBPS_2		= 2,
+	MBPS_5_5	= 5,
+	MBPS_11		= 11,
+	MBPS_6		= 6,
+	MBPS_9		= 9,
+	MBPS_12		= 12,
+	MBPS_18		= 18,
+	MBPS_24		= 24,
+	MBPS_36		= 36,
+	MBPS_48		= 48,
+	MBPS_54		= 54
+};
+
+struct cfg_param_attr {
+	u32 flag;
+	u8 ht_enable;
+	u8 bss_type;
+	u8 auth_type;
+	u16 auth_timeout;
+	u8 power_mgmt_mode;
+	u16 short_retry_limit;
+	u16 long_retry_limit;
+	u16 frag_threshold;
+	u16 rts_threshold;
+	u16 preamble_type;
+	u8 short_slot_allowed;
+	u8 txop_prot_disabled;
+	u16 beacon_interval;
+	u16 dtim_period;
+	enum site_survey site_survey_enabled;
+	u16 site_survey_scan_time;
+	u8 scan_source;
+	u16 active_scan_time;
+	u16 passive_scan_time;
+	enum current_tx_rate curr_tx_rate;
+
+};
+
+enum cfg_param {
+	RETRY_SHORT		= BIT(0),
+	RETRY_LONG		= BIT(1),
+	FRAG_THRESHOLD		= BIT(2),
+	RTS_THRESHOLD		= BIT(3),
+	BSS_TYPE		= BIT(4),
+	AUTH_TYPE		= BIT(5),
+	AUTHEN_TIMEOUT		= BIT(6),
+	POWER_MANAGEMENT	= BIT(7),
+	PREAMBLE		= BIT(8),
+	SHORT_SLOT_ALLOWED	= BIT(9),
+	TXOP_PROT_DISABLE	= BIT(10),
+	BEACON_INTERVAL		= BIT(11),
+	DTIM_PERIOD		= BIT(12),
+	SITE_SURVEY		= BIT(13),
+	SITE_SURVEY_SCAN_TIME	= BIT(14),
+	ACTIVE_SCANTIME		= BIT(15),
+	PASSIVE_SCANTIME	= BIT(16),
+	CURRENT_TX_RATE		= BIT(17),
+	HT_ENABLE		= BIT(18),
+};
+
+struct found_net_info {
+	u8 bssid[6];
+	s8 rssi;
+};
+
+enum scan_event {
+	SCAN_EVENT_NETWORK_FOUND	= 0,
+	SCAN_EVENT_DONE			= 1,
+	SCAN_EVENT_ABORTED		= 2,
+	SCAN_EVENT_FORCE_32BIT		= 0xFFFFFFFF
+};
+
+enum conn_event {
+	CONN_DISCONN_EVENT_CONN_RESP		= 0,
+	CONN_DISCONN_EVENT_DISCONN_NOTIF	= 1,
+	CONN_DISCONN_EVENT_FORCE_32BIT		= 0xFFFFFFFF
+};
+
+enum KEY_TYPE {
+	WEP,
+	WPA_RX_GTK,
+	WPA_PTK,
+	PMKSA,
+};
+
+typedef void (*wilc_scan_result)(enum scan_event, struct network_info *,
+				 void *, void *);
+
+typedef void (*wilc_connect_result)(enum conn_event,
+				     struct connect_info *,
+				     u8,
+				     struct disconnect_info *,
+				     void *);
+
+typedef void (*wilc_remain_on_chan_expired)(void *, u32);
+typedef void (*wilc_remain_on_chan_ready)(void *);
+
+struct rcvd_net_info {
+	u8 *buffer;
+	u32 len;
+};
+
+struct hidden_net_info {
+	u8  *ssid;
+	u8 ssid_len;
+};
+
+struct hidden_network {
+	struct hidden_net_info *net_info;
+	u8 n_ssids;
+};
+
+struct user_scan_req {
+	wilc_scan_result scan_result;
+	void *arg;
+	u32 ch_cnt;
+	struct found_net_info net_info[MAX_NUM_SCANNED_NETWORKS];
+};
+
+struct user_conn_req {
+	u8 *bssid;
+	u8 *ssid;
+	u8 security;
+	enum authtype auth_type;
+	size_t ssid_len;
+	u8 *ies;
+	size_t ies_len;
+	wilc_connect_result conn_result;
+	bool ht_capable;
+	void *arg;
+};
+
+struct drv_handler {
+	u32 handler;
+	u8 mode;
+	u8 name;
+};
+
+struct op_mode {
+	u32 mode;
+};
+
+struct get_mac_addr {
+	u8 *mac_addr;
+};
+
+struct ba_session_info {
+	u8 bssid[ETH_ALEN];
+	u8 tid;
+	u16 buf_size;
+	u16 time_out;
+};
+
+struct remain_ch {
+	u16 ch;
+	u32 duration;
+	wilc_remain_on_chan_expired expired;
+	wilc_remain_on_chan_ready ready;
+	void *arg;
+	u32 id;
+};
+
+struct reg_frame {
+	bool reg;
+	u16 frame_type;
+	u8 reg_id;
+};
+
+struct wilc;
+struct host_if_drv {
+	struct user_scan_req usr_scan_req;
+	struct user_conn_req usr_conn_req;
+	struct remain_ch remain_on_ch;
+	u8 remain_on_ch_pending;
+	u64 p2p_timeout;
+	u8 p2p_connect;
+
+	enum host_if_state hif_state;
+
+	u8 assoc_bssid[ETH_ALEN];
+	struct cfg_param_attr cfg_values;
+	/*lock to protect concurrent setting of cfg params*/
+	struct mutex cfg_values_lock;
+
+	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;
+	int driver_handler_id;
+	u8 assoc_resp[MAX_ASSOC_RESP_FRAME_SIZE];
+};
+
+struct add_sta_param {
+	u8 bssid[ETH_ALEN];
+	u16 aid;
+	u8 rates_len;
+	const u8 *rates;
+	bool ht_supported;
+	struct ieee80211_ht_cap ht_capa;
+	u16 flags_mask;
+	u16 flags_set;
+};
+
+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 host_if_pmkid_attr *pmkid);
+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 *ssid,
+		      size_t ssid_len, const u8 *ies, size_t ies_len,
+		      wilc_connect_result connect_result, void *user_arg,
+		      u8 security, enum authtype auth_type,
+		      u8 channel, void *join_params);
+int wilc_disconnect(struct wilc_vif *vif, u16 reason_code);
+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, const u8 *ies,
+	      size_t ies_len, wilc_scan_result scan_result, void *user_arg,
+	      struct hidden_network *hidden_network);
+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,
+		    u32 head_len, u8 *head, u32 tail_len, u8 *tail);
+int wilc_del_beacon(struct wilc_vif *vif);
+int wilc_add_station(struct wilc_vif *vif, struct add_sta_param *sta_param);
+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,
+		      struct add_sta_param *sta_param);
+int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
+int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled, u32 count,
+				u8 *mc_list);
+int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id,
+			   u32 duration, u16 chan,
+			   wilc_remain_on_chan_expired expired,
+			   wilc_remain_on_chan_ready ready,
+			   void *user_arg);
+int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id);
+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, bool is_sync);
+int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode);
+int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats,
+			bool is_sync);
+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);
+
+#endif