Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215327
b: refs/heads/master
c: a5901cb
h: refs/heads/master
i:
  215325: da5ddba
  215323: 48945f7
  215319: 0c6de94
  215311: 389ff26
  215295: 55b3d53
v: v3
  • Loading branch information
Wey-Yi Guy committed Oct 12, 2010
1 parent 38f48a8 commit b93d998
Show file tree
Hide file tree
Showing 91 changed files with 595 additions and 1,121 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a13c8f3133b250e732c383b1c390d625e755db03
refs/heads/master: a5901cbb5783b25fa71536503bfa4617d8ee41bd
3 changes: 2 additions & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6314,7 +6314,8 @@ L: linux-wireless@vger.kernel.org
W: http://wireless.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
S: Maintained
F: drivers/net/wireless/wl1251/*
F: drivers/net/wireless/wl12xx/*
X: drivers/net/wireless/wl12xx/wl1271*

WL1271 WIRELESS DRIVER
M: Luciano Coelho <luciano.coelho@nokia.com>
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ source "drivers/net/wireless/libertas/Kconfig"
source "drivers/net/wireless/orinoco/Kconfig"
source "drivers/net/wireless/p54/Kconfig"
source "drivers/net/wireless/rt2x00/Kconfig"
source "drivers/net/wireless/wl1251/Kconfig"
source "drivers/net/wireless/wl12xx/Kconfig"
source "drivers/net/wireless/zd1211rw/Kconfig"

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ obj-$(CONFIG_ATH_COMMON) += ath/

obj-$(CONFIG_MAC80211_HWSIM) += mac80211_hwsim.o

obj-$(CONFIG_WL1251) += wl1251/
obj-$(CONFIG_WL12XX) += wl12xx/
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx/

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/at76c50x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,8 @@ static void at76_rx_tasklet(unsigned long param)

if (priv->device_unplugged) {
at76_dbg(DBG_DEVSTART, "device unplugged");
at76_dbg(DBG_DEVSTART, "urb status %d", urb->status);
if (urb)
at76_dbg(DBG_DEVSTART, "urb status %d", urb->status);
return;
}

Expand Down
16 changes: 0 additions & 16 deletions trunk/drivers/net/wireless/ath/ath.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <linux/skbuff.h>
#include <linux/if_ether.h>
#include <linux/spinlock.h>
#include <net/mac80211.h>

/*
Expand All @@ -43,13 +42,6 @@ struct ath_ani {
struct timer_list timer;
};

struct ath_cycle_counters {
u32 cycles;
u32 rx_busy;
u32 rx_frame;
u32 tx_frame;
};

enum ath_device_state {
ATH_HW_UNAVAILABLE,
ATH_HW_INITIALIZED,
Expand Down Expand Up @@ -153,12 +145,6 @@ struct ath_common {
DECLARE_BITMAP(tkip_keymap, ATH_KEYMAX);
enum ath_crypt_caps crypt_caps;

unsigned int clockrate;

spinlock_t cc_lock;
struct ath_cycle_counters cc_ani;
struct ath_cycle_counters cc_survey;

struct ath_regulatory regulatory;
const struct ath_ops *ops;
const struct ath_bus_ops *bus_ops;
Expand All @@ -175,7 +161,5 @@ int ath_key_config(struct ath_common *common,
struct ieee80211_sta *sta,
struct ieee80211_key_conf *key);
bool ath_hw_keyreset(struct ath_common *common, u16 entry);
void ath_hw_cycle_counters_update(struct ath_common *common);
int32_t ath_hw_get_listen_time(struct ath_common *common);

#endif /* ATH_H */
41 changes: 27 additions & 14 deletions trunk/drivers/net/wireless/ath/ath5k/ani.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,28 +355,41 @@ ath5k_ani_lower_immunity(struct ath5k_hw *ah, struct ath5k_ani_state *as)


