1STRUCT IEEE80211_OPS(9) The basic mac80211 driver inte STRUCT IEEE80211_OPS(9)
2
3
4

NAME

6       struct_ieee80211_ops - callbacks from mac80211 to the driver
7

SYNOPSIS

9       struct ieee80211_ops {
10         void (* tx) (struct ieee80211_hw *hw,struct ieee80211_tx_control *control,struct sk_buff *skb);
11         int (* start) (struct ieee80211_hw *hw);
12         void (* stop) (struct ieee80211_hw *hw);
13       #ifdef CONFIG_PM
14         int (* suspend) (struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan);
15         int (* resume) (struct ieee80211_hw *hw);
16         void (* set_wakeup) (struct ieee80211_hw *hw, bool enabled);
17       #endif
18         int (* add_interface) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
19         int (* change_interface) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,enum nl80211_iftype new_type, bool p2p);
20         void (* remove_interface) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
21         int (* config) (struct ieee80211_hw *hw, u32 changed);
22         void (* bss_info_changed) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_bss_conf *info,u32 changed);
23         int (* start_ap) (struct ieee80211_hw *hw, struct ieee80211_vif *vif);
24         void (* stop_ap) (struct ieee80211_hw *hw, struct ieee80211_vif *vif);
25         u64 (* prepare_multicast) (struct ieee80211_hw *hw,struct netdev_hw_addr_list *mc_list);
26         void (* configure_filter) (struct ieee80211_hw *hw,unsigned int changed_flags,unsigned int *total_flags,u64 multicast);
27         void (* config_iface_filter) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,unsigned int filter_flags,unsigned int changed_flags);
28         int (* set_tim) (struct ieee80211_hw *hw, struct ieee80211_sta *sta,bool set);
29         int (* set_key) (struct ieee80211_hw *hw, enum set_key_cmd cmd,struct ieee80211_vif *vif, struct ieee80211_sta *sta,struct ieee80211_key_conf *key);
30         void (* update_tkip_key) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_key_conf *conf,struct ieee80211_sta *sta,u32 iv32, u16 *phase1key);
31         void (* set_rekey_data) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct cfg80211_gtk_rekey_data *data);
32         void (* set_default_unicast_key) (struct ieee80211_hw *hw,struct ieee80211_vif *vif, int idx);
33         int (* hw_scan) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,struct ieee80211_scan_request *req);
34         void (* cancel_hw_scan) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
35         int (* sched_scan_start) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct cfg80211_sched_scan_request *req,struct ieee80211_scan_ies *ies);
36         int (* sched_scan_stop) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
37         void (* sw_scan_start) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,const u8 *mac_addr);
38         void (* sw_scan_complete) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
39         int (* get_stats) (struct ieee80211_hw *hw,struct ieee80211_low_level_stats *stats);
40         void (* get_key_seq) (struct ieee80211_hw *hw,struct ieee80211_key_conf *key,struct ieee80211_key_seq *seq);
41         int (* set_frag_threshold) (struct ieee80211_hw *hw, u32 value);
42         int (* set_rts_threshold) (struct ieee80211_hw *hw, u32 value);
43         int (* sta_add) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,struct ieee80211_sta *sta);
44         int (* sta_remove) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,struct ieee80211_sta *sta);
45       #ifdef CONFIG_MAC80211_DEBUGFS
46         void (* sta_add_debugfs) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta,struct dentry *dir);
47       #endif
48         void (* sta_notify) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,enum sta_notify_cmd, struct ieee80211_sta *sta);
49         int (* sta_state) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,struct ieee80211_sta *sta,enum ieee80211_sta_state old_state,enum ieee80211_sta_state new_state);
50         void (* sta_pre_rcu_remove) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta);
51         void (* sta_rc_update) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta,u32 changed);
52         void (* sta_rate_tbl_update) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta);
53         void (* sta_statistics) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta,struct station_info *sinfo);
54         int (* conf_tx) (struct ieee80211_hw *hw,struct ieee80211_vif *vif, u16 ac,const struct ieee80211_tx_queue_params *params);
55         u64 (* get_tsf) (struct ieee80211_hw *hw, struct ieee80211_vif *vif);
56         void (* set_tsf) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,u64 tsf);
57         void (* offset_tsf) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,s64 offset);
58         void (* reset_tsf) (struct ieee80211_hw *hw, struct ieee80211_vif *vif);
59         int (* tx_last_beacon) (struct ieee80211_hw *hw);
60         int (* get_survey) (struct ieee80211_hw *hw, int idx,struct survey_info *survey);
61         void (* rfkill_poll) (struct ieee80211_hw *hw);
62         void (* set_coverage_class) (struct ieee80211_hw *hw, s16 coverage_class);
63       #ifdef CONFIG_NL80211_TESTMODE
64         int (* testmode_cmd) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,void *data, int len);
65         int (* testmode_dump) (struct ieee80211_hw *hw, struct sk_buff *skb,struct netlink_callback *cb,void *data, int len);
66       #endif
67         void (* flush) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,u32 queues, bool drop);
68         void (* channel_switch) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_channel_switch *ch_switch);
69         int (* set_antenna) (struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
70         int (* get_antenna) (struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
71         int (* remain_on_channel) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_channel *chan,int duration,enum ieee80211_roc_type type);
72         int (* cancel_remain_on_channel) (struct ieee80211_hw *hw);
73         int (* set_ringparam) (struct ieee80211_hw *hw, u32 tx, u32 rx);
74         void (* get_ringparam) (struct ieee80211_hw *hw,u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
75         bool (* tx_frames_pending) (struct ieee80211_hw *hw);
76         int (* set_bitrate_mask) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,const struct cfg80211_bitrate_mask *mask);
77         void (* event_callback) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,const struct ieee80211_event *event);
78         void (* allow_buffered_frames) (struct ieee80211_hw *hw,struct ieee80211_sta *sta,u16 tids, int num_frames,enum ieee80211_frame_release_type reason,bool more_data);
79         void (* release_buffered_frames) (struct ieee80211_hw *hw,struct ieee80211_sta *sta,u16 tids, int num_frames,enum ieee80211_frame_release_type reason,bool more_data);
80         int (* get_et_sset_count) (struct ieee80211_hw *hw,struct ieee80211_vif *vif, int sset);
81         void (* get_et_stats) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ethtool_stats *stats, u64 *data);
82         void (* get_et_strings) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,u32 sset, u8 *data);
83         void (* mgd_prepare_tx) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
84         void (* mgd_protect_tdls_discover) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
85         int (* add_chanctx) (struct ieee80211_hw *hw,struct ieee80211_chanctx_conf *ctx);
86         void (* remove_chanctx) (struct ieee80211_hw *hw,struct ieee80211_chanctx_conf *ctx);
87         void (* change_chanctx) (struct ieee80211_hw *hw,struct ieee80211_chanctx_conf *ctx,u32 changed);
88         int (* assign_vif_chanctx) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_chanctx_conf *ctx);
89         void (* unassign_vif_chanctx) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_chanctx_conf *ctx);
90         int (* switch_vif_chanctx) (struct ieee80211_hw *hw,struct ieee80211_vif_chanctx_switch *vifs,int n_vifs,enum ieee80211_chanctx_switch_mode mode);
91         void (* reconfig_complete) (struct ieee80211_hw *hw,enum ieee80211_reconfig_type reconfig_type);
92       #if IS_ENABLED(CONFIG_IPV6)
93         void (* ipv6_addr_change) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct inet6_dev *idev);
94       #endif
95         void (* channel_switch_beacon) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct cfg80211_chan_def *chandef);
96         int (* pre_channel_switch) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_channel_switch *ch_switch);
97         int (* post_channel_switch) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
98         int (* join_ibss) (struct ieee80211_hw *hw, struct ieee80211_vif *vif);
99         void (* leave_ibss) (struct ieee80211_hw *hw, struct ieee80211_vif *vif);
100         u32 (* get_expected_throughput) (struct ieee80211_hw *hw,struct ieee80211_sta *sta);
101         int (* get_txpower) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,int *dbm);
102         int (* tdls_channel_switch) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta, u8 oper_class,struct cfg80211_chan_def *chandef,struct sk_buff *tmpl_skb, u32 ch_sw_tm_ie);
103         void (* tdls_cancel_channel_switch) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta);
104         void (* tdls_recv_channel_switch) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_tdls_ch_sw_params *params);
105         void (* wake_tx_queue) (struct ieee80211_hw *hw,struct ieee80211_txq *txq);
106         void (* sync_rx_queues) (struct ieee80211_hw *hw);
107         int (* start_nan) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct cfg80211_nan_conf *conf);
108         int (* stop_nan) (struct ieee80211_hw *hw,struct ieee80211_vif *vif);
109         int (* nan_change_conf) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct cfg80211_nan_conf *conf, u32 changes);
110         int (* add_nan_func) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,const struct cfg80211_nan_func *nan_func);
111         void (* del_nan_func) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,u8 instance_id);
112       };
113

