summaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-23 18:52:52 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:37 -0400
commit2448798133d747ad339e57099e32a1d1e68aca1c (patch)
treeee09385f5dca9e243c38f5f888baa02605423bd7 /net/mac80211/cfg.c
parent2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (diff)
downloadlinux-2448798133d747ad339e57099e32a1d1e68aca1c.tar.gz
linux-2448798133d747ad339e57099e32a1d1e68aca1c.tar.bz2
linux-2448798133d747ad339e57099e32a1d1e68aca1c.zip
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/cfg.c')
-rw-r--r--net/mac80211/cfg.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 648bac1c850e..d0ca6da33ca9 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -13,6 +13,7 @@
#include <linux/rcupdate.h>
#include <net/cfg80211.h>
#include "ieee80211_i.h"
+#include "driver-ops.h"
#include "cfg.h"
#include "rate.h"
#include "mesh.h"
@@ -245,12 +246,10 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
iv32 = key->u.tkip.tx.iv32;
iv16 = key->u.tkip.tx.iv16;
- if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE &&
- sdata->local->ops->get_tkip_seq)
- sdata->local->ops->get_tkip_seq(
- local_to_hw(sdata->local),
- key->conf.hw_key_idx,
- &iv32, &iv16);
+ if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
+ drv_get_tkip_seq(sdata->local,
+ key->conf.hw_key_idx,
+ &iv32, &iv16);
seq[0] = iv16 & 0xff;
seq[1] = (iv16 >> 8) & 0xff;
@@ -1115,7 +1114,7 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
p.cw_max = params->cwmax;
p.cw_min = params->cwmin;
p.txop = params->txop;
- if (local->ops->conf_tx(local_to_hw(local), params->queue, &p)) {
+ if (drv_conf_tx(local, params->queue, &p)) {
printk(KERN_DEBUG "%s: failed to set TX queue "
"parameters for queue %d\n", local->mdev->name,
params->queue);
@@ -1296,16 +1295,13 @@ static int ieee80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
+ int err;
if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
- int err;
+ err = drv_set_rts_threshold(local, wiphy->rts_threshold);
- if (local->ops->set_rts_threshold) {
- err = local->ops->set_rts_threshold(
- local_to_hw(local), wiphy->rts_threshold);
- if (err)
- return err;
- }
+ if (err)
+ return err;
}
if (changed & WIPHY_PARAM_RETRY_SHORT)