struct_ieee80211_ops

Langue: en

Version: May 2009 (fedora - 06/07/09)

Section: 9 (Appels noyau Linux)

NAME

struct_ieee80211_ops - callbacks from mac80211 to the driver

SYNOPSIS

 struct ieee80211_ops {
   int (* tx) (struct ieee80211_hw *hw, struct sk_buff *skb);
   int (* start) (struct ieee80211_hw *hw);
   void (* stop) (struct ieee80211_hw *hw);
   int (* add_interface) (struct ieee80211_hw *hw,struct ieee80211_if_init_conf *conf);
   void (* remove_interface) (struct ieee80211_hw *hw,struct ieee80211_if_init_conf *conf);
   int (* config) (struct ieee80211_hw *hw, u32 changed);
   int (* config_interface) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_if_conf *conf);
   void (* bss_info_changed) (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_bss_conf *info,u32 changed);
   void (* configure_filter) (struct ieee80211_hw *hw,unsigned int changed_flags,unsigned int *total_flags,int mc_count, struct dev_addr_list *mc_list);
   int (* set_tim) (struct ieee80211_hw *hw, struct ieee80211_sta *sta,bool set);
   int (* set_key) (struct ieee80211_hw *hw, enum set_key_cmd cmd,const u8 *local_address, const u8 *address,struct ieee80211_key_conf *key);
   void (* update_tkip_key) (struct ieee80211_hw *hw,struct ieee80211_key_conf *conf, const u8 *address,u32 iv32, u16 *phase1key);
   int (* hw_scan) (struct ieee80211_hw *hw, u8 *ssid, size_t len);
   int (* get_stats) (struct ieee80211_hw *hw,struct ieee80211_low_level_stats *stats);
   void (* get_tkip_seq) (struct ieee80211_hw *hw, u8 hw_key_idx,u32 *iv32, u16 *iv16);
   int (* set_rts_threshold) (struct ieee80211_hw *hw, u32 value);
   void (* sta_notify) (struct ieee80211_hw *hw, struct ieee80211_vif *vif,enum sta_notify_cmd, struct ieee80211_sta *sta);
   int (* conf_tx) (struct ieee80211_hw *hw, u16 queue,const struct ieee80211_tx_queue_params *params);
   int (* get_tx_stats) (struct ieee80211_hw *hw,struct ieee80211_tx_queue_stats *stats);
   u64 (* get_tsf) (struct ieee80211_hw *hw);
   void (* reset_tsf) (struct ieee80211_hw *hw);
   int (* tx_last_beacon) (struct ieee80211_hw *hw);
   int (* ampdu_action) (struct ieee80211_hw *hw,enum ieee80211_ampdu_mlme_action action,struct ieee80211_sta *sta, u16 tid, u16 *ssn);
 };  
 

MEMBERS

tx

Handler that 802.11 module calls for each transmitted frame. skb contains the buffer starting from the IEEE 802.11 header. The low-level driver should send the frame out based on configuration in the TX control data. This handler should, preferably, never fail and stop queues appropriately, more importantly, however, it must never fail for A-MPDU-queues. Must be implemented and atomic.

start

Called before the first netdevice attached to the hardware is enabled. This should turn on the hardware and must turn on frame reception (for possibly enabled monitor interfaces.) Returns negative error codes, these may be seen in userspace, or zero. When the device is started it should not have a MAC address to avoid acknowledging frames before a non-monitor device is added. Must be implemented.

stop

Called after last netdevice attached to the hardware is disabled. This should turn off the hardware (at least it must turn off frame reception.) May be called right after add_interface if that rejects an interface. Must be implemented.

add_interface

Called when a netdevice attached to the hardware is enabled. Because it is not called for monitor mode devices, start and stop must be implemented. The driver should perform any initialization it needs before the device can be enabled. The initial configuration for the interface is given in the conf parameter. The callback may refuse to add an interface by returning a negative error code (which will be seen in userspace.) Must be implemented.

remove_interface

Notifies a driver that an interface is going down. The stop callback is called after this if it is the last interface and no monitor interfaces are present. When all interfaces are removed, the MAC address in the hardware must be cleared so the device no longer acknowledges packets, the mac_addr member of the conf structure is, however, set to the MAC address of the device going away. Hence, this callback must be implemented.

config

Handler for configuration requests. IEEE 802.11 code calls this function to change hardware configuration, e.g., channel.

config_interface

Handler for configuration requests related to interfaces (e.g. BSSID changes.)

bss_info_changed

Handler for configuration requests related to BSS parameters that may vary during BSS's lifespan, and may affect low level driver (e.g. assoc/disassoc status, erp parameters). This function should not be used if no BSS has been set, unless for association indication. The changed parameter indicates which of the bss parameters has changed when a call is made.

configure_filter

Configure the device's RX filter. See the section "Frame filtering" for more information. This callback must be implemented and atomic.

set_tim

Set TIM bit. mac80211 calls this function when a TIM bit must be set or cleared for a given STA. Must be atomic.

set_key

See the section "Hardware crypto acceleration" This callback can sleep, and is only called between add_interface and remove_interface calls, i.e. while the interface with the given local_address is enabled.

update_tkip_key

See the section "Hardware crypto acceleration" This callback will be called in the context of Rx. Called for drivers which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY.

hw_scan

Ask the hardware to service the scan request, no need to start the scan state machine in stack. The scan must honour the channel configuration done by the regulatory agent in the wiphy's registered bands. When the scan finishes, ieee80211_scan_completed must be called; note that it also must be called when the scan cannot finish because the hardware is turned off! Anything else is a bug!

get_stats

return low-level statistics

get_tkip_seq

If your device implements TKIP encryption in hardware this callback should be provided to read the TKIP transmit IVs (both IV32 and IV16) for the given key from hardware.

set_rts_threshold

Configuration of RTS threshold (if device needs it)

sta_notify

Notifies low level driver about addition, removal or power state transition of an associated station, AP, IBSS/WDS/mesh peer etc. Must be atomic.

conf_tx

Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), bursting) for a hardware TX queue.

get_tx_stats

Get statistics of the current TX queue status. This is used to get number of currently queued packets (queue length), maximum queue size (limit), and total number of packets sent using each TX queue (count). The 'stats' pointer points to an array that has hw->queues + hw->ampdu_queues items.

get_tsf

Get the current TSF timer value from firmware/hardware. Currently, this is only used for IBSS mode debugging and, as such, is not a required function. Must be atomic.

reset_tsf

Reset the TSF timer and allow firmware/hardware to synchronize with other STAs in the IBSS. This is only used in IBSS mode. This function is optional if the firmware/hardware takes full care of TSF synchronization.

tx_last_beacon

Determine whether the last IBSS beacon was sent by us. This is needed only for IBSS mode and the result of this function is used to determine whether to reply to Probe Requests.

ampdu_action

Perform a certain A-MPDU action The RA/TID combination determines the destination and TID we want the ampdu action to be performed for. The action is defined through ieee80211_ampdu_mlme_action. Starting sequence number (ssn) is the first frame we expect to perform the action on. notice that TX/RX_STOP can pass NULL for this parameter.

DESCRIPTION

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

AUTHOR

Johannes Berg <johannes@sipsolutions.net>

Author.