[Madwifi-cvs] revision 2479 committed
Status: Beta
Brought to you by:
otaku
From: Michael T. <svn...@ma...> - 2007-06-17 08:46:11
|
Project : madwifi Revision : 2479 Author : mtaylor (Michael Taylor) Date : 2007-06-17 10:45:26 +0200 (Sun, 17 Jun 2007) Log Message : Sync changes from trunk 2478 Affected Files: * branches/madwifi-dfs/ath/if_ath.c updated * branches/madwifi-dfs/ath/if_ath_hal.h updated * branches/madwifi-dfs/ath/if_ath_radar.c updated * branches/madwifi-dfs/ath/if_ath_radar.h updated * branches/madwifi-dfs/ath/if_athvar.h updated * branches/madwifi-dfs/ath_hal/ah_os.c updated * branches/madwifi-dfs/ath_hal/ah_os.h updated * branches/madwifi-dfs/net80211/ieee80211.h updated * branches/madwifi-dfs/net80211/ieee80211_wireless.c updated * branches/madwifi-dfs/scripts/if_ath_hal_settings.pl updated Modified: branches/madwifi-dfs/ath/if_ath.c =================================================================== --- branches/madwifi-dfs/ath/if_ath.c 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/ath/if_ath.c 2007-06-17 08:45:26 UTC (rev 2479) @@ -1,4 +1,4 @@ -/* +/*- * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting * All rights reserved. * @@ -226,7 +226,7 @@ static void ath_newassoc(struct ieee80211_node *, int); static int ath_getchannels(struct net_device *, u_int, HAL_BOOL, HAL_BOOL); static void ath_led_event(struct ath_softc *, int); -void ath_update_txpow(struct ath_softc *); +static void ath_update_txpow(struct ath_softc *); #ifdef ATH_REVERSE_ENGINEERING /* Reverse engineering utility commands */ @@ -961,7 +961,6 @@ #ifdef ATH_TX99_DIAG printk("%s: TX99 support enabled\n", DEV_NAME(dev)); #endif - sc->sc_invalid = 0; if (autocreate) { @@ -1005,7 +1004,7 @@ ath_desc_free(sc); bad: if (ah) - ath_hal_detach(ah); + _ath_hal_detach(ah); ATH_TXBUF_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); ATH_HAL_LOCK_DESTROY(sc); @@ -1058,7 +1057,7 @@ ieee80211_rate_detach(sc->sc_rc); ath_desc_free(sc); ath_tx_cleanup(sc); - ath_hal_detach(ah); + _ath_hal_detach(ah); ath_dynamic_sysctl_unregister(sc); ATH_LOCK_DESTROY(sc); @@ -1911,7 +1910,7 @@ HAL_STATUS status; int error = 0; - ATH_LOCK_IRQ(sc); + ATH_LOCK(sc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: mode %d\n", __func__, ic->ic_opmode); @@ -1963,6 +1962,12 @@ if (sc->sc_softled) ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); + /* + * This is needed only to setup initial state + * but it's best done after a reset. + */ + ath_update_txpow(sc); + ath_radar_update(sc); /* * Setup the hardware after reset: the key cache @@ -2006,7 +2011,7 @@ #endif done: - ATH_UNLOCK_IRQ(sc); + ATH_UNLOCK(sc); return error; } @@ -2091,7 +2096,7 @@ struct ath_softc *sc = dev->priv; int error; - ATH_LOCK_IRQ(sc); + ATH_LOCK(sc); if (!sc->sc_invalid) ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE, AH_TRUE); @@ -2112,7 +2117,7 @@ ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); } #endif - ATH_UNLOCK_IRQ(sc); + ATH_UNLOCK(sc); return error; } @@ -2217,6 +2222,8 @@ if (!ath_hal_reset(ah, sc->sc_opmode, &sc->sc_curchan, AH_TRUE, &status)) printk("%s: %s: unable to reset hardware: '%s' (HAL status %u)\n", DEV_NAME(dev), __func__, ath_get_hal_status_desc(status), status); + ath_update_txpow(sc); /* update tx power state */ + ath_radar_update(sc); if (ath_startrecv(sc) != 0) /* restart recv */ printk("%s: %s: unable to start recv logic\n", DEV_NAME(dev), __func__); @@ -2250,9 +2257,11 @@ return 0; } + /* Swap transmit descriptor. * if AH_NEED_DESC_SWAP flag is not defined this becomes a "null" - * function. */ + * function. + */ static __inline void ath_desc_swap(struct ath_desc *ds) { @@ -2276,6 +2285,7 @@ struct ath_desc *lastds, int framelen) { struct ath_hal *ah = sc->sc_ah; + if (ath_check_radio_silence_not_required(sc,__func__)) return; /* @@ -4975,7 +4985,7 @@ /* * move data from Normal txqs to XR queue. */ - DPRINTF(sc, ATH_DEBUG_XMIT_PROC, "move data from NORMAL to XR\n"); + printk("move data from NORMAL to XR\n"); /* * collect all the data towards the node * in to the tmp_q. @@ -7800,8 +7810,6 @@ sc->sc_tx_th.wt_chan_flags = sc->sc_rx_th.wr_chan_flags = htole16(chan->ic_flags); #endif - ath_update_txpow(sc); - printk(KERN_INFO "%s: %s: Maximum txpower: %d.\n", DEV_NAME(sc->sc_dev), __func__, ( ath_get_real_maxtxpower(sc) / 2) ); if (ic->ic_curchanmaxpwr == 0) ic->ic_curchanmaxpwr = chan->ic_maxregpower; } @@ -7851,11 +7859,9 @@ /* Stop any pending channel calibrations or availability check if we are really changing channels. maybe a turbo mode switch only. */ - if (hchan.channel != sc->sc_curchan.channel) { - if (!sc->sc_dfs_testmode && sc->sc_dfs_channel_check) { - ath_interrupt_dfs_channel_check(sc, "Channel change interrupted DFS wait."); - } - } + if (hchan.channel != sc->sc_curchan.channel) + if (!sc->sc_dfs_testmode && sc->sc_dfs_channel_check) + ath_interrupt_dfs_channel_check(sc, "Channel change interrupted DFS wait."); /* Need a doth channel availability check? We do if ... */ doth_channel_availability_check_needed = 1 @@ -7866,10 +7872,9 @@ && (ic->ic_flags & IEEE80211_F_DOTH) ; - channel_change_required = hchan.channel != sc->sc_curchan.channel - || hchan.channelFlags != sc->sc_curchan.channelFlags - || tswitch || doth_channel_availability_check_needed - ; + channel_change_required = hchan.channel != sc->sc_curchan.channel || + hchan.channelFlags != sc->sc_curchan.channelFlags || + tswitch || doth_channel_availability_check_needed; if (channel_change_required) { HAL_STATUS status; @@ -7907,10 +7912,11 @@ ath_hal_gpioCfgOutput(ah, sc->sc_ledpin); sc->sc_curchan = hchan; - /* - * Change channels and update the h/w rate map - * if we're switching; e.g. 11a to 11b/g. - */ + ath_update_txpow(sc); /* update tx power state */ + ath_radar_update(sc); + + /* Change channels and update the h/w rate map + * if we're switching; e.g. 11a to 11b/g. */ ath_chan_change(sc, chan); /* * Re-enable rx framework. @@ -9289,7 +9295,7 @@ mac->sa_data[0], mac->sa_data[1], mac->sa_data[2], mac->sa_data[3], mac->sa_data[4], mac->sa_data[5]); - ATH_LOCK_IRQ(sc); + ATH_LOCK(sc); /* XXX not right for multiple VAPs */ IEEE80211_ADDR_COPY(ic->ic_myaddr, mac->sa_data); IEEE80211_ADDR_COPY(dev->dev_addr, mac->sa_data); @@ -9297,7 +9303,7 @@ if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { error = ath_reset(dev); } - ATH_UNLOCK_IRQ(sc); + ATH_UNLOCK(sc); return error; } @@ -9315,7 +9321,7 @@ } DPRINTF(sc, ATH_DEBUG_ANY, "%s: %d\n", __func__, mtu); - ATH_LOCK_IRQ(sc); + ATH_LOCK(sc); dev->mtu = mtu; if ((dev->flags & IFF_RUNNING) && !sc->sc_invalid) { /* NB: the rx buffers may need to be reallocated */ @@ -9323,7 +9329,7 @@ error = ath_reset(dev); tasklet_enable(&sc->sc_rxtq); } - ATH_UNLOCK_IRQ(sc); + ATH_UNLOCK(sc); return error; } @@ -9394,45 +9400,39 @@ { struct ath_softc *sc = dev->priv; struct ieee80211com *ic = &sc->sc_ic; - int error = -EINVAL; + int error; - if(SIOC80211IFCREATE == cmd) { - /* XXX: ATH_UNLOCK and ATH_LOCK are temporary evil until I - * figure out a fix for ieee80211_ioctl_create_vap working - * when interrupts are disabled */ - ATH_LOCK(sc); + ATH_LOCK(sc); + switch (cmd) { + case SIOCGATHSTATS: + sc->sc_stats.ast_tx_packets = sc->sc_devstats.tx_packets; + sc->sc_stats.ast_rx_packets = sc->sc_devstats.rx_packets; + sc->sc_stats.ast_rx_rssi = ieee80211_getrssi(ic); + if (copy_to_user(ifr->ifr_data, &sc->sc_stats, sizeof (sc->sc_stats))) + error = -EFAULT; + else + error = 0; + break; + case SIOCGATHDIAG: + if (!capable(CAP_NET_ADMIN)) + error = -EPERM; + else + error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); + break; + case SIOCETHTOOL: + if (copy_from_user(&cmd, ifr->ifr_data, sizeof(cmd))) + error = -EFAULT; + else + error = ath_ioctl_ethtool(sc, cmd, ifr->ifr_data); + break; + case SIOC80211IFCREATE: error = ieee80211_ioctl_create_vap(ic, ifr, dev); - ATH_UNLOCK(sc); + break; + default: + error = -EINVAL; + break; } - else { - ATH_LOCK_IRQ(sc); - switch (cmd) { - case SIOCGATHSTATS: - sc->sc_stats.ast_tx_packets = sc->sc_devstats.tx_packets; - sc->sc_stats.ast_rx_packets = sc->sc_devstats.rx_packets; - sc->sc_stats.ast_rx_rssi = ieee80211_getrssi(ic); - if (copy_to_user(ifr->ifr_data, &sc->sc_stats, sizeof (sc->sc_stats))) - error = -EFAULT; - else - error = 0; - break; - case SIOCGATHDIAG: - if (!capable(CAP_NET_ADMIN)) - error = -EPERM; - else - error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); - break; - case SIOCETHTOOL: - if (copy_from_user(&cmd, ifr->ifr_data, sizeof(cmd))) - error = -EFAULT; - else - error = ath_ioctl_ethtool(sc, cmd, ifr->ifr_data); - break; - default: - break; - } - ATH_UNLOCK_IRQ(sc); - } + ATH_UNLOCK(sc); return error; } @@ -9466,10 +9466,9 @@ ATH_DIVERSITY = 11, ATH_TXINTRPERIOD = 12, ATH_FFTXQMIN = 18, - ATH_TKIPMIC = 19, - ATH_XR_POLL_PERIOD = 20, - ATH_XR_POLL_COUNT = 21, - ATH_ACKRATE = 22, + ATH_XR_POLL_PERIOD = 19, + ATH_XR_POLL_COUNT = 20, + ATH_ACKRATE = 21, }; static int @@ -9478,11 +9477,11 @@ struct ath_softc *sc = ctl->extra1; struct ath_hal *ah = sc->sc_ah; u_int val; - int ret; + int ret = 0; - ATH_LOCK_IRQ(sc); ctl->data = &val; ctl->maxlen = sizeof(val); + ATH_LOCK(sc); if (write) { ret = ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos); if (ret == 0) { @@ -9551,11 +9550,15 @@ * 0 = disallow use of diversity * 1 = allow use of diversity */ - if (val > 1) + if (val > 1) { ret = -EINVAL; + break; + } /* Don't enable diversity if XR is enabled */ - if (((!sc->sc_hasdiversity) || (sc->sc_xrtxq != NULL)) && val) + if (((!sc->sc_hasdiversity) || (sc->sc_xrtxq != NULL)) && val) { ret = -EINVAL; + break; + } sc->sc_diversity = val; ath_hal_setdiversity(ah, val); break; @@ -9567,18 +9570,6 @@ /* XXX validate? */ sc->sc_fftxqmin = val; break; - case ATH_TKIPMIC: { - struct ieee80211com *ic = &sc->sc_ic; - - if (!(ic->ic_caps & IEEE80211_C_TKIPMIC) || - ((ic->ic_caps & IEEE80211_C_WME) && - !(ic->ic_caps & IEEE80211_C_WME_TKIPMIC) && - (ic->ic_flags & IEEE80211_F_WME))) - return -EINVAL; - - ath_hal_settkipmic(ah, val); - break; - } #ifdef ATH_SUPERG_XR case ATH_XR_POLL_PERIOD: if (val > XR_MAX_POLL_INTERVAL) @@ -9600,7 +9591,7 @@ sc->sc_ackrate = val; ath_set_ack_bitrate(sc, sc->sc_ackrate); break; - default: + default: ret = -EINVAL; break; } @@ -9646,9 +9637,6 @@ case ATH_FFTXQMIN: val = sc->sc_fftxqmin; break; - case ATH_TKIPMIC: - val = ath_hal_gettkipmic(ah); - break; #ifdef ATH_SUPERG_XR case ATH_XR_POLL_PERIOD: val=sc->sc_xrpollint; @@ -9664,9 +9652,11 @@ ret = -EINVAL; break; } - ret = ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos); + if(!ret) { + ret = ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos); + } } - ATH_UNLOCK_IRQ(sc); + ATH_UNLOCK(sc); return ret; } @@ -9743,11 +9733,6 @@ .mode = 0644, .proc_handler = ath_sysctl_halparam }, - { .ctl_name = ATH_TKIPMIC, - .procname = "tkipmic", - .mode = 0644, - .proc_handler = ath_sysctl_halparam - }, #ifdef ATH_SUPERG_XR { .ctl_name = ATH_XR_POLL_PERIOD, .procname = "xrpollperiod", @@ -10134,6 +10119,8 @@ DEV_NAME(dev), ath_get_hal_status_desc(status), status, __func__, __FILE__, __LINE__); } + ath_update_txpow(sc); + ath_radar_update(sc); #ifdef ATH_SUPERG_DYNTURBO @@ -11399,7 +11386,7 @@ } /* Handle Key Table */ - if ((address >= 0x8800) && (address < 0x9780)) { + if ((address >= 0x8800) && (address < 0x9800)) { #define keytable_entry_reg_count (8) #define keytable_entry_size (keytable_entry_reg_count * sizeof(u_int32_t)) int key = ((address - 0x8800) / keytable_entry_size); @@ -11424,7 +11411,7 @@ } /* Handle Rate Duration Table */ - if (address >= 0x8700 && address < 0x8800) { + if (address >= 0x8700 && address < 0x8780) { snprintf(buf, buflen, "RATE(%2d).DURATION", ((address - 0x8700) / sizeof(u_int32_t))); return AH_TRUE; Modified: branches/madwifi-dfs/ath/if_ath_hal.h =================================================================== --- branches/madwifi-dfs/ath/if_ath_hal.h 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/ath/if_ath_hal.h 2007-06-17 08:45:26 UTC (rev 2479) @@ -7,8 +7,6 @@ * of the struct ath_hal (usually named ah). */ -#include "if_ath_radar.h" - #ifndef _IF_ATH_HAL_H #define _IF_ATH_HAL_H @@ -307,6 +305,14 @@ ah->ah_setRxDP(ah, rxdp); ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); }) +__hal_wrapper HAL_BOOL ath_hal_reset(struct ath_hal* ah, HAL_OPMODE a1, HAL_CHANNEL* a2, HAL_BOOL bChannelChange, HAL_STATUS* status) + IMPLEMENTATION({ + HAL_BOOL ret; + ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); + ret = ah->ah_reset(ah, a1, a2, bChannelChange, status); + ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); + return ret; + }) __hal_wrapper HAL_BOOL ath_hal_setdecompmask(struct ath_hal* ah, u_int16_t a1, int a2) IMPLEMENTATION({ HAL_BOOL ret; @@ -723,19 +729,6 @@ ATH_HAL_UNLOCK_IRQ(sc); return ret; }) -/* This is implemented in if_ath.c, but we need it in ath_hal_reset. */ -extern void ath_update_txpow(struct ath_softc *); - -__hal_wrapper HAL_BOOL ath_hal_reset(struct ath_hal* ah, HAL_OPMODE opMode, HAL_CHANNEL* chan, HAL_BOOL bChannelChange, HAL_STATUS* status) - IMPLEMENTATION({ - HAL_BOOL ret; - ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); - ret = ah->ah_reset(ah, opMode, chan, bChannelChange, status); - ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); - ath_radar_update(GET_ATH_SOFTC(ah), chan); - ath_update_txpow(GET_ATH_SOFTC(ah)); - return ret; - }) __hal_wrapper HAL_BOOL ath_hal_burstsupported(struct ath_hal * ah) IMPLEMENTATION({ return (ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK); Modified: branches/madwifi-dfs/ath/if_ath_radar.c =================================================================== --- branches/madwifi-dfs/ath/if_ath_radar.c 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/ath/if_ath_radar.c 2007-06-17 08:45:26 UTC (rev 2479) @@ -152,7 +152,7 @@ } /* This is called on channel change to enable radar detection for 5211+ chips. * NOTE: AR5210 doesn't have radar pulse detection support. */ -int ath_radar_update(struct ath_softc *sc, HAL_CHANNEL* hchan) { +int ath_radar_update(struct ath_softc *sc) { struct ath_hal *ah = sc->sc_ah; struct net_device *dev = sc->sc_dev; @@ -164,11 +164,11 @@ return 1; /* Update the DFS flags (as a sanity check) */ - if (ath_radar_correct_dfs_flags(sc, hchan)) + if (ath_radar_correct_dfs_flags(sc, &sc->sc_curchan)) DPRINTF(sc, ATH_DEBUG_DOTH, "%s: %s: channel required corrections to private flags.\n", DEV_NAME(dev), __func__); - required = ath_radar_is_dfs_required(sc, hchan); + required = ath_radar_is_dfs_required(sc, &sc->sc_curchan); /* configure radar pulse detector register using default values, but do * not toggle the enable bit. XXX: allow tweaking?? */ ath_radar_set_params(sc, NULL); Modified: branches/madwifi-dfs/ath/if_ath_radar.h =================================================================== --- branches/madwifi-dfs/ath/if_ath_radar.h 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/ath/if_ath_radar.h 2007-06-17 08:45:26 UTC (rev 2479) @@ -102,7 +102,7 @@ /* This is called on channel change to enable radar detection for 5211+ chips. * NOTE: AR5210 doesn't have radar pulse detection support. */ -int ath_radar_update(struct ath_softc *sc, HAL_CHANNEL* hchan); +int ath_radar_update(struct ath_softc *sc); /* Returns true if radar detection is enabled. */ int ath_radar_is_enabled(struct ath_softc *sc); /* Read the radar pulse detection parameters. */ Modified: branches/madwifi-dfs/ath/if_athvar.h =================================================================== --- branches/madwifi-dfs/ath/if_athvar.h 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/ath/if_athvar.h 2007-06-17 08:45:26 UTC (rev 2479) @@ -534,7 +534,7 @@ struct ieee80211com sc_ic; /* NB: must be first */ struct net_device *sc_dev; void __iomem *sc_iobase; /* address of the device */ - spinlock_t sc_lock; /* dev-level lock */ + struct semaphore sc_lock; /* dev-level lock */ struct net_device_stats sc_devstats; /* device statistics */ struct ath_stats sc_stats; /* private statistics */ int devid; @@ -752,26 +752,10 @@ spin_unlock_irqrestore(&(_sc)->sc_rxbuflock, __rxbuflockflags); /* Protects the device from concurrent accesses */ -#define ATH_LOCK_INIT(_sc) spin_lock_init(&(_sc)->sc_lock) +#define ATH_LOCK_INIT(_sc) init_MUTEX(&(_sc)->sc_lock) #define ATH_LOCK_DESTROY(_sc) -#define ATH_LOCK_IRQ(_sc) do { \ - unsigned long __lockflags; \ - spin_lock_irqsave(&(_sc)->sc_lock, __lockflags); -#define ATH_UNLOCK_IRQ(_sc) \ - spin_unlock_irqrestore(&(_sc)->sc_lock, __lockflags); \ -} while (0) -#define ATH_UNLOCK_IRQ_EARLY(_sc) \ - spin_unlock_irqrestore(&(_sc)->sc_lock, __lockflags); -/* -XXX: ATH_UNLOCK and ATH_LOCK are temporary evil until I figure out a fix for - ieee80211_ioctl_create_vap working when interrupts are disabled - Ideally interrupts are disabled while we are playing with the driver - configuration. -*/ -#define ATH_UNLOCK(_sc) \ - spin_unlock(&(_sc)->sc_lock); -#define ATH_LOCK(_sc) \ - spin_lock(&(_sc)->sc_lock); +#define ATH_LOCK(_sc) down(&(_sc)->sc_lock) +#define ATH_UNLOCK(_sc) up(&(_sc)->sc_lock) int ath_attach(u_int16_t, struct net_device *, HAL_BUS_TAG); int ath_detach(struct net_device *); Modified: branches/madwifi-dfs/ath_hal/ah_os.c =================================================================== --- branches/madwifi-dfs/ath_hal/ah_os.c 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/ath_hal/ah_os.c 2007-06-17 08:45:26 UTC (rev 2479) @@ -96,7 +96,7 @@ } void -ath_hal_detach(struct ath_hal *ah) +_ath_hal_detach(struct ath_hal *ah) { (*ah->ah_detach)(ah); AH_MOD_DEC_USE_COUNT(THIS_MODULE); @@ -564,7 +564,7 @@ EXPORT_SYMBOL(ath_hal_probe); EXPORT_SYMBOL(_ath_hal_attach); -EXPORT_SYMBOL(ath_hal_detach); +EXPORT_SYMBOL(_ath_hal_detach); EXPORT_SYMBOL(ath_hal_init_channels); EXPORT_SYMBOL(ath_hal_getwirelessmodes); EXPORT_SYMBOL(ath_hal_computetxtime); Modified: branches/madwifi-dfs/ath_hal/ah_os.h =================================================================== --- branches/madwifi-dfs/ath_hal/ah_os.h 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/ath_hal/ah_os.h 2007-06-17 08:45:26 UTC (rev 2479) @@ -222,6 +222,6 @@ */ extern struct ath_hal *_ath_hal_attach(u_int16_t devid, HAL_SOFTC, HAL_BUS_TAG, HAL_BUS_HANDLE, HAL_STATUS*); -extern void ath_hal_detach(struct ath_hal *); +extern void _ath_hal_detach(struct ath_hal *); #endif /* _ATH_AH_OSDEP_H_ */ Modified: branches/madwifi-dfs/net80211/ieee80211.h =================================================================== --- branches/madwifi-dfs/net80211/ieee80211.h 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/net80211/ieee80211.h 2007-06-17 08:45:26 UTC (rev 2479) @@ -433,13 +433,13 @@ * WME/802.11e information element. */ struct ieee80211_ie_wme { - u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */ - u_int8_t wme_len; /* length in bytes */ + u_int8_t wme_id; /* IEEE80211_ELEMID_VENDOR */ + u_int8_t wme_len; /* length in bytes */ u_int8_t wme_oui[3]; /* 0x00, 0x50, 0xf2 */ - u_int8_t wme_type; /* OUI type */ + u_int8_t wme_type; /* OUI type */ u_int8_t wme_subtype; /* OUI subtype */ u_int8_t wme_version; /* spec revision */ - u_int8_t wme_info; /* QoS info */ + u_int8_t wme_info; /* QoS info */ } __packed; /* @@ -734,6 +734,8 @@ IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ }; +#define IEEE80211_CHANSWITCHANN_BYTES 5 + struct ieee80211_tim_ie { u_int8_t tim_ie; /* IEEE80211_ELEMID_TIM */ u_int8_t tim_len; @@ -756,6 +758,8 @@ #define IEEE80211_CHALLENGE_LEN 128 +#define IEEE80211_SUPPCHAN_LEN 26 + #define IEEE80211_RATE_BASIC 0x80 #define IEEE80211_RATE_VAL 0x7f @@ -873,12 +877,14 @@ IEEE80211_REASON_NOT_ASSOCED = 7, IEEE80211_REASON_ASSOC_LEAVE = 8, IEEE80211_REASON_ASSOC_NOT_AUTHED = 9, + IEEE80211_REASON_PWRCAP_UNACCEPTABLE = 10, IEEE80211_REASON_SUPPCHAN_UNACCEPTABLE = 11, IEEE80211_REASON_RSN_REQUIRED = 11, IEEE80211_REASON_RSN_INCONSISTENT = 12, IEEE80211_REASON_IE_INVALID = 13, IEEE80211_REASON_MIC_FAILURE = 14, + IEEE80211_STATUS_SUCCESS = 0, IEEE80211_STATUS_UNSPECIFIED = 1, IEEE80211_STATUS_CAPINFO = 10, Modified: branches/madwifi-dfs/net80211/ieee80211_wireless.c =================================================================== --- branches/madwifi-dfs/net80211/ieee80211_wireless.c 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/net80211/ieee80211_wireless.c 2007-06-17 08:45:26 UTC (rev 2479) @@ -47,7 +47,7 @@ #include <linux/module.h> #include <linux/netdevice.h> #include <linux/utsname.h> -#include <linux/if_arp.h> /* XXX for ARPHRD_ETHER */ +#include <linux/if_arp.h> /* for ARPHRD_ETHER */ #include <linux/delay.h> #include <linux/wireless.h> @@ -2436,15 +2436,38 @@ break; case IEEE80211_PARAM_WMM: if (ic->ic_caps & IEEE80211_C_WME){ + retv = ENETRESET; /* Renegotiate for capabilities */ + if (value) { - vap->iv_flags |= IEEE80211_F_WME; - vap->iv_ic->ic_flags |= IEEE80211_F_WME; /* XXX needed by ic_reset */ + /* All TKIP keys need resetting to use software MIC. + * They aren't, so this is disabled. + * XXX: Can never turn it back on. */ + if (!(vap->iv_ic->ic_caps & IEEE80211_C_WME_TKIPMIC)) + retv = EBUSY; + else { + vap->iv_flags |= IEEE80211_F_WME; + vap->iv_ic->ic_flags |= IEEE80211_F_WME; + } } else { vap->iv_flags &= ~IEEE80211_F_WME; - vap->iv_ic->ic_flags &= ~IEEE80211_F_WME; /* XXX needed by ic_reset */ + + { + struct ieee80211vap *v = NULL; + int all = 1; + + TAILQ_FOREACH(v, &vap->iv_ic->ic_vaps, iv_next) { + if (v->iv_flags & IEEE80211_F_WME) { + all = 0; + break; + } + } + + if (all) + vap->iv_ic->ic_flags &= ~IEEE80211_F_WME; + } } - retv = ENETRESET; /* Renegotiate for capabilities */ } + break; case IEEE80211_PARAM_HIDESSID: if (value) @@ -2766,7 +2789,8 @@ /* set the same params on the xr vap device if exists */ if (vap->iv_xrvap && !(vap->iv_flags & IEEE80211_F_XR)) { ieee80211_ioctl_setparam(vap->iv_xrvap->iv_dev, info, w, extra); - vap->iv_xrvap->iv_ath_cap &= IEEE80211_ATHC_XR; /* XR vap does not support any superG features */ + /* XR vap does not support any superG features */ + vap->iv_xrvap->iv_ath_cap &= IEEE80211_ATHC_XR; } /* * do not reset the xr vap , which is automatically Modified: branches/madwifi-dfs/scripts/if_ath_hal_settings.pl =================================================================== --- branches/madwifi-dfs/scripts/if_ath_hal_settings.pl 2007-06-17 08:34:51 UTC (rev 2478) +++ branches/madwifi-dfs/scripts/if_ath_hal_settings.pl 2007-06-17 08:45:26 UTC (rev 2479) @@ -69,6 +69,7 @@ "ah_radarWait" => "ath_hal_radar_wait", "ah_releaseTxQueue" => "ath_hal_releasetxqueue", "ah_reqTxIntrDesc" => "ath_hal_txreqintrdesc", + "ah_reset" => "ath_hal_reset", "ah_resetKeyCacheEntry" => "ath_hal_keyreset", "ah_resetStationBeaconTimers" => "ath_hal_beaconreset", "ah_resetTsf" => "ath_hal_resettsf", @@ -119,7 +120,8 @@ # List any functions that should NOT be generated here (such as those that conflict with # other functions, perhaps. # -@hal_functions_not_to_wrap = ( "ah_detach", "ah_reset" ); +@hal_functions_not_to_wrap = ( "ah_detach" ); + # # Boilerplate text # @@ -141,8 +143,6 @@ $header_for_h = <<EOF $header_comment -#include "if_ath_radar.h" - #ifndef _IF_ATH_HAL_H #define _IF_ATH_HAL_H @@ -191,19 +191,6 @@ ATH_HAL_UNLOCK_IRQ(sc); return ret; }) -/* This is implemented in if_ath.c, but we need it in ath_hal_reset. */ -extern void ath_update_txpow(struct ath_softc *); - -__hal_wrapper HAL_BOOL ath_hal_reset(struct ath_hal* ah, HAL_OPMODE opMode, HAL_CHANNEL* chan, HAL_BOOL bChannelChange, HAL_STATUS* status) - IMPLEMENTATION({ - HAL_BOOL ret; - ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); - ret = ah->ah_reset(ah, opMode, chan, bChannelChange, status); - ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); - ath_radar_update(GET_ATH_SOFTC(ah), chan); - ath_update_txpow(GET_ATH_SOFTC(ah)); - return ret; - }) __hal_wrapper HAL_BOOL ath_hal_burstsupported(struct ath_hal * ah) IMPLEMENTATION({ return (ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK); |