support for antenna configuration profiles
PATCH 6/6 support for antenna configuration profiles
This adds support for controlling an external antenna switch to the iw userspace tool.
The part in info.c doesn't work properly yet, somehow nla_parse doesn't like NL80211_ATTR_WIPHY_EXTANT_SUPP_PROFILES... Anyone can spot the mistake here maybe? (or is there anything wrong in my implementation in nl80211.c...?)
Signed-off-by Daniel Golle <[email protected]>
iw-3.1/phy.c +27 -0
@@ -333,3 +333,30 @@ COMMAND(set, antenna, "<bitmap> | all |NL80211_CMD_SET_WIPHY ,0 ,CIB_PHY , handle_antenna,"Set a bitmap of allowed antennas to use for TX and RX.\n" "The driver may reject antenna configurations it cannot support."); + +static int handle_extant (struct nl80211_state *state, +struct nl_cb *cb, +struct nl_msg *msg, +int argc,char **argv) +{ +char *end; +__u32 extant; + +if (argc ==1 ) { + extant =strtoul (argv[0 ], &end,0 ); +if (*end) +return 1 ; + }else +return 1 ; + +NLA_PUT_U32 (msg,NL80211_ATTR_WIPHY_EXTANT_STATE , extant); + +return 0 ; + + nla_put_failure: +return -ENOBUFS ; +} +COMMAND (set, extant,"<profile>" , +NL80211_CMD_SET_WIPHY ,0 ,CIB_PHY , handle_extant, +"Select the external antenna switch configuration profile.\n" +"The driver accepts only profiles defined for the hardware." );
iw-3.1/info.c +59 -0
65 lines not on this page · raw message