10 static int join_ocb(struct nl80211_state
*state
,
11 struct nl_msg
*msg
, int argc
, char **argv
,
20 } *chanmode_selected
, chanmode
[] = {
22 .width
= NL80211_CHAN_WIDTH_5
},
24 .width
= NL80211_CHAN_WIDTH_10
},
31 freq
= strtoul(argv
[0], &end
, 10);
35 NLA_PUT_U32(msg
, NL80211_ATTR_WIPHY_FREQ
, freq
);
40 for (i
= 0; i
< ARRAY_SIZE(chanmode
); i
++) {
41 if (strcasecmp(chanmode
[i
].name
, argv
[0]) == 0) {
42 chanmode_selected
= &chanmode
[i
];
46 if (chanmode_selected
) {
47 NLA_PUT_U32(msg
, NL80211_ATTR_CHANNEL_WIDTH
,
48 chanmode_selected
->width
);
49 NLA_PUT_U32(msg
, NL80211_ATTR_CENTER_FREQ1
, freq
);
62 COMMAND(ocb
, join
, "<freq in MHz> <5MHZ|10MHZ>",
63 NL80211_CMD_JOIN_OCB
, 0, CIB_NETDEV
, join_ocb
,
64 "Join the OCB mode network.");
66 static int leave_ocb(struct nl80211_state
*state
,
67 struct nl_msg
*msg
, int argc
, char **argv
,
75 COMMAND(ocb
, leave
, NULL
, NL80211_CMD_LEAVE_OCB
, 0, CIB_NETDEV
, leave_ocb
,
76 "Leave the OCB mode network.");