/* * Copyright (c) 2010 Broadcom Corporation * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
struct brcms_mcs_info { /* phy rate in kbps [20Mhz] */
u32 phy_rate_20; /* phy rate in kbps [40Mhz] */
u32 phy_rate_40; /* phy rate in kbps [20Mhz] with SGI */
u32 phy_rate_20_sgi; /* phy rate in kbps [40Mhz] with SGI */
u32 phy_rate_40_sgi; /* phy ctl byte 3, code rate, modulation type, # of streams */
u8 tx_phy_ctl3; /* matching legacy ofdm rate in 500bkps */
u8 leg_ofdm;
};
#define BRCMS_MAXMCS 32 /* max valid mcs index */ #define MCS_TABLE_SIZE 33 /* Number of mcs entries in the table */ externconststruct brcms_mcs_info mcs_table[];
#define MCS_TXS_MASK 0xc0 /* num tx streams - 1 bit mask */ #define MCS_TXS_SHIFT 6 /* num tx streams - 1 bit shift */
staticinline uint mcs_2_rate(u8 mcs, bool is40, bool sgi)
{ if (sgi) { if (is40) return mcs_table[mcs].phy_rate_40_sgi; return mcs_table[mcs].phy_rate_20_sgi;
} if (is40) return mcs_table[mcs].phy_rate_40;
return mcs_table[mcs].phy_rate_20;
}
/* Macro to use the rate_info table */ #define BRCMS_RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag */
/* * rate spec : holds rate and mode specific information required to generate a * tx frame. Legacy CCK and OFDM information is held in the same manner as was * done in the past (in the lower byte) the upper 3 bytes primarily hold MIMO * specific information
*/
/* rate spec bit fields */
/* Either 500Kbps units or MIMO MCS idx */ #define RSPEC_RATE_MASK 0x0000007F /* mimo MCS is stored in RSPEC_RATE_MASK */ #define RSPEC_MIMORATE 0x08000000 /* mimo bw mask */ #define RSPEC_BW_MASK 0x00000700 /* mimo bw shift */ #define RSPEC_BW_SHIFT 8 /* mimo Space/Time/Frequency mode mask */ #define RSPEC_STF_MASK 0x00003800 /* mimo Space/Time/Frequency mode shift */ #define RSPEC_STF_SHIFT 11 /* mimo coding type mask */ #define RSPEC_CT_MASK 0x0000C000 /* mimo coding type shift */ #define RSPEC_CT_SHIFT 14 /* mimo num STC streams per PLCP defn. */ #define RSPEC_STC_MASK 0x00300000 /* mimo num STC streams per PLCP defn. */ #define RSPEC_STC_SHIFT 20 /* mimo bit indicates adv coding in use */ #define RSPEC_LDPC_CODING 0x00400000 /* mimo bit indicates short GI in use */ #define RSPEC_SHORT_GI 0x00800000 /* bit indicates override both rate & mode */ #define RSPEC_OVERRIDE 0x80000000 /* bit indicates override rate only */ #define RSPEC_OVERRIDE_MCS_ONLY 0x40000000
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.