Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103352
b: refs/heads/master
c: 238f74a
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and John W. Linville committed Jul 8, 2008
1 parent 0c32efa commit 4c0ae68
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 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: 994d31f7430c3639b73c6ee038bd437c926b1227
refs/heads/master: 238f74a227fd7de8ea1bc66dcbbd36cf9920d1cb
2 changes: 2 additions & 0 deletions trunk/include/linux/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
#define IEEE80211_MAX_SSID_LEN 32
#define IEEE80211_MAX_MESH_ID_LEN 32
#define IEEE80211_QOS_CTL_LEN 2
#define IEEE80211_QOS_CTL_TID_MASK 0x000F
#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007

struct ieee80211_hdr {
__le16 frame_control;
Expand Down
28 changes: 14 additions & 14 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,20 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,

static void ieee80211_parse_qos(struct ieee80211_rx_data *rx)
{
u8 *data = rx->skb->data;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
int tid;

/* does the frame have a qos control field? */
if (WLAN_FC_IS_QOS_DATA(rx->fc)) {
u8 *qc = data + ieee80211_get_hdrlen(rx->fc) - QOS_CONTROL_LEN;
if (ieee80211_is_data_qos(hdr->frame_control)) {
u8 *qc = ieee80211_get_qos_ctl(hdr);
/* frame has qos control */
tid = qc[0] & QOS_CONTROL_TID_MASK;
if (qc[0] & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT)
tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
if (*qc & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT)
rx->flags |= IEEE80211_RX_AMSDU;
else
rx->flags &= ~IEEE80211_RX_AMSDU;
} else {
if (unlikely((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)) {
if (unlikely(ieee80211_is_mgmt(hdr->frame_control))) {
/* Separate TID for management frames */
tid = NUM_RX_DATA_QUEUES - 1;
} else {
Expand Down Expand Up @@ -1037,19 +1037,19 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
static ieee80211_rx_result debug_noinline
ieee80211_rx_h_remove_qos_control(struct ieee80211_rx_data *rx)
{
u16 fc = rx->fc;
u8 *data = rx->skb->data;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) data;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)data;

if (!WLAN_FC_IS_QOS_DATA(fc))
if (!ieee80211_is_data_qos(hdr->frame_control))
return RX_CONTINUE;

/* remove the qos control field, update frame type and meta-data */
memmove(data + 2, data, ieee80211_get_hdrlen(fc) - 2);
hdr = (struct ieee80211_hdr *) skb_pull(rx->skb, 2);
memmove(data + IEEE80211_QOS_CTL_LEN, data,
ieee80211_hdrlen(hdr->frame_control) - IEEE80211_QOS_CTL_LEN);
hdr = (struct ieee80211_hdr *)skb_pull(rx->skb, IEEE80211_QOS_CTL_LEN);
/* change frame type to non QOS */
rx->fc = fc &= ~IEEE80211_STYPE_QOS_DATA;
hdr->frame_control = cpu_to_le16(fc);
rx->fc &= ~IEEE80211_STYPE_QOS_DATA;
hdr->frame_control &= ~cpu_to_le16(IEEE80211_STYPE_QOS_DATA);

return RX_CONTINUE;
}
Expand Down Expand Up @@ -2044,7 +2044,7 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
if (!ieee80211_is_data_qos(hdr->frame_control))
goto end_reorder;

tid = *ieee80211_get_qos_ctl(hdr) & QOS_CONTROL_TID_MASK;
tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK;

if (sta->ampdu_mlme.tid_state_rx[tid] != HT_AGG_STATE_OPERATIONAL)
goto end_reorder;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/mac80211/wme.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
queue = skb_get_queue_mapping(skb);
rcu_read_lock();
sta = sta_info_get(local, hdr->addr1);
tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
if (sta) {
int ampdu_queue = sta->tid_to_tx_q[tid];
if ((ampdu_queue < QD_NUM(hw)) &&
Expand All @@ -181,7 +181,7 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd)
if (ieee80211_is_data_qos(hdr->frame_control)) {
u8 *p = ieee80211_get_qos_ctl(hdr);
u8 ack_policy = 0;
tid = skb->priority & QOS_CONTROL_TAG1D_MASK;
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
if (local->wifi_wme_noack_test)
ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK <<
QOS_CONTROL_ACK_POLICY_SHIFT;
Expand Down
8 changes: 0 additions & 8 deletions trunk/net/mac80211/wme.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@
#define QOS_CONTROL_ACK_POLICY_NORMAL 0
#define QOS_CONTROL_ACK_POLICY_NOACK 1

#define QOS_CONTROL_TID_MASK 0x0f
#define QOS_CONTROL_ACK_POLICY_SHIFT 5

#define QOS_CONTROL_TAG1D_MASK 0x07

extern const int ieee802_1d_to_ac[8];

static inline int WLAN_FC_IS_QOS_DATA(u16 fc)
{
return (fc & 0x8C) == 0x88;
}

#ifdef CONFIG_MAC80211_QOS
void ieee80211_install_qdisc(struct net_device *dev);
int ieee80211_qdisc_installed(struct net_device *dev);
Expand Down

0 comments on commit 4c0ae68

Please sign in to comment.