Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255407
b: refs/heads/master
c: 05c0be2
h: refs/heads/master
i:
  255405: 4bd2669
  255403: 10fbf01
  255399: fb36ae6
  255391: abe94e8
v: v3
  • Loading branch information
Mohammed Shafi Shajakhan authored and John W. Linville committed Jun 1, 2011
1 parent fc9d67e commit 324a189
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 11 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: 81168e509f06aa205b240c1804ec2b9b5add4772
refs/heads/master: 05c0be2f7f10404e5b3bc4105f9206096e9b8767
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ struct ath_common {
const struct ath_bus_ops *bus_ops;

bool btcoex_enabled;
bool disable_ani;
};

struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ void ath_hw_check(struct work_struct *work);
void ath_hw_pll_work(struct work_struct *work);
void ath_paprd_calibrate(struct work_struct *work);
void ath_ani_calibrate(unsigned long data);
void ath_start_ani(struct ath_common *common);

/**********/
/* BTCOEX */
Expand Down
52 changes: 52 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,56 @@ static const struct file_operations fops_rx_chainmask = {
.llseek = default_llseek,
};

static ssize_t read_file_disable_ani(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
char buf[32];
unsigned int len;

len = sprintf(buf, "%d\n", common->disable_ani);
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static ssize_t write_file_disable_ani(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
unsigned long disable_ani;
char buf[32];
ssize_t len;

len = min(count, sizeof(buf) - 1);
if (copy_from_user(buf, user_buf, len))
return -EFAULT;

buf[len] = '\0';
if (strict_strtoul(buf, 0, &disable_ani))
return -EINVAL;

common->disable_ani = !!disable_ani;

if (disable_ani) {
sc->sc_flags &= ~SC_OP_ANI_RUN;
del_timer_sync(&common->ani.timer);
} else {
sc->sc_flags |= SC_OP_ANI_RUN;
ath_start_ani(common);
}

return count;
}

static const struct file_operations fops_disable_ani = {
.read = read_file_disable_ani,
.write = write_file_disable_ani,
.open = ath9k_debugfs_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};

static ssize_t read_file_dma(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
Expand Down Expand Up @@ -1159,6 +1209,8 @@ int ath9k_init_debug(struct ath_hw *ah)
sc->debug.debugfs_phy, sc, &fops_rx_chainmask);
debugfs_create_file("tx_chainmask", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_tx_chainmask);
debugfs_create_file("disable_ani", S_IRUSR | S_IWUSR,
sc->debug.debugfs_phy, sc, &fops_disable_ani);
debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
sc, &fops_regidx);
debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath9k/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ static void ath9k_init_misc(struct ath_softc *sc)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
int i = 0;

setup_timer(&common->ani.timer, ath_ani_calibrate, (unsigned long)sc);

sc->config.txpowlimit = ATH_TXPOWER_MAX;
Expand Down Expand Up @@ -585,6 +584,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
common->priv = sc;
common->debug_mask = ath9k_debug;
common->btcoex_enabled = ath9k_btcoex_enable == 1;
common->disable_ani = false;
spin_lock_init(&common->cc_lock);

spin_lock_init(&sc->sc_serial_rw);
Expand Down
33 changes: 24 additions & 9 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void ath9k_ps_restore(struct ath_softc *sc)
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
}

static void ath_start_ani(struct ath_common *common)
void ath_start_ani(struct ath_common *common)
{
struct ath_hw *ah = common->ah;
unsigned long timestamp = jiffies_to_msecs(jiffies);
Expand Down Expand Up @@ -300,7 +300,8 @@ static int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
ath_set_beacon(sc);
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work, HZ/2);
ath_start_ani(common);
if (!common->disable_ani)
ath_start_ani(common);
}

ps_restore:
Expand Down Expand Up @@ -968,6 +969,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
sc->hw_busy_count = 0;

/* Stop ANI */

del_timer_sync(&common->ani.timer);

ath9k_ps_wakeup(sc);
Expand Down Expand Up @@ -1017,7 +1019,9 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
spin_unlock_bh(&sc->sc_pcu_lock);

/* Start ANI */
ath_start_ani(common);
if (!common->disable_ani)
ath_start_ani(common);

ath9k_ps_restore(sc);

return r;
Expand Down Expand Up @@ -1408,8 +1412,12 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
/* Set up ANI */
if (iter_data.naps > 0) {
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
sc->sc_flags |= SC_OP_ANI_RUN;
ath_start_ani(common);

if (!common->disable_ani) {
sc->sc_flags |= SC_OP_ANI_RUN;
ath_start_ani(common);
}

} else {
sc->sc_flags &= ~SC_OP_ANI_RUN;
del_timer_sync(&common->ani.timer);
Expand Down Expand Up @@ -1973,8 +1981,11 @@ static void ath9k_bss_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;

sc->sc_flags |= SC_OP_ANI_RUN;
ath_start_ani(common);
if (!common->disable_ani) {
sc->sc_flags |= SC_OP_ANI_RUN;
ath_start_ani(common);
}

}
}

Expand Down Expand Up @@ -2043,8 +2054,12 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,

if (bss_conf->ibss_joined) {
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
sc->sc_flags |= SC_OP_ANI_RUN;
ath_start_ani(common);

if (!common->disable_ani) {
sc->sc_flags |= SC_OP_ANI_RUN;
ath_start_ani(common);
}

} else {
sc->sc_flags &= ~SC_OP_ANI_RUN;
del_timer_sync(&common->ani.timer);
Expand Down

0 comments on commit 324a189

Please sign in to comment.