Skip to contentSkip to conversation

query in ath9k

ath9k-devel selvam 3 participants 6 messages Mar 29, 2010 – Mar 30, 2010

lore
Share & tools
lore

selvam

author
#0 lore raw

Hi all,
I have some queries in ath9k.

In xmit.c, the variable 'bits_per_symbol' is used to store the number of bits per OFDM symbol for various data rates.

static u32 bits_per_symbol[][2] = {
        /* 20MHz 40MHz */
        {    26,   54 },     /*  0: BPSK */
        {    52,  108 },     /*  1: QPSK 1/2 */
        {    78,  162 },     /*  2: QPSK 3/4 */
        {   104,  216 },     /*  3: 16-QAM 1/2 */
        {   156,  324 },     /*  4: 16-QAM 3/4 */
        {   208,  432 },     /*  5: 64-QAM 2/3 */
        {   234,  486 },     /*  6: 64-QAM 3/4 */
        {   260,  540 },     /*  7: 64-QAM 5/6 */
        {    52,  108 },     /*  8: BPSK */
        {   104,  216 },     /*  9: QPSK 1/2 */
        {   156,  324 },     /* 10: QPSK 3/4 */
        {   208,  432 },     /* 11: 16-QAM 1/2 */
        {   312,  648 },     /* 12: 16-QAM 3/4 */
        {   416,  864 },     /* 13: 64-QAM 2/3 */
        {   468,  972 },     /* 14: 64-QAM 3/4 */
        {   520, 1080 },     /* 15: 64-QAM 5/6 */

1) Is it possible to keep only the values of MCS 0 to MCS 7 and calculate the rest on run time. so that we can save some amount of memory.

For example, if MCS index is 8, then multiply the MCS 0 by 2, for MCS 9 mutiply MCS 1 by 2..

Can we use in that way?. Is there any performance tradeoff in terms of faster execution due to comparison?

2) Why don't we use static u16 instead of static u32 to declare this variable? Is there any specific reason for using as u32?

If my approach is improper, please excuse me.

Regards,

Signature · 4 lines
Selvam.T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20100329/07a9bb90/attachment.htm 
#1 lore raw
Quoted 27 lines · selvam

Hi all,
I have some queries in ath9k.

In xmit.c, the variable 'bits_per_symbol' is used to store the number of bits per OFDM symbol for various data rates.

static u32 bits_per_symbol[][2] = {
        /* 20MHz 40MHz */
        {    26,   54 },     /*  0: BPSK */
        {    52,  108 },     /*  1: QPSK 1/2 */
        {    78,  162 },     /*  2: QPSK 3/4 */
        {   104,  216 },     /*  3: 16-QAM 1/2 */
        {   156,  324 },     /*  4: 16-QAM 3/4 */
        {   208,  432 },     /*  5: 64-QAM 2/3 */
        {   234,  486 },     /*  6: 64-QAM 3/4 */
        {   260,  540 },     /*  7: 64-QAM 5/6 */
        {    52,  108 },     /*  8: BPSK */
        {   104,  216 },     /*  9: QPSK 1/2 */
        {   156,  324 },     /* 10: QPSK 3/4 */
        {   208,  432 },     /* 11: 16-QAM 1/2 */
        {   312,  648 },     /* 12: 16-QAM 3/4 */
        {   416,  864 },     /* 13: 64-QAM 2/3 */
        {   468,  972 },     /* 14: 64-QAM 3/4 */
        {   520, 1080 },     /* 15: 64-QAM 5/6 */

1) Is it possible to keep only the values of MCS 0 to MCS 7 and calculate the rest on run time. so that we can save some amount of memory.

Quoted 8 lines

For example, if MCS index is 8, then multiply the MCS 0 by 2, for MCS 9 mutiply MCS 1 by 2..

Can we use in that way?. Is there any performance tradeoff in terms of faster execution due to comparison?

2) Why don't we use static u16 instead of static u32 to declare this variable? Is there any specific reason for using as u32?

If my approach is improper, please excuse me.

Try the patch and send it once tested and proved to work :)

Luis

#2 lore raw
Quoted 37 lines · Luis R. Rodriguez
Quoted 27 lines · selvam

Hi all,
I have some queries in ath9k.

In xmit.c, the variable 'bits_per_symbol' is used to store the number of bits per OFDM symbol for various data rates.

