mirror of https://github.com/proski/madwifi
Lots and lots of formatting and trivial changes that I have been collecting
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3069 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
parent
efd52870b7
commit
d959c28466
106
ath/if_ath.c
106
ath/if_ath.c
|
@ -1702,7 +1702,7 @@ ath_uapsd_processtriggers(struct ath_softc *sc)
|
|||
bus_dma_sync_single(sc->sc_bdev, bf->bf_skbaddr,
|
||||
sizeof(struct ieee80211_qosframe),
|
||||
BUS_DMA_FROMDEVICE);
|
||||
qwh = (struct ieee80211_qosframe *) skb->data;
|
||||
qwh = (struct ieee80211_qosframe *)skb->data;
|
||||
|
||||
/* Find the node; it MUST be in the keycache. */
|
||||
if (rs->rs_keyix == HAL_RXKEYIX_INVALID ||
|
||||
|
@ -2661,7 +2661,7 @@ ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb)
|
|||
struct ath_desc *ds = NULL;
|
||||
struct ieee80211_frame *wh;
|
||||
|
||||
wh = (struct ieee80211_frame *) skb->data;
|
||||
wh = (struct ieee80211_frame *)skb->data;
|
||||
try0 = ph->try0;
|
||||
rt = sc->sc_currates;
|
||||
txrate = dot11_to_ratecode(sc, rt, ph->rate0);
|
||||
|
@ -3002,7 +3002,7 @@ ath_hardstart(struct sk_buff *skb, struct net_device *dev)
|
|||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
eh = (struct ether_header *) skb->data;
|
||||
eh = (struct ether_header *)skb->data;
|
||||
ni = SKB_CB(skb)->ni; /* NB: always passed down by 802.11 layer */
|
||||
if (ni == NULL) {
|
||||
/* NB: this happens if someone marks the underlying device up */
|
||||
|
@ -3936,7 +3936,7 @@ static void
|
|||
ath_beacon_dturbo_config(struct ieee80211vap *vap, u_int32_t intval)
|
||||
{
|
||||
#define IS_CAPABLE(vap) \
|
||||
(vap->iv_bss && (vap->iv_bss->ni_ath_flags & (IEEE80211_ATHC_TURBOP )) == \
|
||||
(vap->iv_bss && (vap->iv_bss->ni_ath_flags & (IEEE80211_ATHC_TURBOP)) == \
|
||||
(IEEE80211_ATHC_TURBOP))
|
||||
struct ieee80211com *ic = vap->iv_ic;
|
||||
struct ath_softc *sc = ic->ic_dev->priv;
|
||||
|
@ -4011,15 +4011,12 @@ ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark, u_int8_t dtim)
|
|||
sc->sc_dturbo_bytes = sc->sc_devstats.tx_bytes
|
||||
+ sc->sc_devstats.rx_bytes;
|
||||
if (ic->ic_ath_cap & IEEE80211_ATHC_BOOST) {
|
||||
/*
|
||||
* before switching to base mode,
|
||||
* make sure that the conditions( low rssi, low bw) to switch mode
|
||||
* hold for some time and time in turbo exceeds minimum turbo time.
|
||||
*/
|
||||
|
||||
if (sc->sc_dturbo_tcount >= sc->sc_dturbo_turbo_tmin &&
|
||||
sc->sc_dturbo_hold ==0 &&
|
||||
(bss_traffic < sc->sc_dturbo_bw_base || !sc->sc_rate_recn_state)) {
|
||||
/* Before switching to base mode, make sure that the
|
||||
* conditions (low RSSI, low BW) to switch mode hold for some
|
||||
* time and time in turbo exceeds minimum turbo time. */
|
||||
if ((sc->sc_dturbo_tcount >= sc->sc_dturbo_turbo_tmin) &&
|
||||
(sc->sc_dturbo_hold == 0) &&
|
||||
(bss_traffic < sc->sc_dturbo_bw_base || !sc->sc_rate_recn_state)) {
|
||||
sc->sc_dturbo_hold = 1;
|
||||
} else {
|
||||
if (sc->sc_dturbo_hold &&
|
||||
|
@ -4312,7 +4309,7 @@ ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni)
|
|||
__func__, sc->sc_stagbeacons ? "stagger" : "burst",
|
||||
avp->av_bslot, ni->ni_intval, (unsigned long long) tuadjust);
|
||||
|
||||
wh = (struct ieee80211_frame *) skb->data;
|
||||
wh = (struct ieee80211_frame *)skb->data;
|
||||
memcpy(&wh[1], &tsfadjust, sizeof(tsfadjust));
|
||||
}
|
||||
|
||||
|
@ -5611,7 +5608,7 @@ ath_node_move_data(const struct ieee80211_node *ni)
|
|||
}
|
||||
count++;
|
||||
skb = bf_tmp->bf_skb;
|
||||
wh = (struct ieee80211_frame *) skb->data;
|
||||
wh = (struct ieee80211_frame *)skb->data;
|
||||
if (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_QOS) {
|
||||
/* XXX validate skb->priority, remove
|
||||
* mask */
|
||||
|
@ -6201,7 +6198,7 @@ ath_rx_tasklet(TQUEUE_ARG data)
|
|||
#if 0
|
||||
/* XXX revalidate MIC, lookup ni to find VAP */
|
||||
ieee80211_notify_michael_failure(ic,
|
||||
(struct ieee80211_frame *) skb->data,
|
||||
(struct ieee80211_frame *)skb->data,
|
||||
sc->sc_splitmic ?
|
||||
rs->rs_keyix - 32 : rs->rs_keyix
|
||||
);
|
||||
|
@ -6314,12 +6311,11 @@ rx_accept:
|
|||
* add the node to the mapping table if possible.
|
||||
*/
|
||||
ni = ieee80211_find_rxnode(ic,
|
||||
(const struct ieee80211_frame_min *) skb->data);
|
||||
(const struct ieee80211_frame_min *)skb->data);
|
||||
if (ni != NULL) {
|
||||
struct ath_node *an = ATH_NODE(ni);
|
||||
ieee80211_keyix_t keyix;
|
||||
|
||||
ATH_RSSI_LPF(an->an_avgrssi, rs->rs_rssi);
|
||||
ATH_RSSI_LPF(ATH_NODE(ni)->an_avgrssi, rs->rs_rssi);
|
||||
type = ieee80211_input(ni, skb, rs->rs_rssi, bf->bf_tsf);
|
||||
/*
|
||||
* If the station has a key cache slot assigned
|
||||
|
@ -6329,7 +6325,6 @@ rx_accept:
|
|||
if (keyix != IEEE80211_KEYIX_NONE &&
|
||||
sc->sc_keyixmap[keyix] == NULL)
|
||||
sc->sc_keyixmap[keyix] = ieee80211_ref_node(ni);
|
||||
an = NULL;
|
||||
ieee80211_unref_node(&ni);
|
||||
} else
|
||||
type = ieee80211_input_all(ic, skb, rs->rs_rssi, bf->bf_tsf);
|
||||
|
@ -6679,7 +6674,7 @@ static void ath_grppoll_start(struct ieee80211vap *vap, int pollcount)
|
|||
flags |= HAL_TXDESC_CTSENA;
|
||||
type = HAL_PKT_TYPE_GRP_POLL;
|
||||
}
|
||||
if (i == 0 && amode == HAL_ANTENNA_FIXED_A ) {
|
||||
if (i == 0 && amode == HAL_ANTENNA_FIXED_A) {
|
||||
flags |= HAL_TXDESC_CLRDMASK;
|
||||
head = bf;
|
||||
}
|
||||
|
@ -7181,12 +7176,12 @@ ath_tx_start(struct net_device *dev, struct ieee80211_node *ni,
|
|||
u_int8_t antenna;
|
||||
struct ieee80211_mrr mrr;
|
||||
|
||||
wh = (struct ieee80211_frame *) skb->data;
|
||||
wh = (struct ieee80211_frame *)skb->data;
|
||||
isprot = wh->i_fc[1] & IEEE80211_FC1_PROT;
|
||||
ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1);
|
||||
hdrlen = ieee80211_anyhdrsize(wh);
|
||||
istxfrag = (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) ||
|
||||
(((le16toh(*(__le16 *) &wh->i_seq[0]) >>
|
||||
(((le16toh(*(__le16 *)&wh->i_seq[0]) >>
|
||||
IEEE80211_SEQ_FRAG_SHIFT) & IEEE80211_SEQ_FRAG_MASK) > 0);
|
||||
|
||||
pktlen = skb->len;
|
||||
|
@ -7297,7 +7292,7 @@ ath_tx_start(struct net_device *dev, struct ieee80211_node *ni,
|
|||
/* setup descriptors */
|
||||
ds = bf->bf_desc;
|
||||
#ifdef ATH_SUPERG_XR
|
||||
if (vap->iv_flags & IEEE80211_F_XR )
|
||||
if (vap->iv_flags & IEEE80211_F_XR)
|
||||
rt = sc->sc_xr_rates;
|
||||
else
|
||||
rt = sc->sc_currates;
|
||||
|
@ -7415,7 +7410,7 @@ ath_tx_start(struct net_device *dev, struct ieee80211_node *ni,
|
|||
}
|
||||
|
||||
#ifdef ATH_SUPERG_XR
|
||||
if (vap->iv_flags & IEEE80211_F_XR ) {
|
||||
if (vap->iv_flags & IEEE80211_F_XR) {
|
||||
txq = sc->sc_xrtxq;
|
||||
if (!txq)
|
||||
txq = sc->sc_ac2q[WME_AC_BK];
|
||||
|
@ -8432,7 +8427,7 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
|
|||
static void
|
||||
ath_mib_enable(unsigned long arg)
|
||||
{
|
||||
struct ath_softc *sc = (struct ath_softc *) arg;
|
||||
struct ath_softc *sc = (struct ath_softc *)arg;
|
||||
|
||||
sc->sc_imask |= HAL_INT_MIB;
|
||||
ath_hal_intrset(sc->sc_ah, sc->sc_imask);
|
||||
|
@ -8445,7 +8440,7 @@ ath_mib_enable(unsigned long arg)
|
|||
static void
|
||||
ath_calibrate(unsigned long arg)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *) arg;
|
||||
struct net_device *dev = (struct net_device *)arg;
|
||||
struct ath_softc *sc = dev->priv;
|
||||
struct ath_hal *ah = sc->sc_ah;
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
|
@ -8497,7 +8492,7 @@ ath_calibrate(unsigned long arg)
|
|||
|
||||
DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: channel %u/%x -- IQ %s.\n",
|
||||
__func__, sc->sc_curchan.channel, sc->sc_curchan.channelFlags,
|
||||
isIQdone ? "done" : "not done" );
|
||||
isIQdone ? "done" : "not done");
|
||||
|
||||
sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ);
|
||||
add_timer(&sc->sc_cal_ch);
|
||||
|
@ -8616,7 +8611,8 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
* disable beacon interrupts.
|
||||
*/
|
||||
TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) {
|
||||
if (tmpvap != vap && tmpvap->iv_state == IEEE80211_S_RUN )
|
||||
if ((tmpvap != vap) &&
|
||||
(tmpvap->iv_state == IEEE80211_S_RUN))
|
||||
break;
|
||||
}
|
||||
if (!tmpvap) {
|
||||
|
@ -8658,7 +8654,7 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
ath_hal_setassocid(ah, sc->sc_curbssid, sc->sc_curaid);
|
||||
|
||||
if ((vap->iv_opmode != IEEE80211_M_STA) &&
|
||||
(vap->iv_flags & IEEE80211_F_PRIVACY)) {
|
||||
(vap->iv_flags & IEEE80211_F_PRIVACY)) {
|
||||
for (i = 0; i < IEEE80211_WEP_NKID; i++)
|
||||
if (ath_hal_keyisvalid(ah, i))
|
||||
ath_hal_keysetmac(ah, i, ni->ni_bssid);
|
||||
|
@ -8703,8 +8699,8 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
/* Set default key index for static wep case */
|
||||
ni->ni_ath_defkeyindex = IEEE80211_INVAL_DEFKEY;
|
||||
if (((vap->iv_flags & IEEE80211_F_WPA) == 0) &&
|
||||
(ni->ni_authmode != IEEE80211_AUTH_8021X) &&
|
||||
(vap->iv_def_txkey != IEEE80211_KEYIX_NONE)) {
|
||||
(ni->ni_authmode != IEEE80211_AUTH_8021X) &&
|
||||
(vap->iv_def_txkey != IEEE80211_KEYIX_NONE)) {
|
||||
ni->ni_ath_defkeyindex = vap->iv_def_txkey;
|
||||
}
|
||||
|
||||
|
@ -8723,8 +8719,9 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
* needs to be reconfigured.
|
||||
*/
|
||||
TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) {
|
||||
if (tmpvap != vap && tmpvap->iv_state == IEEE80211_S_RUN &&
|
||||
tmpvap->iv_opmode == IEEE80211_M_HOSTAP)
|
||||
if ((tmpvap != vap) &&
|
||||
(tmpvap->iv_state == IEEE80211_S_RUN) &&
|
||||
(tmpvap->iv_opmode == IEEE80211_M_HOSTAP))
|
||||
break;
|
||||
}
|
||||
if (!tmpvap)
|
||||
|
@ -8732,14 +8729,13 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
break;
|
||||
case IEEE80211_M_STA:
|
||||
#ifdef ATH_SUPERG_COMP
|
||||
/* have we negotiated compression? */
|
||||
/* Have we negotiated compression? */
|
||||
if (!(vap->iv_ath_cap & ni->ni_ath_flags & IEEE80211_NODE_COMP))
|
||||
ni->ni_ath_flags &= ~IEEE80211_NODE_COMP;
|
||||
#endif
|
||||
/*
|
||||
* Allocate a key cache slot to the station.
|
||||
*/
|
||||
/* Allocate a key cache slot to the station. */
|
||||
ath_setup_keycacheslot(sc, ni);
|
||||
|
||||
/*
|
||||
* Record negotiated dynamic turbo state for
|
||||
* use by rate control modules.
|
||||
|
@ -8786,7 +8782,7 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
|
|||
sc->sc_halstats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER;
|
||||
/* if it is a DFS channel and has not been checked for radar
|
||||
* do not let the 80211 state machine to go to RUN state. */
|
||||
if (sc->sc_dfswait && vap->iv_opmode == IEEE80211_M_HOSTAP ) {
|
||||
if (sc->sc_dfswait && vap->iv_opmode == IEEE80211_M_HOSTAP) {
|
||||
/* push the VAP to RUN state once DFS is cleared */
|
||||
DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s: VAP -> DFS_WAIT\n",
|
||||
__func__, DEV_NAME(dev));
|
||||
|
@ -8816,18 +8812,16 @@ done:
|
|||
/* Invoke the parent method to complete the work. */
|
||||
error = avp->av_newstate(vap, nstate, arg);
|
||||
|
||||
/* Finally, start any timers. */
|
||||
if (nstate == IEEE80211_S_RUN) {
|
||||
/* start periodic recalibration timer */
|
||||
mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ));
|
||||
}
|
||||
|
||||
#ifdef ATH_SUPERG_XR
|
||||
if (vap->iv_flags & IEEE80211_F_XR &&
|
||||
nstate == IEEE80211_S_RUN)
|
||||
ATH_SETUP_XR_VAP(sc, vap, rfilt);
|
||||
if (vap->iv_flags & IEEE80211_F_XR &&
|
||||
nstate == IEEE80211_S_INIT && sc->sc_xrgrppoll)
|
||||
/* Finally, restart the periodic recalibration timer */
|
||||
if (nstate == IEEE80211_S_RUN)
|
||||
mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ));
|
||||
|
||||
#ifdef ATH_SUPERG_XR
|
||||
if ((vap->iv_flags & IEEE80211_F_XR) &&
|
||||
(nstate == IEEE80211_S_RUN))
|
||||
ATH_SETUP_XR_VAP(sc, vap, rfilt);
|
||||
if ((vap->iv_flags & IEEE80211_F_XR) &&
|
||||
(nstate == IEEE80211_S_INIT) && (sc->sc_xrgrppoll))
|
||||
ath_grppoll_stop(vap);
|
||||
#endif
|
||||
bad:
|
||||
|
@ -8843,7 +8837,7 @@ bad:
|
|||
*
|
||||
* Context: Timer (softIRQ) */
|
||||
static void
|
||||
ath_check_dfs_clear(unsigned long data )
|
||||
ath_check_dfs_clear(unsigned long data)
|
||||
{
|
||||
struct ath_softc *sc = (struct ath_softc *)data;
|
||||
struct ieee80211com *ic = &sc->sc_ic;
|
||||
|
@ -8881,7 +8875,7 @@ ath_check_dfs_clear(unsigned long data )
|
|||
mod_timer(&sc->sc_cal_ch, jiffies +
|
||||
(ath_calinterval * HZ));
|
||||
#ifdef ATH_SUPERG_XR
|
||||
if (vap->iv_flags & IEEE80211_F_XR ) {
|
||||
if (vap->iv_flags & IEEE80211_F_XR) {
|
||||
u_int32_t rfilt = 0;
|
||||
rfilt = ath_calcrxfilter(sc);
|
||||
ATH_SETUP_XR_VAP(sc, vap, rfilt);
|
||||
|
@ -9213,7 +9207,7 @@ ath_getchannels(struct net_device *dev, u_int cc,
|
|||
static void
|
||||
ath_led_done(unsigned long arg)
|
||||
{
|
||||
struct ath_softc *sc = (struct ath_softc *) arg;
|
||||
struct ath_softc *sc = (struct ath_softc *)arg;
|
||||
|
||||
sc->sc_blinking = 0;
|
||||
}
|
||||
|
@ -9225,7 +9219,7 @@ ath_led_done(unsigned long arg)
|
|||
static void
|
||||
ath_led_off(unsigned long arg)
|
||||
{
|
||||
struct ath_softc *sc = (struct ath_softc *) arg;
|
||||
struct ath_softc *sc = (struct ath_softc *)arg;
|
||||
|
||||
ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon);
|
||||
sc->sc_ledtimer.function = ath_led_done;
|
||||
|
@ -9815,7 +9809,7 @@ ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
|||
if (!capable(CAP_NET_ADMIN))
|
||||
error = -EPERM;
|
||||
else
|
||||
error = ath_ioctl_diag(sc, (struct ath_diag *) ifr);
|
||||
error = ath_ioctl_diag(sc, (struct ath_diag *)ifr);
|
||||
break;
|
||||
case SIOCETHTOOL:
|
||||
if (copy_from_user(&cmd, ifr->ifr_data, sizeof(cmd)))
|
||||
|
|
|
@ -155,7 +155,7 @@ ahb_disable_wmac(u_int16_t devid, u_int16_t wlanNum)
|
|||
((devid & AR5315_REV_MAJ_M) == AR5317_REV_MAJ)) {
|
||||
u_int32_t *en = (u_int32_t *) AR5315_AHB_ARB_CTL;
|
||||
|
||||
KASSERT(wlanNum == 0, ("invalid wlan # %d", wlanNum) );
|
||||
KASSERT(wlanNum == 0, ("invalid wlan # %d", wlanNum));
|
||||
|
||||
/* Enable Arbitration for WLAN */
|
||||
*en &= ~AR5315_ARB_WLAN;
|
||||
|
|
|
@ -503,9 +503,13 @@ struct ieee80211_wme_param {
|
|||
#define WME_CAPINFO_UAPSD_MAXSP_SHIFT 5
|
||||
#define WME_CAPINFO_UAPSD_MAXSP_MASK 0x3
|
||||
#define WME_CAPINFO_IE_OFFSET 8
|
||||
#define WME_UAPSD_MAXSP(_qosinfo) (((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & WME_CAPINFO_UAPSD_MAXSP_MASK)
|
||||
#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) ( (1<<(3 - (_ac))) & \
|
||||
(((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & WME_CAPINFO_UAPSD_ACFLAGS_MASK) )
|
||||
#define WME_UAPSD_MAXSP(_qosinfo) \
|
||||
(((_qosinfo) >> WME_CAPINFO_UAPSD_MAXSP_SHIFT) & \
|
||||
WME_CAPINFO_UAPSD_MAXSP_MASK)
|
||||
#define WME_UAPSD_AC_ENABLED(_ac, _qosinfo) \
|
||||
((1 << (3 - (_ac))) & ( \
|
||||
((_qosinfo) >> WME_CAPINFO_UAPSD_ACFLAGS_SHIFT) & \
|
||||
WME_CAPINFO_UAPSD_ACFLAGS_MASK))
|
||||
|
||||
/*
|
||||
* Atheros Advanced Capability information element.
|
||||
|
|
|
@ -1146,7 +1146,7 @@ ieee80211_deliver_data(struct ieee80211_node *ni, struct sk_buff *skb)
|
|||
skb1->protocol = __constant_htons(ETH_P_802_2);
|
||||
/* XXX insert vlan tag before queue it? */
|
||||
ni_tmp = SKB_CB(skb1)->ni; /* remember node so we can free it */
|
||||
if ( dev_queue_xmit(skb1) == NET_XMIT_DROP ) {
|
||||
if (dev_queue_xmit(skb1) == NET_XMIT_DROP) {
|
||||
/* If queue dropped the packet because device was
|
||||
* too busy */
|
||||
vap->iv_devstats.tx_dropped++;
|
||||
|
@ -1659,7 +1659,7 @@ bad:
|
|||
IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID, \
|
||||
wh, ieee80211_mgt_subtype_name[subtype >> \
|
||||
IEEE80211_FC0_SUBTYPE_SHIFT], \
|
||||
"%s", "no " #__elem ); \
|
||||
"%s", "no " #__elem); \
|
||||
vap->iv_stats.is_rx_elem_missing++; \
|
||||
return; \
|
||||
} \
|
||||
|
@ -3024,7 +3024,7 @@ ieee80211_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb,
|
|||
* XR vap does not process probe requests.
|
||||
*/
|
||||
#ifdef ATH_SUPERG_XR
|
||||
if (vap->iv_flags & IEEE80211_F_XR )
|
||||
if (vap->iv_flags & IEEE80211_F_XR)
|
||||
return;
|
||||
#endif
|
||||
/*
|
||||
|
|
|
@ -329,7 +329,7 @@ ieee80211_notify_replay_failure(struct ieee80211vap *vap,
|
|||
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2,
|
||||
"%s replay detected <keyix %d, rsc %llu >",
|
||||
k->wk_cipher->ic_name, k->wk_keyix,
|
||||
(unsigned long long)rsc );
|
||||
(unsigned long long)rsc);
|
||||
|
||||
/* TODO: needed parameters: count, keyid, key type, src address, TSC */
|
||||
snprintf(buf, sizeof(buf), "%s(keyid=%d %scast addr=%s)", tag,
|
||||
|
|
|
@ -345,7 +345,7 @@ ieee80211_input_monitor(struct ieee80211com *ic, struct sk_buff *skb,
|
|||
/* Accept PHY, CRC and decrypt errors. Discard the rest. */
|
||||
if (bf->bf_dsstatus.ds_rxstat.rs_status &~
|
||||
(HAL_RXERR_DECRYPT | HAL_RXERR_MIC |
|
||||
HAL_RXERR_PHY | HAL_RXERR_CRC ))
|
||||
HAL_RXERR_PHY | HAL_RXERR_CRC))
|
||||
continue;
|
||||
|
||||
/* We can't use addr1 to determine direction at this point */
|
||||
|
@ -539,7 +539,8 @@ ieee80211_input_monitor(struct ieee80211com *ic, struct sk_buff *skb,
|
|||
}
|
||||
|
||||
th->wr_dbm_antnoise = (int8_t) noise;
|
||||
th->wr_dbm_antsignal = th->wr_dbm_antnoise + rssi;
|
||||
th->wr_dbm_antsignal =
|
||||
th->wr_dbm_antnoise + rssi;
|
||||
th->wr_antenna = antenna;
|
||||
th->wr_antsignal = rssi;
|
||||
|
||||
|
@ -549,21 +550,24 @@ ieee80211_input_monitor(struct ieee80211com *ic, struct sk_buff *skb,
|
|||
}
|
||||
case ARPHRD_IEEE80211_ATHDESC: {
|
||||
if (skb_headroom(skb1) < ATHDESC_HEADER_SIZE) {
|
||||
printk("%s:%d %s\n", __FILE__, __LINE__, __func__);
|
||||
printk("%s:%d %s\n", __FILE__,
|
||||
__LINE__, __func__);
|
||||
ieee80211_dev_kfree_skb(&skb1);
|
||||
break;
|
||||
}
|
||||
memcpy(skb_push(skb1, ATHDESC_HEADER_SIZE), ds, ATHDESC_HEADER_SIZE);
|
||||
memcpy(skb_push(skb1, ATHDESC_HEADER_SIZE),
|
||||
ds, ATHDESC_HEADER_SIZE);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (skb1 != NULL) {
|
||||
struct ieee80211_node *ni_tmp;
|
||||
if (!tx && (vap->iv_dev->type != ARPHRD_IEEE80211_RADIOTAP) && (skb1->len >= IEEE80211_CRC_LEN)) {
|
||||
/* Remove FCS from end of rx frames when
|
||||
* delivering to non-Radiotap VAPs */
|
||||
if (!tx && (skb1->len >= IEEE80211_CRC_LEN) &&
|
||||
(vap->iv_dev->type !=
|
||||
ARPHRD_IEEE80211_RADIOTAP)) {
|
||||
/* Remove FCS from end of RX frames when
|
||||
* delivering to non-Radiotap VAPs. */
|
||||
skb_trim(skb1, skb1->len - IEEE80211_CRC_LEN);
|
||||
}
|
||||
skb1->dev = dev; /* NB: deliver to wlanX */
|
||||
|
@ -571,18 +575,18 @@ ieee80211_input_monitor(struct ieee80211com *ic, struct sk_buff *skb,
|
|||
|
||||
skb1->ip_summed = CHECKSUM_NONE;
|
||||
skb1->pkt_type = pkttype;
|
||||
skb1->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */
|
||||
skb1->protocol =
|
||||
__constant_htons(0x0019); /* ETH_P_80211_RAW */
|
||||
|
||||
ni_tmp = SKB_CB(skb1)->ni;
|
||||
if (netif_rx(skb1) == NET_RX_DROP) {
|
||||
/* If netif_rx dropped the packet because
|
||||
* device was too busy */
|
||||
if (ni_tmp != NULL) {
|
||||
/* node reference was leaked */
|
||||
ieee80211_unref_node(&ni_tmp);
|
||||
}
|
||||
* device was too busy, reclaim the ref. in
|
||||
* the skb. */
|
||||
if (SKB_CB(skb1)->ni != NULL)
|
||||
ieee80211_unref_node(&SKB_CB(skb1)->ni);
|
||||
vap->iv_devstats.rx_dropped++;
|
||||
}
|
||||
|
||||
vap->iv_devstats.rx_packets++;
|
||||
vap->iv_devstats.rx_bytes += skb1->len;
|
||||
}
|
||||
|
|
|
@ -614,8 +614,8 @@ ieee80211_sta_join1(struct ieee80211_node *selbs)
|
|||
* Check if old+new node have the same ssid in which
|
||||
* case we can reassociate when operating in sta mode.
|
||||
*/
|
||||
canreassoc = (obss != NULL &&
|
||||
vap->iv_state == IEEE80211_S_RUN && ssid_equal(obss, selbs));
|
||||
canreassoc = ((obss != NULL) &&
|
||||
(vap->iv_state == IEEE80211_S_RUN) && ssid_equal(obss, selbs));
|
||||
vap->iv_bss = selbs;
|
||||
if (obss != NULL)
|
||||
ieee80211_unref_node(&obss);
|
||||
|
@ -734,8 +734,8 @@ ieee80211_sta_leave(struct ieee80211_node *ni)
|
|||
struct ieee80211vap *vap = ni->ni_vap;
|
||||
|
||||
/* WDS/Repeater: Stop software beacon timer for STA */
|
||||
if (vap->iv_opmode == IEEE80211_M_STA &&
|
||||
vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS) {
|
||||
if ((vap->iv_opmode == IEEE80211_M_STA) &&
|
||||
(vap->iv_flags_ext & IEEE80211_FEXT_SWBMISS)) {
|
||||
del_timer(&vap->iv_swbmiss);
|
||||
}
|
||||
|
||||
|
|
|
@ -187,12 +187,15 @@ MALLOC_DECLARE(M_80211_NODE);
|
|||
#define IEEE80211_NODE_STAT_ADD(ni,stat,v) (ni->ni_stats.ns_##stat += v)
|
||||
#define IEEE80211_NODE_STAT_SET(ni,stat,v) (ni->ni_stats.ns_##stat = v)
|
||||
|
||||
#define WME_UAPSD_AC_CAN_TRIGGER(_ac, _ni) ( \
|
||||
((_ni)->ni_flags & IEEE80211_NODE_UAPSD_TRIG) && WME_UAPSD_AC_ENABLED((_ac), (_ni)->ni_uapsd) )
|
||||
#define WME_UAPSD_AC_CAN_TRIGGER(_ac, _ni) ( \
|
||||
((_ni)->ni_flags & IEEE80211_NODE_UAPSD_TRIG) && \
|
||||
WME_UAPSD_AC_ENABLED((_ac), (_ni)->ni_uapsd))
|
||||
#define WME_UAPSD_NODE_MAXQDEPTH 8
|
||||
#define IEEE80211_NODE_UAPSD_USETIM(_ni) (((_ni)->ni_uapsd & 0xF) == 0xF )
|
||||
#define IEEE80211_NODE_UAPSD_USETIM(_ni) (((_ni)->ni_uapsd & 0xF) == 0xF)
|
||||
#define WME_UAPSD_NODE_INVALIDSEQ 0xffff
|
||||
#define WME_UAPSD_NODE_TRIGSEQINIT(_ni) (memset(&(_ni)->ni_uapsd_trigseq[0], 0xff, sizeof((_ni)->ni_uapsd_trigseq)))
|
||||
#define WME_UAPSD_NODE_TRIGSEQINIT(_ni) \
|
||||
(memset(&(_ni)->ni_uapsd_trigseq[0], \
|
||||
0xff, sizeof((_ni)->ni_uapsd_trigseq)))
|
||||
|
||||
void ieee80211_node_attach(struct ieee80211com *);
|
||||
void ieee80211_node_detach(struct ieee80211com *);
|
||||
|
|
|
@ -320,7 +320,7 @@ void ieee80211_parent_queue_xmit(struct sk_buff *skb) {
|
|||
skb->dev = vap->iv_ic->ic_dev;
|
||||
|
||||
ni = SKB_CB(skb)->ni;
|
||||
if ( dev_queue_xmit(skb) == NET_XMIT_DROP ) {
|
||||
if (dev_queue_xmit(skb) == NET_XMIT_DROP) {
|
||||
/* If queue dropped the packet because device was
|
||||
* too busy */
|
||||
vap->iv_devstats.tx_dropped++;
|
||||
|
@ -1754,7 +1754,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni,
|
|||
ether_sprintf(wh->i_addr1),
|
||||
ieee80211_chan2ieee(ic, ic->ic_curchan));
|
||||
|
||||
(void) ic->ic_mgtstart(ic, skb);
|
||||
(void)ic->ic_mgtstart(ic, skb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -407,7 +407,7 @@ ieee80211_fix_rate(struct ieee80211_node *ni, int flags)
|
|||
srs = &ic->ic_sup_rates[ieee80211_chan2mode(ni->ni_chan)];
|
||||
nrs = &ni->ni_rates;
|
||||
fixedrate = IEEE80211_FIXED_RATE_NONE;
|
||||
for (i = 0; i < nrs->rs_nrates; ) {
|
||||
for (i = 0; i < nrs->rs_nrates;) {
|
||||
ignore = 0;
|
||||
if (flags & IEEE80211_F_DOSORT) {
|
||||
/*
|
||||
|
@ -1268,7 +1268,8 @@ __ieee80211_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int
|
|||
ieee80211_state_name[ostate], ieee80211_state_name[nstate]);
|
||||
vap->iv_state = nstate; /* state transition */
|
||||
del_timer(&vap->iv_mgtsend);
|
||||
if (vap->iv_opmode != IEEE80211_M_HOSTAP && ostate != IEEE80211_S_SCAN)
|
||||
if ((vap->iv_opmode != IEEE80211_M_HOSTAP) &&
|
||||
(ostate != IEEE80211_S_SCAN))
|
||||
ieee80211_cancel_scan(vap); /* background scan */
|
||||
ni = vap->iv_bss; /* NB: no reference held */
|
||||
switch (nstate) {
|
||||
|
@ -1682,11 +1683,11 @@ ieee80211_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int ar
|
|||
break;
|
||||
|
||||
case IEEE80211_S_RUN:
|
||||
if (ostate == IEEE80211_S_SCAN || /* AP coming out of scan */
|
||||
vap->iv_opmode == IEEE80211_M_STA) { /* STA in WDS/Repeater needs to bring up other VAPs */
|
||||
if ((ostate == IEEE80211_S_SCAN) || /* AP coming out of scan */
|
||||
(vap->iv_opmode == IEEE80211_M_STA)) { /* STA in WDS/Repeater needs to bring up other VAPs */
|
||||
__ieee80211_newstate(vap, nstate, arg);
|
||||
|
||||
/* bring up all other vaps pending on the scan*/
|
||||
/* bring up all other vaps pending on the scan */
|
||||
TAILQ_FOREACH(tmpvap, &ic->ic_vaps, iv_next) {
|
||||
if (vap != tmpvap) {
|
||||
if (tmpvap->iv_flags_ext & IEEE80211_FEXT_SCAN_PENDING) {
|
||||
|
@ -1700,7 +1701,7 @@ ieee80211_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int ar
|
|||
break;
|
||||
|
||||
case IEEE80211_S_INIT:
|
||||
if (ostate == IEEE80211_S_INIT && vap->iv_flags_ext & IEEE80211_FEXT_SCAN_PENDING)
|
||||
if (ostate == IEEE80211_S_INIT)
|
||||
vap->iv_flags_ext &= ~IEEE80211_FEXT_SCAN_PENDING;
|
||||
/* fall through */
|
||||
|
||||
|
|
|
@ -212,15 +212,15 @@ struct wmeParams {
|
|||
|
||||
struct chanAccParams{
|
||||
/* XXX: is there any reason to have multiple instances of cap_info_count??? */
|
||||
u_int8_t cap_info_count; /* ver. of the current param set */
|
||||
struct wmeParams cap_wmeParams[WME_NUM_AC]; /*WME params for each access class */
|
||||
u_int8_t cap_info_count; /* ver. of the current param set */
|
||||
struct wmeParams cap_wmeParams[WME_NUM_AC]; /* WME params for each access class */
|
||||
};
|
||||
|
||||
struct ieee80211_wme_state {
|
||||
u_int32_t wme_flags;
|
||||
#define WME_F_AGGRMODE 0x00000001 /* STATUS: WME aggressive mode */
|
||||
|
||||
u_int wme_hipri_traffic; /* VI/VO frames in beacon interval */
|
||||
u_int wme_hipri_traffic; /* VI/VO frames in beacon interval */
|
||||
u_int wme_hipri_switch_thresh; /* aggressive mode switch threshold */
|
||||
u_int wme_hipri_switch_hysteresis; /* aggressive mode switch hysteresis */
|
||||
|
||||
|
|
|
@ -645,7 +645,7 @@ scan_next(unsigned long arg)
|
|||
|
||||
again:
|
||||
scandone = (ss->ss_next >= ss->ss_last) ||
|
||||
(SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0;
|
||||
((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0);
|
||||
scanend = SCAN_PRIVATE(ss)->ss_scanend;
|
||||
if (!scandone &&
|
||||
(ss->ss_flags & IEEE80211_SCAN_GOTPICK) == 0 &&
|
||||
|
@ -719,8 +719,8 @@ again:
|
|||
if (scandone)
|
||||
ic->ic_lastscan = jiffies;
|
||||
/* return to the bss channel */
|
||||
if (ic->ic_bsschan != IEEE80211_CHAN_ANYC &&
|
||||
ic->ic_curchan != ic->ic_bsschan)
|
||||
if ((ic->ic_bsschan != IEEE80211_CHAN_ANYC) &&
|
||||
(ic->ic_curchan != ic->ic_bsschan))
|
||||
change_channel(ic, ic->ic_bsschan);
|
||||
/* clear internal flags and any indication of a pick */
|
||||
SCAN_PRIVATE(ss)->ss_iflags &= ~ISCAN_REP;
|
||||
|
|
|
@ -908,7 +908,7 @@ notfound:
|
|||
st->st_action = ss->ss_ops->scan_default;
|
||||
if (action)
|
||||
st->st_action = action;
|
||||
if ((selbss = select_bss(ss, vap)) == NULL ) {
|
||||
if ((selbss = select_bss(ss, vap)) == NULL) {
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
|
||||
"%s: select_bss failed\n", __func__);
|
||||
goto notfound;
|
||||
|
@ -1300,7 +1300,7 @@ adhoc_pick_bss(struct ieee80211_scan_state *ss, struct ieee80211vap *vap,
|
|||
*/
|
||||
/* NB: unlocked read should be ok */
|
||||
if (TAILQ_FIRST(&st->st_entry) == NULL ||
|
||||
(selbs = select_bss(ss, vap)) == NULL ) {
|
||||
(selbs = select_bss(ss, vap)) == NULL) {
|
||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
|
||||
"%s: no scan candidate\n", __func__);
|
||||
if (vap->iv_des_nssid) {
|
||||
|
|
|
@ -4173,7 +4173,7 @@ get_sta_info(void *arg, struct ieee80211_node *ni)
|
|||
si->isi_rxseqs[0] = ni->ni_rxseqs[0];
|
||||
}
|
||||
si->isi_uapsd = ni->ni_uapsd;
|
||||
if ( vap == req->vap->iv_xrvap)
|
||||
if (vap == req->vap->iv_xrvap)
|
||||
si->isi_opmode = IEEE80211_STA_OPMODE_XR;
|
||||
else
|
||||
si->isi_opmode = IEEE80211_STA_OPMODE_NORMAL;
|
||||
|
|
|
@ -146,7 +146,7 @@ main(int argc, char *argv[])
|
|||
strncpy(ifr.ifr_name, argv[4], IFNAMSIZ);
|
||||
argc--;
|
||||
argv++;
|
||||
} else if (strcmp(argv[3], "nounit" ) == 0) {
|
||||
} else if (strcmp(argv[3], "nounit") == 0) {
|
||||
bnounit = 1;
|
||||
} else {
|
||||
int flag = getflag(argv[3]);
|
||||
|
|
Loading…
Reference in New Issue