linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[]
@ 2017-01-24 15:42 Amadeusz Sławiński
  2017-01-24 15:42 ` [PATCH 2/2] mac80211: use accessor functions to set sta->_flags Amadeusz Sławiński
  2017-01-26  8:51 ` [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[] Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Amadeusz Sławiński @ 2017-01-24 15:42 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg
  Cc: David S. Miller, netdev, linux-kernel, Amadeusz Sławiński

cleanup patch to make use of ieee80211_ac_from_tid() to retrieve ac from
ieee802_1d_to_ac[]

Signed-off-by: Amadeusz Sławiński <amadeusz.slawinski@tieto.com>
---
 net/mac80211/rx.c     | 2 +-
 net/mac80211/status.c | 2 +-
 net/mac80211/tx.c     | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 3e289a6..cf8ed1c 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1391,7 +1391,7 @@ void ieee80211_sta_pspoll(struct ieee80211_sta *pubsta)
 void ieee80211_sta_uapsd_trigger(struct ieee80211_sta *pubsta, u8 tid)
 {
 	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
-	u8 ac = ieee802_1d_to_ac[tid & 7];
+	int ac = ieee80211_ac_from_tid(tid);
 
 	/*
 	 * If this AC is not trigger-enabled do nothing unless the
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index ddf71c6..dd48de0 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -95,7 +95,7 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
 		 */
 		if (*p & IEEE80211_QOS_CTL_EOSP)
 			*p &= ~IEEE80211_QOS_CTL_EOSP;
-		ac = ieee802_1d_to_ac[tid & 7];
+		ac = ieee80211_ac_from_tid(tid);
 	} else {
 		ac = IEEE80211_AC_BE;
 	}
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0d8b716..009eb36 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1410,7 +1410,7 @@ void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata,
 		txqi->txq.sta = &sta->sta;
 		sta->sta.txq[tid] = &txqi->txq;
 		txqi->txq.tid = tid;
-		txqi->txq.ac = ieee802_1d_to_ac[tid & 7];
+		txqi->txq.ac = ieee80211_ac_from_tid(tid);
 	} else {
 		sdata->vif.txq = &txqi->txq;
 		txqi->txq.tid = 0;
@@ -4542,7 +4542,7 @@ void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
 				 struct sk_buff *skb, int tid,
 				 enum nl80211_band band)
 {
-	int ac = ieee802_1d_to_ac[tid & 7];
+	int ac = ieee80211_ac_from_tid(tid);
 
 	skb_reset_mac_header(skb);
 	skb_set_queue_mapping(skb, ac);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] mac80211: use accessor functions to set sta->_flags
  2017-01-24 15:42 [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[] Amadeusz Sławiński
@ 2017-01-24 15:42 ` Amadeusz Sławiński
  2017-01-24 15:44   ` Johannes Berg
  2017-01-26  8:51 ` [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[] Johannes Berg
  1 sibling, 1 reply; 6+ messages in thread
From: Amadeusz Sławiński @ 2017-01-24 15:42 UTC (permalink / raw)
  To: linux-wireless, Johannes Berg
  Cc: David S. Miller, netdev, linux-kernel, Amadeusz Sławiński

cleanup patch to make use of set_sta_flag()/clear_sta_flag() in places
where we access sta->_flags

Signed-off-by: Amadeusz Sławiński <amadeusz.slawinski@tieto.com>
---
 net/mac80211/sta_info.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index b6cfcf0..6c9cc2f 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1855,13 +1855,13 @@ int sta_info_move_state(struct sta_info *sta,
 	switch (new_state) {
 	case IEEE80211_STA_NONE:
 		if (sta->sta_state == IEEE80211_STA_AUTH)
-			clear_bit(WLAN_STA_AUTH, &sta->_flags);
+			clear_sta_flag(sta, WLAN_STA_AUTH);
 		break;
 	case IEEE80211_STA_AUTH:
 		if (sta->sta_state == IEEE80211_STA_NONE) {
-			set_bit(WLAN_STA_AUTH, &sta->_flags);
+			set_sta_flag(sta, WLAN_STA_AUTH);
 		} else if (sta->sta_state == IEEE80211_STA_ASSOC) {
-			clear_bit(WLAN_STA_ASSOC, &sta->_flags);
+			clear_sta_flag(sta, WLAN_STA_ASSOC);
 			ieee80211_recalc_min_chandef(sta->sdata);
 			if (!sta->sta.support_p2p_ps)
 				ieee80211_recalc_p2p_go_ps_allowed(sta->sdata);
@@ -1869,13 +1869,13 @@ int sta_info_move_state(struct sta_info *sta,
 		break;
 	case IEEE80211_STA_ASSOC:
 		if (sta->sta_state == IEEE80211_STA_AUTH) {
-			set_bit(WLAN_STA_ASSOC, &sta->_flags);
+			set_sta_flag(sta, WLAN_STA_ASSOC);
 			ieee80211_recalc_min_chandef(sta->sdata);
 			if (!sta->sta.support_p2p_ps)
 				ieee80211_recalc_p2p_go_ps_allowed(sta->sdata);
 		} else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) {
 			ieee80211_vif_dec_num_mcast(sta->sdata);
-			clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
+			clear_sta_flag(sta, WLAN_STA_AUTHORIZED);
 			ieee80211_clear_fast_xmit(sta);
 			ieee80211_clear_fast_rx(sta);
 		}
@@ -1883,7 +1883,7 @@ int sta_info_move_state(struct sta_info *sta,
 	case IEEE80211_STA_AUTHORIZED:
 		if (sta->sta_state == IEEE80211_STA_ASSOC) {
 			ieee80211_vif_inc_num_mcast(sta->sdata);
-			set_bit(WLAN_STA_AUTHORIZED, &sta->_flags);
+			set_sta_flag(sta, WLAN_STA_AUTHORIZED);
 			ieee80211_check_fast_xmit(sta);
 			ieee80211_check_fast_rx(sta);
 		}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] mac80211: use accessor functions to set sta->_flags
  2017-01-24 15:42 ` [PATCH 2/2] mac80211: use accessor functions to set sta->_flags Amadeusz Sławiński
@ 2017-01-24 15:44   ` Johannes Berg
  2017-01-25  8:55     ` Amadeusz Slawinski
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2017-01-24 15:44 UTC (permalink / raw)
  To: Amadeusz Sławiński, linux-wireless
  Cc: David S. Miller, netdev, linux-kernel

On Tue, 2017-01-24 at 16:42 +0100, Amadeusz Sławiński wrote:
> cleanup patch to make use of set_sta_flag()/clear_sta_flag() in
> places
> where we access sta->_flags
> 
> Signed-off-by: Amadeusz Sławiński <amadeusz.slawinski@tieto.com>
> ---
>  net/mac80211/sta_info.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index b6cfcf0..6c9cc2f 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -1855,13 +1855,13 @@ int sta_info_move_state(struct sta_info *sta,
>  	switch (new_state) {
>  	case IEEE80211_STA_NONE:
>  		if (sta->sta_state == IEEE80211_STA_AUTH)
> -			clear_bit(WLAN_STA_AUTH, &sta->_flags);
> +			clear_sta_flag(sta, WLAN_STA_AUTH);

You should try to run this patch sometime :)

johannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] mac80211: use accessor functions to set sta->_flags
  2017-01-24 15:44   ` Johannes Berg
@ 2017-01-25  8:55     ` Amadeusz Slawinski
  2017-01-25  9:17       ` Johannes Berg
  0 siblings, 1 reply; 6+ messages in thread
From: Amadeusz Slawinski @ 2017-01-25  8:55 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, David S. Miller, netdev, linux-kernel

And yes I did. Somehow managed to ignore those warnings though, sorry
about that.
Rechecked with just first patch and it should still be good. Please
ignore this one ;)

On 24 January 2017 at 16:44, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Tue, 2017-01-24 at 16:42 +0100, Amadeusz Sławiński wrote:
>> cleanup patch to make use of set_sta_flag()/clear_sta_flag() in
>> places
>> where we access sta->_flags
>>
>> Signed-off-by: Amadeusz Sławiński <amadeusz.slawinski@tieto.com>
>> ---
>>  net/mac80211/sta_info.c | 12 ++++++------
>>  1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
>> index b6cfcf0..6c9cc2f 100644
>> --- a/net/mac80211/sta_info.c
>> +++ b/net/mac80211/sta_info.c
>> @@ -1855,13 +1855,13 @@ int sta_info_move_state(struct sta_info *sta,
>>       switch (new_state) {
>>       case IEEE80211_STA_NONE:
>>               if (sta->sta_state == IEEE80211_STA_AUTH)
>> -                     clear_bit(WLAN_STA_AUTH, &sta->_flags);
>> +                     clear_sta_flag(sta, WLAN_STA_AUTH);
>
> You should try to run this patch sometime :)
>
> johannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] mac80211: use accessor functions to set sta->_flags
  2017-01-25  8:55     ` Amadeusz Slawinski
@ 2017-01-25  9:17       ` Johannes Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-01-25  9:17 UTC (permalink / raw)
  To: Amadeusz Slawinski; +Cc: linux-wireless, David S. Miller, netdev, linux-kernel

On Wed, 2017-01-25 at 09:55 +0100, Amadeusz Slawinski wrote:
> And yes I did. Somehow managed to ignore those warnings though, sorry
> about that.

:)
That was intentional so nobody changing mac80211 in the future will
accidentally play with those flags through the normal accessors.

> Rechecked with just first patch and it should still be good. Please
> ignore this one ;)

Yeah, I still have that one pending, no worries :)

johannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[]
  2017-01-24 15:42 [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[] Amadeusz Sławiński
  2017-01-24 15:42 ` [PATCH 2/2] mac80211: use accessor functions to set sta->_flags Amadeusz Sławiński
@ 2017-01-26  8:51 ` Johannes Berg
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Berg @ 2017-01-26  8:51 UTC (permalink / raw)
  To: Amadeusz Sławiński, linux-wireless
  Cc: David S. Miller, netdev, linux-kernel

On Tue, 2017-01-24 at 16:42 +0100, Amadeusz Sławiński wrote:
> cleanup patch to make use of ieee80211_ac_from_tid() to retrieve ac
> from
> ieee802_1d_to_ac[]

Applied.

johannes

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-26  8:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 15:42 [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[] Amadeusz Sławiński
2017-01-24 15:42 ` [PATCH 2/2] mac80211: use accessor functions to set sta->_flags Amadeusz Sławiński
2017-01-24 15:44   ` Johannes Berg
2017-01-25  8:55     ` Amadeusz Slawinski
2017-01-25  9:17       ` Johannes Berg
2017-01-26  8:51 ` [PATCH 1/2] mac80211: use helper function to access ieee802_1d_to_ac[] Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).