static u32 bits_per_symbol[][2] = {
? ? ? ? /* 20MHz 40MHz */
? ? ? ? { ? ?26, ? 54 }, ? ? /* ?0: BPSK */
? ? ? ? { ? ?52, ?108 }, ? ? /* ?1: QPSK 1/2 */
? ? ? ? { ? ?78, ?162 }, ? ? /* ?2: QPSK 3/4 */
? ? ? ? { ? 104, ?216 }, ? ? /* ?3: 16-QAM 1/2 */
? ? ? ? { ? 156, ?324 }, ? ? /* ?4: 16-QAM 3/4 */
? ? ? ? { ? 208, ?432 }, ? ? /* ?5: 64-QAM 2/3 */
? ? ? ? { ? 234, ?486 }, ? ? /* ?6: 64-QAM 3/4 */
? ? ? ? { ? 260, ?540 }, ? ? /* ?7: 64-QAM 5/6 */
? ? ? ? { ? ?52, ?108 }, ? ? /* ?8: BPSK */
? ? ? ? { ? 104, ?216 }, ? ? /* ?9: QPSK 1/2 */
? ? ? ? { ? 156, ?324 }, ? ? /* 10: QPSK 3/4 */
? ? ? ? { ? 208, ?432 }, ? ? /* 11: 16-QAM 1/2 */
? ? ? ? { ? 312, ?648 }, ? ? /* 12: 16-QAM 3/4 */
? ? ? ? { ? 416, ?864 }, ? ? /* 13: 64-QAM 2/3 */
? ? ? ? { ? 468, ?972 }, ? ? /* 14: 64-QAM 3/4 */
? ? ? ? { ? 520, 1080 }, ? ? /* 15: 64-QAM 5/6 */

1) Is it possible to keep only the values of MCS 0 to MCS 7 and calculate the rest on run time. so that we can save some amount of memory.

Quoted 8 lines

For example, if MCS index is 8, then multiply the MCS 0 by 2, for MCS 9 mutiply MCS 1 by 2..

Can we use in that way?. Is there any performance tradeoff in terms of faster execution due to comparison?

2) Why don't we use static u16 instead of static u32 to declare this variable? Is there any specific reason for using as u32?

If my approach is improper, please excuse me.

Quoted 8 lines

Try the patch and send it once tested and proved to work :)

?Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

The following patch works for me:
Index: linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c
===================================================================
--- linux-2.6.33.1.orig/drivers/net/wireless/ath/ath9k/xmit.c 2010-03-30
01:24:25.906770962 +0200
+++ linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c 2010-03-30
01:29:11.602996328 +0200
@@ -33,7 +33,7 @@

#define OFDM_SIFS_TIME 16

-static u32 bits_per_symbol[][2] = {
+static u16 bits_per_symbol[][2] = {
/* 20MHz 40MHz */

 	{    26,   54 },     /*  0: BPSK */
 	{    52,  108 },     /*  1: QPSK 1/2 */
@@ -43,14 +43,6 @@
 	{   208,  432 },     /*  5: 64-QAM 2/3 */
 	{   234,  486 },     /*  6: 64-QAM 3/4 */
 	{   260,  540 },     /*  7: 64-QAM 5/6 */
-	{    52,  108 },     /*  8: BPSK */
-	{   104,  216 },     /*  9: QPSK 1/2 */
-	{   156,  324 },     /* 10: QPSK 3/4 */
-	{   208,  432 },     /* 11: 16-QAM 1/2 */
-	{   312,  648 },     /* 12: 16-QAM 3/4 */
-	{   416,  864 },     /* 13: 64-QAM 2/3 */
-	{   468,  972 },     /* 14: 64-QAM 3/4 */
-	{   520, 1080 },     /* 15: 64-QAM 5/6 */

};

#define IS_HT_RATE(_rate) ((_rate) & 0x80)
@@ -598,7 +590,7 @@
if (nsymbols == 0)
nsymbols = 1;

- nsymbits = bits_per_symbol[rix][width];
+ nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);
minlen = (nsymbols * nsymbits) / BITS_PER_BYTE;

if (frmlen < minlen) {
@@ -1452,7 +1444,7 @@

/* find number of symbols: PLCP + data */ nbits = (pktlen << 3) + OFDM_PLCP_BITS;
- nsymbits = bits_per_symbol[rix][width];
+ nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);
nsymbols = (nbits + nsymbits - 1) / nsymbits;

