simplify tim callback api

MFC after:	3 days
This commit is contained in:
Sam Leffler 2005-07-22 17:45:48 +00:00
parent a92c6eb0f1
commit edfa57d0f0
4 changed files with 11 additions and 12 deletions

View File

@ -2632,7 +2632,7 @@ ieee80211_node_pwrsave(struct ieee80211_node *ni, int enable)
*/
if (IEEE80211_NODE_SAVEQ_QLEN(ni) == 0) {
if (ic->ic_set_tim != NULL)
ic->ic_set_tim(ic, ni, 0); /* just in case */
ic->ic_set_tim(ni, 0); /* just in case */
return;
}
IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER,
@ -2657,7 +2657,7 @@ ieee80211_node_pwrsave(struct ieee80211_node *ni, int enable)
IF_ENQUEUE(&ic->ic_ifp->if_snd, m);
}
if (ic->ic_set_tim != NULL)
ic->ic_set_tim(ic, ni, 0);
ic->ic_set_tim(ni, 0);
}
/*
@ -2704,7 +2704,7 @@ ieee80211_recv_pspoll(struct ieee80211com *ic,
ieee80211_send_nulldata(ni);
ic->ic_stats.is_ps_qempty++; /* XXX node stat */
if (ic->ic_set_tim != NULL)
ic->ic_set_tim(ic, ni, 0); /* just in case */
ic->ic_set_tim(ni, 0); /* just in case */
return;
}
/*
@ -2722,7 +2722,7 @@ ieee80211_recv_pspoll(struct ieee80211com *ic,
"[%s] recv ps-poll, send packet, queue empty\n",
ether_sprintf(ni->ni_macaddr));
if (ic->ic_set_tim != NULL)
ic->ic_set_tim(ic, ni, 0);
ic->ic_set_tim(ni, 0);
}
m->m_flags |= M_PWR_SAV; /* bypass PS handling */
IF_ENQUEUE(&ic->ic_ifp->if_snd, m);

View File

@ -72,8 +72,7 @@ static void ieee80211_free_allnodes(struct ieee80211_node_table *);
static void ieee80211_timeout_scan_candidates(struct ieee80211_node_table *);
static void ieee80211_timeout_stations(struct ieee80211_node_table *);
static void ieee80211_set_tim(struct ieee80211com *,
struct ieee80211_node *, int set);
static void ieee80211_set_tim(struct ieee80211_node *, int set);
static void ieee80211_node_table_init(struct ieee80211com *ic,
struct ieee80211_node_table *nt, const char *name, int inact,
@ -864,7 +863,7 @@ node_cleanup(struct ieee80211_node *ni)
*/
IEEE80211_NODE_SAVEQ_DRAIN(ni, qlen);
if (qlen != 0 && ic->ic_set_tim != NULL)
ic->ic_set_tim(ic, ni, 0);
ic->ic_set_tim(ni, 0);
ni->ni_associd = 0;
if (ni->ni_challenge != NULL) {
@ -1464,7 +1463,7 @@ IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER, "[%s] discard frame, age %u\n", ether
IEEE80211_NODE_STAT_ADD(ni,
ps_discard, discard);
if (IEEE80211_NODE_SAVEQ_QLEN(ni) == 0)
ic->ic_set_tim(ic, ni, 0);
ic->ic_set_tim(ni, 0);
}
}
/*
@ -1860,8 +1859,9 @@ ieee80211_getrssi(struct ieee80211com *ic)
* Indicate whether there are frames queued for a station in power-save mode.
*/
static void
ieee80211_set_tim(struct ieee80211com *ic, struct ieee80211_node *ni, int set)
ieee80211_set_tim(struct ieee80211_node *ni, int set)
{
struct ieee80211com *ic = ni->ni_ic;
u_int16_t aid;
KASSERT(ic->ic_opmode == IEEE80211_M_HOSTAP ||

View File

@ -1602,5 +1602,5 @@ ieee80211_pwrsave(struct ieee80211com *ic, struct ieee80211_node *ni,
ether_sprintf(ni->ni_macaddr), qlen);
if (qlen == 1)
ic->ic_set_tim(ic, ni, 1);
ic->ic_set_tim(ni, 1);
}

View File

@ -103,8 +103,7 @@ struct ieee80211com {
void (*ic_newassoc)(struct ieee80211com *,
struct ieee80211_node *, int);
void (*ic_updateslot)(struct ifnet *);
void (*ic_set_tim)(struct ieee80211com *,
struct ieee80211_node *, int);
void (*ic_set_tim)(struct ieee80211_node *, int);
u_int8_t ic_myaddr[IEEE80211_ADDR_LEN];
struct ieee80211_rateset ic_sup_rates[IEEE80211_MODE_MAX];
struct ieee80211_channel ic_channels[IEEE80211_CHAN_MAX+1];