2 ******************************************************************************
6 * Copyright (C) ESWIN 2015-2020
8 ******************************************************************************
13 #include <linux/workqueue.h>
17 /// The buffer can be forwarded to the networking stack
18 RX_STAT_FORWARD = 1 << 0,
19 /// A new buffer has to be allocated
20 RX_STAT_ALLOC = 1 << 1,
21 /// The buffer has to be deleted
22 RX_STAT_DELETE = 1 << 2,
23 /// The length of the buffer has to be updated
24 RX_STAT_LEN_UPDATE = 1 << 3,
25 /// The length in the Ethernet header has to be updated
26 RX_STAT_ETH_LEN_UPDATE = 1 << 4,
28 RX_STAT_COPY = 1 << 5,
29 /// Spurious frame (inform upper layer and discard)
30 RX_STAT_SPURIOUS = 1 << 6,
31 /// packet for monitor interface
32 RX_STAT_MONITOR = 1 << 7,
35 #if defined(CONFIG_ECRNX_ESWIN_USB)
44 * Decryption status subfields.
49 #define _ASOCREQ_IE_OFFSET_ 4 /* excluding wlan_hdr */
50 #define _REASOCREQ_IE_OFFSET_ 10
51 #define STATION_INFO_ASSOC_REQ_IES 0
52 #define WLAN_HDR_A3_LEN 24
53 #define get_addr2_ptr(pbuf) ((unsigned char *)((unsigned int)(pbuf) + 10))
55 /* keep it same with the FW */
56 #define RX_CNTRL_REORD_WIN_SIZE 42
57 #ifdef CONFIG_ECRNX_MON_DATA
58 #define RX_MACHDR_BACKUP_LEN 64
59 /// MAC header backup descriptor
62 /// Length of the buffer
64 /// Buffer containing mac header, LLC and SNAP
65 u8 buffer[RX_MACHDR_BACKUP_LEN];
71 struct hw_vect hwvect;
73 /** PHY channel information */
74 struct phy_channel_info_desc phy_info;
77 u32 flags_is_amsdu : 1;
78 u32 flags_is_80211_mpdu: 1;
79 u32 flags_is_4addr : 1;
80 u32 flags_new_peer : 1;
81 u32 flags_user_prio : 3;
83 u32 flags_vif_idx : 8; // 0xFF if invalid VIF index
84 u32 flags_sta_idx : 8; // 0xFF if invalid STA index
85 u32 flags_dst_idx : 8; // 0xFF if unknown destination STA
86 #ifdef CONFIG_ECRNX_MON_DATA
87 /// MAC header backup descriptor (used only for MSDU when there is a monitor and a data interface)
88 struct mon_machdrdesc mac_hdr_backup;
90 /** Pattern indicating if the buffer is available for the driver */
94 struct ecrnx_defer_rx {
95 struct sk_buff_head sk_list;
96 struct work_struct work;
100 * struct ecrnx_defer_rx_cb - Control buffer for deferred buffers
102 * @vif: VIF that received the buffer
104 struct ecrnx_defer_rx_cb {
105 struct ecrnx_vif *vif;
108 u8 ecrnx_unsup_rx_vec_ind(void *pthis, void *hostid);
109 u8 ecrnx_rxdataind(void *pthis, void *hostid);
110 void ecrnx_rx_deferred(struct work_struct *ws);
111 void ecrnx_rx_defer_skb(struct ecrnx_hw *ecrnx_hw, struct ecrnx_vif *ecrnx_vif,
112 struct sk_buff *skb);
113 #ifdef CONFIG_ECRNX_ESWIN_SDIO
114 int ecrnx_rx_callback(void *priv, struct sk_buff *skb);
115 #elif defined(CONFIG_ECRNX_ESWIN_USB)
116 int ecrnx_rx_callback(void *priv, struct sk_buff *skb, uint8_t endpoint);
119 void ecrnx_rx_reord_deinit(struct ecrnx_hw *ecrnx_hw);
120 void ecrnx_rx_reord_init(struct ecrnx_hw *ecrnx_hw);
121 void ecrnx_rx_reord_sta_init(struct ecrnx_hw* ecrnx_hw, struct ecrnx_vif *ecrnx_vif, u8 sta_idx);
122 void ecrnx_rx_reord_sta_deinit(struct ecrnx_hw* ecrnx_hw, u8 sta_idx, bool is_del);
125 #endif /* _ECRNX_RX_H_ */