aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/agg-rx.c11
-rw-r--r--net/mac80211/agg-tx.c13
-rw-r--r--net/mac80211/cfg.c24
-rw-r--r--net/mac80211/debugfs.c20
-rw-r--r--net/mac80211/driver-ops.h184
-rw-r--r--net/mac80211/ibss.c26
-rw-r--r--net/mac80211/iface.c22
-rw-r--r--net/mac80211/key.c8
-rw-r--r--net/mac80211/main.c17
-rw-r--r--net/mac80211/mlme.c14
-rw-r--r--net/mac80211/pm.c9
-rw-r--r--net/mac80211/rx.c9
-rw-r--r--net/mac80211/scan.c28
-rw-r--r--net/mac80211/sta_info.c14
-rw-r--r--net/mac80211/tkip.c6
-rw-r--r--net/mac80211/tx.c3
-rw-r--r--net/mac80211/util.c14
17 files changed, 292 insertions, 130 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 07656d830bc..fff24c3d646 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -16,12 +16,12 @@
16#include <linux/ieee80211.h> 16#include <linux/ieee80211.h>
17#include <net/mac80211.h> 17#include <net/mac80211.h>
18#include "ieee80211_i.h" 18#include "ieee80211_i.h"
19#include "driver-ops.h"
19 20
20void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, 21void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
21 u16 initiator, u16 reason) 22 u16 initiator, u16 reason)
22{ 23{
23 struct ieee80211_local *local = sta->local; 24 struct ieee80211_local *local = sta->local;
24 struct ieee80211_hw *hw = &local->hw;
25 int i; 25 int i;
26 26
27 /* check if TID is in operational state */ 27 /* check if TID is in operational state */
@@ -41,8 +41,8 @@ void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
41 sta->sta.addr, tid); 41 sta->sta.addr, tid);
42#endif /* CONFIG_MAC80211_HT_DEBUG */ 42#endif /* CONFIG_MAC80211_HT_DEBUG */
43 43
44 if (local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_STOP, 44 if (drv_ampdu_action(local, IEEE80211_AMPDU_RX_STOP,
45 &sta->sta, tid, NULL)) 45 &sta->sta, tid, NULL))
46 printk(KERN_DEBUG "HW problem - can not stop rx " 46 printk(KERN_DEBUG "HW problem - can not stop rx "
47 "aggregation for tid %d\n", tid); 47 "aggregation for tid %d\n", tid);
48 48
@@ -278,9 +278,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
278 goto end; 278 goto end;
279 } 279 }
280 280
281 if (local->ops->ampdu_action) 281 ret = drv_ampdu_action(local, IEEE80211_AMPDU_RX_START,
282 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_START, 282 &sta->sta, tid, &start_seq_num);
283 &sta->sta, tid, &start_seq_num);
284#ifdef CONFIG_MAC80211_HT_DEBUG 283#ifdef CONFIG_MAC80211_HT_DEBUG
285 printk(KERN_DEBUG "Rx A-MPDU request on tid %d result %d\n", tid, ret); 284 printk(KERN_DEBUG "Rx A-MPDU request on tid %d result %d\n", tid, ret);
286#endif /* CONFIG_MAC80211_HT_DEBUG */ 285#endif /* CONFIG_MAC80211_HT_DEBUG */
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index 947aaaad35d..43d00ffd398 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -16,6 +16,7 @@
16#include <linux/ieee80211.h> 16#include <linux/ieee80211.h>
17#include <net/mac80211.h> 17#include <net/mac80211.h>
18#include "ieee80211_i.h" 18#include "ieee80211_i.h"
19#include "driver-ops.h"
19#include "wme.h" 20#include "wme.h"
20 21
21/** 22/**
@@ -134,8 +135,8 @@ static int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
134 *state = HT_AGG_STATE_REQ_STOP_BA_MSK | 135 *state = HT_AGG_STATE_REQ_STOP_BA_MSK |
135 (initiator << HT_AGG_STATE_INITIATOR_SHIFT); 136 (initiator << HT_AGG_STATE_INITIATOR_SHIFT);
136 137
137 ret = local->ops->ampdu_action(&local->hw, IEEE80211_AMPDU_TX_STOP, 138 ret = drv_ampdu_action(local, IEEE80211_AMPDU_TX_STOP,
138 &sta->sta, tid, NULL); 139 &sta->sta, tid, NULL);
139 140
140 /* HW shall not deny going back to legacy */ 141 /* HW shall not deny going back to legacy */
141 if (WARN_ON(ret)) { 142 if (WARN_ON(ret)) {
@@ -306,8 +307,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
306 307
307 start_seq_num = sta->tid_seq[tid]; 308 start_seq_num = sta->tid_seq[tid];
308 309
309 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_TX_START, 310 ret = drv_ampdu_action(local, IEEE80211_AMPDU_TX_START,
310 &sta->sta, tid, &start_seq_num); 311 &sta->sta, tid, &start_seq_num);
311 312
312 if (ret) { 313 if (ret) {
313#ifdef CONFIG_MAC80211_HT_DEBUG 314#ifdef CONFIG_MAC80211_HT_DEBUG
@@ -418,8 +419,8 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
418 ieee80211_agg_splice_finish(local, sta, tid); 419 ieee80211_agg_splice_finish(local, sta, tid);
419 spin_unlock(&local->ampdu_lock); 420 spin_unlock(&local->ampdu_lock);
420 421
421 local->ops->ampdu_action(&local->hw, IEEE80211_AMPDU_TX_OPERATIONAL, 422 drv_ampdu_action(local, IEEE80211_AMPDU_TX_OPERATIONAL,
422 &sta->sta, tid, NULL); 423 &sta->sta, tid, NULL);
423} 424}
424 425
425void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid) 426void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 648bac1c850..d0ca6da33ca 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -13,6 +13,7 @@
13#include <linux/rcupdate.h> 13#include <linux/rcupdate.h>
14#include <net/cfg80211.h> 14#include <net/cfg80211.h>
15#include "ieee80211_i.h" 15#include "ieee80211_i.h"
16#include "driver-ops.h"
16#include "cfg.h" 17#include "cfg.h"
17#include "rate.h" 18#include "rate.h"
18#include "mesh.h" 19#include "mesh.h"
@@ -245,12 +246,10 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
245 iv32 = key->u.tkip.tx.iv32; 246 iv32 = key->u.tkip.tx.iv32;
246 iv16 = key->u.tkip.tx.iv16; 247 iv16 = key->u.tkip.tx.iv16;
247 248
248 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE && 249 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)
249 sdata->local->ops->get_tkip_seq) 250 drv_get_tkip_seq(sdata->local,
250 sdata->local->ops->get_tkip_seq( 251 key->conf.hw_key_idx,
251 local_to_hw(sdata->local), 252 &iv32, &iv16);
252 key->conf.hw_key_idx,
253 &iv32, &iv16);
254 253
255 seq[0] = iv16 & 0xff; 254 seq[0] = iv16 & 0xff;
256 seq[1] = (iv16 >> 8) & 0xff; 255 seq[1] = (iv16 >> 8) & 0xff;
@@ -1115,7 +1114,7 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
1115 p.cw_max = params->cwmax; 1114 p.cw_max = params->cwmax;
1116 p.cw_min = params->cwmin; 1115 p.cw_min = params->cwmin;
1117 p.txop = params->txop; 1116 p.txop = params->txop;
1118 if (local->ops->conf_tx(local_to_hw(local), params->queue, &p)) { 1117 if (drv_conf_tx(local, params->queue, &p)) {
1119 printk(KERN_DEBUG "%s: failed to set TX queue " 1118 printk(KERN_DEBUG "%s: failed to set TX queue "
1120 "parameters for queue %d\n", local->mdev->name, 1119 "parameters for queue %d\n", local->mdev->name,
1121 params->queue); 1120 params->queue);
@@ -1296,16 +1295,13 @@ static int ieee80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
1296static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) 1295static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
1297{ 1296{
1298 struct ieee80211_local *local = wiphy_priv(wiphy); 1297 struct ieee80211_local *local = wiphy_priv(wiphy);
1298 int err;
1299 1299
1300 if (changed & WIPHY_PARAM_RTS_THRESHOLD) { 1300 if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
1301 int err; 1301 err = drv_set_rts_threshold(local, wiphy->rts_threshold);
1302 1302
1303 if (local->ops->set_rts_threshold) { 1303 if (err)
1304 err = local->ops->set_rts_threshold( 1304 return err;
1305 local_to_hw(local), wiphy->rts_threshold);
1306 if (err)
1307 return err;
1308 }
1309 } 1305 }
1310 1306
1311 if (changed & WIPHY_PARAM_RETRY_SHORT) 1307 if (changed & WIPHY_PARAM_RETRY_SHORT)
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 5001328be46..ac793201b70 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -10,6 +10,7 @@
10#include <linux/debugfs.h> 10#include <linux/debugfs.h>
11#include <linux/rtnetlink.h> 11#include <linux/rtnetlink.h>
12#include "ieee80211_i.h" 12#include "ieee80211_i.h"
13#include "driver-ops.h"
13#include "rate.h" 14#include "rate.h"
14#include "debugfs.h" 15#include "debugfs.h"
15 16
@@ -70,11 +71,10 @@ static ssize_t tsf_read(struct file *file, char __user *user_buf,
70 size_t count, loff_t *ppos) 71 size_t count, loff_t *ppos)
71{ 72{
72 struct ieee80211_local *local = file->private_data; 73 struct ieee80211_local *local = file->private_data;
73 u64 tsf = 0; 74 u64 tsf;
74 char buf[100]; 75 char buf[100];
75 76
76 if (local->ops->get_tsf) 77 tsf = drv_get_tsf(local);
77 tsf = local->ops->get_tsf(local_to_hw(local));
78 78
79 snprintf(buf, sizeof(buf), "0x%016llx\n", (unsigned long long) tsf); 79 snprintf(buf, sizeof(buf), "0x%016llx\n", (unsigned long long) tsf);
80 80
@@ -97,13 +97,13 @@ static ssize_t tsf_write(struct file *file,
97 97
98 if (strncmp(buf, "reset", 5) == 0) { 98 if (strncmp(buf, "reset", 5) == 0) {
99 if (local->ops->reset_tsf) { 99 if (local->ops->reset_tsf) {
100 local->ops->reset_tsf(local_to_hw(local)); 100 drv_reset_tsf(local);
101 printk(KERN_INFO "%s: debugfs reset TSF\n", wiphy_name(local->hw.wiphy)); 101 printk(KERN_INFO "%s: debugfs reset TSF\n", wiphy_name(local->hw.wiphy));
102 } 102 }
103 } else { 103 } else {
104 tsf = simple_strtoul(buf, NULL, 0); 104 tsf = simple_strtoul(buf, NULL, 0);
105 if (local->ops->set_tsf) { 105 if (local->ops->set_tsf) {
106 local->ops->set_tsf(local_to_hw(local), tsf); 106 drv_set_tsf(local, tsf);
107 printk(KERN_INFO "%s: debugfs set TSF to %#018llx\n", wiphy_name(local->hw.wiphy), tsf); 107 printk(KERN_INFO "%s: debugfs set TSF to %#018llx\n", wiphy_name(local->hw.wiphy), tsf);
108 } 108 }
109 } 109 }
@@ -150,14 +150,12 @@ static ssize_t format_devstat_counter(struct ieee80211_local *local,
150 char buf[20]; 150 char buf[20];
151 int res; 151 int res;
152 152
153 if (!local->ops->get_stats)
154 return -EOPNOTSUPP;
155
156 rtnl_lock(); 153 rtnl_lock();
157 res = local->ops->get_stats(local_to_hw(local), &stats); 154 res = drv_get_stats(local, &stats);
158 rtnl_unlock(); 155 rtnl_unlock();
159 if (!res) 156 if (res)
160 res = printvalue(&stats, buf, sizeof(buf)); 157 return res;
158 res = printvalue(&stats, buf, sizeof(buf));
161 return simple_read_from_buffer(userbuf, count, ppos, buf, res); 159 return simple_read_from_buffer(userbuf, count, ppos, buf, res);
162} 160}
163 161
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
new file mode 100644
index 00000000000..3912b5334b9
--- /dev/null
+++ b/net/mac80211/driver-ops.h
@@ -0,0 +1,184 @@
1#ifndef __MAC80211_DRIVER_OPS
2#define __MAC80211_DRIVER_OPS
3
4#include <net/mac80211.h>
5#include "ieee80211_i.h"
6
7static inline int drv_tx(struct ieee80211_local *local, struct sk_buff *skb)
8{
9 return local->ops->tx(&local->hw, skb);
10}
11
12static inline int drv_start(struct ieee80211_local *local)
13{
14 return local->ops->start(&local->hw);
15}
16
17static inline void drv_stop(struct ieee80211_local *local)
18{
19 local->ops->stop(&local->hw);
20}
21
22static inline int drv_add_interface(struct ieee80211_local *local,
23 struct ieee80211_if_init_conf *conf)
24{
25 return local->ops->add_interface(&local->hw, conf);
26}
27
28static inline void drv_remove_interface(struct ieee80211_local *local,
29 struct ieee80211_if_init_conf *conf)
30{
31 local->ops->remove_interface(&local->hw, conf);
32}
33
34static inline int drv_config(struct ieee80211_local *local, u32 changed)
35{
36 return local->ops->config(&local->hw, changed);
37}
38
39static inline void drv_bss_info_changed(struct ieee80211_local *local,
40 struct ieee80211_vif *vif,
41 struct ieee80211_bss_conf *info,
42 u32 changed)
43{
44 if (local->ops->bss_info_changed)
45 local->ops->bss_info_changed(&local->hw, vif, info, changed);
46}
47
48static inline void drv_configure_filter(struct ieee80211_local *local,
49 unsigned int changed_flags,
50 unsigned int *total_flags,
51 int mc_count,
52 struct dev_addr_list *mc_list)
53{
54 local->ops->configure_filter(&local->hw, changed_flags, total_flags,
55 mc_count, mc_list);
56}
57
58static inline int drv_set_tim(struct ieee80211_local *local,
59 struct ieee80211_sta *sta, bool set)
60{
61 if (local->ops->set_tim)
62 return local->ops->set_tim(&local->hw, sta, set);
63 return 0;
64}
65
66static inline int drv_set_key(struct ieee80211_local *local,
67 enum set_key_cmd cmd, struct ieee80211_vif *vif,
68 struct ieee80211_sta *sta,
69 struct ieee80211_key_conf *key)
70{
71 return local->ops->set_key(&local->hw, cmd, vif, sta, key);
72}
73
74static inline void drv_update_tkip_key(struct ieee80211_local *local,
75 struct ieee80211_key_conf *conf,
76 const u8 *address, u32 iv32,
77 u16 *phase1key)
78{
79 if (local->ops->update_tkip_key)
80 local->ops->update_tkip_key(&local->hw, conf, address,
81 iv32, phase1key);
82}
83
84static inline int drv_hw_scan(struct ieee80211_local *local,
85 struct cfg80211_scan_request *req)
86{
87 return local->ops->hw_scan(&local->hw, req);
88}
89
90static inline void drv_sw_scan_start(struct ieee80211_local *local)
91{
92 if (local->ops->sw_scan_start)
93 local->ops->sw_scan_start(&local->hw);
94}
95
96static inline void drv_sw_scan_complete(struct ieee80211_local *local)
97{
98 if (local->ops->sw_scan_complete)
99 local->ops->sw_scan_complete(&local->hw);
100}
101
102static inline int drv_get_stats(struct ieee80211_local *local,
103 struct ieee80211_low_level_stats *stats)
104{
105 if (!local->ops->get_stats)
106 return -EOPNOTSUPP;
107 return local->ops->get_stats(&local->hw, stats);
108}
109
110static inline void drv_get_tkip_seq(struct ieee80211_local *local,
111 u8 hw_key_idx, u32 *iv32, u16 *iv16)
112{
113 if (local->ops->get_tkip_seq)
114 local->ops->get_tkip_seq(&local->hw, hw_key_idx, iv32, iv16);
115}
116
117static inline int drv_set_rts_threshold(struct ieee80211_local *local,
118 u32 value)
119{
120 if (local->ops->set_rts_threshold)
121 return local->ops->set_rts_threshold(&local->hw, value);
122 return 0;
123}
124
125static inline void drv_sta_notify(struct ieee80211_local *local,
126 struct ieee80211_vif *vif,
127 enum sta_notify_cmd cmd,
128 struct ieee80211_sta *sta)
129{
130 if (local->ops->sta_notify)
131 local->ops->sta_notify(&local->hw, vif, cmd, sta);
132}
133
134static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue,
135 const struct ieee80211_tx_queue_params *params)
136{
137 if (local->ops->conf_tx)
138 return local->ops->conf_tx(&local->hw, queue, params);
139 return -EOPNOTSUPP;
140}
141
142static inline int drv_get_tx_stats(struct ieee80211_local *local,
143 struct ieee80211_tx_queue_stats *stats)
144{
145 return local->ops->get_tx_stats(&local->hw, stats);
146}
147
148static inline u64 drv_get_tsf(struct ieee80211_local *local)
149{
150 if (local->ops->get_tsf)
151 return local->ops->get_tsf(&local->hw);
152 return -1ULL;
153}
154
155static inline void drv_set_tsf(struct ieee80211_local *local, u64 tsf)
156{
157 if (local->ops->set_tsf)
158 local->ops->set_tsf(&local->hw, tsf);
159}
160
161static inline void drv_reset_tsf(struct ieee80211_local *local)
162{
163 if (local->ops->reset_tsf)
164 local->ops->reset_tsf(&local->hw);
165}
166
167static inline int drv_tx_last_beacon(struct ieee80211_local *local)
168{
169 if (local->ops->tx_last_beacon)
170 return local->ops->tx_last_beacon(&local->hw);
171 return 1;
172}
173
174static inline int drv_ampdu_action(struct ieee80211_local *local,
175 enum ieee80211_ampdu_mlme_action action,
176 struct ieee80211_sta *sta, u16 tid,
177 u16 *ssn)
178{
179 if (local->ops->ampdu_action)
180 return local->ops->ampdu_action(&local->hw, action,
181 sta, tid, ssn);
182 return -EOPNOTSUPP;
183}
184#endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index c87caad383f..a8e23232267 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -22,6 +22,7 @@
22#include <asm/unaligned.h> 22#include <asm/unaligned.h>
23 23
24#include "ieee80211_i.h" 24#include "ieee80211_i.h"
25#include "driver-ops.h"
25#include "rate.h" 26#include "rate.h"
26 27
27#define IEEE80211_SCAN_INTERVAL (2 * HZ) 28#define IEEE80211_SCAN_INTERVAL (2 * HZ)
@@ -75,10 +76,9 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
75 struct ieee80211_supported_band *sband; 76 struct ieee80211_supported_band *sband;
76 u32 bss_change; 77 u32 bss_change;
77 78
78 if (local->ops->reset_tsf) { 79
79 /* Reset own TSF to allow time synchronization work. */ 80 /* Reset own TSF to allow time synchronization work. */
80 local->ops->reset_tsf(local_to_hw(local)); 81 drv_reset_tsf(local);
81 }
82 82
83 skb = ifibss->skb; 83 skb = ifibss->skb;
84 rcu_assign_pointer(ifibss->presp, NULL); 84 rcu_assign_pointer(ifibss->presp, NULL);
@@ -315,12 +315,13 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
315 bitrates[rx_status->rate_idx].bitrate; 315 bitrates[rx_status->rate_idx].bitrate;
316 316
317 rx_timestamp = rx_status->mactime + (24 * 8 * 10 / rate); 317 rx_timestamp = rx_status->mactime + (24 * 8 * 10 / rate);
318 } else if (local && local->ops && local->ops->get_tsf) 318 } else {
319 /* second best option: get current TSF */ 319 /*
320 rx_timestamp = local->ops->get_tsf(local_to_hw(local)); 320 * second best option: get current TSF
321 else 321 * (will return -1 if not supported)
322 /* can't merge without knowing the TSF */ 322 */
323 rx_timestamp = -1LLU; 323 rx_timestamp = drv_get_tsf(local);
324 }
324 325
325#ifdef CONFIG_MAC80211_IBSS_DEBUG 326#ifdef CONFIG_MAC80211_IBSS_DEBUG
326 printk(KERN_DEBUG "RX beacon SA=%pM BSSID=" 327 printk(KERN_DEBUG "RX beacon SA=%pM BSSID="
@@ -591,10 +592,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
591 len < 24 + 2 || !ifibss->presp) 592 len < 24 + 2 || !ifibss->presp)
592 return; 593 return;
593 594
594 if (local->ops->tx_last_beacon) 595 tx_last_beacon = drv_tx_last_beacon(local);
595 tx_last_beacon = local->ops->tx_last_beacon(local_to_hw(local));
596 else
597 tx_last_beacon = 1;
598 596
599#ifdef CONFIG_MAC80211_IBSS_DEBUG 597#ifdef CONFIG_MAC80211_IBSS_DEBUG
600 printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM" 598 printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM"
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 52425975bbb..256fa19e14e 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
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 687acf23054..b7e1350273b 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -16,6 +16,7 @@
16#include <linux/rtnetlink.h> 16#include <linux/rtnetlink.h>
17#include <net/mac80211.h> 17#include <net/mac80211.h>
18#include "ieee80211_i.h" 18#include "ieee80211_i.h"
19#include "driver-ops.h"
19#include "debugfs_key.h" 20#include "debugfs_key.h"
20#include "aes_ccm.h" 21#include "aes_ccm.h"
21#include "aes_cmac.h" 22#include "aes_cmac.h"
@@ -136,8 +137,7 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
136 struct ieee80211_sub_if_data, 137 struct ieee80211_sub_if_data,
137 u.ap); 138 u.ap);
138 139
139 ret = key->local->ops->set_key(local_to_hw(key->local), SET_KEY, 140 ret = drv_set_key(key->local, SET_KEY, &sdata->vif, sta, &key->conf);
140 &sdata->vif, sta, &key->conf);
141 141
142 if (!ret) { 142 if (!ret) {
143 spin_lock(&todo_lock); 143 spin_lock(&todo_lock);
@@ -179,8 +179,8 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
179 struct ieee80211_sub_if_data, 179 struct ieee80211_sub_if_data,
180 u.ap); 180 u.ap);
181 181
182 ret = key->local->ops->set_key(local_to_hw(key->local), DISABLE_KEY, 182 ret = drv_set_key(key->local, DISABLE_KEY, &sdata->vif,
183 &sdata->vif, sta, &key->conf); 183 sta, &key->conf);
184 184
185 if (ret) 185 if (ret)
186 printk(KERN_ERR "mac80211-%s: failed to remove key " 186 printk(KERN_ERR "mac80211-%s: failed to remove key "
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index c817c9ef215..b80bc80e46c 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -26,6 +26,7 @@
26#include <net/cfg80211.h> 26#include <net/cfg80211.h>
27 27
28#include "ieee80211_i.h" 28#include "ieee80211_i.h"
29#include "driver-ops.h"
29#include "rate.h" 30#include "rate.h"
30#include "mesh.h" 31#include "mesh.h"
31#include "wep.h" 32#include "wep.h"
@@ -81,10 +82,9 @@ void ieee80211_configure_filter(struct ieee80211_local *local)
81 /* be a bit nasty */ 82 /* be a bit nasty */
82 new_flags |= (1<<31); 83 new_flags |= (1<<31);
83 84
84 local->ops->configure_filter(local_to_hw(local), 85 drv_configure_filter(local, changed_flags, &new_flags,
85 changed_flags, &new_flags, 86 local->mdev->mc_count,
86 local->mdev->mc_count, 87 local->mdev->mc_list);
87 local->mdev->mc_list);
88 88
89 WARN_ON(new_flags & (1<<31)); 89 WARN_ON(new_flags & (1<<31));
90 90
@@ -192,7 +192,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
192 } 192 }
193 193
194 if (changed && local->open_count) { 194 if (changed && local->open_count) {
195 ret = local->ops->config(local_to_hw(local), changed); 195 ret = drv_config(local, changed);
196 /* 196 /*
197 * Goal: 197 * Goal:
198 * HW reconfiguration should never fail, the driver has told 198 * HW reconfiguration should never fail, the driver has told
@@ -276,11 +276,8 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
276 } 276 }
277 } 277 }
278 278
279 if (local->ops->bss_info_changed) 279 drv_bss_info_changed(local, &sdata->vif,
280 local->ops->bss_info_changed(local_to_hw(local), 280 &sdata->vif.bss_conf, changed);
281 &sdata->vif,
282 &sdata->vif.bss_conf,
283 changed);
284 281
285 /* 282 /*
286 * DEPRECATED 283 * DEPRECATED
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index c7971196d9d..42f33fd3c5e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -23,6 +23,7 @@
23#include <asm/unaligned.h> 23#include <asm/unaligned.h>
24 24
25#include "ieee80211_i.h" 25#include "ieee80211_i.h"
26#include "driver-ops.h"
26#include "rate.h" 27#include "rate.h"
27#include "led.h" 28#include "led.h"
28 29
@@ -683,11 +684,10 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
683 local->mdev->name, queue, aci, acm, params.aifs, params.cw_min, 684 local->mdev->name, queue, aci, acm, params.aifs, params.cw_min,
684 params.cw_max, params.txop); 685 params.cw_max, params.txop);
685#endif 686#endif
686 if (local->ops->conf_tx && 687 if (drv_conf_tx(local, queue, &params) && local->ops->conf_tx)
687 local->ops->conf_tx(local_to_hw(local), queue, &params)) {
688 printk(KERN_DEBUG "%s: failed to set TX queue " 688 printk(KERN_DEBUG "%s: failed to set TX queue "
689 "parameters for queue %d\n", local->mdev->name, queue); 689 "parameters for queue %d\n", local->mdev->name,
690 } 690 queue);
691 } 691 }
692} 692}
693 693
@@ -1982,10 +1982,8 @@ static void ieee80211_sta_reset_auth(struct ieee80211_sub_if_data *sdata)
1982 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 1982 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1983 struct ieee80211_local *local = sdata->local; 1983 struct ieee80211_local *local = sdata->local;
1984 1984
1985 if (local->ops->reset_tsf) { 1985 /* Reset own TSF to allow time synchronization work. */
1986 /* Reset own TSF to allow time synchronization work. */ 1986 drv_reset_tsf(local);
1987 local->ops->reset_tsf(local_to_hw(local));
1988 }
1989 1987
1990 ifmgd->wmm_last_param_set = -1; /* allow any WMM update */ 1988 ifmgd->wmm_last_param_set = -1; /* allow any WMM update */
1991 1989
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index b38986c9dee..9d3d89abbb5 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -2,6 +2,7 @@
2#include <net/rtnetlink.h> 2#include <net/rtnetlink.h>
3 3
4#include "ieee80211_i.h" 4#include "ieee80211_i.h"
5#include "driver-ops.h"
5#include "led.h" 6#include "led.h"
6 7
7int __ieee80211_suspend(struct ieee80211_hw *hw) 8int __ieee80211_suspend(struct ieee80211_hw *hw)
@@ -43,8 +44,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
43 struct ieee80211_sub_if_data, 44 struct ieee80211_sub_if_data,
44 u.ap); 45 u.ap);
45 46
46 local->ops->sta_notify(hw, &sdata->vif, 47 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE,
47 STA_NOTIFY_REMOVE, &sta->sta); 48 &sta->sta);
48 } 49 }
49 spin_unlock_irqrestore(&local->sta_lock, flags); 50 spin_unlock_irqrestore(&local->sta_lock, flags);
50 } 51 }
@@ -57,7 +58,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
57 conf.vif = &sdata->vif; 58 conf.vif = &sdata->vif;
58 conf.type = sdata->vif.type; 59 conf.type = sdata->vif.type;
59 conf.mac_addr = sdata->dev->dev_addr; 60 conf.mac_addr = sdata->dev->dev_addr;
60 local->ops->remove_interface(hw, &conf); 61 drv_remove_interface(local, &conf);
61 } 62 }
62 } 63 }
63 64
@@ -67,7 +68,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
67 /* stop hardware */ 68 /* stop hardware */
68 if (local->open_count) { 69 if (local->open_count) {
69 ieee80211_led_radio(local, false); 70 ieee80211_led_radio(local, false);
70 local->ops->stop(hw); 71 drv_stop(local);
71 } 72 }
72 return 0; 73 return 0;
73} 74}
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a5afb79dab6..6a9d89b392e 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -19,6 +19,7 @@
19#include <net/ieee80211_radiotap.h> 19#include <net/ieee80211_radiotap.h>
20 20
21#include "ieee80211_i.h" 21#include "ieee80211_i.h"
22#include "driver-ops.h"
22#include "led.h" 23#include "led.h"
23#include "mesh.h" 24#include "mesh.h"
24#include "wep.h" 25#include "wep.h"
@@ -773,9 +774,7 @@ static void ap_sta_ps_start(struct sta_info *sta)
773 774
774 atomic_inc(&sdata->bss->num_sta_ps); 775 atomic_inc(&sdata->bss->num_sta_ps);
775 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL); 776 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL);
776 if (local->ops->sta_notify) 777 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_SLEEP, &sta->sta);
777 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
778 STA_NOTIFY_SLEEP, &sta->sta);
779#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 778#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
780 printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n", 779 printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n",
781 sdata->dev->name, sta->sta.addr, sta->sta.aid); 780 sdata->dev->name, sta->sta.addr, sta->sta.aid);
@@ -792,9 +791,7 @@ static int ap_sta_ps_end(struct sta_info *sta)
792 atomic_dec(&sdata->bss->num_sta_ps); 791 atomic_dec(&sdata->bss->num_sta_ps);
793 792
794 clear_sta_flags(sta, WLAN_STA_PS | WLAN_STA_PSPOLL); 793 clear_sta_flags(sta, WLAN_STA_PS | WLAN_STA_PSPOLL);
795 if (local->ops->sta_notify) 794 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_AWAKE, &sta->sta);
796 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
797 STA_NOTIFY_AWAKE, &sta->sta);
798 795
799 if (!skb_queue_empty(&sta->ps_tx_buf)) 796 if (!skb_queue_empty(&sta->ps_tx_buf))
800 sta_info_clear_tim_bit(sta); 797 sta_info_clear_tim_bit(sta);
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 04e270abdd2..127bd54e0e3 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -21,6 +21,7 @@
21#include <net/iw_handler.h> 21#include <net/iw_handler.h>
22 22
23#include "ieee80211_i.h" 23#include "ieee80211_i.h"
24#include "driver-ops.h"
24#include "mesh.h" 25#include "mesh.h"
25 26
26#define IEEE80211_PROBE_DELAY (HZ / 33) 27#define IEEE80211_PROBE_DELAY (HZ / 33)
@@ -316,17 +317,15 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
316 netif_tx_lock_bh(local->mdev); 317 netif_tx_lock_bh(local->mdev);
317 netif_addr_lock(local->mdev); 318 netif_addr_lock(local->mdev);
318 local->filter_flags &= ~FIF_BCN_PRBRESP_PROMISC; 319 local->filter_flags &= ~FIF_BCN_PRBRESP_PROMISC;
319 local->ops->configure_filter(local_to_hw(local), 320 drv_configure_filter(local, FIF_BCN_PRBRESP_PROMISC,
320 FIF_BCN_PRBRESP_PROMISC, 321 &local->filter_flags,
321 &local->filter_flags, 322 local->mdev->mc_count,
322 local->mdev->mc_count, 323 local->mdev->mc_list);
323 local->mdev->mc_list);
324 324
325 netif_addr_unlock(local->mdev); 325 netif_addr_unlock(local->mdev);
326 netif_tx_unlock_bh(local->mdev); 326 netif_tx_unlock_bh(local->mdev);
327 327
328 if (local->ops->sw_scan_complete) 328 drv_sw_scan_complete(local);
329 local->ops->sw_scan_complete(local_to_hw(local));
330 329
331 mutex_lock(&local->iflist_mtx); 330 mutex_lock(&local->iflist_mtx);
332 list_for_each_entry(sdata, &local->interfaces, list) { 331 list_for_each_entry(sdata, &local->interfaces, list) {
@@ -375,8 +374,7 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
375 * nullfunc frames and probe requests will be dropped in 374 * nullfunc frames and probe requests will be dropped in
376 * ieee80211_tx_h_check_assoc(). 375 * ieee80211_tx_h_check_assoc().
377 */ 376 */
378 if (local->ops->sw_scan_start) 377 drv_sw_scan_start(local);
379 local->ops->sw_scan_start(local_to_hw(local));
380 378
381 mutex_lock(&local->iflist_mtx); 379 mutex_lock(&local->iflist_mtx);
382 list_for_each_entry(sdata, &local->interfaces, list) { 380 list_for_each_entry(sdata, &local->interfaces, list) {
@@ -405,11 +403,10 @@ static int ieee80211_start_sw_scan(struct ieee80211_local *local)
405 403
406 netif_addr_lock_bh(local->mdev); 404 netif_addr_lock_bh(local->mdev);
407 local->filter_flags |= FIF_BCN_PRBRESP_PROMISC; 405 local->filter_flags |= FIF_BCN_PRBRESP_PROMISC;
408 local->ops->configure_filter(local_to_hw(local), 406 drv_configure_filter(local, FIF_BCN_PRBRESP_PROMISC,
409 FIF_BCN_PRBRESP_PROMISC, 407 &local->filter_flags,
410 &local->filter_flags, 408 local->mdev->mc_count,
411 local->mdev->mc_count, 409 local->mdev->mc_list);
412 local->mdev->mc_list);
413 netif_addr_unlock_bh(local->mdev); 410 netif_addr_unlock_bh(local->mdev);
414 411
415 /* TODO: start scan as soon as all nullfunc frames are ACKed */ 412 /* TODO: start scan as soon as all nullfunc frames are ACKed */
@@ -477,8 +474,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
477 mutex_unlock(&local->scan_mtx); 474 mutex_unlock(&local->scan_mtx);
478 475
479 if (local->ops->hw_scan) 476 if (local->ops->hw_scan)
480 rc = local->ops->hw_scan(local_to_hw(local), 477 rc = drv_hw_scan(local, local->scan_req);
481 local->scan_req);
482 else 478 else
483 rc = ieee80211_start_sw_scan(local); 479 rc = ieee80211_start_sw_scan(local);
484 480
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 7116220d06b..a98ea273a15 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -19,6 +19,7 @@
19 19
20#include <net/mac80211.h> 20#include <net/mac80211.h>
21#include "ieee80211_i.h" 21#include "ieee80211_i.h"
22#include "driver-ops.h"
22#include "rate.h" 23#include "rate.h"
23#include "sta_info.h" 24#include "sta_info.h"
24#include "debugfs_sta.h" 25#include "debugfs_sta.h"
@@ -346,8 +347,7 @@ int sta_info_insert(struct sta_info *sta)
346 struct ieee80211_sub_if_data, 347 struct ieee80211_sub_if_data,
347 u.ap); 348 u.ap);
348 349
349 local->ops->sta_notify(local_to_hw(local), &sdata->vif, 350 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD, &sta->sta);
350 STA_NOTIFY_ADD, &sta->sta);
351 } 351 }
352 352
353#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 353#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -405,8 +405,7 @@ static void __sta_info_set_tim_bit(struct ieee80211_if_ap *bss,
405 405
406 if (sta->local->ops->set_tim) { 406 if (sta->local->ops->set_tim) {
407 sta->local->tim_in_locked_section = true; 407 sta->local->tim_in_locked_section = true;
408 sta->local->ops->set_tim(local_to_hw(sta->local), 408 drv_set_tim(sta->local, &sta->sta, true);
409 &sta->sta, true);
410 sta->local->tim_in_locked_section = false; 409 sta->local->tim_in_locked_section = false;
411 } 410 }
412} 411}
@@ -431,8 +430,7 @@ static void __sta_info_clear_tim_bit(struct ieee80211_if_ap *bss,
431 430
432 if (sta->local->ops->set_tim) { 431 if (sta->local->ops->set_tim) {
433 sta->local->tim_in_locked_section = true; 432 sta->local->tim_in_locked_section = true;
434 sta->local->ops->set_tim(local_to_hw(sta->local), 433 drv_set_tim(sta->local, &sta->sta, false);
435 &sta->sta, false);
436 sta->local->tim_in_locked_section = false; 434 sta->local->tim_in_locked_section = false;
437 } 435 }
438} 436}
@@ -482,8 +480,8 @@ static void __sta_info_unlink(struct sta_info **sta)
482 struct ieee80211_sub_if_data, 480 struct ieee80211_sub_if_data,
483 u.ap); 481 u.ap);
484 482
485 local->ops->sta_notify(local_to_hw(local), &sdata->vif, 483 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE,
486 STA_NOTIFY_REMOVE, &(*sta)->sta); 484 &(*sta)->sta);
487 } 485 }
488 486
489 if (ieee80211_vif_is_mesh(&sdata->vif)) { 487 if (ieee80211_vif_is_mesh(&sdata->vif)) {
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index 38fa111d2dc..964b7faa7f1 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -13,6 +13,7 @@
13#include <asm/unaligned.h> 13#include <asm/unaligned.h>
14 14
15#include <net/mac80211.h> 15#include <net/mac80211.h>
16#include "driver-ops.h"
16#include "key.h" 17#include "key.h"
17#include "tkip.h" 18#include "tkip.h"
18#include "wep.h" 19#include "wep.h"
@@ -307,9 +308,8 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
307 if (is_multicast_ether_addr(ra)) 308 if (is_multicast_ether_addr(ra))
308 sta_addr = bcast; 309 sta_addr = bcast;
309 310
310 key->local->ops->update_tkip_key( 311 drv_update_tkip_key(key->local, &key->conf, sta_addr,
311 local_to_hw(key->local), &key->conf, 312 iv32, key->u.tkip.rx[queue].p1k);
312 sta_addr, iv32, key->u.tkip.rx[queue].p1k);
313 } 313 }
314 } 314 }
315 315
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 29df65045fc..1564a3018cf 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -25,6 +25,7 @@
25#include <asm/unaligned.h> 25#include <asm/unaligned.h>
26 26
27#include "ieee80211_i.h" 27#include "ieee80211_i.h"
28#include "driver-ops.h"
28#include "led.h" 29#include "led.h"
29#include "mesh.h" 30#include "mesh.h"
30#include "wep.h" 31#include "wep.h"
@@ -1162,7 +1163,7 @@ static int __ieee80211_tx(struct ieee80211_local *local,
1162 1163
1163 next = skb->next; 1164 next = skb->next;
1164 len = skb->len; 1165 len = skb->len;
1165 ret = local->ops->tx(local_to_hw(local), skb); 1166 ret = drv_tx(local, skb);
1166 if (WARN_ON(ret != NETDEV_TX_OK && skb->len != len)) { 1167 if (WARN_ON(ret != NETDEV_TX_OK && skb->len != len)) {
1167 dev_kfree_skb(skb); 1168 dev_kfree_skb(skb);
1168 ret = NETDEV_TX_OK; 1169 ret = NETDEV_TX_OK;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 2cde9bbfe7d..97b613affe0 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -26,6 +26,7 @@
26#include <net/rtnetlink.h> 26#include <net/rtnetlink.h>
27 27
28#include "ieee80211_i.h" 28#include "ieee80211_i.h"
29#include "driver-ops.h"
29#include "rate.h" 30#include "rate.h"
30#include "mesh.h" 31#include "mesh.h"
31#include "wme.h" 32#include "wme.h"
@@ -726,7 +727,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
726 qparam.txop = 0; 727 qparam.txop = 0;
727 728
728 for (i = 0; i < local_to_hw(local)->queues; i++) 729 for (i = 0; i < local_to_hw(local)->queues; i++)
729 local->ops->conf_tx(local_to_hw(local), i, &qparam); 730 drv_conf_tx(local, i, &qparam);
730} 731}
731 732
732void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 733void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
@@ -1000,7 +1001,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1000 1001
1001 /* restart hardware */ 1002 /* restart hardware */
1002 if (local->open_count) { 1003 if (local->open_count) {
1003 res = local->ops->start(hw); 1004 res = drv_start(local);
1004 1005
1005 ieee80211_led_radio(local, hw->conf.radio_enabled); 1006 ieee80211_led_radio(local, hw->conf.radio_enabled);
1006 } 1007 }
@@ -1013,7 +1014,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1013 conf.vif = &sdata->vif; 1014 conf.vif = &sdata->vif;
1014 conf.type = sdata->vif.type; 1015 conf.type = sdata->vif.type;
1015 conf.mac_addr = sdata->dev->dev_addr; 1016 conf.mac_addr = sdata->dev->dev_addr;
1016 res = local->ops->add_interface(hw, &conf); 1017 res = drv_add_interface(local, &conf);
1017 } 1018 }
1018 } 1019 }
1019 1020
@@ -1026,8 +1027,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1026 struct ieee80211_sub_if_data, 1027 struct ieee80211_sub_if_data,
1027 u.ap); 1028 u.ap);
1028 1029
1029 local->ops->sta_notify(hw, &sdata->vif, 1030 drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD,
1030 STA_NOTIFY_ADD, &sta->sta); 1031 &sta->sta);
1031 } 1032 }
1032 spin_unlock_irqrestore(&local->sta_lock, flags); 1033 spin_unlock_irqrestore(&local->sta_lock, flags);
1033 } 1034 }
@@ -1045,8 +1046,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1045 rcu_read_unlock(); 1046 rcu_read_unlock();
1046 1047
1047 /* setup RTS threshold */ 1048 /* setup RTS threshold */
1048 if (local->ops->set_rts_threshold) 1049 drv_set_rts_threshold(local, hw->wiphy->rts_threshold);
1049 local->ops->set_rts_threshold(hw, hw->wiphy->rts_threshold);
1050 1050
1051 /* reconfigure hardware */ 1051 /* reconfigure hardware */
1052 ieee80211_hw_config(local, ~0); 1052 ieee80211_hw_config(local, ~0);