3 #include <netlink/genl/genl.h>
4 #include <netlink/genl/family.h>
5 #include <netlink/genl/ctrl.h>
6 #include <netlink/msg.h>
7 #include <netlink/attr.h>
12 static int iw_cqm_rssi(struct nl80211_state
*state
, struct nl_cb
*cb
,
13 struct nl_msg
*msg
, int argc
, char **argv
,
16 struct nl_msg
*cqm
= NULL
;
21 /* get the required args */
22 if (argc
< 1 || argc
> 2)
25 if (strcmp(argv
[0], "off")) {
26 thold
= atoi(argv
[0]);
35 /* connection quality monitor attributes */
38 NLA_PUT_U32(cqm
, NL80211_ATTR_CQM_RSSI_THOLD
, thold
);
39 NLA_PUT_U32(cqm
, NL80211_ATTR_CQM_RSSI_HYST
, hyst
);
41 nla_put_nested(msg
, NL80211_ATTR_CQM
, cqm
);
50 0, 0, CIB_NETDEV
, NULL
,
51 "Configure the WLAN connection quality monitor.\n");
53 COMMAND(cqm
, rssi
, "<threshold|off> [<hysteresis>]",
54 NL80211_CMD_SET_CQM
, 0, CIB_NETDEV
, iw_cqm_rssi
,
55 "Set connection quality monitor RSSI threshold.\n");