commit 4cb2e576787a095150c2d0ab8c633dd0b8358e62 Author: Jiri Slaby Date: Sat Jun 16 18:17:24 2007 +0200 compilable, woow diff --git a/ath/Makefile b/ath/Makefile index 14dd268..808a66b 100644 --- a/ath/Makefile +++ b/ath/Makefile @@ -15,7 +15,7 @@ bus=pci endif obj-m += ath_$(bus).o -ath_ahb-objs := if_ath.o if_ath_ahb.o radar.o -ath_pci-objs := if_ath.o if_ath_pci.o radar.o +ath_ahb-objs := if_ath.o if_ath_ahb.o #radar.o +ath_pci-objs := if_ath.o if_ath_pci.o #radar.o -EXTRA_CFLAGS += -I../openhal/ +EXTRA_CFLAGS += -I$(src)/../openhal diff --git a/ath/if_ath.c b/ath/if_ath.c index 7fe48a5..7533e01 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -36,8 +36,6 @@ * $Id: if_ath.c 2408 2007-05-30 22:58:20Z mickflemm $ */ -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.76 2005/01/24 20:31:24 sam Exp $"); - /* * Driver for the Atheros Wireless LAN controller. * @@ -63,19 +61,13 @@ __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.76 2005/01/24 20:31:24 sam Exp #include #include -#include "if_ethersubr.h" /* for ETHER_IS_MULTICAST */ -#include "if_media.h" -#include "if_llc.h" - -#include - /* * #define AR_DEBUG here if you need to debug the ath_pci module (athdebug) * disable this if not needed because it adds an amount of load */ #define AR_DEBUG -#include "radar.h" +/*#include "radar.h"*/ #include "if_athvar.h" #include "ah_desc.h" @@ -91,6 +83,13 @@ __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.76 2005/01/24 20:31:24 sam Exp #include "ath_hw.h" +#define KASSERT(exp, msg...) do { \ + if (unlikely(!(exp))) { \ + printk(msg); \ + BUG(); \ + } \ +} while (0) + /* unaligned little endian access */ #define LE_READ_2(_p) (le16_to_cpu(get_unaligned((__le16 *)(_p)))) #define LE_READ_4(_p) (le32_to_cpu(get_unaligned((__le32 *)(_p)))) @@ -110,41 +109,49 @@ static void ath_bmiss_tasklet(TQUEUE_ARG); static void ath_radar_tasklet(TQUEUE_ARG); static int ath_stop_locked(struct net_device *); static int ath_stop(struct net_device *); +#ifdef BLE static int ath_media_change(struct net_device *); static int ath_key_alloc(struct ieee80211com *, - const struct ieee80211_key *); + const struct ieee80211_key_conf *); static int ath_key_delete(struct ieee80211com *, - const struct ieee80211_key *); -static int ath_key_set(struct ieee80211com *, const struct ieee80211_key *, + const struct ieee80211_key_conf *); +static int ath_key_set(struct ieee80211com *, + const struct ieee80211_key_conf *, const u_int8_t mac[IEEE80211_ADDR_LEN]); static void ath_key_update_begin(struct ieee80211com *); static void ath_key_update_end(struct ieee80211com *); static void ath_mode_init(struct net_device *); +#endif static void ath_setslottime(struct ath_softc *); -static void ath_updateslot(struct net_device *); +//static void ath_updateslot(struct net_device *); static int ath_beaconq_setup(struct ath_hal *); -static int ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *); -static void ath_beacon_setup(struct ath_softc *, struct ath_buf *); +//static int ath_beacon_alloc(struct ath_softc *, struct ieee80211_node *); +static void ath_beacon_setup(struct ath_softc *, struct ath_buf *, + struct ieee80211_tx_control *); static void ath_beacon_send(struct net_device *); static void ath_beacon_free(struct ath_softc *); -static void ath_beacon_config(struct ath_softc *); -static void ath_descdma_cleanup(struct ath_softc *sc, ath_bufhead *); +//static void ath_beacon_config(struct ath_softc *); +static void ath_descdma_cleanup(struct ath_softc *sc, struct list_head *); static int ath_desc_alloc(struct ath_softc *); static void ath_desc_free(struct ath_softc *); +#ifdef BLE static struct ieee80211_node *ath_node_alloc(struct ieee80211_node_table *); static void ath_node_free(struct ieee80211_node *); static u_int8_t ath_node_getrssi(const struct ieee80211_node *); +#endif static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *); +#ifdef BLE static void ath_recv_mgmt(struct ieee80211com *, struct sk_buff *, struct ieee80211_node *, int subtype, int rssi, u_int32_t rstamp); +#endif static void ath_setdefantenna(struct ath_softc *, u_int); static void ath_rx_tasklet(TQUEUE_ARG data); static struct ath_txq *ath_txq_setup(struct ath_softc*, int qtype, int subtype); -static int ath_tx_setup(struct ath_softc *, int, int); -static int ath_wme_update(struct ieee80211com *); +//static int ath_wme_update(struct ieee80211com *); static void ath_tx_cleanupq(struct ath_softc *, struct ath_txq *); static void ath_tx_cleanup(struct ath_softc *); +#ifdef BLE static int ath_start(struct sk_buff *, struct net_device *); static int ath_tx_setup(struct ath_softc *, int ac, int txq); static int ath_tx_start(struct net_device *, struct ieee80211_node *, @@ -154,12 +161,14 @@ static void ath_tx_tasklet_q0123(TQUEUE_ARG data); static void ath_tx_tasklet(TQUEUE_ARG data); static void ath_tx_timeout(struct net_device *); static int ath_chan_set(struct ath_softc *, struct ieee80211_channel *); +#endif static void ath_draintxq(struct ath_softc *); static void ath_stoprecv(struct ath_softc *); static int ath_startrecv(struct ath_softc *); -static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); +//static void ath_chan_change(struct ath_softc *, struct ieee80211_channel *); static void ath_next_scan(unsigned long); static void ath_calibrate(unsigned long); +#ifdef BLE static int ath_newstate(struct ieee80211com *, enum ieee80211_state, int); #if IEEE80211_VLAN_TAG_USED static void ath_vlan_register(struct net_device *, struct vlan_group *); @@ -170,21 +179,24 @@ static struct iw_statistics *ath_iw_getstats(struct net_device *); static struct iw_handler_def ath_iw_handler_def; static void ath_setup_stationkey(struct ieee80211_node *); static void ath_newassoc(struct ieee80211_node *, int); +#endif static int ath_getchannels(struct net_device *, u_int cc, AR5K_BOOL outdoor, AR5K_BOOL xchanmode); +#ifdef BLE static void ath_led_event(struct ath_softc *, int); +#endif static void ath_led_off(unsigned long arg); static void ath_update_txpow(struct ath_softc *); - +#ifdef BLE static int ath_set_mac_address(struct net_device *, void *); static int ath_change_mtu(struct net_device *, int); static int ath_ioctl(struct net_device *, struct ifreq *, int); - +#endif static int ath_rate_setup(struct net_device *, u_int mode); -static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode); +static void ath_setcurmode(struct ath_softc *, unsigned int); -static int ath_rawdev_attach(struct ath_softc *); -static void ath_rawdev_detach(struct ath_softc *); +//static int ath_rawdev_attach(struct ath_softc *); +//static void ath_rawdev_detach(struct ath_softc *); static void ath_dynamic_sysctl_register(struct ath_softc *); static void ath_dynamic_sysctl_unregister(struct ath_softc *); static void ath_announce(struct ath_softc *); @@ -321,7 +333,7 @@ int ath_attach(u_int16_t devid, struct net_device *dev) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; +// struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah; AR5K_STATUS status; int error = 0, i; @@ -381,8 +393,8 @@ ath_attach(u_int16_t devid, struct net_device *dev) */ sc->sc_keymax = ath_hal_keycachesize(ah); if (sc->sc_keymax > ATH_KEYMAX) { - if_printf(dev, "Warning, using only %u of %u key cache slots\n", - ATH_KEYMAX, sc->sc_keymax); + printk(KERN_WARNING "Warning, using only %u of %u key cache " + "slots\n", ATH_KEYMAX, sc->sc_keymax); sc->sc_keymax = ATH_KEYMAX; } @@ -398,12 +410,14 @@ ath_attach(u_int16_t devid, struct net_device *dev) * could leave the +32, +64, and +32+64 slots free. * XXX only for splitmic. */ +#ifdef BLE for (i = 0; i < IEEE80211_WEP_NKID; i++) { setbit(sc->sc_keymap, i); setbit(sc->sc_keymap, i+32); setbit(sc->sc_keymap, i+64); setbit(sc->sc_keymap, i+32+64); } +#endif /* * Collect the channel list using the default country @@ -427,20 +441,20 @@ ath_attach(u_int16_t devid, struct net_device *dev) /* * Setup rate tables for all potential media types. */ - ath_rate_setup(dev, IEEE80211_MODE_11A); - ath_rate_setup(dev, IEEE80211_MODE_11B); - ath_rate_setup(dev, IEEE80211_MODE_11G); - ath_rate_setup(dev, IEEE80211_MODE_TURBO_A); - ath_rate_setup(dev, IEEE80211_MODE_TURBO_G); + ath_rate_setup(dev, MODE_IEEE80211A); + ath_rate_setup(dev, MODE_IEEE80211B); + ath_rate_setup(dev, MODE_IEEE80211G); + ath_rate_setup(dev, MODE_ATHEROS_TURBO); + ath_rate_setup(dev, MODE_ATHEROS_TURBOG); /* NB: setup here so ath_rate_update is happy */ - ath_setcurmode(sc, IEEE80211_MODE_11A); + ath_setcurmode(sc, MODE_IEEE80211A); /* * Allocate tx+rx descriptors and populate the lists. */ error = ath_desc_alloc(sc); if (error != 0) { - if_printf(dev, "failed to allocate descriptors: %d\n", error); + printk(KERN_ERR "failed to allocate descriptors: %d\n", error); goto bad; } @@ -454,18 +468,19 @@ ath_attach(u_int16_t devid, struct net_device *dev) */ sc->sc_bhalq = ath_beaconq_setup(ah); if (sc->sc_bhalq == (u_int) -1) { - if_printf(dev, "unable to setup a beacon xmit queue!\n"); + printk(KERN_ERR "unable to setup a beacon xmit queue!\n"); goto bad2; } sc->sc_cabq = ath_txq_setup(sc, AR5K_TX_QUEUE_CAB, 0); if (sc->sc_cabq == NULL) { - if_printf(dev, "unable to setup CAB xmit queue!\n"); + printk(KERN_ERR "unable to setup CAB xmit queue!\n"); error = EIO; goto bad2; } +#ifdef BLE /* NB: insure BK queue is the lowest priority h/w queue */ if (!ath_tx_setup(sc, WME_AC_BK, AR5K_WME_AC_BK)) { - if_printf(dev, "unable to setup xmit queue for %s traffic!\n", + printk(KERN_ERR "unable to setup xmit queue for %s traffic!\n", ieee80211_wme_acnames[WME_AC_BK]); error = EIO; goto bad2; @@ -518,7 +533,7 @@ ath_attach(u_int16_t devid, struct net_device *dev) error = EIO; goto bad2; } - +#endif init_timer(&sc->sc_scan_ch); sc->sc_scan_ch.function = ath_next_scan; sc->sc_scan_ch.data = (unsigned long) dev; @@ -546,6 +561,7 @@ ath_attach(u_int16_t devid, struct net_device *dev) ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon); } +#ifdef BLE ether_setup(dev); dev->open = ath_init; dev->stop = ath_stop; @@ -569,7 +585,6 @@ ath_attach(u_int16_t devid, struct net_device *dev) dev->vlan_rx_register = ath_vlan_register; dev->vlan_rx_kill_vid = ath_vlan_kill_vid; #endif /* IEEE80211_VLAN_TAG_USED */ - ic->ic_dev = dev; ic->ic_devstats = &sc->sc_devstats; ic->ic_init = ath_init; @@ -589,7 +604,6 @@ ath_attach(u_int16_t devid, struct net_device *dev) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WPA /* capable of WPA1+WPA2 */ ; - /* * initialize management queue */ @@ -646,6 +660,7 @@ ath_attach(u_int16_t devid, struct net_device *dev) * 32-bit boundary for 4-address and QoS frames. */ ic->ic_flags |= IEEE80211_F_DATAPAD; +#endif /* * Query the hal about antenna support. @@ -663,9 +678,9 @@ ath_attach(u_int16_t devid, struct net_device *dev) sc->sc_rawdev.type = ARPHRD_IEEE80211; /* get mac address from hardware */ - ath_hal_getmac(ah, ic->ic_myaddr); - IEEE80211_ADDR_COPY(dev->dev_addr, ic->ic_myaddr); - +// ath_hal_getmac(ah, ic->ic_myaddr); BLEE +// IEEE80211_ADDR_COPY(dev->dev_addr, ic->ic_myaddr); +#ifdef BLE /* call MI attach routine. */ ieee80211_ifattach(ic); /* override default methods */ @@ -684,7 +699,8 @@ ath_attach(u_int16_t devid, struct net_device *dev) ic->ic_crypto.cs_key_update_end = ath_key_update_end; radar_init(ic); - +#endif +#if 0 /* complete initialization */ ieee80211_media_init(ic, ath_media_change, ieee80211_media_status); @@ -693,20 +709,21 @@ ath_attach(u_int16_t devid, struct net_device *dev) goto bad3; } +#endif /* * Attach dynamic MIB vars and announce support * now that we have a device name with unit number. */ ath_dynamic_sysctl_register(sc); - ath_rate_dynamic_sysctl_register(sc); - ieee80211_sysctl_register(ic); - ieee80211_announce(ic); +// ath_rate_dynamic_sysctl_register(sc); ath_announce(sc); + return 0; -bad3: - ieee80211_ifdetach(ic); - ath_rate_detach(sc->sc_rc); +//bad3: +// ieee80211_ifdetach(ic); +// ath_rate_detach(sc->sc_rc); bad2: +#ifdef BLE if (sc->sc_txq[WME_AC_BK].axq_qnum != (u_int) -1) { ATH_TXQ_LOCK_DESTROY(&sc->sc_txq[WME_AC_BK]); } @@ -719,6 +736,7 @@ bad2: if (sc->sc_txq[WME_AC_VO].axq_qnum != (u_int) -1) { ATH_TXQ_LOCK_DESTROY(&sc->sc_txq[WME_AC_VO]); } +#endif ath_tx_cleanup(sc); ath_desc_free(sc); bad: @@ -733,7 +751,7 @@ int ath_detach(struct net_device *dev) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; +// struct ieee80211com *ic = &sc->sc_ic; DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); ath_stop(dev); @@ -750,8 +768,8 @@ ath_detach(struct net_device *dev) * it last * Other than that, it's straightforward... */ - ieee80211_ifdetach(ic); - ath_rate_detach(sc->sc_rc); +// ieee80211_ifdetach(ic); +// ath_rate_detach(sc->sc_rc); ath_desc_free(sc); ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); @@ -762,8 +780,8 @@ ath_detach(struct net_device *dev) * state and potentially want to use them. */ ath_dynamic_sysctl_unregister(sc); - ath_rawdev_detach(sc); - unregister_netdev(dev); +// ath_rawdev_detach(sc); +// unregister_netdev(dev); return 0; } @@ -902,8 +920,10 @@ ath_intr(int irq, void *dev_id, struct pt_regs *regs) * Let the hal handle the event. We assume it will * clear whatever condition caused the interrupt. */ +#ifdef BLE ath_hal_mibevent(ah, &ATH_NODE(sc->sc_ic.ic_bss)->an_halstats); +#endif ath_hal_intrset(ah, sc->sc_imask); } } @@ -920,7 +940,7 @@ ath_fatal_tasklet(TQUEUE_ARG data) { struct net_device *dev = (struct net_device *)data; - if_printf(dev, "hardware error; resetting\n"); + printk(KERN_ERR "hardware error; resetting\n"); ath_reset(dev); } @@ -928,6 +948,7 @@ static void ath_radar_tasklet (TQUEUE_ARG data) { struct net_device *dev = (struct net_device *)data; +#ifdef BLE struct ath_softc *sc = dev->priv; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_channel *c; @@ -944,6 +965,7 @@ ath_radar_tasklet (TQUEUE_ARG data) ic->ic_des_chan = c; ic->ic_ibss_chan = c; ieee80211_new_state (ic, IEEE80211_S_INIT, -1); +#endif ath_init (dev); } @@ -952,20 +974,21 @@ ath_rxorn_tasklet(TQUEUE_ARG data) { struct net_device *dev = (struct net_device *)data; - if_printf(dev, "rx FIFO overrun; resetting\n"); + printk(KERN_WARNING "rx FIFO overrun; resetting\n"); ath_reset(dev); } static void ath_bmiss_tasklet(TQUEUE_ARG data) { +#ifdef BLE struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; struct ieee80211com *ic = &sc->sc_ic; DPRINTF(sc, ATH_DEBUG_ANY, "%s\n", __func__); KASSERT(ic->ic_opmode == IEEE80211_M_STA, - ("unexpected operating mode %u", ic->ic_opmode)); + "unexpected operating mode %u", ic->ic_opmode); if (ic->ic_state == IEEE80211_S_RUN) { if (sc->sc_bmisscount >= 1) { /* @@ -992,8 +1015,9 @@ ath_bmiss_tasklet(TQUEUE_ARG data) IEEE80211_FC0_SUBTYPE_PROBE_REQ, 0); } } +#endif } - +#ifdef BLE static u_int ath_chan2flags(struct ieee80211com *ic, struct ieee80211_channel *chan) { @@ -1009,33 +1033,30 @@ ath_chan2flags(struct ieee80211com *ic, struct ieee80211_channel *chan) }; enum ieee80211_phymode mode = ieee80211_chan2mode(ic, chan); - KASSERT(mode < N(modeflags), ("unexpected phy mode %u", mode)); - KASSERT(modeflags[mode] != 0, ("mode %u undefined", mode)); + KASSERT(mode < N(modeflags), "unexpected phy mode %u", mode); + KASSERT(modeflags[mode] != 0, "mode %u undefined", mode); return modeflags[mode]; #undef N } - +#endif static int ath_init(struct net_device *dev) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_node *ni; struct ath_hal *ah = sc->sc_ah; AR5K_STATUS status; int error = 0; - int opmode; ATH_LOCK(sc); - DPRINTF(sc, ATH_DEBUG_RESET, "%s: mode %d\n", __func__, ic->ic_opmode); +// DPRINTF(sc, ATH_DEBUG_RESET, "%s: mode %d\n", __func__, ic->ic_opmode); /* * Stop anything previously setup. This is safe * whether this is the first time through or not. */ ath_stop_locked(dev); - +#ifdef BLE /* * Change our interface type if we are in monitor mode. */ @@ -1051,14 +1072,13 @@ ath_init(struct net_device *dev) */ sc->sc_curchan.freq = ic->ic_ibss_chan->ic_freq; sc->sc_curchan.channel_flags = ath_chan2flags(ic, ic->ic_ibss_chan); - opmode = (ic->ic_opmode == IEEE80211_M_AHDEMO) ? 0 : ic->ic_opmode; - if (!ath_hal_reset(ah, opmode, &sc->sc_curchan, FALSE, &status)) { - if_printf(dev, "unable to reset hardware; hal status %u\n", +#endif + if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, FALSE, &status)) { + printk(KERN_ERR "unable to reset hardware; hal status %u\n", status); error = -EIO; goto done; } - /* * This is needed only to setup initial state * but it's best done after a reset. @@ -1079,7 +1099,7 @@ ath_init(struct net_device *dev) * here except setup the interrupt mask. */ if (ath_startrecv(sc) != 0) { - if_printf(dev, "unable to start recv logic\n"); + printk(KERN_ERR "unable to start recv logic\n"); error = -EIO; goto done; } @@ -1090,6 +1110,7 @@ ath_init(struct net_device *dev) sc->sc_imask = AR5K_INT_RX | AR5K_INT_TX | AR5K_INT_RXEOL | AR5K_INT_RXORN | AR5K_INT_FATAL | AR5K_INT_GLOBAL; // TODO: compiler warning integer overflow in expression +#ifdef BLE /* * Enable MIB interrupts when there are hardware phy counters. * Note we only do this (at the moment) for station mode. @@ -1114,6 +1135,7 @@ ath_init(struct net_device *dev) ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); } else ieee80211_new_state(ic, IEEE80211_S_RUN, -1); +#endif done: ATH_UNLOCK(sc); return error; @@ -1123,7 +1145,7 @@ static int ath_stop_locked(struct net_device *dev) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; +// struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; DPRINTF(sc, ATH_DEBUG_RESET, "%s: invalid %u flags 0x%x\n", @@ -1147,7 +1169,7 @@ ath_stop_locked(struct net_device *dev) * Note that some of this work is not possible if the * hardware is gone (invalid). */ - ieee80211_new_state(ic, IEEE80211_S_INIT, -1); +// ieee80211_new_state(ic, IEEE80211_S_INIT, -1); netif_stop_queue(dev); if (sc->sc_rawdev_enabled) netif_stop_queue(&sc->sc_rawdev); @@ -1228,14 +1250,13 @@ static int ath_reset(struct net_device *dev) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; - struct ath_hal *ah = sc->sc_ah; - struct ieee80211_channel *c; - AR5K_STATUS status; - int opmode; +// struct ath_hal *ah = sc->sc_ah; +// struct ieee80211_channel *c; +// AR5K_STATUS status; +// int opmode; DPRINTF(sc, ATH_DEBUG_RESET, "%s: resetting\n", dev->name); - +#ifdef BLE /* * Convert to a HAL channel description with the flags * constrained to reflect the current operating mode. @@ -1269,7 +1290,7 @@ ath_reset(struct net_device *dev) if (ic->ic_state == IEEE80211_S_RUN) netif_wake_queue(dev); /* restart xmit */ - +#endif if (sc->sc_rawdev_enabled) netif_wake_queue(&sc->sc_rawdev); return 0; @@ -1278,6 +1299,7 @@ ath_reset(struct net_device *dev) #define NUM_RADIOTAP_ELEMENTS 18 +#ifdef BLE static int radiotap_elem_to_bytes[NUM_RADIOTAP_ELEMENTS] = {8, /* IEEE80211_RADIOTAP_TSFT */ 1, /* IEEE80211_RADIOTAP_FLAGS */ @@ -1299,7 +1321,6 @@ static int radiotap_elem_to_bytes[NUM_RADIOTAP_ELEMENTS] = 1, /* IEEE80211_RADIOTAP_DATA_RETRIES */ }; - /* * the following rt_* functions deal with verifying that a valid * radiotap header is on a packet as well as functions to extracting @@ -1347,6 +1368,7 @@ static u_int8_t *rt_el_offset(struct ieee80211_radiotap_header *th, u_int32_t el return offset; } + /* * ath_start for raw 802.11 packets. */ @@ -1374,7 +1396,7 @@ ath_start_raw(struct sk_buff *skb, struct net_device *dev) struct ieee80211_frame *wh; struct ath_desc *ds; const AR5K_RATE_TABLE *rt; - uint8_t testmac[IEEE80211_ADDR_LEN]; + uint8_t testmac[ETH_ALEN]; if ((sc->sc_dev.flags & IFF_RUNNING) == 0 || sc->sc_invalid) { /* device is not up... silently discard packet */ @@ -1407,7 +1429,7 @@ ath_start_raw(struct sk_buff *skb, struct net_device *dev) } rt = sc->sc_currates; - KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + KASSERT(rt != NULL, "no rate table, mode %u", sc->sc_curmode); flags = AR5K_TXDESC_INTREQ | AR5K_TXDESC_CLRDMASK; try0 = ATH_TXMAXTRY; dot11_rate = 0; @@ -1865,7 +1887,7 @@ ath_media_change(struct net_device *dev) #ifdef AR_DEBUG static void ath_keyprint(const char *tag, u_int ix, - const AR5K_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN]) + const AR5K_KEYVAL *hk, const u_int8_t mac[ETH_ALEN]) { static const char *ciphers[] = { "WEP", @@ -1880,7 +1902,7 @@ ath_keyprint(const char *tag, u_int ix, printk("%s: [%02u] %-7s ", tag, ix, ciphers[hk->wk_type]); for (i = 0, n = hk->wk_len; i < n; i++) printk("%02x", hk->wk_key[i]); - printk(" mac %s", ether_sprintf(mac)); +// printk(" mac %s", ether_sprintf(mac)); if (hk->wk_type == AR5K_CIPHER_TKIP) { printk(" mic "); for (i = 0; i < sizeof(hk->wk_mic); i++) @@ -1897,7 +1919,7 @@ ath_keyprint(const char *tag, u_int ix, */ static int ath_keyset_tkip(struct ath_softc *sc, const struct ieee80211_key *k, - AR5K_KEYVAL *hk, const u_int8_t mac[IEEE80211_ADDR_LEN]) + AR5K_KEYVAL *hk, const u_int8_t mac[ETH_ALEN]) { #define IEEE80211_KEY_XR (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV) static const u_int8_t zerobssid[IEEE80211_ADDR_LEN]; @@ -2313,15 +2335,15 @@ static void ath_mode_init(struct net_device *dev) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; +// struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt, mfilt[2], val; u_int8_t pos; struct dev_mc_list *mc; /* configure rx filter */ - rfilt = ath_calcrxfilter(sc, ic->ic_state); - ath_hal_setrxfilter(ah, rfilt); +// rfilt = ath_calcrxfilter(sc, ic->ic_state); +// ath_hal_setrxfilter(ah, rfilt); /* configure operational mode */ ath_hal_setopmode(ah); @@ -2334,8 +2356,8 @@ ath_mode_init(struct net_device *dev) * * XXX should get from lladdr instead of arpcom but that's more work */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, dev->dev_addr); - ath_hal_setmac(ah, ic->ic_myaddr); +// IEEE80211_ADDR_COPY(ic->ic_myaddr, dev->dev_addr); + ath_hal_setmac(ah, dev->dev_addr); /* calculate and install multicast filter */ if ((dev->flags & IFF_ALLMULTI) == 0) { @@ -2356,7 +2378,7 @@ ath_mode_init(struct net_device *dev) DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, MC filter %08x:%08x\n", __func__, rfilt, mfilt[0], mfilt[1]); } - +#endif /* * Set the slot time based on the current setting. * This is called by ath_updateslot below and when a non-ERP node @@ -2365,7 +2387,7 @@ ath_mode_init(struct net_device *dev) static void ath_setslottime(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; +// struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; /* If the user has asked to lock the slot-time, ignore the @@ -2373,14 +2395,14 @@ ath_setslottime(struct ath_softc *sc) * that require a slot time larger than the standard ones. -TvE */ if (!sc->sc_lockslottime) { - if (ic->ic_flags & IEEE80211_F_SHSLOT) - ath_hal_setslottime(ah, AR5K_SLOT_TIME_9); - else +// if (ic->ic_flags & IEEE80211_F_SHSLOT) +// ath_hal_setslottime(ah, AR5K_SLOT_TIME_9); +// else ath_hal_setslottime(ah, AR5K_SLOT_TIME_20); } sc->sc_updateslot = OK; } - +#ifdef BLE /* * Callback from the 802.11 layer to update the * slot time based on the current setting. @@ -2401,7 +2423,7 @@ ath_updateslot(struct net_device *dev) else ath_setslottime(sc); } - +#endif /* * Setup a h/w transmit queue for beacons. */ @@ -2414,11 +2436,11 @@ ath_beaconq_setup(struct ath_hal *ah) qi.tqi_aifs = AR5K_TXQ_USEDEFAULT; qi.tqi_cw_min = AR5K_TXQ_USEDEFAULT; qi.tqi_cw_max = AR5K_TXQ_USEDEFAULT; - /* NB: for dynamic turbo, don't enable any other interrupts */ - qi.tqi_flags = AR5K_TXQ_FLAG_TXDESCINT_ENABLE; - return ath_hal_setuptxqueue(ah, AR5K_TX_QUEUE_BEACON, &qi); + /* NB: for dynamic turbo, don't enable any other interrupts */ + qi.tqi_flags = AR5K_TXQ_FLAG_TXDESCINT_ENABLE; + return ath_hal_setuptxqueue(ah, AR5K_TX_QUEUE_BEACON, &qi); } - +#ifdef BLE /* * Setup the transmit queue parameters for the beacon queue. */ @@ -2426,37 +2448,39 @@ static int ath_beaconq_config(struct ath_softc *sc) { #define ATH_EXPONENT_TO_VALUE(v) ((1<<(v))-1) - struct ieee80211com *ic = &sc->sc_ic; - struct ath_hal *ah = sc->sc_ah; - AR5K_TXQ_INFO qi; +// struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + AR5K_TXQ_INFO qi; - ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); - if (ic->ic_opmode == IEEE80211_M_HOSTAP) { - /* - * Always burst out beacon and CAB traffic. - */ - qi.tqi_aifs = ATH_BEACON_AIFS_DEFAULT; - qi.tqi_cw_min = ATH_BEACON_CWMIN_DEFAULT; - qi.tqi_cw_max = ATH_BEACON_CWMAX_DEFAULT; - } else { - struct wmeParams *wmep = - &ic->ic_wme.wme_chanParams.cap_wmeParams[WME_AC_BE]; - /* - * Adhoc mode; important thing is to use 2x cwmin. - */ - 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); - } + ath_hal_gettxqueueprops(ah, sc->sc_bhalq, &qi); + if (sc->sc_opmode == IEEE80211_IF_TYPE_AP) { + /* + * Always burst out beacon and CAB traffic. + */ + qi.tqi_aifs = ATH_BEACON_AIFS_DEFAULT; + 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]; + /* + * Adhoc mode; important thing is to use 2x cwmin. + */ + 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 (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) { - printk("%s: unable to update parameters for " - "beacon hardware queue! (%s)\n", __func__, sc->sc_dev.name); - return 0; - } else { - ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ - return 1; - } + if (!ath_hal_settxqueueprops(ah, sc->sc_bhalq, &qi)) { + printk("%s: unable to update parameters for " + "beacon hardware queue! (%s)\n", __func__, sc->sc_dev.name); + return 0; + } else { + ath_hal_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ + return 1; + } #undef ATH_EXPONENT_TO_VALUE } @@ -2501,21 +2525,19 @@ ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_node *ni) return 0; // TODO: return value } - +#endif /* * Setup the beacon frame for transmit. */ static void -ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf) +ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf, + struct ieee80211_tx_control *ctl) { #define USE_SHPREAMBLE(_ic) \ (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\ == IEEE80211_F_SHPREAMBLE) - struct ieee80211_node *ni = bf->bf_node; - struct ieee80211com *ic = ni->ni_ic; struct sk_buff *skb = bf->bf_skb; struct ath_hal *ah = sc->sc_ah; - struct ath_node *an = ATH_NODE(ni); struct ath_desc *ds; int antenna = sc->sc_txantenna; int flags; @@ -2527,7 +2549,7 @@ ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf) "%s: skb %p [data %p len %u] skbaddr %llx\n", __func__, skb, skb->data, skb->len, ito64(bf->bf_skbaddr)); if (BUS_DMA_MAP_ERROR(bf->bf_skbaddr)) { - if_printf(&sc->sc_dev, "%s: DMA mapping failed\n", __func__); + printk(KERN_ERR "%s: DMA mapping failed\n", __func__); return; } @@ -2535,7 +2557,7 @@ ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf) ds = bf->bf_desc; flags = AR5K_TXDESC_NOACK; - if (ic->ic_opmode == IEEE80211_M_IBSS && sc->sc_hasveol) { + if (sc->sc_opmode == IEEE80211_IF_TYPE_IBSS && sc->sc_hasveol) { ds->ds_link = bf->bf_daddr; /* self-linked */ flags |= AR5K_TXDESC_VEOL; /* @@ -2557,15 +2579,18 @@ 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; ath_hal_setuptxdesc(ah, ds - , skb->len + IEEE80211_CRC_LEN /* frame length */ - , sizeof(struct ieee80211_frame)/* header length */ + , skb->len + FCS_LEN /* frame length */ + , ieee80211_get_hdrlen_from_skb(skb) /* header length */ , AR5K_PKT_TYPE_BEACON /* Atheros packet type */ - , ni->ni_txpower /* txpower XXX */ + , min((u8)60u, ctl->power_level) /* txpower XXX */ , rate, 1 /* series 0 rate/tries */ , AR5K_TXKEYIX_INVALID /* no encryption */ , antenna /* antenna mode */ @@ -2595,20 +2620,20 @@ ath_beacon_setup(struct ath_softc *sc, struct ath_buf *bf) static void ath_beacon_send(struct net_device *dev) { + struct ieee80211_tx_control ctl; struct ath_softc *sc = dev->priv; - struct ath_buf *bf = STAILQ_FIRST(&sc->sc_bbuf); - struct ieee80211com *ic = &sc->sc_ic; + struct ath_buf *bf = NULL;//STAILQ_FIRST(&sc->sc_bbuf); struct ath_hal *ah = sc->sc_ah; struct sk_buff *skb; int ncabq, otherant; DPRINTF(sc, ATH_DEBUG_BEACON_PROC, "%s\n", __func__); - if (ic->ic_opmode == IEEE80211_M_STA || - ic->ic_opmode == IEEE80211_M_MONITOR || + if (sc->sc_opmode == IEEE80211_IF_TYPE_STA || + sc->sc_opmode == IEEE80211_IF_TYPE_MNTR || bf == NULL || bf->bf_skb == NULL) { - DPRINTF(sc, ATH_DEBUG_ANY, "%s: ic_flags=%x bf=%p bf_skb=%p\n", - __func__, ic->ic_flags, bf, bf ? bf->bf_skb : NULL); + DPRINTF(sc, ATH_DEBUG_ANY, "%s: bf=%p bf_skb=%p\n", + __func__, bf, bf ? bf->bf_skb : NULL); return; } /* @@ -2646,6 +2671,7 @@ 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", @@ -2662,6 +2688,7 @@ ath_beacon_send(struct net_device *dev) return; } } +#endif /* * Handle slot time change when a non-ERP station joins/leaves @@ -2690,7 +2717,7 @@ ath_beacon_send(struct net_device *dev) /* * Construct tx descriptor. */ - ath_beacon_setup(sc, bf); + ath_beacon_setup(sc, bf, &ctl); /* * Stop any current dma and put the new frame on the queue. @@ -2714,9 +2741,11 @@ ath_beacon_send(struct net_device *dev) * * NB: only at DTIM */ - if (ic->ic_opmode == IEEE80211_M_HOSTAP && +#ifdef BLE + if (sc->sc_opmode == IEEE80211_IF_TYPE_AP && ncabq > 0 && sc->sc_boff.bo_tim[4] & 1) ath_hal_txstart(ah, sc->sc_cabq->axq_qnum); +#endif ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); ath_hal_txstart(ah, sc->sc_bhalq); DPRINTF(sc, ATH_DEBUG_BEACON_PROC, @@ -2735,7 +2764,7 @@ ath_bstuck_tasklet(TQUEUE_ARG data) struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; - if_printf(dev, "stuck beacon; resetting (bmiss count %u)\n", + printk(KERN_WARNING "stuck beacon; resetting (bmiss count %u)\n", sc->sc_bmisscount); ath_reset(dev); } @@ -2748,20 +2777,24 @@ ath_beacon_free(struct ath_softc *sc) { struct ath_buf *bf; - 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; - } - if (bf->bf_node != NULL) { - ieee80211_free_node(bf->bf_node); - bf->bf_node = NULL; - } - } + bf = NULL; +// 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 +// } } +#ifdef BLE /* * Configure the beacon and sleep timers. * @@ -2782,8 +2815,6 @@ ath_beacon_config(struct ath_softc *sc) { #define TSF_TO_TU(_h,_l) (((_h) << 22) | ((_l) >> 10)) struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_node *ni = ic->ic_bss; u_int32_t nexttbtt, intval; u_int64_t tsf; u_int32_t tsftu; @@ -2959,10 +2990,12 @@ ath_beacon_config(struct ath_softc *sc) } #undef TSF_TO_TU } +#endif static void -ath_descdma_cleanup(struct ath_softc *sc, ath_bufhead *head) +ath_descdma_cleanup(struct ath_softc *sc, struct list_head *head) { +#ifdef BLE struct ath_buf *bf; struct ieee80211_node *ni; @@ -2985,6 +3018,7 @@ ath_descdma_cleanup(struct ath_softc *sc, ath_bufhead *head) } STAILQ_INIT(head); +#endif } static int @@ -3004,7 +3038,7 @@ ath_desc_alloc(struct ath_softc *sc) sc->sc_desc = bus_alloc_consistent(sc->sc_bdev, sc->sc_desc_len, &sc->sc_desc_daddr); if (sc->sc_desc == NULL) { - if_printf(&sc->sc_dev, "%s, could not allocate descriptors\n", __func__); + printk(KERN_ERR "%s, could not allocate descriptors\n", __func__); return ENOMEM; } ds = sc->sc_desc; @@ -3019,25 +3053,25 @@ ath_desc_alloc(struct ath_softc *sc) memset(bf, 0, bsize); sc->sc_bufptr = bf; - STAILQ_INIT(&sc->sc_rxbuf); +// STAILQ_INIT(&sc->sc_rxbuf); for (i = 0; i < ATH_RXBUF; i++, bf++, ds++) { bf->bf_desc = ds; bf->bf_daddr = DS2PHYS(sc, ds); - STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); +// STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); } - STAILQ_INIT(&sc->sc_txbuf); +// STAILQ_INIT(&sc->sc_txbuf); for (i = 0; i < ATH_TXBUF; i++, bf++, ds += ATH_TXDESC) { bf->bf_desc = ds; bf->bf_daddr = DS2PHYS(sc, ds); - STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); +// STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); } - STAILQ_INIT(&sc->sc_bbuf); +// STAILQ_INIT(&sc->sc_bbuf); for (i = 0; i < ATH_BCBUF; i++, bf++, ds++) { bf->bf_desc = ds; bf->bf_daddr = DS2PHYS(sc, ds); - STAILQ_INSERT_TAIL(&sc->sc_bbuf, bf, bf_list); +// STAILQ_INSERT_TAIL(&sc->sc_bbuf, bf, bf_list); } return 0; @@ -3052,9 +3086,9 @@ bad: static void ath_desc_free(struct ath_softc *sc) { - ath_descdma_cleanup(sc, &sc->sc_bbuf); - ath_descdma_cleanup(sc, &sc->sc_txbuf); - ath_descdma_cleanup(sc, &sc->sc_rxbuf); + ath_descdma_cleanup(sc, sc->sc_bbuf); + ath_descdma_cleanup(sc, sc->sc_txbuf); + ath_descdma_cleanup(sc, sc->sc_rxbuf); /* Free memory associated with all descriptors */ bus_free_consistent(sc->sc_bdev, sc->sc_desc_len, @@ -3064,6 +3098,7 @@ ath_desc_free(struct ath_softc *sc) sc->sc_bufptr = NULL; } +#ifdef BLE static struct ieee80211_node * ath_node_alloc(struct ieee80211_node_table *nt) { @@ -3123,6 +3158,7 @@ ath_node_getrssi(const struct ieee80211_node *ni) return rssi < 0 ? 0 : rssi > 127 ? 127 : rssi; #undef AR5K_EP_RND } +#endif static int ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) @@ -3132,7 +3168,7 @@ ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) struct ath_desc *ds; int headroom_needed = 0; - if (sc->sc_ic.ic_opmode == IEEE80211_M_MONITOR) { + if (sc->sc_opmode == IEEE80211_IF_TYPE_MNTR) { headroom_needed = sizeof(wlan_ng_prism2_header); } else if (sc->sc_rawdev.type == ARPHRD_IEEE80211_PRISM) { headroom_needed = sizeof(wlan_ng_prism2_header); @@ -3192,7 +3228,7 @@ ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) bf->bf_skbaddr = bus_map_single(sc->sc_bdev, skb->data, sc->sc_rxbufsize, BUS_DMA_FROMDEVICE); if (BUS_DMA_MAP_ERROR(bf->bf_skbaddr)) { - if_printf(&sc->sc_dev, "%s: DMA mapping failed\n", __func__); + printk(KERN_ERR "%s: DMA mapping failed\n", __func__); dev_kfree_skb(skb); bf->bf_skb = NULL; sc->sc_stats.ast_rx_busdma++; @@ -3229,6 +3265,7 @@ ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) return 0; } +#ifdef BLE /* * Add additional headers to a transmitted frame and netif_rx it on * a monitor or raw device @@ -3237,7 +3274,6 @@ static void ath_tx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; u_int32_t tsf; /* @@ -3376,8 +3412,8 @@ ath_tx_capture(struct net_device *dev, struct ath_desc *ds, struct sk_buff *skb) bad: dev_kfree_skb(skb); - return; } +#endif /* * Add additional headers to a received frame and netif_rx it on @@ -3386,6 +3422,7 @@ 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)) @@ -3531,6 +3568,7 @@ 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 } /* @@ -3550,7 +3588,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. @@ -3614,7 +3652,7 @@ ath_recv_mgmt(struct ieee80211com *ic, struct sk_buff *skb, break; } } - +#endif /* * Set the default antenna. */ @@ -3640,21 +3678,20 @@ ath_rx_tasklet(TQUEUE_ARG data) struct net_device *dev = (struct net_device *)data; struct ath_buf *bf; struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds; struct sk_buff *skb; - struct ieee80211_node *ni; - struct ath_node *an; - int len, type; +// struct ath_node *an; + int len;//, type; u_int phyerr; AR5K_STATUS status; DPRINTF(sc, ATH_DEBUG_RX_PROC, "%s\n", __func__); do { - bf = STAILQ_FIRST(&sc->sc_rxbuf); +// bf = STAILQ_FIRST(&sc->sc_rxbuf); + bf = NULL; if (bf == NULL) { /* XXX ??? can this happen */ - if_printf(dev, "%s: no buffer!\n", __func__); + printk(KERN_ERR "%s: no buffer!\n", __func__); break; } ds = bf->bf_desc; @@ -3664,7 +3701,7 @@ ath_rx_tasklet(TQUEUE_ARG data) } skb = bf->bf_skb; if (skb == NULL) { /* XXX ??? can this happen */ - if_printf(dev, "%s: no skbuff!\n", __func__); + printk(KERN_ERR "%s: no skbuff!\n", __func__); continue; } /* XXX sync descriptor memory */ @@ -3687,7 +3724,7 @@ ath_rx_tasklet(TQUEUE_ARG data) #endif if (status == AR5K_EINPROGRESS) break; - STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); +// STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); if (ds->ds_rxstat.rs_more) { /* * Frame spans multiple descriptors; this @@ -3700,7 +3737,7 @@ ath_rx_tasklet(TQUEUE_ARG data) * Enable this if you want to see * error frames in Monitor mode. */ - if (ic->ic_opmode != IEEE80211_M_MONITOR) { + if (sc->sc_opmode != IEEE80211_IF_TYPE_MNTR) { sc->sc_stats.ast_rx_toobig++; goto rx_next; } @@ -3745,6 +3782,7 @@ ath_rx_tasklet(TQUEUE_ARG data) * the 802.11 header for notifcation. */ /* XXX frag's and qos frames */ +#ifdef BLE len = ds->ds_rxstat.rs_datalen; if (len >= sizeof (struct ieee80211_frame)) { bus_dma_sync_single(sc->sc_bdev, @@ -3757,10 +3795,11 @@ ath_rx_tasklet(TQUEUE_ARG data) ds->ds_rxstat.rs_keyix ); } +#endif } // TODO: correct? - ic->ic_devstats->rx_errors++; +// ic->ic_devstats->rx_errors++; /* * accept error frames on the raw device @@ -3777,7 +3816,7 @@ ath_rx_tasklet(TQUEUE_ARG data) */ if ((ds->ds_rxstat.rs_status &~ (AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) || - sc->sc_ic.ic_opmode != IEEE80211_M_MONITOR) + sc->sc_opmode != IEEE80211_IF_TYPE_MNTR) goto rx_next; } rx_accept: @@ -3796,7 +3835,7 @@ rx_accept: bf->bf_skb = NULL; sc->sc_stats.ast_ant_rx[ds->ds_rxstat.rs_antenna]++; - +#ifdef BLE if (len < IEEE80211_ACK_LEN) { DPRINTF(sc, ATH_DEBUG_RECV, "%s: runt packet %d\n", __func__, len); @@ -3804,10 +3843,9 @@ rx_accept: dev_kfree_skb(skb); goto rx_next; } - - KASSERT(len <= skb_tailroom(skb), - ("not enough tailroom (%d vs %d)", - len, skb_tailroom(skb))); +#endif + KASSERT(len <= skb_tailroom(skb), "not enough tailroom " + "(%d vs %d)", len, skb_tailroom(skb)); skb_put(skb, len); skb->protocol = __constant_htons(ETH_P_CONTROL); @@ -3821,7 +3859,7 @@ rx_accept: } } - if (ic->ic_opmode == IEEE80211_M_MONITOR) { + if (sc->sc_opmode == IEEE80211_IF_TYPE_MNTR) { /* * Monitor mode: discard anything shorter than * an ack or cts, clean the skbuff, fabricate @@ -3849,6 +3887,7 @@ rx_accept: * From this point on we assume the frame is at least * as large as ieee80211_frame_min; verify that. */ +#ifdef BLE if (len < IEEE80211_MIN_LEN) { DPRINTF(sc, ATH_DEBUG_RECV, "%s: short packet %d\n", __func__, len); @@ -3946,12 +3985,14 @@ rx_accept: } else if (jiffies - sc->sc_ledevent >= sc->sc_ledidle) ath_led_event(sc, ATH_LED_POLL); } +#endif rx_next: - STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); +// STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + ; } while (ath_rxbuf_init(sc, bf) == 0); /* rx signal state monitoring */ - ath_hal_rxmonitor(ah, &ATH_NODE(ic->ic_bss)->an_halstats); +// ath_hal_rxmonitor(ah, &ATH_NODE(ic->ic_bss)->an_halstats); #undef PA2DESC } @@ -4006,14 +4047,14 @@ ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) txq->axq_depth = 0; txq->axq_intrcnt = 0; txq->axq_link = NULL; - STAILQ_INIT(&txq->axq_q); +// STAILQ_INIT(&txq->axq_q); ATH_TXQ_LOCK_INIT(sc, txq); sc->sc_txqsetup |= 1<sc_txq[qnum]; #undef N } - +#ifdef BLE /* * Setup a hardware data transmit queue for the specified * access control. The hal may not support all requested @@ -4051,9 +4092,8 @@ ath_txq_update(struct ath_softc *sc, int ac) { #define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ic; struct ath_txq *txq = sc->sc_ac2q[ac]; - struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; +// struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; struct ath_hal *ah = sc->sc_ah; AR5K_TXQ_INFO qi; @@ -4089,7 +4129,7 @@ ath_wme_update(struct ieee80211com *ic) !ath_txq_update(sc, WME_AC_VI) || !ath_txq_update(sc, WME_AC_VO) ? EIO : 0; } - +#endif /* * Reclaim resources for a setup queue. */ @@ -4117,7 +4157,7 @@ ath_tx_cleanup(struct ath_softc *sc) ath_tx_cleanupq(sc, &sc->sc_txq[i]); } } - +#ifdef BLE static int ath_tx_start(struct net_device *dev, struct ieee80211_node *ni, struct ath_buf *bf, struct sk_buff *skb) @@ -4608,22 +4648,21 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) { struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = &sc->sc_ic; struct ath_buf *bf; struct ath_desc *ds; - struct ieee80211_node *ni; - struct ath_node *an; - int sr, lr, pri; +// struct ieee80211_node *ni; +// struct ath_node *an; +// int sr, lr, pri; AR5K_STATUS status; DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: tx queue %u head %p link %p\n", __func__, txq->axq_qnum, - (caddr_t)(uintptr_t) ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum), + (caddr_t)ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum), txq->axq_link); for (;;) { ATH_TXQ_LOCK(txq); txq->axq_intrcnt = 0; /* reset periodic desc intr count */ - bf = STAILQ_FIRST(&txq->axq_q); +// bf = STAILQ_FIRST(&txq->axq_q); if (bf == NULL) { txq->axq_link = NULL; ATH_TXQ_UNLOCK(txq); @@ -4643,9 +4682,9 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) txq->axq_lastdsWithCTS = NULL; if (ds == txq->axq_gatingds) txq->axq_gatingds = NULL; - ATH_TXQ_REMOVE_HEAD(txq, bf_list); +// ATH_TXQ_REMOVE_HEAD(txq, bf_list); ATH_TXQ_UNLOCK(txq); - +#ifdef BLE ni = bf->bf_node; if (ni != NULL) { an = ATH_NODE(ni); @@ -4690,6 +4729,7 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) */ ieee80211_free_node(ni); } +#endif bus_unmap_single(sc->sc_bdev, bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); @@ -4699,10 +4739,10 @@ ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) dev_kfree_skb(bf->bf_skb); } bf->bf_skb = NULL; - bf->bf_node = NULL; +// bf->bf_node = NULL; ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); +// STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); } } @@ -4716,7 +4756,6 @@ ath_tx_tasklet_q0(TQUEUE_ARG data) { struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; ath_tx_processq(sc, &sc->sc_txq[0]); ath_tx_processq(sc, sc->sc_cabq); @@ -4748,7 +4787,6 @@ ath_tx_tasklet_q0123(TQUEUE_ARG data) { struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; /* * Process each active queue. @@ -4785,7 +4823,6 @@ ath_tx_tasklet(TQUEUE_ARG data) { struct net_device *dev = (struct net_device *)data; struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; int i; /* @@ -4823,6 +4860,7 @@ ath_tx_timeout(struct net_device *dev) sc->sc_stats.ast_watchdog++; ath_init(dev); } +#endif static void ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) @@ -4830,7 +4868,6 @@ ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) #ifdef AR_DEBUG struct ath_hal *ah = sc->sc_ah; #endif - struct ieee80211_node *ni; struct ath_buf *bf; /* @@ -4839,13 +4876,14 @@ ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) */ for (;;) { ATH_TXQ_LOCK_BH(txq); - bf = STAILQ_FIRST(&txq->axq_q); +// bf = STAILQ_FIRST(&txq->axq_q); + bf = NULL; if (bf == NULL) { txq->axq_link = NULL; ATH_TXQ_UNLOCK_BH(txq); break; } - ATH_TXQ_REMOVE_HEAD(txq, bf_list); +// ATH_TXQ_REMOVE_HEAD(txq, bf_list); ATH_TXQ_UNLOCK_BH(txq); #ifdef AR_DEBUG if (sc->sc_debug & ATH_DEBUG_RESET) @@ -4856,6 +4894,7 @@ ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) bf->bf_skbaddr, bf->bf_skb->len, BUS_DMA_TODEVICE); dev_kfree_skb(bf->bf_skb); bf->bf_skb = NULL; +#ifdef BLE ni = bf->bf_node; bf->bf_node = NULL; if (ni != NULL) { @@ -4864,8 +4903,9 @@ ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq) */ ieee80211_free_node(ni); } +#endif ATH_TXBUF_LOCK_BH(sc); - STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); +// STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK_BH(sc); } } @@ -4878,8 +4918,7 @@ ath_tx_stopdma(struct ath_softc *sc, struct ath_txq *txq) (void) ath_hal_stoptxdma(ah, txq->axq_qnum); DPRINTF(sc, ATH_DEBUG_RESET, "%s: tx queue [%u] %p, link %p\n", __func__, txq->axq_qnum, - (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, txq->axq_qnum), - txq->axq_link); + (caddr_t)ath_hal_gettxbuf(ah, txq->axq_qnum), txq->axq_link); } /* @@ -4897,7 +4936,7 @@ ath_draintxq(struct ath_softc *sc) (void) ath_hal_stoptxdma(ah, sc->sc_bhalq); DPRINTF(sc, ATH_DEBUG_RESET, "%s: beacon queue %p\n", __func__, - (caddr_t)(uintptr_t) ath_hal_gettxbuf(ah, sc->sc_bhalq)); + (caddr_t)ath_hal_gettxbuf(ah, sc->sc_bhalq)); for (i = 0; i < AR5K_NUM_TX_QUEUES; i++) { if (ATH_TXQ_SETUP(sc, i)) ath_tx_stopdma(sc, &sc->sc_txq[i]); @@ -4934,10 +4973,11 @@ ath_stoprecv(struct ath_softc *sc) mdelay(3); /* 3ms is long enough for 1 frame */ #ifdef AR_DEBUG if (sc->sc_debug & (ATH_DEBUG_RESET | ATH_DEBUG_FATAL)) { // TODO: compiler warns integer overflow - struct ath_buf *bf; +// struct ath_buf *bf; printk("%s: rx queue %p, link %p\n", __func__, - (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah), sc->sc_rxlink); + (caddr_t)ath_hal_getrxbuf(ah), sc->sc_rxlink); +#ifdef BLE STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) { struct ath_desc *ds = bf->bf_desc; AR5K_STATUS status = ath_hal_rxprocdesc(ah, ds, @@ -4945,6 +4985,7 @@ ath_stoprecv(struct ath_softc *sc) if (status == AR5K_OK || (sc->sc_debug & ATH_DEBUG_FATAL)) ath_printrxbuf(bf, status == AR5K_OK); } +#endif } #endif sc->sc_rxlink = NULL; /* just in case */ @@ -4958,8 +4999,7 @@ static int ath_startrecv(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = &sc->sc_ic; - struct net_device *dev = ic->ic_dev; +// struct net_device *dev = ic->ic_dev; struct ath_buf *bf; /* @@ -4982,6 +5022,7 @@ ath_startrecv(struct ath_softc *sc) #else sc->sc_rxbufsize = roundup(IEEE80211_MAX_LEN, sc->sc_cachelsz); #endif +#ifdef BLE DPRINTF(sc, ATH_DEBUG_RESET, "%s: mtu %u cachelsz %u rxbufsize %u\n", __func__, dev->mtu, sc->sc_cachelsz, sc->sc_rxbufsize); @@ -4997,28 +5038,30 @@ ath_startrecv(struct ath_softc *sc) } bf = STAILQ_FIRST(&sc->sc_rxbuf); +#endif + bf = NULL; ath_hal_putrxbuf(ah, bf->bf_daddr); ath_hal_rxena(ah); /* enable recv descriptors */ - ath_mode_init(dev); /* set filters, etc. */ +// ath_mode_init(dev); /* set filters, etc. */ ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */ return 0; } +#ifdef BLE /* * Update internal state after a channel change. */ static void ath_chan_change(struct ath_softc *sc, struct ieee80211_channel *chan) { - struct ieee80211com *ic = &sc->sc_ic; - enum ieee80211_phymode mode; - u_int16_t flags; + unsigned int mode; +// u_int16_t flags; /* * Change channels and update the h/w rate map * if we're switching; e.g. 11a to 11b/g. */ - mode = ieee80211_chan2mode(ic, chan); +// mode = ieee80211_chan2mode(ic, chan); if (mode != sc->sc_curmode) ath_setcurmode(sc, mode); /* @@ -5047,20 +5090,20 @@ static int ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) { struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = &sc->sc_ic; AR5K_CHANNEL hchan; - int opmode; /* * Convert to a HAL channel description with * the flags constrained to reflect the current * operating mode. */ +#ifdef BLE if (chan == IEEE80211_CHAN_ANYC) { return 0; } - hchan.freq = chan->ic_freq; + hchan.freq = chan->freq; hchan.channel_flags = ath_chan2flags(ic, chan); +#endif DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz) -> %u (%u MHz)\n", __func__, @@ -5081,11 +5124,11 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) ath_hal_intrset(ah, 0); /* disable interrupts */ ath_draintxq(sc); /* clear pending tx frames */ ath_stoprecv(sc); /* turn off frame recv */ - opmode = (ic->ic_opmode == IEEE80211_M_AHDEMO) ? 0 : ic->ic_opmode; - if (!ath_hal_reset(ah, opmode, &hchan, TRUE, &status)) { - if_printf(ic->ic_dev, "ath_chan_set: unable to reset " - "channel %u (%u Mhz)\n", - ieee80211_chan2ieee(ic, chan), chan->ic_freq); + if (!ath_hal_reset(ah, sc->sc_opmode, &hchan, TRUE, &status)) { + printk(KERN_ERR "ath_chan_set: unable to reset " + "channel %u (%u Mhz)\n", 0, +// ieee80211_chan2ieee(ic, chan), + chan->freq); return EIO; } sc->sc_curchan = hchan; @@ -5096,8 +5139,8 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) * Re-enable rx framework. */ if (ath_startrecv(sc) != 0) { - if_printf(ic->ic_dev, - "ath_chan_set: unable to restart recv logic\n"); + printk(KERN_ERR "ath_chan_set: unable to restart recv " + "logic\n"); return EIO; } @@ -5105,7 +5148,7 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) * Change channels and update the h/w rate map * if we're switching; e.g. 11a to 11b/g. */ - ic->ic_ibss_chan = chan; +// ic->ic_ibss_chan = chan; ath_chan_change(sc, chan); /* @@ -5115,16 +5158,17 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan) } return 0; } - +#endif static void ath_next_scan(unsigned long arg) { +#ifdef BLE struct net_device *dev = (struct net_device *) arg; struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; if (ic->ic_state == IEEE80211_S_SCAN) ieee80211_next_scan(ic); +#endif } /* @@ -5162,7 +5206,7 @@ ath_calibrate(unsigned long arg) sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ); add_timer(&sc->sc_cal_ch); } - +#ifdef BLE static int ath_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) { @@ -5358,26 +5402,25 @@ ath_newassoc(struct ieee80211_node *ni, int isnew) if (isnew && (ic->ic_flags & IEEE80211_F_PRIVACY) == 0 && sc->sc_hasclrkey) { KASSERT(ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE, - ("new assoc with a unicast key already setup (keyix %u)", - ni->ni_ucastkey.wk_keyix)); + "new assoc with a unicast key already setup (keyix %u)", + ni->ni_ucastkey.wk_keyix); ath_setup_stationkey(ni); } } - +#endif static int ath_getchannels(struct net_device *dev, u_int cc, AR5K_BOOL outdoor, AR5K_BOOL xchanmode) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; AR5K_CHANNEL *chans; int i, ix; u_int nchan; - +#define IEEE80211_CHAN_MAX 255 chans = kmalloc(IEEE80211_CHAN_MAX * sizeof(AR5K_CHANNEL), GFP_KERNEL); if (chans == NULL) { - if_printf(dev, "unable to allocate channel table\n"); + printk(KERN_ERR "unable to allocate channel table\n"); return ENOMEM; } if (!ath_hal_init_channels(ah, chans, IEEE80211_CHAN_MAX, &nchan, @@ -5385,7 +5428,7 @@ ath_getchannels(struct net_device *dev, u_int cc, u_int32_t rd; ath_hal_getregdomain(ah, &rd); - if_printf(dev, "unable to collect channel list from hal; " + printk(KERN_ERR "unable to collect channel list from hal; " "regdomain likely %u country code %u\n", rd, cc); kfree(chans); return EINVAL; @@ -5399,10 +5442,11 @@ ath_getchannels(struct net_device *dev, u_int cc, AR5K_CHANNEL *c = &chans[i]; ix = ath_hal_mhz2ieee(c->freq, c->channel_flags); if (ix > IEEE80211_CHAN_MAX) { - if_printf(dev, "bad hal channel %u (%u/%x) ignored\n", + printk(KERN_ERR "bad hal channel %u (%u/%x) ignored\n", ix, c->freq, c->channel_flags); continue; } +#ifdef BLE /* NB: flags are known to be compatible */ if (ic->ic_channels[ix].ic_freq == 0) { ic->ic_channels[ix].ic_freq = c->freq; @@ -5411,9 +5455,11 @@ ath_getchannels(struct net_device *dev, u_int cc, /* channels overlap; e.g. 11g and 11b */ ic->ic_channels[ix].ic_flags |= c->channel_flags; } +#endif } kfree(chans); return 0; +#undef IEEE80211_CHAN_MAX } /* @@ -5434,7 +5480,7 @@ ath_led_off(unsigned long arg) mod_timer(&sc->sc_ledtimer, jiffies + sc->sc_ledoff); } } - +#ifdef BLE /* * Blink the LED according to the specified on/off times. */ @@ -5471,11 +5517,11 @@ ath_led_event(struct ath_softc *sc, int event) break; } } - +#endif static void ath_update_txpow(struct ath_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; +#ifdef BLE struct ath_hal *ah = sc->sc_ah; u_int32_t txpow; @@ -5490,6 +5536,7 @@ ath_update_txpow(struct ath_softc *sc) */ (void)ath_hal_getmaxtxpow(sc->sc_ah, &txpow); ic->ic_bss->ni_txpower = txpow; +#endif } static int @@ -5497,25 +5544,24 @@ ath_rate_setup(struct net_device *dev, u_int mode) { struct ath_softc *sc = dev->priv; struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = &sc->sc_ic; const AR5K_RATE_TABLE *rt; - struct ieee80211_rateset *rs; - int i, maxrates; +// struct ieee80211_rateset *rs; +// int i, maxrates; switch (mode) { - case IEEE80211_MODE_11A: + case MODE_IEEE80211A: sc->sc_rates[mode] = ath_hal_getratetable(ah, AR5K_MODE_11A); break; - case IEEE80211_MODE_11B: + case MODE_IEEE80211B: sc->sc_rates[mode] = ath_hal_getratetable(ah, AR5K_MODE_11B); break; - case IEEE80211_MODE_11G: + case MODE_IEEE80211G: sc->sc_rates[mode] = ath_hal_getratetable(ah, AR5K_MODE_11G); break; - case IEEE80211_MODE_TURBO_A: + case MODE_ATHEROS_TURBO: sc->sc_rates[mode] = ath_hal_getratetable(ah, AR5K_MODE_TURBO); break; - case IEEE80211_MODE_TURBO_G: + case MODE_ATHEROS_TURBOG: sc->sc_rates[mode] = ath_hal_getratetable(ah, AR5K_MODE_108G); break; default: @@ -5526,6 +5572,7 @@ ath_rate_setup(struct net_device *dev, u_int mode) rt = sc->sc_rates[mode]; if (rt == NULL) return 0; +#ifdef BLE if (rt->rate_count > IEEE80211_RATE_MAXSIZE) { DPRINTF(sc, ATH_DEBUG_ANY, "%s: rate table too small (%u > %u)\n", @@ -5537,14 +5584,16 @@ ath_rate_setup(struct net_device *dev, u_int mode) for (i = 0; i < maxrates; i++) rs->rs_rates[i] = rt->rates[i].dot11_rate; rs->rs_nrates = maxrates; +#endif return 1; } static void -ath_setcurmode(struct ath_softc *sc, enum ieee80211_phymode mode) +ath_setcurmode(struct ath_softc *sc, unsigned int mode) { #define N(a) (sizeof(a)/sizeof(a[0])) /* NB: on/off times from the Atheros NDIS driver, w/ permission */ +#ifdef BLE static const struct { u_int rate; /* tx/rx 802.11 rate */ u_int16_t timeOn; /* LED on time (ms) */ @@ -5565,12 +5614,14 @@ ath_setcurmode(struct ath_softc *sc, enum ieee80211_phymode mode) { 2, 400, 100 }, { 0, 500, 130 }, }; +#endif const AR5K_RATE_TABLE *rt; - int i, j; +// int i, j; memset(sc->sc_rixmap, 0xff, sizeof(sc->sc_rixmap)); rt = sc->sc_rates[mode]; - KASSERT(rt != NULL, ("no h/w rate set for phy mode %u", mode)); + KASSERT(rt != NULL, "no h/w rate set for phy mode %u", mode); +#ifdef BLE for (i = 0; i < rt->rate_count; i++) sc->sc_rixmap[rt->rates[i].dot11_rate & IEEE80211_RATE_VAL] = i; memset(sc->sc_hwmap, 0, sizeof(sc->sc_hwmap)); @@ -5599,6 +5650,7 @@ ath_setcurmode(struct ath_softc *sc, enum ieee80211_phymode mode) sc->sc_hwmap[i].ledon = (blinkrates[j].timeOn * HZ) / 1000; sc->sc_hwmap[i].ledoff = (blinkrates[j].timeOff * HZ) / 1000; } +#endif sc->sc_currates = rt; sc->sc_curmode = mode; /* @@ -5606,12 +5658,12 @@ ath_setcurmode(struct ath_softc *sc, enum ieee80211_phymode mode) * 11g, otherwise at 1Mb/s. * XXX select protection rate index from rate table. */ - sc->sc_protrix = ((mode == IEEE80211_MODE_11G || mode == IEEE80211_MODE_TURBO_G) ? 1 : 0); + sc->sc_protrix = ((mode == MODE_IEEE80211G || mode == MODE_ATHEROS_TURBOG) ? 1 : 0); /* NB: caller is responsible for reseting rate control state */ #undef N } - +#ifdef BLE static int ath_rawdev_attach(struct ath_softc *sc) { @@ -5659,6 +5711,7 @@ ath_rawdev_detach(struct ath_softc *sc) unregister_netdev(&sc->sc_rawdev); } } + #if IEEE80211_VLAN_TAG_USED static void ath_vlan_register(struct net_device *dev, struct vlan_group *grp) @@ -5678,7 +5731,7 @@ ath_vlan_kill_vid(struct net_device *dev, unsigned short vid) ieee80211_vlan_kill_vid(ic, vid); } #endif /* IEEE80211_VLAN_TAG_USED */ - +#endif #ifdef AR_DEBUG static void ath_printrxbuf(struct ath_buf *bf, int done) @@ -5706,7 +5759,7 @@ ath_printtxbuf(struct ath_buf *bf, int done) !done ? ' ' : (ds->ds_txstat.ts_status == 0) ? '*' : '!'); } #endif /* AR_DEBUG */ - +#ifdef BLE /* * Return netdevice statistics. */ @@ -5742,10 +5795,9 @@ static struct iw_statistics * ath_iw_getstats(struct net_device *dev) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; struct iw_statistics *is = &sc->sc_iwstats; - ieee80211_iw_getstats(ic, is); +// ieee80211_iw_getstats(ic, is); /* add in statistics maintained by the driver */ is->discard.code += sc->sc_stats.ast_rx_badcrypt; is->discard.retries += sc->sc_stats.ast_tx_xretries; @@ -5960,7 +6012,6 @@ static int ath_set_mac_address(struct net_device *dev, void *addr) { struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; struct sockaddr *mac = addr; int error = 0; @@ -5977,8 +6028,8 @@ ath_set_mac_address(struct net_device *dev, void *addr) ATH_LOCK(sc); /* XXX not right for multiple vap's */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, mac->sa_data); - IEEE80211_ADDR_COPY(dev->dev_addr, mac->sa_data); +// IEEE80211_ADDR_COPY(ic->ic_myaddr, mac->sa_data); + memcpy(dev->dev_addr, mac->sa_data, ETH_ALEN); ath_hal_setmac(ah, dev->dev_addr); if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { error = -ath_reset(dev); @@ -6082,7 +6133,6 @@ ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) #define IS_RUNNING(dev) \ ((dev->flags & (IFF_RUNNING|IFF_UP)) == (IFF_RUNNING|IFF_UP)) struct ath_softc *sc = dev->priv; - struct ieee80211com *ic = &sc->sc_ic; int error = 0; ATH_LOCK(sc); @@ -6105,7 +6155,7 @@ ath_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) * torn down much of our state. There's * probably a better way to deal with this. */ - if (!sc->sc_invalid && ic->ic_bss != NULL) +// if (!sc->sc_invalid && ic->ic_bss != NULL) ath_init(dev); /* XXX lose error */ } else ath_stop_locked(dev); @@ -6120,6 +6170,7 @@ 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; @@ -6132,6 +6183,7 @@ 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; @@ -6145,6 +6197,7 @@ 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) && @@ -6154,13 +6207,14 @@ 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 @@ -6206,7 +6260,6 @@ static int ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos) { struct ath_softc *sc = ctl->extra1; - struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; u_int val; int ret; @@ -6273,9 +6326,10 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos) /* XXX validate? */ ath_hal_settpc(ah, val); break; +#ifdef BLE case ATH_TXPOWLIMIT: /* XXX validate? */ - ic->ic_txpowlimit = val; + ic->ic_txpowlimit = val; ath_reset(&sc->sc_dev); break; case ATH_BINTVAL: @@ -6313,6 +6367,7 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos) } ath_reset(&sc->sc_dev); break; +#endif case ATH_RXFILTER: sc->sc_rxfilter = val; ath_reset(&sc->sc_dev); @@ -6378,7 +6433,7 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl, write, filp, buffer, lenp, ppos) val = sc->sc_hasveol; break; case ATH_BINTVAL: - val = (sc->sc_ic).ic_lintval; +// val = (sc->sc_ic).ic_lintval; break; case ATH_RAWDEV: val = sc->sc_rawdev_enabled; @@ -6561,7 +6616,7 @@ 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) { @@ -6569,7 +6624,7 @@ 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; @@ -6599,12 +6654,12 @@ static void ath_announce(struct ath_softc *sc) { #define AR5K_MODE_DUALBAND (AR5K_MODE_11A|AR5K_MODE_11B) - struct net_device *dev = &sc->sc_dev; +// struct net_device *dev = &sc->sc_dev; struct ath_hal *ah = sc->sc_ah; u_int modes, cc; - int i; +// int i; - if_printf(dev, "mac %d.%d phy %d.%d", + printk(KERN_INFO "mac %d.%d phy %d.%d", ah->ah_mac_version, ah->ah_mac_version, ah->ah_phy_revision >> 4, ah->ah_phy_revision & 0xf); /* @@ -6628,14 +6683,16 @@ ath_announce(struct ath_softc *sc) printk(" radio %d.%d", ah->ah_radio_5ghz_revision >> 4, ah->ah_radio_5ghz_revision & 0xf); printk("\n"); +#ifdef BLE for (i = 0; i <= WME_AC_VO; i++) { struct ath_txq *txq = sc->sc_ac2q[i]; - if_printf(dev, "Use hw queue %u for %s traffic\n", - txq->axq_qnum, ieee80211_wme_acnames[i]); + printk(KERN_INFO "Use hw queue %u for %s traffic\n", + txq->axq_qnum, ieee80211_wme_acnames[i]); } - if_printf(dev, "Use hw queue %u for CAB traffic\n", - sc->sc_cabq->axq_qnum); - if_printf(dev, "Use hw queue %u for beacons\n", sc->sc_bhalq); +#endif + printk(KERN_INFO "Use hw queue %u for CAB traffic\n", + sc->sc_cabq->axq_qnum); + printk(KERN_INFO "Use hw queue %u for beacons\n", sc->sc_bhalq); #ifdef AR_DEBUG printk("Debugging version (ATH)\n"); @@ -6731,8 +6788,7 @@ ath_sysctl_register(void) static int initialized = 0; if (!initialized) { - ath_sysctl_header = - ATH_REGISTER_SYSCTL_TABLE(ath_root_table); + ath_sysctl_header = register_sysctl_table(ath_root_table); initialized = 1; } } diff --git a/ath/if_ath_pci.c b/ath/if_ath_pci.c index 2bdd297..439749e 100644 --- a/ath/if_ath_pci.c +++ b/ath/if_ath_pci.c @@ -59,9 +59,6 @@ #include -#include "if_media.h" -#include - #include "if_athvar.h" #include "if_ath_pci.h" diff --git a/ath/if_athioctl.h b/ath/if_athioctl.h index 2b0935f..24ab592 100644 --- a/ath/if_athioctl.h +++ b/ath/if_athioctl.h @@ -42,6 +42,8 @@ #ifndef _DEV_ATH_ATHIOCTL_H #define _DEV_ATH_ATHIOCTL_H +#include + struct ath_stats { u_int32_t ast_watchdog; /* device reset by watchdog */ u_int32_t ast_hardware; /* fatal hardware error interrupts */ diff --git a/ath/if_athrate.h b/ath/if_athrate.h index d8f251c..ff4beaf 100644 --- a/ath/if_athrate.h +++ b/ath/if_athrate.h @@ -110,13 +110,14 @@ void ath_rate_node_cleanup(struct ath_softc *, struct ath_node *); */ void ath_rate_newassoc(struct ath_softc *, struct ath_node *, int isNewAssociation); +#ifdef BLE /* * Update/reset rate control state for 802.11 state transitions. * Important mostly as the analog to ath_rate_newassoc when operating * in station mode. */ void ath_rate_newstate(struct ath_softc *, enum ieee80211_state); - +#endif /* * Transmit handling. */ diff --git a/ath/if_athvar.h b/ath/if_athvar.h index 3320729..16edb96 100644 --- a/ath/if_athvar.h +++ b/ath/if_athvar.h @@ -43,11 +43,11 @@ #define _DEV_ATH_ATHVAR_H #include "ah.h" -#include "../net80211/ieee80211_radiotap.h" #include "if_athioctl.h" #include "if_athrate.h" #include +#include #ifndef ARPHRD_IEEE80211_RADIOTAP #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ @@ -153,7 +153,9 @@ typedef void irqreturn_t; /* driver-specific node state */ struct ath_node { +#ifdef BLE struct ieee80211_node an_node; /* base class */ +#endif u_int8_t an_tx_mgtrate; /* h/w rate for management/ctl frames */ u_int8_t an_tx_mgtratesp;/* short preamble h/w rate for " " */ u_int32_t an_avgrssi; /* average rssi over all rx frames */ @@ -175,20 +177,20 @@ struct ath_node { } while (0) struct ath_buf { - STAILQ_ENTRY(ath_buf) bf_list; + struct list_head bf_list; //int bf_nseg; int bf_flags; /* tx descriptor flags */ struct ath_desc *bf_desc; /* virtual addr of desc */ dma_addr_t bf_daddr; /* physical addr of desc */ struct sk_buff *bf_skb; /* skbuff for buf */ dma_addr_t bf_skbaddr; /* physical addr of skb data */ +#ifdef BLE struct ieee80211_node *bf_node; /* pointer to the node */ +#endif }; -typedef STAILQ_HEAD(, ath_buf) ath_bufhead; struct ath_hal; struct ath_desc; -struct proc_dir_entry; /* * Data transmit queue state. One of these exists for each @@ -204,7 +206,7 @@ struct ath_txq { u_int axq_depth; /* queue depth (stat only) */ u_int axq_intrcnt; /* interrupt count */ u_int32_t *axq_link; /* link ptr in last TX desc */ - STAILQ_HEAD(, ath_buf) axq_q; /* transmit queue */ + struct list_head axq_q; /* transmit queue */ spinlock_t axq_lock; /* lock on q and link */ /* * State for patching up CTS when bursting. @@ -246,10 +248,15 @@ struct ath_softc { struct semaphore sc_lock; /* dev-level lock */ struct net_device_stats sc_devstats; /* device statistics */ struct ath_stats sc_stats; /* private statistics */ + struct ieee80211_hw sc_hw; /* IEEE 802.11 common */ +#ifdef BLE struct ieee80211com sc_ic; /* IEEE 802.11 common */ +#endif + enum ieee80211_if_types sc_opmode; int sc_regdomain; int sc_countrycode; int sc_debug; +#ifdef BLE void (*sc_recv_mgmt)(struct ieee80211com *, struct sk_buff *, struct ieee80211_node *, @@ -257,6 +264,7 @@ struct ath_softc { int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int); void (*sc_node_free)(struct ieee80211_node *); +#endif void *sc_bdev; /* associated bus device */ struct ath_desc *sc_desc; /* TX/RX descriptors */ size_t sc_desc_len; /* size of TX/RX descriptors */ @@ -280,9 +288,9 @@ struct ath_softc { sc_hasclrkey:1, /* CLR key supported */ sc_rawdev_enabled : 1; /* enable sc_rawdev */ /* rate tables */ - const AR5K_RATE_TABLE *sc_rates[IEEE80211_MODE_MAX]; + const AR5K_RATE_TABLE *sc_rates[NUM_IEEE80211_MODES]; const AR5K_RATE_TABLE *sc_currates; /* current rate table */ - enum ieee80211_phymode sc_curmode; /* current phy mode */ + unsigned int sc_curmode; /* current phy mode */ u_int16_t sc_curtxpow; /* current tx power limit */ AR5K_CHANNEL sc_curchan; /* current h/w channel */ u_int8_t sc_rixmap[256]; /* IEEE to h/w rate table ix */ @@ -297,8 +305,10 @@ struct ath_softc { u_int sc_txantenna; /* tx antenna (fixed or auto) */ AR5K_INT sc_imask; /* interrupt mask copy */ u_int sc_keymax; /* size of key cache */ +#ifdef BLE u_int8_t sc_keymap[ATH_KEYBYTES];/* key use bit map */ struct ieee80211_node *sc_keyixmap[ATH_KEYMAX];/* key ix->node map */ +#endif u_int sc_ledpin; /* GPIO pin for driving LED */ u_int sc_ledon; /* pin setting for LED on */ @@ -325,14 +335,14 @@ struct ath_softc { struct tq_struct sc_radartq; /* Radar detection */ int sc_rxbufsize; /* rx size based on mtu */ - ath_bufhead sc_rxbuf; /* receive buffer */ + struct list_head *sc_rxbuf; /* receive buffer */ u_int32_t *sc_rxlink; /* link ptr in last RX desc */ struct tq_struct sc_rxtq; /* rx intr tasklet */ struct tq_struct sc_rxorntq; /* rxorn intr tasklet */ u_int8_t sc_defant; /* current default antenna */ u_int8_t sc_rxotherant; /* rx's on non-default antenna*/ - ath_bufhead sc_txbuf; /* transmit buffer */ + struct list_head *sc_txbuf; /* transmit buffer */ spinlock_t sc_txbuflock; /* txbuf lock */ int sc_tx_timer; /* transmit timeout */ u_int sc_txqsetup; /* h/w queues setup */ @@ -341,13 +351,15 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct tq_struct sc_txtq; /* tx intr tasklet */ - ath_bufhead sc_bbuf; /* beacon buffers */ + struct list_head *sc_bbuf; /* beacon buffers */ u_int sc_bhalq; /* HAL q for outgoing beacons */ u_int sc_bmisscount; /* missed beacon transmits */ u_int32_t sc_ant_tx[8]; /* recent tx frames/antenna */ struct ath_txq *sc_cabq; /* tx q for cab frames */ struct ath_buf *sc_bufptr; /* allocated buffer ptr */ +#ifdef BLE struct ieee80211_beacon_offsets sc_boff;/* dynamic update state */ +#endif struct tq_struct sc_bmisstq; /* bmiss intr tasklet */ struct tq_struct sc_bstuckq; /* stuck beacon processing */ enum { diff --git a/ath/radar.c b/ath/radar.c index adaffae..1da9edf 100644 --- a/ath/radar.c +++ b/ath/radar.c @@ -8,10 +8,7 @@ #include #include -#include "if_media.h" - -#include -#include "radar.h" +//#include "radar.h" /* diff --git a/openhal/ath5k.h b/openhal/ath5k.h index 444b97f..8fc2ad3 100644 --- a/openhal/ath5k.h +++ b/openhal/ath5k.h @@ -33,6 +33,8 @@ #ifndef _AR5K_H #define _AR5K_H +#include + /*Os dependent definitions*/ #include "ah_osdep.h" #include "ath5k_hw.h" @@ -49,14 +51,12 @@ */ #include "translation.h" -/*Use with MadWiFi/net80211*/ -#include "stack_net80211.h" - - /****************************\ GENERIC DRIVER DEFINITIONS \****************************/ +#define howmany(x, y) (((x)+((y)-1))/(y)) + /* * C doesn't support boolean ;-( * TODO: See if there is a bool definition somewere else @@ -195,6 +195,28 @@ struct ath5k_srev_name { #define AR5K_SREV_RAD_UNSUPP 0x50 +/* IEEE defs */ + +#define IEEE80211_MAX_LEN 2500 + +#define MAX_PDU_LENGTH IEEE80211_MAX_LEN +#define MODULATION_CCK IEEE80211_RATE_CCK +#define MODULATION_OFDM IEEE80211_RATE_OFDM +#define MODULATION_TURBO IEEE80211_RATE_TURBO +#define MODULATION_XR 0x00000200 /*XR thingie*/ +#define MODULATION_CCK_SP IEEE80211_RATE_CCK_2 /*CCK + Shortpreamble*/ + +#define AR5K_SET_SHORT_PREAMBLE 0x04 /* adding this flag to rate_code + enables short preamble, see ar5212_reg.h */ +#define HAS_SHPREAMBLE(_ix) (rt->rates[_ix].modulation == MODULATION_CCK_SP) +#define SHPREAMBLE_FLAG(_ix) HAS_SHPREAMBLE(_ix)?AR5K_SET_SHORT_PREAMBLE:0 + +typedef enum { + AR5K_M_STA = IEEE80211_IF_TYPE_STA, + AR5K_M_IBSS = IEEE80211_IF_TYPE_IBSS, + AR5K_M_HOSTAP = IEEE80211_IF_TYPE_AP, + AR5K_M_MONITOR = IEEE80211_IF_TYPE_MNTR, +} AR5K_OPMODE; /****************\ diff --git a/openhal/stack_d80211.h b/openhal/stack_d80211.h deleted file mode 100644 index fbcde4f..0000000 --- a/openhal/stack_d80211.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2006-2007 Nick Kossifidis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id$ - */ - -/*d80211 definitions needed for use with dadwifi*/ -#include - -#define IEEE80211_MAX_LEN 2500 - -#define MAX_PDU_LENGTH IEEE80211_MAX_LEN -#define MODULATION_CCK IEEE80211_RATE_CCK -#define MODULATION_OFDM IEEE80211_RATE_OFDM -#define MODULATION_TURBO IEEE80211_RATE_TURBO -#define MODULATION_XR 0x00000200 /*XR thingie*/ -#define MODULATION_CCK_SP IEEE80211_RATE_CCK_2 /*CCK + Shortpreamble*/ - -#define AR5K_SET_SHORT_PREAMBLE 0x04 /* adding this flag to rate_code - enables short preamble, see ar5212_reg.h */ -#define HAS_SHPREAMBLE(_ix) (rt->rates[_ix].modulation == MODULATION_CCK_SP) -#define SHPREAMBLE_FLAG(_ix) HAS_SHPREAMBLE(_ix)?AR5K_SET_SHORT_PREAMBLE:0 - -typedef enum { - AR5K_M_STA = IEEE80211_IF_TYPE_STA, - AR5K_M_IBSS = IEEE80211_IF_TYPE_IBSS, - AR5K_M_HOSTAP = IEEE80211_IF_TYPE_AP, - AR5K_M_MONITOR = IEEE80211_IF_TYPE_MNTR, -}AR5K_OPMODE; diff --git a/openhal/stack_net80211.h b/openhal/stack_net80211.h deleted file mode 100644 index 7c218bf..0000000 --- a/openhal/stack_net80211.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2006-2007 Nick Kossifidis - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $Id$ - */ - -/*net80211 definitions needed for use with madwifi*/ -#include -#include - -#define MAX_PDU_LENGTH IEEE80211_MAX_LEN -#define MODULATION_CCK IEEE80211_T_CCK -#define MODULATION_OFDM IEEE80211_T_OFDM -#define MODULATION_TURBO IEEE80211_T_TURBO -#define MODULATION_XR 7 /*XR thingie*/ -#define MODULATION_CCK_SP 8 /*CCK + Shortpreamble*/ - -#define AR5K_SET_SHORT_PREAMBLE 0x04 /* adding this flag to rate_code - enables short preamble, see ar5212_reg.h */ -#define HAS_SHPREAMBLE(_ix) (rt->rates[_ix].modulation == MODULATION_CCK_SP) -#define SHPREAMBLE_FLAG(_ix) HAS_SHPREAMBLE(_ix)?AR5K_SET_SHORT_PREAMBLE:0 - -typedef enum { - AR5K_M_STA = IEEE80211_M_STA, - AR5K_M_IBSS = IEEE80211_M_IBSS, - AR5K_M_HOSTAP = IEEE80211_M_HOSTAP, - AR5K_M_MONITOR = IEEE80211_M_MONITOR, -}AR5K_OPMODE;