示例#1
0
void
bcm_rpc_tp_agg_set(rpc_tp_info_t *rpcb, uint32 reason, bool set)
{
	static int i = 0;

	if (set) {
		RPC_TP_AGG(("%s: agg start\n", __FUNCTION__));

		mboolset(rpcb->tp_dngl_aggregation, reason);

	} else if (rpcb->tp_dngl_aggregation) {

		RPC_TP_AGG(("%s: agg end\n", __FUNCTION__));

		if (i > 0) {
			i--;
			return;
		} else {
			i = rpcb->tp_dngl_agg_lazy;
		}

		mboolclr(rpcb->tp_dngl_aggregation, reason);
		if (!rpcb->tp_dngl_aggregation)
			bcm_rpc_tp_dngl_agg_release(rpcb);
	}
}
/* Update the radio state (enable/disable) and tx power targets
 * based on a new set of channel/regulatory information
 */
static void brcms_c_channels_commit(struct brcms_cm_info *wlc_cm)
{
	struct brcms_c_info *wlc = wlc_cm->wlc;
	uint chan;
	struct txpwr_limits txpwr;

	/* search for the existence of any valid channel */
	for (chan = 0; chan < MAXCHANNEL; chan++) {
		if (brcms_c_valid_channel20_db(wlc->cmi, chan))
			break;
	}
	if (chan == MAXCHANNEL)
		chan = INVCHANNEL;

	/*
	 * based on the channel search above, set or
	 * clear WL_RADIO_COUNTRY_DISABLE.
	 */
	if (chan == INVCHANNEL) {
		/*
		 * country/locale with no valid channels, set
		 * the radio disable bit
		 */
		mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
		wiphy_err(wlc->wiphy, "wl%d: %s: no valid channel for \"%s\" "
			  "nbands %d bandlocked %d\n", wlc->pub->unit,
			  __func__, wlc_cm->country_abbrev, wlc->pub->_nbands,
			  wlc->bandlocked);
	} else if (mboolisset(wlc->pub->radio_disabled,
			      WL_RADIO_COUNTRY_DISABLE)) {
		/*
		 * country/locale with valid channel, clear
		 * the radio disable bit
		 */
		mboolclr(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
	}

	/*
	 * Now that the country abbreviation is set, if the radio supports 2G,
	 * then set channel 14 restrictions based on the new locale.
	 */
	if (wlc->pub->_nbands > 1 || wlc->band->bandtype == BRCM_BAND_2G)
		wlc_phy_chanspec_ch14_widefilter_set(wlc->band->pi,
						     brcms_c_japan(wlc) ? true :
						     false);

	if (wlc->pub->up && chan != INVCHANNEL) {
		brcms_c_channel_reg_limits(wlc_cm, wlc->chanspec, &txpwr);
		brcms_c_channel_min_txpower_limits_with_local_constraint(wlc_cm,
			&txpwr, BRCMS_TXPWR_MAX);
		wlc_phy_txpower_limit_set(wlc->band->pi, &txpwr, wlc->chanspec);
	}
}
示例#3
0
/* TP aggregation: set, init, agg, append, close, flush */
void
bcm_rpc_tp_agg_set(rpc_tp_info_t *rpcb, uint32 reason, bool set)
{
	if (set) {
		RPC_TP_AGG(("%s: agg start 0x%x\n", __FUNCTION__, reason));

		mboolset(rpcb->tp_tx_aggregation, reason);

	} else if (rpcb->tp_tx_aggregation) {
		RPC_TP_AGG(("%s: agg end 0x%x\n", __FUNCTION__, reason));

		mboolclr(rpcb->tp_tx_aggregation, reason);
		if (!rpcb->tp_tx_aggregation)
			bcm_rpc_tp_tx_agg_release(rpcb);
	}
}
示例#4
0
/* Update the radio state (enable/disable) and tx power targets
 * based on a new set of channel/regulatory information
 */
static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
{
	struct wlc_info *wlc = wlc_cm->wlc;
	uint chan;
	struct txpwr_limits txpwr;

	/* search for the existence of any valid channel */
	for (chan = 0; chan < MAXCHANNEL; chan++) {
		if (VALID_CHANNEL20_DB(wlc, chan)) {
			break;
		}
	}
	if (chan == MAXCHANNEL)
		chan = INVCHANNEL;

	/* based on the channel search above, set or clear WL_RADIO_COUNTRY_DISABLE */
	if (chan == INVCHANNEL) {
		/* country/locale with no valid channels, set the radio disable bit */
		mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
		WL_ERROR("wl%d: %s: no valid channel for \"%s\" nbands %d bandlocked %d\n",
			 wlc->pub->unit, __func__,
			 wlc_cm->country_abbrev, NBANDS(wlc), wlc->bandlocked);
	} else
	    if (mboolisset(wlc->pub->radio_disabled,
		WL_RADIO_COUNTRY_DISABLE)) {
		/* country/locale with valid channel, clear the radio disable bit */
		mboolclr(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
	}

	/* Now that the country abbreviation is set, if the radio supports 2G, then
	 * set channel 14 restrictions based on the new locale.
	 */
	if (NBANDS(wlc) > 1 || BAND_2G(wlc->band->bandtype)) {
		wlc_phy_chanspec_ch14_widefilter_set(wlc->band->pi,
						     wlc_japan(wlc) ? true :
						     false);
	}

	if (wlc->pub->up && chan != INVCHANNEL) {
		wlc_channel_reg_limits(wlc_cm, wlc->chanspec, &txpwr);
		wlc_channel_min_txpower_limits_with_local_constraint(wlc_cm,
								     &txpwr,
								     WLC_TXPWR_MAX);
		wlc_phy_txpower_limit_set(wlc->band->pi, &txpwr, wlc->chanspec);
	}
}