Skip to content

Commit

Permalink
Merge tag 'mac80211-next-for-davem-2015-08-14' of git://git.kernel.or…
Browse files Browse the repository at this point in the history
…g/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
Another pull request for the next cycle, this time with quite
a bit of content:
 * mesh fixes/improvements from Alexis, Bob, Chun-Yeow and Jesse
 * TDLS higher bandwidth support (Arik)
 * OCB fixes from Bertold Van den Bergh
 * suspend/resume fixes from Eliad
 * dynamic SMPS support for minstrel-HT (Krishna Chaitanya)
 * VHT bitrate mask support (Lorenzo Bianconi)
 * better regulatory support for 5/10 MHz channels (Matthias May)
 * basic support for MU-MIMO to avoid the multi-vif issue (Sara Sharon)
along with a number of other cleanups.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Aug 17, 2015
2 parents 90eb7fa + 8f9c98d commit 2bd736f
Show file tree
Hide file tree
Showing 54 changed files with 1,510 additions and 846 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlwifi/dvm/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,8 @@ struct iwl_priv {
/* ieee device used by generic ieee processing code */
struct ieee80211_hw *hw;

struct napi_struct *napi;

struct list_head calib_results;

struct workqueue_struct *workqueue;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/iwlwifi/dvm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,8 @@ static void iwl_napi_add(struct iwl_op_mode *op_mode,
{
struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);

ieee80211_napi_add(priv->hw, napi, napi_dev, poll, weight);
netif_napi_add(napi_dev, napi, poll, weight);
priv->napi = napi;
}

static const struct iwl_op_mode_ops iwl_dvm_ops = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/dvm/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,

memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats));

ieee80211_rx(priv->hw, skb);
ieee80211_rx_napi(priv->hw, skb, priv->napi);
}

static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in)
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ struct iwl_mvm_rm_sta_cmd {
* ( MGMT_MCAST_KEY = 0x1f )
* @ctrl_flags: %iwl_sta_key_flag
* @IGTK:
* @K1: IGTK master key
* @K2: IGTK sub key
* @K1: unused
* @K2: unused
* @sta_id: station ID that support IGTK
* @key_id:
* @receive_seq_cnt: initial RSC/PN needed for replay check
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/iwlwifi/mvm/mvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ struct iwl_mvm {
const struct iwl_cfg *cfg;
struct iwl_phy_db *phy_db;
struct ieee80211_hw *hw;
struct napi_struct *napi;

/* for protecting access to iwl_mvm */
struct mutex mutex;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/iwlwifi/mvm/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,8 @@ static void iwl_mvm_napi_add(struct iwl_op_mode *op_mode,
{
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);

ieee80211_napi_add(mvm->hw, napi, napi_dev, poll, weight);
netif_napi_add(napi_dev, napi, poll, weight);
mvm->napi = napi;
}

static const struct iwl_op_mode_ops iwl_mvm_ops = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/iwlwifi/mvm/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
fraglen, rxb->truesize);
}

ieee80211_rx(mvm->hw, skb);
ieee80211_rx_napi(mvm->hw, skb, mvm->napi);
}

