aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/adm8211.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/wireless/adm8211.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/wireless/adm8211.c')
-rw-r--r--drivers/net/wireless/adm8211.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index b80f514877d8..ab61d2b558d6 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/if.h> 19#include <linux/if.h>
20#include <linux/skbuff.h> 20#include <linux/skbuff.h>
21#include <linux/slab.h>
21#include <linux/etherdevice.h> 22#include <linux/etherdevice.h>
22#include <linux/pci.h> 23#include <linux/pci.h>
23#include <linux/delay.h> 24#include <linux/delay.h>
@@ -39,7 +40,7 @@ static unsigned int rx_ring_size __read_mostly = 16;
39module_param(tx_ring_size, uint, 0); 40module_param(tx_ring_size, uint, 0);
40module_param(rx_ring_size, uint, 0); 41module_param(rx_ring_size, uint, 0);
41 42
42static struct pci_device_id adm8211_pci_id_table[] __devinitdata = { 43static DEFINE_PCI_DEVICE_TABLE(adm8211_pci_id_table) = {
43 /* ADMtek ADM8211 */ 44 /* ADMtek ADM8211 */
44 { PCI_DEVICE(0x10B7, 0x6000) }, /* 3Com 3CRSHPW796 */ 45 { PCI_DEVICE(0x10B7, 0x6000) }, /* 3Com 3CRSHPW796 */
45 { PCI_DEVICE(0x1200, 0x8201) }, /* ? */ 46 { PCI_DEVICE(0x1200, 0x8201) }, /* ? */
@@ -302,18 +303,6 @@ static int adm8211_get_stats(struct ieee80211_hw *dev,
302 return 0; 303 return 0;
303} 304}
304 305
305static int adm8211_get_tx_stats(struct ieee80211_hw *dev,
306 struct ieee80211_tx_queue_stats *stats)
307{
308 struct adm8211_priv *priv = dev->priv;
309
310 stats[0].len = priv->cur_tx - priv->dirty_tx;
311 stats[0].limit = priv->tx_ring_size - 2;
312 stats[0].count = priv->dirty_tx;
313
314 return 0;
315}
316
317static void adm8211_interrupt_tci(struct ieee80211_hw *dev) 306static void adm8211_interrupt_tci(struct ieee80211_hw *dev)
318{ 307{
319 struct adm8211_priv *priv = dev->priv; 308 struct adm8211_priv *priv = dev->priv;
@@ -1400,15 +1389,15 @@ static void adm8211_configure_filter(struct ieee80211_hw *dev,
1400} 1389}
1401 1390
1402static int adm8211_add_interface(struct ieee80211_hw *dev, 1391static int adm8211_add_interface(struct ieee80211_hw *dev,
1403 struct ieee80211_if_init_conf *conf) 1392 struct ieee80211_vif *vif)
1404{ 1393{
1405 struct adm8211_priv *priv = dev->priv; 1394 struct adm8211_priv *priv = dev->priv;
1406 if (priv->mode != NL80211_IFTYPE_MONITOR) 1395 if (priv->mode != NL80211_IFTYPE_MONITOR)
1407 return -EOPNOTSUPP; 1396 return -EOPNOTSUPP;
1408 1397
1409 switch (conf->type) { 1398 switch (vif->type) {
1410 case NL80211_IFTYPE_STATION: 1399 case NL80211_IFTYPE_STATION:
1411 priv->mode = conf->type; 1400 priv->mode = vif->type;
1412 break; 1401 break;
1413 default: 1402 default:
1414 return -EOPNOTSUPP; 1403 return -EOPNOTSUPP;
@@ -1416,8 +1405,8 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,
1416 1405
1417 ADM8211_IDLE(); 1406 ADM8211_IDLE();
1418 1407
1419 ADM8211_CSR_WRITE(PAR0, le32_to_cpu(*(__le32 *)conf->mac_addr)); 1408 ADM8211_CSR_WRITE(PAR0, le32_to_cpu(*(__le32 *)vif->addr));
1420 ADM8211_CSR_WRITE(PAR1, le16_to_cpu(*(__le16 *)(conf->mac_addr + 4))); 1409 ADM8211_CSR_WRITE(PAR1, le16_to_cpu(*(__le16 *)(vif->addr + 4)));
1421 1410
1422 adm8211_update_mode(dev); 1411 adm8211_update_mode(dev);
1423 1412
@@ -1427,7 +1416,7 @@ static int adm8211_add_interface(struct ieee80211_hw *dev,
1427} 1416}
1428 1417
1429static void adm8211_remove_interface(struct ieee80211_hw *dev, 1418static void adm8211_remove_interface(struct ieee80211_hw *dev,
1430 struct ieee80211_if_init_conf *conf) 1419 struct ieee80211_vif *vif)
1431{ 1420{
1432 struct adm8211_priv *priv = dev->priv; 1421 struct adm8211_priv *priv = dev->priv;
1433 priv->mode = NL80211_IFTYPE_MONITOR; 1422 priv->mode = NL80211_IFTYPE_MONITOR;
@@ -1538,7 +1527,7 @@ static int adm8211_start(struct ieee80211_hw *dev)
1538 adm8211_hw_init(dev); 1527 adm8211_hw_init(dev);
1539 adm8211_rf_set_channel(dev, priv->channel); 1528 adm8211_rf_set_channel(dev, priv->channel);
1540 1529
1541 retval = request_irq(priv->pdev->irq, &adm8211_interrupt, 1530 retval = request_irq(priv->pdev->irq, adm8211_interrupt,
1542 IRQF_SHARED, "adm8211", dev); 1531 IRQF_SHARED, "adm8211", dev);
1543 if (retval) { 1532 if (retval) {
1544 printk(KERN_ERR "%s: failed to register IRQ handler\n", 1533 printk(KERN_ERR "%s: failed to register IRQ handler\n",
@@ -1773,7 +1762,6 @@ static const struct ieee80211_ops adm8211_ops = {
1773 .prepare_multicast = adm8211_prepare_multicast, 1762 .prepare_multicast = adm8211_prepare_multicast,
1774 .configure_filter = adm8211_configure_filter, 1763 .configure_filter = adm8211_configure_filter,
1775 .get_stats = adm8211_get_stats, 1764 .get_stats = adm8211_get_stats,
1776 .get_tx_stats = adm8211_get_tx_stats,
1777 .get_tsf = adm8211_get_tsft 1765 .get_tsf = adm8211_get_tsft
1778}; 1766};
1779 1767