Thread (34 messages) 34 messages, 3 authors, 2012-07-25

Re: [RFC v3 6/7] mac80211: refactor set_channel_type

From: Eliad Peller <hidden>
Date: 2012-06-26 14:04:56

hi Michal,

On Tue, Jun 26, 2012 at 3:37 PM, Michal Kazior [off-list ref] wrote:
From: Kazior Michal <redacted>

Split functionality for further reuse.

Will prevent code duplication when channel context
channel_type merging is introduced.

Signed-off-by: Michal Kazior <redacted>
---
[...]
+static bool
+ieee80211_channel_types_are_compatible(enum nl80211_channel_type chantype1,
+                                      enum nl80211_channel_type chantype2,
+                                      enum nl80211_channel_type *compat)
+{
+       switch (chantype1) {
       case NL80211_CHAN_NO_HT:
       case NL80211_CHAN_HT20:
               /*
                * allow any change that doesn't go to no-HT
                * (if it already is no-HT no change is needed)
                */
-               if (chantype == NL80211_CHAN_NO_HT)
+               if (chantype2 == NL80211_CHAN_NO_HT)
                       break;
-               superchan = chantype;
+               *compat = chantype2;
               break;
       case NL80211_CHAN_HT40PLUS:
       case NL80211_CHAN_HT40MINUS:
+               *compat = chantype1;
this should be outside of switch, as it applies to the first cases as
well (chantype1=ht20, chantype2=no_ht will return the original *compat
value (no_ht) instead of ht20).

Eliad.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help