802.11 경쟁 윈도우의 최대 및 최소 크기를 설정할 수 있도록'iw '유틸리티를 확장하려고했습니다. 그러나 나는 항상 '잘못된 인수 (-22)'를 반환했습니다. libnl 'nl80211을 사용하는 동안 잘못된 인수 (-22)
은 내가 IW-3.15 소스의 phy.c을 편집하고 내가 nl80211의 좋은 문서를 찾을 수 없습니다 또는 헤더 파일 자체를 제외 넷 링크를 통해 사용의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");
을 추가. 나는 이 아니며, 스펙에 따라 중첩 된 메시지를 구성하고 U16을 사용하여 특성을 추측합니다 (일치하는 cfg80211에서 uint_16 임).
netlink에 대한 제 이해에서 메시지 어셈블리가 정확해야합니다. 그러나 오류가 발생하기 때문에 나는 아마도 잘못된 것입니다 ... 아무도 nl80211 및 그 사용법에 대한 좋은 설명서가 있습니까? 누구든지 내 문제를 파악할 수 있습니까?