aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-02-15 06:44:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:51:42 -0500
commit469002983fc90c2ff0959e2b03335c0fe2e4d5a9 (patch)
treefdcf78dcdaeadba897abd86d39d0275e236803b3 /net/mac80211/tx.c
parent96f5e66e8a79810e2982cdcfa28e554f3d97da21 (diff)
mac80211: split IBSS/managed code
This patch splits out the ibss code and data from managed (station) mode. The reason to do this is to better separate the state machines, and have the code be contained better so it gets easier to determine what exactly a given change will affect, that in turn makes it easier to understand. This is quite some churn, especially because I split sdata->u.sta into sdata->u.mgd and sdata->u.ibss, but I think it's easier to maintain that way. I've also shuffled around some code -- null function sending is only applicable to managed interfaces so put that into that file, some other functions are needed from various places so put them into util, and also rearranged the prototypes in ieee80211_i.h accordingly. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 6aca49897d55..c3f0e950125b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1633,7 +1633,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1633 case NL80211_IFTYPE_STATION: 1633 case NL80211_IFTYPE_STATION:
1634 fc |= cpu_to_le16(IEEE80211_FCTL_TODS); 1634 fc |= cpu_to_le16(IEEE80211_FCTL_TODS);
1635 /* BSSID SA DA */ 1635 /* BSSID SA DA */
1636 memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN); 1636 memcpy(hdr.addr1, sdata->u.mgd.bssid, ETH_ALEN);
1637 memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); 1637 memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
1638 memcpy(hdr.addr3, skb->data, ETH_ALEN); 1638 memcpy(hdr.addr3, skb->data, ETH_ALEN);
1639 hdrlen = 24; 1639 hdrlen = 24;
@@ -1642,7 +1642,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1642 /* DA SA BSSID */ 1642 /* DA SA BSSID */
1643 memcpy(hdr.addr1, skb->data, ETH_ALEN); 1643 memcpy(hdr.addr1, skb->data, ETH_ALEN);
1644 memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); 1644 memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
1645 memcpy(hdr.addr3, sdata->u.sta.bssid, ETH_ALEN); 1645 memcpy(hdr.addr3, sdata->u.ibss.bssid, ETH_ALEN);
1646 hdrlen = 24; 1646 hdrlen = 24;
1647 break; 1647 break;
1648 default: 1648 default:
@@ -1928,7 +1928,6 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1928 struct ieee80211_tx_info *info; 1928 struct ieee80211_tx_info *info;
1929 struct ieee80211_sub_if_data *sdata = NULL; 1929 struct ieee80211_sub_if_data *sdata = NULL;
1930 struct ieee80211_if_ap *ap = NULL; 1930 struct ieee80211_if_ap *ap = NULL;
1931 struct ieee80211_if_sta *ifsta = NULL;
1932 struct beacon_data *beacon; 1931 struct beacon_data *beacon;
1933 struct ieee80211_supported_band *sband; 1932 struct ieee80211_supported_band *sband;
1934 enum ieee80211_band band = local->hw.conf.channel->band; 1933 enum ieee80211_band band = local->hw.conf.channel->band;
@@ -1980,13 +1979,13 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1980 } else 1979 } else
1981 goto out; 1980 goto out;
1982 } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { 1981 } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
1982 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
1983 struct ieee80211_hdr *hdr; 1983 struct ieee80211_hdr *hdr;
1984 ifsta = &sdata->u.sta;
1985 1984
1986 if (!ifsta->probe_resp) 1985 if (!ifibss->probe_resp)
1987 goto out; 1986 goto out;
1988 1987
1989 skb = skb_copy(ifsta->probe_resp, GFP_ATOMIC); 1988 skb = skb_copy(ifibss->probe_resp, GFP_ATOMIC);
1990 if (!skb) 1989 if (!skb)
1991 goto out; 1990 goto out;
1992 1991