ath9k: fix invalid max frame length
authorSylvain Roger Rieunier <sylvain.roger.rieunier@gmail.com>
Thu, 27 Feb 2014 13:36:06 +0000 (14:36 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 3 Mar 2014 20:35:55 +0000 (15:35 -0500)
According to 802.11n-2012 standard in paragraph PPDU Fromat(20.3.2) HT-mixed
format  Hearder PPDU contains : L_STF, L_LTF, L_SIG, HT_SIG, HT_STF, HT_LTF
they are symbols in the preamble, there are in time unit(us) that's for why
it can't be computed in bytes

Signed-off-by: Sylvain ROGER RIEUNIER <sylvain.roger.rieunier@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/xmit.c

index 8f28711cfd4e05b558624427da73505b3ba12a94..306ea322c65d84983477031f97e83a248468afa1 100644 (file)
@@ -1040,11 +1040,11 @@ static int ath_max_framelen(int usec, int mcs, bool ht40, bool sgi)
        int symbols, bits;
        int bytes = 0;
 
+       usec -= L_STF + L_LTF + L_SIG + HT_SIG + HT_STF + HT_LTF(streams);
        symbols = sgi ? TIME_SYMBOLS_HALFGI(usec) : TIME_SYMBOLS(usec);
        bits = symbols * bits_per_symbol[mcs % 8][ht40] * streams;
        bits -= OFDM_PLCP_BITS;
        bytes = bits / 8;
-       bytes -= L_STF + L_LTF + L_SIG + HT_SIG + HT_STF + HT_LTF(streams);
        if (bytes > 65532)
                bytes = 65532;