commit 7bf450afe8809a2dbe42f341930b6017dbf9e154 Author: Jiri Slaby Date: Thu Jul 19 08:41:35 2007 +0200 get rid of BLE eve in old if_ath.c diff --git a/ath/if_ath.c b/ath/if_ath.c index 57f48ac..d0a4b9e 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -83,7 +83,6 @@ static void ath_radar_tasklet(unsigned long data) { struct ieee80211_hw *hw = (void *)data; -#ifdef BLE struct ath_softc *sc = dev->priv; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_channel *c; @@ -100,7 +99,6 @@ ath_radar_tasklet(unsigned long data) ic->ic_des_chan = c; ic->ic_ibss_chan = c; ieee80211_new_state (ic, IEEE80211_S_INIT, -1); -#endif ath_init(hw); } @@ -116,7 +114,6 @@ ath_rxorn_tasklet(unsigned long data) static void ath_bmiss_tasklet(unsigned long data) { -#ifdef BLE struct ieee80211_hw *dev = (void *)data; struct ath_softc *sc = dev->priv; struct ieee80211com *ic = &sc->sc_ic; @@ -150,13 +147,11 @@ ath_bmiss_tasklet(unsigned long data) IEEE80211_FC0_SUBTYPE_PROBE_REQ, 0); } } -#endif } #define NUM_RADIOTAP_ELEMENTS 18 -#ifdef BLE static int radiotap_elem_to_bytes[NUM_RADIOTAP_ELEMENTS] = {8, /* IEEE80211_RADIOTAP_TSFT */ 1, /* IEEE80211_RADIOTAP_FLAGS */ @@ -634,7 +629,7 @@ ath_setslottime(struct ath_softc *sc) } sc->sc_updateslot = OK; } -#ifdef BLE + /* * Callback from the 802.11 layer to update the * slot time based on the current setting. @@ -675,7 +670,6 @@ ath_beaconq_config(struct ath_softc *sc) qi.tqi_cw_min = ATH_BEACON_CWMIN_DEFAULT; qi.tqi_cw_max = ATH_BEACON_CWMAX_DEFAULT; } else { -#ifdef BLE struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE]; /* @@ -684,7 +678,6 @@ ath_beaconq_config(struct ath_softc *sc) qi.tqi_aifs = wmep->wmep_aifsn; qi.tqi_cw_min = 2*ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmin); qi.tqi_cw_max = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); -#endif } if (!ath5k_hw_setup_tx_queueprops(ah, sc->sc_bhalq, &qi)) { @@ -739,7 +732,7 @@ ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) return 0; // TODO: return value } -#endif + /* * Setup the beacon frame for transmit. */ @@ -794,12 +787,10 @@ ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf, * Calculate rate code. * XXX everything at min xmit rate */ -#ifdef BLE if (USE_SHPREAMBLE(ic)) rate = an->an_tx_mgtratesp; else rate = an->an_tx_mgtrate; -#endif rate = 0; ah->ah_setup_tx_desc(ah, ds , skb->len + FCS_LEN /* frame length */ @@ -886,7 +877,6 @@ ath_beacon_send(struct net_device *dev) */ skb = bf->bf_skb; ncabq = sc->sc_cabq->axq_depth; -#ifdef BLE if (ieee80211_beacon_update(ic, bf->bf_node, &sc->sc_boff, skb, ncabq)) { DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s: update, beacon len changed %d to %d\n", @@ -903,7 +893,6 @@ ath_beacon_send(struct net_device *dev) return; } } -#endif /* * Handle slot time change when a non-ERP station joins/leaves @@ -956,11 +945,10 @@ ath_beacon_send(struct net_device *dev) * * NB: only at DTIM */ -#ifdef BLE if (sc->sc_opmode == IEEE80211_IF_TYPE_AP && ncabq > 0 && sc->sc_boff.bo_tim[4] & 1) ath5k_hw_tx_start(ah, sc->sc_cabq->axq_qnum); -#endif + ath5k_hw_put_tx_buf(ah, sc->sc_bhalq, bf->bf_daddr); ath5k_hw_tx_start(ah, sc->sc_bhalq); DPRINTF(sc, ATH_DEBUG_BEACON_PROC, @@ -983,7 +971,7 @@ ath_bstuck_tasklet(unsigned long data) sc->sc_bmisscount); ath_reset(hw); } -#ifdef BLE + /* * Reclaim beacon resources. */ @@ -993,20 +981,19 @@ ath_beacon_free(struct ath_softc *sc) struct ath_buf *bf; bf = NULL; -// STAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { + STAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { if (bf->bf_skb != NULL) { bus_unmap_single(sc->sc_bdev, bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); dev_kfree_skb(bf->bf_skb); bf->bf_skb = NULL; } -#ifdef BLE + if (bf->bf_node != NULL) { ieee80211_free_node(bf->bf_node); bf->bf_node = NULL; } -#endif -// } + } } /* @@ -1352,7 +1339,6 @@ ath_tx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) bad: dev_kfree_skb(skb); } -#endif /* * Add additional headers to a received frame and netif_rx it on @@ -1361,7 +1347,6 @@ ath_tx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) static void ath_rx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) { -#ifdef BLE #define IS_QOS_DATA(wh) \ ((wh->i_fc[0] & (IEEE80211_FC0_TYPE_MASK|IEEE80211_FC0_SUBTYPE_MASK))==\ (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS)) @@ -1507,7 +1492,6 @@ ath_rx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) dev_kfree_skb(skb); return; #undef IS_QOS_DATA -#endif } /* @@ -1527,7 +1511,7 @@ ath_tsf_extend(struct ath_hal *ah, uint32_t rstamp) return ((tsf & ~(uint64_t)0x7fff) | rstamp); } -#ifdef BLE + /* * Intercept management frames to collect beacon rssi data * and to do ibss merges. @@ -1591,7 +1575,7 @@ ath_recv_mgmt(struct ieee80211com *ic, struct sk_buff *skb, break; } } -#endif + /* * Set the default antenna. */ @@ -1608,7 +1592,6 @@ ath_setdefantenna(struct ath_softc *sc, u_int antenna) sc->sc_rxotherant = 0; } -#ifdef BLE /* * Update WME parameters for a transmit queue. */ @@ -1760,158 +1743,6 @@ ath_tx_tasklet(unsigned long data) netif_wake_queue(&sc->sc_rawdev); } -#endif - -#ifdef BLE -static int -ath_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) -{ - struct net_device *dev = ic->ic_dev; - struct ath_softc *sc = dev->priv; - struct ath_hal *ah = sc->sc_ah; - struct ieee80211_node *ni; - int i, error; - const u_int8_t *bssid; - u_int32_t rfilt; - static const AR5K_LED_STATE leds[] = { - AR5K_LED_INIT, /* IEEE80211_S_INIT */ - AR5K_LED_SCAN, /* IEEE80211_S_SCAN */ - AR5K_LED_AUTH, /* IEEE80211_S_AUTH */ - AR5K_LED_ASSOC, /* IEEE80211_S_ASSOC */ - AR5K_LED_RUN, /* IEEE80211_S_RUN */ - }; - - DPRINTF(sc, ATH_DEBUG_STATE, "%s: %s -> %s\n", __func__, - ieee80211_state_name[ic->ic_state], - ieee80211_state_name[nstate]); - - del_timer(&sc->sc_scan_ch); /* ap/neighbor scan timer */ - del_timer(&sc->sc_cal_ch); /* periodic calibration timer */ - ath5k_hw_set_ledstate(ah, leds[nstate]); /* set LED */ - netif_stop_queue(dev); /* before we do anything else */ - if (sc->sc_rawdev_enabled) - netif_stop_queue(&sc->sc_rawdev); - - if (nstate == IEEE80211_S_INIT) { - sc->sc_imask &= ~(AR5K_INT_SWBA | AR5K_INT_BMISS); - /* - * NB: disable interrupts so we don't rx frames. - */ - ath5k_hw_set_intr(ah, sc->sc_imask &~ AR5K_INT_GLOBAL); - /* - * Notify the rate control algorithm. - */ - ath_rate_newstate(sc, nstate); - goto done; - } - ni = ic->ic_bss; - error = ath_chan_set(sc, ni->ni_chan); - if (error != 0) - goto bad; - rfilt = ath_calcrxfilter(sc, nstate); - if (nstate == IEEE80211_S_SCAN) - bssid = dev->broadcast; - else - bssid = ni->ni_bssid; - ath5k_hw_set_rx_filter(ah, rfilt); - DPRINTF(sc, ATH_DEBUG_STATE, "%s: RX filter 0x%x bssid %s\n", - __func__, rfilt, ether_sprintf(bssid)); - - if (nstate == IEEE80211_S_RUN && ic->ic_opmode == IEEE80211_M_STA) - ath5k_hw_set_associd(ah, bssid, ni->ni_associd); - else - ath5k_hw_set_associd(ah, bssid, 0); - if (ic->ic_flags & IEEE80211_F_PRIVACY) { - for (i = 0; i < IEEE80211_WEP_NKID; i++) - if (ath5k_hw_is_key_valid(ah, i)) - ath5k_hw_set_key_lladdr(ah, i, bssid); - } - - /* - * Notify the rate control algorithm so rates - * are setup should ath_beacon_alloc be called. - */ - ath_rate_newstate(sc, nstate); - - if (ic->ic_opmode == IEEE80211_M_MONITOR) { - /* nothing to do */; - } else if (nstate == IEEE80211_S_RUN) { - DPRINTF(sc, ATH_DEBUG_STATE, - "%s(RUN): ic_flags=0x%08x iv=%d bssid=%s " - "capinfo=0x%04x chan=%d\n" - , __func__ - , ic->ic_flags - , ni->ni_intval - , ether_sprintf(ni->ni_bssid) - , ni->ni_capinfo - , ieee80211_chan2ieee(ic, ni->ni_chan)); - - /* - * Allocate and setup the beacon frame for AP or adhoc mode. - */ - switch (ic->ic_opmode) { - case IEEE80211_M_HOSTAP: - case IEEE80211_M_IBSS: - /* - * Allocate and setup the beacon frame. - * - * Stop any previous beacon DMA. This may be - * necessary, for example, when an ibss merge - * causes reconfiguration; there will be a state - * transition from RUN->RUN that means we may - * be called with beacon transmission active. - */ - ath5k_hw_stop_tx_dma(ah, sc->sc_bhalq); - ath_beacon_free(sc); - error = ath_beacon_alloc(sc, ni); - if (error != 0) - goto bad; - break; - case IEEE80211_M_STA: - /* - * Allocate a key cache slot to the station. - */ - if ((ic->ic_flags & IEEE80211_F_PRIVACY) == 0 && - sc->sc_hasclrkey && - ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE) - ath_setup_stationkey(ni); - break; - default: - break; - } - - /* - * Configure the beacon and sleep timers. - */ - ath_beacon_config(sc); - } else { - ath5k_hw_set_intr(ah, - sc->sc_imask &~ (AR5K_INT_SWBA | AR5K_INT_BMISS)); - sc->sc_imask &= ~(AR5K_INT_SWBA | AR5K_INT_BMISS); - } -done: - /* - * Invoke the parent method to complete the work. - */ - error = sc->sc_newstate(ic, 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)); - } else if (nstate == IEEE80211_S_SCAN) { - /* start ap/neighbor scan timer */ - mod_timer(&sc->sc_scan_ch, - jiffies + ((HZ * ath_dwelltime) / 1000)); - } -bad: - netif_start_queue(dev); - if (sc->sc_rawdev_enabled) - netif_start_queue(&sc->sc_rawdev); - - return error; -} /* * Allocate a key cache slot to the station so we can @@ -2123,7 +1954,6 @@ ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) if (dev->flags & IFF_RUNNING) ath_mode_init(dev); break; -#ifdef BLE case SIOCGATHSTATS: /* NB: embed these numbers to get a consistent view */ sc->sc_stats.ast_tx_packets = ic->ic_devstats->tx_packets; @@ -2136,7 +1966,6 @@ ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) else error = 0; break; -#endif case SIOCGATHDIAG: if (!capable(CAP_NET_ADMIN)) error = -EPERM; @@ -2150,7 +1979,6 @@ ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) error = ath_ioctl_ethtool(sc, cmd, ifr->ifr_data); break; default: -#ifdef BLE error = ieee80211_ioctlx(ic, ifr, cmd); if (error == -ENETRESET) { if (IS_RUNNING(dev) && @@ -2160,14 +1988,13 @@ ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) } if (error == -ERESTART) error = IS_RUNNING(dev) ? ath_reset(dev) : 0; -#endif break; } ATH_UNLOCK(sc); return error; #undef IS_RUNNING } -#endif + /* * Sysctls are split into ``static'' and ``dynamic'' tables. * The former are defined at module load time and are used @@ -2280,7 +2107,6 @@ ath_sysctl_halparam(ctl_table *ctl, int write, struct file *filp, /* XXX validate? */ ath_hal_settpc(ah, val); break; -#ifdef BLE case ATH_TXPOWLIMIT: /* XXX validate? */ ic->ic_txpowlimit = val; @@ -2321,10 +2147,9 @@ ath_sysctl_halparam(ctl_table *ctl, int write, struct file *filp, } ath_reset(&sc->sc_dev); break; -#endif case ATH_RXFILTER: sc->sc_rxfilter = val; -// ath_reset(sc->sc_dev); + ath_reset(sc->sc_dev); break; case ATH_RADARSIM: tasklet_schedule(&sc->sc_radartq); @@ -2387,9 +2212,8 @@ ath_sysctl_halparam(ctl_table *ctl, int write, struct file *filp, val = sc->sc_hasveol; break; case ATH_BINTVAL: -// val = (sc->sc_ic).ic_lintval; + val = (sc->sc_ic).ic_lintval; break; -#ifdef BLE case ATH_RAWDEV: val = sc->sc_rawdev_enabled; break; @@ -2402,7 +2226,6 @@ ath_sysctl_halparam(ctl_table *ctl, int write, struct file *filp, val = 0; } break; -#endif case ATH_RXFILTER: val = sc->sc_rxfilter; break; @@ -2558,7 +2381,7 @@ ath_dynamic_sysctl_register(struct ath_softc *sc) sc->sc_sysctls[0].child = &sc->sc_sysctls[2]; /* [1] is NULL terminator */ sc->sc_sysctls[2].ctl_name = CTL_AUTO; - sc->sc_sysctls[2].procname = "BLE";//sc->sc_dev->name; + sc->sc_sysctls[2].procname = sc->sc_dev->name; sc->sc_sysctls[2].mode = 0555; sc->sc_sysctls[2].child = &sc->sc_sysctls[4]; /* [3] is NULL terminator */ @@ -2570,7 +2393,6 @@ ath_dynamic_sysctl_register(struct ath_softc *sc) for (i = 4; sc->sc_sysctls[i].ctl_name; i++) if (sc->sc_sysctls[i].extra1 == NULL) sc->sc_sysctls[i].extra1 = sc; -#ifdef BLE /* and register everything */ sc->sc_sysctl_header = ATH_REGISTER_SYSCTL_TABLE(sc->sc_sysctls); if (!sc->sc_sysctl_header) { @@ -2578,7 +2400,6 @@ ath_dynamic_sysctl_register(struct ath_softc *sc) kfree(sc->sc_sysctls); sc->sc_sysctls = NULL; } -#endif /* initialize values */ #ifdef AR_DEBUG sc->sc_debug = ath_debug;