if (!half_gi)

Signature · 12 lines
Matteo Croce
OpenWrt Developer
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge) ------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
#3 lore raw
Quoted 89 lines · On Mon, Mar 29, 2010 at 04:32:25PM -0700, rootkit85 at yahoo.it wrote:
Quoted 37 lines · Luis R. Rodriguez
Quoted 27 lines · selvam

Hi all,
I have some queries in ath9k.

In xmit.c, the variable 'bits_per_symbol' is used to store the number of bits per OFDM symbol for various data rates.

static u32 bits_per_symbol[][2] = {
? ? ? ? /* 20MHz 40MHz */
? ? ? ? { ? ?26, ? 54 }, ? ? /* ?0: BPSK */
? ? ? ? { ? ?52, ?108 }, ? ? /* ?1: QPSK 1/2 */
? ? ? ? { ? ?78, ?162 }, ? ? /* ?2: QPSK 3/4 */
? ? ? ? { ? 104, ?216 }, ? ? /* ?3: 16-QAM 1/2 */
? ? ? ? { ? 156, ?324 }, ? ? /* ?4: 16-QAM 3/4 */
? ? ? ? { ? 208, ?432 }, ? ? /* ?5: 64-QAM 2/3 */
? ? ? ? { ? 234, ?486 }, ? ? /* ?6: 64-QAM 3/4 */
? ? ? ? { ? 260, ?540 }, ? ? /* ?7: 64-QAM 5/6 */
? ? ? ? { ? ?52, ?108 }, ? ? /* ?8: BPSK */
? ? ? ? { ? 104, ?216 }, ? ? /* ?9: QPSK 1/2 */
? ? ? ? { ? 156, ?324 }, ? ? /* 10: QPSK 3/4 */
? ? ? ? { ? 208, ?432 }, ? ? /* 11: 16-QAM 1/2 */
? ? ? ? { ? 312, ?648 }, ? ? /* 12: 16-QAM 3/4 */
? ? ? ? { ? 416, ?864 }, ? ? /* 13: 64-QAM 2/3 */
? ? ? ? { ? 468, ?972 }, ? ? /* 14: 64-QAM 3/4 */
? ? ? ? { ? 520, 1080 }, ? ? /* 15: 64-QAM 5/6 */

1) Is it possible to keep only the values of MCS 0 to MCS 7 and calculate the rest on run time. so that we can save some amount of memory.

Quoted 8 lines

For example, if MCS index is 8, then multiply the MCS 0 by 2, for MCS 9 mutiply MCS 1 by 2..

Can we use in that way?. Is there any performance tradeoff in terms of faster execution due to comparison?

2) Why don't we use static u16 instead of static u32 to declare this variable? Is there any specific reason for using as u32?

If my approach is improper, please excuse me.

Quoted 8 lines

Try the patch and send it once tested and proved to work :)

?Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

The following patch works for me:
Index: linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c
===================================================================
--- linux-2.6.33.1.orig/drivers/net/wireless/ath/ath9k/xmit.c 2010-03-30
01:24:25.906770962 +0200
+++ linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c 2010-03-30
01:29:11.602996328 +0200

(quoted diff) +2 -10
@@ -33,7 +33,7 @@
 
 #define OFDM_SIFS_TIME    	    16
 
