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

staging: brcm80211: macro cleanup in softmac rate.h



Substituted/moved/deleted macro's.

Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2fc6af5b
Loading
Loading
Loading
Loading
+12 −13
Original line number Diff line number Diff line
@@ -158,16 +158,16 @@ static void brcms_c_scb_ampdu_update_max_txlen(struct ampdu_info *ampdu, u8 dur)
	for (mcs = 0; mcs < MCS_TABLE_SIZE; mcs++) {
		/* rate is in Kbps; dur is in msec ==> len = (rate * dur) / 8 */
		/* 20MHz, No SGI */
		rate = MCS_RATE(mcs, false, false);
		rate = mcs_2_rate(mcs, false, false);
		ampdu->max_txlen[mcs][0][0] = (rate * dur) >> 3;
		/* 40 MHz, No SGI */
		rate = MCS_RATE(mcs, true, false);
		rate = mcs_2_rate(mcs, true, false);
		ampdu->max_txlen[mcs][1][0] = (rate * dur) >> 3;
		/* 20MHz, SGI */
		rate = MCS_RATE(mcs, false, true);
		rate = mcs_2_rate(mcs, false, true);
		ampdu->max_txlen[mcs][0][1] = (rate * dur) >> 3;
		/* 40 MHz, SGI */
		rate = MCS_RATE(mcs, true, true);
		rate = mcs_2_rate(mcs, true, true);
		ampdu->max_txlen[mcs][1][1] = (rate * dur) >> 3;
	}
}
@@ -330,7 +330,7 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
	/* note : we divide/multiply by 100 to avoid integer overflows */
	max_mpdu = min_t(u8, fifo->mcs2ampdu_table[FFPLD_MAX_MCS],
			 AMPDU_NUM_MPDU_LEGACY);
	phy_rate = MCS_RATE(FFPLD_MAX_MCS, true, false);
	phy_rate = mcs_2_rate(FFPLD_MAX_MCS, true, false);
	dma_rate =
	    (((phy_rate / 100) *
	      (max_mpdu * FFPLD_MPDU_SIZE - fifo->ampdu_pld_size))
@@ -341,7 +341,7 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
	dma_rate = dma_rate >> 7;
	for (i = 0; i < FFPLD_MAX_MCS; i++) {
		/* shifting to keep it within integer range */
		phy_rate = MCS_RATE(i, true, false) >> 7;
		phy_rate = mcs_2_rate(i, true, false) >> 7;
		if (phy_rate > dma_rate) {
			tmp = ((fifo->ampdu_pld_size * phy_rate) /
			       ((phy_rate - dma_rate) * FFPLD_MPDU_SIZE)) + 1;
@@ -360,7 +360,7 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
{
	struct ampdu_info *ampdu = wlc->ampdu;
	u32 phy_rate = MCS_RATE(FFPLD_MAX_MCS, true, false);
	u32 phy_rate = mcs_2_rate(FFPLD_MAX_MCS, true, false);
	u32 txunfl_ratio;
	u8 max_mpdu;
	u32 current_ampdu_cnt = 0;
@@ -678,7 +678,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,

			}
			is40 = (plcp0 & MIMO_PLCP_40MHZ) ? 1 : 0;
			sgi = PLCP3_ISSGI(plcp3) ? 1 : 0;
			sgi = plcp3_issgi(plcp3) ? 1 : 0;
			mcs = plcp0 & ~MIMO_PLCP_40MHZ;
			max_ampdu_bytes =
			    min(scb_ampdu->max_rx_ampdu_bytes,
@@ -697,8 +697,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
				rspec |= (PHY_TXC1_BW_40MHZ << RSPEC_BW_SHIFT);

			if (fbr_iscck)	/* CCK */
				rspec_fallback =
				    CCK_RSPEC(CCK_PHY2MAC_RATE
				rspec_fallback = cck_rspec(cck_phy2mac_rate
						    (txh->FragPLCPFallback[0]));
			else {	/* MIMO */
				rspec_fallback = RSPEC_MIMORATE;
@@ -722,7 +721,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,

		/* if (first mpdu for host agg) */
		/* test whether to add more */
		if ((MCS_RATE(mcs, true, false) >= f->dmaxferrate) &&
		if ((mcs_2_rate(mcs, true, false) >= f->dmaxferrate) &&
		    (count == f->mcs2ampdu_table[mcs])) {
			BCMMSG(wlc->wiphy, "wl%d: PR 37644: stopping"
				" ampdu at %d for mcs %d\n",
@@ -816,7 +815,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
		}

		/* set the preload length */
		if (MCS_RATE(mcs, true, false) >= f->dmaxferrate) {
		if (mcs_2_rate(mcs, true, false) >= f->dmaxferrate) {
			dma_len = min(dma_len, f->ampdu_pld_size);
			txh->PreloadSize = cpu_to_le16(dma_len);
		} else
+85 −88

File changed.

Preview size limit exceeded, changes collapsed.

+9 −7
Original line number Diff line number Diff line
@@ -353,12 +353,12 @@ u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp)
		switch (rxh->PhyRxStatus_0 & PRXS0_FT_MASK) {
		case PRXS0_CCK:
			rspec =
			    CCK_PHY2MAC_RATE(
				cck_phy2mac_rate(
				((struct cck_phy_hdr *) plcp)->signal);
			break;
		case PRXS0_OFDM:
			rspec =
			    OFDM_PHY2MAC_RATE(
			    ofdm_phy2mac_rate(
				((struct ofdm_phy_hdr *) plcp)->rlpt[0]);
			break;
		case PRXS0_PREN:
@@ -375,14 +375,14 @@ u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp)
			/* not supported, error condition */
			break;
		}
		if (PLCP3_ISSGI(plcp[3]))
		if (plcp3_issgi(plcp[3]))
			rspec |= RSPEC_SHORT_GI;
	} else
	    if ((phy_type == PHY_TYPE_A) || (rxh->PhyRxStatus_0 & PRXS0_OFDM))
		rspec = OFDM_PHY2MAC_RATE(
		rspec = ofdm_phy2mac_rate(
				((struct ofdm_phy_hdr *) plcp)->rlpt[0]);
	else
		rspec = CCK_PHY2MAC_RATE(
		rspec = cck_phy2mac_rate(
				((struct cck_phy_hdr *) plcp)->signal);

	return rspec;
@@ -417,9 +417,11 @@ brcms_c_rateset_filter(struct brcms_c_rateset *src, struct brcms_c_rateset *dst,
		r = src->rates[i];
		if (basic_only && !(r & BRCMS_RATE_FLAG))
			continue;
		if (rates == BRCMS_RATES_CCK && IS_OFDM((r & BRCMS_RATE_MASK)))
		if (rates == BRCMS_RATES_CCK &&
		    is_ofdm_rate((r & BRCMS_RATE_MASK)))
			continue;
		if (rates == BRCMS_RATES_OFDM && IS_CCK((r & BRCMS_RATE_MASK)))
		if (rates == BRCMS_RATES_OFDM &&
		    is_cck_rate((r & BRCMS_RATE_MASK)))
			continue;
		dst->rates[count++] = r & xmask;
	}
+113 −75

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -421,7 +421,7 @@ static u16 _brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
{
	u16 phytxant = wlc->stf->phytxant;

	if (RSPEC_STF(rspec) != PHY_TXC1_MODE_SISO)
	if (rspec_stf(rspec) != PHY_TXC1_MODE_SISO)
		phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
	else if (wlc->stf->txant == ANT_TX_DEF)
		phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;