Skip to content

Commit

Permalink
Merge tag 'mac80211-for-davem-2019-04-09' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
Various fixes:
 * iTXQ fixes from Felix
 * tracing fix - increase message length
 * fix SW_CRYPTO_CONTROL enforcement
 * WMM rule handling for regdomain intersection
 * max_interfaces in hwsim - reported by syzbot
 * clear private data in some more commands
 * a clang compiler warning fix

I added a patch with two new (unused) macros for
rate-limited printing to simplify getting the users
into the tree.
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Apr 9, 2019
2 parents 869e330 + 78ad234 commit c03fd01
Show file tree
Hide file tree
Showing 16 changed files with 163 additions and 85 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/htt_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2728,7 +2728,7 @@ static void ath10k_htt_rx_tx_fetch_ind(struct ath10k *ar, struct sk_buff *skb)
num_msdus++;
num_bytes += ret;
}
ieee80211_return_txq(hw, txq);
ieee80211_return_txq(hw, txq, false);
ieee80211_txq_schedule_end(hw, txq->ac);

record->num_msdus = cpu_to_le16(num_msdus);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath10k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -4089,7 +4089,7 @@ static int ath10k_mac_schedule_txq(struct ieee80211_hw *hw, u32 ac)
if (ret < 0)
break;
}
ieee80211_return_txq(hw, txq);
ieee80211_return_txq(hw, txq, false);
ath10k_htt_tx_txq_update(hw, txq);
if (ret == -EBUSY)
break;
Expand Down Expand Up @@ -4374,7 +4374,7 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw,
if (ret < 0)
break;
}
ieee80211_return_txq(hw, txq);
ieee80211_return_txq(hw, txq, false);
ath10k_htt_tx_txq_update(hw, txq);
out:
ieee80211_txq_schedule_end(hw, ac);
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1938,12 +1938,15 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
goto out;

while ((queue = ieee80211_next_txq(hw, txq->mac80211_qnum))) {
bool force;

tid = (struct ath_atx_tid *)queue->drv_priv;

ret = ath_tx_sched_aggr(sc, txq, tid);
ath_dbg(common, QUEUE, "ath_tx_sched_aggr returned %d\n", ret);

ieee80211_return_txq(hw, queue);
force = !skb_queue_empty(&tid->retry_q);
ieee80211_return_txq(hw, queue, force);
}

out:
Expand Down
19 changes: 15 additions & 4 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -2644,7 +2644,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
enum nl80211_band band;
const struct ieee80211_ops *ops = &mac80211_hwsim_ops;
struct net *net;
int idx;
int idx, i;
int n_limits = 0;

if (WARN_ON(param->channels > 1 && !param->use_chanctx))
Expand Down Expand Up @@ -2768,12 +2768,23 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
goto failed_hw;
}

data->if_combination.max_interfaces = 0;
for (i = 0; i < n_limits; i++)
data->if_combination.max_interfaces +=
data->if_limits[i].max;

data->if_combination.n_limits = n_limits;
data->if_combination.max_interfaces = 2048;
data->if_combination.limits = data->if_limits;

hw->wiphy->iface_combinations = &data->if_combination;
hw->wiphy->n_iface_combinations = 1;
/*
* If we actually were asked to support combinations,
* advertise them - if there's only a single thing like
* only IBSS then don't advertise it as combinations.
*/
if (data->if_combination.max_interfaces > 1) {
hw->wiphy->iface_combinations = &data->if_combination;
hw->wiphy->n_iface_combinations = 1;
}

