Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149979
b: refs/heads/master
c: 9e52b06
h: refs/heads/master
i:
  149977: e620656
  149975: 3388942
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 22, 2009
1 parent 383e2bc commit cd0326d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 9 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: 314bd7503b1e96841931311f28a8925dab66ed83
refs/heads/master: 9e52b0623c6eb49c3f23a326c1fb97bdecc49ba1
15 changes: 15 additions & 0 deletions trunk/drivers/net/wireless/ath/ar9170/ar9170.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ enum ar9170_bw {
__AR9170_NUM_BW,
};

static inline enum ar9170_bw nl80211_to_ar9170(enum nl80211_channel_type type)
{
switch (type) {
case NL80211_CHAN_NO_HT:
case NL80211_CHAN_HT20:
return AR9170_BW_20;
case NL80211_CHAN_HT40MINUS:
return AR9170_BW_40_BELOW;
case NL80211_CHAN_HT40PLUS:
return AR9170_BW_40_ABOVE;
default:
BUG();
}
}

enum ar9170_rf_init_mode {
AR9170_RFI_NONE,
AR9170_RFI_WARM,
Expand Down
54 changes: 46 additions & 8 deletions trunk/drivers/net/wireless/ath/ar9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,36 @@ static struct ieee80211_channel ar9170_5ghz_chantable[] = {
};
#undef CHAN

#define AR9170_HT_CAP \
{ \
.ht_supported = true, \
.cap = IEEE80211_HT_CAP_MAX_AMSDU | \
IEEE80211_HT_CAP_SM_PS | \
IEEE80211_HT_CAP_SUP_WIDTH_20_40 | \
IEEE80211_HT_CAP_SGI_40 | \
IEEE80211_HT_CAP_DSSSCCK40 | \
IEEE80211_HT_CAP_SM_PS, \
.ampdu_factor = 3, /* ?? */ \
.ampdu_density = 7, /* ?? */ \
.mcs = { \
.rx_mask = { 0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, }, \
}, \
}

static struct ieee80211_supported_band ar9170_band_2GHz = {
.channels = ar9170_2ghz_chantable,
.n_channels = ARRAY_SIZE(ar9170_2ghz_chantable),
.bitrates = ar9170_g_ratetable,
.n_bitrates = ar9170_g_ratetable_size,
.ht_cap = AR9170_HT_CAP,
};

static struct ieee80211_supported_band ar9170_band_5GHz = {
.channels = ar9170_5ghz_chantable,
.n_channels = ARRAY_SIZE(ar9170_5ghz_chantable),
.bitrates = ar9170_a_ratetable,
.n_bitrates = ar9170_a_ratetable_size,
.ht_cap = AR9170_HT_CAP,
};

#ifdef AR9170_QUEUE_DEBUG
Expand Down Expand Up @@ -190,13 +215,6 @@ static void ar9170_dump_station_tx_status_queue(struct ar9170 *ar,
}
#endif /* AR9170_QUEUE_DEBUG */

static struct ieee80211_supported_band ar9170_band_5GHz = {
.channels = ar9170_5ghz_chantable,
.n_channels = ARRAY_SIZE(ar9170_5ghz_chantable),
.bitrates = ar9170_a_ratetable,
.n_bitrates = ar9170_a_ratetable_size,
};

void ar9170_handle_tx_status(struct ar9170 *ar, struct sk_buff *skb,
bool valid_status, u16 tx_status)
{
Expand Down Expand Up @@ -1077,7 +1095,8 @@ static int ar9170_op_config(struct ieee80211_hw *hw, u32 changed)

if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
err = ar9170_set_channel(ar, hw->conf.channel,
AR9170_RFI_NONE, AR9170_BW_20);
AR9170_RFI_NONE,
nl80211_to_ar9170(hw->conf.channel_type));
if (err)
goto out;
/* adjust slot time for 5 GHz */
Expand Down Expand Up @@ -1499,6 +1518,24 @@ static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
return ret;
}

static int ar9170_ampdu_action(struct ieee80211_hw *hw,
enum ieee80211_ampdu_mlme_action action,
struct ieee80211_sta *sta, u16 tid, u16 *ssn)
{
switch (action) {
case IEEE80211_AMPDU_RX_START:
case IEEE80211_AMPDU_RX_STOP:
/*
* Something goes wrong -- RX locks up
* after a while of receiving aggregated
* frames -- not enabling for now.
*/
return -EOPNOTSUPP;
default:
return -EOPNOTSUPP;
}
}

static const struct ieee80211_ops ar9170_ops = {
.start = ar9170_op_start,
.stop = ar9170_op_stop,
Expand All @@ -1515,6 +1552,7 @@ static const struct ieee80211_ops ar9170_ops = {
.sta_notify = ar9170_sta_notify,
.get_stats = ar9170_get_stats,
.get_tx_stats = ar9170_get_tx_stats,
.ampdu_action = ar9170_ampdu_action,
};

void *ar9170_alloc(size_t priv_size)
Expand Down

0 comments on commit cd0326d

Please sign in to comment.