-static u32 bits_per_symbol[][2] = {
+static u16 bits_per_symbol[][2] = {
 	/* 20MHz 40MHz */
 	{    26,   54 },     /*  0: BPSK */
 	{    52,  108 },     /*  1: QPSK 1/2 */
@@ -43,14 +43,6 @@
 	{   208,  432 },     /*  5: 64-QAM 2/3 */
 	{   234,  486 },     /*  6: 64-QAM 3/4 */
 	{   260,  540 },     /*  7: 64-QAM 5/6 */
-	{    52,  108 },     /*  8: BPSK */
-	{   104,  216 },     /*  9: QPSK 1/2 */
-	{   156,  324 },     /* 10: QPSK 3/4 */
-	{   208,  432 },     /* 11: 16-QAM 1/2 */
-	{   312,  648 },     /* 12: 16-QAM 3/4 */
-	{   416,  864 },     /* 13: 64-QAM 2/3 */
-	{   468,  972 },     /* 14: 64-QAM 3/4 */
-	{   520, 1080 },     /* 15: 64-QAM 5/6 */
 };
 
 #define IS_HT_RATE(_rate)     ((_rate) & 0x80)
@@ -598,7 +590,7 @@
 	if (nsymbols == 0)
 		nsymbols = 1;
 
-	nsymbits = bits_per_symbol[rix][width];
+	nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);
 	minlen = (nsymbols * nsymbits) / BITS_PER_BYTE;
 
 	if (frmlen < minlen) {

Review line 1448

Quoted 6 lines
(quoted diff) +1 -1
@@ -1452,7 +1444,7 @@
 
 	/* find number of symbols: PLCP + data */
 	nbits = (pktlen << 3) + OFDM_PLCP_BITS;
-	nsymbits = bits_per_symbol[rix][width];
+	nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);
 	nsymbols = (nbits + nsymbits - 1) / nsymbits;

What's the ko file size differene?

Luis

#4 lore raw
Quoted 99 lines · Luis R. Rodriguez
Quoted 90 lines · On Mon, Mar 29, 2010 at 04:32:25PM -0700, rootkit85 at yahoo.it wrote:
Quoted 37 lines · Luis R. Rodriguez
Quoted 27 lines · selvam

Hi all,
I have some queries in ath9k.

In xmit.c, the variable 'bits_per_symbol' is used to store the number of bits per OFDM symbol for various data rates.

static u32 bits_per_symbol[][2] = {
? ? ? ? /* 20MHz 40MHz */
? ? ? ? { ? ?26, ? 54 }, ? ? /* ?0: BPSK */
? ? ? ? { ? ?52, ?108 }, ? ? /* ?1: QPSK 1/2 */
? ? ? ? { ? ?78, ?162 }, ? ? /* ?2: QPSK 3/4 */
? ? ? ? { ? 104, ?216 }, ? ? /* ?3: 16-QAM 1/2 */
? ? ? ? { ? 156, ?324 }, ? ? /* ?4: 16-QAM 3/4 */
? ? ? ? { ? 208, ?432 }, ? ? /* ?5: 64-QAM 2/3 */
? ? ? ? { ? 234, ?486 }, ? ? /* ?6: 64-QAM 3/4 */
? ? ? ? { ? 260, ?540 }, ? ? /* ?7: 64-QAM 5/6 */
? ? ? ? { ? ?52, ?108 }, ? ? /* ?8: BPSK */
? ? ? ? { ? 104, ?216 }, ? ? /* ?9: QPSK 1/2 */
? ? ? ? { ? 156, ?324 }, ? ? /* 10: QPSK 3/4 */
? ? ? ? { ? 208, ?432 }, ? ? /* 11: 16-QAM 1/2 */
? ? ? ? { ? 312, ?648 }, ? ? /* 12: 16-QAM 3/4 */
? ? ? ? { ? 416, ?864 }, ? ? /* 13: 64-QAM 2/3 */
? ? ? ? { ? 468, ?972 }, ? ? /* 14: 64-QAM 3/4 */
? ? ? ? { ? 520, 1080 }, ? ? /* 15: 64-QAM 5/6 */

1) Is it possible to keep only the values of MCS 0 to MCS 7 and calculate the rest on run time. so that we can save some amount of memory.

Quoted 8 lines

For example, if MCS index is 8, then multiply the MCS 0 by 2, for MCS 9 mutiply MCS 1 by 2..

Can we use in that way?. Is there any performance tradeoff in terms of faster execution due to comparison?

2) Why don't we use static u16 instead of static u32 to declare this variable? Is there any specific reason for using as u32?

If my approach is improper, please excuse me.

Quoted 8 lines

Try the patch and send it once tested and proved to work :)

?Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

The following patch works for me:
Index: linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c
===================================================================
--- linux-2.6.33.1.orig/drivers/net/wireless/ath/ath9k/xmit.c 2010-03-30 01:24:25.906770962 +0200
+++ linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c ? ? ?2010-03-30 01:29:11.602996328 +0200

(quoted diff) +0 -0
@@ -33,7 +33,7 @@
 

?#define OFDM_SIFS_TIME ? ? ? ? ? 16

