diff options
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index e9d23f68174f..241af7fe44bb 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -12,9 +12,8 @@ | |||
12 | #include <linux/kthread.h> | 12 | #include <linux/kthread.h> |
13 | #include <linux/kfifo.h> | 13 | #include <linux/kfifo.h> |
14 | #include <linux/stddef.h> | 14 | #include <linux/stddef.h> |
15 | 15 | #include <linux/ieee80211.h> | |
16 | #include <net/iw_handler.h> | 16 | #include <net/iw_handler.h> |
17 | #include <net/ieee80211.h> | ||
18 | 17 | ||
19 | #include "host.h" | 18 | #include "host.h" |
20 | #include "decl.h" | 19 | #include "decl.h" |
@@ -223,7 +222,7 @@ u8 lbs_data_rate_to_fw_index(u32 rate) | |||
223 | static ssize_t lbs_anycast_get(struct device *dev, | 222 | static ssize_t lbs_anycast_get(struct device *dev, |
224 | struct device_attribute *attr, char * buf) | 223 | struct device_attribute *attr, char * buf) |
225 | { | 224 | { |
226 | struct lbs_private *priv = to_net_dev(dev)->priv; | 225 | struct lbs_private *priv = netdev_priv(to_net_dev(dev)); |
227 | struct cmd_ds_mesh_access mesh_access; | 226 | struct cmd_ds_mesh_access mesh_access; |
228 | int ret; | 227 | int ret; |
229 | 228 | ||
@@ -242,7 +241,7 @@ static ssize_t lbs_anycast_get(struct device *dev, | |||
242 | static ssize_t lbs_anycast_set(struct device *dev, | 241 | static ssize_t lbs_anycast_set(struct device *dev, |
243 | struct device_attribute *attr, const char * buf, size_t count) | 242 | struct device_attribute *attr, const char * buf, size_t count) |
244 | { | 243 | { |
245 | struct lbs_private *priv = to_net_dev(dev)->priv; | 244 | struct lbs_private *priv = netdev_priv(to_net_dev(dev)); |
246 | struct cmd_ds_mesh_access mesh_access; | 245 | struct cmd_ds_mesh_access mesh_access; |
247 | uint32_t datum; | 246 | uint32_t datum; |
248 | int ret; | 247 | int ret; |
@@ -270,7 +269,7 @@ static void lbs_remove_mesh(struct lbs_private *priv); | |||
270 | static ssize_t lbs_rtap_get(struct device *dev, | 269 | static ssize_t lbs_rtap_get(struct device *dev, |
271 | struct device_attribute *attr, char * buf) | 270 | struct device_attribute *attr, char * buf) |
272 | { | 271 | { |
273 | struct lbs_private *priv = to_net_dev(dev)->priv; | 272 | struct lbs_private *priv = netdev_priv(to_net_dev(dev)); |
274 | return snprintf(buf, 5, "0x%X\n", priv->monitormode); | 273 | return snprintf(buf, 5, "0x%X\n", priv->monitormode); |
275 | } | 274 | } |
276 | 275 | ||
@@ -281,7 +280,7 @@ static ssize_t lbs_rtap_set(struct device *dev, | |||
281 | struct device_attribute *attr, const char * buf, size_t count) | 280 | struct device_attribute *attr, const char * buf, size_t count) |
282 | { | 281 | { |
283 | int monitor_mode; | 282 | int monitor_mode; |
284 | struct lbs_private *priv = to_net_dev(dev)->priv; | 283 | struct lbs_private *priv = netdev_priv(to_net_dev(dev)); |
285 | 284 | ||
286 | sscanf(buf, "%x", &monitor_mode); | 285 | sscanf(buf, "%x", &monitor_mode); |
287 | if (monitor_mode) { | 286 | if (monitor_mode) { |
@@ -332,7 +331,7 @@ static DEVICE_ATTR(lbs_rtap, 0644, lbs_rtap_get, lbs_rtap_set ); | |||
332 | static ssize_t lbs_mesh_get(struct device *dev, | 331 | static ssize_t lbs_mesh_get(struct device *dev, |
333 | struct device_attribute *attr, char * buf) | 332 | struct device_attribute *attr, char * buf) |
334 | { | 333 | { |
335 | struct lbs_private *priv = to_net_dev(dev)->priv; | 334 | struct lbs_private *priv = netdev_priv(to_net_dev(dev)); |
336 | return snprintf(buf, 5, "0x%X\n", !!priv->mesh_dev); | 335 | return snprintf(buf, 5, "0x%X\n", !!priv->mesh_dev); |
337 | } | 336 | } |
338 | 337 | ||
@@ -342,7 +341,7 @@ static ssize_t lbs_mesh_get(struct device *dev, | |||
342 | static ssize_t lbs_mesh_set(struct device *dev, | 341 | static ssize_t lbs_mesh_set(struct device *dev, |
343 | struct device_attribute *attr, const char * buf, size_t count) | 342 | struct device_attribute *attr, const char * buf, size_t count) |
344 | { | 343 | { |
345 | struct lbs_private *priv = to_net_dev(dev)->priv; | 344 | struct lbs_private *priv = netdev_priv(to_net_dev(dev)); |
346 | int enable; | 345 | int enable; |
347 | int ret, action = CMD_ACT_MESH_CONFIG_STOP; | 346 | int ret, action = CMD_ACT_MESH_CONFIG_STOP; |
348 | 347 | ||
@@ -393,7 +392,7 @@ static struct attribute_group lbs_mesh_attr_group = { | |||
393 | */ | 392 | */ |
394 | static int lbs_dev_open(struct net_device *dev) | 393 | static int lbs_dev_open(struct net_device *dev) |
395 | { | 394 | { |
396 | struct lbs_private *priv = (struct lbs_private *) dev->priv ; | 395 | struct lbs_private *priv = netdev_priv(dev) ; |
397 | int ret = 0; | 396 | int ret = 0; |
398 | 397 | ||
399 | lbs_deb_enter(LBS_DEB_NET); | 398 | lbs_deb_enter(LBS_DEB_NET); |
@@ -435,7 +434,7 @@ static int lbs_dev_open(struct net_device *dev) | |||
435 | */ | 434 | */ |
436 | static int lbs_mesh_stop(struct net_device *dev) | 435 | static int lbs_mesh_stop(struct net_device *dev) |
437 | { | 436 | { |
438 | struct lbs_private *priv = (struct lbs_private *) (dev->priv); | 437 | struct lbs_private *priv = dev->ml_priv; |
439 | 438 | ||
440 | lbs_deb_enter(LBS_DEB_MESH); | 439 | lbs_deb_enter(LBS_DEB_MESH); |
441 | spin_lock_irq(&priv->driver_lock); | 440 | spin_lock_irq(&priv->driver_lock); |
@@ -462,7 +461,7 @@ static int lbs_mesh_stop(struct net_device *dev) | |||
462 | */ | 461 | */ |
463 | static int lbs_eth_stop(struct net_device *dev) | 462 | static int lbs_eth_stop(struct net_device *dev) |
464 | { | 463 | { |
465 | struct lbs_private *priv = (struct lbs_private *) dev->priv; | 464 | struct lbs_private *priv = netdev_priv(dev); |
466 | 465 | ||
467 | lbs_deb_enter(LBS_DEB_NET); | 466 | lbs_deb_enter(LBS_DEB_NET); |
468 | 467 | ||
@@ -479,7 +478,7 @@ static int lbs_eth_stop(struct net_device *dev) | |||
479 | 478 | ||
480 | static void lbs_tx_timeout(struct net_device *dev) | 479 | static void lbs_tx_timeout(struct net_device *dev) |
481 | { | 480 | { |
482 | struct lbs_private *priv = (struct lbs_private *) dev->priv; | 481 | struct lbs_private *priv = netdev_priv(dev); |
483 | 482 | ||
484 | lbs_deb_enter(LBS_DEB_TX); | 483 | lbs_deb_enter(LBS_DEB_TX); |
485 | 484 | ||
@@ -531,7 +530,7 @@ EXPORT_SYMBOL_GPL(lbs_host_to_card_done); | |||
531 | */ | 530 | */ |
532 | static struct net_device_stats *lbs_get_stats(struct net_device *dev) | 531 | static struct net_device_stats *lbs_get_stats(struct net_device *dev) |
533 | { | 532 | { |
534 | struct lbs_private *priv = (struct lbs_private *) dev->priv; | 533 | struct lbs_private *priv = netdev_priv(dev); |
535 | 534 | ||
536 | lbs_deb_enter(LBS_DEB_NET); | 535 | lbs_deb_enter(LBS_DEB_NET); |
537 | return &priv->stats; | 536 | return &priv->stats; |
@@ -540,7 +539,7 @@ static struct net_device_stats *lbs_get_stats(struct net_device *dev) | |||
540 | static int lbs_set_mac_address(struct net_device *dev, void *addr) | 539 | static int lbs_set_mac_address(struct net_device *dev, void *addr) |
541 | { | 540 | { |
542 | int ret = 0; | 541 | int ret = 0; |
543 | struct lbs_private *priv = (struct lbs_private *) dev->priv; | 542 | struct lbs_private *priv = netdev_priv(dev); |
544 | struct sockaddr *phwaddr = addr; | 543 | struct sockaddr *phwaddr = addr; |
545 | struct cmd_ds_802_11_mac_address cmd; | 544 | struct cmd_ds_802_11_mac_address cmd; |
546 | 545 | ||
@@ -673,7 +672,7 @@ static void lbs_set_mcast_worker(struct work_struct *work) | |||
673 | 672 | ||
674 | static void lbs_set_multicast_list(struct net_device *dev) | 673 | static void lbs_set_multicast_list(struct net_device *dev) |
675 | { | 674 | { |
676 | struct lbs_private *priv = dev->priv; | 675 | struct lbs_private *priv = netdev_priv(dev); |
677 | 676 | ||
678 | schedule_work(&priv->mcast_work); | 677 | schedule_work(&priv->mcast_work); |
679 | } | 678 | } |
@@ -689,7 +688,7 @@ static void lbs_set_multicast_list(struct net_device *dev) | |||
689 | static int lbs_thread(void *data) | 688 | static int lbs_thread(void *data) |
690 | { | 689 | { |
691 | struct net_device *dev = data; | 690 | struct net_device *dev = data; |
692 | struct lbs_private *priv = dev->priv; | 691 | struct lbs_private *priv = netdev_priv(dev); |
693 | wait_queue_t wait; | 692 | wait_queue_t wait; |
694 | 693 | ||
695 | lbs_deb_enter(LBS_DEB_THREAD); | 694 | lbs_deb_enter(LBS_DEB_THREAD); |
@@ -1124,7 +1123,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev) | |||
1124 | lbs_pr_err("init ethX device failed\n"); | 1123 | lbs_pr_err("init ethX device failed\n"); |
1125 | goto done; | 1124 | goto done; |
1126 | } | 1125 | } |
1127 | priv = dev->priv; | 1126 | priv = netdev_priv(dev); |
1128 | 1127 | ||
1129 | if (lbs_init_adapter(priv)) { | 1128 | if (lbs_init_adapter(priv)) { |
1130 | lbs_pr_err("failed to initialize adapter structure.\n"); | 1129 | lbs_pr_err("failed to initialize adapter structure.\n"); |
@@ -1377,7 +1376,7 @@ static int lbs_add_mesh(struct lbs_private *priv) | |||
1377 | ret = -ENOMEM; | 1376 | ret = -ENOMEM; |
1378 | goto done; | 1377 | goto done; |
1379 | } | 1378 | } |
1380 | mesh_dev->priv = priv; | 1379 | mesh_dev->ml_priv = priv; |
1381 | priv->mesh_dev = mesh_dev; | 1380 | priv->mesh_dev = mesh_dev; |
1382 | 1381 | ||
1383 | mesh_dev->open = lbs_dev_open; | 1382 | mesh_dev->open = lbs_dev_open; |
@@ -1590,7 +1589,7 @@ static int lbs_rtap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1590 | 1589 | ||
1591 | static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev) | 1590 | static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev) |
1592 | { | 1591 | { |
1593 | struct lbs_private *priv = dev->priv; | 1592 | struct lbs_private *priv = dev->ml_priv; |
1594 | lbs_deb_enter(LBS_DEB_NET); | 1593 | lbs_deb_enter(LBS_DEB_NET); |
1595 | return &priv->stats; | 1594 | return &priv->stats; |
1596 | } | 1595 | } |
@@ -1631,7 +1630,7 @@ static int lbs_add_rtap(struct lbs_private *priv) | |||
1631 | rtap_dev->stop = lbs_rtap_stop; | 1630 | rtap_dev->stop = lbs_rtap_stop; |
1632 | rtap_dev->get_stats = lbs_rtap_get_stats; | 1631 | rtap_dev->get_stats = lbs_rtap_get_stats; |
1633 | rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit; | 1632 | rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit; |
1634 | rtap_dev->priv = priv; | 1633 | rtap_dev->ml_priv = priv; |
1635 | SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent); | 1634 | SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent); |
1636 | 1635 | ||
1637 | ret = register_netdev(rtap_dev); | 1636 | ret = register_netdev(rtap_dev); |