svn commit: r188790 - in projects/vap7/sys: . contrib/pf dev
dev/ath dev/ath/ath_hal dev/ath/ath_hal/ar5210
dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212
dev/ath/ath_hal/ar5312 dev/ath/ath_hal/ar54...
Sam Leffler
sam at FreeBSD.org
Wed Feb 18 21:46:33 PST 2009
Author: sam
Date: Thu Feb 19 05:46:32 2009
New Revision: 188790
URL: http://svn.freebsd.org/changeset/base/188790
Log:
merge r188773: cleanup ath_hal_computetxtime's handling of
1/2 and 1/4-width channels
Modified:
projects/vap7/sys/ (props changed)
projects/vap7/sys/contrib/pf/ (props changed)
projects/vap7/sys/dev/ (props changed)
projects/vap7/sys/dev/ath/ (props changed)
projects/vap7/sys/dev/ath/ath_hal/ (props changed)
projects/vap7/sys/dev/ath/ath_hal/ah.c
projects/vap7/sys/dev/ath/ath_hal/ah_internal.h
projects/vap7/sys/dev/ath/ath_hal/ar5210/ (props changed)
projects/vap7/sys/dev/ath/ath_hal/ar5211/ (props changed)
projects/vap7/sys/dev/ath/ath_hal/ar5212/ (props changed)
projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c
projects/vap7/sys/dev/ath/ath_hal/ar5312/ (props changed)
projects/vap7/sys/dev/ath/ath_hal/ar5416/ (props changed)
projects/vap7/sys/dev/cxgb/ (props changed)
projects/vap7/sys/dev/usb2/ (props changed)
projects/vap7/sys/i386/conf/USB2 (props changed)
projects/vap7/sys/modules/usb2/ (props changed)
projects/vap7/sys/net80211/ (props changed)
Modified: projects/vap7/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- projects/vap7/sys/dev/ath/ath_hal/ah.c Thu Feb 19 05:45:41 2009 (r188789)
+++ projects/vap7/sys/dev/ath/ath_hal/ah.c Thu Feb 19 05:46:32 2009 (r188790)
@@ -166,11 +166,7 @@ ath_hal_computetxtime(struct ath_hal *ah
if (kbps == 0)
return 0;
switch (rates->info[rateix].phy) {
-
case IEEE80211_T_CCK:
-#define CCK_SIFS_TIME 10
-#define CCK_PREAMBLE_BITS 144
-#define CCK_PLCP_BITS 48
phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS;
if (shortPreamble && rates->info[rateix].shortPreamble)
phyTime >>= 1;
@@ -178,81 +174,47 @@ ath_hal_computetxtime(struct ath_hal *ah
txTime = CCK_SIFS_TIME + phyTime
+ ((numBits * 1000)/kbps);
break;
-#undef CCK_SIFS_TIME
-#undef CCK_PREAMBLE_BITS
-#undef CCK_PLCP_BITS
-
case IEEE80211_T_OFDM:
-#define OFDM_SIFS_TIME 16
-#define OFDM_PREAMBLE_TIME 20
-#define OFDM_PLCP_BITS 22
-#define OFDM_SYMBOL_TIME 4
-
-#define OFDM_SIFS_TIME_HALF 32
-#define OFDM_PREAMBLE_TIME_HALF 40
-#define OFDM_PLCP_BITS_HALF 22
-#define OFDM_SYMBOL_TIME_HALF 8
-
-#define OFDM_SIFS_TIME_QUARTER 64
-#define OFDM_PREAMBLE_TIME_QUARTER 80
-#define OFDM_PLCP_BITS_QUARTER 22
-#define OFDM_SYMBOL_TIME_QUARTER 16
-
- if (AH_PRIVATE(ah)->ah_curchan != AH_NULL &&
- IEEE80211_IS_CHAN_QUARTER(AH_PRIVATE(ah)->ah_curchan)) {
- bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000;
- HALASSERT(bitsPerSymbol != 0);
-
- numBits = OFDM_PLCP_BITS + (frameLen << 3);
- numSymbols = howmany(numBits, bitsPerSymbol);
- txTime = OFDM_SIFS_TIME_QUARTER
- + OFDM_PREAMBLE_TIME_QUARTER
- + (numSymbols * OFDM_SYMBOL_TIME_QUARTER);
- } else if (AH_PRIVATE(ah)->ah_curchan != AH_NULL &&
- IEEE80211_IS_CHAN_HALF(AH_PRIVATE(ah)->ah_curchan)) {
- bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000;
- HALASSERT(bitsPerSymbol != 0);
-
- numBits = OFDM_PLCP_BITS + (frameLen << 3);
- numSymbols = howmany(numBits, bitsPerSymbol);
- txTime = OFDM_SIFS_TIME_HALF +
- OFDM_PREAMBLE_TIME_HALF
- + (numSymbols * OFDM_SYMBOL_TIME_HALF);
- } else { /* full rate channel */
- bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000;
- HALASSERT(bitsPerSymbol != 0);
-
- numBits = OFDM_PLCP_BITS + (frameLen << 3);
- numSymbols = howmany(numBits, bitsPerSymbol);
- txTime = OFDM_SIFS_TIME + OFDM_PREAMBLE_TIME
- + (numSymbols * OFDM_SYMBOL_TIME);
- }
+ bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000;
+ HALASSERT(bitsPerSymbol != 0);
+
+ numBits = OFDM_PLCP_BITS + (frameLen << 3);
+ numSymbols = howmany(numBits, bitsPerSymbol);
+ txTime = OFDM_SIFS_TIME
+ + OFDM_PREAMBLE_TIME
+ + (numSymbols * OFDM_SYMBOL_TIME);
break;
+ case IEEE80211_T_OFDM_HALF:
+ bitsPerSymbol = (kbps * OFDM_HALF_SYMBOL_TIME) / 1000;
+ HALASSERT(bitsPerSymbol != 0);
-#undef OFDM_SIFS_TIME
-#undef OFDM_PREAMBLE_TIME
-#undef OFDM_PLCP_BITS
-#undef OFDM_SYMBOL_TIME
+ numBits = OFDM_HALF_PLCP_BITS + (frameLen << 3);
+ numSymbols = howmany(numBits, bitsPerSymbol);
+ txTime = OFDM_HALF_SIFS_TIME
+ + OFDM_HALF_PREAMBLE_TIME
+ + (numSymbols * OFDM_HALF_SYMBOL_TIME);
+ break;
+ case IEEE80211_T_OFDM_QUARTER:
+ bitsPerSymbol = (kbps * OFDM_QUARTER_SYMBOL_TIME) / 1000;
+ HALASSERT(bitsPerSymbol != 0);
+ numBits = OFDM_QUARTER_PLCP_BITS + (frameLen << 3);
+ numSymbols = howmany(numBits, bitsPerSymbol);
+ txTime = OFDM_QUARTER_SIFS_TIME
+ + OFDM_QUARTER_PREAMBLE_TIME
+ + (numSymbols * OFDM_QUARTER_SYMBOL_TIME);
+ break;
case IEEE80211_T_TURBO:
-#define TURBO_SIFS_TIME 8
-#define TURBO_PREAMBLE_TIME 14
-#define TURBO_PLCP_BITS 22
-#define TURBO_SYMBOL_TIME 4
/* we still save OFDM rates in kbps - so double them */
bitsPerSymbol = ((kbps << 1) * TURBO_SYMBOL_TIME) / 1000;
HALASSERT(bitsPerSymbol != 0);
- numBits = TURBO_PLCP_BITS + (frameLen << 3);
- numSymbols = howmany(numBits, bitsPerSymbol);
- txTime = TURBO_SIFS_TIME + TURBO_PREAMBLE_TIME
- + (numSymbols * TURBO_SYMBOL_TIME);
+ numBits = TURBO_PLCP_BITS + (frameLen << 3);
+ numSymbols = howmany(numBits, bitsPerSymbol);
+ txTime = TURBO_SIFS_TIME
+ + TURBO_PREAMBLE_TIME
+ + (numSymbols * TURBO_SYMBOL_TIME);
break;
-#undef TURBO_SIFS_TIME
-#undef TURBO_PREAMBLE_TIME
-#undef TURBO_PLCP_BITS
-#undef TURBO_SYMBOL_TIME
-
default:
HALDEBUG(ah, HAL_DEBUG_PHYIO,
"%s: unknown phy %u (rate ix %u)\n",
Modified: projects/vap7/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- projects/vap7/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 05:45:41 2009 (r188789)
+++ projects/vap7/sys/dev/ath/ath_hal/ah_internal.h Thu Feb 19 05:46:32 2009 (r188790)
@@ -773,5 +773,29 @@ extern void ath_hal_ini_bank_setup(uint3
extern int ath_hal_ini_bank_write(struct ath_hal *ah, const HAL_INI_ARRAY *ia,
const uint32_t data[], int regWr);
+#define CCK_SIFS_TIME 10
+#define CCK_PREAMBLE_BITS 144
+#define CCK_PLCP_BITS 48
+
+#define OFDM_SIFS_TIME 16
+#define OFDM_PREAMBLE_TIME 20
+#define OFDM_PLCP_BITS 22
+#define OFDM_SYMBOL_TIME 4
+
+#define OFDM_HALF_SIFS_TIME 32
+#define OFDM_HALF_PREAMBLE_TIME 40
+#define OFDM_HALF_PLCP_BITS 22
+#define OFDM_HALF_SYMBOL_TIME 8
+
+#define OFDM_QUARTER_SIFS_TIME 64
+#define OFDM_QUARTER_PREAMBLE_TIME 80
+#define OFDM_QUARTER_PLCP_BITS 22
+#define OFDM_QUARTER_SYMBOL_TIME 16
+
+#define TURBO_SIFS_TIME 8
+#define TURBO_PREAMBLE_TIME 14
+#define TURBO_PLCP_BITS 22
+#define TURBO_SYMBOL_TIME 4
+
#define WLAN_CTRL_FRAME_SIZE (2+2+6+4) /* ACK+FCS */
#endif /* _ATH_AH_INTERAL_H_ */
Modified: projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c
==============================================================================
--- projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c Thu Feb 19 05:45:41 2009 (r188789)
+++ projects/vap7/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c Thu Feb 19 05:46:32 2009 (r188790)
@@ -14,7 +14,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: ar5212_phy.c,v 1.5 2008/11/15 03:43:53 sam Exp $
+ * $FreeBSD$
*/
#include "opt_ah.h"
@@ -27,6 +27,8 @@
#define OFDM IEEE80211_T_OFDM
#define CCK IEEE80211_T_CCK
#define TURBO IEEE80211_T_TURBO
+#define HALF IEEE80211_T_OFDM_HALF
+#define QUART IEEE80211_T_OFDM_QUARTER
HAL_RATE_TABLE ar5212_11a_table = {
8, /* number of rates */
@@ -51,14 +53,14 @@ HAL_RATE_TABLE ar5212_half_table = {
{
/* short ctrl */
/* valid rateCode Preamble dot11Rate Rate */
-/* 6 Mb */ { AH_TRUE, OFDM, 3000, 0x0b, 0x00, (0x80|6), 0 },
-/* 9 Mb */ { AH_TRUE, OFDM, 4500, 0x0f, 0x00, 9, 0 },
-/* 12 Mb */ { AH_TRUE, OFDM, 6000, 0x0a, 0x00, (0x80|12), 2 },
-/* 18 Mb */ { AH_TRUE, OFDM, 9000, 0x0e, 0x00, 18, 2 },
-/* 24 Mb */ { AH_TRUE, OFDM, 12000, 0x09, 0x00, (0x80|24), 4 },
-/* 36 Mb */ { AH_TRUE, OFDM, 18000, 0x0d, 0x00, 36, 4 },
-/* 48 Mb */ { AH_TRUE, OFDM, 24000, 0x08, 0x00, 48, 4 },
-/* 54 Mb */ { AH_TRUE, OFDM, 27000, 0x0c, 0x00, 54, 4 }
+/* 3 Mb */ { AH_TRUE, HALF, 3000, 0x0b, 0x00, (0x80|6), 0 },
+/* 4.5 Mb */ { AH_TRUE, HALF, 4500, 0x0f, 0x00, 9, 0 },
+/* 6 Mb */ { AH_TRUE, HALF, 6000, 0x0a, 0x00, (0x80|12), 2 },
+/* 9 Mb */ { AH_TRUE, HALF, 9000, 0x0e, 0x00, 18, 2 },
+/* 12 Mb */ { AH_TRUE, HALF, 12000, 0x09, 0x00, (0x80|24), 4 },
+/* 18 Mb */ { AH_TRUE, HALF, 18000, 0x0d, 0x00, 36, 4 },
+/* 24 Mb */ { AH_TRUE, HALF, 24000, 0x08, 0x00, 48, 4 },
+/* 27 Mb */ { AH_TRUE, HALF, 27000, 0x0c, 0x00, 54, 4 }
},
};
@@ -68,14 +70,14 @@ HAL_RATE_TABLE ar5212_quarter_table = {
{
/* short ctrl */
/* valid rateCode Preamble dot11Rate Rate */
-/* 6 Mb */ { AH_TRUE, OFDM, 1500, 0x0b, 0x00, (0x80|3), 0 },
-/* 9 Mb */ { AH_TRUE, OFDM, 2250, 0x0f, 0x00, 4, 0 },
-/* 12 Mb */ { AH_TRUE, OFDM, 3000, 0x0a, 0x00, (0x80|6), 2 },
-/* 18 Mb */ { AH_TRUE, OFDM, 4500, 0x0e, 0x00, 9, 2 },
-/* 24 Mb */ { AH_TRUE, OFDM, 6000, 0x09, 0x00, (0x80|12), 4 },
-/* 36 Mb */ { AH_TRUE, OFDM, 9000, 0x0d, 0x00, 18, 4 },
-/* 48 Mb */ { AH_TRUE, OFDM, 12000, 0x08, 0x00, 24, 4 },
-/* 54 Mb */ { AH_TRUE, OFDM, 13500, 0x0c, 0x00, 27, 4 }
+/* 1.5 Mb */ { AH_TRUE, QUART, 1500, 0x0b, 0x00, (0x80|3), 0 },
+/* 2 Mb */ { AH_TRUE, QUART, 2250, 0x0f, 0x00, 4, 0 },
+/* 3 Mb */ { AH_TRUE, QUART, 3000, 0x0a, 0x00, (0x80|6), 2 },
+/* 4.5 Mb */ { AH_TRUE, QUART, 4500, 0x0e, 0x00, 9, 2 },
+/* 6 Mb */ { AH_TRUE, QUART, 6000, 0x09, 0x00, (0x80|12), 4 },
+/* 9 Mb */ { AH_TRUE, QUART, 9000, 0x0d, 0x00, 18, 4 },
+/* 12 Mb */ { AH_TRUE, QUART, 12000, 0x08, 0x00, 24, 4 },
+/*13.5 Mb */ { AH_TRUE, QUART, 13500, 0x0c, 0x00, 27, 4 }
},
};
More information about the svn-src-projects
mailing list