(quoted diff) +1 -1
-static u32 bits_per_symbol[][2] = {
+static u16 bits_per_symbol[][2] = {

? ? ? /* 20MHz 40MHz */
? ? ? { ? ?26, ? 54 }, ? ? /* ?0: BPSK */
? ? ? { ? ?52, ?108 }, ? ? /* ?1: QPSK 1/2 */

(quoted diff) +0 -0
@@ -43,14 +43,6 @@

? ? ? { ? 208, ?432 }, ? ? /* ?5: 64-QAM 2/3 */
? ? ? { ? 234, ?486 }, ? ? /* ?6: 64-QAM 3/4 */
? ? ? { ? 260, ?540 }, ? ? /* ?7: 64-QAM 5/6 */
- ? ? { ? ?52, ?108 }, ? ? /* ?8: BPSK */
- ? ? { ? 104, ?216 }, ? ? /* ?9: QPSK 1/2 */
- ? ? { ? 156, ?324 }, ? ? /* 10: QPSK 3/4 */
- ? ? { ? 208, ?432 }, ? ? /* 11: 16-QAM 1/2 */
- ? ? { ? 312, ?648 }, ? ? /* 12: 16-QAM 3/4 */
- ? ? { ? 416, ?864 }, ? ? /* 13: 64-QAM 2/3 */
- ? ? { ? 468, ?972 }, ? ? /* 14: 64-QAM 3/4 */
- ? ? { ? 520, 1080 }, ? ? /* 15: 64-QAM 5/6 */
?};

?#define IS_HT_RATE(_rate) ? ? ((_rate) & 0x80)

(quoted diff) +1 -1
@@ -598,7 +590,7 @@
 ? ? ? if (nsymbols == 0)
 ? ? ? ? ? ? ? nsymbols = 1;
 
- ? ? nsymbits = bits_per_symbol[rix][width];
+ ? ? nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);
 ? ? ? minlen = (nsymbols * nsymbits) / BITS_PER_BYTE;
 
 ? ? ? if (frmlen < minlen) {
@@ -1452,7 +1444,7 @@
 
Quoted 5 lines

? ? ? /* find number of symbols: PLCP + data */
? ? ? nbits = (pktlen << 3) + OFDM_PLCP_BITS;
- ? ? nsymbits = bits_per_symbol[rix][width];
+ ? ? nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1); ? ? ? nsymbols = (nbits + nsymbits - 1) / nsymbits;

What's the ko file size differene?

Quoted 2 lines

?Luis

Slighty smaller:

Original:
-rw-r--r-- 1 root root 122968 2010-03-30 01:59
drivers/net/wireless/ath/ath9k/ath9k.ko
Patched
-rw-r--r-- 1 root root 122936 2010-03-30 01:59
drivers/net/wireless/ath/ath9k/ath9k.ko

Signature · 12 lines
Matteo Croce
OpenWrt developer
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge) ------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
author
#5 lore raw
Quoted 130 lines · On Tue, Mar 30, 2010 at 5:31 AM, <[email protected]> wrote:
Quoted 8 lines · Luis R. Rodriguez
Quoted 7 lines · On Mon, Mar 29, 2010 at 04:32:25PM -0700, rootkit85 at yahoo.it wrote:
Quoted 5 lines · Luis R. Rodriguez
Quoted 4 lines · selvam

Hi all,
I have some queries in ath9k.

In xmit.c, the variable 'bits_per_symbol' is used to store the number

of bits per OFDM symbol for various data rates.

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
static u32 bits_per_symbol[][2] = {
        /* 20MHz 40MHz */
        {    26,   54 },     /*  0: BPSK */
        {    52,  108 },     /*  1: QPSK 1/2 */
        {    78,  162 },     /*  2: QPSK 3/4 */
        {   104,  216 },     /*  3: 16-QAM 1/2 */
        {   156,  324 },     /*  4: 16-QAM 3/4 */
        {   208,  432 },     /*  5: 64-QAM 2/3 */
        {   234,  486 },     /*  6: 64-QAM 3/4 */
        {   260,  540 },     /*  7: 64-QAM 5/6 */
        {    52,  108 },     /*  8: BPSK */
        {   104,  216 },     /*  9: QPSK 1/2 */
        {   156,  324 },     /* 10: QPSK 3/4 */
        {   208,  432 },     /* 11: 16-QAM 1/2 */
        {   312,  648 },     /* 12: 16-QAM 3/4 */
        {   416,  864 },     /* 13: 64-QAM 2/3 */
        {   468,  972 },     /* 14: 64-QAM 3/4 */
        {   520, 1080 },     /* 15: 64-QAM 5/6 */
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

1) Is it possible to keep only the values of MCS 0 to MCS 7 and

