aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/libertas/dev.h2
-rw-r--r--drivers/net/wireless/libertas/main.c36
2 files changed, 15 insertions, 23 deletions
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index a9c3adc421b7..04cf33da5899 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -10,7 +10,6 @@
10#include <linux/wireless.h> 10#include <linux/wireless.h>
11#include <linux/ethtool.h> 11#include <linux/ethtool.h>
12#include <linux/debugfs.h> 12#include <linux/debugfs.h>
13#include <net/ieee80211.h>
14 13
15#include "defs.h" 14#include "defs.h"
16#include "scan.h" 15#include "scan.h"
@@ -114,7 +113,6 @@ struct lbs_private {
114 struct net_device_stats stats; 113 struct net_device_stats stats;
115 struct net_device *mesh_dev; /* Virtual device */ 114 struct net_device *mesh_dev; /* Virtual device */
116 struct net_device *rtap_net_dev; 115 struct net_device *rtap_net_dev;
117 struct ieee80211_device *ieee;
118 116
119 struct iw_statistics wstats; 117 struct iw_statistics wstats;
120 struct lbs_mesh_stats mstats; 118 struct lbs_mesh_stats mstats;
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 5c8cb0079d4b..55dce8dbd0d2 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1448,7 +1448,7 @@ static int lbs_rtap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
1448static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev) 1448static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev)
1449{ 1449{
1450 struct lbs_private *priv = dev->priv; 1450 struct lbs_private *priv = dev->priv;
1451 return &priv->ieee->stats; 1451 return &priv->stats;
1452} 1452}
1453 1453
1454 1454
@@ -1457,42 +1457,36 @@ void lbs_remove_rtap(struct lbs_private *priv)
1457 if (priv->rtap_net_dev == NULL) 1457 if (priv->rtap_net_dev == NULL)
1458 return; 1458 return;
1459 unregister_netdev(priv->rtap_net_dev); 1459 unregister_netdev(priv->rtap_net_dev);
1460 free_ieee80211(priv->rtap_net_dev); 1460 free_netdev(priv->rtap_net_dev);
1461 priv->rtap_net_dev = NULL; 1461 priv->rtap_net_dev = NULL;
1462} 1462}
1463 1463
1464int lbs_add_rtap(struct lbs_private *priv) 1464int lbs_add_rtap(struct lbs_private *priv)
1465{ 1465{
1466 int rc = 0; 1466 int rc = 0;
1467 struct net_device *rtap_dev;
1467 1468
1468 if (priv->rtap_net_dev) 1469 if (priv->rtap_net_dev)
1469 return -EPERM; 1470 return -EPERM;
1470 1471
1471 priv->rtap_net_dev = alloc_ieee80211(0); 1472 rtap_dev = alloc_netdev(0, "rtap%d", ether_setup);
1472 if (priv->rtap_net_dev == NULL) 1473 if (rtap_dev == NULL)
1473 return -ENOMEM; 1474 return -ENOMEM;
1474 1475
1476 rtap_dev->type = ARPHRD_IEEE80211_RADIOTAP;
1477 rtap_dev->open = lbs_rtap_open;
1478 rtap_dev->stop = lbs_rtap_stop;
1479 rtap_dev->get_stats = lbs_rtap_get_stats;
1480 rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit;
1481 rtap_dev->set_multicast_list = lbs_set_multicast_list;
1482 rtap_dev->priv = priv;
1475 1483
1476 priv->ieee = netdev_priv(priv->rtap_net_dev); 1484 rc = register_netdev(rtap_dev);
1477
1478 strcpy(priv->rtap_net_dev->name, "rtap%d");
1479
1480 priv->rtap_net_dev->type = ARPHRD_IEEE80211_RADIOTAP;
1481 priv->rtap_net_dev->open = lbs_rtap_open;
1482 priv->rtap_net_dev->stop = lbs_rtap_stop;
1483 priv->rtap_net_dev->get_stats = lbs_rtap_get_stats;
1484 priv->rtap_net_dev->hard_start_xmit = lbs_rtap_hard_start_xmit;
1485 priv->rtap_net_dev->set_multicast_list = lbs_set_multicast_list;
1486 priv->rtap_net_dev->priv = priv;
1487
1488 priv->ieee->iw_mode = IW_MODE_MONITOR;
1489
1490 rc = register_netdev(priv->rtap_net_dev);
1491 if (rc) { 1485 if (rc) {
1492 free_ieee80211(priv->rtap_net_dev); 1486 free_netdev(rtap_dev);
1493 priv->rtap_net_dev = NULL;
1494 return rc; 1487 return rc;
1495 } 1488 }
1489 priv->rtap_net_dev = rtap_dev;
1496 1490
1497 return 0; 1491 return 0;
1498} 1492}