/**
* ath5k_hw_ani_get_listen_time() - Update counters and return listening time
* ath5k_hw_ani_get_listen_time() - Calculate time spent listening
*
* Return an approximation of the time spent "listening" in milliseconds (ms)
* since the last call of this function.
* Save a snapshot of the counter values for debugging/statistics.
* since the last call of this function by deducting the cycles spent
* transmitting and receiving from the total cycle count.
* Save profile count values for debugging/statistics and because we might want
* to use them later.
*
* We assume no one else clears these registers!
*/
static int
ath5k_hw_ani_get_listen_time(struct ath5k_hw *ah, struct ath5k_ani_state *as)
{
struct ath_common *common = ath5k_hw_common(ah);
int listen;

spin_lock_bh(&common->cc_lock);

ath_hw_cycle_counters_update(common);
memcpy(&as->last_cc, &common->cc_ani, sizeof(as->last_cc));

/* clears common->cc_ani */
listen = ath_hw_get_listen_time(common);

spin_unlock_bh(&common->cc_lock);

/* freeze */
ath5k_hw_reg_write(ah, AR5K_MIBC_FMC, AR5K_MIBC);
/* read */
as->pfc_cycles = ath5k_hw_reg_read(ah, AR5K_PROFCNT_CYCLE);
as->pfc_busy = ath5k_hw_reg_read(ah, AR5K_PROFCNT_RXCLR);
as->pfc_tx = ath5k_hw_reg_read(ah, AR5K_PROFCNT_TX);
as->pfc_rx = ath5k_hw_reg_read(ah, AR5K_PROFCNT_RX);
/* clear */
ath5k_hw_reg_write(ah, 0, AR5K_PROFCNT_TX);
ath5k_hw_reg_write(ah, 0, AR5K_PROFCNT_RX);
ath5k_hw_reg_write(ah, 0, AR5K_PROFCNT_RXCLR);
ath5k_hw_reg_write(ah, 0, AR5K_PROFCNT_CYCLE);
/* un-freeze */
ath5k_hw_reg_write(ah, 0, AR5K_MIBC);

/* TODO: where does 44000 come from? (11g clock rate?) */
listen = (as->pfc_cycles - as->pfc_rx - as->pfc_tx) / 44000;

if (as->pfc_cycles == 0 || listen < 0)
return 0;
return listen;
}

Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/wireless/ath/ath5k/ani.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ struct ath5k_ani_state {
unsigned int cck_errors;

/* debug/statistics only: numbers from last ANI calibration */
struct ath_cycle_counters last_cc;
unsigned int pfc_tx;
unsigned int pfc_rx;
unsigned int pfc_busy;
unsigned int pfc_cycles;
unsigned int last_listen;
unsigned int last_ofdm_errors;
unsigned int last_cck_errors;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath5k/ath5k.h
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ void ath5k_hw_set_ack_bitrate_high(struct ath5k_hw *ah, bool high);
/* Clock rate related functions */
unsigned int ath5k_hw_htoclock(struct ath5k_hw *ah, unsigned int usec);
unsigned int ath5k_hw_clocktoh(struct ath5k_hw *ah, unsigned int clock);
void ath5k_hw_set_clockrate(struct ath5k_hw *ah);
unsigned int ath5k_hw_get_clockrate(struct ath5k_hw *ah);

/* Queue Control Unit, DFS Control Unit Functions */
int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue,
Expand Down
66 changes: 26 additions & 40 deletions trunk/drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
#include "reg.h"
#include "debug.h"
#include "ani.h"
#include "../debug.h"

static int modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
Expand Down Expand Up @@ -518,14 +517,12 @@ struct ath_vif_iter_data {
bool need_set_hw_addr;
bool found_active;
bool any_assoc;
enum nl80211_iftype opmode;
};

static void ath_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
{
struct ath_vif_iter_data *iter_data = data;
int i;
struct ath5k_vif *avf = (void *)vif->drv_priv;

if (iter_data->hw_macaddr)
for (i = 0; i < ETH_ALEN; i++)
Expand All @@ -542,34 +539,13 @@ static void ath_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
iter_data->need_set_hw_addr = false;

if (!iter_data->any_assoc) {
struct ath5k_vif *avf = (void *)vif->drv_priv;
if (avf->assoc)
iter_data->any_assoc = true;
}

/* Calculate combined mode - when APs are active, operate in AP mode.
* Otherwise use the mode of the new interface. This can currently
* only deal with combinations of APs and STAs. Only one ad-hoc
* interfaces is allowed above.
*/
if (avf->opmode == NL80211_IFTYPE_AP)
iter_data->opmode = NL80211_IFTYPE_AP;
else
if (iter_data->opmode == NL80211_IFTYPE_UNSPECIFIED)
iter_data->opmode = avf->opmode;
}

static void ath_do_set_opmode(struct ath5k_softc *sc)
{
struct ath5k_hw *ah = sc->ah;
ath5k_hw_set_opmode(ah, sc->opmode);
ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d (%s)\n",
sc->opmode,
ath_opmode_to_string(sc->opmode) ?
ath_opmode_to_string(sc->opmode) : "UKNOWN");
}

