Hello, below is a patch by Pavel Roskin [1] which allows for choosing frame bit rate and retry count in injected frames. I've reformatted it to match compat-wireless of openwrt trunk@26460 (git 020dd72982225bf36072130046c88c3fdab12811). I find it very useful for my needs, you may want to consider importing.
[1] http://article.gmane.org/gmane.linux.kernel.wireless.general/47441 diff -urN a/include/net/mac80211.h b/include/net/mac80211.h --- a/include/net/mac80211.h 2011-04-04 10:19:31.269159064 +0200 +++ b/include/net/mac80211.h 2011-05-10 13:24:34.520866984 +0200 @@ -344,6 +344,7 @@ * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP * testing. It will be sent out with incorrect Michael MIC key to allow * TKIP countermeasures to be tested. + * @IEEE80211_TX_CTL_RC_BYPASS: Don't use rate control on the frame. * * Note: If you have to add new flags to the enumeration, then don't * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. @@ -374,6 +375,7 @@ IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), + IEEE80211_TX_CTL_RC_BYPASS = BIT(27), }; #define IEEE80211_TX_CTL_STBC_SHIFT 23 diff -urN a/net/mac80211/tx.c b/net/mac80211/tx.c --- a/net/mac80211/tx.c 2011-03-25 21:43:25.000000000 +0100 +++ b/net/mac80211/tx.c 2011-05-10 13:28:11.096866864 +0200 @@ -1091,6 +1091,39 @@ tx->flags |= IEEE80211_TX_FRAGMENTED; break; + case IEEE80211_RADIOTAP_RATE: { + int i, idx = -1; + int rate = *iterator.this_arg * 5; + + for (i = 0; i < sband->n_bitrates; i++) + if (sband->bitrates[i].bitrate == rate) { + idx = i; + break; + } + + /* Rate not available - rejecting */ + if (idx < 0) + return false; + + info->flags |= IEEE80211_TX_CTL_RC_BYPASS; + info->control.rates[0].idx = idx; + info->control.rates[0].count = 1; + for (i = 1; i < IEEE80211_TX_MAX_RATES; i++) + info->control.rates[i].idx = -1; + break; + } + + 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; + /* * Please update the file * Documentation/networking/mac80211-injection.txt @@ -1397,7 +1430,8 @@ CALL_TXH(ieee80211_tx_h_ps_buf); CALL_TXH(ieee80211_tx_h_check_control_port_protocol); CALL_TXH(ieee80211_tx_h_select_key); - if (!(tx->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)) + if (!(tx->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) && + !(info->flags & IEEE80211_TX_CTL_RC_BYPASS)) CALL_TXH(ieee80211_tx_h_rate_ctrl); if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) --- Paweł Foremski _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel