aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-07-02 12:09:12 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-08-12 08:09:29 -0400
commitaf61a165187bb94b1dc7628ef815c23d0eacf40b (patch)
tree9dae3fcf629a55b0f3e91bec51ad92a9d77e6402 /net
parent1da5fcc86d71040c5b294ca5611ae6c86bfa815c (diff)
mac80211: add control port protocol TX control flag
A lot of drivers check the frame protocol for ETH_P_PAE, for various reasons (like making those more reliable). Add a new flags bitmap to the TX control info and a new flag indicating the control port protocol is in use to let all drivers also apply such logic to other control port protocols, should they be configured. Also use the new flag in the iwlwifi drivers. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/rc80211_minstrel_ht.c5
-rw-r--r--net/mac80211/tx.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 7475a7a33797..9eff3824f2d1 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -439,12 +439,13 @@ minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb)
439{ 439{
440 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 440 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
441 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); 441 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
442 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
442 u16 tid; 443 u16 tid;
443 444
444 if (unlikely(!ieee80211_is_data_qos(hdr->frame_control))) 445 if (unlikely(!ieee80211_is_data_qos(hdr->frame_control)))
445 return; 446 return;
446 447
447 if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE))) 448 if (unlikely(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
448 return; 449 return;
449 450
450 tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK; 451 tid = *ieee80211_get_qos_ctl(hdr) & IEEE80211_QOS_CTL_TID_MASK;
@@ -776,7 +777,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
776 777
777 /* Don't use EAPOL frames for sampling on non-mrr hw */ 778 /* Don't use EAPOL frames for sampling on non-mrr hw */
778 if (mp->hw->max_rates == 1 && 779 if (mp->hw->max_rates == 1 &&
779 txrc->skb->protocol == cpu_to_be16(ETH_P_PAE)) 780 (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
780 sample_idx = -1; 781 sample_idx = -1;
781 else 782 else
782 sample_idx = minstrel_get_sample_rate(mp, mi); 783 sample_idx = minstrel_get_sample_rate(mp, mi);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0e42322aa6b1..098ae854ad3c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -539,9 +539,11 @@ ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx)
539{ 539{
540 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); 540 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
541 541
542 if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol && 542 if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol)) {
543 tx->sdata->control_port_no_encrypt)) 543 if (tx->sdata->control_port_no_encrypt)
544 info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 544 info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
545 info->control.flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO;
546 }
545 547
546 return TX_CONTINUE; 548 return TX_CONTINUE;
547} 549}