/*
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/iwlwifi/mvm/sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,6 @@ static int iwl_mvm_send_sta_igtk(struct iwl_mvm *mvm,
const u8 *pn;

memcpy(igtk_cmd.IGTK, keyconf->key, keyconf->keylen);
ieee80211_aes_cmac_calculate_k1_k2(keyconf,
igtk_cmd.K1, igtk_cmd.K2);
ieee80211_get_key_rx_seq(keyconf, 0, &seq);
pn = seq.aes_cmac.pn;
igtk_cmd.receive_seq_cnt = cpu_to_le64(((u64) pn[5] << 0) |
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -2399,6 +2399,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
ieee80211_hw_set(hw, AMPDU_AGGREGATION);
ieee80211_hw_set(hw, MFP_CAPABLE);
ieee80211_hw_set(hw, SIGNAL_DBM);
ieee80211_hw_set(hw, TDLS_WIDER_BW);
if (rctbl)
ieee80211_hw_set(hw, SUPPORTS_RC_TABLE);

Expand Down Expand Up @@ -3120,8 +3121,10 @@ static int hwsim_init_netlink(void)
goto failure;

rc = netlink_register_notifier(&hwsim_netlink_notifier);
if (rc)
if (rc) {
genl_unregister_family(&hwsim_genl_family);
goto failure;
}

return 0;

Expand Down
39 changes: 39 additions & 0 deletions include/linux/average.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,43 @@ static inline unsigned long ewma_read(const struct ewma *avg)
return avg->internal >> avg->factor;
}

#define DECLARE_EWMA(name, _factor, _weight) \
struct ewma_##name { \
unsigned long internal; \
}; \
static inline void ewma_##name##_init(struct ewma_##name *e) \
{ \
BUILD_BUG_ON(!__builtin_constant_p(_factor)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight)); \
BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \
e->internal = 0; \
} \
static inline unsigned long \
ewma_##name##_read(struct ewma_##name *e) \
{ \
BUILD_BUG_ON(!__builtin_constant_p(_factor)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight)); \
BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \
return e->internal >> ilog2(_factor); \
} \
static inline void ewma_##name##_add(struct ewma_##name *e, \
unsigned long val) \
{ \
unsigned long internal = ACCESS_ONCE(e->internal); \
unsigned long weight = ilog2(_weight); \
unsigned long factor = ilog2(_factor); \
\
BUILD_BUG_ON(!__builtin_constant_p(_factor)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight)); \
BUILD_BUG_ON_NOT_POWER_OF_2(_factor); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight); \
\
ACCESS_ONCE(e->internal) = internal ? \
(((internal << weight) - internal) + \
(val << factor)) >> weight : \
(val << factor); \
}

#endif /* _LINUX_AVERAGE_H */
2 changes: 1 addition & 1 deletion include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2074,8 +2074,8 @@ enum ieee80211_tdls_actioncode {
#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
#define WLAN_EXT_CAPA5_TDLS_CH_SW_PROHIBITED BIT(7)

#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(5)
#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(7)

/* TDLS specific payload type in the LLC/SNAP header */
#define WLAN_TDLS_SNAP_RFTYPE 0x2
Expand Down
3 changes: 1 addition & 2 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2369,8 +2369,7 @@ struct cfg80211_qos_map {
* method returns 0.)
*
* @mgmt_frame_register: Notify driver that a management frame type was
* registered. Note that this callback may not sleep, and cannot run
* concurrently with itself.
* registered. The callback is allowed to sleep.
*
* @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device.
* Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may
Expand Down
69 changes: 36 additions & 33 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,10 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
* @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame.
* If this flag is set, the stack cannot do any replay detection
* hence the driver or hardware will have to do that.
* @RX_FLAG_PN_VALIDATED: Currently only valid for CCMP/GCMP frames, this
* flag indicates that the PN was verified for replay protection.
* Note that this flag is also currently only supported when a frame
* is also decrypted (ie. @RX_FLAG_DECRYPTED must be set)
* @RX_FLAG_FAILED_FCS_CRC: Set this flag if the FCS check failed on
* the frame.
* @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
Expand All @@ -997,9 +1001,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
* @RX_FLAG_AMPDU_DETAILS: A-MPDU details are known, in particular the reference
* number (@ampdu_reference) must be populated and be a distinct number for
* each A-MPDU
* @RX_FLAG_AMPDU_REPORT_ZEROLEN: driver reports 0-length subframes
* @RX_FLAG_AMPDU_IS_ZEROLEN: This is a zero-length subframe, for
* monitoring purposes only
* @RX_FLAG_AMPDU_LAST_KNOWN: last subframe is known, should be set on all
* subframes of a single A-MPDU
* @RX_FLAG_AMPDU_IS_LAST: this subframe is the last subframe of the A-MPDU
Expand Down Expand Up @@ -1039,8 +1040,8 @@ enum mac80211_rx_flags {
RX_FLAG_NO_SIGNAL_VAL = BIT(12),
RX_FLAG_HT_GF = BIT(13),
RX_FLAG_AMPDU_DETAILS = BIT(14),
RX_FLAG_AMPDU_REPORT_ZEROLEN = BIT(15),
RX_FLAG_AMPDU_IS_ZEROLEN = BIT(16),
RX_FLAG_PN_VALIDATED = BIT(15),
/* bit 16 free */
RX_FLAG_AMPDU_LAST_KNOWN = BIT(17),
RX_FLAG_AMPDU_IS_LAST = BIT(18),
RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19),
Expand Down Expand Up @@ -1491,8 +1492,10 @@ enum ieee80211_key_flags {
* - Temporal Authenticator Rx MIC Key (64 bits)
* @icv_len: The ICV length for this key type
* @iv_len: The IV length for this key type
* @drv_priv: pointer for driver use
*/
struct ieee80211_key_conf {
void *drv_priv;
atomic64_t tx_pn;
u32 cipher;
u8 icv_len;
Expand Down Expand Up @@ -1675,7 +1678,6 @@ struct ieee80211_sta_rates {
* @tdls: indicates whether the STA is a TDLS peer
* @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only
* valid if the STA is a TDLS peer in the first place.
* @mfp: indicates whether the STA uses management frame protection or not.
* @txq: per-TID data TX queues (if driver uses the TXQ abstraction)
*/
struct ieee80211_sta {
Expand All @@ -1693,7 +1695,6 @@ struct ieee80211_sta {
struct ieee80211_sta_rates __rcu *rates;
bool tdls;
bool tdls_initiator;
bool mfp;

struct ieee80211_txq *txq[IEEE80211_NUM_TIDS];

Expand Down Expand Up @@ -1888,6 +1889,9 @@ struct ieee80211_txq {
* @IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS: The HW supports scanning on all bands
* in one command, mac80211 doesn't have to run separate scans per band.
*
* @IEEE80211_HW_TDLS_WIDER_BW: The device/driver supports wider bandwidth
* than then BSS bandwidth for a TDLS link on the base channel.
*
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
Expand Down Expand Up @@ -1920,6 +1924,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_CHANCTX_STA_CSA,
IEEE80211_HW_SUPPORTS_CLONED_SKBS,
IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS,
IEEE80211_HW_TDLS_WIDER_BW,

/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
Expand Down Expand Up @@ -3696,20 +3701,28 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
void ieee80211_restart_hw(struct ieee80211_hw *hw);

/**
* ieee80211_napi_add - initialize mac80211 NAPI context
* @hw: the hardware to initialize the NAPI context on
* @napi: the NAPI context to initialize
* @napi_dev: dummy NAPI netdevice, here to not waste the space if the
* driver doesn't use NAPI
* @poll: poll function
* @weight: default weight
* ieee80211_rx_napi - receive frame from NAPI context
*
* Use this function to hand received frames to mac80211. The receive
* buffer in @skb must start with an IEEE 802.11 header. In case of a
* paged @skb is used, the driver is recommended to put the ieee80211
* header of the frame on the linear part of the @skb to avoid memory
* allocation and/or memcpy by the stack.
*
* This function may not be called in IRQ context. Calls to this function
* for a single hardware must be synchronized against each other. Calls to
* this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be
* mixed for a single hardware. Must not run concurrently with
* ieee80211_tx_status() or ieee80211_tx_status_ni().
*
* This function must be called with BHs disabled.
*
* See also netif_napi_add().
* @hw: the hardware this frame came in on
* @skb: the buffer to receive, owned by mac80211 after this call
* @napi: the NAPI context
*/
void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
struct net_device *napi_dev,
int (*poll)(struct napi_struct *, int),
int weight);
void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
struct napi_struct *napi);

/**
* ieee80211_rx - receive frame
Expand All @@ -3731,7 +3744,10 @@ void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
* @hw: the hardware this frame came in on
* @skb: the buffer to receive, owned by mac80211 after this call
*/
void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb);
static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
{
ieee80211_rx_napi(hw, skb, NULL);
}

/**
* ieee80211_rx_irqsafe - receive frame
Expand Down Expand Up @@ -4314,19 +4330,6 @@ void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
struct sk_buff *skb, u8 *p2k);

/**
* ieee80211_aes_cmac_calculate_k1_k2 - calculate the AES-CMAC sub keys
*
* This function computes the two AES-CMAC sub-keys, based on the
* previously installed master key.
*
* @keyconf: the parameter passed with the set key
* @k1: a buffer to be filled with the 1st sub-key
* @k2: a buffer to be filled with the 2nd sub-key
*/
void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf,
u8 *k1, u8 *k2);

/**
* ieee80211_get_key_tx_seq - get key TX sequence counter
*
Expand Down
1 change: 0 additions & 1 deletion net/mac80211/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ config MAC80211
select CRYPTO_CCM
select CRYPTO_GCM
select CRC32
select AVERAGE
---help---
This option enables the hardware independent IEEE 802.11
networking stack.
Expand Down
1 change: 1 addition & 0 deletions net/mac80211/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ obj-$(CONFIG_MAC80211) += mac80211.o
# mac80211 objects
mac80211-y := \
main.o status.o \
driver-ops.o \
sta_info.o \
wep.o \
wpa.o \
Expand Down
17 changes: 0 additions & 17 deletions net/mac80211/aes_cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,3 @@ void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm)
{
crypto_free_cipher(tfm);
}

void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf,
u8 *k1, u8 *k2)
{
u8 l[AES_BLOCK_SIZE] = {};
struct ieee80211_key *key =
container_of(keyconf, struct ieee80211_key, conf);

crypto_cipher_encrypt_one(key->u.aes_cmac.tfm, l, l);

memcpy(k1, l, AES_BLOCK_SIZE);
gf_mulx(k1);

memcpy(k2, k1, AES_BLOCK_SIZE);
gf_mulx(k2);
}
EXPORT_SYMBOL(ieee80211_aes_cmac_calculate_k1_k2);
Loading

0 comments on commit 2bd736f

Please sign in to comment.