diff options
Diffstat (limited to 'drivers/net/wireless/p54/main.c')
-rw-r--r-- | drivers/net/wireless/p54/main.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c index 4d486bf9f725..a7cb9eb759a1 100644 --- a/drivers/net/wireless/p54/main.c +++ b/drivers/net/wireless/p54/main.c | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/slab.h> | ||
20 | #include <linux/firmware.h> | 21 | #include <linux/firmware.h> |
21 | #include <linux/etherdevice.h> | 22 | #include <linux/etherdevice.h> |
22 | 23 | ||
@@ -33,21 +34,29 @@ MODULE_DESCRIPTION("Softmac Prism54 common code"); | |||
33 | MODULE_LICENSE("GPL"); | 34 | MODULE_LICENSE("GPL"); |
34 | MODULE_ALIAS("prism54common"); | 35 | MODULE_ALIAS("prism54common"); |
35 | 36 | ||
37 | static int p54_sta_add_remove(struct ieee80211_hw *hw, | ||
38 | struct ieee80211_vif *vif, | ||
39 | struct ieee80211_sta *sta) | ||
40 | { | ||
41 | struct p54_common *priv = hw->priv; | ||
42 | |||
43 | /* | ||
44 | * Notify the firmware that we don't want or we don't | ||
45 | * need to buffer frames for this station anymore. | ||
46 | */ | ||
47 | |||
48 | p54_sta_unlock(priv, sta->addr); | ||
49 | |||
50 | return 0; | ||
51 | } | ||
52 | |||
36 | static void p54_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif, | 53 | static void p54_sta_notify(struct ieee80211_hw *dev, struct ieee80211_vif *vif, |
37 | enum sta_notify_cmd notify_cmd, | 54 | enum sta_notify_cmd notify_cmd, |
38 | struct ieee80211_sta *sta) | 55 | struct ieee80211_sta *sta) |
39 | { | 56 | { |
40 | struct p54_common *priv = dev->priv; | 57 | struct p54_common *priv = dev->priv; |
41 | switch (notify_cmd) { | ||
42 | case STA_NOTIFY_ADD: | ||
43 | case STA_NOTIFY_REMOVE: | ||
44 | /* | ||
45 | * Notify the firmware that we don't want or we don't | ||
46 | * need to buffer frames for this station anymore. | ||
47 | */ | ||
48 | 58 | ||
49 | p54_sta_unlock(priv, sta->addr); | 59 | switch (notify_cmd) { |
50 | break; | ||
51 | case STA_NOTIFY_AWAKE: | 60 | case STA_NOTIFY_AWAKE: |
52 | /* update the firmware's filter table */ | 61 | /* update the firmware's filter table */ |
53 | p54_sta_unlock(priv, sta->addr); | 62 | p54_sta_unlock(priv, sta->addr); |
@@ -216,7 +225,7 @@ static void p54_stop(struct ieee80211_hw *dev) | |||
216 | } | 225 | } |
217 | 226 | ||
218 | static int p54_add_interface(struct ieee80211_hw *dev, | 227 | static int p54_add_interface(struct ieee80211_hw *dev, |
219 | struct ieee80211_if_init_conf *conf) | 228 | struct ieee80211_vif *vif) |
220 | { | 229 | { |
221 | struct p54_common *priv = dev->priv; | 230 | struct p54_common *priv = dev->priv; |
222 | 231 | ||
@@ -226,28 +235,28 @@ static int p54_add_interface(struct ieee80211_hw *dev, | |||
226 | return -EOPNOTSUPP; | 235 | return -EOPNOTSUPP; |
227 | } | 236 | } |
228 | 237 | ||
229 | priv->vif = conf->vif; | 238 | priv->vif = vif; |
230 | 239 | ||
231 | switch (conf->type) { | 240 | switch (vif->type) { |
232 | case NL80211_IFTYPE_STATION: | 241 | case NL80211_IFTYPE_STATION: |
233 | case NL80211_IFTYPE_ADHOC: | 242 | case NL80211_IFTYPE_ADHOC: |
234 | case NL80211_IFTYPE_AP: | 243 | case NL80211_IFTYPE_AP: |
235 | case NL80211_IFTYPE_MESH_POINT: | 244 | case NL80211_IFTYPE_MESH_POINT: |
236 | priv->mode = conf->type; | 245 | priv->mode = vif->type; |
237 | break; | 246 | break; |
238 | default: | 247 | default: |
239 | mutex_unlock(&priv->conf_mutex); | 248 | mutex_unlock(&priv->conf_mutex); |
240 | return -EOPNOTSUPP; | 249 | return -EOPNOTSUPP; |
241 | } | 250 | } |
242 | 251 | ||
243 | memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); | 252 | memcpy(priv->mac_addr, vif->addr, ETH_ALEN); |
244 | p54_setup_mac(priv); | 253 | p54_setup_mac(priv); |
245 | mutex_unlock(&priv->conf_mutex); | 254 | mutex_unlock(&priv->conf_mutex); |
246 | return 0; | 255 | return 0; |
247 | } | 256 | } |
248 | 257 | ||
249 | static void p54_remove_interface(struct ieee80211_hw *dev, | 258 | static void p54_remove_interface(struct ieee80211_hw *dev, |
250 | struct ieee80211_if_init_conf *conf) | 259 | struct ieee80211_vif *vif) |
251 | { | 260 | { |
252 | struct p54_common *priv = dev->priv; | 261 | struct p54_common *priv = dev->priv; |
253 | 262 | ||
@@ -358,16 +367,6 @@ static int p54_get_stats(struct ieee80211_hw *dev, | |||
358 | return 0; | 367 | return 0; |
359 | } | 368 | } |
360 | 369 | ||
361 | static int p54_get_tx_stats(struct ieee80211_hw *dev, | ||
362 | struct ieee80211_tx_queue_stats *stats) | ||
363 | { | ||
364 | struct p54_common *priv = dev->priv; | ||
365 | |||
366 | memcpy(stats, &priv->tx_stats[P54_QUEUE_DATA], | ||
367 | sizeof(stats[0]) * dev->queues); | ||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | static void p54_bss_info_changed(struct ieee80211_hw *dev, | 370 | static void p54_bss_info_changed(struct ieee80211_hw *dev, |
372 | struct ieee80211_vif *vif, | 371 | struct ieee80211_vif *vif, |
373 | struct ieee80211_bss_conf *info, | 372 | struct ieee80211_bss_conf *info, |
@@ -516,13 +515,14 @@ static const struct ieee80211_ops p54_ops = { | |||
516 | .remove_interface = p54_remove_interface, | 515 | .remove_interface = p54_remove_interface, |
517 | .set_tim = p54_set_tim, | 516 | .set_tim = p54_set_tim, |
518 | .sta_notify = p54_sta_notify, | 517 | .sta_notify = p54_sta_notify, |
518 | .sta_add = p54_sta_add_remove, | ||
519 | .sta_remove = p54_sta_add_remove, | ||
519 | .set_key = p54_set_key, | 520 | .set_key = p54_set_key, |
520 | .config = p54_config, | 521 | .config = p54_config, |
521 | .bss_info_changed = p54_bss_info_changed, | 522 | .bss_info_changed = p54_bss_info_changed, |
522 | .configure_filter = p54_configure_filter, | 523 | .configure_filter = p54_configure_filter, |
523 | .conf_tx = p54_conf_tx, | 524 | .conf_tx = p54_conf_tx, |
524 | .get_stats = p54_get_stats, | 525 | .get_stats = p54_get_stats, |
525 | .get_tx_stats = p54_get_tx_stats | ||
526 | }; | 526 | }; |
527 | 527 | ||
528 | struct ieee80211_hw *p54_init_common(size_t priv_data_len) | 528 | struct ieee80211_hw *p54_init_common(size_t priv_data_len) |
@@ -579,7 +579,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) | |||
579 | * For now, disable PS by default because it affects | 579 | * For now, disable PS by default because it affects |
580 | * link stability significantly. | 580 | * link stability significantly. |
581 | */ | 581 | */ |
582 | dev->wiphy->ps_default = false; | 582 | dev->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; |
583 | 583 | ||
584 | mutex_init(&priv->conf_mutex); | 584 | mutex_init(&priv->conf_mutex); |
585 | mutex_init(&priv->eeprom_mutex); | 585 | mutex_init(&priv->eeprom_mutex); |