<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>struct cfg80211_ops</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="The 802.11 subsystems – for kernel developers" /><link rel="up" href="bk01ch02.html" title="Chapter 2. Actions and configuration" /><link rel="prev" href="bk01ch02.html" title="Chapter 2. Actions and configuration" /><link rel="next" href="API-struct-vif-params.html" title="struct vif_params" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>struct cfg80211_ops</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01ch02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Actions and configuration</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-vif-params.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="struct cfg80211_ops"><a id="API-struct-cfg80211-ops"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct cfg80211_ops — backend description for wireless configuration </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><pre class="programlisting"> struct cfg80211_ops { int (* suspend) (struct wiphy *wiphy); int (* resume) (struct wiphy *wiphy); struct net_device * (* add_virtual_intf) (struct wiphy *wiphy,char *name,enum nl80211_iftype type,u32 *flags,struct vif_params *params); int (* del_virtual_intf) (struct wiphy *wiphy, struct net_device *dev); int (* change_virtual_intf) (struct wiphy *wiphy,struct net_device *dev,enum nl80211_iftype type, u32 *flags,struct vif_params *params); int (* add_key) (struct wiphy *wiphy, struct net_device *netdev,u8 key_index, bool pairwise, const u8 *mac_addr,struct key_params *params); int (* get_key) (struct wiphy *wiphy, struct net_device *netdev,u8 key_index, bool pairwise, const u8 *mac_addr,void *cookie,void (*callback); int (* del_key) (struct wiphy *wiphy, struct net_device *netdev,u8 key_index, bool pairwise, const u8 *mac_addr); int (* set_default_key) (struct wiphy *wiphy,struct net_device *netdev,u8 key_index, bool unicast, bool multicast); int (* set_default_mgmt_key) (struct wiphy *wiphy,struct net_device *netdev,u8 key_index); int (* add_beacon) (struct wiphy *wiphy, struct net_device *dev,struct beacon_parameters *info); int (* set_beacon) (struct wiphy *wiphy, struct net_device *dev,struct beacon_parameters *info); int (* del_beacon) (struct wiphy *wiphy, struct net_device *dev); int (* add_station) (struct wiphy *wiphy, struct net_device *dev,u8 *mac, struct station_parameters *params); int (* del_station) (struct wiphy *wiphy, struct net_device *dev,u8 *mac); int (* change_station) (struct wiphy *wiphy, struct net_device *dev,u8 *mac, struct station_parameters *params); int (* get_station) (struct wiphy *wiphy, struct net_device *dev,u8 *mac, struct station_info *sinfo); int (* dump_station) (struct wiphy *wiphy, struct net_device *dev,int idx, u8 *mac, struct station_info *sinfo); int (* add_mpath) (struct wiphy *wiphy, struct net_device *dev,u8 *dst, u8 *next_hop); int (* del_mpath) (struct wiphy *wiphy, struct net_device *dev,u8 *dst); int (* change_mpath) (struct wiphy *wiphy, struct net_device *dev,u8 *dst, u8 *next_hop); int (* get_mpath) (struct wiphy *wiphy, struct net_device *dev,u8 *dst, u8 *next_hop,struct mpath_info *pinfo); int (* dump_mpath) (struct wiphy *wiphy, struct net_device *dev,int idx, u8 *dst, u8 *next_hop,struct mpath_info *pinfo); int (* get_mesh_config) (struct wiphy *wiphy,struct net_device *dev,struct mesh_config *conf); int (* update_mesh_config) (struct wiphy *wiphy,struct net_device *dev, u32 mask,const struct mesh_config *nconf); int (* join_mesh) (struct wiphy *wiphy, struct net_device *dev,const struct mesh_config *conf,const struct mesh_setup *setup); int (* leave_mesh) (struct wiphy *wiphy, struct net_device *dev); int (* change_bss) (struct wiphy *wiphy, struct net_device *dev,struct bss_parameters *params); int (* set_txq_params) (struct wiphy *wiphy,struct ieee80211_txq_params *params); int (* set_channel) (struct wiphy *wiphy, struct net_device *dev,struct ieee80211_channel *chan,enum nl80211_channel_type channel_type); int (* scan) (struct wiphy *wiphy, struct net_device *dev,struct cfg80211_scan_request *request); int (* auth) (struct wiphy *wiphy, struct net_device *dev,struct cfg80211_auth_request *req); int (* assoc) (struct wiphy *wiphy, struct net_device *dev,struct cfg80211_assoc_request *req); int (* deauth) (struct wiphy *wiphy, struct net_device *dev,struct cfg80211_deauth_request *req,void *cookie); int (* disassoc) (struct wiphy *wiphy, struct net_device *dev,struct cfg80211_disassoc_request *req,void *cookie); int (* connect) (struct wiphy *wiphy, struct net_device *dev,struct cfg80211_connect_params *sme); int (* disconnect) (struct wiphy *wiphy, struct net_device *dev,u16 reason_code); int (* join_ibss) (struct wiphy *wiphy, struct net_device *dev,struct cfg80211_ibss_params *params); int (* leave_ibss) (struct wiphy *wiphy, struct net_device *dev); int (* set_wiphy_params) (struct wiphy *wiphy, u32 changed); int (* set_tx_power) (struct wiphy *wiphy,enum nl80211_tx_power_setting type, int mbm); int (* get_tx_power) (struct wiphy *wiphy, int *dbm); int (* set_wds_peer) (struct wiphy *wiphy, struct net_device *dev,const u8 *addr); void (* rfkill_poll) (struct wiphy *wiphy); #ifdef CONFIG_NL80211_TESTMODE int (* testmode_cmd) (struct wiphy *wiphy, void *data, int len); #endif int (* set_bitrate_mask) (struct wiphy *wiphy,struct net_device *dev,const u8 *peer,const struct cfg80211_bitrate_mask *mask); int (* dump_survey) (struct wiphy *wiphy, struct net_device *netdev,int idx, struct survey_info *info); int (* set_pmksa) (struct wiphy *wiphy, struct net_device *netdev,struct cfg80211_pmksa *pmksa); int (* del_pmksa) (struct wiphy *wiphy, struct net_device *netdev,struct cfg80211_pmksa *pmksa); int (* flush_pmksa) (struct wiphy *wiphy, struct net_device *netdev); int (* remain_on_channel) (struct wiphy *wiphy,struct net_device *dev,struct ieee80211_channel *chan,enum nl80211_channel_type channel_type,unsigned int duration,u64 *cookie); int (* cancel_remain_on_channel) (struct wiphy *wiphy,struct net_device *dev,u64 cookie); int (* mgmt_tx) (struct wiphy *wiphy, struct net_device *dev,struct ieee80211_channel *chan, bool offchan,enum nl80211_channel_type channel_type,bool channel_type_valid, unsigned int wait,const u8 *buf, size_t len, u64 *cookie); int (* mgmt_tx_cancel_wait) (struct wiphy *wiphy,struct net_device *dev,u64 cookie); int (* set_power_mgmt) (struct wiphy *wiphy, struct net_device *dev,bool enabled, int timeout); int (* set_cqm_rssi_config) (struct wiphy *wiphy,struct net_device *dev,s32 rssi_thold, u32 rssi_hyst); void (* mgmt_frame_register) (struct wiphy *wiphy,struct net_device *dev,u16 frame_type, bool reg); int (* set_antenna) (struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); int (* get_antenna) (struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant); }; </pre></div><div class="refsect1" title="Members"><a id="id3030718"></a><h2>Members</h2><div class="variablelist"><dl><dt><span class="term">suspend</span></dt><dd><p> wiphy device needs to be suspended </p></dd><dt><span class="term">resume</span></dt><dd><p> wiphy device needs to be resumed </p></dd><dt><span class="term">add_virtual_intf</span></dt><dd><p> create a new virtual interface with the given name, must set the struct wireless_dev's iftype. Beware: You must create the new netdev in the wiphy's network namespace! Returns the netdev, or an ERR_PTR. </p></dd><dt><span class="term">del_virtual_intf</span></dt><dd><p> remove the virtual interface determined by ifindex. </p></dd><dt><span class="term">change_virtual_intf</span></dt><dd><p> change type/configuration of virtual interface, keep the struct wireless_dev's iftype updated. </p></dd><dt><span class="term">add_key</span></dt><dd><p> add a key with the given parameters. <em class="parameter"><code>mac_addr</code></em> will be <code class="constant">NULL</code> when adding a group key. </p></dd><dt><span class="term">get_key</span></dt><dd><p> get information about the key with the given parameters. <em class="parameter"><code>mac_addr</code></em> will be <code class="constant">NULL</code> when requesting information for a group key. All pointers given to the <em class="parameter"><code>callback</code></em> function need not be valid after it returns. This function should return an error if it is not possible to retrieve the key, -ENOENT if it doesn't exist. </p></dd><dt><span class="term">del_key</span></dt><dd><p> remove a key given the <em class="parameter"><code>mac_addr</code></em> (<code class="constant">NULL</code> for a group key) and <em class="parameter"><code>key_index</code></em>, return -ENOENT if the key doesn't exist. </p></dd><dt><span class="term">set_default_key</span></dt><dd><p> set the default key on an interface </p></dd><dt><span class="term">set_default_mgmt_key</span></dt><dd><p> set the default management frame key on an interface </p></dd><dt><span class="term">add_beacon</span></dt><dd><p> Add a beacon with given parameters, <em class="parameter"><code>head</code></em>, <em class="parameter"><code>interval</code></em> and <em class="parameter"><code>dtim_period</code></em> will be valid, <em class="parameter"><code>tail</code></em> is optional. </p></dd><dt><span class="term">set_beacon</span></dt><dd><p> Change the beacon parameters for an access point mode interface. This should reject the call when no beacon has been configured. </p></dd><dt><span class="term">del_beacon</span></dt><dd><p> Remove beacon configuration and stop sending the beacon. </p></dd><dt><span class="term">add_station</span></dt><dd><p> Add a new station. </p></dd><dt><span class="term">del_station</span></dt><dd><p> Remove a station; <em class="parameter"><code>mac</code></em> may be NULL to remove all stations. </p></dd><dt><span class="term">change_station</span></dt><dd><p> Modify a given station. </p></dd><dt><span class="term">get_station</span></dt><dd><p> get station information for the station identified by <em class="parameter"><code>mac</code></em> </p></dd><dt><span class="term">dump_station</span></dt><dd><p> dump station callback -- resume dump at index <em class="parameter"><code>idx</code></em> </p></dd><dt><span class="term">add_mpath</span></dt><dd><p> add a fixed mesh path </p></dd><dt><span class="term">del_mpath</span></dt><dd><p> delete a given mesh path </p></dd><dt><span class="term">change_mpath</span></dt><dd><p> change a given mesh path </p></dd><dt><span class="term">get_mpath</span></dt><dd><p> get a mesh path for the given parameters </p></dd><dt><span class="term">dump_mpath</span></dt><dd><p> dump mesh path callback -- resume dump at index <em class="parameter"><code>idx</code></em> </p></dd><dt><span class="term">get_mesh_config</span></dt><dd><p> Get the current mesh configuration </p></dd><dt><span class="term">update_mesh_config</span></dt><dd><p> Update mesh parameters on a running mesh. The mask is a bitfield which tells us which parameters to set, and which to leave alone. </p></dd><dt><span class="term">join_mesh</span></dt><dd><p> join the mesh network with the specified parameters </p></dd><dt><span class="term">leave_mesh</span></dt><dd><p> leave the current mesh network </p></dd><dt><span class="term">change_bss</span></dt><dd><p> Modify parameters for a given BSS. </p></dd><dt><span class="term">set_txq_params</span></dt><dd><p> Set TX queue parameters </p></dd><dt><span class="term">set_channel</span></dt><dd><p> Set channel for a given wireless interface. Some devices may support multi-channel operation (by channel hopping) so cfg80211 doesn't verify much. Note, however, that the passed netdev may be <code class="constant">NULL</code> as well if the user requested changing the channel for the device itself, or for a monitor interface. </p></dd><dt><span class="term">scan</span></dt><dd><p> Request to do a scan. If returning zero, the scan request is given the driver, and will be valid until passed to <code class="function">cfg80211_scan_done</code>. For scan results, call <code class="function">cfg80211_inform_bss</code>; you can call this outside the scan/scan_done bracket too. </p></dd><dt><span class="term">auth</span></dt><dd><p> Request to authenticate with the specified peer </p></dd><dt><span class="term">assoc</span></dt><dd><p> Request to (re)associate with the specified peer </p></dd><dt><span class="term">deauth</span></dt><dd><p> Request to deauthenticate from the specified peer </p></dd><dt><span class="term">disassoc</span></dt><dd><p> Request to disassociate from the specified peer </p></dd><dt><span class="term">connect</span></dt><dd><p> Connect to the ESS with the specified parameters. When connected, call <code class="function">cfg80211_connect_result</code> with status code <code class="constant">WLAN_STATUS_SUCCESS</code>. If the connection fails for some reason, call <code class="function">cfg80211_connect_result</code> with the status from the AP. </p></dd><dt><span class="term">disconnect</span></dt><dd><p> Disconnect from the BSS/ESS. </p></dd><dt><span class="term">join_ibss</span></dt><dd><p> Join the specified IBSS (or create if necessary). Once done, call <code class="function">cfg80211_ibss_joined</code>, also call that function when changing BSSID due to a merge. </p></dd><dt><span class="term">leave_ibss</span></dt><dd><p> Leave the IBSS. </p></dd><dt><span class="term">set_wiphy_params</span></dt><dd><p> Notify that wiphy parameters have changed; <em class="parameter"><code>changed</code></em> bitfield (see <span class="structname">enum</span> wiphy_params_flags) describes which values have changed. The actual parameter values are available in struct wiphy. If returning an error, no value should be changed. </p></dd><dt><span class="term">set_tx_power</span></dt><dd><p> set the transmit power according to the parameters </p></dd><dt><span class="term">get_tx_power</span></dt><dd><p> store the current TX power into the dbm variable; return 0 if successful </p></dd><dt><span class="term">set_wds_peer</span></dt><dd><p> set the WDS peer for a WDS interface </p></dd><dt><span class="term">rfkill_poll</span></dt><dd><p> polls the hw rfkill line, use cfg80211 reporting functions to adjust rfkill hw state </p></dd><dt><span class="term">testmode_cmd</span></dt><dd><p> run a test mode command </p></dd><dt><span class="term">set_bitrate_mask</span></dt><dd><p> set the bitrate mask configuration </p></dd><dt><span class="term">dump_survey</span></dt><dd><p> get site survey information. </p></dd><dt><span class="term">set_pmksa</span></dt><dd><p> Cache a PMKID for a BSSID. This is mostly useful for fullmac devices running firmwares capable of generating the (re) association RSN IE. It allows for faster roaming between WPA2 BSSIDs. </p></dd><dt><span class="term">del_pmksa</span></dt><dd><p> Delete a cached PMKID. </p></dd><dt><span class="term">flush_pmksa</span></dt><dd><p> Flush all cached PMKIDs. </p></dd><dt><span class="term">remain_on_channel</span></dt><dd><p> Request the driver to remain awake on the specified channel for the specified duration to complete an off-channel operation (e.g., public action frame exchange). When the driver is ready on the requested channel, it must indicate this with an event notification by calling <code class="function">cfg80211_ready_on_channel</code>. </p></dd><dt><span class="term">cancel_remain_on_channel</span></dt><dd><p> Cancel an on-going remain-on-channel operation. This allows the operation to be terminated prior to timeout based on the duration value. </p></dd><dt><span class="term">mgmt_tx</span></dt><dd><p> Transmit a management frame. </p></dd><dt><span class="term">mgmt_tx_cancel_wait</span></dt><dd><p> Cancel the wait time from transmitting a management frame on another channel </p></dd><dt><span class="term">set_power_mgmt</span></dt><dd><p> Configure WLAN power management. A timeout value of -1 allows the driver to adjust the dynamic ps timeout value. </p></dd><dt><span class="term">set_cqm_rssi_config</span></dt><dd><p> Configure connection quality monitor RSSI threshold. </p></dd><dt><span class="term">mgmt_frame_register</span></dt><dd><p> Notify driver that a management frame type was registered. Note that this callback may not sleep, and cannot run concurrently with itself. </p></dd><dt><span class="term">set_antenna</span></dt><dd><p> Set antenna configuration (tx_ant, rx_ant) on the device. Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may reject TX/RX mask combinations they cannot support by returning -EINVAL (also see nl80211.h <em class="parameter"><code>NL80211_ATTR_WIPHY_ANTENNA_TX</code></em>). </p></dd><dt><span class="term">get_antenna</span></dt><dd><p> Get current antenna configuration from device (tx_ant, rx_ant). </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id3031578"></a><h2>Description</h2><p> </p><p> This struct is registered by fullmac card drivers and/or wireless stacks in order to handle configuration requests on their interfaces. </p><p> All callbacks except where otherwise noted should return 0 on success or a negative error code. </p><p> All operations are currently invoked under rtnl for consistency with the wireless extensions but this is subject to reevaluation as soon as this code is used more widely and we have a first user without wext. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01ch02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk01ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-vif-params.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Actions and configuration </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>struct vif_params</span></td></tr></table></div></body></html>