1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-11 09:50:12 +00:00

use c99 initializers

This commit is contained in:
Sam Leffler 2009-02-19 04:52:03 +00:00
parent 047db6b311
commit be0df3e7c0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=188780
2 changed files with 112 additions and 112 deletions

View File

@ -1758,17 +1758,17 @@ static struct ieee80211_channel *
findchannel(struct ieee80211com *ic, int ieee, int mode)
{
static const u_int chanflags[IEEE80211_MODE_MAX] = {
0, /* IEEE80211_MODE_AUTO */
IEEE80211_CHAN_A, /* IEEE80211_MODE_11A */
IEEE80211_CHAN_B, /* IEEE80211_MODE_11B */
IEEE80211_CHAN_G, /* IEEE80211_MODE_11G */
IEEE80211_CHAN_FHSS, /* IEEE80211_MODE_FH */
IEEE80211_CHAN_108A, /* IEEE80211_MODE_TURBO_A */
IEEE80211_CHAN_108G, /* IEEE80211_MODE_TURBO_G */
IEEE80211_CHAN_STURBO, /* IEEE80211_MODE_STURBO_A */
/* NB: handled specially below */
IEEE80211_CHAN_A, /* IEEE80211_MODE_11NA */
IEEE80211_CHAN_G, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = 0,
[IEEE80211_MODE_11A] = IEEE80211_CHAN_A,
[IEEE80211_MODE_11B] = IEEE80211_CHAN_B,
[IEEE80211_MODE_11G] = IEEE80211_CHAN_G,
[IEEE80211_MODE_FH] = IEEE80211_CHAN_FHSS,
[IEEE80211_MODE_TURBO_A] = IEEE80211_CHAN_108A,
[IEEE80211_MODE_TURBO_G] = IEEE80211_CHAN_108G,
[IEEE80211_MODE_STURBO_A] = IEEE80211_CHAN_STURBO,
/* NB: handled specially below */
[IEEE80211_MODE_11NA] = IEEE80211_CHAN_A,
[IEEE80211_MODE_11NG] = IEEE80211_CHAN_G,
};
u_int modeflags;
int i;

View File

@ -655,16 +655,16 @@ setbasicrates(struct ieee80211_rateset *rs,
enum ieee80211_phymode mode, int add)
{
static const struct ieee80211_rateset basic[IEEE80211_MODE_MAX] = {
{ .rs_nrates = 0 }, /* IEEE80211_MODE_AUTO */
{ 3, { 12, 24, 48 } }, /* IEEE80211_MODE_11A */
{ 2, { 2, 4 } }, /* IEEE80211_MODE_11B */
{ 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_11G (mixed b/g) */
{ .rs_nrates = 0 }, /* IEEE80211_MODE_FH */
{ 3, { 12, 24, 48 } }, /* IEEE80211_MODE_TURBO_A */
{ 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_TURBO_G (mixed b/g) */
{ 3, { 12, 24, 48 } }, /* IEEE80211_MODE_STURBO_A */
{ 3, { 12, 24, 48 } }, /* IEEE80211_MODE_11NA */
{ 4, { 2, 4, 11, 22 } }, /* IEEE80211_MODE_11NG (mixed b/g) */
[IEEE80211_MODE_11A] = { 3, { 12, 24, 48 } },
[IEEE80211_MODE_11B] = { 2, { 2, 4 } },
/* NB: mixed b/g */
[IEEE80211_MODE_11G] = { 4, { 2, 4, 11, 22 } },
[IEEE80211_MODE_TURBO_A] = { 3, { 12, 24, 48 } },
[IEEE80211_MODE_TURBO_G] = { 4, { 2, 4, 11, 22 } },
[IEEE80211_MODE_STURBO_A] = { 3, { 12, 24, 48 } },
[IEEE80211_MODE_11NA] = { 3, { 12, 24, 48 } },
/* NB: mixed b/g */
[IEEE80211_MODE_11NG] = { 4, { 2, 4, 11, 22 } },
};
int i, j;
@ -717,89 +717,89 @@ typedef struct phyParamType {
} paramType;
static const struct phyParamType phyParamForAC_BE[IEEE80211_MODE_MAX] = {
{ 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_AUTO */
{ 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11A */
{ 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11B */
{ 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11G */
{ 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_FH */
{ 2, 3, 5, 0, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 2, 3, 5, 0, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 2, 3, 5, 0, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11NA */
{ 3, 4, 6, 0, 0 }, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = { 3, 4, 6, 0, 0 },
[IEEE80211_MODE_11A] = { 3, 4, 6, 0, 0 },
[IEEE80211_MODE_11B] = { 3, 4, 6, 0, 0 },
[IEEE80211_MODE_11G] = { 3, 4, 6, 0, 0 },
[IEEE80211_MODE_FH] = { 3, 4, 6, 0, 0 },
[IEEE80211_MODE_TURBO_A]= { 2, 3, 5, 0, 0 },
[IEEE80211_MODE_TURBO_G]= { 2, 3, 5, 0, 0 },
[IEEE80211_MODE_STURBO_A]={ 2, 3, 5, 0, 0 },
[IEEE80211_MODE_11NA] = { 3, 4, 6, 0, 0 },
[IEEE80211_MODE_11NG] = { 3, 4, 6, 0, 0 },
};
static const struct phyParamType phyParamForAC_BK[IEEE80211_MODE_MAX] = {
{ 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_AUTO */
{ 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11A */
{ 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11B */
{ 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11G */
{ 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_FH */
{ 7, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 7, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 7, 3, 10, 0, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NA */
{ 7, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = { 7, 4, 10, 0, 0 },
[IEEE80211_MODE_11A] = { 7, 4, 10, 0, 0 },
[IEEE80211_MODE_11B] = { 7, 4, 10, 0, 0 },
[IEEE80211_MODE_11G] = { 7, 4, 10, 0, 0 },
[IEEE80211_MODE_FH] = { 7, 4, 10, 0, 0 },
[IEEE80211_MODE_TURBO_A]= { 7, 3, 10, 0, 0 },
[IEEE80211_MODE_TURBO_G]= { 7, 3, 10, 0, 0 },
[IEEE80211_MODE_STURBO_A]={ 7, 3, 10, 0, 0 },
[IEEE80211_MODE_11NA] = { 7, 4, 10, 0, 0 },
[IEEE80211_MODE_11NG] = { 7, 4, 10, 0, 0 },
};
static const struct phyParamType phyParamForAC_VI[IEEE80211_MODE_MAX] = {
{ 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_AUTO */
{ 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11A */
{ 1, 3, 4, 188, 0 }, /* IEEE80211_MODE_11B */
{ 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11G */
{ 1, 3, 4, 188, 0 }, /* IEEE80211_MODE_FH */
{ 1, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 1, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 1, 2, 3, 94, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NA */
{ 1, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = { 1, 3, 4, 94, 0 },
[IEEE80211_MODE_11A] = { 1, 3, 4, 94, 0 },
[IEEE80211_MODE_11B] = { 1, 3, 4, 188, 0 },
[IEEE80211_MODE_11G] = { 1, 3, 4, 94, 0 },
[IEEE80211_MODE_FH] = { 1, 3, 4, 188, 0 },
[IEEE80211_MODE_TURBO_A]= { 1, 2, 3, 94, 0 },
[IEEE80211_MODE_TURBO_G]= { 1, 2, 3, 94, 0 },
[IEEE80211_MODE_STURBO_A]={ 1, 2, 3, 94, 0 },
[IEEE80211_MODE_11NA] = { 1, 3, 4, 94, 0 },
[IEEE80211_MODE_11NG] = { 1, 3, 4, 94, 0 },
};
static const struct phyParamType phyParamForAC_VO[IEEE80211_MODE_MAX] = {
{ 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_AUTO */
{ 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11A */
{ 1, 2, 3, 102, 0 }, /* IEEE80211_MODE_11B */
{ 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11G */
{ 1, 2, 3, 102, 0 }, /* IEEE80211_MODE_FH */
{ 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NA */
{ 1, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = { 1, 2, 3, 47, 0 },
[IEEE80211_MODE_11A] = { 1, 2, 3, 47, 0 },
[IEEE80211_MODE_11B] = { 1, 2, 3, 102, 0 },
[IEEE80211_MODE_11G] = { 1, 2, 3, 47, 0 },
[IEEE80211_MODE_FH] = { 1, 2, 3, 102, 0 },
[IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 },
[IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 },
[IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 },
[IEEE80211_MODE_11NA] = { 1, 2, 3, 47, 0 },
[IEEE80211_MODE_11NG] = { 1, 2, 3, 47, 0 },
};
static const struct phyParamType bssPhyParamForAC_BE[IEEE80211_MODE_MAX] = {
{ 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_AUTO */
{ 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11A */
{ 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11B */
{ 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11G */
{ 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_FH */
{ 2, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 2, 3, 10, 0, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 2, 3, 10, 0, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NA */
{ 3, 4, 10, 0, 0 }, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = { 3, 4, 10, 0, 0 },
[IEEE80211_MODE_11A] = { 3, 4, 10, 0, 0 },
[IEEE80211_MODE_11B] = { 3, 4, 10, 0, 0 },
[IEEE80211_MODE_11G] = { 3, 4, 10, 0, 0 },
[IEEE80211_MODE_FH] = { 3, 4, 10, 0, 0 },
[IEEE80211_MODE_TURBO_A]= { 2, 3, 10, 0, 0 },
[IEEE80211_MODE_TURBO_G]= { 2, 3, 10, 0, 0 },
[IEEE80211_MODE_STURBO_A]={ 2, 3, 10, 0, 0 },
[IEEE80211_MODE_11NA] = { 3, 4, 10, 0, 0 },
[IEEE80211_MODE_11NG] = { 3, 4, 10, 0, 0 },
};
static const struct phyParamType bssPhyParamForAC_VI[IEEE80211_MODE_MAX] = {
{ 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_AUTO */
{ 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11A */
{ 2, 3, 4, 188, 0 }, /* IEEE80211_MODE_11B */
{ 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11G */
{ 2, 3, 4, 188, 0 }, /* IEEE80211_MODE_FH */
{ 2, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 2, 2, 3, 94, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 2, 2, 3, 94, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NA */
{ 2, 3, 4, 94, 0 }, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = { 2, 3, 4, 94, 0 },
[IEEE80211_MODE_11A] = { 2, 3, 4, 94, 0 },
[IEEE80211_MODE_11B] = { 2, 3, 4, 188, 0 },
[IEEE80211_MODE_11G] = { 2, 3, 4, 94, 0 },
[IEEE80211_MODE_FH] = { 2, 3, 4, 188, 0 },
[IEEE80211_MODE_TURBO_A]= { 2, 2, 3, 94, 0 },
[IEEE80211_MODE_TURBO_G]= { 2, 2, 3, 94, 0 },
[IEEE80211_MODE_STURBO_A]={ 2, 2, 3, 94, 0 },
[IEEE80211_MODE_11NA] = { 2, 3, 4, 94, 0 },
[IEEE80211_MODE_11NG] = { 2, 3, 4, 94, 0 },
};
static const struct phyParamType bssPhyParamForAC_VO[IEEE80211_MODE_MAX] = {
{ 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_AUTO */
{ 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11A */
{ 2, 2, 3, 102, 0 }, /* IEEE80211_MODE_11B */
{ 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11G */
{ 2, 2, 3, 102, 0 }, /* IEEE80211_MODE_FH */
{ 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 1, 2, 2, 47, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NA */
{ 2, 2, 3, 47, 0 }, /* IEEE80211_MODE_11NG */
[IEEE80211_MODE_AUTO] = { 2, 2, 3, 47, 0 },
[IEEE80211_MODE_11A] = { 2, 2, 3, 47, 0 },
[IEEE80211_MODE_11B] = { 2, 2, 3, 102, 0 },
[IEEE80211_MODE_11G] = { 2, 2, 3, 47, 0 },
[IEEE80211_MODE_FH] = { 2, 2, 3, 102, 0 },
[IEEE80211_MODE_TURBO_A]= { 1, 2, 2, 47, 0 },
[IEEE80211_MODE_TURBO_G]= { 1, 2, 2, 47, 0 },
[IEEE80211_MODE_STURBO_A]={ 1, 2, 2, 47, 0 },
[IEEE80211_MODE_11NA] = { 2, 2, 3, 47, 0 },
[IEEE80211_MODE_11NG] = { 2, 2, 3, 47, 0 },
};
static void
@ -922,16 +922,16 @@ void
ieee80211_wme_updateparams_locked(struct ieee80211vap *vap)
{
static const paramType phyParam[IEEE80211_MODE_MAX] = {
{ 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_AUTO */
{ 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11A */
{ 2, 5, 10, 64, 0 }, /* IEEE80211_MODE_11B */
{ 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11G */
{ 2, 5, 10, 64, 0 }, /* IEEE80211_MODE_FH */
{ 1, 3, 10, 64, 0 }, /* IEEE80211_MODE_TURBO_A */
{ 1, 3, 10, 64, 0 }, /* IEEE80211_MODE_TURBO_G */
{ 1, 3, 10, 64, 0 }, /* IEEE80211_MODE_STURBO_A */
{ 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11NA */ /*XXXcheck*/
{ 2, 4, 10, 64, 0 }, /* IEEE80211_MODE_11NG */ /*XXXcheck*/
[IEEE80211_MODE_AUTO] = { 2, 4, 10, 64, 0 },
[IEEE80211_MODE_11A] = { 2, 4, 10, 64, 0 },
[IEEE80211_MODE_11B] = { 2, 5, 10, 64, 0 },
[IEEE80211_MODE_11G] = { 2, 4, 10, 64, 0 },
[IEEE80211_MODE_FH] = { 2, 5, 10, 64, 0 },
[IEEE80211_MODE_TURBO_A] = { 1, 3, 10, 64, 0 },
[IEEE80211_MODE_TURBO_G] = { 1, 3, 10, 64, 0 },
[IEEE80211_MODE_STURBO_A] = { 1, 3, 10, 64, 0 },
[IEEE80211_MODE_11NA] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/
[IEEE80211_MODE_11NG] = { 2, 4, 10, 64, 0 }, /* XXXcheck*/
};
struct ieee80211com *ic = vap->iv_ic;
struct ieee80211_wme_state *wme = &ic->ic_wme;
@ -1007,17 +1007,17 @@ ieee80211_wme_updateparams_locked(struct ieee80211vap *vap)
/* XXX multi-bss */
if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
ic->ic_sta_assoc < 2 && (wme->wme_flags & WME_F_AGGRMODE) != 0) {
static const uint8_t logCwMin[IEEE80211_MODE_MAX] = {
3, /* IEEE80211_MODE_AUTO */
3, /* IEEE80211_MODE_11A */
4, /* IEEE80211_MODE_11B */
3, /* IEEE80211_MODE_11G */
4, /* IEEE80211_MODE_FH */
3, /* IEEE80211_MODE_TURBO_A */
3, /* IEEE80211_MODE_TURBO_G */
3, /* IEEE80211_MODE_STURBO_A */
3, /* IEEE80211_MODE_11NA */
3, /* IEEE80211_MODE_11NG */
static const uint8_t logCwMin[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO] = 3,
[IEEE80211_MODE_11A] = 3,
[IEEE80211_MODE_11B] = 4,
[IEEE80211_MODE_11G] = 3,
[IEEE80211_MODE_FH] = 4,
[IEEE80211_MODE_TURBO_A] = 3,
[IEEE80211_MODE_TURBO_G] = 3,
[IEEE80211_MODE_STURBO_A] = 3,
[IEEE80211_MODE_11NA] = 3,
[IEEE80211_MODE_11NG] = 3,
};
chanp = &wme->wme_chanParams.cap_wmeParams[WME_AC_BE];
bssp = &wme->wme_bssChanParams.cap_wmeParams[WME_AC_BE];