Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
339754f
Documentation
LICENSES
arch
block
certs
crypto
drivers
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
char
clk
clocksource
connector
counter
cpufreq
cpuidle
crypto
dax
dca
devfreq
dio
dma-buf
dma
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu
greybus
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
ide
idle
iio
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net
appletalk
arcnet
bonding
caif
can
dsa
ethernet
fddi
fjes
hamradio
hippi
hyperv
ieee802154
ipa
ipvlan
mdio
netdevsim
pcs
phy
plip
ppp
slip
team
usb
vmxnet3
wan
wimax
wireguard
wireless
admtek
ath
atmel
broadcom
cisco
intel
intersil
marvell
mediatek
microchip
wilc1000
Kconfig
Makefile
cfg80211.c
cfg80211.h
fw.h
hif.c
hif.h
mon.c
netdev.c
netdev.h
sdio.c
spi.c
wlan.c
wlan.h
wlan_cfg.c
wlan_cfg.h
wlan_if.h
Kconfig
Makefile
quantenna
ralink
realtek
rsi
st
ti
zydas
Kconfig
Makefile
mac80211_hwsim.c
mac80211_hwsim.h
ray_cs.c
ray_cs.h
rayctl.h
rndis_wlan.c
virt_wifi.c
wl3501.h
wl3501_cs.c
xen-netback
Kconfig
LICENSE.SRC
Makefile
Space.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c
macsec.c
macvlan.c
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c
virtio_net.c
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
oprofile
parisc
parport
pci
pcmcia
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sfi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
uio
usb
vdpa
vfio
vhost
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
net
/
wireless
/
microchip
/
wilc1000
/
netdev.h
Copy path
Blame
Blame
Latest commit
History
History
296 lines (247 loc) · 6.36 KB
Breadcrumbs
linux
/
drivers
/
net
/
wireless
/
microchip
/
wilc1000
/
netdev.h
Top
File metadata and controls
Code
Blame
296 lines (247 loc) · 6.36 KB
Raw
/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2012 - 2018 Microchip Technology Inc., and its subsidiaries. * All rights reserved. */ #ifndef WILC_NETDEV_H #define WILC_NETDEV_H #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 "hif.h" #include "wlan.h" #include "wlan_cfg.h" #define FLOW_CONTROL_LOWER_THRESHOLD 128 #define FLOW_CONTROL_UPPER_THRESHOLD 256 #define PMKID_FOUND 1 #define NUM_STA_ASSOCIATED 8 #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54 #define DEFAULT_LINK_SPEED 72 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[WILC_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; }; static const u32 wilc_cipher_suites[] = { WLAN_CIPHER_SUITE_WEP40, WLAN_CIPHER_SUITE_WEP104, WLAN_CIPHER_SUITE_TKIP, WLAN_CIPHER_SUITE_CCMP, WLAN_CIPHER_SUITE_AES_CMAC }; #define CHAN2G(_channel, _freq, _flags) { \ .band = NL80211_BAND_2GHZ, \ .center_freq = (_freq), \ .hw_value = (_channel), \ .flags = (_flags), \ .max_antenna_gain = 0, \ .max_power = 30, \ } static const struct ieee80211_channel wilc_2ghz_channels[] = { CHAN2G(1, 2412, 0), CHAN2G(2, 2417, 0), CHAN2G(3, 2422, 0), CHAN2G(4, 2427, 0), CHAN2G(5, 2432, 0), CHAN2G(6, 2437, 0), CHAN2G(7, 2442, 0), CHAN2G(8, 2447, 0), CHAN2G(9, 2452, 0), CHAN2G(10, 2457, 0), CHAN2G(11, 2462, 0), CHAN2G(12, 2467, 0), CHAN2G(13, 2472, 0), CHAN2G(14, 2484, 0) }; #define RATETAB_ENT(_rate, _hw_value, _flags) { \ .bitrate = (_rate), \ .hw_value = (_hw_value), \ .flags = (_flags), \ } static struct ieee80211_rate wilc_bitrates[] = { RATETAB_ENT(10, 0, 0), RATETAB_ENT(20, 1, 0), RATETAB_ENT(55, 2, 0), RATETAB_ENT(110, 3, 0), RATETAB_ENT(60, 9, 0), RATETAB_ENT(90, 6, 0), RATETAB_ENT(120, 7, 0), RATETAB_ENT(180, 8, 0), RATETAB_ENT(240, 9, 0), RATETAB_ENT(360, 10, 0), RATETAB_ENT(480, 11, 0), RATETAB_ENT(540, 12, 0) }; 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; 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 wilc_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[WILC_MAX_NUM_STA]; struct wilc_wfi_key *wilc_ptk[WILC_MAX_NUM_STA]; u8 wilc_groupkey; /* mutexes */ struct mutex scan_req_lock; bool p2p_listen_state; int scanned_cnt; u64 inc_roc_cookie; }; #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; u32 mgmt_reg_stypes; struct net_device_stats netstats; struct wilc *wilc; u8 bssid[ETH_ALEN]; struct host_if_drv *hif_drv; struct net_device *ndev; u8 mode; struct timer_list during_ip_timer; struct timer_list periodic_rssi; struct rf_info periodic_stat; struct tcp_ack_filter ack_filter; bool connecting; struct wilc_priv priv; struct list_head list; struct cfg80211_bss *bss; }; struct wilc_tx_queue_status { u8 buffer[AC_BUFFER_SIZE]; u16 end_index; u16 cnt[NQUEUES]; u16 sum; bool initialized; }; struct wilc { struct wiphy *wiphy; const struct wilc_hif_func *hif_func; int io_type; s8 mac_status; struct clk *rtc_clk; bool initialized; int dev_irq_num; int close; u8 vif_num; struct list_head vif_list; /* protect vif list */ struct mutex vif_mutex; struct srcu_struct srcu; 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; /* lock to protect issue of wid command to firmware */ struct mutex cfg_cmd_lock; struct wilc_cfg_frame cfg_frame; u32 cfg_frame_offset; u8 cfg_seq_no; u8 *rx_buffer; u32 rx_buffer_offset; u8 *tx_buffer; struct txq_handle txq[NQUEUES]; int txq_entries; struct wilc_tx_queue_status tx_q_limit; struct rxq_entry_t rxq_head; const struct firmware *firmware; struct device *dev; bool suspend_event; int clients_count; struct workqueue_struct *hif_workqueue; enum chip_ps_states chip_ps_state; struct wilc_cfg cfg; void *bus_data; struct net_device *monitor_dev; /* deinit lock */ struct mutex deinit_lock; u8 sta_ch; u8 op_ch; struct ieee80211_channel channels[ARRAY_SIZE(wilc_2ghz_channels)]; struct ieee80211_rate bitrates[ARRAY_SIZE(wilc_bitrates)]; struct ieee80211_supported_band band; u32 cipher_suites[ARRAY_SIZE(wilc_cipher_suites)]; }; struct wilc_wfi_mon_priv { struct net_device *real_ndev; }; void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset); void wilc_mac_indicate(struct wilc *wilc); void wilc_netdev_cleanup(struct wilc *wilc); 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); struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name, int vif_type, enum nl80211_iftype type, bool rtnl_locked); #endif
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
You can’t perform that action at this time.