aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-10-25 18:09:11 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-26 06:32:18 -0400
commit1df332e82d0facc6b236957f1a5691b550b4e1f1 (patch)
treea06658446a90986c2be65fda9ab349a13f2918fd /net/mac80211/rx.c
parent1724ffbc7439de679d536163e03f54f35574d449 (diff)
mac80211: a few formatting fixes
Fix a few code formatting issues in the RX code. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index d07216ab5f72..c0a1f53e68ab 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -54,8 +54,7 @@ static struct sk_buff *remove_monitor_info(struct ieee80211_local *local,
54 return skb; 54 return skb;
55} 55}
56 56
57static inline int should_drop_frame(struct sk_buff *skb, 57static inline int should_drop_frame(struct sk_buff *skb, int present_fcs_len)
58 int present_fcs_len)
59{ 58{
60 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 59 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
61 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 60 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -130,15 +129,14 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
130 (1 << IEEE80211_RADIOTAP_RX_FLAGS)); 129 (1 << IEEE80211_RADIOTAP_RX_FLAGS));
131 rthdr->it_len = cpu_to_le16(rtap_len); 130 rthdr->it_len = cpu_to_le16(rtap_len);
132 131
133 pos = (unsigned char *)(rthdr+1); 132 pos = (unsigned char *)(rthdr + 1);
134 133
135 /* the order of the following fields is important */ 134 /* the order of the following fields is important */
136 135
137 /* IEEE80211_RADIOTAP_TSFT */ 136 /* IEEE80211_RADIOTAP_TSFT */
138 if (status->flag & RX_FLAG_MACTIME_MPDU) { 137 if (status->flag & RX_FLAG_MACTIME_MPDU) {
139 put_unaligned_le64(status->mactime, pos); 138 put_unaligned_le64(status->mactime, pos);
140 rthdr->it_present |= 139 rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT);
141 cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT);
142 pos += 8; 140 pos += 8;
143 } 141 }
144 142
@@ -374,7 +372,6 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
374 return origskb; 372 return origskb;
375} 373}
376 374
377
378static void ieee80211_parse_qos(struct ieee80211_rx_data *rx) 375static void ieee80211_parse_qos(struct ieee80211_rx_data *rx)
379{ 376{
380 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; 377 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
@@ -481,8 +478,7 @@ static int ieee80211_get_mmie_keyidx(struct sk_buff *skb)
481 struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *) skb->data; 478 struct ieee80211_mgmt *hdr = (struct ieee80211_mgmt *) skb->data;
482 struct ieee80211_mmie *mmie; 479 struct ieee80211_mmie *mmie;
483 480
484 if (skb->len < 24 + sizeof(*mmie) || 481 if (skb->len < 24 + sizeof(*mmie) || !is_multicast_ether_addr(hdr->da))
485 !is_multicast_ether_addr(hdr->da))
486 return -1; 482 return -1;
487 483
488 if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *) hdr)) 484 if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *) hdr))
@@ -497,9 +493,7 @@ static int ieee80211_get_mmie_keyidx(struct sk_buff *skb)
497 return le16_to_cpu(mmie->key_id); 493 return le16_to_cpu(mmie->key_id);
498} 494}
499 495
500 496static ieee80211_rx_result ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
501static ieee80211_rx_result
502ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
503{ 497{
504 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; 498 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
505 char *dev_addr = rx->sdata->vif.addr; 499 char *dev_addr = rx->sdata->vif.addr;
@@ -507,7 +501,7 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
507 if (ieee80211_is_data(hdr->frame_control)) { 501 if (ieee80211_is_data(hdr->frame_control)) {
508 if (is_multicast_ether_addr(hdr->addr1)) { 502 if (is_multicast_ether_addr(hdr->addr1)) {
509 if (ieee80211_has_tods(hdr->frame_control) || 503 if (ieee80211_has_tods(hdr->frame_control) ||
510 !ieee80211_has_fromds(hdr->frame_control)) 504 !ieee80211_has_fromds(hdr->frame_control))
511 return RX_DROP_MONITOR; 505 return RX_DROP_MONITOR;
512 if (ether_addr_equal(hdr->addr3, dev_addr)) 506 if (ether_addr_equal(hdr->addr3, dev_addr))
513 return RX_DROP_MONITOR; 507 return RX_DROP_MONITOR;
@@ -534,7 +528,7 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
534 mgmt = (struct ieee80211_mgmt *)hdr; 528 mgmt = (struct ieee80211_mgmt *)hdr;
535 category = mgmt->u.action.category; 529 category = mgmt->u.action.category;
536 if (category != WLAN_CATEGORY_MESH_ACTION && 530 if (category != WLAN_CATEGORY_MESH_ACTION &&
537 category != WLAN_CATEGORY_SELF_PROTECTED) 531 category != WLAN_CATEGORY_SELF_PROTECTED)
538 return RX_DROP_MONITOR; 532 return RX_DROP_MONITOR;
539 return RX_CONTINUE; 533 return RX_CONTINUE;
540 } 534 }
@@ -546,7 +540,6 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
546 return RX_CONTINUE; 540 return RX_CONTINUE;
547 541
548 return RX_DROP_MONITOR; 542 return RX_DROP_MONITOR;
549
550 } 543 }
551 544
552 return RX_CONTINUE; 545 return RX_CONTINUE;
@@ -570,7 +563,6 @@ static inline u16 seq_sub(u16 sq1, u16 sq2)
570 return (sq1 - sq2) & SEQ_MASK; 563 return (sq1 - sq2) & SEQ_MASK;
571} 564}
572 565
573
574static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata, 566static void ieee80211_release_reorder_frame(struct ieee80211_sub_if_data *sdata,
575 struct tid_ampdu_rx *tid_agg_rx, 567 struct tid_ampdu_rx *tid_agg_rx,
576 int index) 568 int index)
@@ -1575,18 +1567,15 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
1575 return RX_CONTINUE; 1567 return RX_CONTINUE;
1576} 1568}
1577 1569
1578static int 1570static int ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx)
1579ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx)
1580{ 1571{
1581 if (unlikely(!rx->sta || 1572 if (unlikely(!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_AUTHORIZED)))
1582 !test_sta_flag(rx->sta, WLAN_STA_AUTHORIZED)))
1583 return -EACCES; 1573 return -EACCES;
1584 1574
1585 return 0; 1575 return 0;
1586} 1576}
1587 1577
1588static int 1578static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
1589ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
1590{ 1579{
1591 struct sk_buff *skb = rx->skb; 1580 struct sk_buff *skb = rx->skb;
1592 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 1581 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
@@ -1608,8 +1597,7 @@ ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
1608 return 0; 1597 return 0;
1609} 1598}
1610 1599
1611static int 1600static int ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx)
1612ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx)
1613{ 1601{
1614 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; 1602 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
1615 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 1603 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
@@ -1978,7 +1966,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1978 } else { 1966 } else {
1979 /* unable to resolve next hop */ 1967 /* unable to resolve next hop */
1980 mesh_path_error_tx(ifmsh->mshcfg.element_ttl, fwd_hdr->addr3, 1968 mesh_path_error_tx(ifmsh->mshcfg.element_ttl, fwd_hdr->addr3,
1981 0, reason, fwd_hdr->addr2, sdata); 1969 0, reason, fwd_hdr->addr2, sdata);
1982 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route); 1970 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
1983 kfree_skb(fwd_skb); 1971 kfree_skb(fwd_skb);
1984 return RX_DROP_MONITOR; 1972 return RX_DROP_MONITOR;
@@ -2379,7 +2367,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx)
2379 if (!ieee80211_vif_is_mesh(&sdata->vif)) 2367 if (!ieee80211_vif_is_mesh(&sdata->vif))
2380 break; 2368 break;
2381 if (mesh_action_is_path_sel(mgmt) && 2369 if (mesh_action_is_path_sel(mgmt) &&
2382 (!mesh_path_sel_is_hwmp(sdata))) 2370 !mesh_path_sel_is_hwmp(sdata))
2383 break; 2371 break;
2384 goto queue; 2372 goto queue;
2385 } 2373 }
@@ -2435,7 +2423,6 @@ ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx)
2435 return RX_QUEUED; 2423 return RX_QUEUED;
2436 } 2424 }
2437 2425
2438
2439 return RX_CONTINUE; 2426 return RX_CONTINUE;
2440} 2427}
2441 2428