[Click] [click] How to modify ath9k driver if click-1.8.0 want to support 802.11n mode
欧阳鑫
yuanmmsip at gmail.com
Mon Mar 14 08:44:29 EDT 2011
Hi, everyone.
I am running roofnet experiments on 2 Ubuntu hosts with 2.6.32-26
kernel. Both are AR5416 cards with ath9k driver, and I have updated ath9k
driver to compat-wireless-2011-01-15, and also patched. All cards run in
Monitor mode. The roofnet can run on high rates, and also can run on mode b
and mode g. But now I want to run on mode n, I know the radiotap element
currently included in click do not support the MCS rate fields necessary to
send frames at 11n rates. I look up much information and then find there is
already a patch to solve this problem:
http://permalink.gmane.org/gmane.network.wireless.radiotap/239 .
I only patch the ath9k driver include
wireless-testing/net/mac80211/rx.c and
wireless-testing/include/net/ieee80211_radiotap.h. And also modify
wireless-testing/net/mac80211/tx.c:
switch (iterator.this_arg_index) {
..................
case IEEE80211_RADIOTAP_DATA_RETRIES:
/*
* Only allow setting the number of retries in
* conjunction with the rates, when the rate control
* is bypassed.
*/
if (info->flags & IEEE80211_TX_CTL_RC_BYPASS)
info->control.rates[0].count =
*iterator.this_arg;
break;
+ case IEEE80211_RADIOTAP_MCS: {
+ u8 known, flags;
+ known = *(iterator.this_arg);
+ flags = *(iterator.this_arg + 1);
+ // set Band width
+ if (known & IEEE80211_RADIOTAP_MCS_HAVE_BW) {
+ if (flags & IEEE80211_RADIOTAP_MCS_BW_40)
+ info->control.rates[0].flags |=
IEEE80211_TX_RC_40_MHZ_WIDTH;
+ }
+ // set Rate index
+ info->control.rates[0].flags |= IEEE80211_TX_RC_MCS;
+ if (known & IEEE80211_RADIOTAP_MCS_HAVE_MCS)
+ info->control.rates[0].idx = *(iterator.this_arg + 2);
+ // set Guard interval
+ if (known & IEEE80211_RADIOTAP_MCS_HAVE_GI) {
+ if (flags & IEEE80211_RADIOTAP_MCS_SGI)
+ info->control.rates[0].flags |=
IEEE80211_TX_RC_SHORT_GI;
+ }
+ // set FMT
+ if (known & IEEE80211_RADIOTAP_MCS_HAVE_FMT) {
+ if (flags & IEEE80211_RADIOTAP_MCS_FMT_GF)
+ info->control.rates[0].flags |=
IEEE80211_TX_RC_GREEN_FIELD;
+ }
+ // set FEC
+ if (known & IEEE80211_RADIOTAP_MCS_HAVE_FEC) {
+ if (flags & IEEE80211_RADIOTAP_MCS_FEC_LDPC)
+ info->flags |= IEEE80211_TX_CTL_LDPC;
+ }
break;
}
I do some experiments, but I find that the argument
iterator.this_arg_index in wireless-testing/net/mac80211/tx.c switch
(iterator.this_arg_index) is not equal IEEE80211_RADIOTAP_MCS, so the
ath9k driver can not support 80211n mode.
I do not know why the argument iterator.this_arg_index is not equal
IEEE80211_RADIOTAP_MCS. Should I modify some other *.c or *.h files?
Could someone tell me how to do if you know something about it? Thank you
very much!
Yours,
ouyang
More information about the click
mailing list