iw: Support ht-capability overrides mask.
PATCH v3 1/1 iw: Support ht-capability overrides mask.
From: Ben Greear <[email protected]>
Let user know which capabilities are supported.
---
v3: Don't make modifications to nl80211.h..put new code
in iw.h instead.
:100644 100644 b55b282... 040937c... M info.c
:100644 100644 a50d447... 441c724... M iw.h
:100644 100644 e03ec2c... c452a64... M util.c
info.c | 33 +++++++++++++++++++++++++++++++++ iw.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++- util.c | 8 ++++++++ 3 files changed, 87 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 +46 -1
53 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
Quoted 3 lines · On Mon, 2011-11-28 at 10:40 -0800, [email protected] wrote:
From: Ben Greear <[email protected]>
Let user know which capabilities are supported.
I applied this with a bunch of modifications, but I think you should follow up and make it more complete. You're covering exactly and only the case that you're working on right now, I don't think that's good practice.
johannes
Quoted 9 lines · Johannes Berg
Quoted 3 lines · On Mon, 2011-11-28 at 10:40 -0800, [email protected] wrote:
From: Ben Greear<[email protected]>
Let user know which capabilities are supported.
I applied this with a bunch of modifications, but I think you should follow up and make it more complete. You're covering exactly and only the case that you're working on right now, I don't think that's good practice.
It would just be adding dead code until I get more kernel changes in?
But, if you can think of any other over-rides you'd like to see supported, I can attempt to cook up some kernel patches as well.
Thanks,
Ben
Quoted 7 lines
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 9 lines · Johannes Berg
Quoted 3 lines · On Mon, 2011-11-28 at 10:40 -0800, [email protected] wrote:
From: Ben Greear<[email protected]>
Let user know which capabilities are supported.
I applied this with a bunch of modifications, but I think you should follow up and make it more complete. You're covering exactly and only the case that you're working on right now, I don't think that's good practice.
It looks to me like your change isn't going to compile on older systems (Fedora Core 8, for instance), because htole16 isn't defined there (no endian.h file).
That is why I hand-coded an equivalent method...
Thanks,
Ben
Signature · 2 lines
Ben Greear <[email protected]> Candela Technologies Inc http://www.candelatech.com
Quoted 11 lines · Ben Greear
Quoted 9 lines · Johannes Berg
Quoted 3 lines · On Mon, 2011-11-28 at 10:40 -0800, [email protected] wrote:
From: Ben Greear<[email protected]>
Let user know which capabilities are supported.
I applied this with a bunch of modifications, but I think you should follow up and make it more complete. You're covering exactly and only the case that you're working on right now, I don't think that's good practice.
Quoted 5 lines
It looks to me like your change isn't going to compile on older systems (Fedora Core 8, for instance), because htole16 isn't defined there (no
endian.hfile).That is why I hand-coded an equivalent method...
I assume you mean Fedora 8 (they dropped the Core after 6)? That was released, uh, about 4 years ago. I don't think I care.
johannes