if (param->ciphers) {
memcpy(data->ciphers, param->ciphers,
Expand Down
5 changes: 5 additions & 0 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -7183,6 +7183,11 @@ void cfg80211_pmsr_complete(struct wireless_dev *wdev,
#define wiphy_info(wiphy, format, args...) \
dev_info(&(wiphy)->dev, format, ##args)

#define wiphy_err_ratelimited(wiphy, format, args...) \
dev_err_ratelimited(&(wiphy)->dev, format, ##args)
#define wiphy_warn_ratelimited(wiphy, format, args...) \
dev_warn_ratelimited(&(wiphy)->dev, format, ##args)

#define wiphy_debug(wiphy, format, args...) \
wiphy_printk(KERN_DEBUG, wiphy, format, ##args)

Expand Down
63 changes: 34 additions & 29 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -6231,60 +6231,65 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
* @hw: pointer as obtained from ieee80211_alloc_hw()
* @ac: AC number to return packets from.
*
* Should only be called between calls to ieee80211_txq_schedule_start()
* and ieee80211_txq_schedule_end().
* Returns the next txq if successful, %NULL if no queue is eligible. If a txq
* is returned, it should be returned with ieee80211_return_txq() after the
* driver has finished scheduling it.
*/
struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac);

/**
* ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
*
* @hw: pointer as obtained from ieee80211_alloc_hw()
* @txq: pointer obtained from station or virtual interface
*
* Should only be called between calls to ieee80211_txq_schedule_start()
* and ieee80211_txq_schedule_end().
*/
void ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq);

/**
* ieee80211_txq_schedule_start - acquire locks for safe scheduling of an AC
* ieee80211_txq_schedule_start - start new scheduling round for TXQs
*
* @hw: pointer as obtained from ieee80211_alloc_hw()
* @ac: AC number to acquire locks for
*
* Acquire locks needed to schedule TXQs from the given AC. Should be called
* before ieee80211_next_txq() or ieee80211_return_txq().
* Should be called before ieee80211_next_txq() or ieee80211_return_txq().
* The driver must not call multiple TXQ scheduling rounds concurrently.
*/
void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac)
__acquires(txq_lock);
void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac);

/* (deprecated) */
static inline void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
{
}

void __ieee80211_schedule_txq(struct ieee80211_hw *hw,
struct ieee80211_txq *txq, bool force);

/**
* ieee80211_txq_schedule_end - release locks for safe scheduling of an AC
* ieee80211_schedule_txq - schedule a TXQ for transmission
*
* @hw: pointer as obtained from ieee80211_alloc_hw()
* @ac: AC number to acquire locks for
* @txq: pointer obtained from station or virtual interface
*
* Release locks previously acquired by ieee80211_txq_schedule_end().
* Schedules a TXQ for transmission if it is not already scheduled,
* even if mac80211 does not have any packets buffered.
*
* The driver may call this function if it has buffered packets for
* this TXQ internally.
*/
void ieee80211_txq_schedule_end(struct ieee80211_hw *hw, u8 ac)
__releases(txq_lock);
static inline void
ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
{
__ieee80211_schedule_txq(hw, txq, true);
}

/**
* ieee80211_schedule_txq - schedule a TXQ for transmission
* ieee80211_return_txq - return a TXQ previously acquired by ieee80211_next_txq()
*
* @hw: pointer as obtained from ieee80211_alloc_hw()
* @txq: pointer obtained from station or virtual interface
* @force: schedule txq even if mac80211 does not have any buffered packets.
*
* Schedules a TXQ for transmission if it is not already scheduled. Takes a
* lock, which means it must *not* be called between
* ieee80211_txq_schedule_start() and ieee80211_txq_schedule_end()
* The driver may set force=true if it has buffered packets for this TXQ
* internally.
*/
void ieee80211_schedule_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq)
__acquires(txq_lock) __releases(txq_lock);
static inline void
ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq,
bool force)
{
__ieee80211_schedule_txq(hw, txq, force);
}

/**
* ieee80211_txq_may_transmit - check whether TXQ is allowed to transmit
Expand Down
3 changes: 3 additions & 0 deletions net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,9 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
{
struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif);

if (local->in_reconfig)
return;

if (!check_sdata_in_driver(sdata))
return;

Expand Down
9 changes: 4 additions & 5 deletions net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
* The driver doesn't know anything about VLAN interfaces.
* Hence, don't send GTKs for VLAN interfaces to the driver.
*/
if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE))
if (!(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
ret = 1;
goto out_unsupported;
}
}

ret = drv_set_key(key->local, SET_KEY, sdata,
Expand Down Expand Up @@ -213,11 +215,8 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
/* all of these we can do in software - if driver can */
if (ret == 1)
return 0;
if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL)) {
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
return 0;
if (ieee80211_hw_check(&key->local->hw, SW_CRYPTO_CONTROL))
return -EINVAL;
}
return 0;
default:
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/mesh_pathtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath);
static u32 mesh_table_hash(const void *addr, u32 len, u32 seed)
{
/* Use last four bytes of hw addr as hash index */
return jhash_1word(*(u32 *)(addr+2), seed);
return jhash_1word(__get_unaligned_cpu32((u8 *)addr + 2), seed);
}

static const struct rhashtable_params mesh_rht_params = {
Expand Down
10 changes: 9 additions & 1 deletion net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,15 @@ static void sta_ps_start(struct sta_info *sta)
return;

for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) {
if (txq_has_queue(sta->sta.txq[tid]))
struct ieee80211_txq *txq = sta->sta.txq[tid];
struct txq_info *txqi = to_txq_info(txq);

spin_lock(&local->active_txq_lock[txq->ac]);
if (!list_empty(&txqi->schedule_order))
list_del_init(&txqi->schedule_order);
spin_unlock(&local->active_txq_lock[txq->ac]);

if (txq_has_queue(txq))
set_bit(tid, &sta->txq_buffered_tids);
else
clear_bit(tid, &sta->txq_buffered_tids);
Expand Down
7 changes: 6 additions & 1 deletion net/mac80211/trace_msg.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Portions of this file
* Copyright (C) 2019 Intel Corporation
*/

#ifdef CONFIG_MAC80211_MESSAGE_TRACING

#if !defined(__MAC80211_MSG_DRIVER_TRACE) || defined(TRACE_HEADER_MULTI_READ)
Expand All @@ -11,7 +16,7 @@
#undef TRACE_SYSTEM
#define TRACE_SYSTEM mac80211_msg

#define MAX_MSG_LEN 100
#define MAX_MSG_LEN 120

DECLARE_EVENT_CLASS(mac80211_msg_event,
TP_PROTO(struct va_format *vaf),
Expand Down
Loading

0 comments on commit c03fd01

Please sign in to comment.