All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ajay Singh <ajay.kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <kvalo@codeaurora.org>, <gregkh@linuxfoundation.org>,
	<ganesh.krishna@microchip.com>, <aditya.shankar@microchip.com>,
	<venkateswara.kaja@microchip.com>, <claudiu.beznea@microchip.com>,
	<adham.abozaeid@microchip.com>,
	Ajay Singh <ajay.kathat@microchip.com>
Subject: [PATCH 10/19] wilc: add wilc_wfi_netdevice.h
Date: Wed, 26 Sep 2018 15:55:16 +0530	[thread overview]
Message-ID: <1537957525-11467-11-git-send-email-ajay.kathat@microchip.com> (raw)
In-Reply-To: <1537957525-11467-1-git-send-email-ajay.kathat@microchip.com>

Moved '/driver/staging/wilc1000/wilc_wfi_netdevice.h' to
'drivers/net/wireless/microchip/wilc/'.

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

diff --git a/drivers/net/wireless/microchip/wilc/wilc_wfi_netdevice.h b/drivers/net/wireless/microchip/wilc/wilc_wfi_netdevice.h
new file mode 100644
index 0000000..4f05a16
--- /dev/null
+++ b/drivers/net/wireless/microchip/wilc/wilc_wfi_netdevice.h
@@ -0,0 +1,230 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries.
+ * All rights reserved.
+ */
+
+#ifndef WILC_WFI_NETDEVICE
+#define WILC_WFI_NETDEVICE
+
+#include <linux/tcp.h>
+#include <linux/ieee80211.h>
+#include <net/cfg80211.h>
+#include <net/ieee80211_radiotap.h>
+#include <linux/if_arp.h>
+#include <linux/gpio/consumer.h>
+
+#include "host_interface.h"
+#include "wilc_wlan.h"
+#include "wilc_wlan_cfg.h"
+
+#define FLOW_CONTROL_LOWER_THRESHOLD		128
+#define FLOW_CONTROL_UPPER_THRESHOLD		256
+
+#define WILC_MAX_NUM_PMKIDS			16
+#define PMKID_LEN				16
+#define PMKID_FOUND				1
+#define NUM_STA_ASSOCIATED			8
+
+#define NUM_REG_FRAME				2
+
+#define TCP_ACK_FILTER_LINK_SPEED_THRESH	54
+#define DEFAULT_LINK_SPEED			72
+
+#define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
+
+struct wilc_wfi_stats {
+	unsigned long rx_packets;
+	unsigned long tx_packets;
+	unsigned long rx_bytes;
+	unsigned long tx_bytes;
+	u64 rx_time;
+	u64 tx_time;
+
+};
+
+struct wilc_wfi_key {
+	u8 *key;
+	u8 *seq;
+	int key_len;
+	int seq_len;
+	u32 cipher;
+};
+
+struct wilc_wfi_wep_key {
+	u8 *key;
+	u8 key_len;
+	u8 key_idx;
+};
+
+struct sta_info {
+	u8 sta_associated_bss[MAX_NUM_STA][ETH_ALEN];
+};
+
+/*Parameters needed for host interface for  remaining on channel*/
+struct wilc_wfi_p2p_listen_params {
+	struct ieee80211_channel *listen_ch;
+	u32 listen_duration;
+	u64 listen_cookie;
+	u32 listen_session_id;
+};
+
+struct wilc_p2p_var {
+	u8 local_random;
+	u8 recv_random;
+	bool is_wilc_ie;
+};
+
+struct wilc_priv {
+	struct wireless_dev *wdev;
+	struct cfg80211_scan_request *scan_req;
+
+	struct wilc_wfi_p2p_listen_params remain_on_ch_params;
+	u64 tx_cookie;
+
+	bool cfg_scanning;
+	u32 rcvd_ch_cnt;
+
+	u8 associated_bss[ETH_ALEN];
+	struct sta_info assoc_stainfo;
+	struct sk_buff *skb;
+	struct net_device *dev;
+	struct host_if_drv *hif_drv;
+	struct host_if_pmkid_attr pmkid_list;
+	u8 wep_key[4][WLAN_KEY_LEN_WEP104];
+	u8 wep_key_len[4];
+	/* The real interface that the monitor is on */
+	struct net_device *real_ndev;
+	struct wilc_wfi_key *wilc_gtk[MAX_NUM_STA];
+	struct wilc_wfi_key *wilc_ptk[MAX_NUM_STA];
+	u8 wilc_groupkey;
+	/* mutexes */
+	struct mutex scan_req_lock;
+	bool p2p_listen_state;
+	struct timer_list aging_timer;
+	struct network_info scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
+	int scanned_cnt;
+	struct wilc_p2p_var p2p;
+};
+
+struct frame_reg {
+	u16 type;
+	bool reg;
+};
+
+#define MAX_TCP_SESSION                25
+#define MAX_PENDING_ACKS               256
+
+struct ack_session_info {
+	u32 seq_num;
+	u32 bigger_ack_num;
+	u16 src_port;
+	u16 dst_port;
+	u16 status;
+};
+
+struct pending_acks {
+	u32 ack_num;
+	u32 session_index;
+	struct txq_entry_t  *txqe;
+};
+
+struct tcp_ack_filter {
+	struct ack_session_info ack_session_info[2 * MAX_TCP_SESSION];
+	struct pending_acks pending_acks[MAX_PENDING_ACKS];
+	u32 pending_base;
+	u32 tcp_session;
+	u32 pending_acks_idx;
+	bool enabled;
+};
+
+struct wilc_vif {
+	u8 idx;
+	u8 iftype;
+	int monitor_flag;
+	int mac_opened;
+	struct frame_reg frame_reg[NUM_REG_FRAME];
+	struct net_device_stats netstats;
+	struct wilc *wilc;
+	u8 src_addr[ETH_ALEN];
+	u8 bssid[ETH_ALEN];
+	struct host_if_drv *hif_drv;
+	struct net_device *ndev;
+	u8 mode;
+	u8 ifc_id;
+	struct timer_list during_ip_timer;
+	bool obtaining_ip;
+	struct timer_list periodic_rssi;
+	struct rf_info periodic_stat;
+	struct tcp_ack_filter ack_filter;
+	bool connecting;
+};
+
+struct wilc {
+	const struct wilc_hif_func *hif_func;
+	int io_type;
+	s8 mac_status;
+	struct gpio_desc *gpio_irq;
+	bool initialized;
+	int dev_irq_num;
+	int close;
+	u8 vif_num;
+	struct wilc_vif *vif[NUM_CONCURRENT_IFC];
+	u8 open_ifcs;
+	/*protect head of transmit queue*/
+	struct mutex txq_add_to_head_cs;
+	/*protect txq_entry_t transmit queue*/
+	spinlock_t txq_spinlock;
+	/*protect rxq_entry_t receiver queue*/
+	struct mutex rxq_cs;
+	/* lock to protect hif access */
+	struct mutex hif_cs;
+
+	struct completion cfg_event;
+	struct completion sync_event;
+	struct completion txq_event;
+	struct completion txq_thread_started;
+
+	struct task_struct *txq_thread;
+
+	int quit;
+	int cfg_frame_in_use;
+	struct wilc_cfg_frame cfg_frame;
+	u32 cfg_frame_offset;
+	int cfg_seq_no;
+
+	u8 *rx_buffer;
+	u32 rx_buffer_offset;
+	u8 *tx_buffer;
+
+	struct txq_entry_t txq_head;
+	int txq_entries;
+
+	struct rxq_entry_t rxq_head;
+
+	const struct firmware *firmware;
+
+	struct device *dev;
+	bool suspend_event;
+
+	bool enable_ps;
+	int clients_count;
+	struct workqueue_struct *hif_workqueue;
+	enum chip_ps_states chip_ps_state;
+	struct wilc_cfg cfg;
+	void *bus_data;
+};
+
+struct wilc_wfi_mon_priv {
+	struct net_device *real_ndev;
+};
+
+void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset);
+void wilc_mac_indicate(struct wilc *wilc);
+void wilc_netdev_cleanup(struct wilc *wilc);
+int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
+		     const struct wilc_hif_func *ops);
+void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
+void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode);
+
+#endif
-- 
2.7.4


  parent reply	other threads:[~2018-09-26 10:26 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 10:25 [RFC 00/19] wilc: added driver for wilc module Ajay Singh
2018-09-26 10:25 ` [PATCH 01/19] wilc: add coreconfigurator.h Ajay Singh
2018-09-26 10:25 ` [PATCH 02/19] wilc: add coreconfigurator.c Ajay Singh
2018-10-08 14:16   ` Johannes Berg
2018-10-09  9:42     ` Ajay Singh
2018-10-09 10:05       ` Johannes Berg
2018-09-26 10:25 ` [PATCH 03/19] wilc: add host_interface.h Ajay Singh
2018-10-08 14:20   ` Johannes Berg
2018-10-09 10:34     ` Ajay Singh
2018-10-09 10:36       ` Johannes Berg
2018-10-09 11:44         ` Ajay Singh
2018-10-09 11:46           ` Johannes Berg
2018-10-09 12:18             ` Ajay Singh
2018-10-09 18:36               ` Adham.Abozaeid
2018-10-09 19:14                 ` Johannes Berg
2018-10-09 20:01                   ` Adham.Abozaeid
2018-10-09 20:02                     ` Johannes Berg
2018-10-09 20:06                       ` Adham.Abozaeid
2018-10-29 14:56           ` Kalle Valo
2018-10-30  3:20             ` Ajay.Kathat
2018-09-26 10:25 ` [PATCH 04/19] wilc: add host_interface.c Ajay Singh
2018-10-08 14:31   ` Johannes Berg
2018-10-10 20:06     ` Adham.Abozaeid
2018-10-11  7:01       ` Johannes Berg
2018-10-12 22:08         ` Adham.Abozaeid
2018-10-18  8:23           ` Johannes Berg
2018-10-18 18:30             ` Adham.Abozaeid
2018-10-19  7:02               ` Johannes Berg
2018-10-19 20:53                 ` Adham.Abozaeid
2018-10-29 20:10                   ` Johannes Berg
2018-10-29 21:32                     ` Adham.Abozaeid
2018-10-29 21:33                       ` Johannes Berg
2018-10-11  6:57     ` Ajay Singh
2018-10-10 20:14   ` Johannes Berg
2018-10-12 21:55     ` Adham.Abozaeid
2018-10-18  8:23       ` Johannes Berg
2018-09-26 10:25 ` [PATCH 05/19] wilc: add wilc_wlan_if.h Ajay Singh
2018-10-08 14:33   ` Johannes Berg
2018-10-11  6:59     ` Ajay Singh
2018-09-26 10:25 ` [PATCH 06/19] wilc: add wilc_wlan_cfg.h Ajay Singh
2018-09-26 10:25 ` [PATCH 07/19] wilc: add wilc_wlan_cfg.c Ajay Singh
2018-09-26 10:25 ` [PATCH 08/19] wilc: add wilc_wlan.h Ajay Singh
2018-09-26 10:25 ` [PATCH 09/19] wilc: add wilc_wlan.c Ajay Singh
2018-09-26 10:25 ` Ajay Singh [this message]
2018-09-26 10:25 ` [PATCH 11/19] wilc: add wilc_wfi_cfgoperations.h Ajay Singh
2018-09-26 10:25 ` [PATCH 12/19] wilc: add wilc_wfi_cfgoperations.c Ajay Singh
2018-10-08 14:57   ` Johannes Berg
2018-10-09  4:23     ` Adham.Abozaeid
2018-10-09  7:55       ` Johannes Berg
2018-10-09 17:15         ` Adham.Abozaeid
2018-10-19 21:47           ` Adham.Abozaeid
2018-10-29 20:11             ` Johannes Berg
2018-10-29 21:43               ` Adham.Abozaeid
2018-09-26 10:25 ` [PATCH 13/19] wilc: add linux_wlan.c Ajay Singh
2018-10-08 14:41   ` Johannes Berg
2018-10-11  7:00     ` Ajay Singh
2018-10-11  7:03       ` Johannes Berg
2018-10-11  7:26         ` Ajay Singh
2018-09-26 10:25 ` [PATCH 14/19] wilc: add linux_mon.c Ajay Singh
2018-10-08 14:44   ` Johannes Berg
2018-10-11  7:12     ` Ajay Singh
2018-10-11  7:15       ` Johannes Berg
2018-09-26 10:25 ` [PATCH 15/19] wilc: add wilc_spi.c Ajay Singh
2018-09-26 10:25 ` [PATCH 16/19] wilc: add wilc_sdio.c Ajay Singh
2018-09-26 10:25 ` [PATCH 17/19] wilc: updated DT device binding for wilc device Ajay Singh
2018-09-26 10:25 ` [PATCH 18/19] wilc: add Makefile and Kconfig files for wilc compilation Ajay Singh
2018-09-26 10:25 ` [PATCH 19/19] wilc: added wilc module compilation in wireless Makefile & Kconfig Ajay Singh
2018-10-06 12:45 ` [RFC 00/19] wilc: added driver for wilc module Kalle Valo
2018-10-08  5:17   ` Ajay Singh
2018-10-08  7:38     ` Kalle Valo
2018-10-08 18:34       ` Adham.Abozaeid
2018-11-15 14:11         ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1537957525-11467-11-git-send-email-ajay.kathat@microchip.com \
    --to=ajay.kathat@microchip.com \
    --cc=adham.abozaeid@microchip.com \
    --cc=aditya.shankar@microchip.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=ganesh.krishna@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=venkateswara.kaja@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.