diff options
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 06998c2240d9..cb429e783749 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -1046,7 +1046,6 @@ static WifiCtlHdr wifictlhdr8023 = { | |||
1046 | } | 1046 | } |
1047 | }; | 1047 | }; |
1048 | 1048 | ||
1049 | #ifdef WIRELESS_EXT | ||
1050 | // Frequency list (map channels to frequencies) | 1049 | // Frequency list (map channels to frequencies) |
1051 | static const long frequency_list[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442, | 1050 | static const long frequency_list[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442, |
1052 | 2447, 2452, 2457, 2462, 2467, 2472, 2484 }; | 1051 | 2447, 2452, 2457, 2462, 2467, 2472, 2484 }; |
@@ -1067,7 +1066,6 @@ typedef struct wep_key_t { | |||
1067 | 1066 | ||
1068 | /* List of Wireless Handlers (new API) */ | 1067 | /* List of Wireless Handlers (new API) */ |
1069 | static const struct iw_handler_def airo_handler_def; | 1068 | static const struct iw_handler_def airo_handler_def; |
1070 | #endif /* WIRELESS_EXT */ | ||
1071 | 1069 | ||
1072 | static const char version[] = "airo.c 0.6 (Ben Reed & Javier Achirica)"; | 1070 | static const char version[] = "airo.c 0.6 (Ben Reed & Javier Achirica)"; |
1073 | 1071 | ||
@@ -1110,10 +1108,8 @@ static irqreturn_t airo_interrupt( int irq, void* dev_id, struct pt_regs | |||
1110 | static int airo_thread(void *data); | 1108 | static int airo_thread(void *data); |
1111 | static void timer_func( struct net_device *dev ); | 1109 | static void timer_func( struct net_device *dev ); |
1112 | static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 1110 | static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
1113 | #ifdef WIRELESS_EXT | ||
1114 | static struct iw_statistics *airo_get_wireless_stats (struct net_device *dev); | 1111 | static struct iw_statistics *airo_get_wireless_stats (struct net_device *dev); |
1115 | static void airo_read_wireless_stats (struct airo_info *local); | 1112 | static void airo_read_wireless_stats (struct airo_info *local); |
1116 | #endif /* WIRELESS_EXT */ | ||
1117 | #ifdef CISCO_EXT | 1113 | #ifdef CISCO_EXT |
1118 | static int readrids(struct net_device *dev, aironet_ioctl *comp); | 1114 | static int readrids(struct net_device *dev, aironet_ioctl *comp); |
1119 | static int writerids(struct net_device *dev, aironet_ioctl *comp); | 1115 | static int writerids(struct net_device *dev, aironet_ioctl *comp); |
@@ -1187,12 +1183,10 @@ struct airo_info { | |||
1187 | int fid; | 1183 | int fid; |
1188 | } xmit, xmit11; | 1184 | } xmit, xmit11; |
1189 | struct net_device *wifidev; | 1185 | struct net_device *wifidev; |
1190 | #ifdef WIRELESS_EXT | ||
1191 | struct iw_statistics wstats; // wireless stats | 1186 | struct iw_statistics wstats; // wireless stats |
1192 | unsigned long scan_timestamp; /* Time started to scan */ | 1187 | unsigned long scan_timestamp; /* Time started to scan */ |
1193 | struct iw_spy_data spy_data; | 1188 | struct iw_spy_data spy_data; |
1194 | struct iw_public_data wireless_data; | 1189 | struct iw_public_data wireless_data; |
1195 | #endif /* WIRELESS_EXT */ | ||
1196 | #ifdef MICSUPPORT | 1190 | #ifdef MICSUPPORT |
1197 | /* MIC stuff */ | 1191 | /* MIC stuff */ |
1198 | struct crypto_tfm *tfm; | 1192 | struct crypto_tfm *tfm; |
@@ -2527,7 +2521,8 @@ static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci, | |||
2527 | unsigned long mem_start, mem_len, aux_start, aux_len; | 2521 | unsigned long mem_start, mem_len, aux_start, aux_len; |
2528 | int rc = -1; | 2522 | int rc = -1; |
2529 | int i; | 2523 | int i; |
2530 | unsigned char *busaddroff,*vpackoff; | 2524 | dma_addr_t busaddroff; |
2525 | unsigned char *vpackoff; | ||
2531 | unsigned char __iomem *pciaddroff; | 2526 | unsigned char __iomem *pciaddroff; |
2532 | 2527 | ||
2533 | mem_start = pci_resource_start(pci, 1); | 2528 | mem_start = pci_resource_start(pci, 1); |
@@ -2570,7 +2565,7 @@ static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci, | |||
2570 | /* | 2565 | /* |
2571 | * Setup descriptor RX, TX, CONFIG | 2566 | * Setup descriptor RX, TX, CONFIG |
2572 | */ | 2567 | */ |
2573 | busaddroff = (unsigned char *)ai->shared_dma; | 2568 | busaddroff = ai->shared_dma; |
2574 | pciaddroff = ai->pciaux + AUX_OFFSET; | 2569 | pciaddroff = ai->pciaux + AUX_OFFSET; |
2575 | vpackoff = ai->shared; | 2570 | vpackoff = ai->shared; |
2576 | 2571 | ||
@@ -2579,7 +2574,7 @@ static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci, | |||
2579 | ai->rxfids[i].pending = 0; | 2574 | ai->rxfids[i].pending = 0; |
2580 | ai->rxfids[i].card_ram_off = pciaddroff; | 2575 | ai->rxfids[i].card_ram_off = pciaddroff; |
2581 | ai->rxfids[i].virtual_host_addr = vpackoff; | 2576 | ai->rxfids[i].virtual_host_addr = vpackoff; |
2582 | ai->rxfids[i].rx_desc.host_addr = (dma_addr_t) busaddroff; | 2577 | ai->rxfids[i].rx_desc.host_addr = busaddroff; |
2583 | ai->rxfids[i].rx_desc.valid = 1; | 2578 | ai->rxfids[i].rx_desc.valid = 1; |
2584 | ai->rxfids[i].rx_desc.len = PKTSIZE; | 2579 | ai->rxfids[i].rx_desc.len = PKTSIZE; |
2585 | ai->rxfids[i].rx_desc.rdy = 0; | 2580 | ai->rxfids[i].rx_desc.rdy = 0; |
@@ -2594,7 +2589,7 @@ static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci, | |||
2594 | ai->txfids[i].card_ram_off = pciaddroff; | 2589 | ai->txfids[i].card_ram_off = pciaddroff; |
2595 | ai->txfids[i].virtual_host_addr = vpackoff; | 2590 | ai->txfids[i].virtual_host_addr = vpackoff; |
2596 | ai->txfids[i].tx_desc.valid = 1; | 2591 | ai->txfids[i].tx_desc.valid = 1; |
2597 | ai->txfids[i].tx_desc.host_addr = (dma_addr_t) busaddroff; | 2592 | ai->txfids[i].tx_desc.host_addr = busaddroff; |
2598 | memcpy(ai->txfids[i].virtual_host_addr, | 2593 | memcpy(ai->txfids[i].virtual_host_addr, |
2599 | &wifictlhdr8023, sizeof(wifictlhdr8023)); | 2594 | &wifictlhdr8023, sizeof(wifictlhdr8023)); |
2600 | 2595 | ||
@@ -2607,8 +2602,8 @@ static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci, | |||
2607 | /* Rid descriptor setup */ | 2602 | /* Rid descriptor setup */ |
2608 | ai->config_desc.card_ram_off = pciaddroff; | 2603 | ai->config_desc.card_ram_off = pciaddroff; |
2609 | ai->config_desc.virtual_host_addr = vpackoff; | 2604 | ai->config_desc.virtual_host_addr = vpackoff; |
2610 | ai->config_desc.rid_desc.host_addr = (dma_addr_t) busaddroff; | 2605 | ai->config_desc.rid_desc.host_addr = busaddroff; |
2611 | ai->ridbus = (dma_addr_t)busaddroff; | 2606 | ai->ridbus = busaddroff; |
2612 | ai->config_desc.rid_desc.rid = 0; | 2607 | ai->config_desc.rid_desc.rid = 0; |
2613 | ai->config_desc.rid_desc.len = RIDSIZE; | 2608 | ai->config_desc.rid_desc.len = RIDSIZE; |
2614 | ai->config_desc.rid_desc.valid = 1; | 2609 | ai->config_desc.rid_desc.valid = 1; |
@@ -2647,9 +2642,7 @@ static void wifi_setup(struct net_device *dev) | |||
2647 | dev->get_stats = &airo_get_stats; | 2642 | dev->get_stats = &airo_get_stats; |
2648 | dev->set_mac_address = &airo_set_mac_address; | 2643 | dev->set_mac_address = &airo_set_mac_address; |
2649 | dev->do_ioctl = &airo_ioctl; | 2644 | dev->do_ioctl = &airo_ioctl; |
2650 | #ifdef WIRELESS_EXT | ||
2651 | dev->wireless_handlers = &airo_handler_def; | 2645 | dev->wireless_handlers = &airo_handler_def; |
2652 | #endif /* WIRELESS_EXT */ | ||
2653 | dev->change_mtu = &airo_change_mtu; | 2646 | dev->change_mtu = &airo_change_mtu; |
2654 | dev->open = &airo_open; | 2647 | dev->open = &airo_open; |
2655 | dev->stop = &airo_close; | 2648 | dev->stop = &airo_close; |
@@ -2675,9 +2668,7 @@ static struct net_device *init_wifidev(struct airo_info *ai, | |||
2675 | dev->priv = ethdev->priv; | 2668 | dev->priv = ethdev->priv; |
2676 | dev->irq = ethdev->irq; | 2669 | dev->irq = ethdev->irq; |
2677 | dev->base_addr = ethdev->base_addr; | 2670 | dev->base_addr = ethdev->base_addr; |
2678 | #ifdef WIRELESS_EXT | ||
2679 | dev->wireless_data = ethdev->wireless_data; | 2671 | dev->wireless_data = ethdev->wireless_data; |
2680 | #endif /* WIRELESS_EXT */ | ||
2681 | memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len); | 2672 | memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len); |
2682 | err = register_netdev(dev); | 2673 | err = register_netdev(dev); |
2683 | if (err<0) { | 2674 | if (err<0) { |
@@ -2755,11 +2746,9 @@ static struct net_device *_init_airo_card( unsigned short irq, int port, | |||
2755 | dev->set_multicast_list = &airo_set_multicast_list; | 2746 | dev->set_multicast_list = &airo_set_multicast_list; |
2756 | dev->set_mac_address = &airo_set_mac_address; | 2747 | dev->set_mac_address = &airo_set_mac_address; |
2757 | dev->do_ioctl = &airo_ioctl; | 2748 | dev->do_ioctl = &airo_ioctl; |
2758 | #ifdef WIRELESS_EXT | ||
2759 | dev->wireless_handlers = &airo_handler_def; | 2749 | dev->wireless_handlers = &airo_handler_def; |
2760 | ai->wireless_data.spy_data = &ai->spy_data; | 2750 | ai->wireless_data.spy_data = &ai->spy_data; |
2761 | dev->wireless_data = &ai->wireless_data; | 2751 | dev->wireless_data = &ai->wireless_data; |
2762 | #endif /* WIRELESS_EXT */ | ||
2763 | dev->change_mtu = &airo_change_mtu; | 2752 | dev->change_mtu = &airo_change_mtu; |
2764 | dev->open = &airo_open; | 2753 | dev->open = &airo_open; |
2765 | dev->stop = &airo_close; | 2754 | dev->stop = &airo_close; |
@@ -5515,12 +5504,13 @@ static int airo_pci_resume(struct pci_dev *pdev) | |||
5515 | struct net_device *dev = pci_get_drvdata(pdev); | 5504 | struct net_device *dev = pci_get_drvdata(pdev); |
5516 | struct airo_info *ai = dev->priv; | 5505 | struct airo_info *ai = dev->priv; |
5517 | Resp rsp; | 5506 | Resp rsp; |
5507 | pci_power_t prev_state = pdev->current_state; | ||
5518 | 5508 | ||
5519 | pci_set_power_state(pdev, 0); | 5509 | pci_set_power_state(pdev, PCI_D0); |
5520 | pci_restore_state(pdev); | 5510 | pci_restore_state(pdev); |
5521 | pci_enable_wake(pdev, pci_choose_state(pdev, ai->power), 0); | 5511 | pci_enable_wake(pdev, PCI_D0, 0); |
5522 | 5512 | ||
5523 | if (ai->power.event > 1) { | 5513 | if (prev_state != PCI_D1) { |
5524 | reset_card(dev, 0); | 5514 | reset_card(dev, 0); |
5525 | mpi_init_descriptors(ai); | 5515 | mpi_init_descriptors(ai); |
5526 | setup_card(ai, dev->dev_addr, 0); | 5516 | setup_card(ai, dev->dev_addr, 0); |
@@ -5598,7 +5588,6 @@ static void __exit airo_cleanup_module( void ) | |||
5598 | remove_proc_entry("aironet", proc_root_driver); | 5588 | remove_proc_entry("aironet", proc_root_driver); |
5599 | } | 5589 | } |
5600 | 5590 | ||
5601 | #ifdef WIRELESS_EXT | ||
5602 | /* | 5591 | /* |
5603 | * Initial Wireless Extension code for Aironet driver by : | 5592 | * Initial Wireless Extension code for Aironet driver by : |
5604 | * Jean Tourrilhes <jt@hpl.hp.com> - HPL - 17 November 00 | 5593 | * Jean Tourrilhes <jt@hpl.hp.com> - HPL - 17 November 00 |
@@ -7107,8 +7096,6 @@ static const struct iw_handler_def airo_handler_def = | |||
7107 | .get_wireless_stats = airo_get_wireless_stats, | 7096 | .get_wireless_stats = airo_get_wireless_stats, |
7108 | }; | 7097 | }; |
7109 | 7098 | ||
7110 | #endif /* WIRELESS_EXT */ | ||
7111 | |||
7112 | /* | 7099 | /* |
7113 | * This defines the configuration part of the Wireless Extensions | 7100 | * This defines the configuration part of the Wireless Extensions |
7114 | * Note : irq and spinlock protection will occur in the subroutines | 7101 | * Note : irq and spinlock protection will occur in the subroutines |
@@ -7187,7 +7174,6 @@ static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
7187 | return rc; | 7174 | return rc; |
7188 | } | 7175 | } |
7189 | 7176 | ||
7190 | #ifdef WIRELESS_EXT | ||
7191 | /* | 7177 | /* |
7192 | * Get the Wireless stats out of the driver | 7178 | * Get the Wireless stats out of the driver |
7193 | * Note : irq and spinlock protection will occur in the subroutines | 7179 | * Note : irq and spinlock protection will occur in the subroutines |
@@ -7260,7 +7246,6 @@ static struct iw_statistics *airo_get_wireless_stats(struct net_device *dev) | |||
7260 | 7246 | ||
7261 | return &local->wstats; | 7247 | return &local->wstats; |
7262 | } | 7248 | } |
7263 | #endif /* WIRELESS_EXT */ | ||
7264 | 7249 | ||
7265 | #ifdef CISCO_EXT | 7250 | #ifdef CISCO_EXT |
7266 | /* | 7251 | /* |