xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/ralink/rt2x00/rt2x00lib.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun 	Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
4*4882a593Smuzhiyun 	Copyright (C) 2004 - 2009 Gertjan van Wingerde <gwingerde@gmail.com>
5*4882a593Smuzhiyun 	<http://rt2x00.serialmonkey.com>
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun  */
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun /*
10*4882a593Smuzhiyun 	Module: rt2x00lib
11*4882a593Smuzhiyun 	Abstract: Data structures and definitions for the rt2x00lib module.
12*4882a593Smuzhiyun  */
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun #ifndef RT2X00LIB_H
15*4882a593Smuzhiyun #define RT2X00LIB_H
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun /*
18*4882a593Smuzhiyun  * Interval defines
19*4882a593Smuzhiyun  */
20*4882a593Smuzhiyun #define WATCHDOG_INTERVAL	round_jiffies_relative(HZ)
21*4882a593Smuzhiyun #define LINK_TUNE_SECONDS	1
22*4882a593Smuzhiyun #define LINK_TUNE_INTERVAL	round_jiffies_relative(LINK_TUNE_SECONDS * HZ)
23*4882a593Smuzhiyun #define AGC_SECONDS		4
24*4882a593Smuzhiyun #define VCO_SECONDS		10
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun /*
27*4882a593Smuzhiyun  * rt2x00_rate: Per rate device information
28*4882a593Smuzhiyun  */
29*4882a593Smuzhiyun struct rt2x00_rate {
30*4882a593Smuzhiyun 	unsigned short flags;
31*4882a593Smuzhiyun #define DEV_RATE_CCK			0x0001
32*4882a593Smuzhiyun #define DEV_RATE_OFDM			0x0002
33*4882a593Smuzhiyun #define DEV_RATE_SHORT_PREAMBLE		0x0004
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun 	unsigned short bitrate; /* In 100kbit/s */
36*4882a593Smuzhiyun 	unsigned short ratemask;
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun 	unsigned short plcp;
39*4882a593Smuzhiyun 	unsigned short mcs;
40*4882a593Smuzhiyun };
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun extern const struct rt2x00_rate rt2x00_supported_rates[12];
43*4882a593Smuzhiyun 
rt2x00_get_rate(const u16 hw_value)44*4882a593Smuzhiyun static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value)
45*4882a593Smuzhiyun {
46*4882a593Smuzhiyun 	return &rt2x00_supported_rates[hw_value & 0xff];
47*4882a593Smuzhiyun }
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun #define RATE_MCS(__mode, __mcs) \
50*4882a593Smuzhiyun 	((((__mode) & 0x00ff) << 8) | ((__mcs) & 0x00ff))
51*4882a593Smuzhiyun 
rt2x00_get_rate_mcs(const u16 mcs_value)52*4882a593Smuzhiyun static inline int rt2x00_get_rate_mcs(const u16 mcs_value)
53*4882a593Smuzhiyun {
54*4882a593Smuzhiyun 	return (mcs_value & 0x00ff);
55*4882a593Smuzhiyun }
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun /*
58*4882a593Smuzhiyun  * Radio control handlers.
59*4882a593Smuzhiyun  */
60*4882a593Smuzhiyun int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);
61*4882a593Smuzhiyun void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev);
62*4882a593Smuzhiyun 
63*4882a593Smuzhiyun /*
64*4882a593Smuzhiyun  * Initialization handlers.
65*4882a593Smuzhiyun  */
66*4882a593Smuzhiyun int rt2x00lib_start(struct rt2x00_dev *rt2x00dev);
67*4882a593Smuzhiyun void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev);
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun /*
70*4882a593Smuzhiyun  * Configuration handlers.
71*4882a593Smuzhiyun  */
72*4882a593Smuzhiyun void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
73*4882a593Smuzhiyun 			   struct rt2x00_intf *intf,
74*4882a593Smuzhiyun 			   enum nl80211_iftype type,
75*4882a593Smuzhiyun 			   const u8 *mac, const u8 *bssid);
76*4882a593Smuzhiyun void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev,
77*4882a593Smuzhiyun 			  struct rt2x00_intf *intf,
78*4882a593Smuzhiyun 			  struct ieee80211_bss_conf *conf,
79*4882a593Smuzhiyun 			  u32 changed);
80*4882a593Smuzhiyun void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
81*4882a593Smuzhiyun 			      struct antenna_setup ant);
82*4882a593Smuzhiyun void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
83*4882a593Smuzhiyun 		      struct ieee80211_conf *conf,
84*4882a593Smuzhiyun 		      const unsigned int changed_flags);
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun /**
87*4882a593Smuzhiyun  * DOC: Queue handlers
88*4882a593Smuzhiyun  */
89*4882a593Smuzhiyun 
90*4882a593Smuzhiyun /**
91*4882a593Smuzhiyun  * rt2x00queue_alloc_rxskb - allocate a skb for RX purposes.
92*4882a593Smuzhiyun  * @entry: The entry for which the skb will be applicable.
93*4882a593Smuzhiyun  */
94*4882a593Smuzhiyun struct sk_buff *rt2x00queue_alloc_rxskb(struct queue_entry *entry, gfp_t gfp);
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun /**
97*4882a593Smuzhiyun  * rt2x00queue_free_skb - free a skb
98*4882a593Smuzhiyun  * @entry: The entry for which the skb will be applicable.
99*4882a593Smuzhiyun  */
100*4882a593Smuzhiyun void rt2x00queue_free_skb(struct queue_entry *entry);
101*4882a593Smuzhiyun 
102*4882a593Smuzhiyun /**
103*4882a593Smuzhiyun  * rt2x00queue_align_frame - Align 802.11 frame to 4-byte boundary
104*4882a593Smuzhiyun  * @skb: The skb to align
105*4882a593Smuzhiyun  *
106*4882a593Smuzhiyun  * Align the start of the 802.11 frame to a 4-byte boundary, this could
107*4882a593Smuzhiyun  * mean the payload is not aligned properly though.
108*4882a593Smuzhiyun  */
109*4882a593Smuzhiyun void rt2x00queue_align_frame(struct sk_buff *skb);
110*4882a593Smuzhiyun 
111*4882a593Smuzhiyun /**
112*4882a593Smuzhiyun  * rt2x00queue_insert_l2pad - Align 802.11 header & payload to 4-byte boundary
113*4882a593Smuzhiyun  * @skb: The skb to align
114*4882a593Smuzhiyun  * @header_length: Length of 802.11 header
115*4882a593Smuzhiyun  *
116*4882a593Smuzhiyun  * Apply L2 padding to align both header and payload to 4-byte boundary
117*4882a593Smuzhiyun  */
118*4882a593Smuzhiyun void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length);
119*4882a593Smuzhiyun 
120*4882a593Smuzhiyun /**
121*4882a593Smuzhiyun  * rt2x00queue_insert_l2pad - Remove L2 padding from 802.11 frame
122*4882a593Smuzhiyun  * @skb: The skb to align
123*4882a593Smuzhiyun  * @header_length: Length of 802.11 header
124*4882a593Smuzhiyun  *
125*4882a593Smuzhiyun  * Remove L2 padding used to align both header and payload to 4-byte boundary,
126*4882a593Smuzhiyun  * by removing the L2 padding the header will no longer be 4-byte aligned.
127*4882a593Smuzhiyun  */
128*4882a593Smuzhiyun void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length);
129*4882a593Smuzhiyun 
130*4882a593Smuzhiyun /**
131*4882a593Smuzhiyun  * rt2x00queue_write_tx_frame - Write TX frame to hardware
132*4882a593Smuzhiyun  * @queue: Queue over which the frame should be send
133*4882a593Smuzhiyun  * @skb: The skb to send
134*4882a593Smuzhiyun  * @local: frame is not from mac80211
135*4882a593Smuzhiyun  */
136*4882a593Smuzhiyun int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
137*4882a593Smuzhiyun 			       struct ieee80211_sta *sta, bool local);
138*4882a593Smuzhiyun 
139*4882a593Smuzhiyun /**
140*4882a593Smuzhiyun  * rt2x00queue_update_beacon - Send new beacon from mac80211
141*4882a593Smuzhiyun  *	to hardware. Handles locking by itself (mutex).
142*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
143*4882a593Smuzhiyun  * @vif: Interface for which the beacon should be updated.
144*4882a593Smuzhiyun  */
145*4882a593Smuzhiyun int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
146*4882a593Smuzhiyun 			      struct ieee80211_vif *vif);
147*4882a593Smuzhiyun 
148*4882a593Smuzhiyun /**
149*4882a593Smuzhiyun  * rt2x00queue_update_beacon_locked - Send new beacon from mac80211
150*4882a593Smuzhiyun  *	to hardware. Caller needs to ensure locking.
151*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
152*4882a593Smuzhiyun  * @vif: Interface for which the beacon should be updated.
153*4882a593Smuzhiyun  */
154*4882a593Smuzhiyun int rt2x00queue_update_beacon_locked(struct rt2x00_dev *rt2x00dev,
155*4882a593Smuzhiyun 				     struct ieee80211_vif *vif);
156*4882a593Smuzhiyun 
157*4882a593Smuzhiyun /**
158*4882a593Smuzhiyun  * rt2x00queue_clear_beacon - Clear beacon in hardware
159*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
160*4882a593Smuzhiyun  * @vif: Interface for which the beacon should be updated.
161*4882a593Smuzhiyun  */
162*4882a593Smuzhiyun int rt2x00queue_clear_beacon(struct rt2x00_dev *rt2x00dev,
163*4882a593Smuzhiyun 			     struct ieee80211_vif *vif);
164*4882a593Smuzhiyun 
165*4882a593Smuzhiyun /**
166*4882a593Smuzhiyun  * rt2x00queue_index_inc - Index incrementation function
167*4882a593Smuzhiyun  * @entry: Queue entry (&struct queue_entry) to perform the action on.
168*4882a593Smuzhiyun  * @index: Index type (&enum queue_index) to perform the action on.
169*4882a593Smuzhiyun  *
170*4882a593Smuzhiyun  * This function will increase the requested index on the entry's queue,
171*4882a593Smuzhiyun  * it will grab the appropriate locks and handle queue overflow events by
172*4882a593Smuzhiyun  * resetting the index to the start of the queue.
173*4882a593Smuzhiyun  */
174*4882a593Smuzhiyun void rt2x00queue_index_inc(struct queue_entry *entry, enum queue_index index);
175*4882a593Smuzhiyun 
176*4882a593Smuzhiyun /**
177*4882a593Smuzhiyun  * rt2x00queue_init_queues - Initialize all data queues
178*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
179*4882a593Smuzhiyun  *
180*4882a593Smuzhiyun  * This function will loop through all available queues to clear all
181*4882a593Smuzhiyun  * index numbers and set the queue entry to the correct initialization
182*4882a593Smuzhiyun  * state.
183*4882a593Smuzhiyun  */
184*4882a593Smuzhiyun void rt2x00queue_init_queues(struct rt2x00_dev *rt2x00dev);
185*4882a593Smuzhiyun 
186*4882a593Smuzhiyun int rt2x00queue_initialize(struct rt2x00_dev *rt2x00dev);
187*4882a593Smuzhiyun void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev);
188*4882a593Smuzhiyun int rt2x00queue_allocate(struct rt2x00_dev *rt2x00dev);
189*4882a593Smuzhiyun void rt2x00queue_free(struct rt2x00_dev *rt2x00dev);
190*4882a593Smuzhiyun 
191*4882a593Smuzhiyun /**
192*4882a593Smuzhiyun  * rt2x00link_update_stats - Update link statistics from RX frame
193*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
194*4882a593Smuzhiyun  * @skb: Received frame
195*4882a593Smuzhiyun  * @rxdesc: Received frame descriptor
196*4882a593Smuzhiyun  *
197*4882a593Smuzhiyun  * Update link statistics based on the information from the
198*4882a593Smuzhiyun  * received frame descriptor.
199*4882a593Smuzhiyun  */
200*4882a593Smuzhiyun void rt2x00link_update_stats(struct rt2x00_dev *rt2x00dev,
201*4882a593Smuzhiyun 			     struct sk_buff *skb,
202*4882a593Smuzhiyun 			     struct rxdone_entry_desc *rxdesc);
203*4882a593Smuzhiyun 
204*4882a593Smuzhiyun /**
205*4882a593Smuzhiyun  * rt2x00link_start_tuner - Start periodic link tuner work
206*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
207*4882a593Smuzhiyun  *
208*4882a593Smuzhiyun  * This start the link tuner periodic work, this work will
209*4882a593Smuzhiyun  * be executed periodically until &rt2x00link_stop_tuner has
210*4882a593Smuzhiyun  * been called.
211*4882a593Smuzhiyun  */
212*4882a593Smuzhiyun void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev);
213*4882a593Smuzhiyun 
214*4882a593Smuzhiyun /**
215*4882a593Smuzhiyun  * rt2x00link_stop_tuner - Stop periodic link tuner work
216*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
217*4882a593Smuzhiyun  *
218*4882a593Smuzhiyun  * After this function completed the link tuner will not
219*4882a593Smuzhiyun  * be running until &rt2x00link_start_tuner is called.
220*4882a593Smuzhiyun  */
221*4882a593Smuzhiyun void rt2x00link_stop_tuner(struct rt2x00_dev *rt2x00dev);
222*4882a593Smuzhiyun 
223*4882a593Smuzhiyun /**
224*4882a593Smuzhiyun  * rt2x00link_reset_tuner - Reset periodic link tuner work
225*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
226*4882a593Smuzhiyun  * @antenna: Should the antenna tuning also be reset
227*4882a593Smuzhiyun  *
228*4882a593Smuzhiyun  * The VGC limit configured in the hardware will be reset to 0
229*4882a593Smuzhiyun  * which forces the driver to rediscover the correct value for
230*4882a593Smuzhiyun  * the current association. This is needed when configuration
231*4882a593Smuzhiyun  * options have changed which could drastically change the
232*4882a593Smuzhiyun  * SNR level or link quality (i.e. changing the antenna setting).
233*4882a593Smuzhiyun  *
234*4882a593Smuzhiyun  * Resetting the link tuner will also cause the periodic work counter
235*4882a593Smuzhiyun  * to be reset. Any driver which has a fixed limit on the number
236*4882a593Smuzhiyun  * of rounds the link tuner is supposed to work will accept the
237*4882a593Smuzhiyun  * tuner actions again if this limit was previously reached.
238*4882a593Smuzhiyun  *
239*4882a593Smuzhiyun  * If @antenna is set to true a the software antenna diversity
240*4882a593Smuzhiyun  * tuning will also be reset.
241*4882a593Smuzhiyun  */
242*4882a593Smuzhiyun void rt2x00link_reset_tuner(struct rt2x00_dev *rt2x00dev, bool antenna);
243*4882a593Smuzhiyun 
244*4882a593Smuzhiyun /**
245*4882a593Smuzhiyun  * rt2x00link_start_watchdog - Start periodic watchdog monitoring
246*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
247*4882a593Smuzhiyun  *
248*4882a593Smuzhiyun  * This start the watchdog periodic work, this work will
249*4882a593Smuzhiyun  *be executed periodically until &rt2x00link_stop_watchdog has
250*4882a593Smuzhiyun  * been called.
251*4882a593Smuzhiyun  */
252*4882a593Smuzhiyun void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev);
253*4882a593Smuzhiyun 
254*4882a593Smuzhiyun /**
255*4882a593Smuzhiyun  * rt2x00link_stop_watchdog - Stop periodic watchdog monitoring
256*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
257*4882a593Smuzhiyun  *
258*4882a593Smuzhiyun  * After this function completed the watchdog monitoring will not
259*4882a593Smuzhiyun  * be running until &rt2x00link_start_watchdog is called.
260*4882a593Smuzhiyun  */
261*4882a593Smuzhiyun void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev);
262*4882a593Smuzhiyun 
263*4882a593Smuzhiyun /**
264*4882a593Smuzhiyun  * rt2x00link_register - Initialize link tuning & watchdog functionality
265*4882a593Smuzhiyun  * @rt2x00dev: Pointer to &struct rt2x00_dev.
266*4882a593Smuzhiyun  *
267*4882a593Smuzhiyun  * Initialize work structure and all link tuning and watchdog related
268*4882a593Smuzhiyun  * parameters. This will not start the periodic work itself.
269*4882a593Smuzhiyun  */
270*4882a593Smuzhiyun void rt2x00link_register(struct rt2x00_dev *rt2x00dev);
271*4882a593Smuzhiyun 
272*4882a593Smuzhiyun /*
273*4882a593Smuzhiyun  * Firmware handlers.
274*4882a593Smuzhiyun  */
275*4882a593Smuzhiyun #ifdef CONFIG_RT2X00_LIB_FIRMWARE
276*4882a593Smuzhiyun int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev);
277*4882a593Smuzhiyun void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev);
278*4882a593Smuzhiyun #else
rt2x00lib_load_firmware(struct rt2x00_dev * rt2x00dev)279*4882a593Smuzhiyun static inline int rt2x00lib_load_firmware(struct rt2x00_dev *rt2x00dev)
280*4882a593Smuzhiyun {
281*4882a593Smuzhiyun 	return 0;
282*4882a593Smuzhiyun }
rt2x00lib_free_firmware(struct rt2x00_dev * rt2x00dev)283*4882a593Smuzhiyun static inline void rt2x00lib_free_firmware(struct rt2x00_dev *rt2x00dev)
284*4882a593Smuzhiyun {
285*4882a593Smuzhiyun }
286*4882a593Smuzhiyun #endif /* CONFIG_RT2X00_LIB_FIRMWARE */
287*4882a593Smuzhiyun 
288*4882a593Smuzhiyun /*
289*4882a593Smuzhiyun  * Debugfs handlers.
290*4882a593Smuzhiyun  */
291*4882a593Smuzhiyun #ifdef CONFIG_RT2X00_LIB_DEBUGFS
292*4882a593Smuzhiyun void rt2x00debug_register(struct rt2x00_dev *rt2x00dev);
293*4882a593Smuzhiyun void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev);
294*4882a593Smuzhiyun void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
295*4882a593Smuzhiyun 			       struct rxdone_entry_desc *rxdesc);
296*4882a593Smuzhiyun #else
rt2x00debug_register(struct rt2x00_dev * rt2x00dev)297*4882a593Smuzhiyun static inline void rt2x00debug_register(struct rt2x00_dev *rt2x00dev)
298*4882a593Smuzhiyun {
299*4882a593Smuzhiyun }
300*4882a593Smuzhiyun 
rt2x00debug_deregister(struct rt2x00_dev * rt2x00dev)301*4882a593Smuzhiyun static inline void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
302*4882a593Smuzhiyun {
303*4882a593Smuzhiyun }
304*4882a593Smuzhiyun 
rt2x00debug_update_crypto(struct rt2x00_dev * rt2x00dev,struct rxdone_entry_desc * rxdesc)305*4882a593Smuzhiyun static inline void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
306*4882a593Smuzhiyun 					     struct rxdone_entry_desc *rxdesc)
307*4882a593Smuzhiyun {
308*4882a593Smuzhiyun }
309*4882a593Smuzhiyun #endif /* CONFIG_RT2X00_LIB_DEBUGFS */
310*4882a593Smuzhiyun 
311*4882a593Smuzhiyun /*
312*4882a593Smuzhiyun  * Crypto handlers.
313*4882a593Smuzhiyun  */
314*4882a593Smuzhiyun #ifdef CONFIG_RT2X00_LIB_CRYPTO
315*4882a593Smuzhiyun enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key);
316*4882a593Smuzhiyun void rt2x00crypto_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
317*4882a593Smuzhiyun 				       struct sk_buff *skb,
318*4882a593Smuzhiyun 				       struct txentry_desc *txdesc);
319*4882a593Smuzhiyun unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
320*4882a593Smuzhiyun 				      struct sk_buff *skb);
321*4882a593Smuzhiyun void rt2x00crypto_tx_copy_iv(struct sk_buff *skb,
322*4882a593Smuzhiyun 			     struct txentry_desc *txdesc);
323*4882a593Smuzhiyun void rt2x00crypto_tx_remove_iv(struct sk_buff *skb,
324*4882a593Smuzhiyun 			       struct txentry_desc *txdesc);
325*4882a593Smuzhiyun void rt2x00crypto_tx_insert_iv(struct sk_buff *skb, unsigned int header_length);
326*4882a593Smuzhiyun void rt2x00crypto_rx_insert_iv(struct sk_buff *skb,
327*4882a593Smuzhiyun 			       unsigned int header_length,
328*4882a593Smuzhiyun 			       struct rxdone_entry_desc *rxdesc);
329*4882a593Smuzhiyun #else
rt2x00crypto_key_to_cipher(struct ieee80211_key_conf * key)330*4882a593Smuzhiyun static inline enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key)
331*4882a593Smuzhiyun {
332*4882a593Smuzhiyun 	return CIPHER_NONE;
333*4882a593Smuzhiyun }
334*4882a593Smuzhiyun 
rt2x00crypto_create_tx_descriptor(struct rt2x00_dev * rt2x00dev,struct sk_buff * skb,struct txentry_desc * txdesc)335*4882a593Smuzhiyun static inline void rt2x00crypto_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
336*4882a593Smuzhiyun 						     struct sk_buff *skb,
337*4882a593Smuzhiyun 						     struct txentry_desc *txdesc)
338*4882a593Smuzhiyun {
339*4882a593Smuzhiyun }
340*4882a593Smuzhiyun 
rt2x00crypto_tx_overhead(struct rt2x00_dev * rt2x00dev,struct sk_buff * skb)341*4882a593Smuzhiyun static inline unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
342*4882a593Smuzhiyun 						    struct sk_buff *skb)
343*4882a593Smuzhiyun {
344*4882a593Smuzhiyun 	return 0;
345*4882a593Smuzhiyun }
346*4882a593Smuzhiyun 
rt2x00crypto_tx_copy_iv(struct sk_buff * skb,struct txentry_desc * txdesc)347*4882a593Smuzhiyun static inline void rt2x00crypto_tx_copy_iv(struct sk_buff *skb,
348*4882a593Smuzhiyun 					   struct txentry_desc *txdesc)
349*4882a593Smuzhiyun {
350*4882a593Smuzhiyun }
351*4882a593Smuzhiyun 
rt2x00crypto_tx_remove_iv(struct sk_buff * skb,struct txentry_desc * txdesc)352*4882a593Smuzhiyun static inline void rt2x00crypto_tx_remove_iv(struct sk_buff *skb,
353*4882a593Smuzhiyun 					     struct txentry_desc *txdesc)
354*4882a593Smuzhiyun {
355*4882a593Smuzhiyun }
356*4882a593Smuzhiyun 
rt2x00crypto_tx_insert_iv(struct sk_buff * skb,unsigned int header_length)357*4882a593Smuzhiyun static inline void rt2x00crypto_tx_insert_iv(struct sk_buff *skb,
358*4882a593Smuzhiyun 					     unsigned int header_length)
359*4882a593Smuzhiyun {
360*4882a593Smuzhiyun }
361*4882a593Smuzhiyun 
rt2x00crypto_rx_insert_iv(struct sk_buff * skb,unsigned int header_length,struct rxdone_entry_desc * rxdesc)362*4882a593Smuzhiyun static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb,
363*4882a593Smuzhiyun 					     unsigned int header_length,
364*4882a593Smuzhiyun 					     struct rxdone_entry_desc *rxdesc)
365*4882a593Smuzhiyun {
366*4882a593Smuzhiyun }
367*4882a593Smuzhiyun #endif /* CONFIG_RT2X00_LIB_CRYPTO */
368*4882a593Smuzhiyun 
369*4882a593Smuzhiyun /*
370*4882a593Smuzhiyun  * RFkill handlers.
371*4882a593Smuzhiyun  */
rt2x00rfkill_register(struct rt2x00_dev * rt2x00dev)372*4882a593Smuzhiyun static inline void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev)
373*4882a593Smuzhiyun {
374*4882a593Smuzhiyun 	if (test_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags))
375*4882a593Smuzhiyun 		wiphy_rfkill_start_polling(rt2x00dev->hw->wiphy);
376*4882a593Smuzhiyun }
377*4882a593Smuzhiyun 
rt2x00rfkill_unregister(struct rt2x00_dev * rt2x00dev)378*4882a593Smuzhiyun static inline void rt2x00rfkill_unregister(struct rt2x00_dev *rt2x00dev)
379*4882a593Smuzhiyun {
380*4882a593Smuzhiyun 	if (test_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags))
381*4882a593Smuzhiyun 		wiphy_rfkill_stop_polling(rt2x00dev->hw->wiphy);
382*4882a593Smuzhiyun }
383*4882a593Smuzhiyun 
384*4882a593Smuzhiyun /*
385*4882a593Smuzhiyun  * LED handlers
386*4882a593Smuzhiyun  */
387*4882a593Smuzhiyun #ifdef CONFIG_RT2X00_LIB_LEDS
388*4882a593Smuzhiyun void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi);
389*4882a593Smuzhiyun void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled);
390*4882a593Smuzhiyun void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled);
391*4882a593Smuzhiyun void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled);
392*4882a593Smuzhiyun void rt2x00leds_register(struct rt2x00_dev *rt2x00dev);
393*4882a593Smuzhiyun void rt2x00leds_unregister(struct rt2x00_dev *rt2x00dev);
394*4882a593Smuzhiyun void rt2x00leds_suspend(struct rt2x00_dev *rt2x00dev);
395*4882a593Smuzhiyun void rt2x00leds_resume(struct rt2x00_dev *rt2x00dev);
396*4882a593Smuzhiyun #else
rt2x00leds_led_quality(struct rt2x00_dev * rt2x00dev,int rssi)397*4882a593Smuzhiyun static inline void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev,
398*4882a593Smuzhiyun 					  int rssi)
399*4882a593Smuzhiyun {
400*4882a593Smuzhiyun }
401*4882a593Smuzhiyun 
rt2x00led_led_activity(struct rt2x00_dev * rt2x00dev,bool enabled)402*4882a593Smuzhiyun static inline void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev,
403*4882a593Smuzhiyun 					  bool enabled)
404*4882a593Smuzhiyun {
405*4882a593Smuzhiyun }
406*4882a593Smuzhiyun 
rt2x00leds_led_assoc(struct rt2x00_dev * rt2x00dev,bool enabled)407*4882a593Smuzhiyun static inline void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev,
408*4882a593Smuzhiyun 					bool enabled)
409*4882a593Smuzhiyun {
410*4882a593Smuzhiyun }
411*4882a593Smuzhiyun 
rt2x00leds_led_radio(struct rt2x00_dev * rt2x00dev,bool enabled)412*4882a593Smuzhiyun static inline void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev,
413*4882a593Smuzhiyun 					bool enabled)
414*4882a593Smuzhiyun {
415*4882a593Smuzhiyun }
416*4882a593Smuzhiyun 
rt2x00leds_register(struct rt2x00_dev * rt2x00dev)417*4882a593Smuzhiyun static inline void rt2x00leds_register(struct rt2x00_dev *rt2x00dev)
418*4882a593Smuzhiyun {
419*4882a593Smuzhiyun }
420*4882a593Smuzhiyun 
rt2x00leds_unregister(struct rt2x00_dev * rt2x00dev)421*4882a593Smuzhiyun static inline void rt2x00leds_unregister(struct rt2x00_dev *rt2x00dev)
422*4882a593Smuzhiyun {
423*4882a593Smuzhiyun }
424*4882a593Smuzhiyun 
rt2x00leds_suspend(struct rt2x00_dev * rt2x00dev)425*4882a593Smuzhiyun static inline void rt2x00leds_suspend(struct rt2x00_dev *rt2x00dev)
426*4882a593Smuzhiyun {
427*4882a593Smuzhiyun }
428*4882a593Smuzhiyun 
rt2x00leds_resume(struct rt2x00_dev * rt2x00dev)429*4882a593Smuzhiyun static inline void rt2x00leds_resume(struct rt2x00_dev *rt2x00dev)
430*4882a593Smuzhiyun {
431*4882a593Smuzhiyun }
432*4882a593Smuzhiyun #endif /* CONFIG_RT2X00_LIB_LEDS */
433*4882a593Smuzhiyun 
434*4882a593Smuzhiyun #endif /* RT2X00LIB_H */
435