This patch enables to set txq params such as aifs, cwmin, cwmax and txop for each queue for VO, VI, BE, BK directly using ?iw? command. Signed-off-by: Jinsung Lee <ljs@xxxxxxxxxxxxxxxxxx> --- Index: iw-0.9.17/phy.c =================================================================== *** a/iw-0.9.17/phy.c 2009-08-26 18:41:41.000000000 +0900 --- b/iw-0.9.17/phy.c 2009-11-10 23:53:49.000000000 +0900 *************** static int handle_rts(struct nl80211_sta *** 140,142 **** --- 140,216 ---- COMMAND(set, rts, "<rts threshold|off>", NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_rts, "Set rts threshold."); + + static int handle_txq_params(struct nl80211_state *state, + struct nl_cb *cb, struct nl_msg *msg, + int argc, char **argv) + { + __u8 queue, aifs; + __u16 txop, cwmin, cwmax; + + struct nlattr *nl_txqs; + + if (argc != 1) + return 1; + + if (strcmp("off", argv[0]) == 0) + return 0; + + + queue = strtoul(argv[0], NULL, 10); + + switch(queue) { + case 0: + printf("configuring TX queue for VO\n"); + txop = 0; + cwmin = 7; + cwmax = 15; + aifs = 2; + break; + case 1: + printf("configuring TX queue for VI\n"); + txop = 0; + cwmin = 15; + cwmax = 31; + aifs = 2; + break; + case 2: + printf("configuring TX queue for BE\n"); + txop = 0; + cwmin = 31; + cwmax = 1023; + aifs = 3; + break; + case 3: + printf("configuring TX queue for BK\n"); + txop = 0; + cwmin = 31; + cwmax = 1023; + aifs = 7; + break; + default: + printf("switch() error\n"); + return -1; + } + + nl_txqs = nla_nest_start(msg, NL80211_ATTR_WIPHY_TXQ_PARAMS); + if (!nl_txqs) + return -ENOBUFS; + + struct nlattr *nl_txq = nla_nest_start(msg, queue); + NLA_PUT_U8(msg, NL80211_TXQ_ATTR_QUEUE, queue); + NLA_PUT_U16(msg, NL80211_TXQ_ATTR_TXOP, txop); + NLA_PUT_U16(msg, NL80211_TXQ_ATTR_CWMIN, cwmin); + NLA_PUT_U16(msg, NL80211_TXQ_ATTR_CWMAX, cwmax); + NLA_PUT_U8(msg, NL80211_TXQ_ATTR_AIFS, aifs); + nla_nest_end(msg, nl_txq); + + nla_nest_end(msg, nl_txqs); + + return 0; + nla_put_failure: + return -ENOBUFS; + } + COMMAND(set, txq_params, "<queue type in [0,1,2,3]|off>", + NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_txq_params, + "Set txq parameters."); ÿôèº{.nÇ+?·?®??+%?Ëÿ±éݶ¥?wÿº{.nÇ+?·¥?{±ÿ«zW¬³ø§¶?¡Ü¨}©?²Æ zÚ&j:+v?¨þø¯ù®w¥þ?à2?Þ?¨èÚ&¢)ß¡«a¶Úÿÿûàz¿äz¹Þ?ú+?ù???Ý¢jÿ?wèþf