diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-07-09 08:40:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-14 14:30:07 -0400 |
commit | 9d139c810a2aa17365cc548d0cd2a189d8433c65 (patch) | |
tree | ef10ca55f93689ab97368376d277102d2527c961 /net/mac80211/tx.c | |
parent | f3947e2dfa3b18f375b7acd03b7ee2877d0751fc (diff) |
mac80211: revamp beacon configuration
This patch changes mac80211's beacon configuration handling
to never pass skbs to the driver directly but rather always
require the driver to use ieee80211_beacon_get(). Additionally,
it introduces "change flags" on the config_interface() call
to enable drivers to figure out what is changing. Finally, it
removes the beacon_update() driver callback in favour of
having IBSS beacon delivered by ieee80211_beacon_get() as well.
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.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index a757dcc1208d..8843416e1460 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1788,17 +1788,17 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1788 | struct ieee80211_vif *vif) | 1788 | struct ieee80211_vif *vif) |
1789 | { | 1789 | { |
1790 | struct ieee80211_local *local = hw_to_local(hw); | 1790 | struct ieee80211_local *local = hw_to_local(hw); |
1791 | struct sk_buff *skb; | 1791 | struct sk_buff *skb = NULL; |
1792 | struct ieee80211_tx_info *info; | 1792 | struct ieee80211_tx_info *info; |
1793 | struct net_device *bdev; | 1793 | struct net_device *bdev; |
1794 | struct ieee80211_sub_if_data *sdata = NULL; | 1794 | struct ieee80211_sub_if_data *sdata = NULL; |
1795 | struct ieee80211_if_ap *ap = NULL; | 1795 | struct ieee80211_if_ap *ap = NULL; |
1796 | struct ieee80211_if_sta *ifsta = NULL; | ||
1796 | struct rate_selection rsel; | 1797 | struct rate_selection rsel; |
1797 | struct beacon_data *beacon; | 1798 | struct beacon_data *beacon; |
1798 | struct ieee80211_supported_band *sband; | 1799 | struct ieee80211_supported_band *sband; |
1799 | struct ieee80211_mgmt *mgmt; | 1800 | struct ieee80211_mgmt *mgmt; |
1800 | int *num_beacons; | 1801 | int *num_beacons; |
1801 | bool err = true; | ||
1802 | enum ieee80211_band band = local->hw.conf.channel->band; | 1802 | enum ieee80211_band band = local->hw.conf.channel->band; |
1803 | u8 *pos; | 1803 | u8 *pos; |
1804 | 1804 | ||
@@ -1852,9 +1852,24 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1852 | beacon->tail, beacon->tail_len); | 1852 | beacon->tail, beacon->tail_len); |
1853 | 1853 | ||
1854 | num_beacons = &ap->num_beacons; | 1854 | num_beacons = &ap->num_beacons; |
1855 | } else | ||
1856 | goto out; | ||
1857 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | ||
1858 | struct ieee80211_hdr *hdr; | ||
1859 | ifsta = &sdata->u.sta; | ||
1855 | 1860 | ||
1856 | err = false; | 1861 | if (!ifsta->probe_resp) |
1857 | } | 1862 | goto out; |
1863 | |||
1864 | skb = skb_copy(ifsta->probe_resp, GFP_ATOMIC); | ||
1865 | if (!skb) | ||
1866 | goto out; | ||
1867 | |||
1868 | hdr = (struct ieee80211_hdr *) skb->data; | ||
1869 | hdr->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, | ||
1870 | IEEE80211_STYPE_BEACON); | ||
1871 | |||
1872 | num_beacons = &ifsta->num_beacons; | ||
1858 | } else if (ieee80211_vif_is_mesh(&sdata->vif)) { | 1873 | } else if (ieee80211_vif_is_mesh(&sdata->vif)) { |
1859 | /* headroom, head length, tail length and maximum TIM length */ | 1874 | /* headroom, head length, tail length and maximum TIM length */ |
1860 | skb = dev_alloc_skb(local->tx_headroom + 400); | 1875 | skb = dev_alloc_skb(local->tx_headroom + 400); |
@@ -1881,17 +1896,8 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1881 | mesh_mgmt_ies_add(skb, sdata->dev); | 1896 | mesh_mgmt_ies_add(skb, sdata->dev); |
1882 | 1897 | ||
1883 | num_beacons = &sdata->u.sta.num_beacons; | 1898 | num_beacons = &sdata->u.sta.num_beacons; |
1884 | 1899 | } else { | |
1885 | err = false; | 1900 | WARN_ON(1); |
1886 | } | ||
1887 | |||
1888 | if (err) { | ||
1889 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | ||
1890 | if (net_ratelimit()) | ||
1891 | printk(KERN_DEBUG "no beacon data avail for %s\n", | ||
1892 | bdev->name); | ||
1893 | #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ | ||
1894 | skb = NULL; | ||
1895 | goto out; | 1901 | goto out; |
1896 | } | 1902 | } |
1897 | 1903 | ||