diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-09 16:22:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:06:27 -0500 |
commit | d9268fb9a124d067cf93710a85bb6c158d131c97 (patch) | |
tree | 2a7c28fe0f1e78c1445a569042298c4c87f160c5 /drivers/net/wireless/libertas/main.c | |
parent | 198cefb9320ea0aa1be43a93b398435447583081 (diff) |
libertas: stop using ieee80211 for radiotap device
There seems to be no point in doing it as an ieee80211 device instead of
a normal netdev, and when we override its ->priv and then call
free_ieee80211() it has a distressing tendency to crash horribly.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 36 |
1 files changed, 15 insertions, 21 deletions
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) | |||
1448 | static struct net_device_stats *lbs_rtap_get_stats(struct net_device *dev) | 1448 | static 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 | ||
1464 | int lbs_add_rtap(struct lbs_private *priv) | 1464 | int 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 | } |