Skip to content

Commit d346f49

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
2 parents d87fd25 + b6ce5c3 commit d346f49

117 files changed

Lines changed: 2965 additions & 1122 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/networking/regulatory.txt‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,27 @@ Then in some part of your code after your wiphy has been registered:
188188
&mydriver_jp_regdom.reg_rules[i],
189189
sizeof(struct ieee80211_reg_rule));
190190
regulatory_struct_hint(rd);
191+
192+
Statically compiled regulatory database
193+
---------------------------------------
194+
195+
In most situations the userland solution using CRDA as described
196+
above is the preferred solution. However in some cases a set of
197+
rules built into the kernel itself may be desirable. To account
198+
for this situation, a configuration option has been provided
199+
(i.e. CONFIG_CFG80211_INTERNAL_REGDB). With this option enabled,
200+
the wireless database information contained in net/wireless/db.txt is
201+
used to generate a data structure encoded in net/wireless/regdb.c.
202+
That option also enables code in net/wireless/reg.c which queries
203+
the data in regdb.c as an alternative to using CRDA.
204+
205+
The file net/wireless/db.txt should be kept up-to-date with the db.txt
206+
file available in the git repository here:
207+
208+
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git
209+
210+
Again, most users in most situations should be using the CRDA package
211+
provided with their distribution, and in most other situations users
212+
should be building and using CRDA on their own rather than using
213+
this option. If you are not absolutely sure that you should be using
214+
CONFIG_CFG80211_INTERNAL_REGDB then _DO_NOT_USE_IT_.

‎drivers/net/wireless/ath/ar9170/ar9170.h‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ struct ar9170_rxstream_mpdu_merge {
109109
bool has_plcp;
110110
};
111111

112-
#define AR9170_NUM_MAX_BA_RETRY 5
113112
#define AR9170_NUM_TID 16
114113
#define WME_BA_BMP_SIZE 64
115114
#define AR9170_NUM_MAX_AGG_LEN (2 * WME_BA_BMP_SIZE)
@@ -143,7 +142,6 @@ struct ar9170_sta_tid {
143142
u16 tid;
144143
enum ar9170_tid_state state;
145144
bool active;
146-
u8 retry;
147145
};
148146

