wlan.h (6288cf1e768ae73db5ddaaae54d85245cc1c2b56) wlan.h (85ee5122abbc1b5c5f3622e46942291a2f6f1261)
1/*
2 * Shared Atheros AR9170 Header
3 *
4 * RX/TX meta descriptor format
5 *
6 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
1/*
2 * Shared Atheros AR9170 Header
3 *
4 * RX/TX meta descriptor format
5 *
6 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
7 * Copyright 2009, 2010, Christian Lamparter <chunkeey@googlemail.com>
7 * Copyright 2009-2011 Christian Lamparter <chunkeey@googlemail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

--- 257 unchanged lines hidden (view full) ---

273 struct ieee80211_hdr i3e;
274 u8 payload[0];
275 } data;
276} __packed;
277
278struct carl9170_tx_superframe {
279 struct carl9170_tx_superdesc s;
280 struct ar9170_tx_frame f;
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

--- 257 unchanged lines hidden (view full) ---

273 struct ieee80211_hdr i3e;
274 u8 payload[0];
275 } data;
276} __packed;
277
278struct carl9170_tx_superframe {
279 struct carl9170_tx_superdesc s;
280 struct ar9170_tx_frame f;
281} __packed;
281} __packed __aligned(4);
282
283#endif /* __CARL9170FW__ */
284
285struct _ar9170_tx_hwdesc {
286 __le16 length;
287 __le16 mac_control;
288 __le32 phy_control;
289} __packed;

--- 33 unchanged lines hidden (view full) ---

323 u8 ri[CARL9170_TX_MAX_RATES];
324 __le32 rr[CARL9170_TX_MAX_RETRY_RATES];
325} __packed;
326
327struct _carl9170_tx_superframe {
328 struct _carl9170_tx_superdesc s;
329 struct _ar9170_tx_hwdesc f;
330 u8 frame_data[0];
282
283#endif /* __CARL9170FW__ */
284
285struct _ar9170_tx_hwdesc {
286 __le16 length;
287 __le16 mac_control;
288 __le32 phy_control;
289} __packed;

--- 33 unchanged lines hidden (view full) ---

323 u8 ri[CARL9170_TX_MAX_RATES];
324 __le32 rr[CARL9170_TX_MAX_RETRY_RATES];
325} __packed;
326
327struct _carl9170_tx_superframe {
328 struct _carl9170_tx_superdesc s;
329 struct _ar9170_tx_hwdesc f;
330 u8 frame_data[0];
331} __packed;
331} __packed __aligned(4);
332
333#define CARL9170_TX_SUPERDESC_LEN 24
334#define AR9170_TX_HWDESC_LEN 8
335#define CARL9170_TX_SUPERFRAME_LEN (CARL9170_TX_SUPERDESC_LEN + \
336 AR9170_TX_HWDESC_LEN)
337
338struct ar9170_rx_head {
339 u8 plcp[12];

--- 59 unchanged lines hidden (view full) ---

399} __packed;
400
401static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_macstatus *t)
402{
403 return (t->SAidx & 0xc0) >> 4 |
404 (t->DAidx & 0xc0) >> 6;
405}
406
332
333#define CARL9170_TX_SUPERDESC_LEN 24
334#define AR9170_TX_HWDESC_LEN 8
335#define CARL9170_TX_SUPERFRAME_LEN (CARL9170_TX_SUPERDESC_LEN + \
336 AR9170_TX_HWDESC_LEN)
337
338struct ar9170_rx_head {
339 u8 plcp[12];

--- 59 unchanged lines hidden (view full) ---

399} __packed;
400
401static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_macstatus *t)
402{
403 return (t->SAidx & 0xc0) >> 4 |
404 (t->DAidx & 0xc0) >> 6;
405}
406
407enum ar9170_txq {
408 AR9170_TXQ_BE,
409
410 AR9170_TXQ_VI,
411 AR9170_TXQ_VO,
412 AR9170_TXQ_BK,
413
414 __AR9170_NUM_TXQ,
415};
416
417/*
418 * This is an workaround for several undocumented bugs.
419 * Don't mess with the QoS/AC <-> HW Queue map, if you don't
420 * know what you are doing.
421 *
422 * Known problems [hardware]:
423 * * The MAC does not aggregate frames on anything other
424 * than the first HW queue.
425 * * when an AMPDU is placed [in the first hw queue] and
426 * additional frames are already queued on a different
427 * hw queue, the MAC will ALWAYS freeze.
428 *
429 * In a nutshell: The hardware can either do QoS or
430 * Aggregation but not both at the same time. As a
431 * result, this makes the device pretty much useless
432 * for any serious 802.11n setup.
433 */
407/*
408 * This is an workaround for several undocumented bugs.
409 * Don't mess with the QoS/AC <-> HW Queue map, if you don't
410 * know what you are doing.
411 *
412 * Known problems [hardware]:
413 * * The MAC does not aggregate frames on anything other
414 * than the first HW queue.
415 * * when an AMPDU is placed [in the first hw queue] and
416 * additional frames are already queued on a different
417 * hw queue, the MAC will ALWAYS freeze.
418 *
419 * In a nutshell: The hardware can either do QoS or
420 * Aggregation but not both at the same time. As a
421 * result, this makes the device pretty much useless
422 * for any serious 802.11n setup.
423 */
434static const u8 ar9170_qmap[__AR9170_NUM_TXQ] = { 2, 1, 0, 3 };
424enum ar9170_txq {
425 AR9170_TXQ_BK = 0, /* TXQ0 */
426 AR9170_TXQ_BE, /* TXQ1 */
427 AR9170_TXQ_VI, /* TXQ2 */
428 AR9170_TXQ_VO, /* TXQ3 */
435
429
430 __AR9170_NUM_TXQ,
431};
432
436#define AR9170_TXQ_DEPTH 32
437
438#endif /* __CARL9170_SHARED_WLAN_H */
433#define AR9170_TXQ_DEPTH 32
434
435#endif /* __CARL9170_SHARED_WLAN_H */