void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
struct ieee80211_vif *vif)
void ath5k_update_bssid_mask(struct ath5k_softc *sc, struct ieee80211_vif *vif)
{
struct ath_common *common = ath5k_hw_common(sc->ah);
struct ath_vif_iter_data iter_data;
Expand All @@ -582,7 +558,6 @@ void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
memset(&iter_data.mask, 0xff, ETH_ALEN);
iter_data.found_active = false;
iter_data.need_set_hw_addr = true;
iter_data.opmode = NL80211_IFTYPE_UNSPECIFIED;

if (vif)
ath_vif_iter(&iter_data, vif->addr, vif);
Expand All @@ -592,18 +567,10 @@ void ath5k_update_bssid_mask_and_opmode(struct ath5k_softc *sc,
&iter_data);
memcpy(sc->bssidmask, iter_data.mask, ETH_ALEN);

sc->opmode = iter_data.opmode;
if (sc->opmode == NL80211_IFTYPE_UNSPECIFIED)
/* Nothing active, default to station mode */
sc->opmode = NL80211_IFTYPE_STATION;

ath_do_set_opmode(sc);

if (iter_data.need_set_hw_addr && iter_data.found_active)
ath5k_hw_set_lladdr(sc->ah, iter_data.active_mac);

if (ath5k_hw_hasbssidmask(sc->ah))
ath5k_hw_set_bssid_mask(sc->ah, sc->bssidmask);
ath5k_hw_set_bssid_mask(sc->ah, sc->bssidmask);
}

static void
Expand All @@ -615,9 +582,15 @@ ath5k_mode_setup(struct ath5k_softc *sc, struct ieee80211_vif *vif)
/* configure rx filter */
rfilt = sc->filter_flags;
ath5k_hw_set_rx_filter(ah, rfilt);
ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt);

ath5k_update_bssid_mask_and_opmode(sc, vif);
if (ath5k_hw_hasbssidmask(ah))
ath5k_update_bssid_mask(sc, vif);

/* configure operational mode */
ath5k_hw_set_opmode(ah, sc->opmode);

ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "mode setup opmode %d\n", sc->opmode);
ATH5K_DBG(sc, ATH5K_DEBUG_MODE, "RX filter 0x%x\n", rfilt);
}

static inline int
Expand Down Expand Up @@ -2715,7 +2688,7 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
SET_IEEE80211_PERM_ADDR(hw, mac);
memcpy(&sc->lladdr, mac, ETH_ALEN);
/* All MAC address bits matter for ACKs */
ath5k_update_bssid_mask_and_opmode(sc, NULL);
ath5k_update_bssid_mask(sc, NULL);

