aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-01-01 15:39:56 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-01-01 15:39:56 -0500
commitad86c55bac643a745f480d26689d153ec0f38b04 (patch)
tree8ae3e20d2f3619021393166fe1f50a8ca00c1c33 /include/net
parent21eb218989523b7bee28900aaec9f9296b70fa27 (diff)
parent39731b78b4afebb7501c05b68e2443a1b250b41c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h123
-rw-r--r--include/net/mac80211.h45
2 files changed, 155 insertions, 13 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e9abc7b536cd..80a10212b1b9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -747,6 +747,8 @@ enum station_parameters_apply_mask {
747 * @supported_channels_len: number of supported channels 747 * @supported_channels_len: number of supported channels
748 * @supported_oper_classes: supported oper classes in IEEE 802.11 format 748 * @supported_oper_classes: supported oper classes in IEEE 802.11 format
749 * @supported_oper_classes_len: number of supported operating classes 749 * @supported_oper_classes_len: number of supported operating classes
750 * @opmode_notif: operating mode field from Operating Mode Notification
751 * @opmode_notif_used: information if operating mode field is used
750 */ 752 */
751struct station_parameters { 753struct station_parameters {
752 const u8 *supported_rates; 754 const u8 *supported_rates;
@@ -770,6 +772,8 @@ struct station_parameters {
770 u8 supported_channels_len; 772 u8 supported_channels_len;
771 const u8 *supported_oper_classes; 773 const u8 *supported_oper_classes;
772 u8 supported_oper_classes_len; 774 u8 supported_oper_classes_len;
775 u8 opmode_notif;
776 bool opmode_notif_used;
773}; 777};
774 778
775/** 779/**
@@ -1762,7 +1766,8 @@ enum wiphy_params_flags {
1762struct cfg80211_bitrate_mask { 1766struct cfg80211_bitrate_mask {
1763 struct { 1767 struct {
1764 u32 legacy; 1768 u32 legacy;
1765 u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; 1769 u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
1770 u16 vht_mcs[NL80211_VHT_NSS_MAX];
1766 } control[IEEE80211_NUM_BANDS]; 1771 } control[IEEE80211_NUM_BANDS];
1767}; 1772};
1768/** 1773/**
@@ -2676,6 +2681,34 @@ struct wiphy_coalesce_support {
2676}; 2681};
2677 2682
2678/** 2683/**
2684 * enum wiphy_vendor_command_flags - validation flags for vendor commands
2685 * @WIPHY_VENDOR_CMD_NEED_WDEV: vendor command requires wdev
2686 * @WIPHY_VENDOR_CMD_NEED_NETDEV: vendor command requires netdev
2687 * @WIPHY_VENDOR_CMD_NEED_RUNNING: interface/wdev must be up & running
2688 * (must be combined with %_WDEV or %_NETDEV)
2689 */
2690enum wiphy_vendor_command_flags {
2691 WIPHY_VENDOR_CMD_NEED_WDEV = BIT(0),
2692 WIPHY_VENDOR_CMD_NEED_NETDEV = BIT(1),
2693 WIPHY_VENDOR_CMD_NEED_RUNNING = BIT(2),
2694};
2695
2696/**
2697 * struct wiphy_vendor_command - vendor command definition
2698 * @info: vendor command identifying information, as used in nl80211
2699 * @flags: flags, see &enum wiphy_vendor_command_flags
2700 * @doit: callback for the operation, note that wdev is %NULL if the
2701 * flags didn't ask for a wdev and non-%NULL otherwise; the data
2702 * pointer may be %NULL if userspace provided no data at all
2703 */
2704struct wiphy_vendor_command {
2705 struct nl80211_vendor_cmd_info info;
2706 u32 flags;
2707 int (*doit)(struct wiphy *wiphy, struct wireless_dev *wdev,
2708 const void *data, int data_len);
2709};
2710
2711/**
2679 * struct wiphy - wireless hardware description 2712 * struct wiphy - wireless hardware description
2680 * @reg_notifier: the driver's regulatory notification callback, 2713 * @reg_notifier: the driver's regulatory notification callback,
2681 * note that if your driver uses wiphy_apply_custom_regulatory() 2714 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2788,6 +2821,9 @@ struct wiphy_coalesce_support {
2788 * @extended_capabilities_mask: mask of the valid values 2821 * @extended_capabilities_mask: mask of the valid values
2789 * @extended_capabilities_len: length of the extended capabilities 2822 * @extended_capabilities_len: length of the extended capabilities
2790 * @coalesce: packet coalescing support information 2823 * @coalesce: packet coalescing support information
2824 *
2825 * @vendor_commands: array of vendor commands supported by the hardware
2826 * @n_vendor_commands: number of vendor commands
2791 */ 2827 */
2792struct wiphy { 2828struct wiphy {
2793 /* assign these fields before you register the wiphy */ 2829 /* assign these fields before you register the wiphy */
@@ -2899,6 +2935,9 @@ struct wiphy {
2899 2935
2900 const struct wiphy_coalesce_support *coalesce; 2936 const struct wiphy_coalesce_support *coalesce;
2901 2937
2938 const struct wiphy_vendor_command *vendor_commands;
2939 int n_vendor_commands;
2940
2902 char priv[0] __aligned(NETDEV_ALIGN); 2941 char priv[0] __aligned(NETDEV_ALIGN);
2903}; 2942};
2904 2943
@@ -3843,6 +3882,75 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy);
3843 */ 3882 */
3844void wiphy_rfkill_stop_polling(struct wiphy *wiphy); 3883void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3845 3884
3885/**
3886 * DOC: Vendor commands
3887 *
3888 * Occasionally, there are special protocol or firmware features that
3889 * can't be implemented very openly. For this and similar cases, the
3890 * vendor command functionality allows implementing the features with
3891 * (typically closed-source) userspace and firmware, using nl80211 as
3892 * the configuration mechanism.
3893 *
3894 * A driver supporting vendor commands must register them as an array
3895 * in struct wiphy, with handlers for each one, each command has an
3896 * OUI and sub command ID to identify it.
3897 *
3898 * Note that this feature should not be (ab)used to implement protocol
3899 * features that could openly be shared across drivers. In particular,
3900 * it must never be required to use vendor commands to implement any
3901 * "normal" functionality that higher-level userspace like connection
3902 * managers etc. need.
3903 */
3904
3905struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
3906 enum nl80211_commands cmd,
3907 enum nl80211_attrs attr,
3908 int approxlen);
3909
3910/**
3911 * cfg80211_vendor_cmd_alloc_reply_skb - allocate vendor command reply
3912 * @wiphy: the wiphy
3913 * @approxlen: an upper bound of the length of the data that will
3914 * be put into the skb
3915 *
3916 * This function allocates and pre-fills an skb for a reply to
3917 * a vendor command. Since it is intended for a reply, calling
3918 * it outside of a vendor command's doit() operation is invalid.
3919 *
3920 * The returned skb is pre-filled with some identifying data in
3921 * a way that any data that is put into the skb (with skb_put(),
3922 * nla_put() or similar) will end up being within the
3923 * %NL80211_ATTR_VENDOR_DATA attribute, so all that needs to be done
3924 * with the skb is adding data for the corresponding userspace tool
3925 * which can then read that data out of the vendor data attribute.
3926 * You must not modify the skb in any other way.
3927 *
3928 * When done, call cfg80211_vendor_cmd_reply() with the skb and return
3929 * its error code as the result of the doit() operation.
3930 *
3931 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3932 */
3933static inline struct sk_buff *
3934cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
3935{
3936 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_VENDOR,
3937 NL80211_ATTR_VENDOR_DATA, approxlen);
3938}
3939
3940/**
3941 * cfg80211_vendor_cmd_reply - send the reply skb
3942 * @skb: The skb, must have been allocated with
3943 * cfg80211_vendor_cmd_alloc_reply_skb()
3944 *
3945 * Since calling this function will usually be the last thing
3946 * before returning from the vendor command doit() you should
3947 * return the error code. Note that this function consumes the
3948 * skb regardless of the return value.
3949 *
3950 * Return: An error code or 0 on success.
3951 */
3952int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
3953
3846#ifdef CONFIG_NL80211_TESTMODE 3954#ifdef CONFIG_NL80211_TESTMODE
3847/** 3955/**
3848 * DOC: Test mode 3956 * DOC: Test mode
@@ -3878,8 +3986,12 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3878 * 3986 *
3879 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 3987 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3880 */ 3988 */
3881struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, 3989static inline struct sk_buff *
3882 int approxlen); 3990cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
3991{
3992 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_TESTMODE,
3993 NL80211_ATTR_TESTDATA, approxlen);
3994}
3883 3995
3884/** 3996/**
3885 * cfg80211_testmode_reply - send the reply skb 3997 * cfg80211_testmode_reply - send the reply skb
@@ -3893,7 +4005,10 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
3893 * 4005 *
3894 * Return: An error code or 0 on success. 4006 * Return: An error code or 0 on success.
3895 */ 4007 */
3896int cfg80211_testmode_reply(struct sk_buff *skb); 4008static inline int cfg80211_testmode_reply(struct sk_buff *skb)
4009{
4010 return cfg80211_vendor_cmd_reply(skb);
4011}
3897 4012
3898/** 4013/**
3899 * cfg80211_testmode_alloc_event_skb - allocate testmode event 4014 * cfg80211_testmode_alloc_event_skb - allocate testmode event
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 3cd408b326de..531785f5819e 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1163,6 +1163,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
1163} 1163}
1164 1164
1165/** 1165/**
1166 * wdev_to_ieee80211_vif - return a vif struct from a wdev
1167 * @wdev: the wdev to get the vif for
1168 *
1169 * This can be used by mac80211 drivers with direct cfg80211 APIs
1170 * (like the vendor commands) that get a wdev.
1171 *
1172 * Note that this function may return %NULL if the given wdev isn't
1173 * associated with a vif that the driver knows about (e.g. monitor
1174 * or AP_VLAN interfaces.)
1175 */
1176struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1177
1178/**
1166 * enum ieee80211_key_flags - key flags 1179 * enum ieee80211_key_flags - key flags
1167 * 1180 *
1168 * These flags are used for communication about keys between the driver 1181 * These flags are used for communication about keys between the driver
@@ -1600,6 +1613,9 @@ enum ieee80211_hw_flags {
1600 * @extra_tx_headroom: headroom to reserve in each transmit skb 1613 * @extra_tx_headroom: headroom to reserve in each transmit skb
1601 * for use by the driver (e.g. for transmit headers.) 1614 * for use by the driver (e.g. for transmit headers.)
1602 * 1615 *
1616 * @extra_beacon_tailroom: tailroom to reserve in each beacon tx skb.
1617 * Can be used by drivers to add extra IEs.
1618 *
1603 * @channel_change_time: time (in microseconds) it takes to change channels. 1619 * @channel_change_time: time (in microseconds) it takes to change channels.
1604 * 1620 *
1605 * @max_signal: Maximum value for signal (rssi) in RX information, used 1621 * @max_signal: Maximum value for signal (rssi) in RX information, used
@@ -1682,6 +1698,7 @@ struct ieee80211_hw {
1682 void *priv; 1698 void *priv;
1683 u32 flags; 1699 u32 flags;
1684 unsigned int extra_tx_headroom; 1700 unsigned int extra_tx_headroom;
1701 unsigned int extra_beacon_tailroom;
1685 int channel_change_time; 1702 int channel_change_time;
1686 int vif_data_size; 1703 int vif_data_size;
1687 int sta_data_size; 1704 int sta_data_size;
@@ -2398,9 +2415,6 @@ enum ieee80211_roc_type {
2398 * See the section "Frame filtering" for more information. 2415 * See the section "Frame filtering" for more information.
2399 * This callback must be implemented and can sleep. 2416 * This callback must be implemented and can sleep.
2400 * 2417 *
2401 * @set_multicast_list: Configure the device's interface specific RX multicast
2402 * filter. This callback is optional. This callback must be atomic.
2403 *
2404 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 2418 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
2405 * must be set or cleared for a given STA. Must be atomic. 2419 * must be set or cleared for a given STA. Must be atomic.
2406 * 2420 *
@@ -2485,7 +2499,11 @@ enum ieee80211_roc_type {
2485 * AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2499 * AP, IBSS/WDS/mesh peer etc. This callback can sleep.
2486 * 2500 *
2487 * @sta_remove: Notifies low level driver about removal of an associated 2501 * @sta_remove: Notifies low level driver about removal of an associated
2488 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2502 * station, AP, IBSS/WDS/mesh peer etc. Note that after the callback
2503 * returns it isn't safe to use the pointer, not even RCU protected;
2504 * no RCU grace period is guaranteed between returning here and freeing
2505 * the station. See @sta_pre_rcu_remove if needed.
2506 * This callback can sleep.
2489 * 2507 *
2490 * @sta_add_debugfs: Drivers can use this callback to add debugfs files 2508 * @sta_add_debugfs: Drivers can use this callback to add debugfs files
2491 * when a station is added to mac80211's station list. This callback 2509 * when a station is added to mac80211's station list. This callback
@@ -2504,7 +2522,17 @@ enum ieee80211_roc_type {
2504 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) 2522 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
2505 * This callback is mutually exclusive with @sta_add/@sta_remove. 2523 * This callback is mutually exclusive with @sta_add/@sta_remove.
2506 * It must not fail for down transitions but may fail for transitions 2524 * It must not fail for down transitions but may fail for transitions
2507 * up the list of states. 2525 * up the list of states. Also note that after the callback returns it
2526 * isn't safe to use the pointer, not even RCU protected - no RCU grace
2527 * period is guaranteed between returning here and freeing the station.
2528 * See @sta_pre_rcu_remove if needed.
2529 * The callback can sleep.
2530 *
2531 * @sta_pre_rcu_remove: Notify driver about station removal before RCU
2532 * synchronisation. This is useful if a driver needs to have station
2533 * pointers protected using RCU, it can then use this call to clear
2534 * the pointers instead of waiting for an RCU grace period to elapse
2535 * in @sta_state.
2508 * The callback can sleep. 2536 * The callback can sleep.
2509 * 2537 *
2510 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be 2538 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be
@@ -2764,10 +2792,6 @@ struct ieee80211_ops {
2764 unsigned int changed_flags, 2792 unsigned int changed_flags,
2765 unsigned int *total_flags, 2793 unsigned int *total_flags,
2766 u64 multicast); 2794 u64 multicast);
2767 void (*set_multicast_list)(struct ieee80211_hw *hw,
2768 struct ieee80211_vif *vif, bool allmulti,
2769 struct netdev_hw_addr_list *mc_list);
2770
2771 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2795 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
2772 bool set); 2796 bool set);
2773 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 2797 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
@@ -2821,6 +2845,9 @@ struct ieee80211_ops {
2821 struct ieee80211_sta *sta, 2845 struct ieee80211_sta *sta,
2822 enum ieee80211_sta_state old_state, 2846 enum ieee80211_sta_state old_state,
2823 enum ieee80211_sta_state new_state); 2847 enum ieee80211_sta_state new_state);
2848 void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw,
2849 struct ieee80211_vif *vif,
2850 struct ieee80211_sta *sta);
2824 void (*sta_rc_update)(struct ieee80211_hw *hw, 2851 void (*sta_rc_update)(struct ieee80211_hw *hw,
2825 struct ieee80211_vif *vif, 2852 struct ieee80211_vif *vif,
2826 struct ieee80211_sta *sta, 2853 struct ieee80211_sta *sta,