calculate the rest on run time. so that we can save some amount of memory.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

For example, if MCS index is 8, then multiply the MCS 0 by 2, for MCS

9 mutiply MCS 1 by 2..

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Can we use in that way?. Is there any performance tradeoff in terms

of faster execution due to comparison?

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

2) Why don't we use static u16 instead of static u32 to declare this

variable? Is there any specific reason for using as u32?

Quoted 62 lines
Quoted 53 lines
Quoted 11 lines
Quoted 2 lines

If my approach is improper, please excuse me.

Try the patch and send it once tested and proved to work :)

Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

The following patch works for me:
Index: linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c
===================================================================
--- linux-2.6.33.1.orig/drivers/net/wireless/ath/ath9k/xmit.c 2010-03-30 01:24:25.906770962 +0200
+++ linux-2.6.33.1/drivers/net/wireless/ath/ath9k/xmit.c 2010-03-30
01:29:11.602996328 +0200

(quoted diff) +2 -10
@@ -33,7 +33,7 @@
 
 #define OFDM_SIFS_TIME           16
 
-static u32 bits_per_symbol[][2] = {
+static u16 bits_per_symbol[][2] = {
      /* 20MHz 40MHz */
      {    26,   54 },     /*  0: BPSK */
      {    52,  108 },     /*  1: QPSK 1/2 */
@@ -43,14 +43,6 @@
      {   208,  432 },     /*  5: 64-QAM 2/3 */
      {   234,  486 },     /*  6: 64-QAM 3/4 */
      {   260,  540 },     /*  7: 64-QAM 5/6 */
-     {    52,  108 },     /*  8: BPSK */
-     {   104,  216 },     /*  9: QPSK 1/2 */
-     {   156,  324 },     /* 10: QPSK 3/4 */
-     {   208,  432 },     /* 11: 16-QAM 1/2 */
-     {   312,  648 },     /* 12: 16-QAM 3/4 */
-     {   416,  864 },     /* 13: 64-QAM 2/3 */
-     {   468,  972 },     /* 14: 64-QAM 3/4 */
-     {   520, 1080 },     /* 15: 64-QAM 5/6 */
 };
 
 #define IS_HT_RATE(_rate)     ((_rate) & 0x80)
@@ -598,7 +590,7 @@
      if (nsymbols == 0)
              nsymbols = 1;
 
-     nsymbits = bits_per_symbol[rix][width];
+     nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);
      minlen = (nsymbols * nsymbits) / BITS_PER_BYTE;
 
      if (frmlen < minlen) {

Review line 1448

Quoted 6 lines
(quoted diff) +1 -1
@@ -1452,7 +1444,7 @@
 
      /* find number of symbols: PLCP + data */
      nbits = (pktlen << 3) + OFDM_PLCP_BITS;
-     nsymbits = bits_per_symbol[rix][width];
+     nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);
      nsymbols = (nbits + nsymbits - 1) / nsymbits;

What's the ko file size differene?

Quoted 2 lines

Luis

Slighty smaller:

Original:
-rw-r--r-- 1 root root 122968 2010-03-30 01:59
drivers/net/wireless/ath/ath9k/ath9k.ko
Patched
-rw-r--r-- 1 root root 122936 2010-03-30 01:59
drivers/net/wireless/ath/ath9k/ath9k.ko

--
Matteo Croce
OpenWrt developer

 _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
         |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge) ------------------
 * 10 oz Vodka       Shake well with ice and strain
 * 10 oz Triple sec  mixture into 10 shot glasses.
 * 10 oz lime juice  Salute!
Quoted 2 lines

---------------------------------------------------

A typo in the code.

nsymbits = bits_per_symbol[rix & 3][width] * ((rix >> 3) + 1);

should be changed to
nsymbits = bits_per_symbol[rix & 7][width] * ((rix >> 3) + 1);

It saves 32 bytes. Is it worth to create a patch?

Please comment on this...

Regards,

Signature · 4 lines
Selvam.T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20100330/c5ecb195/attachment-0001.htm