regulatory->current_rd = ah->ah_capabilities.cap_eeprom.ee_regdomain;
ret = ath_regd_init(regulatory, hw->wiphy, ath5k_reg_notifier);
Expand Down Expand Up @@ -2813,6 +2786,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
{
struct ath5k_softc *sc = hw->priv;
int ret;
struct ath5k_hw *ah = sc->ah;
struct ath5k_vif *avf = (void *)vif->drv_priv;

mutex_lock(&sc->lock);
Expand Down Expand Up @@ -2876,6 +2850,18 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
sc->num_adhoc_vifs++;
}

/* Set combined mode - when APs are configured, operate in AP mode.
* Otherwise use the mode of the new interface. This can currently
* only deal with combinations of APs and STAs. Only one ad-hoc
* interfaces is allowed above.
*/
if (sc->num_ap_vifs)
sc->opmode = NL80211_IFTYPE_AP;
else
sc->opmode = vif->type;

ath5k_hw_set_opmode(ah, sc->opmode);

/* Any MAC address is fine, all others are included through the
* filter.
*/
Expand Down Expand Up @@ -2919,7 +2905,7 @@ ath5k_remove_interface(struct ieee80211_hw *hw,
else if (avf->opmode == NL80211_IFTYPE_ADHOC)
sc->num_adhoc_vifs--;

ath5k_update_bssid_mask_and_opmode(sc, NULL);
ath5k_update_bssid_mask(sc, NULL);
mutex_unlock(&sc->lock);
}

Expand Down
31 changes: 10 additions & 21 deletions trunk/drivers/net/wireless/ath/ath5k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

#include "base.h"
#include "debug.h"
#include "../debug.h"

static unsigned int ath5k_debug;
module_param_named(debug, ath5k_debug, uint, 0);
Expand Down Expand Up @@ -493,7 +492,6 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
char buf[700];
unsigned int len = 0;
u32 filt = ath5k_hw_get_rx_filter(sc->ah);
const char *tmp;

len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n",
sc->bssidmask);
Expand Down Expand Up @@ -526,14 +524,6 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
else
len += snprintf(buf+len, sizeof(buf)-len, "\n");

tmp = ath_opmode_to_string(sc->opmode);
if (tmp)
len += snprintf(buf+len, sizeof(buf)-len, "opmode: %s\n",
tmp);
else
len += snprintf(buf+len, sizeof(buf)-len,
"opmode: UNKNOWN-%i\n", sc->opmode);

if (len > sizeof(buf))
len = sizeof(buf);

Expand Down Expand Up @@ -725,21 +715,20 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
len += snprintf(buf+len, sizeof(buf)-len,
"beacon RSSI average:\t%d\n",
sc->ah->ah_beacon_rssi_avg.avg);

#define CC_PRINT(_struct, _field) \
_struct._field, \
_struct.cycles > 0 ? \
_struct._field*100/_struct.cycles : 0

len += snprintf(buf+len, sizeof(buf)-len, "profcnt tx\t\t%u\t(%d%%)\n",
CC_PRINT(as->last_cc, tx_frame));
as->pfc_tx,
as->pfc_cycles > 0 ?
as->pfc_tx*100/as->pfc_cycles : 0);
len += snprintf(buf+len, sizeof(buf)-len, "profcnt rx\t\t%u\t(%d%%)\n",
CC_PRINT(as->last_cc, rx_frame));
as->pfc_rx,
as->pfc_cycles > 0 ?
as->pfc_rx*100/as->pfc_cycles : 0);
len += snprintf(buf+len, sizeof(buf)-len, "profcnt busy\t\t%u\t(%d%%)\n",
CC_PRINT(as->last_cc, rx_busy));
#undef CC_PRINT
as->pfc_busy,
as->pfc_cycles > 0 ?
as->pfc_busy*100/as->pfc_cycles : 0);
len += snprintf(buf+len, sizeof(buf)-len, "profcnt cycles\t\t%u\n",
as->last_cc.cycles);
as->pfc_cycles);
len += snprintf(buf+len, sizeof(buf)-len,
"listen time\t\t%d\tlast: %d\n",
as->listen_time, as->last_listen);
Expand Down
Loading

0 comments on commit b93d998

Please sign in to comment.