diff options
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 107 |
1 files changed, 72 insertions, 35 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 51f67a9003a9..493fa0c79005 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -999,7 +999,7 @@ struct cfg80211_ssid { | |||
999 | * @ie_len: length of ie in octets | 999 | * @ie_len: length of ie in octets |
1000 | * @rates: bitmap of rates to advertise for each band | 1000 | * @rates: bitmap of rates to advertise for each band |
1001 | * @wiphy: the wiphy this was for | 1001 | * @wiphy: the wiphy this was for |
1002 | * @dev: the interface | 1002 | * @wdev: the wireless device to scan for |
1003 | * @aborted: (internal) scan request was notified as aborted | 1003 | * @aborted: (internal) scan request was notified as aborted |
1004 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band | 1004 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band |
1005 | */ | 1005 | */ |
@@ -1012,9 +1012,10 @@ struct cfg80211_scan_request { | |||
1012 | 1012 | ||
1013 | u32 rates[IEEE80211_NUM_BANDS]; | 1013 | u32 rates[IEEE80211_NUM_BANDS]; |
1014 | 1014 | ||
1015 | struct wireless_dev *wdev; | ||
1016 | |||
1015 | /* internal */ | 1017 | /* internal */ |
1016 | struct wiphy *wiphy; | 1018 | struct wiphy *wiphy; |
1017 | struct net_device *dev; | ||
1018 | bool aborted; | 1019 | bool aborted; |
1019 | bool no_cck; | 1020 | bool no_cck; |
1020 | 1021 | ||
@@ -1435,10 +1436,10 @@ struct cfg80211_gtk_rekey_data { | |||
1435 | * | 1436 | * |
1436 | * @add_virtual_intf: create a new virtual interface with the given name, | 1437 | * @add_virtual_intf: create a new virtual interface with the given name, |
1437 | * must set the struct wireless_dev's iftype. Beware: You must create | 1438 | * must set the struct wireless_dev's iftype. Beware: You must create |
1438 | * the new netdev in the wiphy's network namespace! Returns the netdev, | 1439 | * the new netdev in the wiphy's network namespace! Returns the struct |
1439 | * or an ERR_PTR. | 1440 | * wireless_dev, or an ERR_PTR. |
1440 | * | 1441 | * |
1441 | * @del_virtual_intf: remove the virtual interface determined by ifindex. | 1442 | * @del_virtual_intf: remove the virtual interface |
1442 | * | 1443 | * |
1443 | * @change_virtual_intf: change type/configuration of virtual interface, | 1444 | * @change_virtual_intf: change type/configuration of virtual interface, |
1444 | * keep the struct wireless_dev's iftype updated. | 1445 | * keep the struct wireless_dev's iftype updated. |
@@ -1503,8 +1504,6 @@ struct cfg80211_gtk_rekey_data { | |||
1503 | * interfaces are active this callback should reject the configuration. | 1504 | * interfaces are active this callback should reject the configuration. |
1504 | * If no interfaces are active or the device is down, the channel should | 1505 | * If no interfaces are active or the device is down, the channel should |
1505 | * be stored for when a monitor interface becomes active. | 1506 | * be stored for when a monitor interface becomes active. |
1506 | * @set_monitor_enabled: Notify driver that there are only monitor | ||
1507 | * interfaces running. | ||
1508 | * | 1507 | * |
1509 | * @scan: Request to do a scan. If returning zero, the scan request is given | 1508 | * @scan: Request to do a scan. If returning zero, the scan request is given |
1510 | * the driver, and will be valid until passed to cfg80211_scan_done(). | 1509 | * the driver, and will be valid until passed to cfg80211_scan_done(). |
@@ -1574,6 +1573,8 @@ struct cfg80211_gtk_rekey_data { | |||
1574 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 | 1573 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 |
1575 | * allows the driver to adjust the dynamic ps timeout value. | 1574 | * allows the driver to adjust the dynamic ps timeout value. |
1576 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. | 1575 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. |
1576 | * @set_cqm_txe_config: Configure connection quality monitor TX error | ||
1577 | * thresholds. | ||
1577 | * @sched_scan_start: Tell the driver to start a scheduled scan. | 1578 | * @sched_scan_start: Tell the driver to start a scheduled scan. |
1578 | * @sched_scan_stop: Tell the driver to stop an ongoing scheduled | 1579 | * @sched_scan_stop: Tell the driver to stop an ongoing scheduled |
1579 | * scan. The driver_initiated flag specifies whether the driver | 1580 | * scan. The driver_initiated flag specifies whether the driver |
@@ -1611,18 +1612,23 @@ struct cfg80211_gtk_rekey_data { | |||
1611 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | 1612 | * @get_et_strings: Ethtool API to get a set of strings to describe stats |
1612 | * and perhaps other supported types of ethtool data-sets. | 1613 | * and perhaps other supported types of ethtool data-sets. |
1613 | * See @ethtool_ops.get_strings | 1614 | * See @ethtool_ops.get_strings |
1615 | * | ||
1616 | * @get_channel: Get the current operating channel for the virtual interface. | ||
1617 | * For monitor interfaces, it should return %NULL unless there's a single | ||
1618 | * current monitoring channel. | ||
1614 | */ | 1619 | */ |
1615 | struct cfg80211_ops { | 1620 | struct cfg80211_ops { |
1616 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 1621 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
1617 | int (*resume)(struct wiphy *wiphy); | 1622 | int (*resume)(struct wiphy *wiphy); |
1618 | void (*set_wakeup)(struct wiphy *wiphy, bool enabled); | 1623 | void (*set_wakeup)(struct wiphy *wiphy, bool enabled); |
1619 | 1624 | ||
1620 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, | 1625 | struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy, |
1621 | char *name, | 1626 | char *name, |
1622 | enum nl80211_iftype type, | 1627 | enum nl80211_iftype type, |
1623 | u32 *flags, | 1628 | u32 *flags, |
1624 | struct vif_params *params); | 1629 | struct vif_params *params); |
1625 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); | 1630 | int (*del_virtual_intf)(struct wiphy *wiphy, |
1631 | struct wireless_dev *wdev); | ||
1626 | int (*change_virtual_intf)(struct wiphy *wiphy, | 1632 | int (*change_virtual_intf)(struct wiphy *wiphy, |
1627 | struct net_device *dev, | 1633 | struct net_device *dev, |
1628 | enum nl80211_iftype type, u32 *flags, | 1634 | enum nl80211_iftype type, u32 *flags, |
@@ -1699,7 +1705,7 @@ struct cfg80211_ops { | |||
1699 | struct ieee80211_channel *chan, | 1705 | struct ieee80211_channel *chan, |
1700 | enum nl80211_channel_type channel_type); | 1706 | enum nl80211_channel_type channel_type); |
1701 | 1707 | ||
1702 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, | 1708 | int (*scan)(struct wiphy *wiphy, |
1703 | struct cfg80211_scan_request *request); | 1709 | struct cfg80211_scan_request *request); |
1704 | 1710 | ||
1705 | int (*auth)(struct wiphy *wiphy, struct net_device *dev, | 1711 | int (*auth)(struct wiphy *wiphy, struct net_device *dev, |
@@ -1753,23 +1759,23 @@ struct cfg80211_ops { | |||
1753 | int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); | 1759 | int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); |
1754 | 1760 | ||
1755 | int (*remain_on_channel)(struct wiphy *wiphy, | 1761 | int (*remain_on_channel)(struct wiphy *wiphy, |
1756 | struct net_device *dev, | 1762 | struct wireless_dev *wdev, |
1757 | struct ieee80211_channel *chan, | 1763 | struct ieee80211_channel *chan, |
1758 | enum nl80211_channel_type channel_type, | 1764 | enum nl80211_channel_type channel_type, |
1759 | unsigned int duration, | 1765 | unsigned int duration, |
1760 | u64 *cookie); | 1766 | u64 *cookie); |
1761 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1767 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
1762 | struct net_device *dev, | 1768 | struct wireless_dev *wdev, |
1763 | u64 cookie); | 1769 | u64 cookie); |
1764 | 1770 | ||
1765 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, | 1771 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1766 | struct ieee80211_channel *chan, bool offchan, | 1772 | struct ieee80211_channel *chan, bool offchan, |
1767 | enum nl80211_channel_type channel_type, | 1773 | enum nl80211_channel_type channel_type, |
1768 | bool channel_type_valid, unsigned int wait, | 1774 | bool channel_type_valid, unsigned int wait, |
1769 | const u8 *buf, size_t len, bool no_cck, | 1775 | const u8 *buf, size_t len, bool no_cck, |
1770 | bool dont_wait_for_ack, u64 *cookie); | 1776 | bool dont_wait_for_ack, u64 *cookie); |
1771 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1777 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
1772 | struct net_device *dev, | 1778 | struct wireless_dev *wdev, |
1773 | u64 cookie); | 1779 | u64 cookie); |
1774 | 1780 | ||
1775 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1781 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
@@ -1779,8 +1785,12 @@ struct cfg80211_ops { | |||
1779 | struct net_device *dev, | 1785 | struct net_device *dev, |
1780 | s32 rssi_thold, u32 rssi_hyst); | 1786 | s32 rssi_thold, u32 rssi_hyst); |
1781 | 1787 | ||
1788 | int (*set_cqm_txe_config)(struct wiphy *wiphy, | ||
1789 | struct net_device *dev, | ||
1790 | u32 rate, u32 pkts, u32 intvl); | ||
1791 | |||
1782 | void (*mgmt_frame_register)(struct wiphy *wiphy, | 1792 | void (*mgmt_frame_register)(struct wiphy *wiphy, |
1783 | struct net_device *dev, | 1793 | struct wireless_dev *wdev, |
1784 | u16 frame_type, bool reg); | 1794 | u16 frame_type, bool reg); |
1785 | 1795 | ||
1786 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); | 1796 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); |
@@ -1818,7 +1828,10 @@ struct cfg80211_ops { | |||
1818 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1828 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
1819 | u32 sset, u8 *data); | 1829 | u32 sset, u8 *data); |
1820 | 1830 | ||
1821 | void (*set_monitor_enabled)(struct wiphy *wiphy, bool enabled); | 1831 | struct ieee80211_channel * |
1832 | (*get_channel)(struct wiphy *wiphy, | ||
1833 | struct wireless_dev *wdev, | ||
1834 | enum nl80211_channel_type *type); | ||
1822 | }; | 1835 | }; |
1823 | 1836 | ||
1824 | /* | 1837 | /* |
@@ -2341,17 +2354,25 @@ struct cfg80211_internal_bss; | |||
2341 | struct cfg80211_cached_keys; | 2354 | struct cfg80211_cached_keys; |
2342 | 2355 | ||
2343 | /** | 2356 | /** |
2344 | * struct wireless_dev - wireless per-netdev state | 2357 | * struct wireless_dev - wireless device state |
2358 | * | ||
2359 | * For netdevs, this structure must be allocated by the driver | ||
2360 | * that uses the ieee80211_ptr field in struct net_device (this | ||
2361 | * is intentional so it can be allocated along with the netdev.) | ||
2362 | * It need not be registered then as netdev registration will | ||
2363 | * be intercepted by cfg80211 to see the new wireless device. | ||
2345 | * | 2364 | * |
2346 | * This structure must be allocated by the driver/stack | 2365 | * For non-netdev uses, it must also be allocated by the driver |
2347 | * that uses the ieee80211_ptr field in struct net_device | 2366 | * in response to the cfg80211 callbacks that require it, as |
2348 | * (this is intentional so it can be allocated along with | 2367 | * there's no netdev registration in that case it may not be |
2349 | * the netdev.) | 2368 | * allocated outside of callback operations that return it. |
2350 | * | 2369 | * |
2351 | * @wiphy: pointer to hardware description | 2370 | * @wiphy: pointer to hardware description |
2352 | * @iftype: interface type | 2371 | * @iftype: interface type |
2353 | * @list: (private) Used to collect the interfaces | 2372 | * @list: (private) Used to collect the interfaces |
2354 | * @netdev: (private) Used to reference back to the netdev | 2373 | * @netdev: (private) Used to reference back to the netdev, may be %NULL |
2374 | * @identifier: (private) Identifier used in nl80211 to identify this | ||
2375 | * wireless device if it has no netdev | ||
2355 | * @current_bss: (private) Used by the internal configuration code | 2376 | * @current_bss: (private) Used by the internal configuration code |
2356 | * @channel: (private) Used by the internal configuration code to track | 2377 | * @channel: (private) Used by the internal configuration code to track |
2357 | * the user-set AP, monitor and WDS channel | 2378 | * the user-set AP, monitor and WDS channel |
@@ -2383,6 +2404,8 @@ struct wireless_dev { | |||
2383 | struct list_head list; | 2404 | struct list_head list; |
2384 | struct net_device *netdev; | 2405 | struct net_device *netdev; |
2385 | 2406 | ||
2407 | u32 identifier; | ||
2408 | |||
2386 | struct list_head mgmt_registrations; | 2409 | struct list_head mgmt_registrations; |
2387 | spinlock_t mgmt_registrations_lock; | 2410 | spinlock_t mgmt_registrations_lock; |
2388 | 2411 | ||
@@ -3269,7 +3292,7 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3269 | 3292 | ||
3270 | /** | 3293 | /** |
3271 | * cfg80211_ready_on_channel - notification of remain_on_channel start | 3294 | * cfg80211_ready_on_channel - notification of remain_on_channel start |
3272 | * @dev: network device | 3295 | * @wdev: wireless device |
3273 | * @cookie: the request cookie | 3296 | * @cookie: the request cookie |
3274 | * @chan: The current channel (from remain_on_channel request) | 3297 | * @chan: The current channel (from remain_on_channel request) |
3275 | * @channel_type: Channel type | 3298 | * @channel_type: Channel type |
@@ -3277,21 +3300,20 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3277 | * channel | 3300 | * channel |
3278 | * @gfp: allocation flags | 3301 | * @gfp: allocation flags |
3279 | */ | 3302 | */ |
3280 | void cfg80211_ready_on_channel(struct net_device *dev, u64 cookie, | 3303 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
3281 | struct ieee80211_channel *chan, | 3304 | struct ieee80211_channel *chan, |
3282 | enum nl80211_channel_type channel_type, | 3305 | enum nl80211_channel_type channel_type, |
3283 | unsigned int duration, gfp_t gfp); | 3306 | unsigned int duration, gfp_t gfp); |
3284 | 3307 | ||
3285 | /** | 3308 | /** |
3286 | * cfg80211_remain_on_channel_expired - remain_on_channel duration expired | 3309 | * cfg80211_remain_on_channel_expired - remain_on_channel duration expired |
3287 | * @dev: network device | 3310 | * @wdev: wireless device |
3288 | * @cookie: the request cookie | 3311 | * @cookie: the request cookie |
3289 | * @chan: The current channel (from remain_on_channel request) | 3312 | * @chan: The current channel (from remain_on_channel request) |
3290 | * @channel_type: Channel type | 3313 | * @channel_type: Channel type |
3291 | * @gfp: allocation flags | 3314 | * @gfp: allocation flags |
3292 | */ | 3315 | */ |
3293 | void cfg80211_remain_on_channel_expired(struct net_device *dev, | 3316 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
3294 | u64 cookie, | ||
3295 | struct ieee80211_channel *chan, | 3317 | struct ieee80211_channel *chan, |
3296 | enum nl80211_channel_type channel_type, | 3318 | enum nl80211_channel_type channel_type, |
3297 | gfp_t gfp); | 3319 | gfp_t gfp); |
@@ -3319,7 +3341,7 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | |||
3319 | 3341 | ||
3320 | /** | 3342 | /** |
3321 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame | 3343 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
3322 | * @dev: network device | 3344 | * @wdev: wireless device receiving the frame |
3323 | * @freq: Frequency on which the frame was received in MHz | 3345 | * @freq: Frequency on which the frame was received in MHz |
3324 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 3346 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
3325 | * @buf: Management frame (header + body) | 3347 | * @buf: Management frame (header + body) |
@@ -3334,12 +3356,12 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | |||
3334 | * This function is called whenever an Action frame is received for a station | 3356 | * This function is called whenever an Action frame is received for a station |
3335 | * mode interface, but is not processed in kernel. | 3357 | * mode interface, but is not processed in kernel. |
3336 | */ | 3358 | */ |
3337 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm, | 3359 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, |
3338 | const u8 *buf, size_t len, gfp_t gfp); | 3360 | const u8 *buf, size_t len, gfp_t gfp); |
3339 | 3361 | ||
3340 | /** | 3362 | /** |
3341 | * cfg80211_mgmt_tx_status - notification of TX status for management frame | 3363 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
3342 | * @dev: network device | 3364 | * @wdev: wireless device receiving the frame |
3343 | * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() | 3365 | * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() |
3344 | * @buf: Management frame (header + body) | 3366 | * @buf: Management frame (header + body) |
3345 | * @len: length of the frame data | 3367 | * @len: length of the frame data |
@@ -3350,7 +3372,7 @@ bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm, | |||
3350 | * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the | 3372 | * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the |
3351 | * transmission attempt. | 3373 | * transmission attempt. |
3352 | */ | 3374 | */ |
3353 | void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie, | 3375 | void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, |
3354 | const u8 *buf, size_t len, bool ack, gfp_t gfp); | 3376 | const u8 *buf, size_t len, bool ack, gfp_t gfp); |
3355 | 3377 | ||
3356 | 3378 | ||
@@ -3380,6 +3402,21 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev, | |||
3380 | const u8 *peer, u32 num_packets, gfp_t gfp); | 3402 | const u8 *peer, u32 num_packets, gfp_t gfp); |
3381 | 3403 | ||
3382 | /** | 3404 | /** |
3405 | * cfg80211_cqm_txe_notify - TX error rate event | ||
3406 | * @dev: network device | ||
3407 | * @peer: peer's MAC address | ||
3408 | * @num_packets: how many packets were lost | ||
3409 | * @rate: % of packets which failed transmission | ||
3410 | * @intvl: interval (in s) over which the TX failure threshold was breached. | ||
3411 | * @gfp: context flags | ||
3412 | * | ||
3413 | * Notify userspace when configured % TX failures over number of packets in a | ||
3414 | * given interval is exceeded. | ||
3415 | */ | ||
3416 | void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer, | ||
3417 | u32 num_packets, u32 rate, u32 intvl, gfp_t gfp); | ||
3418 | |||
3419 | /** | ||
3383 | * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying | 3420 | * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying |
3384 | * @dev: network device | 3421 | * @dev: network device |
3385 | * @bssid: BSSID of AP (to avoid races) | 3422 | * @bssid: BSSID of AP (to avoid races) |