iw: Support ht-capability overrides mask.
PATCH v2 1/1 iw: Support ht-capability overrides mask.
From: Ben Greear <[email protected]>
Let user know which capabilities are supported.
Signed-off-by Ben Greear <[email protected]>
---
:100644 100644 b55b282... 040937c... M info.c
:100644 100644 a50d447... 1fcc343... M iw.h
:100644 100644 8049bf7... f5adc62... M nl80211.h
:100644 100644 e03ec2c... c452a64... M util.c
info.c | 33 +++++++++++++++++++++++++++++++ iw.h | 2 +- nl80211.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ util.c | 8 +++++++ 4 files changed, 105 insertions(+), 1 deletions(-)
info.c +33 -0
@@ -400,6 +400,39 @@ broken_combination:if (tb_msg[NL80211_ATTR_SUPPORT_AP_UAPSD ])printf ("\tDevice supports AP-side u-APSD.\n" ); +if (tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK ]) { +struct ieee80211_ht_cap *cm; +printf ("\tHT Capabilities over-rides:\n" ); +if (nla_len (tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK ]) >= +sizeof (*cm)) { + cm =nla_data (tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK ]); +printf ("\t\t * MCS: %02hx %02hx %02hx %02hx %02hx %02hx" +" %02hx %02hx %02hx %02hx\n" , + cm->mcs.rx_mask[0 ], cm->mcs.rx_mask[1 ], + cm->mcs.rx_mask[2 ], cm->mcs.rx_mask[3 ], + cm->mcs.rx_mask[4 ], cm->mcs.rx_mask[5 ], + cm->mcs.rx_mask[6 ], cm->mcs.rx_mask[7 ], + cm->mcs.rx_mask[8 ], cm->mcs.rx_mask[9 ]); +printf ("\t\t * MAX-AMSDU: %s\n" +"\t\t * WIDTH-20-40: %s\n" +"\t\t * SGI-40: %s\n" +"\t\t * AMPDU-Factor: %s\n" +"\t\t * AMPDU-Density: %s\n" , + cm->cap_info &cpu_to_le16 (IEEE80211_HT_CAP_MAX_AMSDU ) ?"Yes" :"No" , + cm->cap_info &cpu_to_le16 (IEEE80211_HT_CAP_SUP_WIDTH_20_40 ) ?"Yes" :"No" , + cm->cap_info &cpu_to_le16 (IEEE80211_HT_CAP_SGI_40 ) ?"Yes" :"No" , + cm->ampdu_params_info &IEEE80211_HT_AMPDU_PARM_FACTOR ?"Yes" :"No" , + cm->ampdu_params_info &IEEE80211_HT_AMPDU_PARM_DENSITY ?"Yes" :"No" ); + }else { +printf ("\tERROR: capabilities mask is too short, expected: %d" +", received: %d\n" , + (int )(sizeof (*cm)), + (int )(nla_len (tb_msg[NL80211_ATTR_HT_CAPABILITY_MASK ]))); + } + }else { +printf ("\tHT Capabilities over-rides are NOT supported.\n" ); + } +return NL_SKIP ; }
iw.h +1 -1
@@ -125,7 +125,7 @@ __u32 __do_listen_events(struct nl80211_state *state, const int n_waits, const __u32 *waits, struct print_event_args *args); - +unsigned short cpu_to_le16 (unsigned short v);int mac_addr_a2n (unsigned char *mac_addr,char *arg);void mac_addr_n2a (char *mac_addr,unsigned char *arg); int parse_hex_mask(char *hexmask, unsigned char **result, size_t *result_len,
nl80211.h +63 -0
81 lines not on this page · raw message
util.c +8 -0
@@ -5,6 +5,14 @@#include "iw.h" #include "nl80211.h" +unsigned short cpu_to_le16 (unsigned short v) +{ +unsigned short nv =htons (v); +/* and now swap this to get litte-endian */ +return ((nv &0xff ) <<8 ) | ((nv &0xff00 ) >>8 ); +} + +void mac_addr_n2a (char *mac_addr,unsigned char *arg) {int i, l;
Signature · 1 line
1.7.3.4
nl80211.h enum nl80211_iftype { · line 1443
Quoted 7 lines · On Fri, 2011-11-18 at 14:03 -0800, [email protected] wrote:
From: Ben Greear <[email protected]>
Let user know which capabilities are supported.
nl80211.h +3
-0+/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ +#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 +#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
This patch doesn't compile after I replace nl80211.h. nl80211.h is supposed to be a true copy of the kernel's file, not some randomly hacked up version. I can't apply this.
johannes