9 static int join_ocb(struct nl80211_state
*state
,
10 struct nl_msg
*msg
, int argc
, char **argv
,
16 const struct chanmode
*chanmode_selected
= NULL
;
17 static const struct chanmode chanmode
[] = {
19 .width
= NL80211_CHAN_WIDTH_5
,
23 .width
= NL80211_CHAN_WIDTH_10
,
32 freq
= strtoul(argv
[0], &end
, 10);
36 NLA_PUT_U32(msg
, NL80211_ATTR_WIPHY_FREQ
, freq
);
41 for (i
= 0; i
< ARRAY_SIZE(chanmode
); i
++) {
42 if (strcasecmp(chanmode
[i
].name
, argv
[0]) == 0) {
43 chanmode_selected
= &chanmode
[i
];
47 if (chanmode_selected
) {
48 NLA_PUT_U32(msg
, NL80211_ATTR_CHANNEL_WIDTH
,
49 chanmode_selected
->width
);
50 NLA_PUT_U32(msg
, NL80211_ATTR_CENTER_FREQ1
,
51 get_cf1(chanmode_selected
, freq
));
64 COMMAND(ocb
, join
, "<freq in MHz> <5MHz|10MHz>",
65 NL80211_CMD_JOIN_OCB
, 0, CIB_NETDEV
, join_ocb
,
66 "Join the OCB mode network.");
68 static int leave_ocb(struct nl80211_state
*state
,
69 struct nl_msg
*msg
, int argc
, char **argv
,
77 COMMAND(ocb
, leave
, NULL
, NL80211_CMD_LEAVE_OCB
, 0, CIB_NETDEV
, leave_ocb
,
78 "Leave the OCB mode network.");