aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorVladimir Koutny <vlado@work.ksp.sk>2008-06-13 10:50:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:14 -0400
commit87291c0269e77b029282676448fed3706a54211a (patch)
treea066649aa997de82c1d0643f9feb155591f3f9ac /net
parentc644bce95f287e763a0b49e5d03f0fe6256f6d2e (diff)
mac80211: eliminate IBSS warning in rate_lowest_index()
In IBSS mode prior to join/creation of new IBSS it is possible that a frame from unknown station is received and an ibss_add_sta() is called. This will cause a warning in rate_lowest_index() since the list of supported rates of our station is not initialized yet. The fix is to add ibss stations with a rate we received that frame at; this single-element set will be extended later based on beacon data. Also there is no need to store stations from a foreign IBSS. Signed-off-by: Vladimir Koutny <vlado@ksp.sk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/mlme.c15
-rw-r--r--net/mac80211/rx.c10
3 files changed, 20 insertions, 7 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index b19bd16703b2..14fccf16b80f 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -876,7 +876,7 @@ void ieee80211_rx_bss_list_deinit(struct net_device *dev);
876int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len); 876int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len);
877struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev, 877struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
878 struct sk_buff *skb, u8 *bssid, 878 struct sk_buff *skb, u8 *bssid,
879 u8 *addr); 879 u8 *addr, u64 supp_rates);
880int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason); 880int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason);
881int ieee80211_sta_disassociate(struct net_device *dev, u16 reason); 881int ieee80211_sta_disassociate(struct net_device *dev, u16 reason);
882void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata, 882void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 46f203740834..55659a730dc1 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2863,7 +2863,8 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
2863 dev->name, print_mac(mac, mgmt->bssid)); 2863 dev->name, print_mac(mac, mgmt->bssid));
2864 ieee80211_sta_join_ibss(dev, &sdata->u.sta, bss); 2864 ieee80211_sta_join_ibss(dev, &sdata->u.sta, bss);
2865 ieee80211_ibss_add_sta(dev, NULL, 2865 ieee80211_ibss_add_sta(dev, NULL,
2866 mgmt->bssid, mgmt->sa); 2866 mgmt->bssid, mgmt->sa,
2867 BIT(rx_status->rate_idx));
2867 } 2868 }
2868 } 2869 }
2869 2870
@@ -4307,12 +4308,13 @@ int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len)
4307 4308
4308struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev, 4309struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
4309 struct sk_buff *skb, u8 *bssid, 4310 struct sk_buff *skb, u8 *bssid,
4310 u8 *addr) 4311 u8 *addr, u64 supp_rates)
4311{ 4312{
4312 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 4313 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
4313 struct sta_info *sta; 4314 struct sta_info *sta;
4314 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 4315 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
4315 DECLARE_MAC_BUF(mac); 4316 DECLARE_MAC_BUF(mac);
4317 int band = local->hw.conf.channel->band;
4316 4318
4317 /* TODO: Could consider removing the least recently used entry and 4319 /* TODO: Could consider removing the least recently used entry and
4318 * allow new one to be added. */ 4320 * allow new one to be added. */
@@ -4324,6 +4326,9 @@ struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
4324 return NULL; 4326 return NULL;
4325 } 4327 }
4326 4328
4329 if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid))
4330 return NULL;
4331
4327 printk(KERN_DEBUG "%s: Adding new IBSS station %s (dev=%s)\n", 4332 printk(KERN_DEBUG "%s: Adding new IBSS station %s (dev=%s)\n",
4328 wiphy_name(local->hw.wiphy), print_mac(mac, addr), dev->name); 4333 wiphy_name(local->hw.wiphy), print_mac(mac, addr), dev->name);
4329 4334
@@ -4333,8 +4338,10 @@ struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
4333 4338
4334 set_sta_flags(sta, WLAN_STA_AUTHORIZED); 4339 set_sta_flags(sta, WLAN_STA_AUTHORIZED);
4335 4340
4336 sta->supp_rates[local->hw.conf.channel->band] = 4341 if (supp_rates)
4337 sdata->u.sta.supp_rates_bits[local->hw.conf.channel->band]; 4342 sta->supp_rates[band] = supp_rates;
4343 else
4344 sta->supp_rates[band] = sdata->u.sta.supp_rates_bits[band];
4338 4345
4339 rate_control_rate_init(sta, local); 4346 rate_control_rate_init(sta, local);
4340 4347
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index e80336f8f1ea..c32a0bcd53b7 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1823,8 +1823,13 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1823 if (!bssid) 1823 if (!bssid)
1824 return 0; 1824 return 0;
1825 if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && 1825 if ((rx->fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT &&
1826 (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) 1826 (rx->fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON) {
1827 if (!rx->sta)
1828 rx->sta = ieee80211_ibss_add_sta(sdata->dev,
1829 rx->skb, bssid, hdr->addr2,
1830 BIT(rx->status->rate_idx));
1827 return 1; 1831 return 1;
1832 }
1828 else if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { 1833 else if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) {
1829 if (!(rx->flags & IEEE80211_RX_IN_SCAN)) 1834 if (!(rx->flags & IEEE80211_RX_IN_SCAN))
1830 return 0; 1835 return 0;
@@ -1837,7 +1842,8 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
1837 rx->flags &= ~IEEE80211_RX_RA_MATCH; 1842 rx->flags &= ~IEEE80211_RX_RA_MATCH;
1838 } else if (!rx->sta) 1843 } else if (!rx->sta)
1839 rx->sta = ieee80211_ibss_add_sta(sdata->dev, rx->skb, 1844 rx->sta = ieee80211_ibss_add_sta(sdata->dev, rx->skb,
1840 bssid, hdr->addr2); 1845 bssid, hdr->addr2,
1846 BIT(rx->status->rate_idx));
1841 break; 1847 break;
1842 case IEEE80211_IF_TYPE_MESH_POINT: 1848 case IEEE80211_IF_TYPE_MESH_POINT:
1843 if (!multicast && 1849 if (!multicast &&