aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ieee80211.h4
-rw-r--r--include/net/cfg80211.h5
-rw-r--r--include/net/mac80211.h109
3 files changed, 110 insertions, 8 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b3ce299782af..23a8877f4ded 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2288,4 +2288,8 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2288 return !!(tim->virtual_map[index] & mask); 2288 return !!(tim->virtual_map[index] & mask);
2289} 2289}
2290 2290
2291/* convert time units */
2292#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024))
2293#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x))
2294
2291#endif /* LINUX_IEEE80211_H */ 2295#endif /* LINUX_IEEE80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b7495c72061c..9ab7a0690d93 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2081,7 +2081,7 @@ struct cfg80211_update_ft_ies_params {
2081 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management 2081 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management
2082 * frame on another channel 2082 * frame on another channel
2083 * 2083 *
2084 * @testmode_cmd: run a test mode command 2084 * @testmode_cmd: run a test mode command; @wdev may be %NULL
2085 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be 2085 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
2086 * used by the function, but 0 and 1 must not be touched. Additionally, 2086 * used by the function, but 0 and 1 must not be touched. Additionally,
2087 * return error codes other than -ENOBUFS and -ENOENT will terminate the 2087 * return error codes other than -ENOBUFS and -ENOENT will terminate the
@@ -2290,7 +2290,8 @@ struct cfg80211_ops {
2290 void (*rfkill_poll)(struct wiphy *wiphy); 2290 void (*rfkill_poll)(struct wiphy *wiphy);
2291 2291
2292#ifdef CONFIG_NL80211_TESTMODE 2292#ifdef CONFIG_NL80211_TESTMODE
2293 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); 2293 int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
2294 void *data, int len);
2294 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb, 2295 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
2295 struct netlink_callback *cb, 2296 struct netlink_callback *cb,
2296 void *data, int len); 2297 void *data, int len);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9cda3728c2cb..e3e303778936 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -375,7 +375,7 @@ struct ieee80211_bss_conf {
375}; 375};
376 376
377/** 377/**
378 * enum mac80211_tx_control_flags - flags to describe transmission information/status 378 * enum mac80211_tx_info_flags - flags to describe transmission information/status
379 * 379 *
380 * These flags are used with the @flags member of &ieee80211_tx_info. 380 * These flags are used with the @flags member of &ieee80211_tx_info.
381 * 381 *
@@ -471,7 +471,7 @@ struct ieee80211_bss_conf {
471 * Note: If you have to add new flags to the enumeration, then don't 471 * Note: If you have to add new flags to the enumeration, then don't
472 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 472 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
473 */ 473 */
474enum mac80211_tx_control_flags { 474enum mac80211_tx_info_flags {
475 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 475 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
476 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1), 476 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1),
477 IEEE80211_TX_CTL_NO_ACK = BIT(2), 477 IEEE80211_TX_CTL_NO_ACK = BIT(2),
@@ -507,6 +507,18 @@ enum mac80211_tx_control_flags {
507 507
508#define IEEE80211_TX_CTL_STBC_SHIFT 23 508#define IEEE80211_TX_CTL_STBC_SHIFT 23
509 509
510/**
511 * enum mac80211_tx_control_flags - flags to describe transmit control
512 *
513 * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
514 * protocol frame (e.g. EAP)
515 *
516 * These flags are used in tx_info->control.flags.
517 */
518enum mac80211_tx_control_flags {
519 IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0),
520};
521
510/* 522/*
511 * This definition is used as a mask to clear all temporary flags, which are 523 * This definition is used as a mask to clear all temporary flags, which are
512 * set by the tx handlers for each transmission attempt by the mac80211 stack. 524 * set by the tx handlers for each transmission attempt by the mac80211 stack.
@@ -680,7 +692,8 @@ struct ieee80211_tx_info {
680 /* NB: vif can be NULL for injected frames */ 692 /* NB: vif can be NULL for injected frames */
681 struct ieee80211_vif *vif; 693 struct ieee80211_vif *vif;
682 struct ieee80211_key_conf *hw_key; 694 struct ieee80211_key_conf *hw_key;
683 /* 8 bytes free */ 695 u32 flags;
696 /* 4 bytes free */
684 } control; 697 } control;
685 struct { 698 struct {
686 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; 699 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
@@ -2503,8 +2516,8 @@ enum ieee80211_roc_type {
2503 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout 2516 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
2504 * accordingly. This callback is not required and may sleep. 2517 * accordingly. This callback is not required and may sleep.
2505 * 2518 *
2506 * @testmode_cmd: Implement a cfg80211 test mode command. 2519 * @testmode_cmd: Implement a cfg80211 test mode command. The passed @vif may
2507 * The callback can sleep. 2520 * be %NULL. The callback can sleep.
2508 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep. 2521 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep.
2509 * 2522 *
2510 * @flush: Flush all pending frames from the hardware queue, making sure 2523 * @flush: Flush all pending frames from the hardware queue, making sure
@@ -2765,7 +2778,8 @@ struct ieee80211_ops {
2765 void (*rfkill_poll)(struct ieee80211_hw *hw); 2778 void (*rfkill_poll)(struct ieee80211_hw *hw);
2766 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); 2779 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
2767#ifdef CONFIG_NL80211_TESTMODE 2780#ifdef CONFIG_NL80211_TESTMODE
2768 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 2781 int (*testmode_cmd)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2782 void *data, int len);
2769 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb, 2783 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb,
2770 struct netlink_callback *cb, 2784 struct netlink_callback *cb,
2771 void *data, int len); 2785 void *data, int len);
@@ -3674,6 +3688,89 @@ void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
3674 int tid, struct ieee80211_key_seq *seq); 3688 int tid, struct ieee80211_key_seq *seq);
3675 3689
3676/** 3690/**
3691 * ieee80211_set_key_tx_seq - set key TX sequence counter
3692 *
3693 * @keyconf: the parameter passed with the set key
3694 * @seq: new sequence data
3695 *
3696 * This function allows a driver to set the current TX IV/PNs for the
3697 * given key. This is useful when resuming from WoWLAN sleep and the
3698 * device may have transmitted frames using the PTK, e.g. replies to
3699 * ARP requests.
3700 *
3701 * Note that this function may only be called when no TX processing
3702 * can be done concurrently.
3703 */
3704void ieee80211_set_key_tx_seq(struct ieee80211_key_conf *keyconf,
3705 struct ieee80211_key_seq *seq);
3706
3707/**
3708 * ieee80211_set_key_rx_seq - set key RX sequence counter
3709 *
3710 * @keyconf: the parameter passed with the set key
3711 * @tid: The TID, or -1 for the management frame value (CCMP only);
3712 * the value on TID 0 is also used for non-QoS frames. For
3713 * CMAC, only TID 0 is valid.
3714 * @seq: new sequence data
3715 *
3716 * This function allows a driver to set the current RX IV/PNs for the
3717 * given key. This is useful when resuming from WoWLAN sleep and GTK
3718 * rekey may have been done while suspended. It should not be called
3719 * if IV checking is done by the device and not by mac80211.
3720 *
3721 * Note that this function may only be called when no RX processing
3722 * can be done concurrently.
3723 */
3724void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
3725 int tid, struct ieee80211_key_seq *seq);
3726
3727/**
3728 * ieee80211_remove_key - remove the given key
3729 * @keyconf: the parameter passed with the set key
3730 *
3731 * Remove the given key. If the key was uploaded to the hardware at the
3732 * time this function is called, it is not deleted in the hardware but
3733 * instead assumed to have been removed already.
3734 *
3735 * Note that due to locking considerations this function can (currently)
3736 * only be called during key iteration (ieee80211_iter_keys().)
3737 */
3738void ieee80211_remove_key(struct ieee80211_key_conf *keyconf);
3739
3740/**
3741 * ieee80211_gtk_rekey_add - add a GTK key from rekeying during WoWLAN
3742 * @vif: the virtual interface to add the key on
3743 * @keyconf: new key data
3744 *
3745 * When GTK rekeying was done while the system was suspended, (a) new
3746 * key(s) will be available. These will be needed by mac80211 for proper
3747 * RX processing, so this function allows setting them.
3748 *
3749 * The function returns the newly allocated key structure, which will
3750 * have similar contents to the passed key configuration but point to
3751 * mac80211-owned memory. In case of errors, the function returns an
3752 * ERR_PTR(), use IS_ERR() etc.
3753 *
3754 * Note that this function assumes the key isn't added to hardware
3755 * acceleration, so no TX will be done with the key. Since it's a GTK
3756 * on managed (station) networks, this is true anyway. If the driver
3757 * calls this function from the resume callback and subsequently uses
3758 * the return code 1 to reconfigure the device, this key will be part
3759 * of the reconfiguration.
3760 *
3761 * Note that the driver should also call ieee80211_set_key_rx_seq()
3762 * for the new key for each TID to set up sequence counters properly.
3763 *
3764 * IMPORTANT: If this replaces a key that is present in the hardware,
3765 * then it will attempt to remove it during this call. In many cases
3766 * this isn't what you want, so call ieee80211_remove_key() first for
3767 * the key that's being replaced.
3768 */
3769struct ieee80211_key_conf *
3770ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
3771 struct ieee80211_key_conf *keyconf);
3772
3773/**
3677 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying 3774 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
3678 * @vif: virtual interface the rekeying was done on 3775 * @vif: virtual interface the rekeying was done on
3679 * @bssid: The BSSID of the AP, for checking association 3776 * @bssid: The BSSID of the AP, for checking association