Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless-next-2.6
  • Loading branch information
David S. Miller committed Feb 10, 2009
2 parents 4cdc44a + 99e0fca commit 4b53b36
Show file tree
Hide file tree
Showing 101 changed files with 4,269 additions and 2,798 deletions.
15 changes: 14 additions & 1 deletion drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,19 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
bf->skb = NULL;
}

static inline void ath5k_rxbuf_free(struct ath5k_softc *sc,
struct ath5k_buf *bf)
{
BUG_ON(!bf);
if (!bf->skb)
return;
pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize,
PCI_DMA_FROMDEVICE);
dev_kfree_skb_any(bf->skb);
bf->skb = NULL;
}


/* Queues setup */
static struct ath5k_txq *ath5k_txq_setup(struct ath5k_softc *sc,
int qtype, int subtype);
Expand Down Expand Up @@ -1343,7 +1356,7 @@ ath5k_desc_free(struct ath5k_softc *sc, struct pci_dev *pdev)
list_for_each_entry(bf, &sc->txbuf, list)
ath5k_txbuf_free(sc, bf);
list_for_each_entry(bf, &sc->rxbuf, list)
ath5k_txbuf_free(sc, bf);
ath5k_rxbuf_free(sc, bf);

/* Free memory associated with all descriptors */
pci_free_consistent(pdev, sc->desc_len, sc->desc, sc->desc_daddr);
Expand Down
35 changes: 27 additions & 8 deletions drivers/net/wireless/ath9k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,18 @@ struct ath_interrupt_stats {
u32 dtim;
};

struct ath_legacy_rc_stats {
u32 success;
};

struct ath_11n_rc_stats {
u32 success;
};

struct ath_stats {
struct ath_interrupt_stats istats;
struct ath_legacy_rc_stats legacy_rcstats[12]; /* max(11a,11b,11g) */
struct ath_11n_rc_stats n_rcstats[16]; /* 0..15 MCS rates */
};

struct ath9k_debug {
Expand All @@ -141,13 +151,15 @@ struct ath9k_debug {
struct dentry *debugfs_phy;
struct dentry *debugfs_dma;
struct dentry *debugfs_interrupt;
struct dentry *debugfs_rcstat;
struct ath_stats stats;
};

void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...);
int ath9k_init_debug(struct ath_softc *sc);
void ath9k_exit_debug(struct ath_softc *sc);
void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb);

#else

Expand All @@ -170,6 +182,11 @@ static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
{
}

static inline void ath_debug_stat_rc(struct ath_softc *sc,
struct sk_buff *skb)
{
}

#endif /* CONFIG_ATH9K_DEBUG */

