Search Linux Wireless

nl80211.h txq parameters via userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried to add use the nl80211.h userspace API to configure the txq
parameters via the 'iw' utility. From my understanding (and after
staring at the nl80211.h) I have to send nested netlink
messages. I added the following to 'phy.c' in the iw-3.15 source files
to extend iw with the command 'iw <phy_dev> set txq <cwmin> <cwmax>'
but somehow I always get a 'command failed: Invalid argument (-22)'
returned. I tried this with two different drivers/physical devices
(intel's iwlwifi and realtek's rtl8192cu) and had no luck (same
error). Do I use this wrong?
>From my understanding this should work driver independently since
mac80211 is shared and work at least for iwlwifi. Thanks for any help!

static int handle_txq(struct nl80211_state *state,
struct nl_cb *cb,
struct nl_msg *msg,
int argc, char **argv,
enum id_input id)
{
unsigned int cw_min, cw_max;
printf("HANDLE TXQ");
if (argc != 2)
return 1;

cw_min = atoi(argv[0]);
cw_max = atoi(argv[1]);

printf("setting contention window to: %d - %d\n",cw_min,cw_max);

//create nested txq array

struct nlattr *nested;

nested = nla_nest_start(msg,NL80211_ATTR_WIPHY_TXQ_PARAMS);

NLA_PUT_U16(msg,NL80211_TXQ_ATTR_CWMIN,cw_min);
NLA_PUT_U16(msg,NL80211_TXQ_ATTR_CWMAX,cw_max);
nla_nest_end(msg,nested);

return 0;
 nla_put_failure:
return -ENOBUFS;
}
COMMAND(set, txq, "<cw_min> <cw_max>",
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_txq,
"Set contention window minimum and maximum size.\n"
"Valid values: 1 - 32767 in the form 2^n-1");

COMMAND(set, txq, "<cw_min> <cw_max>",
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_txq,
"Set contention window minimum and maximum size.\n"
"Valid values: 1 - 32767 in the form 2^n-1");
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux