]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: use get_cf1 and struct chanmode for ocb
authorSven Eckelmann <sven@open-mesh.com>
Wed, 25 Nov 2015 13:59:17 +0000 (14:59 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 Jan 2016 11:03:18 +0000 (12:03 +0100)
The struct chanmode and the function get_cf1 is already used by ibss and
mesh. Also use it for ocb to make it consistent for for all join functions.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ocb.c

diff --git a/ocb.c b/ocb.c
index 767eb82c51aef054cc870effed777e7270af0522..bcf04742c33ea6ddf4b136070e93bdd969d7884d 100644 (file)
--- a/ocb.c
+++ b/ocb.c
@@ -13,14 +13,16 @@ static int join_ocb(struct nl80211_state *state,
        unsigned long freq;
        char *end;
        unsigned int i;
-       static const struct {
-               const char *name;
-               unsigned int width;
-       } *chanmode_selected, chanmode[] = {
+       const struct chanmode *chanmode_selected = NULL;
+       static const struct chanmode chanmode[] = {
                { .name = "5MHz",
-                 .width = NL80211_CHAN_WIDTH_5 },
+                 .width = NL80211_CHAN_WIDTH_5,
+                 .freq1_diff = 0,
+                 .chantype = -1 },
                { .name = "10MHz",
-                 .width = NL80211_CHAN_WIDTH_10 },
+                 .width = NL80211_CHAN_WIDTH_10,
+                 .freq1_diff = 0,
+                 .chantype = -1 },
        };
 
        if (argc < 2)
@@ -45,7 +47,8 @@ static int join_ocb(struct nl80211_state *state,
        if (chanmode_selected) {
                NLA_PUT_U32(msg, NL80211_ATTR_CHANNEL_WIDTH,
                            chanmode_selected->width);
-               NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1, freq);
+               NLA_PUT_U32(msg, NL80211_ATTR_CENTER_FREQ1,
+                           get_cf1(chanmode_selected, freq));
 
                argv++;
                argc--;