struct ath_config {
Expand Down Expand Up @@ -233,7 +250,6 @@ struct ath_buf_state {
#define bf_isht(bf) (bf->bf_state.bf_type & BUF_HT)
#define bf_isretried(bf) (bf->bf_state.bf_type & BUF_RETRY)
#define bf_isxretried(bf) (bf->bf_state.bf_type & BUF_XRETRY)
#define bf_isshpreamble(bf) (bf->bf_state.bf_type & BUF_SHORT_PREAMBLE)
#define bf_isbar(bf) (bf->bf_state.bf_type & BUF_BAR)
#define bf_ispspoll(bf) (bf->bf_state.bf_type & BUF_PSPOLL)
#define bf_isaggrburst(bf) (bf->bf_state.bf_type & BUF_AGGR_BURST)
Expand Down Expand Up @@ -600,6 +616,8 @@ struct ath_ani {
/********************/

#define ATH_LED_PIN 1
#define ATH_LED_ON_DURATION_IDLE 350 /* in msecs */
#define ATH_LED_OFF_DURATION_IDLE 250 /* in msecs */

enum ath_led_type {
ATH_LED_RADIO,
Expand Down Expand Up @@ -656,12 +674,6 @@ struct ath_rfkill {
#define ATH_RSSI_DUMMY_MARKER 0x127
#define ATH_RATE_DUMMY_MARKER 0

enum PROT_MODE {
PROT_M_NONE = 0,
PROT_M_RTSCTS,
PROT_M_CTSONLY
};

#define SC_OP_INVALID BIT(0)
#define SC_OP_BEACONS BIT(1)
#define SC_OP_RXAGGR BIT(2)
Expand All @@ -677,6 +689,7 @@ enum PROT_MODE {
#define SC_OP_RFKILL_SW_BLOCKED BIT(12)
#define SC_OP_RFKILL_HW_BLOCKED BIT(13)
#define SC_OP_WAIT_FOR_BEACON BIT(14)
#define SC_OP_LED_ON BIT(15)

struct ath_bus_ops {
void (*read_cachesize)(struct ath_softc *sc, int *csz);
Expand Down Expand Up @@ -712,7 +725,6 @@ struct ath_softc {
u8 sc_splitmic;
atomic_t ps_usecount;
enum ath9k_int sc_imask;
enum PROT_MODE sc_protmode;
enum ath9k_ht_extprotspacing sc_ht_extprotspacing;
enum ath9k_ht_macmode tx_chan_width;

Expand All @@ -725,10 +737,17 @@ struct ath_softc {
struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX];
struct ath_rate_table *cur_rate_table;
struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];

struct ath_led radio_led;
struct ath_led assoc_led;
struct ath_led tx_led;
struct ath_led rx_led;
struct delayed_work ath_led_blink_work;
int led_on_duration;
int led_off_duration;
int led_on_cnt;
int led_off_cnt;

struct ath_rfkill rf_kill;
struct ath_ani sc_ani;
struct ath9k_node_stats sc_halstats;
Expand Down
100 changes: 100 additions & 0 deletions drivers/net/wireless/ath9k/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,98 @@ static const struct file_operations fops_interrupt = {
.owner = THIS_MODULE
};

static void ath_debug_stat_11n_rc(struct ath_softc *sc, struct sk_buff *skb)
{
struct ath_tx_info_priv *tx_info_priv = NULL;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_tx_rate *rates = tx_info->status.rates;
int final_ts_idx, idx;

tx_info_priv = ATH_TX_INFO_PRIV(tx_info);
final_ts_idx = tx_info_priv->tx.ts_rateindex;
idx = sc->cur_rate_table->info[rates[final_ts_idx].idx].dot11rate;

sc->sc_debug.stats.n_rcstats[idx].success++;
}

static void ath_debug_stat_legacy_rc(struct ath_softc *sc, struct sk_buff *skb)
{
struct ath_tx_info_priv *tx_info_priv = NULL;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_tx_rate *rates = tx_info->status.rates;
int final_ts_idx, idx;

tx_info_priv = ATH_TX_INFO_PRIV(tx_info);
final_ts_idx = tx_info_priv->tx.ts_rateindex;
idx = rates[final_ts_idx].idx;

sc->sc_debug.stats.legacy_rcstats[idx].success++;
}

void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb)
{
if (conf_is_ht(&sc->hw->conf))
ath_debug_stat_11n_rc(sc, skb);
else
ath_debug_stat_legacy_rc(sc, skb);
}

static ssize_t ath_read_file_stat_11n_rc(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
char buf[512];
unsigned int len = 0;
int i = 0;

len += sprintf(buf, "%7s %13s\n\n", "Rate", "Success");

for (i = 0; i <= 15; i++) {
len += snprintf(buf + len, sizeof(buf) - len,
"%5s%3d: %8u\n", "MCS", i,
sc->sc_debug.stats.n_rcstats[i].success);
}

return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static ssize_t ath_read_file_stat_legacy_rc(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;
char buf[512];
unsigned int len = 0;
int i = 0;

len += sprintf(buf, "%7s %13s\n\n", "Rate", "Success");

for (i = 0; i < sc->cur_rate_table->rate_cnt; i++) {
len += snprintf(buf + len, sizeof(buf) - len, "%5u: %12u\n",
sc->cur_rate_table->info[i].ratekbps / 1000,
sc->sc_debug.stats.legacy_rcstats[i].success);
}

return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}

static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_softc *sc = file->private_data;

if (conf_is_ht(&sc->hw->conf))
return ath_read_file_stat_11n_rc(file, user_buf, count, ppos);
else
return ath_read_file_stat_legacy_rc(file, user_buf, count ,ppos);
}

static const struct file_operations fops_rcstat = {
.read = read_file_rcstat,
.open = ath9k_debugfs_open,
.owner = THIS_MODULE
};

int ath9k_init_debug(struct ath_softc *sc)
{
Expand All @@ -248,6 +340,13 @@ int ath9k_init_debug(struct ath_softc *sc)
if (!sc->sc_debug.debugfs_interrupt)
goto err;

sc->sc_debug.debugfs_rcstat = debugfs_create_file("rcstat",
S_IRUGO,
sc->sc_debug.debugfs_phy,
sc, &fops_rcstat);
if (!sc->sc_debug.debugfs_rcstat)
goto err;

return 0;
err:
ath9k_exit_debug(sc);
Expand All @@ -256,6 +355,7 @@ int ath9k_init_debug(struct ath_softc *sc)

void ath9k_exit_debug(struct ath_softc *sc)
{
debugfs_remove(sc->sc_debug.debugfs_rcstat);
debugfs_remove(sc->sc_debug.debugfs_interrupt);
debugfs_remove(sc->sc_debug.debugfs_dma);
debugfs_remove(sc->sc_debug.debugfs_phy);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static int ath9k_hw_get_radiorev(struct ath_hal *ah)

static void ath9k_hw_disablepcie(struct ath_hal *ah)
{
if (!AR_SREV_9100(ah))
if (AR_SREV_9100(ah))
return;

REG_WRITE(ah, AR_PCIE_SERDES, 0x9248fc00);
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/wireless/ath9k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ void ath9k_hw_set11n_ratescenario(struct ath_hal *ah, struct ath_desc *ds,
struct ar5416_desc *last_ads = AR5416DESC(lastds);
u32 ds_ctl0;

(void) nseries;
(void) rtsctsDuration;

if (flags & (ATH9K_TXDESC_RTSENA | ATH9K_TXDESC_CTSENA)) {
ds_ctl0 = ads->ds_ctl0;

Expand Down
Loading

0 comments on commit 4b53b36

Please sign in to comment.