Exemple #1
0
void
ieee80211_amrr_setinterval(struct ieee80211_amrr *amrr, int msecs)
{
	int t;

	if (msecs < 100)
		msecs = 100;
	t = msecs_to_ticks(msecs);
	amrr->amrr_interval = (t < 1) ? 1 : t;
}
void
rtwn_pci_delay(struct rtwn_softc *sc, int usec)
{
	if (usec < 1000)
		DELAY(usec);
	else {
		(void) mtx_sleep(sc, &sc->sc_mtx, 0, "rtwn_pci",
		    msecs_to_ticks(usec / 1000));
	}
}
static void
amrr_setinterval(const struct ieee80211vap *vap, int msecs)
{
	struct ieee80211_amrr *amrr = vap->iv_rs;
	int t;

	if (msecs < 100)
		msecs = 100;
	t = msecs_to_ticks(msecs);
	amrr->amrr_interval = (t < 1) ? 1 : t;
}
Exemple #4
0
void
rtwn_usb_delay(struct rtwn_softc *sc, int usec)
{

	/* 1ms delay as default is too big. */
	if (usec < 1000)
		DELAY(usec);
	else {
		usb_pause_mtx(&sc->sc_mtx,
		    MAX(msecs_to_ticks(usec / 1000), 1));
	}
}
Exemple #5
0
static void
ieee80211_hwmp_init(void)
{
	ieee80211_hwmp_pathtimeout = msecs_to_ticks(5*1000);
	ieee80211_hwmp_roottimeout = msecs_to_ticks(5*1000);
	ieee80211_hwmp_rootint = msecs_to_ticks(2*1000);
	ieee80211_hwmp_rannint = msecs_to_ticks(1*1000);

	/*
	 * Register action frame handler.
	 */
	ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHPATH,
	    IEEE80211_ACTION_MESHPATH_SEL, hwmp_recv_action_meshpath);

	/* NB: default is 5 secs per spec */
	mesh_proto_hwmp.mpp_inact = msecs_to_ticks(5*1000);

	/*
	 * Register HWMP.
	 */
	ieee80211_mesh_register_proto_path(&mesh_proto_hwmp);
}
Exemple #6
0
int
ieee80211_sysctl_msecs_ticks(SYSCTL_HANDLER_ARGS)
{
	int msecs = ticks_to_msecs(*(int *)arg1);
	int error, t;

	error = sysctl_handle_int(oidp, &msecs, 0, req);
	if (error || !req->newptr)
		return error;
	t = msecs_to_ticks(msecs);
	*(int *)arg1 = (t < 1) ? 1 : t;
	return 0;
}
static void
scan_start(void *arg, int pending)
{
#define	ISCAN_REP	(ISCAN_MINDWELL | ISCAN_DISCARD)
	struct ieee80211_scan_state *ss = (struct ieee80211_scan_state *) arg;
	struct scan_state *ss_priv = SCAN_PRIVATE(ss);
	struct ieee80211vap *vap = ss->ss_vap;
	struct ieee80211com *ic = ss->ss_ic;

	IEEE80211_LOCK(ic);
	if (vap == NULL || (ic->ic_flags & IEEE80211_F_SCAN) == 0 ||
	    (ss_priv->ss_iflags & ISCAN_ABORT)) {
		/* Cancelled before we started */
		scan_done(ss, 0);
		return;
	}

	if (ss->ss_next == ss->ss_last) {
		IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
			"%s: no channels to scan\n", __func__);
		scan_done(ss, 1);
		return;
	}

	if (vap->iv_opmode == IEEE80211_M_STA &&
	    vap->iv_state == IEEE80211_S_RUN) {
		if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) {
			/* Enable station power save mode */
			vap->iv_sta_ps(vap, 1);
			/* Wait until null data frame will be ACK'ed */
			mtx_sleep(vap, IEEE80211_LOCK_OBJ(ic), PCATCH,
			    "sta_ps", msecs_to_ticks(10));
			if (ss_priv->ss_iflags & ISCAN_ABORT) {
				scan_done(ss, 0);
				return;
			}
		}
	}

	ss_priv->ss_scanend = ticks + ss_priv->ss_duration;

	/* XXX scan state can change! Re-validate scan state! */

	IEEE80211_UNLOCK(ic);

	ic->ic_scan_start(ic);		/* notify driver */

	scan_curchan_task(ss, 0);
}
Exemple #8
0
/*
 * rt2860_amrr_init
 */
void rt2860_amrr_init(struct rt2860_amrr *amrr, struct ieee80211vap *vap,
	int ntxpath, int min_success_threshold, int max_success_threshold, int msecs)
{
	int t;

	amrr->ntxpath = ntxpath;

	amrr->min_success_threshold = min_success_threshold;
	amrr->max_success_threshold = max_success_threshold;

	if (msecs < 100)
		msecs = 100;

	t = msecs_to_ticks(msecs);

	amrr->interval = (t < 1) ? 1 : t;
}
void
ieee80211_superg_attach(struct ieee80211com *ic)
{
	struct ieee80211_superg *sg;

	if (ic->ic_caps & IEEE80211_C_FF) {
		sg = (struct ieee80211_superg *) malloc(
		     sizeof(struct ieee80211_superg), M_80211_VAP,
		     M_NOWAIT | M_ZERO);
		if (sg == NULL) {
			printf("%s: cannot allocate SuperG state block\n",
			    __func__);
			return;
		}
		ic->ic_superg = sg;
	}
	ieee80211_ffagemax = msecs_to_ticks(150);
}
Exemple #10
0
void
ieee80211_superg_attach(struct ieee80211com *ic)
{
	struct ieee80211_superg *sg;

	sg = (struct ieee80211_superg *) IEEE80211_MALLOC(
	     sizeof(struct ieee80211_superg), M_80211_VAP,
	     IEEE80211_M_NOWAIT | IEEE80211_M_ZERO);
	if (sg == NULL) {
		printf("%s: cannot allocate SuperG state block\n",
		    __func__);
		return;
	}
	ic->ic_superg = sg;

	/*
	 * Default to not being so aggressive for FF/AMSDU
	 * aging, otherwise we may hold a frame around
	 * for way too long before we expire it out.
	 */
	ieee80211_ffagemax = msecs_to_ticks(2);
}