aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-07-09 08:40:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-14 14:30:07 -0400
commit9d139c810a2aa17365cc548d0cd2a189d8433c65 (patch)
treeef10ca55f93689ab97368376d277102d2527c961 /drivers/net/wireless/rt2x00
parentf3947e2dfa3b18f375b7acd03b7ee2877d0751fc (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 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c22
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
8 files changed, 28 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index ee953ca0c6a3..89b874ca6107 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1581,7 +1581,6 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = {
1581 .conf_tx = rt2400pci_conf_tx, 1581 .conf_tx = rt2400pci_conf_tx,
1582 .get_tx_stats = rt2x00mac_get_tx_stats, 1582 .get_tx_stats = rt2x00mac_get_tx_stats,
1583 .get_tsf = rt2400pci_get_tsf, 1583 .get_tsf = rt2400pci_get_tsf,
1584 .beacon_update = rt2400pci_beacon_update,
1585 .tx_last_beacon = rt2400pci_tx_last_beacon, 1584 .tx_last_beacon = rt2400pci_tx_last_beacon,
1586}; 1585};
1587 1586
@@ -1601,6 +1600,7 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = {
1601 .write_tx_data = rt2x00pci_write_tx_data, 1600 .write_tx_data = rt2x00pci_write_tx_data,
1602 .kick_tx_queue = rt2400pci_kick_tx_queue, 1601 .kick_tx_queue = rt2400pci_kick_tx_queue,
1603 .fill_rxdone = rt2400pci_fill_rxdone, 1602 .fill_rxdone = rt2400pci_fill_rxdone,
1603 .beacon_update = rt2400pci_beacon_update,
1604 .config_filter = rt2400pci_config_filter, 1604 .config_filter = rt2400pci_config_filter,
1605 .config_intf = rt2400pci_config_intf, 1605 .config_intf = rt2400pci_config_intf,
1606 .config_erp = rt2400pci_config_erp, 1606 .config_erp = rt2400pci_config_erp,
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 0423c251c78e..a64bb18322e9 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1875,7 +1875,6 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = {
1875 .conf_tx = rt2x00mac_conf_tx, 1875 .conf_tx = rt2x00mac_conf_tx,
1876 .get_tx_stats = rt2x00mac_get_tx_stats, 1876 .get_tx_stats = rt2x00mac_get_tx_stats,
1877 .get_tsf = rt2500pci_get_tsf, 1877 .get_tsf = rt2500pci_get_tsf,
1878 .beacon_update = rt2500pci_beacon_update,
1879 .tx_last_beacon = rt2500pci_tx_last_beacon, 1878 .tx_last_beacon = rt2500pci_tx_last_beacon,
1880}; 1879};
1881 1880
@@ -1895,6 +1894,7 @@ static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = {
1895 .write_tx_data = rt2x00pci_write_tx_data, 1894 .write_tx_data = rt2x00pci_write_tx_data,
1896 .kick_tx_queue = rt2500pci_kick_tx_queue, 1895 .kick_tx_queue = rt2500pci_kick_tx_queue,
1897 .fill_rxdone = rt2500pci_fill_rxdone, 1896 .fill_rxdone = rt2500pci_fill_rxdone,
1897 .beacon_update = rt2500pci_beacon_update,
1898 .config_filter = rt2500pci_config_filter, 1898 .config_filter = rt2500pci_config_filter,
1899 .config_intf = rt2500pci_config_intf, 1899 .config_intf = rt2500pci_config_intf,
1900 .config_erp = rt2500pci_config_erp, 1900 .config_erp = rt2500pci_config_erp,
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 0dd1cb537b92..8ce1726d7508 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1775,7 +1775,6 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = {
1775 .bss_info_changed = rt2x00mac_bss_info_changed, 1775 .bss_info_changed = rt2x00mac_bss_info_changed,
1776 .conf_tx = rt2x00mac_conf_tx, 1776 .conf_tx = rt2x00mac_conf_tx,
1777 .get_tx_stats = rt2x00mac_get_tx_stats, 1777 .get_tx_stats = rt2x00mac_get_tx_stats,
1778 .beacon_update = rt2500usb_beacon_update,
1779}; 1778};
1780 1779
1781static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { 1780static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
@@ -1793,6 +1792,7 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
1793 .get_tx_data_len = rt2500usb_get_tx_data_len, 1792 .get_tx_data_len = rt2500usb_get_tx_data_len,
1794 .kick_tx_queue = rt2500usb_kick_tx_queue, 1793 .kick_tx_queue = rt2500usb_kick_tx_queue,
1795 .fill_rxdone = rt2500usb_fill_rxdone, 1794 .fill_rxdone = rt2500usb_fill_rxdone,
1795 .beacon_update = rt2500usb_beacon_update,
1796 .config_filter = rt2500usb_config_filter, 1796 .config_filter = rt2500usb_config_filter,
1797 .config_intf = rt2500usb_config_intf, 1797 .config_intf = rt2500usb_config_intf,
1798 .config_erp = rt2500usb_config_erp, 1798 .config_erp = rt2500usb_config_erp,
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index c07d9ef383f0..9ad3ce43e6cd 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -534,6 +534,8 @@ struct rt2x00lib_ops {
534 /* 534 /*
535 * Configuration handlers. 535 * Configuration handlers.
536 */ 536 */
537 int (*beacon_update) (struct ieee80211_hw *hw, struct sk_buff *bcn);
538
537 void (*config_filter) (struct rt2x00_dev *rt2x00dev, 539 void (*config_filter) (struct rt2x00_dev *rt2x00dev,
538 const unsigned int filter_flags); 540 const unsigned int filter_flags);
539 void (*config_intf) (struct rt2x00_dev *rt2x00dev, 541 void (*config_intf) (struct rt2x00_dev *rt2x00dev,
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index b48c04e80a38..1b7f87799a7e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -409,7 +409,6 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
409{ 409{
410 struct rt2x00_dev *rt2x00dev = data; 410 struct rt2x00_dev *rt2x00dev = data;
411 struct rt2x00_intf *intf = vif_to_intf(vif); 411 struct rt2x00_intf *intf = vif_to_intf(vif);
412 struct sk_buff *skb;
413 struct ieee80211_bss_conf conf; 412 struct ieee80211_bss_conf conf;
414 int delayed_flags; 413 int delayed_flags;
415 414
@@ -436,10 +435,11 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
436 return; 435 return;
437 436
438 if (delayed_flags & DELAYED_UPDATE_BEACON) { 437 if (delayed_flags & DELAYED_UPDATE_BEACON) {
439 skb = ieee80211_beacon_get(rt2x00dev->hw, vif); 438 struct ieee80211_if_conf conf;
440 if (skb && 439 conf.bssid = conf.ssid = NULL;
441 rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, skb)) 440 conf.ssid_len = 0;
442 dev_kfree_skb(skb); 441 conf.changed = IEEE80211_IFCC_BEACON;
442 rt2x00dev->ops->hw->config_interface(rt2x00dev->hw, vif, &conf);
443 } 443 }
444 444
445 if (delayed_flags & DELAYED_CONFIG_ERP) 445 if (delayed_flags & DELAYED_CONFIG_ERP)
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 3a1fb6d47e5d..84b51f49175e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -348,6 +348,7 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
348{ 348{
349 struct rt2x00_dev *rt2x00dev = hw->priv; 349 struct rt2x00_dev *rt2x00dev = hw->priv;
350 struct rt2x00_intf *intf = vif_to_intf(vif); 350 struct rt2x00_intf *intf = vif_to_intf(vif);
351 struct sk_buff *beacon;
351 int status; 352 int status;
352 353
353 /* 354 /*
@@ -363,8 +364,11 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
363 * If the interface does not work in master mode, 364 * If the interface does not work in master mode,
364 * then the bssid value in the interface structure 365 * then the bssid value in the interface structure
365 * should now be set. 366 * should now be set.
367 *
368 * conf->bssid can be NULL if coming from the internal
369 * beacon update routine.
366 */ 370 */
367 if (conf->type != IEEE80211_IF_TYPE_AP) 371 if (conf->bssid && vif->type != IEEE80211_IF_TYPE_AP)
368 memcpy(&intf->bssid, conf->bssid, ETH_ALEN); 372 memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
369 373
370 spin_unlock(&intf->lock); 374 spin_unlock(&intf->lock);
@@ -375,17 +379,23 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,
375 * values as arguments we make keep access to rt2x00_intf thread safe 379 * values as arguments we make keep access to rt2x00_intf thread safe
376 * even without the lock. 380 * even without the lock.
377 */ 381 */
378 rt2x00lib_config_intf(rt2x00dev, intf, conf->type, NULL, conf->bssid); 382 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL, conf->bssid);
379 383
380 /* 384 /*
381 * We only need to initialize the beacon when master mode is enabled. 385 * We only need to initialize the beacon when in master/ibss mode.
382 */ 386 */
383 if (conf->type != IEEE80211_IF_TYPE_AP || !conf->beacon) 387 if ((vif->type != IEEE80211_IF_TYPE_AP &&
388 vif->type != IEEE80211_IF_TYPE_IBSS) ||
389 !(conf->changed & IEEE80211_IFCC_BEACON))
384 return 0; 390 return 0;
385 391
386 status = rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, conf->beacon); 392 beacon = ieee80211_beacon_get(rt2x00dev->hw, vif);
393 if (!beacon)
394 return -ENOMEM;
395
396 status = rt2x00dev->ops->lib->beacon_update(rt2x00dev->hw, beacon);
387 if (status) 397 if (status)
388 dev_kfree_skb(conf->beacon); 398 dev_kfree_skb(beacon);
389 399
390 return status; 400 return status;
391} 401}
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index bbf1048f6400..852d193a11a9 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2427,7 +2427,6 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = {
2427 .conf_tx = rt2x00mac_conf_tx, 2427 .conf_tx = rt2x00mac_conf_tx,
2428 .get_tx_stats = rt2x00mac_get_tx_stats, 2428 .get_tx_stats = rt2x00mac_get_tx_stats,
2429 .get_tsf = rt61pci_get_tsf, 2429 .get_tsf = rt61pci_get_tsf,
2430 .beacon_update = rt61pci_beacon_update,
2431}; 2430};
2432 2431
2433static const struct rt2x00lib_ops rt61pci_rt2x00_ops = { 2432static const struct rt2x00lib_ops rt61pci_rt2x00_ops = {
@@ -2449,6 +2448,7 @@ static const struct rt2x00lib_ops rt61pci_rt2x00_ops = {
2449 .write_tx_data = rt2x00pci_write_tx_data, 2448 .write_tx_data = rt2x00pci_write_tx_data,
2450 .kick_tx_queue = rt61pci_kick_tx_queue, 2449 .kick_tx_queue = rt61pci_kick_tx_queue,
2451 .fill_rxdone = rt61pci_fill_rxdone, 2450 .fill_rxdone = rt61pci_fill_rxdone,
2451 .beacon_update = rt61pci_beacon_update,
2452 .config_filter = rt61pci_config_filter, 2452 .config_filter = rt61pci_config_filter,
2453 .config_intf = rt61pci_config_intf, 2453 .config_intf = rt61pci_config_intf,
2454 .config_erp = rt61pci_config_erp, 2454 .config_erp = rt61pci_config_erp,
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 3ef318e098e7..657200972424 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2031,7 +2031,6 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = {
2031 .conf_tx = rt2x00mac_conf_tx, 2031 .conf_tx = rt2x00mac_conf_tx,
2032 .get_tx_stats = rt2x00mac_get_tx_stats, 2032 .get_tx_stats = rt2x00mac_get_tx_stats,
2033 .get_tsf = rt73usb_get_tsf, 2033 .get_tsf = rt73usb_get_tsf,
2034 .beacon_update = rt73usb_beacon_update,
2035}; 2034};
2036 2035
2037static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { 2036static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {
@@ -2052,6 +2051,7 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {
2052 .get_tx_data_len = rt73usb_get_tx_data_len, 2051 .get_tx_data_len = rt73usb_get_tx_data_len,
2053 .kick_tx_queue = rt73usb_kick_tx_queue, 2052 .kick_tx_queue = rt73usb_kick_tx_queue,
2054 .fill_rxdone = rt73usb_fill_rxdone, 2053 .fill_rxdone = rt73usb_fill_rxdone,
2054 .beacon_update = rt73usb_beacon_update,
2055 .config_filter = rt73usb_config_filter, 2055 .config_filter = rt73usb_config_filter,
2056 .config_intf = rt73usb_config_intf, 2056 .config_intf = rt73usb_config_intf,
2057 .config_erp = rt73usb_config_erp, 2057 .config_erp = rt73usb_config_erp,