149147
#define AR9170_QUEUE_TIMEOUT 64
@@ -154,6 +152,8 @@ struct ar9170_sta_tid {
154152

155153
#define AR9170_NUM_TX_STATUS 128
156154
#define AR9170_NUM_TX_AGG_MAX 30
155+
#define AR9170_NUM_TX_LIMIT_HARD AR9170_TXQ_DEPTH
156+
#define AR9170_NUM_TX_LIMIT_SOFT (AR9170_TXQ_DEPTH - 10)
157157

158158
struct ar9170 {
159159
struct ieee80211_hw *hw;
@@ -248,13 +248,8 @@ struct ar9170_sta_info {
248248
unsigned int ampdu_max_len;
249249
};
250250

251-
#define AR9170_TX_FLAG_WAIT_FOR_ACK BIT(0)
252-
#define AR9170_TX_FLAG_NO_ACK BIT(1)
253-
#define AR9170_TX_FLAG_BLOCK_ACK BIT(2)
254-
255251
struct ar9170_tx_info {
256252
unsigned long timeout;
257-
unsigned int flags;
258253
};
259254

260255
#define IS_STARTED(a) (((struct ar9170 *)a)->state >= AR9170_STARTED)

‎drivers/net/wireless/ath/ar9170/hw.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ struct ar9170_tx_control {
276276
#define AR9170_TX_MAC_RATE_PROBE 0x8000
277277

278278
/* either-or */
279+
#define AR9170_TX_PHY_MOD_MASK 0x00000003
279280
#define AR9170_TX_PHY_MOD_CCK 0x00000000
280281
#define AR9170_TX_PHY_MOD_OFDM 0x00000001
281282
#define AR9170_TX_PHY_MOD_HT 0x00000002

‎drivers/net/wireless/ath/ar9170/mac.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ int ar9170_set_qos(struct ar9170 *ar)
117117
ar9170_regwrite(AR9170_MAC_REG_AC1_AC0_TXOP,
118118
ar->edcf[0].txop | ar->edcf[1].txop << 16);
119119
ar9170_regwrite(AR9170_MAC_REG_AC3_AC2_TXOP,
120-
ar->edcf[1].txop | ar->edcf[3].txop << 16);
120+
ar->edcf[2].txop | ar->edcf[3].txop << 16);
121121

122122
ar9170_regwrite_finish();
123123

‎drivers/net/wireless/ath/ar9170/main.c‎

Lines changed: 45 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,15 @@ static inline u16 ar9170_get_seq(struct sk_buff *skb)
194194
return ar9170_get_seq_h((void *) txc->frame_data);
195195
}
196196

197+
static inline u16 ar9170_get_tid_h(struct ieee80211_hdr *hdr)
198+
{
199+
return (ieee80211_get_qos_ctl(hdr))[0] & IEEE80211_QOS_CTL_TID_MASK;
200+
}
201+
197202
static inline u16 ar9170_get_tid(struct sk_buff *skb)
198203
{
199204
struct ar9170_tx_control *txc = (void *) skb->data;
200-
struct ieee80211_hdr *hdr = (void *) txc->frame_data;
201-
202-
return (ieee80211_get_qos_ctl(hdr))[0] & IEEE80211_QOS_CTL_TID_MASK;
205+
return ar9170_get_tid_h((struct ieee80211_hdr *) txc->frame_data);
203206
}
204207

205208
#define GET_NEXT_SEQ(seq) ((seq + 1) & 0x0fff)
@@ -213,10 +216,10 @@ static void ar9170_print_txheader(struct ar9170 *ar, struct sk_buff *skb)
213216
struct ar9170_tx_info *arinfo = (void *) txinfo->rate_driver_data;
214217
struct ieee80211_hdr *hdr = (void *) txc->frame_data;
215218

216-
printk(KERN_DEBUG "%s: => FRAME [skb:%p, q:%d, DA:[%pM] flags:%x s:%d "
219+
printk(KERN_DEBUG "%s: => FRAME [skb:%p, q:%d, DA:[%pM] s:%d "
217220
"mac_ctrl:%04x, phy_ctrl:%08x, timeout:[%d ms]]\n",
218221
wiphy_name(ar->hw->wiphy), skb, skb_get_queue_mapping(skb),
219-
ieee80211_get_DA(hdr), arinfo->flags, ar9170_get_seq_h(hdr),
222+
ieee80211_get_DA(hdr), ar9170_get_seq_h(hdr),
220223
le16_to_cpu(txc->mac_control), le32_to_cpu(txc->phy_control),
221224
jiffies_to_msecs(arinfo->timeout - jiffies));
222225
}
@@ -430,7 +433,7 @@ void ar9170_tx_callback(struct ar9170 *ar, struct sk_buff *skb)
430433
spin_lock_irqsave(&ar->tx_stats_lock, flags);
431434
ar->tx_stats[queue].len--;
432435

433-
if (skb_queue_empty(&ar->tx_pending[queue])) {
436+
if (ar->tx_stats[queue].len < AR9170_NUM_TX_LIMIT_SOFT) {
434437
#ifdef AR9170_QUEUE_STOP_DEBUG
435438
printk(KERN_DEBUG "%s: wake queue %d\n",
436439
wiphy_name(ar->hw->wiphy), queue);
@@ -440,22 +443,17 @@ void ar9170_tx_callback(struct ar9170 *ar, struct sk_buff *skb)
440443
}
441444
spin_unlock_irqrestore(&ar->tx_stats_lock, flags);
442445

443-
if (arinfo->flags & AR9170_TX_FLAG_BLOCK_ACK) {
444-
ar9170_tx_ampdu_callback(ar, skb);
445-
} else if (arinfo->flags & AR9170_TX_FLAG_WAIT_FOR_ACK) {
446-
arinfo->timeout = jiffies +
447-
msecs_to_jiffies(AR9170_TX_TIMEOUT);
448-
449-
skb_queue_tail(&ar->tx_status[queue], skb);
450-
} else if (arinfo->flags & AR9170_TX_FLAG_NO_ACK) {
446+
if (info->flags & IEEE80211_TX_CTL_NO_ACK) {
451447
ar9170_tx_status(ar, skb, AR9170_TX_STATUS_FAILED);
452448
} else {
453-
#ifdef AR9170_QUEUE_DEBUG
454-
printk(KERN_DEBUG "%s: unsupported frame flags!\n",
455-
wiphy_name(ar->hw->wiphy));
456-
ar9170_print_txheader(ar, skb);
457-
#endif /* AR9170_QUEUE_DEBUG */
458-
dev_kfree_skb_any(skb);
449+
if (info->flags & IEEE80211_TX_CTL_AMPDU) {
450+
ar9170_tx_ampdu_callback(ar, skb);
451+
} else {
452+
arinfo->timeout = jiffies +
453+
msecs_to_jiffies(AR9170_TX_TIMEOUT);
454+
455+
skb_queue_tail(&ar->tx_status[queue], skb);
456+
}
459457
}
460458

461459
if (!ar->tx_stats[queue].len &&
@@ -1407,17 +1405,6 @@ static int ar9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb)
14071405

14081406
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
14091407
(is_valid_ether_addr(ieee80211_get_DA(hdr)))) {
1410-
if (info->flags & IEEE80211_TX_CTL_AMPDU) {
1411-
if (unlikely(!info->control.sta))
1412-
goto err_out;
1413-
1414-
txc->mac_control |= cpu_to_le16(AR9170_TX_MAC_AGGR);
1415-
arinfo->flags = AR9170_TX_FLAG_BLOCK_ACK;
1416-
1417-
goto out;
1418-
}
1419-
1420-
txc->mac_control |= cpu_to_le16(AR9170_TX_MAC_RATE_PROBE);
14211408
/*
14221409
* WARNING:
14231410
* Putting the QoS queue bits into an unexplored territory is
@@ -1431,12 +1418,17 @@ static int ar9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb)
14311418

14321419
txc->phy_control |=
14331420
cpu_to_le32(queue << AR9170_TX_PHY_QOS_SHIFT);
1434-
arinfo->flags = AR9170_TX_FLAG_WAIT_FOR_ACK;
1435-
} else {
1436-
arinfo->flags = AR9170_TX_FLAG_NO_ACK;
1421+
1422+
if (info->flags & IEEE80211_TX_CTL_AMPDU) {
1423+
if (unlikely(!info->control.sta))
1424+
goto err_out;
1425+
1426+
txc->mac_control |= cpu_to_le16(AR9170_TX_MAC_AGGR);
1427+
} else {
1428+
txc->mac_control |= cpu_to_le16(AR9170_TX_MAC_RATE_PROBE);
1429+
}
14371430
}
14381431

1439-
out:
14401432
return 0;
14411433

14421434
err_out:
@@ -1671,8 +1663,7 @@ static bool ar9170_tx_ampdu(struct ar9170 *ar)
16711663
* tell the FW/HW that this is the last frame,
16721664
* that way it will wait for the immediate block ack.
16731665
*/
1674-
if (likely(skb_peek_tail(&agg)))
1675-
ar9170_tx_indicate_immba(ar, skb_peek_tail(&agg));
1666+
ar9170_tx_indicate_immba(ar, skb_peek_tail(&agg));
16761667

16771668
#ifdef AR9170_TXAGG_DEBUG
16781669
printk(KERN_DEBUG "%s: generated A-MPDU looks like this:\n",
@@ -1716,6 +1707,21 @@ static void ar9170_tx(struct ar9170 *ar)
17161707

17171708
for (i = 0; i < __AR9170_NUM_TXQ; i++) {
17181709
spin_lock_irqsave(&ar->tx_stats_lock, flags);
1710+
frames = min(ar->tx_stats[i].limit - ar->tx_stats[i].len,
1711+
skb_queue_len(&ar->tx_pending[i]));
1712+
1713+
if (remaining_space < frames) {
1714+
#ifdef AR9170_QUEUE_DEBUG
1715+
printk(KERN_DEBUG "%s: tx quota reached queue:%d, "
1716+
"remaining slots:%d, needed:%d\n",
1717+
wiphy_name(ar->hw->wiphy), i, remaining_space,
1718+
frames);
1719+
#endif /* AR9170_QUEUE_DEBUG */
1720+
frames = remaining_space;
1721+
}
1722+
1723+
ar->tx_stats[i].len += frames;
1724+
ar->tx_stats[i].count += frames;
17191725
if (ar->tx_stats[i].len >= ar->tx_stats[i].limit) {
17201726
#ifdef AR9170_QUEUE_DEBUG
17211727
printk(KERN_DEBUG "%s: queue %d full\n",
@@ -1733,25 +1739,8 @@ static void ar9170_tx(struct ar9170 *ar)
17331739
__ar9170_dump_txstats(ar);
17341740
#endif /* AR9170_QUEUE_STOP_DEBUG */
17351741
ieee80211_stop_queue(ar->hw, i);
1736-
spin_unlock_irqrestore(&ar->tx_stats_lock, flags);
1737-
continue;
17381742
}
17391743

1740-
frames = min(ar->tx_stats[i].limit - ar->tx_stats[i].len,
1741-
skb_queue_len(&ar->tx_pending[i]));
1742-
1743-
if (remaining_space < frames) {
1744-
#ifdef AR9170_QUEUE_DEBUG
1745-
printk(KERN_DEBUG "%s: tx quota reached queue:%d, "
1746-
"remaining slots:%d, needed:%d\n",
1747-
wiphy_name(ar->hw->wiphy), i, remaining_space,
1748-
frames);
1749-
#endif /* AR9170_QUEUE_DEBUG */
1750-
frames = remaining_space;
1751-
}
1752-
1753-
ar->tx_stats[i].len += frames;
1754-
ar->tx_stats[i].count += frames;
17551744
spin_unlock_irqrestore(&ar->tx_stats_lock, flags);
17561745

17571746
if (!frames)
@@ -1773,7 +1762,7 @@ static void ar9170_tx(struct ar9170 *ar)
17731762
arinfo->timeout = jiffies +
17741763
msecs_to_jiffies(AR9170_TX_TIMEOUT);
17751764

1776-
if (arinfo->flags == AR9170_TX_FLAG_BLOCK_ACK)
1765+
if (info->flags & IEEE80211_TX_CTL_AMPDU)
17771766
atomic_inc(&ar->tx_ampdu_pending);
17781767

17791768
#ifdef AR9170_QUEUE_DEBUG
@@ -1784,7 +1773,7 @@ static void ar9170_tx(struct ar9170 *ar)
17841773

17851774
err = ar->tx(ar, skb);
17861775
if (unlikely(err)) {
1787-
if (arinfo->flags == AR9170_TX_FLAG_BLOCK_ACK)
1776+
if (info->flags & IEEE80211_TX_CTL_AMPDU)
17881777
atomic_dec(&ar->tx_ampdu_pending);
17891778

17901779
frames_failed++;
@@ -2366,7 +2355,6 @@ static void ar9170_sta_notify(struct ieee80211_hw *hw,
23662355
sta_info->agg[i].state = AR9170_TID_STATE_SHUTDOWN;
23672356
sta_info->agg[i].active = false;
23682357
sta_info->agg[i].ssn = 0;
2369-
sta_info->agg[i].retry = 0;
23702358
sta_info->agg[i].tid = i;
23712359
INIT_LIST_HEAD(&sta_info->agg[i].list);
23722360
skb_queue_head_init(&sta_info->agg[i].queue);

‎drivers/net/wireless/ath/ar9170/usb.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ static struct usb_device_id ar9170_usb_ids[] = {
8484
{ USB_DEVICE(0x0cde, 0x0023) },
8585
/* Z-Com UB82 ABG */
8686
{ USB_DEVICE(0x0cde, 0x0026) },
87+
/* Sphairon Homelink 1202 */
88+
{ USB_DEVICE(0x0cde, 0x0027) },
8789
/* Arcadyan WN7512 */
8890
{ USB_DEVICE(0x083a, 0xf522) },
8991
/* Planex GWUS300 */

‎drivers/net/wireless/ath/ath9k/ath9k.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ struct ath_softc {
453453
int irq;
454454
spinlock_t sc_resetlock;
455455
spinlock_t sc_serial_rw;
456-
spinlock_t ani_lock;
457456
spinlock_t sc_pm_lock;
458457
struct mutex mutex;
459458

‎drivers/net/wireless/ath/ath9k/debug.c‎

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,23 +289,49 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
289289
if (sc->cur_rate_table == NULL)
290290
return 0;
291291

292-
max = 80 + sc->cur_rate_table->rate_cnt * 64;
292+
max = 80 + sc->cur_rate_table->rate_cnt * 1024;
293293
buf = kmalloc(max + 1, GFP_KERNEL);
294294
if (buf == NULL)
295295
return 0;
296296
buf[max] = 0;
297297

298-
len += sprintf(buf, "%5s %15s %8s %9s %3s\n\n", "Rate", "Success",
299-
"Retries", "XRetries", "PER");
298+
len += sprintf(buf, "%6s %6s %6s "
299+
"%10s %10s %10s %10s\n",
300+
"HT", "MCS", "Rate",
301+
"Success", "Retries", "XRetries", "PER");
300302

301303
for (i = 0; i < sc->cur_rate_table->rate_cnt; i++) {
302304
u32 ratekbps = sc->cur_rate_table->info[i].ratekbps;
303305
struct ath_rc_stats *stats = &sc->debug.stats.rcstats[i];
306+
char mcs[5];
307+
char htmode[5];
308+
int used_mcs = 0, used_htmode = 0;
309+
310+
if (WLAN_RC_PHY_HT(sc->cur_rate_table->info[i].phy)) {
311+
used_mcs = snprintf(mcs, 5, "%d",
312+
sc->cur_rate_table->info[i].ratecode);
313+
314+
if (WLAN_RC_PHY_40(sc->cur_rate_table->info[i].phy))
315+
used_htmode = snprintf(htmode, 5, "HT40");
316+
else if (WLAN_RC_PHY_20(sc->cur_rate_table->info[i].phy))
317+
used_htmode = snprintf(htmode, 5, "HT20");
318+
else
319+
used_htmode = snprintf(htmode, 5, "????");
320+
}
321+
322+
mcs[used_mcs] = '\0';
323+
htmode[used_htmode] = '\0';
304324

305325
len += snprintf(buf + len, max - len,
306-
"%3u.%d: %8u %8u %8u %8u\n", ratekbps / 1000,
307-
(ratekbps % 1000) / 100, stats->success,
308-
stats->retries, stats->xretries,
326+
"%6s %6s %3u.%d: "
327+
"%10u %10u %10u %10u\n",
328+
htmode,
329+
mcs,
330+
ratekbps / 1000,
331+
(ratekbps % 1000) / 100,
332+
stats->success,
333+
stats->retries,
334+
stats->xretries,
309335
stats->per);
310336
}
311337

0 commit comments

Comments
 (0)