aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-12-18 19:31:27 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:37 -0500
commit51fb61e76d952e6bc2fbdd9f0d38425fbab1cf31 (patch)
tree09618b395aae1b91fbc8dec7ea9397a9654a9f0f /net/mac80211/rx.c
parent32bfd35d4b63bd63de4bb0d791ef049c3c868726 (diff)
mac80211: move interface type to vif structure
Drivers that support mixed AP/STA operation may well need to know the type of a virtual interface when iterating over them. The easiest way to support that is to move the interface type variable into the vif structure. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index ed3b81639203..465fce0f62ad 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -223,7 +223,7 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
223 if (!netif_running(sdata->dev)) 223 if (!netif_running(sdata->dev))
224 continue; 224 continue;
225 225
226 if (sdata->type != IEEE80211_IF_TYPE_MNTR) 226 if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR)
227 continue; 227 continue;
228 228
229 if (prev_dev) { 229 if (prev_dev) {
@@ -419,7 +419,7 @@ ieee80211_rx_h_check(struct ieee80211_txrx_data *rx)
419 if (unlikely(((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA || 419 if (unlikely(((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA ||
420 ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL && 420 ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL &&
421 (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)) && 421 (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)) &&
422 rx->sdata->type != IEEE80211_IF_TYPE_IBSS && 422 rx->sdata->vif.type != IEEE80211_IF_TYPE_IBSS &&
423 (!rx->sta || !(rx->sta->flags & WLAN_STA_ASSOC)))) { 423 (!rx->sta || !(rx->sta->flags & WLAN_STA_ASSOC)))) {
424 if ((!(rx->fc & IEEE80211_FCTL_FROMDS) && 424 if ((!(rx->fc & IEEE80211_FCTL_FROMDS) &&
425 !(rx->fc & IEEE80211_FCTL_TODS) && 425 !(rx->fc & IEEE80211_FCTL_TODS) &&
@@ -639,14 +639,14 @@ ieee80211_rx_h_sta_process(struct ieee80211_txrx_data *rx)
639 /* Update last_rx only for IBSS packets which are for the current 639 /* Update last_rx only for IBSS packets which are for the current
640 * BSSID to avoid keeping the current IBSS network alive in cases where 640 * BSSID to avoid keeping the current IBSS network alive in cases where
641 * other STAs are using different BSSID. */ 641 * other STAs are using different BSSID. */
642 if (rx->sdata->type == IEEE80211_IF_TYPE_IBSS) { 642 if (rx->sdata->vif.type == IEEE80211_IF_TYPE_IBSS) {
643 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, 643 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len,
644 IEEE80211_IF_TYPE_IBSS); 644 IEEE80211_IF_TYPE_IBSS);
645 if (compare_ether_addr(bssid, rx->sdata->u.sta.bssid) == 0) 645 if (compare_ether_addr(bssid, rx->sdata->u.sta.bssid) == 0)
646 sta->last_rx = jiffies; 646 sta->last_rx = jiffies;
647 } else 647 } else
648 if (!is_multicast_ether_addr(hdr->addr1) || 648 if (!is_multicast_ether_addr(hdr->addr1) ||
649 rx->sdata->type == IEEE80211_IF_TYPE_STA) { 649 rx->sdata->vif.type == IEEE80211_IF_TYPE_STA) {
650 /* Update last_rx only for unicast frames in order to prevent 650 /* Update last_rx only for unicast frames in order to prevent
651 * the Probe Request frames (the only broadcast frames from a 651 * the Probe Request frames (the only broadcast frames from a
652 * STA in infrastructure mode) from keeping a connection alive. 652 * STA in infrastructure mode) from keeping a connection alive.
@@ -901,8 +901,8 @@ ieee80211_rx_h_ps_poll(struct ieee80211_txrx_data *rx)
901 !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH))) 901 !(rx->flags & IEEE80211_TXRXD_RXRA_MATCH)))
902 return TXRX_CONTINUE; 902 return TXRX_CONTINUE;
903 903
904 if ((sdata->type != IEEE80211_IF_TYPE_AP) && 904 if ((sdata->vif.type != IEEE80211_IF_TYPE_AP) &&
905 (sdata->type != IEEE80211_IF_TYPE_VLAN)) 905 (sdata->vif.type != IEEE80211_IF_TYPE_VLAN))
906 return TXRX_DROP; 906 return TXRX_DROP;
907 907
908 skb = skb_dequeue(&rx->sta->tx_filtered); 908 skb = skb_dequeue(&rx->sta->tx_filtered);
@@ -1058,8 +1058,8 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx)
1058 memcpy(dst, hdr->addr3, ETH_ALEN); 1058 memcpy(dst, hdr->addr3, ETH_ALEN);
1059 memcpy(src, hdr->addr2, ETH_ALEN); 1059 memcpy(src, hdr->addr2, ETH_ALEN);
1060 1060
1061 if (unlikely(sdata->type != IEEE80211_IF_TYPE_AP && 1061 if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_AP &&
1062 sdata->type != IEEE80211_IF_TYPE_VLAN)) { 1062 sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) {
1063 if (net_ratelimit()) 1063 if (net_ratelimit())
1064 printk(KERN_DEBUG "%s: dropped ToDS frame " 1064 printk(KERN_DEBUG "%s: dropped ToDS frame "
1065 "(BSSID=%s SA=%s DA=%s)\n", 1065 "(BSSID=%s SA=%s DA=%s)\n",
@@ -1075,7 +1075,7 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx)
1075 memcpy(dst, hdr->addr3, ETH_ALEN); 1075 memcpy(dst, hdr->addr3, ETH_ALEN);
1076 memcpy(src, hdr->addr4, ETH_ALEN); 1076 memcpy(src, hdr->addr4, ETH_ALEN);
1077 1077
1078 if (unlikely(sdata->type != IEEE80211_IF_TYPE_WDS)) { 1078 if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_WDS)) {
1079 if (net_ratelimit()) 1079 if (net_ratelimit())
1080 printk(KERN_DEBUG "%s: dropped FromDS&ToDS " 1080 printk(KERN_DEBUG "%s: dropped FromDS&ToDS "
1081 "frame (RA=%s TA=%s DA=%s SA=%s)\n", 1081 "frame (RA=%s TA=%s DA=%s SA=%s)\n",
@@ -1092,7 +1092,7 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx)
1092 memcpy(dst, hdr->addr1, ETH_ALEN); 1092 memcpy(dst, hdr->addr1, ETH_ALEN);
1093 memcpy(src, hdr->addr3, ETH_ALEN); 1093 memcpy(src, hdr->addr3, ETH_ALEN);
1094 1094
1095 if (sdata->type != IEEE80211_IF_TYPE_STA || 1095 if (sdata->vif.type != IEEE80211_IF_TYPE_STA ||
1096 (is_multicast_ether_addr(dst) && 1096 (is_multicast_ether_addr(dst) &&
1097 !compare_ether_addr(src, dev->dev_addr))) 1097 !compare_ether_addr(src, dev->dev_addr)))
1098 return -1; 1098 return -1;
@@ -1102,7 +1102,7 @@ ieee80211_data_to_8023(struct ieee80211_txrx_data *rx)
1102 memcpy(dst, hdr->addr1, ETH_ALEN); 1102 memcpy(dst, hdr->addr1, ETH_ALEN);
1103 memcpy(src, hdr->addr2, ETH_ALEN); 1103 memcpy(src, hdr->addr2, ETH_ALEN);
1104 1104
1105 if (sdata->type != IEEE80211_IF_TYPE_IBSS) { 1105 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS) {
1106 if (net_ratelimit()) { 1106 if (net_ratelimit()) {
1107 printk(KERN_DEBUG "%s: dropped IBSS frame " 1107 printk(KERN_DEBUG "%s: dropped IBSS frame "
1108 "(DA=%s SA=%s BSSID=%s)\n", 1108 "(DA=%s SA=%s BSSID=%s)\n",
@@ -1190,8 +1190,8 @@ ieee80211_deliver_skb(struct ieee80211_txrx_data *rx)
1190 skb = rx->skb; 1190 skb = rx->skb;
1191 xmit_skb = NULL; 1191 xmit_skb = NULL;
1192 1192
1193 if (local->bridge_packets && (sdata->type == IEEE80211_IF_TYPE_AP || 1193 if (local->bridge_packets && (sdata->vif.type == IEEE80211_IF_TYPE_AP ||
1194 sdata->type == IEEE80211_IF_TYPE_VLAN) && 1194 sdata->vif.type == IEEE80211_IF_TYPE_VLAN) &&
1195 (rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) { 1195 (rx->flags & IEEE80211_TXRXD_RXRA_MATCH)) {
1196 if (is_multicast_ether_addr(ehdr->h_dest)) { 1196 if (is_multicast_ether_addr(ehdr->h_dest)) {
1197 /* 1197 /*
@@ -1435,8 +1435,8 @@ ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx)
1435 return TXRX_DROP; 1435 return TXRX_DROP;
1436 1436
1437 sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); 1437 sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev);
1438 if ((sdata->type == IEEE80211_IF_TYPE_STA || 1438 if ((sdata->vif.type == IEEE80211_IF_TYPE_STA ||
1439 sdata->type == IEEE80211_IF_TYPE_IBSS) && 1439 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) &&
1440 !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) 1440 !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME))
1441 ieee80211_sta_rx_mgmt(rx->dev, rx->skb, rx->u.rx.status); 1441 ieee80211_sta_rx_mgmt(rx->dev, rx->skb, rx->u.rx.status);
1442 else 1442 else
@@ -1528,7 +1528,7 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1528 goto ignore; 1528 goto ignore;
1529 } 1529 }
1530 1530
1531 if (rx->sdata->type == IEEE80211_IF_TYPE_AP && keyidx) { 1531 if (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP && keyidx) {
1532 /* 1532 /*
1533 * APs with pairwise keys should never receive Michael MIC 1533 * APs with pairwise keys should never receive Michael MIC
1534 * errors for non-zero keyidx because these are reserved for 1534 * errors for non-zero keyidx because these are reserved for
@@ -1590,7 +1590,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1590{ 1590{
1591 int multicast = is_multicast_ether_addr(hdr->addr1); 1591 int multicast = is_multicast_ether_addr(hdr->addr1);
1592 1592
1593 switch (sdata->type) { 1593 switch (sdata->vif.type) {
1594 case IEEE80211_IF_TYPE_STA: 1594 case IEEE80211_IF_TYPE_STA:
1595 if (!bssid) 1595 if (!bssid)
1596 return 0; 1596 return 0;
@@ -1738,10 +1738,10 @@ void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, struct sk_buff *skb,
1738 if (!netif_running(sdata->dev)) 1738 if (!netif_running(sdata->dev))
1739 continue; 1739 continue;
1740 1740
1741 if (sdata->type == IEEE80211_IF_TYPE_MNTR) 1741 if (sdata->vif.type == IEEE80211_IF_TYPE_MNTR)
1742 continue; 1742 continue;
1743 1743
1744 bssid = ieee80211_get_bssid(hdr, skb->len, sdata->type); 1744 bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type);
1745 rx.flags |= IEEE80211_TXRXD_RXRA_MATCH; 1745 rx.flags |= IEEE80211_TXRXD_RXRA_MATCH;
1746 prepares = prepare_for_handlers(sdata, bssid, &rx, hdr); 1746 prepares = prepare_for_handlers(sdata, bssid, &rx, hdr);
1747 /* prepare_for_handlers can change sta */ 1747 /* prepare_for_handlers can change sta */