Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183348
b: refs/heads/master
c: e0493a8
h: refs/heads/master
v: v3
  • Loading branch information
Lennert Buytenhek authored and John W. Linville committed Dec 28, 2009
1 parent 4c80dc2 commit 7cdaee6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 42 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: 74726e729291131ac2b9ab7e0bd2e18b7b03970d
refs/heads/master: e0493a8dd6351a114b53790dda6bd855ae73a85c
51 changes: 10 additions & 41 deletions trunk/drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,35 +658,6 @@ struct peer_capability_info {
__le16 amsdu_enabled;
} __attribute__((packed));

/* Inline functions to manipulate QoS field in data descriptor. */
static inline u16 mwl8k_qos_setbit_eosp(u16 qos)
{
u16 val_mask = 1 << 4;

/* End of Service Period Bit 4 */
return qos | val_mask;
}

static inline u16 mwl8k_qos_setbit_ack(u16 qos, u8 ack_policy)
{
u16 val_mask = 0x3;
u8 shift = 5;
u16 qos_mask = ~(val_mask << shift);

/* Ack Policy Bit 5-6 */
return (qos & qos_mask) | ((ack_policy & val_mask) << shift);
}

static inline u16 mwl8k_qos_setbit_qlen(u16 qos, u8 len)
{
u16 val_mask = 0xff;
u8 shift = 8;
u16 qos_mask = ~(val_mask << shift);

/* Queue Length Bits 8-15 */
return (qos & qos_mask) | ((len & val_mask) << shift);
}

/* DMA header used by firmware and hardware. */
struct mwl8k_dma_data {
__le16 fwlen;
Expand Down Expand Up @@ -1145,16 +1116,18 @@ static int rxq_process(struct ieee80211_hw *hw, int index, int limit)
* Packet transmission.
*/

/* Transmit packet ACK policy */
#define MWL8K_TXD_ACK_POLICY_NORMAL 0
#define MWL8K_TXD_ACK_POLICY_BLOCKACK 3

#define MWL8K_TXD_STATUS_OK 0x00000001
#define MWL8K_TXD_STATUS_OK_RETRY 0x00000002
#define MWL8K_TXD_STATUS_OK_MORE_RETRY 0x00000004
#define MWL8K_TXD_STATUS_MULTICAST_TX 0x00000008
#define MWL8K_TXD_STATUS_FW_OWNED 0x80000000

#define MWL8K_QOS_QLEN_UNSPEC 0xff00
#define MWL8K_QOS_ACK_POLICY_MASK 0x0060
#define MWL8K_QOS_ACK_POLICY_NORMAL 0x0000
#define MWL8K_QOS_ACK_POLICY_BLOCKACK 0x0060
#define MWL8K_QOS_EOSP 0x0010

struct mwl8k_tx_desc {
__le32 status;
__u8 data_rate;
Expand Down Expand Up @@ -1451,21 +1424,17 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
if (ieee80211_is_mgmt(wh->frame_control) ||
ieee80211_is_ctl(wh->frame_control)) {
txdatarate = 0;
qos = mwl8k_qos_setbit_eosp(qos);
/* Set Queue size to unspecified */
qos = mwl8k_qos_setbit_qlen(qos, 0xff);
qos |= MWL8K_QOS_QLEN_UNSPEC | MWL8K_QOS_EOSP;
} else if (ieee80211_is_data(wh->frame_control)) {
txdatarate = 1;
if (is_multicast_ether_addr(wh->addr1))
txstatus |= MWL8K_TXD_STATUS_MULTICAST_TX;

/* Send pkt in an aggregate if AMPDU frame. */
qos &= ~MWL8K_QOS_ACK_POLICY_MASK;
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU)
qos = mwl8k_qos_setbit_ack(qos,
MWL8K_TXD_ACK_POLICY_BLOCKACK);
qos |= MWL8K_QOS_ACK_POLICY_BLOCKACK;
else
qos = mwl8k_qos_setbit_ack(qos,
MWL8K_TXD_ACK_POLICY_NORMAL);
qos |= MWL8K_QOS_ACK_POLICY_NORMAL;
}

dma = pci_map_single(priv->pdev, skb->data,
Expand Down

0 comments on commit 7cdaee6

Please sign in to comment.