aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-23 12:52:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:37 -0400
commit2448798133d747ad339e57099e32a1d1e68aca1c (patch)
treeee09385f5dca9e243c38f5f888baa02605423bd7 /net/mac80211/iface.c
parent2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (diff)
mac80211: add driver ops wrappers
In order to later add tracing or verifications to the driver calls mac80211 makes, this patch adds static inline wrappers for all operations. All calls are now written as drv_<op>(local, ...); instead of local->ops-><op>(&local->hw, ...); Where necessary, the wrappers also do existence checking and return default values as appropriate. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 52425975bbbe..256fa19e14ec 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -20,6 +20,7 @@
20#include "debugfs_netdev.h" 20#include "debugfs_netdev.h"
21#include "mesh.h" 21#include "mesh.h"
22#include "led.h" 22#include "led.h"
23#include "driver-ops.h"
23 24
24/** 25/**
25 * DOC: Interface list locking 26 * DOC: Interface list locking
@@ -164,9 +165,7 @@ static int ieee80211_open(struct net_device *dev)
164 } 165 }
165 166
166 if (local->open_count == 0) { 167 if (local->open_count == 0) {
167 res = 0; 168 res = drv_start(local);
168 if (local->ops->start)
169 res = local->ops->start(local_to_hw(local));
170 if (res) 169 if (res)
171 goto err_del_bss; 170 goto err_del_bss;
172 /* we're brought up, everything changes */ 171 /* we're brought up, everything changes */
@@ -199,8 +198,8 @@ static int ieee80211_open(struct net_device *dev)
199 * Validate the MAC address for this device. 198 * Validate the MAC address for this device.
200 */ 199 */
201 if (!is_valid_ether_addr(dev->dev_addr)) { 200 if (!is_valid_ether_addr(dev->dev_addr)) {
202 if (!local->open_count && local->ops->stop) 201 if (!local->open_count)
203 local->ops->stop(local_to_hw(local)); 202 drv_stop(local);
204 return -EADDRNOTAVAIL; 203 return -EADDRNOTAVAIL;
205 } 204 }
206 205
@@ -241,7 +240,7 @@ static int ieee80211_open(struct net_device *dev)
241 conf.vif = &sdata->vif; 240 conf.vif = &sdata->vif;
242 conf.type = sdata->vif.type; 241 conf.type = sdata->vif.type;
243 conf.mac_addr = dev->dev_addr; 242 conf.mac_addr = dev->dev_addr;
244 res = local->ops->add_interface(local_to_hw(local), &conf); 243 res = drv_add_interface(local, &conf);
245 if (res) 244 if (res)
246 goto err_stop; 245 goto err_stop;
247 246
@@ -328,10 +327,10 @@ static int ieee80211_open(struct net_device *dev)
328 327
329 return 0; 328 return 0;
330 err_del_interface: 329 err_del_interface:
331 local->ops->remove_interface(local_to_hw(local), &conf); 330 drv_remove_interface(local, &conf);
332 err_stop: 331 err_stop:
333 if (!local->open_count && local->ops->stop) 332 if (!local->open_count)
334 local->ops->stop(local_to_hw(local)); 333 drv_stop(local);
335 err_del_bss: 334 err_del_bss:
336 sdata->bss = NULL; 335 sdata->bss = NULL;
337 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 336 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@ -544,7 +543,7 @@ static int ieee80211_stop(struct net_device *dev)
544 conf.mac_addr = dev->dev_addr; 543 conf.mac_addr = dev->dev_addr;
545 /* disable all keys for as long as this netdev is down */ 544 /* disable all keys for as long as this netdev is down */
546 ieee80211_disable_keys(sdata); 545 ieee80211_disable_keys(sdata);
547 local->ops->remove_interface(local_to_hw(local), &conf); 546 drv_remove_interface(local, &conf);
548 } 547 }
549 548
550 sdata->bss = NULL; 549 sdata->bss = NULL;
@@ -553,8 +552,7 @@ static int ieee80211_stop(struct net_device *dev)
553 if (netif_running(local->mdev)) 552 if (netif_running(local->mdev))
554 dev_close(local->mdev); 553 dev_close(local->mdev);
555 554
556 if (local->ops->stop) 555 drv_stop(local);
557 local->ops->stop(local_to_hw(local));
558 556
559 ieee80211_led_radio(local, 0); 557 ieee80211_led_radio(local, 0);
560 558