aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index bc4fefc91663..ccf373788ce9 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -351,8 +351,8 @@ static void purge_old_ps_buffers(struct ieee80211_local *local)
351 351
352 local->total_ps_buffered = total; 352 local->total_ps_buffered = total;
353#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 353#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
354 printk(KERN_DEBUG "%s: PS buffers full - purged %d frames\n", 354 wiphy_debug(local->hw.wiphy, "PS buffers full - purged %d frames\n",
355 wiphy_name(local->hw.wiphy), purged); 355 purged);
356#endif 356#endif
357} 357}
358 358
@@ -509,6 +509,18 @@ ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx)
509} 509}
510 510
511static ieee80211_tx_result debug_noinline 511static ieee80211_tx_result debug_noinline
512ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx)
513{
514 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
515
516 if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol &&
517 tx->sdata->control_port_no_encrypt))
518 info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
519
520 return TX_CONTINUE;
521}
522
523static ieee80211_tx_result debug_noinline
512ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) 524ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
513{ 525{
514 struct ieee80211_key *key = NULL; 526 struct ieee80211_key *key = NULL;
@@ -527,7 +539,7 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
527 else if ((key = rcu_dereference(tx->sdata->default_key))) 539 else if ((key = rcu_dereference(tx->sdata->default_key)))
528 tx->key = key; 540 tx->key = key;
529 else if (tx->sdata->drop_unencrypted && 541 else if (tx->sdata->drop_unencrypted &&
530 (tx->skb->protocol != cpu_to_be16(ETH_P_PAE)) && 542 (tx->skb->protocol != tx->sdata->control_port_protocol) &&
531 !(info->flags & IEEE80211_TX_CTL_INJECTED) && 543 !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
532 (!ieee80211_is_robust_mgmt_frame(hdr) || 544 (!ieee80211_is_robust_mgmt_frame(hdr) ||
533 (ieee80211_is_action(hdr->frame_control) && 545 (ieee80211_is_action(hdr->frame_control) &&
@@ -947,6 +959,8 @@ ieee80211_tx_h_stats(struct ieee80211_tx_data *tx)
947static ieee80211_tx_result debug_noinline 959static ieee80211_tx_result debug_noinline
948ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx) 960ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx)
949{ 961{
962 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
963
950 if (!tx->key) 964 if (!tx->key)
951 return TX_CONTINUE; 965 return TX_CONTINUE;
952 966
@@ -960,10 +974,16 @@ ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx)
960 return ieee80211_crypto_ccmp_encrypt(tx); 974 return ieee80211_crypto_ccmp_encrypt(tx);
961 case WLAN_CIPHER_SUITE_AES_CMAC: 975 case WLAN_CIPHER_SUITE_AES_CMAC:
962 return ieee80211_crypto_aes_cmac_encrypt(tx); 976 return ieee80211_crypto_aes_cmac_encrypt(tx);
977 default:
978 /* handle hw-only algorithm */
979 if (info->control.hw_key) {
980 ieee80211_tx_set_protected(tx);
981 return TX_CONTINUE;
982 }
983 break;
984
963 } 985 }
964 986
965 /* not reached */
966 WARN_ON(1);
967 return TX_DROP; 987 return TX_DROP;
968} 988}
969 989
@@ -1341,6 +1361,7 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
1341 CALL_TXH(ieee80211_tx_h_dynamic_ps); 1361 CALL_TXH(ieee80211_tx_h_dynamic_ps);
1342 CALL_TXH(ieee80211_tx_h_check_assoc); 1362 CALL_TXH(ieee80211_tx_h_check_assoc);
1343 CALL_TXH(ieee80211_tx_h_ps_buf); 1363 CALL_TXH(ieee80211_tx_h_ps_buf);
1364 CALL_TXH(ieee80211_tx_h_check_control_port_protocol);
1344 CALL_TXH(ieee80211_tx_h_select_key); 1365 CALL_TXH(ieee80211_tx_h_select_key);
1345 if (!(tx->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL)) 1366 if (!(tx->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL))
1346 CALL_TXH(ieee80211_tx_h_rate_ctrl); 1367 CALL_TXH(ieee80211_tx_h_rate_ctrl);
@@ -1513,8 +1534,8 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
1513 I802_DEBUG_INC(local->tx_expand_skb_head); 1534 I802_DEBUG_INC(local->tx_expand_skb_head);
1514 1535
1515 if (pskb_expand_head(skb, head_need, tail_need, GFP_ATOMIC)) { 1536 if (pskb_expand_head(skb, head_need, tail_need, GFP_ATOMIC)) {
1516 printk(KERN_DEBUG "%s: failed to reallocate TX buffer\n", 1537 wiphy_debug(local->hw.wiphy,
1517 wiphy_name(local->hw.wiphy)); 1538 "failed to reallocate TX buffer\n");
1518 return -ENOMEM; 1539 return -ENOMEM;
1519 } 1540 }
1520 1541
@@ -1701,7 +1722,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1701 u16 ethertype, hdrlen, meshhdrlen = 0; 1722 u16 ethertype, hdrlen, meshhdrlen = 0;
1702 __le16 fc; 1723 __le16 fc;
1703 struct ieee80211_hdr hdr; 1724 struct ieee80211_hdr hdr;
1704 struct ieee80211s_hdr mesh_hdr; 1725 struct ieee80211s_hdr mesh_hdr __maybe_unused;
1705 const u8 *encaps_data; 1726 const u8 *encaps_data;
1706 int encaps_len, skip_header_bytes; 1727 int encaps_len, skip_header_bytes;
1707 int nh_pos, h_pos; 1728 int nh_pos, h_pos;
@@ -1818,7 +1839,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1818#endif 1839#endif
1819 case NL80211_IFTYPE_STATION: 1840 case NL80211_IFTYPE_STATION:
1820 memcpy(hdr.addr1, sdata->u.mgd.bssid, ETH_ALEN); 1841 memcpy(hdr.addr1, sdata->u.mgd.bssid, ETH_ALEN);
1821 if (sdata->u.mgd.use_4addr && ethertype != ETH_P_PAE) { 1842 if (sdata->u.mgd.use_4addr &&
1843 cpu_to_be16(ethertype) != sdata->control_port_protocol) {
1822 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); 1844 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS);
1823 /* RA TA DA SA */ 1845 /* RA TA DA SA */
1824 memcpy(hdr.addr2, sdata->vif.addr, ETH_ALEN); 1846 memcpy(hdr.addr2, sdata->vif.addr, ETH_ALEN);
@@ -1871,7 +1893,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1871 if (!ieee80211_vif_is_mesh(&sdata->vif) && 1893 if (!ieee80211_vif_is_mesh(&sdata->vif) &&
1872 unlikely(!is_multicast_ether_addr(hdr.addr1) && 1894 unlikely(!is_multicast_ether_addr(hdr.addr1) &&
1873 !(sta_flags & WLAN_STA_AUTHORIZED) && 1895 !(sta_flags & WLAN_STA_AUTHORIZED) &&
1874 !(ethertype == ETH_P_PAE && 1896 !(cpu_to_be16(ethertype) == sdata->control_port_protocol &&
1875 compare_ether_addr(sdata->vif.addr, 1897 compare_ether_addr(sdata->vif.addr,
1876 skb->data + ETH_ALEN) == 0))) { 1898 skb->data + ETH_ALEN) == 0))) {
1877#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1899#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -2070,8 +2092,7 @@ void ieee80211_tx_pending(unsigned long data)
2070 2092
2071 if (skb_queue_empty(&local->pending[i])) 2093 if (skb_queue_empty(&local->pending[i]))
2072 list_for_each_entry_rcu(sdata, &local->interfaces, list) 2094 list_for_each_entry_rcu(sdata, &local->interfaces, list)
2073 netif_tx_wake_queue( 2095 netif_wake_subqueue(sdata->dev, i);
2074 netdev_get_tx_queue(sdata->dev, i));
2075 } 2096 }
2076 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); 2097 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
2077 2098