* [PATCH 0/5] some trivial mac80211 cleanups
@ 2012-03-27 12:18 Johannes Berg
2012-03-27 12:18 ` [PATCH 1/5] mac80211: fix mesh TX coding style Johannes Berg
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Johannes Berg @ 2012-03-27 12:18 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
First set of cleanups I noticed while beginning work
on my new multi-queue design :-)
johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] mac80211: fix mesh TX coding style
2012-03-27 12:18 [PATCH 0/5] some trivial mac80211 cleanups Johannes Berg
@ 2012-03-27 12:18 ` Johannes Berg
2012-03-27 12:18 ` [PATCH 2/5] mac80211: clean up uAPSD TX code Johannes Berg
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2012-03-27 12:18 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Fix bad indentation & pointless if nesting.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/tx.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/net/mac80211/tx.c 2012-03-23 16:51:10.000000000 +0100
+++ b/net/mac80211/tx.c 2012-03-23 17:03:05.000000000 +0100
@@ -1468,12 +1468,12 @@ void ieee80211_xmit(struct ieee80211_sub
if (ieee80211_vif_is_mesh(&sdata->vif) &&
ieee80211_is_data(hdr->frame_control) &&
- !is_multicast_ether_addr(hdr->addr1))
- if (mesh_nexthop_resolve(skb, sdata)) {
- /* skb queued: don't free */
- rcu_read_unlock();
- return;
- }
+ !is_multicast_ether_addr(hdr->addr1) &&
+ mesh_nexthop_resolve(skb, sdata)) {
+ /* skb queued: don't free */
+ rcu_read_unlock();
+ return;
+ }
ieee80211_set_qos_hdr(sdata, skb);
ieee80211_tx(sdata, skb, false);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/5] mac80211: clean up uAPSD TX code
2012-03-27 12:18 [PATCH 0/5] some trivial mac80211 cleanups Johannes Berg
2012-03-27 12:18 ` [PATCH 1/5] mac80211: fix mesh TX coding style Johannes Berg
@ 2012-03-27 12:18 ` Johannes Berg
2012-03-27 12:18 ` [PATCH 3/5] mac80211: make ieee80211_downgrade_queue static Johannes Berg
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2012-03-27 12:18 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Clean up the code formatting and also replace
the constant 0 by IEEE80211_AC_VO.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/tx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/net/mac80211/tx.c 2012-03-23 11:25:35.000000000 +0100
+++ b/net/mac80211/tx.c 2012-03-23 14:28:08.000000000 +0100
@@ -230,9 +230,9 @@ ieee80211_tx_h_dynamic_ps(struct ieee802
* changed via debugfs, user needs to reassociate manually to have
* everything in sync.
*/
- if ((ifmgd->flags & IEEE80211_STA_UAPSD_ENABLED)
- && (ifmgd->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO)
- && skb_get_queue_mapping(tx->skb) == 0)
+ if ((ifmgd->flags & IEEE80211_STA_UAPSD_ENABLED) &&
+ (ifmgd->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO) &&
+ skb_get_queue_mapping(tx->skb) == IEEE80211_AC_VO)
return TX_CONTINUE;
if (local->hw.conf.flags & IEEE80211_CONF_PS) {
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/5] mac80211: make ieee80211_downgrade_queue static
2012-03-27 12:18 [PATCH 0/5] some trivial mac80211 cleanups Johannes Berg
2012-03-27 12:18 ` [PATCH 1/5] mac80211: fix mesh TX coding style Johannes Berg
2012-03-27 12:18 ` [PATCH 2/5] mac80211: clean up uAPSD TX code Johannes Berg
@ 2012-03-27 12:18 ` Johannes Berg
2012-03-27 12:18 ` [PATCH 4/5] mac80211: inline ieee80211_add_pending_skbs Johannes Berg
2012-03-27 12:18 ` [PATCH 5/5] mac80211: use AC constants Johannes Berg
4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2012-03-27 12:18 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
There's no reason for it to not be static.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/wme.c | 40 ++++++++++++++++++++--------------------
net/mac80211/wme.h | 3 ---
2 files changed, 20 insertions(+), 23 deletions(-)
--- a/net/mac80211/wme.c 2012-03-23 14:11:47.000000000 +0100
+++ b/net/mac80211/wme.c 2012-03-23 14:14:00.000000000 +0100
@@ -52,6 +52,26 @@ static int wme_downgrade_ac(struct sk_bu
}
}
+static u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
+ struct sk_buff *skb)
+{
+ /* in case we are a client verify acm is not set for this ac */
+ while (unlikely(local->wmm_acm & BIT(skb->priority))) {
+ if (wme_downgrade_ac(skb)) {
+ /*
+ * This should not really happen. The AP has marked all
+ * lower ACs to require admission control which is not
+ * a reasonable configuration. Allow the frame to be
+ * transmitted using AC_BK as a workaround.
+ */
+ break;
+ }
+ }
+
+ /* look up which queue to use for frames with this 1d tag */
+ return ieee802_1d_to_ac[skb->priority];
+}
+
/* Indicate which queue to use for this fully formed 802.11 frame */
u16 ieee80211_select_queue_80211(struct ieee80211_local *local,
struct sk_buff *skb,
@@ -139,26 +159,6 @@ u16 ieee80211_select_queue(struct ieee80
return ieee80211_downgrade_queue(local, skb);
}
-u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
- struct sk_buff *skb)
-{
- /* in case we are a client verify acm is not set for this ac */
- while (unlikely(local->wmm_acm & BIT(skb->priority))) {
- if (wme_downgrade_ac(skb)) {
- /*
- * This should not really happen. The AP has marked all
- * lower ACs to require admission control which is not
- * a reasonable configuration. Allow the frame to be
- * transmitted using AC_BK as a workaround.
- */
- break;
- }
- }
-
- /* look up which queue to use for frames with this 1d tag */
- return ieee802_1d_to_ac[skb->priority];
-}
-
void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb)
{
--- a/net/mac80211/wme.h 2012-03-15 14:31:56.000000000 +0100
+++ b/net/mac80211/wme.h 2012-03-23 14:14:03.000000000 +0100
@@ -22,8 +22,5 @@ u16 ieee80211_select_queue(struct ieee80
struct sk_buff *skb);
void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
-u16 ieee80211_downgrade_queue(struct ieee80211_local *local,
- struct sk_buff *skb);
-
#endif /* _WME_H */
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/5] mac80211: inline ieee80211_add_pending_skbs
2012-03-27 12:18 [PATCH 0/5] some trivial mac80211 cleanups Johannes Berg
` (2 preceding siblings ...)
2012-03-27 12:18 ` [PATCH 3/5] mac80211: make ieee80211_downgrade_queue static Johannes Berg
@ 2012-03-27 12:18 ` Johannes Berg
2012-03-27 12:18 ` [PATCH 5/5] mac80211: use AC constants Johannes Berg
4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2012-03-27 12:18 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
This is a trivial wrapper function, inline it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/ieee80211_i.h | 7 +++++--
net/mac80211/util.c | 6 ------
2 files changed, 5 insertions(+), 8 deletions(-)
--- a/net/mac80211/ieee80211_i.h 2012-03-26 12:25:01.000000000 +0200
+++ b/net/mac80211/ieee80211_i.h 2012-03-26 12:25:10.000000000 +0200
@@ -1432,11 +1432,14 @@ void ieee80211_stop_queue_by_reason(stru
enum queue_stop_reason reason);
void ieee80211_add_pending_skb(struct ieee80211_local *local,
struct sk_buff *skb);
-void ieee80211_add_pending_skbs(struct ieee80211_local *local,
- struct sk_buff_head *skbs);
void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local,
struct sk_buff_head *skbs,
void (*fn)(void *data), void *data);
+static inline void ieee80211_add_pending_skbs(struct ieee80211_local *local,
+ struct sk_buff_head *skbs)
+{
+ ieee80211_add_pending_skbs_fn(local, skbs, NULL, NULL);
+}
void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
u16 transaction, u16 auth_alg,
--- a/net/mac80211/util.c 2012-03-26 12:25:00.000000000 +0200
+++ b/net/mac80211/util.c 2012-03-26 12:25:10.000000000 +0200
@@ -404,12 +404,6 @@ void ieee80211_add_pending_skbs_fn(struc
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
}
-void ieee80211_add_pending_skbs(struct ieee80211_local *local,
- struct sk_buff_head *skbs)
-{
- ieee80211_add_pending_skbs_fn(local, skbs, NULL, NULL);
-}
-
void ieee80211_stop_queues_by_reason(struct ieee80211_hw *hw,
enum queue_stop_reason reason)
{
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 5/5] mac80211: use AC constants
2012-03-27 12:18 [PATCH 0/5] some trivial mac80211 cleanups Johannes Berg
` (3 preceding siblings ...)
2012-03-27 12:18 ` [PATCH 4/5] mac80211: inline ieee80211_add_pending_skbs Johannes Berg
@ 2012-03-27 12:18 ` Johannes Berg
4 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2012-03-27 12:18 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
From: Johannes Berg <johannes.berg@intel.com>
Use the AC constants instead of hard-coding
the numbers with comments.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/util.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/net/mac80211/util.c 2012-03-23 17:45:09.000000000 +0100
+++ b/net/mac80211/util.c 2012-03-23 17:45:18.000000000 +0100
@@ -790,20 +790,20 @@ void ieee80211_set_wmm_default(struct ie
aCWmin = 15;
switch (queue) {
- case 3: /* AC_BK */
+ case IEEE80211_AC_BK:
qparam.cw_max = aCWmax;
qparam.cw_min = aCWmin;
qparam.txop = 0;
qparam.aifs = 7;
break;
default: /* never happens but let's not leave undefined */
- case 2: /* AC_BE */
+ case IEEE80211_AC_BE:
qparam.cw_max = aCWmax;
qparam.cw_min = aCWmin;
qparam.txop = 0;
qparam.aifs = 3;
break;
- case 1: /* AC_VI */
+ case IEEE80211_AC_VI:
qparam.cw_max = aCWmin;
qparam.cw_min = (aCWmin + 1) / 2 - 1;
if (use_11b)
@@ -812,7 +812,7 @@ void ieee80211_set_wmm_default(struct ie
qparam.txop = 3008/32;
qparam.aifs = 2;
break;
- case 0: /* AC_VO */
+ case IEEE80211_AC_VO:
qparam.cw_max = (aCWmin + 1) / 2 - 1;
qparam.cw_min = (aCWmin + 1) / 4 - 1;
if (use_11b)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-03-27 12:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-27 12:18 [PATCH 0/5] some trivial mac80211 cleanups Johannes Berg
2012-03-27 12:18 ` [PATCH 1/5] mac80211: fix mesh TX coding style Johannes Berg
2012-03-27 12:18 ` [PATCH 2/5] mac80211: clean up uAPSD TX code Johannes Berg
2012-03-27 12:18 ` [PATCH 3/5] mac80211: make ieee80211_downgrade_queue static Johannes Berg
2012-03-27 12:18 ` [PATCH 4/5] mac80211: inline ieee80211_add_pending_skbs Johannes Berg
2012-03-27 12:18 ` [PATCH 5/5] mac80211: use AC constants Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.