Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc87568a authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: replaced various typedefs in softmac



typedefs are undesirable according to documentation/CodingStyle.

Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2d4684a5
Loading
Loading
Loading
Loading
+67 −67
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@
/* resetctrl */
#define	AIRC_RESET		1

typedef volatile struct _aidmp {
struct aidmp {
	u32 oobselina30;	/* 0x000 */
	u32 oobselina74;	/* 0x004 */
	u32 PAD[6];
@@ -355,7 +355,7 @@ typedef volatile struct _aidmp {
	u32 componentid1;	/* 0xff4 */
	u32 componentid2;	/* 0xff8 */
	u32 componentid3;	/* 0xffc */
} aidmp_t;
};

/* EROM parsing */

@@ -429,14 +429,14 @@ get_asd(struct si_pub *sih, u32 **eromptr, uint sp, uint ad, uint st,
	return asd;
}

static void ai_hwfixup(si_info_t *sii)
static void ai_hwfixup(struct si_info *sii)
{
}

/* parse the enumeration rom to identify all cores */
void ai_scan(struct si_pub *sih, void *regs)
{
	si_info_t *sii = SI_INFO(sih);
	struct si_info *sii = SI_INFO(sih);
	chipcregs_t *cc = (chipcregs_t *) regs;
	u32 erombase, *eromptr, *eromlim;

@@ -639,7 +639,7 @@ void ai_scan(struct si_pub *sih, void *regs)
 */
void *ai_setcoreidx(struct si_pub *sih, uint coreidx)
{
	si_info_t *sii = SI_INFO(sih);
	struct si_info *sii = SI_INFO(sih);
	u32 addr = sii->coresba[coreidx];
	u32 wrap = sii->wrapba[coreidx];
	void *regs;
@@ -694,7 +694,7 @@ int ai_numaddrspaces(struct si_pub *sih)
/* Return the address of the nth address space in the current core */
u32 ai_addrspace(struct si_pub *sih, uint asidx)
{
	si_info_t *sii;
	struct si_info *sii;
	uint cidx;

	sii = SI_INFO(sih);
@@ -713,7 +713,7 @@ u32 ai_addrspace(struct si_pub *sih, uint asidx)
/* Return the size of the nth address space in the current core */
u32 ai_addrspacesize(struct si_pub *sih, uint asidx)
{
	si_info_t *sii;
	struct si_info *sii;
	uint cidx;

	sii = SI_INFO(sih);
@@ -731,8 +731,8 @@ u32 ai_addrspacesize(struct si_pub *sih, uint asidx)

uint ai_flag(struct si_pub *sih)
{
	si_info_t *sii;
	aidmp_t *ai;
	struct si_info *sii;
	struct aidmp *ai;

	sii = SI_INFO(sih);
	if (BCM47162_DMP()) {
@@ -750,7 +750,7 @@ void ai_setint(struct si_pub *sih, int siflag)

uint ai_corevendor(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;
	u32 cia;

	sii = SI_INFO(sih);
@@ -760,7 +760,7 @@ uint ai_corevendor(struct si_pub *sih)

uint ai_corerev(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;
	u32 cib;

	sii = SI_INFO(sih);
@@ -770,8 +770,8 @@ uint ai_corerev(struct si_pub *sih)

bool ai_iscoreup(struct si_pub *sih)
{
	si_info_t *sii;
	aidmp_t *ai;
	struct si_info *sii;
	struct aidmp *ai;

	sii = SI_INFO(sih);
	ai = sii->curwrap;
@@ -783,8 +783,8 @@ bool ai_iscoreup(struct si_pub *sih)

void ai_core_cflags_wo(struct si_pub *sih, u32 mask, u32 val)
{
	si_info_t *sii;
	aidmp_t *ai;
	struct si_info *sii;
	struct aidmp *ai;
	u32 w;

	sii = SI_INFO(sih);
@@ -805,8 +805,8 @@ void ai_core_cflags_wo(struct si_pub *sih, u32 mask, u32 val)

u32 ai_core_cflags(struct si_pub *sih, u32 mask, u32 val)
{
	si_info_t *sii;
	aidmp_t *ai;
	struct si_info *sii;
	struct aidmp *ai;
	u32 w;

	sii = SI_INFO(sih);
@@ -828,8 +828,8 @@ u32 ai_core_cflags(struct si_pub *sih, u32 mask, u32 val)

u32 ai_core_sflags(struct si_pub *sih, u32 mask, u32 val)
{
	si_info_t *sii;
	aidmp_t *ai;
	struct si_info *sii;
	struct aidmp *ai;
	u32 w;

	sii = SI_INFO(sih);
@@ -850,19 +850,19 @@ u32 ai_core_sflags(struct si_pub *sih, u32 mask, u32 val)

/* *************** from siutils.c ************** */
/* local prototypes */
static si_info_t *ai_doattach(si_info_t *sii, void *regs,
static struct si_info *ai_doattach(struct si_info *sii, void *regs,
			      uint bustype, void *sdh, char **vars,
			      uint *varsz);
static bool ai_buscore_prep(si_info_t *sii, uint bustype);
static bool ai_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype,
static bool ai_buscore_prep(struct si_info *sii, uint bustype);
static bool ai_buscore_setup(struct si_info *sii, chipcregs_t *cc, uint bustype,
			     u32 savewin, uint *origidx, void *regs);
static void ai_nvram_process(si_info_t *sii, char *pvars);
static void ai_nvram_process(struct si_info *sii, char *pvars);

/* dev path concatenation util */
static char *ai_devpathvar(struct si_pub *sih, char *var, int len,
			   const char *name);
static bool _ai_clkctl_cc(si_info_t *sii, uint mode);
static bool ai_ispcie(si_info_t *sii);
static bool _ai_clkctl_cc(struct si_info *sii, uint mode);
static bool ai_ispcie(struct si_info *sii);

/* global variable to indicate reservation/release of gpio's */
static u32 ai_gpioreservation;
@@ -879,10 +879,10 @@ static u32 ai_gpioreservation;
struct si_pub *ai_attach(void *regs, uint bustype,
		void *sdh, char **vars, uint *varsz)
{
	si_info_t *sii;
	struct si_info *sii;

	/* alloc si_info_t */
	sii = kmalloc(sizeof(si_info_t), GFP_ATOMIC);
	/* alloc struct si_info */
	sii = kmalloc(sizeof(struct si_info), GFP_ATOMIC);
	if (sii == NULL) {
		SI_ERROR(("si_attach: malloc failed!\n"));
		return NULL;
@@ -900,9 +900,9 @@ struct si_pub *ai_attach(void *regs, uint bustype,
}

/* global kernel resource */
static si_info_t ksii;
static struct si_info ksii;

static bool ai_buscore_prep(si_info_t *sii, uint bustype)
static bool ai_buscore_prep(struct si_info *sii, uint bustype)
{
	/* kludge to enable the clock on the 4306 which lacks a slowclock */
	if (bustype == PCI_BUS && !ai_ispcie(sii))
@@ -910,7 +910,7 @@ static bool ai_buscore_prep(si_info_t *sii, uint bustype)
	return true;
}

static bool ai_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype,
static bool ai_buscore_setup(struct si_info *sii, chipcregs_t *cc, uint bustype,
			     u32 savewin, uint *origidx, void *regs)
{
	bool pci, pcie;
@@ -1019,7 +1019,7 @@ static bool ai_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype,
	return true;
}

static __used void ai_nvram_process(si_info_t *sii, char *pvars)
static __used void ai_nvram_process(struct si_info *sii, char *pvars)
{
	uint w = 0;

@@ -1068,7 +1068,7 @@ static __used void ai_nvram_process(si_info_t *sii, char *pvars)
	sii->pub.boardflags = getintvar(pvars, "boardflags");
}

static si_info_t *ai_doattach(si_info_t *sii,
static struct si_info *ai_doattach(struct si_info *sii,
			      void *regs, uint bustype, void *pbus,
			      char **vars, uint *varsz)
{
@@ -1079,7 +1079,7 @@ static si_info_t *ai_doattach(si_info_t *sii,
	uint socitype;
	uint origidx;

	memset((unsigned char *) sii, 0, sizeof(si_info_t));
	memset((unsigned char *) sii, 0, sizeof(struct si_info));

	savewin = 0;

@@ -1241,7 +1241,7 @@ static si_info_t *ai_doattach(si_info_t *sii,
/* may be called with core in reset */
void ai_detach(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;
	uint idx;

	struct si_pub *si_local = NULL;
@@ -1275,7 +1275,7 @@ ai_register_intr_callback(struct si_pub *sih, void *intrsoff_fn,
			  void *intrsrestore_fn,
			  void *intrsenabled_fn, void *intr_arg)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);
	sii->intr_arg = intr_arg;
@@ -1290,7 +1290,7 @@ ai_register_intr_callback(struct si_pub *sih, void *intrsoff_fn,

void ai_deregister_intr_callback(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);
	sii->intrsoff_fn = NULL;
@@ -1298,7 +1298,7 @@ void ai_deregister_intr_callback(struct si_pub *sih)

uint ai_coreid(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);
	return sii->coreid[sii->curidx];
@@ -1306,7 +1306,7 @@ uint ai_coreid(struct si_pub *sih)

uint ai_coreidx(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);
	return sii->curidx;
@@ -1320,7 +1320,7 @@ bool ai_backplane64(struct si_pub *sih)
/* return index of coreid or BADIDX if not found */
uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit)
{
	si_info_t *sii;
	struct si_info *sii;
	uint found;
	uint i;

@@ -1360,7 +1360,7 @@ void *ai_switch_core(struct si_pub *sih, uint coreid, uint *origidx,
		     uint *intr_val)
{
	void *cc;
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -1384,7 +1384,7 @@ void *ai_switch_core(struct si_pub *sih, uint coreid, uint *origidx,
/* restore coreidx and restore interrupt */
void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);
	if (SI_FAST(sii)
@@ -1397,7 +1397,7 @@ void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val)

void ai_write_wrapperreg(struct si_pub *sih, u32 offset, u32 val)
{
	si_info_t *sii = SI_INFO(sih);
	struct si_info *sii = SI_INFO(sih);
	u32 *w = (u32 *) sii->curwrap;
	W_REG(w + (offset / 4), val);
	return;
@@ -1421,7 +1421,7 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,
	uint w;
	uint intr_val = 0;
	bool fast = false;
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -1500,9 +1500,9 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,

void ai_core_disable(struct si_pub *sih, u32 bits)
{
	si_info_t *sii;
	struct si_info *sii;
	u32 dummy;
	aidmp_t *ai;
	struct aidmp *ai;

	sii = SI_INFO(sih);

@@ -1527,8 +1527,8 @@ void ai_core_disable(struct si_pub *sih, u32 bits)
 */
void ai_core_reset(struct si_pub *sih, u32 bits, u32 resetbits)
{
	si_info_t *sii;
	aidmp_t *ai;
	struct si_info *sii;
	struct aidmp *ai;
	u32 dummy;

	sii = SI_INFO(sih);
@@ -1554,7 +1554,7 @@ void ai_core_reset(struct si_pub *sih, u32 bits, u32 resetbits)
}

/* return the slow clock source - LPO, XTAL, or PCI */
static uint ai_slowclk_src(si_info_t *sii)
static uint ai_slowclk_src(struct si_info *sii)
{
	chipcregs_t *cc;
	u32 val;
@@ -1578,7 +1578,7 @@ static uint ai_slowclk_src(si_info_t *sii)
* return the ILP (slowclock) min or max frequency
* precondition: we've established the chip has dynamic clk control
*/
static uint ai_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc)
static uint ai_slowclk_freq(struct si_info *sii, bool max_freq, chipcregs_t *cc)
{
	u32 slowclk;
	uint div;
@@ -1612,7 +1612,7 @@ static uint ai_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc)
	return 0;
}

static void ai_clkctl_setdelay(si_info_t *sii, void *chipcregs)
static void ai_clkctl_setdelay(struct si_info *sii, void *chipcregs)
{
	chipcregs_t *cc = (chipcregs_t *) chipcregs;
	uint slowmaxfreq, pll_delay, slowclk;
@@ -1644,7 +1644,7 @@ static void ai_clkctl_setdelay(si_info_t *sii, void *chipcregs)
/* initialize power control delay registers */
void ai_clkctl_init(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;
	uint origidx = 0;
	chipcregs_t *cc;
	bool fast;
@@ -1682,7 +1682,7 @@ void ai_clkctl_init(struct si_pub *sih)
 */
u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;
	uint origidx = 0;
	chipcregs_t *cc;
	uint slowminfreq;
@@ -1730,7 +1730,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih)
/* turn primary xtal and/or pll off/on */
int ai_clkctl_xtal(struct si_pub *sih, uint what, bool on)
{
	si_info_t *sii;
	struct si_info *sii;
	u32 in, out, outen;

	sii = SI_INFO(sih);
@@ -1807,7 +1807,7 @@ int ai_clkctl_xtal(struct si_pub *sih, uint what, bool on)
 */
bool ai_clkctl_cc(struct si_pub *sih, uint mode)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -1822,7 +1822,7 @@ bool ai_clkctl_cc(struct si_pub *sih, uint mode)
}

/* clk control mechanism through chipcommon, no policy checking */
static bool _ai_clkctl_cc(si_info_t *sii, uint mode)
static bool _ai_clkctl_cc(struct si_info *sii, uint mode)
{
	uint origidx = 0;
	chipcregs_t *cc;
@@ -2001,7 +2001,7 @@ static char *ai_devpathvar(struct si_pub *sih, char *var, int len,
}

/* return true if PCIE capability exists in the pci config space */
static bool ai_ispcie(si_info_t *sii)
static bool ai_ispcie(struct si_info *sii)
{
	u8 cap_ptr;

@@ -2019,7 +2019,7 @@ static bool ai_ispcie(si_info_t *sii)

bool ai_pci_war16165(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -2028,7 +2028,7 @@ bool ai_pci_war16165(struct si_pub *sih)

void ai_pci_up(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -2047,7 +2047,7 @@ void ai_pci_up(struct si_pub *sih)
/* Unconfigure and/or apply various WARs when system is going to sleep mode */
void ai_pci_sleep(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -2057,7 +2057,7 @@ void ai_pci_sleep(struct si_pub *sih)
/* Unconfigure and/or apply various WARs when going down */
void ai_pci_down(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -2078,7 +2078,7 @@ void ai_pci_down(struct si_pub *sih)
 */
void ai_pci_setup(struct si_pub *sih, uint coremask)
{
	si_info_t *sii;
	struct si_info *sii;
	void *regs = NULL;
	u32 siflag = 0, w;
	uint idx = 0;
@@ -2130,7 +2130,7 @@ int ai_pci_fixcfg(struct si_pub *sih)
	uint origidx;
	void *regs = NULL;

	si_info_t *sii = SI_INFO(sih);
	struct si_info *sii = SI_INFO(sih);

	/* Fixup PI in SROM shadow area to enable the correct PCI core access */
	/* save the current index */
@@ -2170,7 +2170,7 @@ u32 ai_gpiocontrol(struct si_pub *sih, u32 mask, u32 val, u8 priority)

void ai_chipcontrl_epa4331(struct si_pub *sih, bool on)
{
	si_info_t *sii;
	struct si_info *sii;
	chipcregs_t *cc;
	uint origidx;
	u32 val;
@@ -2204,7 +2204,7 @@ void ai_chipcontrl_epa4331(struct si_pub *sih, bool on)
/* Enable BT-COEX & Ex-PA for 4313 */
void ai_epa_4313war(struct si_pub *sih)
{
	si_info_t *sii;
	struct si_info *sii;
	chipcregs_t *cc;
	uint origidx;

@@ -2224,7 +2224,7 @@ void ai_epa_4313war(struct si_pub *sih)
bool ai_deviceremoved(struct si_pub *sih)
{
	u32 w;
	si_info_t *sii;
	struct si_info *sii;

	sii = SI_INFO(sih);

@@ -2241,7 +2241,7 @@ bool ai_deviceremoved(struct si_pub *sih)
bool ai_is_sprom_available(struct si_pub *sih)
{
	if (sih->ccrev >= 31) {
		si_info_t *sii;
		struct si_info *sii;
		uint origidx;
		chipcregs_t *cc;
		u32 sromctrl;
+1 −1
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@
#define	BCM5357_CHIP_ID		0x5357	/* 5357 chipcommon chipid */


#define	SI_INFO(sih)	((si_info_t *)sih)
#define	SI_INFO(sih)	((struct si_info *)sih)

#define	GOODCOREADDR(x, b) \
	(((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
+15 −15
Original line number Diff line number Diff line
@@ -22,12 +22,12 @@

static struct brcms_c_bsscfg *brcms_c_bsscfg_malloc(uint unit);
static void brcms_c_bsscfg_mfree(struct brcms_c_bsscfg *cfg);
static struct wlc_pub *brcms_c_pub_malloc(uint unit,
static struct brcms_pub *brcms_c_pub_malloc(uint unit,
				      uint *err, uint devid);
static void brcms_c_pub_mfree(struct wlc_pub *pub);
static void brcms_c_tunables_init(wlc_tunables_t *tunables, uint devid);
static void brcms_c_pub_mfree(struct brcms_pub *pub);
static void brcms_c_tunables_init(struct brcms_tunables *tunables, uint devid);

static void brcms_c_tunables_init(wlc_tunables_t *tunables, uint devid)
static void brcms_c_tunables_init(struct brcms_tunables *tunables, uint devid)
{
	tunables->ntxd = NTXD;
	tunables->nrxd = NRXD;
@@ -45,17 +45,17 @@ static void brcms_c_tunables_init(wlc_tunables_t *tunables, uint devid)
	tunables->txsbnd = TXSBND;
}

static struct wlc_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
static struct brcms_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
{
	struct wlc_pub *pub;
	struct brcms_pub *pub;

	pub = kzalloc(sizeof(struct wlc_pub), GFP_ATOMIC);
	pub = kzalloc(sizeof(struct brcms_pub), GFP_ATOMIC);
	if (pub == NULL) {
		*err = 1001;
		goto fail;
	}

	pub->tunables = kzalloc(sizeof(wlc_tunables_t), GFP_ATOMIC);
	pub->tunables = kzalloc(sizeof(struct brcms_tunables), GFP_ATOMIC);
	if (pub->tunables == NULL) {
		*err = 1028;
		goto fail;
@@ -77,7 +77,7 @@ static struct wlc_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
	return NULL;
}

static void brcms_c_pub_mfree(struct wlc_pub *pub)
static void brcms_c_pub_mfree(struct brcms_pub *pub)
{
	if (pub == NULL)
		return;
@@ -95,7 +95,7 @@ static struct brcms_c_bsscfg *brcms_c_bsscfg_malloc(uint unit)
	if (cfg == NULL)
		goto fail;

	cfg->current_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
	cfg->current_bss = kzalloc(sizeof(struct brcms_bss_info), GFP_ATOMIC);
	if (cfg->current_bss == NULL)
		goto fail;

@@ -175,7 +175,7 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
		goto fail;
	}

	wlc->default_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
	wlc->default_bss = kzalloc(sizeof(struct brcms_bss_info), GFP_ATOMIC);
	if (wlc->default_bss == NULL) {
		*err = 1010;
		goto fail;
@@ -189,16 +189,16 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
	brcms_c_bsscfg_ID_assign(wlc, wlc->cfg);

	wlc->wsec_def_keys[0] =
		kzalloc(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
		kzalloc(sizeof(struct wsec_key) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
	if (wlc->wsec_def_keys[0] == NULL) {
		*err = 1015;
		goto fail;
	} else {
		int i;
		for (i = 1; i < WLC_DEFAULT_KEYS; i++) {
			wlc->wsec_def_keys[i] = (wsec_key_t *)
			wlc->wsec_def_keys[i] = (struct wsec_key *)
			    ((unsigned long)wlc->wsec_def_keys[0] +
			     (sizeof(wsec_key_t) * i));
			     (sizeof(struct wsec_key) * i));
		}
	}

@@ -237,7 +237,7 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
	}

	wlc->corestate->macstat_snapshot =
		kzalloc(sizeof(macstat_t), GFP_ATOMIC);
		kzalloc(sizeof(struct macstat), GFP_ATOMIC);
	if (wlc->corestate->macstat_snapshot == NULL) {
		*err = 1027;
		goto fail;
+38 −35
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@
 * This allows to maintain a specific state independently of
 * how often and/or when the wlc counters are updated.
 */
typedef struct wlc_fifo_info {
struct brcms_fifo_info {
	u16 ampdu_pld_size;	/* number of bytes to be pre-loaded */
	u8 mcs2ampdu_table[FFPLD_MAX_MCS + 1];	/* per-mcs max # of mpdus in an ampdu */
	u16 prev_txfunfl;	/* num of underflows last read from the HW macstats counter */
@@ -68,7 +68,7 @@ typedef struct wlc_fifo_info {
	u32 accum_txampdu;	/* num of tx ampdu since we modified pld params  */
	u32 prev_txampdu;	/* previous reading of tx ampdu */
	u32 dmaxferrate;	/* estimated dma avg xfer rate in kbits/sec */
} wlc_fifo_info_t;
};

/* AMPDU module specific state */
struct ampdu_info {
@@ -94,7 +94,8 @@ struct ampdu_info {
	u32 tx_max_funl;	/* underflows should be kept such that
				 * (tx_max_funfl*underflows) < tx frames
				 */
	wlc_fifo_info_t fifo_tb[NUM_FFPLD_FIFO];	/* table of fifo infos  */
	/* table of fifo infos */
	struct brcms_fifo_info fifo_tb[NUM_FFPLD_FIFO];

};

@@ -122,10 +123,12 @@ static void brcms_c_scb_ampdu_update_config_all(struct ampdu_info *ampdu);

#define brcms_c_ampdu_txflowcontrol(a, b, c)	do {} while (0)

static void brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu,
static void
brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu,
				  struct scb *scb,
					  struct sk_buff *p, tx_status_t *txs,
				  struct sk_buff *p, struct tx_status *txs,
				  u32 frmtxstatus, u32 frmtxstatus2);

static bool brcms_c_ampdu_cap(struct ampdu_info *ampdu);
static int brcms_c_ampdu_set(struct ampdu_info *ampdu, bool on);

@@ -203,7 +206,7 @@ void brcms_c_ampdu_detach(struct ampdu_info *ampdu)
static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
					    struct scb *scb)
{
	scb_ampdu_t *scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
	struct scb_ampdu *scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
	int i;

	scb_ampdu->max_pdu = (u8) ampdu->wlc->pub->tunables->ampdunummpdu;
@@ -237,7 +240,7 @@ static void brcms_c_scb_ampdu_update_config_all(struct ampdu_info *ampdu)
static void brcms_c_ffpld_init(struct ampdu_info *ampdu)
{
	int i, j;
	wlc_fifo_info_t *fifo;
	struct brcms_fifo_info *fifo;

	for (j = 0; j < NUM_FFPLD_FIFO; j++) {
		fifo = (ampdu->fifo_tb + j);
@@ -267,14 +270,14 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
	u32 current_ampdu_cnt = 0;
	u16 max_pld_size;
	u32 new_txunfl;
	wlc_fifo_info_t *fifo = (ampdu->fifo_tb + fid);
	struct brcms_fifo_info *fifo = (ampdu->fifo_tb + fid);
	uint xmtfifo_sz;
	u16 cur_txunfl;

	/* return if we got here for a different reason than underflows */
	cur_txunfl =
	    brcms_c_read_shm(wlc,
			 M_UCODE_MACSTAT + offsetof(macstat_t, txfunfl[fid]));
	cur_txunfl = brcms_c_read_shm(wlc,
				      M_UCODE_MACSTAT +
				      offsetof(struct macstat, txfunfl[fid]));
	new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl);
	if (new_txunfl == 0) {
		BCMMSG(wlc->wiphy, "TX status FRAG set but no tx underflows\n");
@@ -381,7 +384,7 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
	int i;
	u32 phy_rate, dma_rate, tmp;
	u8 max_mpdu;
	wlc_fifo_info_t *fifo = (ampdu->fifo_tb + f);
	struct brcms_fifo_info *fifo = (ampdu->fifo_tb + f);

	/* recompute the dma rate */
	/* note : we divide/multiply by 100 to avoid integer overflows */
@@ -413,8 +416,8 @@ brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
	u8 ba_wsize,		/* negotiated ba window size (in pdu) */
	uint max_rx_ampdu_bytes) /* from ht_cap in beacon */
{
	scb_ampdu_t *scb_ampdu;
	scb_ampdu_tid_ini_t *ini;
	struct scb_ampdu *scb_ampdu;
	struct scb_ampdu_tid_ini *ini;
	struct ampdu_info *ampdu = wlc->ampdu;
	struct scb *scb = wlc->pub->global_scb;
	scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
@@ -449,12 +452,12 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
	uint i, count = 0, fifo, seg_cnt = 0;
	u16 plen, len, seq = 0, mcl, mch, index, frameid, dma_len = 0;
	u32 ampdu_len, max_ampdu_bytes = 0;
	d11txh_t *txh = NULL;
	struct d11txh *txh = NULL;
	u8 *plcp;
	struct ieee80211_hdr *h;
	struct scb *scb;
	scb_ampdu_t *scb_ampdu;
	scb_ampdu_tid_ini_t *ini;
	struct scb_ampdu *scb_ampdu;
	struct scb_ampdu_tid_ini *ini;
	u8 mcs = 0;
	bool use_rts = false, use_cts = false;
	ratespec_t rspec = 0, rspec_fallback = 0;
@@ -462,7 +465,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
	u16 mimo_ctlchbw = PHY_TXC1_BW_20MHZ;
	struct ieee80211_rts *rts;
	u8 rr_retry_limit;
	wlc_fifo_info_t *f;
	struct brcms_fifo_info *f;
	bool fbr_iscck;
	struct ieee80211_tx_info *tx_info;
	u16 qlen;
@@ -524,7 +527,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
		}

		/* pkt is good to be aggregated */
		txh = (d11txh_t *) p->data;
		txh = (struct d11txh *) p->data;
		plcp = (u8 *) (txh + 1);
		h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN);
		seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT;
@@ -701,7 +704,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,

	if (count) {
		/* patch up the last txh */
		txh = (d11txh_t *) pkt[count - 1]->data;
		txh = (struct d11txh *) pkt[count - 1]->data;
		mcl = le16_to_cpu(txh->MacTxControlLow);
		mcl &= ~TXC_AMPDU_MASK;
		mcl |= (TXC_AMPDU_LAST << TXC_AMPDU_SHIFT);
@@ -719,7 +722,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
		ampdu_len -= roundup(len, 4) - len;

		/* patch up the first txh & plcp */
		txh = (d11txh_t *) pkt[0]->data;
		txh = (struct d11txh *) pkt[0]->data;
		plcp = (u8 *) (txh + 1);

		WLC_SET_MIMO_PLCP_LEN(plcp, ampdu_len);
@@ -809,11 +812,11 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,

void
brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
		     struct sk_buff *p, tx_status_t *txs)
		     struct sk_buff *p, struct tx_status *txs)
{
	scb_ampdu_t *scb_ampdu;
	struct scb_ampdu *scb_ampdu;
	struct brcms_c_info *wlc = ampdu->wlc;
	scb_ampdu_tid_ini_t *ini;
	struct scb_ampdu_tid_ini *ini;
	u32 s1 = 0, s2 = 0;
	struct ieee80211_tx_info *tx_info;

@@ -845,11 +848,11 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
	} else {
		/* loop through all pkts and free */
		u8 queue = txs->frameid & TXFID_QUEUE_MASK;
		d11txh_t *txh;
		struct d11txh *txh;
		u16 mcl;
		while (p) {
			tx_info = IEEE80211_SKB_CB(p);
			txh = (d11txh_t *) p->data;
			txh = (struct d11txh *) p->data;
			mcl = le16_to_cpu(txh->MacTxControlLow);
			brcmu_pkt_buf_free_skb(p);
			/* break out if last packet of ampdu */
@@ -866,7 +869,7 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
static void
brcms_c_ampdu_rate_status(struct brcms_c_info *wlc,
			  struct ieee80211_tx_info *tx_info,
			  tx_status_t *txs, u8 mcs)
			  struct tx_status *txs, u8 mcs)
{
	struct ieee80211_tx_rate *txrate = tx_info->status.rates;
	int i;
@@ -882,14 +885,14 @@ brcms_c_ampdu_rate_status(struct brcms_c_info *wlc,

static void
brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
			      struct sk_buff *p, tx_status_t *txs,
			      struct sk_buff *p, struct tx_status *txs,
			      u32 s1, u32 s2)
{
	scb_ampdu_t *scb_ampdu;
	struct scb_ampdu *scb_ampdu;
	struct brcms_c_info *wlc = ampdu->wlc;
	scb_ampdu_tid_ini_t *ini;
	struct scb_ampdu_tid_ini *ini;
	u8 bitmap[8], queue, tid;
	d11txh_t *txh;
	struct d11txh *txh;
	u8 *plcp;
	struct ieee80211_hdr *h;
	u16 seq, start_seq = 0, bindex, index, mcl;
@@ -982,7 +985,7 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,

			if (WL_ERROR_ON()) {
				brcmu_prpkt("txpkt (AMPDU)", p);
				brcms_c_print_txdesc((d11txh_t *) p->data);
				brcms_c_print_txdesc((struct d11txh *) p->data);
			}
			brcms_c_print_txstatus(txs);
		}
@@ -991,7 +994,7 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
	/* loop through all pkts and retry if not acked */
	while (p) {
		tx_info = IEEE80211_SKB_CB(p);
		txh = (d11txh_t *) p->data;
		txh = (struct d11txh *) p->data;
		mcl = le16_to_cpu(txh->MacTxControlLow);
		plcp = (u8 *) (txh + 1);
		h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN);
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ extern int brcms_c_sendampdu(struct ampdu_info *ampdu,
			     struct brcms_c_txq_info *qi,
			     struct sk_buff **aggp, int prec);
extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
				 struct sk_buff *p, tx_status_t *txs);
				 struct sk_buff *p, struct tx_status *txs);
extern void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
extern void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);

Loading