MEMBERS

115       tx
116           Handler that 802.11 module calls for each transmitted frame. skb
117           contains the buffer starting from the IEEE 802.11 header. The
118           low-level driver should send the frame out based on configuration
119           in the TX control data. This handler should, preferably, never fail
120           and stop queues appropriately. Must be atomic.
121
122       start
123           Called before the first netdevice attached to the hardware is
124           enabled. This should turn on the hardware and must turn on frame
125           reception (for possibly enabled monitor interfaces.) Returns
126           negative error codes, these may be seen in userspace, or zero. When
127           the device is started it should not have a MAC address to avoid
128           acknowledging frames before a non-monitor device is added. Must be
129           implemented and can sleep.
130
131       stop
132           Called after last netdevice attached to the hardware is disabled.
133           This should turn off the hardware (at least it must turn off frame
134           reception.) May be called right after add_interface if that rejects
135           an interface. If you added any work onto the mac80211 workqueue you
136           should ensure to cancel it on this callback. Must be implemented
137           and can sleep.
138
139       suspend
140           Suspend the device; mac80211 itself will quiesce before and stop
141           transmitting and doing any other configuration, and then ask the
142           device to suspend. This is only invoked when WoWLAN is configured,
143           otherwise the device is deconfigured completely and reconfigured at
144           resume time. The driver may also impose special conditions under
145           which it wants to use the “normal” suspend (deconfigure), say if it
146           only supports WoWLAN when the device is associated. In this case,
147           it must return 1 from this function.
148
149       resume
150           If WoWLAN was configured, this indicates that mac80211 is now
151           resuming its operation, after this the device must be fully
152           functional again. If this returns an error, the only way out is to
153           also unregister the device. If it returns 1, then mac80211 will
154           also go through the regular complete restart on resume.
155
156       set_wakeup
157           Enable or disable wakeup when WoWLAN configuration is modified. The
158           reason is that device_set_wakeup_enable is supposed to be called
159           when the configuration changes, not only in suspend.
160
161       add_interface
162           Called when a netdevice attached to the hardware is enabled.
163           Because it is not called for monitor mode devices, start and stop
164           must be implemented. The driver should perform any initialization
165           it needs before the device can be enabled. The initial
166           configuration for the interface is given in the conf parameter. The
167           callback may refuse to add an interface by returning a negative
168           error code (which will be seen in userspace.) Must be implemented
169           and can sleep.
170
171       change_interface
172           Called when a netdevice changes type. This callback is optional,
173           but only if it is supported can interface types be switched while
174           the interface is UP. The callback may sleep. Note that while an
175           interface is being switched, it will not be found by the interface
176           iteration callbacks.
177
178       remove_interface
179           Notifies a driver that an interface is going down. The stop
180           callback is called after this if it is the last interface and no
181           monitor interfaces are present. When all interfaces are removed,
182           the MAC address in the hardware must be cleared so the device no
183           longer acknowledges packets, the mac_addr member of the conf
184           structure is, however, set to the MAC address of the device going
185           away. Hence, this callback must be implemented. It can sleep.
186
187       config
188           Handler for configuration requests. IEEE 802.11 code calls this
189           function to change hardware configuration, e.g., channel. This
190           function should never fail but returns a negative error code if it
191           does. The callback can sleep.
192
193       bss_info_changed
194           Handler for configuration requests related to BSS parameters that
195           may vary during BSS's lifespan, and may affect low level driver
196           (e.g. assoc/disassoc status, erp parameters). This function should
197           not be used if no BSS has been set, unless for association
198           indication. The changed parameter indicates which of the bss
199           parameters has changed when a call is made. The callback can sleep.
200
201       start_ap
202           Start operation on the AP interface, this is called after all the
203           information in bss_conf is set and beacon can be retrieved. A
204           channel context is bound before this is called. Note that if the
205           driver uses software scan or ROC, this (and stop_ap) isn't called
206           when the AP is just “paused” for scanning/ROC, which is indicated
207           by the beacon being disabled/enabled via bss_info_changed.
208
209       stop_ap
210           Stop operation on the AP interface.
211
212       prepare_multicast
213           Prepare for multicast filter configuration. This callback is
214           optional, and its return value is passed to configure_filter. This
215           callback must be atomic.
216
217       configure_filter
218           Configure the device's RX filter. See the section “Frame filtering”
219           for more information. This callback must be implemented and can
220           sleep.
221
222       config_iface_filter
223           Configure the interface's RX filter. This callback is optional and
224           is used to configure which frames should be passed to mac80211. The
225           filter_flags is the combination of FIF_* flags. The changed_flags
226           is a bit mask that indicates which flags are changed. This callback
227           can sleep.
228
229       set_tim
230           Set TIM bit. mac80211 calls this function when a TIM bit must be
231           set or cleared for a given STA. Must be atomic.
232
233       set_key
234           See the section “Hardware crypto acceleration” This callback is
235           only called between add_interface and remove_interface calls, i.e.
236           while the given virtual interface is enabled. Returns a negative
237           error code if the key can't be added. The callback can sleep.
238
239       update_tkip_key
240           See the section “Hardware crypto acceleration” This callback will
241           be called in the context of Rx. Called for drivers which set
242           IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. The callback must be atomic.
243
244       set_rekey_data
245           If the device supports GTK rekeying, for example while the host is
246           suspended, it can assign this callback to retrieve the data
247           necessary to do GTK rekeying, this is the KEK, KCK and replay
248           counter. After rekeying was done it should (for example during
249           resume) notify userspace of the new replay counter using
250           ieee80211_gtk_rekey_notify.
251
252       set_default_unicast_key
253           Set the default (unicast) key index, useful for WEP when the device
254           sends data packets autonomously, e.g. for ARP offloading. The index
255           can be 0-3, or -1 for unsetting it.
256
257       hw_scan
258           Ask the hardware to service the scan request, no need to start the
259           scan state machine in stack. The scan must honour the channel
260           configuration done by the regulatory agent in the wiphy's
261           registered bands. The hardware (or the driver) needs to make sure
262           that power save is disabled. The req ie/ie_len members are
263           rewritten by mac80211 to contain the entire IEs after the SSID, so
264           that drivers need not look at these at all but just send them after
265           the SSID -- mac80211 includes the (extended) supported rates and HT
266           information (where applicable). When the scan finishes,
267           ieee80211_scan_completed must be called; note that it also must be
268           called when the scan cannot finish due to any error unless this
269           callback returned a negative error code. The callback can sleep.
270
271       cancel_hw_scan
272           Ask the low-level tp cancel the active hw scan. The driver should
273           ask the hardware to cancel the scan (if possible), but the scan
274           will be completed only after the driver will call
275           ieee80211_scan_completed. This callback is needed for wowlan, to
276           prevent enqueueing a new scan_work after the low-level driver was
277           already suspended. The callback can sleep.
278
279       sched_scan_start
280           Ask the hardware to start scanning repeatedly at specific
281           intervals. The driver must call the ieee80211_sched_scan_results
282           function whenever it finds results. This process will continue
283           until sched_scan_stop is called.
284
285       sched_scan_stop
286           Tell the hardware to stop an ongoing scheduled scan. In this case,
287           ieee80211_sched_scan_stopped must not be called.
288
289       sw_scan_start
290           Notifier function that is called just before a software scan is
291           started. Can be NULL, if the driver doesn't need this notification.
292           The mac_addr parameter allows supporting
293           NL80211_SCAN_FLAG_RANDOM_ADDR, the driver may set the
294           NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR flag if it can use this
295           parameter. The callback can sleep.
296
297       sw_scan_complete
298           Notifier function that is called just after a software scan
299           finished. Can be NULL, if the driver doesn't need this
300           notification. The callback can sleep.
301
302       get_stats
303           Return low-level statistics. Returns zero if statistics are
304           available. The callback can sleep.
305
306       get_key_seq
307           If your device implements encryption in hardware and does IV/PN
308           assignment then this callback should be provided to read the IV/PN
309           for the given key from hardware. The callback must be atomic.
310
311       set_frag_threshold
312           Configuration of fragmentation threshold. Assign this if the device
313           does fragmentation by itself. Note that to prevent the stack from
314           doing fragmentation IEEE80211_HW_SUPPORTS_TX_FRAG should be set as
315           well. The callback can sleep.
316
317       set_rts_threshold
318           Configuration of RTS threshold (if device needs it) The callback
319           can sleep.
320
321       sta_add
322           Notifies low level driver about addition of an associated station,
323           AP, IBSS/WDS/mesh peer etc. This callback can sleep.
324
325       sta_remove
326           Notifies low level driver about removal of an associated station,
327           AP, IBSS/WDS/mesh peer etc. Note that after the callback returns it
328           isn't safe to use the pointer, not even RCU protected; no RCU grace
329           period is guaranteed between returning here and freeing the
330           station. See sta_pre_rcu_remove if needed. This callback can sleep.
331
332       sta_add_debugfs
333           Drivers can use this callback to add debugfs files when a station
334           is added to mac80211's station list. This callback should be within
335           a CONFIG_MAC80211_DEBUGFS conditional. This callback can sleep.
336
337       sta_notify
338           Notifies low level driver about power state transition of an
339           associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating
340           in AP mode, this callback will not be called when the flag
341           IEEE80211_HW_AP_LINK_PS is set. Must be atomic.
342
343       sta_state
344           Notifies low level driver about state transition of a station
345           (which can be the AP, a client, IBSS/WDS/mesh peer etc.) This
346           callback is mutually exclusive with sta_add/sta_remove. It must not
347           fail for down transitions but may fail for transitions up the list
348           of states. Also note that after the callback returns it isn't safe
349           to use the pointer, not even RCU protected - no RCU grace period is
350           guaranteed between returning here and freeing the station. See
351           sta_pre_rcu_remove if needed. The callback can sleep.
352
353       sta_pre_rcu_remove
354           Notify driver about station removal before RCU synchronisation.
355           This is useful if a driver needs to have station pointers protected
356           using RCU, it can then use this call to clear the pointers instead
357           of waiting for an RCU grace period to elapse in sta_state. The
358           callback can sleep.
359
360       sta_rc_update
361           Notifies the driver of changes to the bitrates that can be used to
362           transmit to the station. The changes are advertised with bits from
363           enum ieee80211_rate_control_changed and the values are reflected in
364           the station data. This callback should only be used when the driver
365           uses hardware rate control (IEEE80211_HW_HAS_RATE_CONTROL) since
366           otherwise the rate control algorithm is notified directly. Must be
367           atomic.
368
369       sta_rate_tbl_update
370           Notifies the driver that the rate table changed. This is only used
371           if the configured rate control algorithm actually uses the new rate
372           table API, and is therefore optional. Must be atomic.
373
374       sta_statistics
375           Get statistics for this station. For example with beacon filtering,
376           the statistics kept by mac80211 might not be accurate, so let the
377           driver pre-fill the statistics. The driver can fill most of the
378           values (indicating which by setting the filled bitmap), but not all
379           of them make sense - see the source for which ones are possible.
380           Statistics that the driver doesn't fill will be filled by mac80211.
381           The callback can sleep.
382
383       conf_tx
384           Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
385           bursting) for a hardware TX queue. Returns a negative error code on
386           failure. The callback can sleep.
387
388       get_tsf
389           Get the current TSF timer value from firmware/hardware. Currently,
390           this is only used for IBSS mode BSSID merging and debugging. Is not
391           a required function. The callback can sleep.
392
393       set_tsf
394           Set the TSF timer to the specified value in the firmware/hardware.
395           Currently, this is only used for IBSS mode debugging. Is not a
396           required function. The callback can sleep.
397
398       offset_tsf
399           Offset the TSF timer by the specified value in the
400           firmware/hardware. Preferred to set_tsf as it avoids delay between
401           calling set_tsf and hardware getting programmed, which will show up
402           as TSF delay. Is not a required function. The callback can sleep.
403
404       reset_tsf
405           Reset the TSF timer and allow firmware/hardware to synchronize with
406           other STAs in the IBSS. This is only used in IBSS mode. This
407           function is optional if the firmware/hardware takes full care of
408           TSF synchronization. The callback can sleep.
409
410       tx_last_beacon
411           Determine whether the last IBSS beacon was sent by us. This is
412           needed only for IBSS mode and the result of this function is used
413           to determine whether to reply to Probe Requests. Returns non-zero
414           if this device sent the last beacon. The callback can sleep.
415
416       get_survey
417           Return per-channel survey information
418
419       rfkill_poll
420           Poll rfkill hardware state. If you need this, you also need to set
421           wiphy->rfkill_poll to true before registration, and need to call
422           wiphy_rfkill_set_hw_state in the callback. The callback can sleep.
423
424       set_coverage_class
425           Set slot time for given coverage class as specified in IEEE
426           802.11-2007 section 17.3.8.6 and modify ACK timeout accordingly;
427           coverage class equals to -1 to enable ACK timeout estimation
428           algorithm (dynack). To disable dynack set valid value for coverage
429           class. This callback is not required and may sleep.
430
431       testmode_cmd
432           Implement a cfg80211 test mode command. The passed vif may be NULL.
433           The callback can sleep.
434
435       testmode_dump
436           Implement a cfg80211 test mode dump. The callback can sleep.
437
438       flush
439           Flush all pending frames from the hardware queue, making sure that
440           the hardware queues are empty. The queues parameter is a bitmap of
441           queues to flush, which is useful if different virtual interfaces
442           use different hardware queues; it may also indicate all queues. If
443           the parameter drop is set to true, pending frames may be dropped.
444           Note that vif can be NULL. The callback can sleep.
445
446       channel_switch
447           Drivers that need (or want) to offload the channel switch operation
448           for CSAs received from the AP may implement this callback. They
449           must then call ieee80211_chswitch_done to indicate completion of
450           the channel switch.
451
452       set_antenna
453           Set antenna configuration (tx_ant, rx_ant) on the device.
454           Parameters are bitmaps of allowed antennas to use for TX/RX.
455           Drivers may reject TX/RX mask combinations they cannot support by
456           returning -EINVAL (also see nl80211.h
457           NL80211_ATTR_WIPHY_ANTENNA_TX).
458
459       get_antenna
460           Get current antenna configuration from device (tx_ant, rx_ant).
461
462       remain_on_channel
463           Starts an off-channel period on the given channel, must call back
464           to ieee80211_ready_on_channel when on that channel. Note that
465           normal channel traffic is not stopped as this is intended for hw
466           offload. Frames to transmit on the off-channel channel are
467           transmitted normally except for the IEEE80211_TX_CTL_TX_OFFCHAN
468           flag. When the duration (which will always be non-zero) expires,
469           the driver must call ieee80211_remain_on_channel_expired. Note that
470           this callback may be called while the device is in IDLE and must be
471           accepted in this case. This callback may sleep.
472
473       cancel_remain_on_channel
474           Requests that an ongoing off-channel period is aborted before it
475           expires. This callback may sleep.
476
477       set_ringparam
478           Set tx and rx ring sizes.
479
480       get_ringparam
481           Get tx and rx ring current and maximum sizes.
482
483       tx_frames_pending
484           Check if there is any pending frame in the hardware queues before
485           entering power save.
486
487       set_bitrate_mask
488           Set a mask of rates to be used for rate control selection when
489           transmitting a frame. Currently only legacy rates are handled. The
490           callback can sleep.
491
492       event_callback
493           Notify driver about any event in mac80211. See enum
494           ieee80211_event_type for the different types. The callback must be
495           atomic.
496
497       allow_buffered_frames
498           Prepare device to allow the given number of frames to go out to the
499           given station. The frames will be sent by mac80211 via the usual TX
500           path after this call. The TX information for frames released will
501           also have the IEEE80211_TX_CTL_NO_PS_BUFFER flag set and the last
502           one will also have IEEE80211_TX_STATUS_EOSP set. In case frames
503           from multiple TIDs are released and the driver might reorder them
504           between the TIDs, it must set the IEEE80211_TX_STATUS_EOSP flag on
505           the last frame and clear it on all others and also handle the EOSP
506           bit in the QoS header correctly. Alternatively, it can also call
507           the ieee80211_sta_eosp function. The tids parameter is a bitmap and
508           tells the driver which TIDs the frames will be on; it will at most
509           have two bits set. This callback must be atomic.
510
511       release_buffered_frames
512           Release buffered frames according to the given parameters. In the
513           case where the driver buffers some frames for sleeping stations
514           mac80211 will use this callback to tell the driver to release some
515           frames, either for PS-poll or uAPSD. Note that if the more_data
516           parameter is false the driver must check if there are more frames
517           on the given TIDs, and if there are more than the frames being
518           released then it must still set the more-data bit in the frame. If
519           the more_data parameter is true, then of course the more-data bit
520           must always be set. The tids parameter tells the driver which TIDs
521           to release frames from, for PS-poll it will always have only a
522           single bit set. In the case this is used for a PS-poll initiated
523           release, the num_frames parameter will always be 1 so code can be
524           shared. In this case the driver must also set
525           IEEE80211_TX_STATUS_EOSP flag on the TX status (and must report TX
526           status) so that the PS-poll period is properly ended. This is used
527           to avoid sending multiple responses for a retried PS-poll frame. In
528           the case this is used for uAPSD, the num_frames parameter may be
529           bigger than one, but the driver may send fewer frames (it must send
530           at least one, however). In this case it is also responsible for
531           setting the EOSP flag in the QoS header of the frames. Also, when
532           the service period ends, the driver must set
533           IEEE80211_TX_STATUS_EOSP on the last frame in the SP.
534           Alternatively, it may call the function ieee80211_sta_eosp to
535           inform mac80211 of the end of the SP. This callback must be atomic.
536
537       get_et_sset_count
538           Ethtool API to get string-set count.
539
540       get_et_stats
541           Ethtool API to get a set of u64 stats.
542
543       get_et_strings
544           Ethtool API to get a set of strings to describe stats and perhaps
545           other supported types of ethtool data-sets.
546
547       mgd_prepare_tx
548           Prepare for transmitting a management frame for association before
549           associated. In multi-channel scenarios, a virtual interface is
550           bound to a channel before it is associated, but as it isn't
551           associated yet it need not necessarily be given airtime, in
552           particular since any transmission to a P2P GO needs to be
553           synchronized against the GO's powersave state. mac80211 will call
554           this function before transmitting a management frame prior to
555           having successfully associated to allow the driver to give it
556           channel time for the transmission, to get a response and to be able
557           to synchronize with the GO. The callback will be called before each
558           transmission and upon return mac80211 will transmit the frame right
559           away. The callback is optional and can (should!) sleep.
560
561       mgd_protect_tdls_discover
562           Protect a TDLS discovery session. After sending a TDLS
563           discovery-request, we expect a reply to arrive on the AP's channel.
564           We must stay on the channel (no PSM, scan, etc.), since a TDLS
565           setup-response is a direct packet not buffered by the AP. mac80211
566           will call this function just before the transmission of a TDLS
567           discovery-request. The recommended period of protection is at least
568           2 * (DTIM period). The callback is optional and can sleep.
569
570       add_chanctx
571           Notifies device driver about new channel context creation. This
572           callback may sleep.
573
574       remove_chanctx
575           Notifies device driver about channel context destruction. This
576           callback may sleep.
577
578       change_chanctx
579           Notifies device driver about channel context changes that may
580           happen when combining different virtual interfaces on the same
581           channel context with different settings This callback may sleep.
582
583       assign_vif_chanctx
584           Notifies device driver about channel context being bound to vif.
585           Possible use is for hw queue remapping. This callback may sleep.
586
587       unassign_vif_chanctx
588           Notifies device driver about channel context being unbound from
589           vif. This callback may sleep.
590
591       switch_vif_chanctx
592           switch a number of vifs from one chanctx to another, as specified
593           in the list of ieee80211_vif_chanctx_switch passed to the driver,
594           according to the mode defined in ieee80211_chanctx_switch_mode.
595           This callback may sleep.
596
597       reconfig_complete
598           Called after a call to ieee80211_restart_hw and during resume, when
599           the reconfiguration has completed. This can help the driver
600           implement the reconfiguration step (and indicate mac80211 is ready
601           to receive frames). This callback may sleep.
602
603       ipv6_addr_change
604           IPv6 address assignment on the given interface changed. Currently,
605           this is only called for managed or P2P client interfaces. This
606           callback is optional; it must not sleep.
607
608       channel_switch_beacon
609           Starts a channel switch to a new channel. Beacons are modified to
610           include CSA or ECSA IEs before calling this function. The
611           corresponding count fields in these IEs must be decremented, and
612           when they reach 1 the driver must call ieee80211_csa_finish.
613           Drivers which use ieee80211_beacon_get get the csa counter
614           decremented by mac80211, but must check if it is 1 using
615           ieee80211_csa_is_complete after the beacon has been transmitted and
616           then call ieee80211_csa_finish. If the CSA count starts as zero or
617           1, this function will not be called, since there won't be any time
618           to beacon before the switch anyway.
619
620       pre_channel_switch
621           This is an optional callback that is called before a channel switch
622           procedure is started (ie. when a STA gets a CSA or an userspace
623           initiated channel-switch), allowing the driver to prepare for the
624           channel switch.
625
626       post_channel_switch
627           This is an optional callback that is called after a channel switch
628           procedure is completed, allowing the driver to go back to a normal
629           configuration.
630
631       join_ibss
632           Join an IBSS (on an IBSS interface); this is called after all
633           information in bss_conf is set up and the beacon can be retrieved.
634           A channel context is bound before this is called.
635
636       leave_ibss
637           Leave the IBSS again.
638
639       get_expected_throughput
640           extract the expected throughput towards the specified station. The
641           returned value is expressed in Kbps. It returns 0 if the RC
642           algorithm does not have proper data to provide.
643
644       get_txpower
645           get current maximum tx power (in dBm) based on configuration and
646           hardware limits.
647
648       tdls_channel_switch
649           Start channel-switching with a TDLS peer. The driver is responsible
650           for continually initiating channel-switching operations and
651           returning to the base channel for communication with the AP. The
652           driver receives a channel-switch request template and the location
653           of the switch-timing IE within the template as part of the
654           invocation. The template is valid only within the call, and the
655           driver can optionally copy the skb for further re-use.
656
657       tdls_cancel_channel_switch
658           Stop channel-switching with a TDLS peer. Both peers must be on the
659           base channel when the call completes.
660
661       tdls_recv_channel_switch
662           a TDLS channel-switch related frame (request or response) has been
663           received from a remote peer. The driver gets parameters parsed from
664           the incoming frame and may use them to continue an ongoing
665           channel-switch operation. In addition, a channel-switch response
666           template is provided, together with the location of the
667           switch-timing IE within the template. The skb can only be used
668           within the function call.
669
670       wake_tx_queue
671           Called when new packets have been added to the queue.
672
673       sync_rx_queues
674           Process all pending frames in RSS queues. This is a synchronization
675           which is needed in case driver has in its RSS queues pending frames
676           that were received prior to the control path action currently taken
677           (e.g. disassociation) but are not processed yet.
678
679       start_nan
680           join an existing NAN cluster, or create a new one.
681
682       stop_nan
683           leave the NAN cluster.
684
685       nan_change_conf
686           change NAN configuration. The data in cfg80211_nan_conf contains
687           full new configuration and changes specify which parameters are
688           changed with respect to the last NAN config. The driver gets both
689           full configuration and the changed parameters since some devices
690           may need the full configuration while others need only the changed
691           parameters.
692
693       add_nan_func
694           Add a NAN function. Returns 0 on success. The data in
695           cfg80211_nan_func must not be referenced outside the scope of this
696           call.
697
698       del_nan_func
699           Remove a NAN function. The driver must call
700           ieee80211_nan_func_terminated with
701           NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal.
702

DESCRIPTION

704       This structure contains various callbacks that the driver may handle
705       or, in some cases, must handle, for example to configure the hardware
706       to a new channel or to transmit a frame.
707

AUTHOR

709       Johannes Berg <johannes@sipsolutions.net>
710           Author.
711
713Kernel Hackers Manual 3.10         June 2019           STRUCT IEEE80211_OPS(9)
Impressum