aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2009-08-20 14:48:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:28 -0400
commitb0a4e7d8a291de63f35b04464de9ab4a83d38a7c (patch)
treec95a79b15483070bf1ca92ddf7b7e9ba4d4af026 /drivers
parent01a0ac417ce9b4f1216a266f2fd454cffefc5aee (diff)
libipw: switch from ieee80211_* to libipw_* naming policy
This eliminates the dual definition of ieee80211_channel (and possibly others), further clarifying who defines what and paving the way for inclusion of cfg80211.h. Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c198
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.h14
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c902
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.h14
-rw-r--r--drivers/net/wireless/ipw2x00/libipw.h (renamed from drivers/net/wireless/ipw2x00/ieee80211.h)658
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_geo.c80
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_module.c80
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_rx.c403
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_tx.c68
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_wx.c92
10 files changed, 1255 insertions, 1254 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index dee50ed0897d..33bdb20e9f1e 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -1673,7 +1673,7 @@ static int ipw2100_start_scan(struct ipw2100_priv *priv)
1673 return err; 1673 return err;
1674} 1674}
1675 1675
1676static const struct ieee80211_geo ipw_geos[] = { 1676static const struct libipw_geo ipw_geos[] = {
1677 { /* Restricted */ 1677 { /* Restricted */
1678 "---", 1678 "---",
1679 .bg_channels = 14, 1679 .bg_channels = 14,
@@ -1694,7 +1694,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1694 1694
1695 /* Age scan list entries found before suspend */ 1695 /* Age scan list entries found before suspend */
1696 if (priv->suspend_time) { 1696 if (priv->suspend_time) {
1697 ieee80211_networks_age(priv->ieee, priv->suspend_time); 1697 libipw_networks_age(priv->ieee, priv->suspend_time);
1698 priv->suspend_time = 0; 1698 priv->suspend_time = 0;
1699 } 1699 }
1700 1700
@@ -1752,11 +1752,11 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1752 } 1752 }
1753 1753
1754 /* Initialize the geo */ 1754 /* Initialize the geo */
1755 if (ieee80211_set_geo(priv->ieee, &ipw_geos[0])) { 1755 if (libipw_set_geo(priv->ieee, &ipw_geos[0])) {
1756 printk(KERN_WARNING DRV_NAME "Could not set geo\n"); 1756 printk(KERN_WARNING DRV_NAME "Could not set geo\n");
1757 return 0; 1757 return 0;
1758 } 1758 }
1759 priv->ieee->freq_band = IEEE80211_24GHZ_BAND; 1759 priv->ieee->freq_band = LIBIPW_24GHZ_BAND;
1760 1760
1761 lock = LOCK_NONE; 1761 lock = LOCK_NONE;
1762 if (ipw2100_set_ordinal(priv, IPW_ORD_PERS_DB_LOCK, &lock, &ord_len)) { 1762 if (ipw2100_set_ordinal(priv, IPW_ORD_PERS_DB_LOCK, &lock, &ord_len)) {
@@ -1817,7 +1817,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
1817/* Called by register_netdev() */ 1817/* Called by register_netdev() */
1818static int ipw2100_net_init(struct net_device *dev) 1818static int ipw2100_net_init(struct net_device *dev)
1819{ 1819{
1820 struct ipw2100_priv *priv = ieee80211_priv(dev); 1820 struct ipw2100_priv *priv = libipw_priv(dev);
1821 return ipw2100_up(priv, 1); 1821 return ipw2100_up(priv, 1);
1822} 1822}
1823 1823
@@ -2340,8 +2340,8 @@ static u32 ipw2100_match_buf(struct ipw2100_priv *priv, u8 * in_buf,
2340 * 2340 *
2341 * When packet is provided by the firmware, it contains the following: 2341 * When packet is provided by the firmware, it contains the following:
2342 * 2342 *
2343 * . ieee80211_hdr 2343 * . libipw_hdr
2344 * . ieee80211_snap_hdr 2344 * . libipw_snap_hdr
2345 * 2345 *
2346 * The size of the constructed ethernet 2346 * The size of the constructed ethernet
2347 * 2347 *
@@ -2396,7 +2396,7 @@ static void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i)
2396} 2396}
2397 2397
2398static void isr_rx(struct ipw2100_priv *priv, int i, 2398static void isr_rx(struct ipw2100_priv *priv, int i,
2399 struct ieee80211_rx_stats *stats) 2399 struct libipw_rx_stats *stats)
2400{ 2400{
2401 struct net_device *dev = priv->net_dev; 2401 struct net_device *dev = priv->net_dev;
2402 struct ipw2100_status *status = &priv->status_queue.drv[i]; 2402 struct ipw2100_status *status = &priv->status_queue.drv[i];
@@ -2435,13 +2435,13 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2435 2435
2436#ifdef IPW2100_RX_DEBUG 2436#ifdef IPW2100_RX_DEBUG
2437 /* Make a copy of the frame so we can dump it to the logs if 2437 /* Make a copy of the frame so we can dump it to the logs if
2438 * ieee80211_rx fails */ 2438 * libipw_rx fails */
2439 skb_copy_from_linear_data(packet->skb, packet_data, 2439 skb_copy_from_linear_data(packet->skb, packet_data,
2440 min_t(u32, status->frame_size, 2440 min_t(u32, status->frame_size,
2441 IPW_RX_NIC_BUFFER_LENGTH)); 2441 IPW_RX_NIC_BUFFER_LENGTH));
2442#endif 2442#endif
2443 2443
2444 if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { 2444 if (!libipw_rx(priv->ieee, packet->skb, stats)) {
2445#ifdef IPW2100_RX_DEBUG 2445#ifdef IPW2100_RX_DEBUG
2446 IPW_DEBUG_DROP("%s: Non consumed packet:\n", 2446 IPW_DEBUG_DROP("%s: Non consumed packet:\n",
2447 dev->name); 2447 dev->name);
@@ -2449,7 +2449,7 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2449#endif 2449#endif
2450 dev->stats.rx_errors++; 2450 dev->stats.rx_errors++;
2451 2451
2452 /* ieee80211_rx failed, so it didn't free the SKB */ 2452 /* libipw_rx failed, so it didn't free the SKB */
2453 dev_kfree_skb_any(packet->skb); 2453 dev_kfree_skb_any(packet->skb);
2454 packet->skb = NULL; 2454 packet->skb = NULL;
2455 } 2455 }
@@ -2470,7 +2470,7 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2470#ifdef CONFIG_IPW2100_MONITOR 2470#ifdef CONFIG_IPW2100_MONITOR
2471 2471
2472static void isr_rx_monitor(struct ipw2100_priv *priv, int i, 2472static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
2473 struct ieee80211_rx_stats *stats) 2473 struct libipw_rx_stats *stats)
2474{ 2474{
2475 struct net_device *dev = priv->net_dev; 2475 struct net_device *dev = priv->net_dev;
2476 struct ipw2100_status *status = &priv->status_queue.drv[i]; 2476 struct ipw2100_status *status = &priv->status_queue.drv[i];
@@ -2528,10 +2528,10 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
2528 2528
2529 skb_put(packet->skb, status->frame_size + sizeof(struct ipw_rt_hdr)); 2529 skb_put(packet->skb, status->frame_size + sizeof(struct ipw_rt_hdr));
2530 2530
2531 if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { 2531 if (!libipw_rx(priv->ieee, packet->skb, stats)) {
2532 dev->stats.rx_errors++; 2532 dev->stats.rx_errors++;
2533 2533
2534 /* ieee80211_rx failed, so it didn't free the SKB */ 2534 /* libipw_rx failed, so it didn't free the SKB */
2535 dev_kfree_skb_any(packet->skb); 2535 dev_kfree_skb_any(packet->skb);
2536 packet->skb = NULL; 2536 packet->skb = NULL;
2537 } 2537 }
@@ -2615,7 +2615,7 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv)
2615 u16 frame_type; 2615 u16 frame_type;
2616 u32 r, w, i, s; 2616 u32 r, w, i, s;
2617 struct ipw2100_rx *u; 2617 struct ipw2100_rx *u;
2618 struct ieee80211_rx_stats stats = { 2618 struct libipw_rx_stats stats = {
2619 .mac_time = jiffies, 2619 .mac_time = jiffies,
2620 }; 2620 };
2621 2621
@@ -2661,8 +2661,8 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv)
2661 2661
2662 stats.mask = 0; 2662 stats.mask = 0;
2663 if (stats.rssi != 0) 2663 if (stats.rssi != 0)
2664 stats.mask |= IEEE80211_STATMASK_RSSI; 2664 stats.mask |= LIBIPW_STATMASK_RSSI;
2665 stats.freq = IEEE80211_24GHZ_BAND; 2665 stats.freq = LIBIPW_24GHZ_BAND;
2666 2666
2667 IPW_DEBUG_RX("%s: '%s' frame type received (%d).\n", 2667 IPW_DEBUG_RX("%s: '%s' frame type received (%d).\n",
2668 priv->net_dev->name, frame_types[frame_type], 2668 priv->net_dev->name, frame_types[frame_type],
@@ -2686,11 +2686,11 @@ static void __ipw2100_rx_process(struct ipw2100_priv *priv)
2686 break; 2686 break;
2687 } 2687 }
2688#endif 2688#endif
2689 if (stats.len < sizeof(struct ieee80211_hdr_3addr)) 2689 if (stats.len < sizeof(struct libipw_hdr_3addr))
2690 break; 2690 break;
2691 switch (WLAN_FC_GET_TYPE(le16_to_cpu(u->rx_data.header.frame_ctl))) { 2691 switch (WLAN_FC_GET_TYPE(le16_to_cpu(u->rx_data.header.frame_ctl))) {
2692 case IEEE80211_FTYPE_MGMT: 2692 case IEEE80211_FTYPE_MGMT:
2693 ieee80211_rx_mgt(priv->ieee, 2693 libipw_rx_mgt(priv->ieee,
2694 &u->rx_data.header, &stats); 2694 &u->rx_data.header, &stats);
2695 break; 2695 break;
2696 2696
@@ -2884,7 +2884,7 @@ static int __ipw2100_tx_process(struct ipw2100_priv *priv)
2884 tbd->buf_length, PCI_DMA_TODEVICE); 2884 tbd->buf_length, PCI_DMA_TODEVICE);
2885 } 2885 }
2886 2886
2887 ieee80211_txb_free(packet->info.d_struct.txb); 2887 libipw_txb_free(packet->info.d_struct.txb);
2888 packet->info.d_struct.txb = NULL; 2888 packet->info.d_struct.txb = NULL;
2889 2889
2890 list_add_tail(element, &priv->tx_free_list); 2890 list_add_tail(element, &priv->tx_free_list);
@@ -3028,7 +3028,7 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
3028 int next = txq->next; 3028 int next = txq->next;
3029 int i = 0; 3029 int i = 0;
3030 struct ipw2100_data_header *ipw_hdr; 3030 struct ipw2100_data_header *ipw_hdr;
3031 struct ieee80211_hdr_3addr *hdr; 3031 struct libipw_hdr_3addr *hdr;
3032 3032
3033 while (!list_empty(&priv->tx_pend_list)) { 3033 while (!list_empty(&priv->tx_pend_list)) {
3034 /* if there isn't enough space in TBD queue, then 3034 /* if there isn't enough space in TBD queue, then
@@ -3062,7 +3062,7 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
3062 packet->index = txq->next; 3062 packet->index = txq->next;
3063 3063
3064 ipw_hdr = packet->info.d_struct.data; 3064 ipw_hdr = packet->info.d_struct.data;
3065 hdr = (struct ieee80211_hdr_3addr *)packet->info.d_struct.txb-> 3065 hdr = (struct libipw_hdr_3addr *)packet->info.d_struct.txb->
3066 fragments[0]->data; 3066 fragments[0]->data;
3067 3067
3068 if (priv->ieee->iw_mode == IW_MODE_INFRA) { 3068 if (priv->ieee->iw_mode == IW_MODE_INFRA) {
@@ -3086,7 +3086,7 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
3086 if (packet->info.d_struct.txb->nr_frags > 1) 3086 if (packet->info.d_struct.txb->nr_frags > 1)
3087 ipw_hdr->fragment_size = 3087 ipw_hdr->fragment_size =
3088 packet->info.d_struct.txb->frag_size - 3088 packet->info.d_struct.txb->frag_size -
3089 IEEE80211_3ADDR_LEN; 3089 LIBIPW_3ADDR_LEN;
3090 else 3090 else
3091 ipw_hdr->fragment_size = 0; 3091 ipw_hdr->fragment_size = 0;
3092 3092
@@ -3119,13 +3119,13 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
3119 IPW_BD_STATUS_TX_FRAME_NOT_LAST_FRAGMENT; 3119 IPW_BD_STATUS_TX_FRAME_NOT_LAST_FRAGMENT;
3120 3120
3121 tbd->buf_length = packet->info.d_struct.txb-> 3121 tbd->buf_length = packet->info.d_struct.txb->
3122 fragments[i]->len - IEEE80211_3ADDR_LEN; 3122 fragments[i]->len - LIBIPW_3ADDR_LEN;
3123 3123
3124 tbd->host_addr = pci_map_single(priv->pci_dev, 3124 tbd->host_addr = pci_map_single(priv->pci_dev,
3125 packet->info.d_struct. 3125 packet->info.d_struct.
3126 txb->fragments[i]-> 3126 txb->fragments[i]->
3127 data + 3127 data +
3128 IEEE80211_3ADDR_LEN, 3128 LIBIPW_3ADDR_LEN,
3129 tbd->buf_length, 3129 tbd->buf_length,
3130 PCI_DMA_TODEVICE); 3130 PCI_DMA_TODEVICE);
3131 3131
@@ -3330,10 +3330,10 @@ static irqreturn_t ipw2100_interrupt(int irq, void *data)
3330 return IRQ_NONE; 3330 return IRQ_NONE;
3331} 3331}
3332 3332
3333static int ipw2100_tx(struct ieee80211_txb *txb, struct net_device *dev, 3333static int ipw2100_tx(struct libipw_txb *txb, struct net_device *dev,
3334 int pri) 3334 int pri)
3335{ 3335{
3336 struct ipw2100_priv *priv = ieee80211_priv(dev); 3336 struct ipw2100_priv *priv = libipw_priv(dev);
3337 struct list_head *element; 3337 struct list_head *element;
3338 struct ipw2100_tx_packet *packet; 3338 struct ipw2100_tx_packet *packet;
3339 unsigned long flags; 3339 unsigned long flags;
@@ -4488,7 +4488,7 @@ static void ipw2100_tx_initialize(struct ipw2100_priv *priv)
4488 /* We simply drop any SKBs that have been queued for 4488 /* We simply drop any SKBs that have been queued for
4489 * transmit */ 4489 * transmit */
4490 if (priv->tx_buffers[i].info.d_struct.txb) { 4490 if (priv->tx_buffers[i].info.d_struct.txb) {
4491 ieee80211_txb_free(priv->tx_buffers[i].info.d_struct. 4491 libipw_txb_free(priv->tx_buffers[i].info.d_struct.
4492 txb); 4492 txb);
4493 priv->tx_buffers[i].info.d_struct.txb = NULL; 4493 priv->tx_buffers[i].info.d_struct.txb = NULL;
4494 } 4494 }
@@ -4527,7 +4527,7 @@ static void ipw2100_tx_free(struct ipw2100_priv *priv)
4527 4527
4528 for (i = 0; i < TX_PENDED_QUEUE_LENGTH; i++) { 4528 for (i = 0; i < TX_PENDED_QUEUE_LENGTH; i++) {
4529 if (priv->tx_buffers[i].info.d_struct.txb) { 4529 if (priv->tx_buffers[i].info.d_struct.txb) {
4530 ieee80211_txb_free(priv->tx_buffers[i].info.d_struct. 4530 libipw_txb_free(priv->tx_buffers[i].info.d_struct.
4531 txb); 4531 txb);
4532 priv->tx_buffers[i].info.d_struct.txb = NULL; 4532 priv->tx_buffers[i].info.d_struct.txb = NULL;
4533 } 4533 }
@@ -5558,9 +5558,9 @@ static void ipw2100_security_work(struct work_struct *work)
5558} 5558}
5559 5559
5560static void shim__set_security(struct net_device *dev, 5560static void shim__set_security(struct net_device *dev,
5561 struct ieee80211_security *sec) 5561 struct libipw_security *sec)
5562{ 5562{
5563 struct ipw2100_priv *priv = ieee80211_priv(dev); 5563 struct ipw2100_priv *priv = libipw_priv(dev);
5564 int i, force_update = 0; 5564 int i, force_update = 0;
5565 5565
5566 mutex_lock(&priv->action_mutex); 5566 mutex_lock(&priv->action_mutex);
@@ -5753,7 +5753,7 @@ static int ipw2100_adapter_setup(struct ipw2100_priv *priv)
5753 * method as well) to talk to the firmware */ 5753 * method as well) to talk to the firmware */
5754static int ipw2100_set_address(struct net_device *dev, void *p) 5754static int ipw2100_set_address(struct net_device *dev, void *p)
5755{ 5755{
5756 struct ipw2100_priv *priv = ieee80211_priv(dev); 5756 struct ipw2100_priv *priv = libipw_priv(dev);
5757 struct sockaddr *addr = p; 5757 struct sockaddr *addr = p;
5758 int err = 0; 5758 int err = 0;
5759 5759
@@ -5781,7 +5781,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
5781 5781
5782static int ipw2100_open(struct net_device *dev) 5782static int ipw2100_open(struct net_device *dev)
5783{ 5783{
5784 struct ipw2100_priv *priv = ieee80211_priv(dev); 5784 struct ipw2100_priv *priv = libipw_priv(dev);
5785 unsigned long flags; 5785 unsigned long flags;
5786 IPW_DEBUG_INFO("dev->open\n"); 5786 IPW_DEBUG_INFO("dev->open\n");
5787 5787
@@ -5797,7 +5797,7 @@ static int ipw2100_open(struct net_device *dev)
5797 5797
5798static int ipw2100_close(struct net_device *dev) 5798static int ipw2100_close(struct net_device *dev)
5799{ 5799{
5800 struct ipw2100_priv *priv = ieee80211_priv(dev); 5800 struct ipw2100_priv *priv = libipw_priv(dev);
5801 unsigned long flags; 5801 unsigned long flags;
5802 struct list_head *element; 5802 struct list_head *element;
5803 struct ipw2100_tx_packet *packet; 5803 struct ipw2100_tx_packet *packet;
@@ -5818,7 +5818,7 @@ static int ipw2100_close(struct net_device *dev)
5818 list_del(element); 5818 list_del(element);
5819 DEC_STAT(&priv->tx_pend_stat); 5819 DEC_STAT(&priv->tx_pend_stat);
5820 5820
5821 ieee80211_txb_free(packet->info.d_struct.txb); 5821 libipw_txb_free(packet->info.d_struct.txb);
5822 packet->info.d_struct.txb = NULL; 5822 packet->info.d_struct.txb = NULL;
5823 5823
5824 list_add_tail(element, &priv->tx_free_list); 5824 list_add_tail(element, &priv->tx_free_list);
@@ -5836,7 +5836,7 @@ static int ipw2100_close(struct net_device *dev)
5836 */ 5836 */
5837static void ipw2100_tx_timeout(struct net_device *dev) 5837static void ipw2100_tx_timeout(struct net_device *dev)
5838{ 5838{
5839 struct ipw2100_priv *priv = ieee80211_priv(dev); 5839 struct ipw2100_priv *priv = libipw_priv(dev);
5840 5840
5841 dev->stats.tx_errors++; 5841 dev->stats.tx_errors++;
5842 5842
@@ -5861,8 +5861,8 @@ static int ipw2100_wpa_enable(struct ipw2100_priv *priv, int value)
5861static int ipw2100_wpa_set_auth_algs(struct ipw2100_priv *priv, int value) 5861static int ipw2100_wpa_set_auth_algs(struct ipw2100_priv *priv, int value)
5862{ 5862{
5863 5863
5864 struct ieee80211_device *ieee = priv->ieee; 5864 struct libipw_device *ieee = priv->ieee;
5865 struct ieee80211_security sec = { 5865 struct libipw_security sec = {
5866 .flags = SEC_AUTH_MODE, 5866 .flags = SEC_AUTH_MODE,
5867 }; 5867 };
5868 int ret = 0; 5868 int ret = 0;
@@ -5907,7 +5907,7 @@ static void ipw2100_wpa_assoc_frame(struct ipw2100_priv *priv,
5907static void ipw_ethtool_get_drvinfo(struct net_device *dev, 5907static void ipw_ethtool_get_drvinfo(struct net_device *dev,
5908 struct ethtool_drvinfo *info) 5908 struct ethtool_drvinfo *info)
5909{ 5909{
5910 struct ipw2100_priv *priv = ieee80211_priv(dev); 5910 struct ipw2100_priv *priv = libipw_priv(dev);
5911 char fw_ver[64], ucode_ver[64]; 5911 char fw_ver[64], ucode_ver[64];
5912 5912
5913 strcpy(info->driver, DRV_NAME); 5913 strcpy(info->driver, DRV_NAME);
@@ -5924,7 +5924,7 @@ static void ipw_ethtool_get_drvinfo(struct net_device *dev,
5924 5924
5925static u32 ipw2100_ethtool_get_link(struct net_device *dev) 5925static u32 ipw2100_ethtool_get_link(struct net_device *dev)
5926{ 5926{
5927 struct ipw2100_priv *priv = ieee80211_priv(dev); 5927 struct ipw2100_priv *priv = libipw_priv(dev);
5928 return (priv->status & STATUS_ASSOCIATED) ? 1 : 0; 5928 return (priv->status & STATUS_ASSOCIATED) ? 1 : 0;
5929} 5929}
5930 5930
@@ -6011,8 +6011,8 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv);
6011static const struct net_device_ops ipw2100_netdev_ops = { 6011static const struct net_device_ops ipw2100_netdev_ops = {
6012 .ndo_open = ipw2100_open, 6012 .ndo_open = ipw2100_open,
6013 .ndo_stop = ipw2100_close, 6013 .ndo_stop = ipw2100_close,
6014 .ndo_start_xmit = ieee80211_xmit, 6014 .ndo_start_xmit = libipw_xmit,
6015 .ndo_change_mtu = ieee80211_change_mtu, 6015 .ndo_change_mtu = libipw_change_mtu,
6016 .ndo_init = ipw2100_net_init, 6016 .ndo_init = ipw2100_net_init,
6017 .ndo_tx_timeout = ipw2100_tx_timeout, 6017 .ndo_tx_timeout = ipw2100_tx_timeout,
6018 .ndo_set_mac_address = ipw2100_set_address, 6018 .ndo_set_mac_address = ipw2100_set_address,
@@ -6032,7 +6032,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6032 dev = alloc_ieee80211(sizeof(struct ipw2100_priv)); 6032 dev = alloc_ieee80211(sizeof(struct ipw2100_priv));
6033 if (!dev) 6033 if (!dev)
6034 return NULL; 6034 return NULL;
6035 priv = ieee80211_priv(dev); 6035 priv = libipw_priv(dev);
6036 priv->ieee = netdev_priv(dev); 6036 priv->ieee = netdev_priv(dev);
6037 priv->pci_dev = pci_dev; 6037 priv->pci_dev = pci_dev;
6038 priv->net_dev = dev; 6038 priv->net_dev = dev;
@@ -6046,7 +6046,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
6046 dev->netdev_ops = &ipw2100_netdev_ops; 6046 dev->netdev_ops = &ipw2100_netdev_ops;
6047 dev->ethtool_ops = &ipw2100_ethtool_ops; 6047 dev->ethtool_ops = &ipw2100_ethtool_ops;
6048 dev->wireless_handlers = &ipw2100_wx_handler_def; 6048 dev->wireless_handlers = &ipw2100_wx_handler_def;
6049 priv->wireless_data.ieee80211 = priv->ieee; 6049 priv->wireless_data.libipw = priv->ieee;
6050 dev->wireless_data = &priv->wireless_data; 6050 dev->wireless_data = &priv->wireless_data;
6051 dev->watchdog_timeo = 3 * HZ; 6051 dev->watchdog_timeo = 3 * HZ;
6052 dev->irq = 0; 6052 dev->irq = 0;
@@ -6202,7 +6202,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
6202 return err; 6202 return err;
6203 } 6203 }
6204 6204
6205 priv = ieee80211_priv(dev); 6205 priv = libipw_priv(dev);
6206 6206
6207 pci_set_master(pci_dev); 6207 pci_set_master(pci_dev);
6208 pci_set_drvdata(pci_dev, priv); 6208 pci_set_drvdata(pci_dev, priv);
@@ -6629,7 +6629,7 @@ static int ipw2100_wx_get_name(struct net_device *dev,
6629 * This can be called at any time. No action lock required 6629 * This can be called at any time. No action lock required
6630 */ 6630 */
6631 6631
6632 struct ipw2100_priv *priv = ieee80211_priv(dev); 6632 struct ipw2100_priv *priv = libipw_priv(dev);
6633 if (!(priv->status & STATUS_ASSOCIATED)) 6633 if (!(priv->status & STATUS_ASSOCIATED))
6634 strcpy(wrqu->name, "unassociated"); 6634 strcpy(wrqu->name, "unassociated");
6635 else 6635 else
@@ -6643,7 +6643,7 @@ static int ipw2100_wx_set_freq(struct net_device *dev,
6643 struct iw_request_info *info, 6643 struct iw_request_info *info,
6644 union iwreq_data *wrqu, char *extra) 6644 union iwreq_data *wrqu, char *extra)
6645{ 6645{
6646 struct ipw2100_priv *priv = ieee80211_priv(dev); 6646 struct ipw2100_priv *priv = libipw_priv(dev);
6647 struct iw_freq *fwrq = &wrqu->freq; 6647 struct iw_freq *fwrq = &wrqu->freq;
6648 int err = 0; 6648 int err = 0;
6649 6649
@@ -6693,7 +6693,7 @@ static int ipw2100_wx_get_freq(struct net_device *dev,
6693 * This can be called at any time. No action lock required 6693 * This can be called at any time. No action lock required
6694 */ 6694 */
6695 6695
6696 struct ipw2100_priv *priv = ieee80211_priv(dev); 6696 struct ipw2100_priv *priv = libipw_priv(dev);
6697 6697
6698 wrqu->freq.e = 0; 6698 wrqu->freq.e = 0;
6699 6699
@@ -6714,7 +6714,7 @@ static int ipw2100_wx_set_mode(struct net_device *dev,
6714 struct iw_request_info *info, 6714 struct iw_request_info *info,
6715 union iwreq_data *wrqu, char *extra) 6715 union iwreq_data *wrqu, char *extra)
6716{ 6716{
6717 struct ipw2100_priv *priv = ieee80211_priv(dev); 6717 struct ipw2100_priv *priv = libipw_priv(dev);
6718 int err = 0; 6718 int err = 0;
6719 6719
6720 IPW_DEBUG_WX("SET Mode -> %d \n", wrqu->mode); 6720 IPW_DEBUG_WX("SET Mode -> %d \n", wrqu->mode);
@@ -6757,7 +6757,7 @@ static int ipw2100_wx_get_mode(struct net_device *dev,
6757 * This can be called at any time. No action lock required 6757 * This can be called at any time. No action lock required
6758 */ 6758 */
6759 6759
6760 struct ipw2100_priv *priv = ieee80211_priv(dev); 6760 struct ipw2100_priv *priv = libipw_priv(dev);
6761 6761
6762 wrqu->mode = priv->ieee->iw_mode; 6762 wrqu->mode = priv->ieee->iw_mode;
6763 IPW_DEBUG_WX("GET Mode -> %d\n", wrqu->mode); 6763 IPW_DEBUG_WX("GET Mode -> %d\n", wrqu->mode);
@@ -6792,7 +6792,7 @@ static int ipw2100_wx_get_range(struct net_device *dev,
6792 * This can be called at any time. No action lock required 6792 * This can be called at any time. No action lock required
6793 */ 6793 */
6794 6794
6795 struct ipw2100_priv *priv = ieee80211_priv(dev); 6795 struct ipw2100_priv *priv = libipw_priv(dev);
6796 struct iw_range *range = (struct iw_range *)extra; 6796 struct iw_range *range = (struct iw_range *)extra;
6797 u16 val; 6797 u16 val;
6798 int i, level; 6798 int i, level;
@@ -6913,7 +6913,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6913 struct iw_request_info *info, 6913 struct iw_request_info *info,
6914 union iwreq_data *wrqu, char *extra) 6914 union iwreq_data *wrqu, char *extra)
6915{ 6915{
6916 struct ipw2100_priv *priv = ieee80211_priv(dev); 6916 struct ipw2100_priv *priv = libipw_priv(dev);
6917 int err = 0; 6917 int err = 0;
6918 6918
6919 static const unsigned char any[] = { 6919 static const unsigned char any[] = {
@@ -6962,7 +6962,7 @@ static int ipw2100_wx_get_wap(struct net_device *dev,
6962 * This can be called at any time. No action lock required 6962 * This can be called at any time. No action lock required
6963 */ 6963 */
6964 6964
6965 struct ipw2100_priv *priv = ieee80211_priv(dev); 6965 struct ipw2100_priv *priv = libipw_priv(dev);
6966 6966
6967 /* If we are associated, trying to associate, or have a statically 6967 /* If we are associated, trying to associate, or have a statically
6968 * configured BSSID then return that; otherwise return ANY */ 6968 * configured BSSID then return that; otherwise return ANY */
@@ -6980,7 +6980,7 @@ static int ipw2100_wx_set_essid(struct net_device *dev,
6980 struct iw_request_info *info, 6980 struct iw_request_info *info,
6981 union iwreq_data *wrqu, char *extra) 6981 union iwreq_data *wrqu, char *extra)
6982{ 6982{
6983 struct ipw2100_priv *priv = ieee80211_priv(dev); 6983 struct ipw2100_priv *priv = libipw_priv(dev);
6984 char *essid = ""; /* ANY */ 6984 char *essid = ""; /* ANY */
6985 int length = 0; 6985 int length = 0;
6986 int err = 0; 6986 int err = 0;
@@ -7035,7 +7035,7 @@ static int ipw2100_wx_get_essid(struct net_device *dev,
7035 * This can be called at any time. No action lock required 7035 * This can be called at any time. No action lock required
7036 */ 7036 */
7037 7037
7038 struct ipw2100_priv *priv = ieee80211_priv(dev); 7038 struct ipw2100_priv *priv = libipw_priv(dev);
7039 DECLARE_SSID_BUF(ssid); 7039 DECLARE_SSID_BUF(ssid);
7040 7040
7041 /* If we are associated, trying to associate, or have a statically 7041 /* If we are associated, trying to associate, or have a statically
@@ -7063,7 +7063,7 @@ static int ipw2100_wx_set_nick(struct net_device *dev,
7063 * This can be called at any time. No action lock required 7063 * This can be called at any time. No action lock required
7064 */ 7064 */
7065 7065
7066 struct ipw2100_priv *priv = ieee80211_priv(dev); 7066 struct ipw2100_priv *priv = libipw_priv(dev);
7067 7067
7068 if (wrqu->data.length > IW_ESSID_MAX_SIZE) 7068 if (wrqu->data.length > IW_ESSID_MAX_SIZE)
7069 return -E2BIG; 7069 return -E2BIG;
@@ -7085,7 +7085,7 @@ static int ipw2100_wx_get_nick(struct net_device *dev,
7085 * This can be called at any time. No action lock required 7085 * This can be called at any time. No action lock required
7086 */ 7086 */
7087 7087
7088 struct ipw2100_priv *priv = ieee80211_priv(dev); 7088 struct ipw2100_priv *priv = libipw_priv(dev);
7089 7089
7090 wrqu->data.length = strlen(priv->nick); 7090 wrqu->data.length = strlen(priv->nick);
7091 memcpy(extra, priv->nick, wrqu->data.length); 7091 memcpy(extra, priv->nick, wrqu->data.length);
@@ -7100,7 +7100,7 @@ static int ipw2100_wx_set_rate(struct net_device *dev,
7100 struct iw_request_info *info, 7100 struct iw_request_info *info,
7101 union iwreq_data *wrqu, char *extra) 7101 union iwreq_data *wrqu, char *extra)
7102{ 7102{
7103 struct ipw2100_priv *priv = ieee80211_priv(dev); 7103 struct ipw2100_priv *priv = libipw_priv(dev);
7104 u32 target_rate = wrqu->bitrate.value; 7104 u32 target_rate = wrqu->bitrate.value;
7105 u32 rate; 7105 u32 rate;
7106 int err = 0; 7106 int err = 0;
@@ -7140,7 +7140,7 @@ static int ipw2100_wx_get_rate(struct net_device *dev,
7140 struct iw_request_info *info, 7140 struct iw_request_info *info,
7141 union iwreq_data *wrqu, char *extra) 7141 union iwreq_data *wrqu, char *extra)
7142{ 7142{
7143 struct ipw2100_priv *priv = ieee80211_priv(dev); 7143 struct ipw2100_priv *priv = libipw_priv(dev);
7144 int val; 7144 int val;
7145 unsigned int len = sizeof(val); 7145 unsigned int len = sizeof(val);
7146 int err = 0; 7146 int err = 0;
@@ -7192,7 +7192,7 @@ static int ipw2100_wx_set_rts(struct net_device *dev,
7192 struct iw_request_info *info, 7192 struct iw_request_info *info,
7193 union iwreq_data *wrqu, char *extra) 7193 union iwreq_data *wrqu, char *extra)
7194{ 7194{
7195 struct ipw2100_priv *priv = ieee80211_priv(dev); 7195 struct ipw2100_priv *priv = libipw_priv(dev);
7196 int value, err; 7196 int value, err;
7197 7197
7198 /* Auto RTS not yet supported */ 7198 /* Auto RTS not yet supported */
@@ -7231,7 +7231,7 @@ static int ipw2100_wx_get_rts(struct net_device *dev,
7231 * This can be called at any time. No action lock required 7231 * This can be called at any time. No action lock required
7232 */ 7232 */
7233 7233
7234 struct ipw2100_priv *priv = ieee80211_priv(dev); 7234 struct ipw2100_priv *priv = libipw_priv(dev);
7235 7235
7236 wrqu->rts.value = priv->rts_threshold & ~RTS_DISABLED; 7236 wrqu->rts.value = priv->rts_threshold & ~RTS_DISABLED;
7237 wrqu->rts.fixed = 1; /* no auto select */ 7237 wrqu->rts.fixed = 1; /* no auto select */
@@ -7248,7 +7248,7 @@ static int ipw2100_wx_set_txpow(struct net_device *dev,
7248 struct iw_request_info *info, 7248 struct iw_request_info *info,
7249 union iwreq_data *wrqu, char *extra) 7249 union iwreq_data *wrqu, char *extra)
7250{ 7250{
7251 struct ipw2100_priv *priv = ieee80211_priv(dev); 7251 struct ipw2100_priv *priv = libipw_priv(dev);
7252 int err = 0, value; 7252 int err = 0, value;
7253 7253
7254 if (ipw_radio_kill_sw(priv, wrqu->txpower.disabled)) 7254 if (ipw_radio_kill_sw(priv, wrqu->txpower.disabled))
@@ -7293,7 +7293,7 @@ static int ipw2100_wx_get_txpow(struct net_device *dev,
7293 * This can be called at any time. No action lock required 7293 * This can be called at any time. No action lock required
7294 */ 7294 */
7295 7295
7296 struct ipw2100_priv *priv = ieee80211_priv(dev); 7296 struct ipw2100_priv *priv = libipw_priv(dev);
7297 7297
7298 wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0; 7298 wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0;
7299 7299
@@ -7320,7 +7320,7 @@ static int ipw2100_wx_set_frag(struct net_device *dev,
7320 * This can be called at any time. No action lock required 7320 * This can be called at any time. No action lock required
7321 */ 7321 */
7322 7322
7323 struct ipw2100_priv *priv = ieee80211_priv(dev); 7323 struct ipw2100_priv *priv = libipw_priv(dev);
7324 7324
7325 if (!wrqu->frag.fixed) 7325 if (!wrqu->frag.fixed)
7326 return -EINVAL; 7326 return -EINVAL;
@@ -7350,7 +7350,7 @@ static int ipw2100_wx_get_frag(struct net_device *dev,
7350 * This can be called at any time. No action lock required 7350 * This can be called at any time. No action lock required
7351 */ 7351 */
7352 7352
7353 struct ipw2100_priv *priv = ieee80211_priv(dev); 7353 struct ipw2100_priv *priv = libipw_priv(dev);
7354 wrqu->frag.value = priv->frag_threshold & ~FRAG_DISABLED; 7354 wrqu->frag.value = priv->frag_threshold & ~FRAG_DISABLED;
7355 wrqu->frag.fixed = 0; /* no auto select */ 7355 wrqu->frag.fixed = 0; /* no auto select */
7356 wrqu->frag.disabled = (priv->frag_threshold & FRAG_DISABLED) ? 1 : 0; 7356 wrqu->frag.disabled = (priv->frag_threshold & FRAG_DISABLED) ? 1 : 0;
@@ -7364,7 +7364,7 @@ static int ipw2100_wx_set_retry(struct net_device *dev,
7364 struct iw_request_info *info, 7364 struct iw_request_info *info,
7365 union iwreq_data *wrqu, char *extra) 7365 union iwreq_data *wrqu, char *extra)
7366{ 7366{
7367 struct ipw2100_priv *priv = ieee80211_priv(dev); 7367 struct ipw2100_priv *priv = libipw_priv(dev);
7368 int err = 0; 7368 int err = 0;
7369 7369
7370 if (wrqu->retry.flags & IW_RETRY_LIFETIME || wrqu->retry.disabled) 7370 if (wrqu->retry.flags & IW_RETRY_LIFETIME || wrqu->retry.disabled)
@@ -7412,7 +7412,7 @@ static int ipw2100_wx_get_retry(struct net_device *dev,
7412 * This can be called at any time. No action lock required 7412 * This can be called at any time. No action lock required
7413 */ 7413 */
7414 7414
7415 struct ipw2100_priv *priv = ieee80211_priv(dev); 7415 struct ipw2100_priv *priv = libipw_priv(dev);
7416 7416
7417 wrqu->retry.disabled = 0; /* can't be disabled */ 7417 wrqu->retry.disabled = 0; /* can't be disabled */
7418 7418
@@ -7440,7 +7440,7 @@ static int ipw2100_wx_set_scan(struct net_device *dev,
7440 struct iw_request_info *info, 7440 struct iw_request_info *info,
7441 union iwreq_data *wrqu, char *extra) 7441 union iwreq_data *wrqu, char *extra)
7442{ 7442{
7443 struct ipw2100_priv *priv = ieee80211_priv(dev); 7443 struct ipw2100_priv *priv = libipw_priv(dev);
7444 int err = 0; 7444 int err = 0;
7445 7445
7446 mutex_lock(&priv->action_mutex); 7446 mutex_lock(&priv->action_mutex);
@@ -7472,8 +7472,8 @@ static int ipw2100_wx_get_scan(struct net_device *dev,
7472 * This can be called at any time. No action lock required 7472 * This can be called at any time. No action lock required
7473 */ 7473 */
7474 7474
7475 struct ipw2100_priv *priv = ieee80211_priv(dev); 7475 struct ipw2100_priv *priv = libipw_priv(dev);
7476 return ieee80211_wx_get_scan(priv->ieee, info, wrqu, extra); 7476 return libipw_wx_get_scan(priv->ieee, info, wrqu, extra);
7477} 7477}
7478 7478
7479/* 7479/*
@@ -7487,8 +7487,8 @@ static int ipw2100_wx_set_encode(struct net_device *dev,
7487 * No check of STATUS_INITIALIZED required 7487 * No check of STATUS_INITIALIZED required
7488 */ 7488 */
7489 7489
7490 struct ipw2100_priv *priv = ieee80211_priv(dev); 7490 struct ipw2100_priv *priv = libipw_priv(dev);
7491 return ieee80211_wx_set_encode(priv->ieee, info, wrqu, key); 7491 return libipw_wx_set_encode(priv->ieee, info, wrqu, key);
7492} 7492}
7493 7493
7494static int ipw2100_wx_get_encode(struct net_device *dev, 7494static int ipw2100_wx_get_encode(struct net_device *dev,
@@ -7499,15 +7499,15 @@ static int ipw2100_wx_get_encode(struct net_device *dev,
7499 * This can be called at any time. No action lock required 7499 * This can be called at any time. No action lock required
7500 */ 7500 */
7501 7501
7502 struct ipw2100_priv *priv = ieee80211_priv(dev); 7502 struct ipw2100_priv *priv = libipw_priv(dev);
7503 return ieee80211_wx_get_encode(priv->ieee, info, wrqu, key); 7503 return libipw_wx_get_encode(priv->ieee, info, wrqu, key);
7504} 7504}
7505 7505
7506static int ipw2100_wx_set_power(struct net_device *dev, 7506static int ipw2100_wx_set_power(struct net_device *dev,
7507 struct iw_request_info *info, 7507 struct iw_request_info *info,
7508 union iwreq_data *wrqu, char *extra) 7508 union iwreq_data *wrqu, char *extra)
7509{ 7509{
7510 struct ipw2100_priv *priv = ieee80211_priv(dev); 7510 struct ipw2100_priv *priv = libipw_priv(dev);
7511 int err = 0; 7511 int err = 0;
7512 7512
7513 mutex_lock(&priv->action_mutex); 7513 mutex_lock(&priv->action_mutex);
@@ -7556,7 +7556,7 @@ static int ipw2100_wx_get_power(struct net_device *dev,
7556 * This can be called at any time. No action lock required 7556 * This can be called at any time. No action lock required
7557 */ 7557 */
7558 7558
7559 struct ipw2100_priv *priv = ieee80211_priv(dev); 7559 struct ipw2100_priv *priv = libipw_priv(dev);
7560 7560
7561 if (!(priv->power_mode & IPW_POWER_ENABLED)) 7561 if (!(priv->power_mode & IPW_POWER_ENABLED))
7562 wrqu->power.disabled = 1; 7562 wrqu->power.disabled = 1;
@@ -7580,8 +7580,8 @@ static int ipw2100_wx_set_genie(struct net_device *dev,
7580 union iwreq_data *wrqu, char *extra) 7580 union iwreq_data *wrqu, char *extra)
7581{ 7581{
7582 7582
7583 struct ipw2100_priv *priv = ieee80211_priv(dev); 7583 struct ipw2100_priv *priv = libipw_priv(dev);
7584 struct ieee80211_device *ieee = priv->ieee; 7584 struct libipw_device *ieee = priv->ieee;
7585 u8 *buf; 7585 u8 *buf;
7586 7586
7587 if (!ieee->wpa_enabled) 7587 if (!ieee->wpa_enabled)
@@ -7615,8 +7615,8 @@ static int ipw2100_wx_get_genie(struct net_device *dev,
7615 struct iw_request_info *info, 7615 struct iw_request_info *info,
7616 union iwreq_data *wrqu, char *extra) 7616 union iwreq_data *wrqu, char *extra)
7617{ 7617{
7618 struct ipw2100_priv *priv = ieee80211_priv(dev); 7618 struct ipw2100_priv *priv = libipw_priv(dev);
7619 struct ieee80211_device *ieee = priv->ieee; 7619 struct libipw_device *ieee = priv->ieee;
7620 7620
7621 if (ieee->wpa_ie_len == 0 || ieee->wpa_ie == NULL) { 7621 if (ieee->wpa_ie_len == 0 || ieee->wpa_ie == NULL) {
7622 wrqu->data.length = 0; 7622 wrqu->data.length = 0;
@@ -7637,8 +7637,8 @@ static int ipw2100_wx_set_auth(struct net_device *dev,
7637 struct iw_request_info *info, 7637 struct iw_request_info *info,
7638 union iwreq_data *wrqu, char *extra) 7638 union iwreq_data *wrqu, char *extra)
7639{ 7639{
7640 struct ipw2100_priv *priv = ieee80211_priv(dev); 7640 struct ipw2100_priv *priv = libipw_priv(dev);
7641 struct ieee80211_device *ieee = priv->ieee; 7641 struct libipw_device *ieee = priv->ieee;
7642 struct iw_param *param = &wrqu->param; 7642 struct iw_param *param = &wrqu->param;
7643 struct lib80211_crypt_data *crypt; 7643 struct lib80211_crypt_data *crypt;
7644 unsigned long flags; 7644 unsigned long flags;
@@ -7682,7 +7682,7 @@ static int ipw2100_wx_set_auth(struct net_device *dev,
7682 * can use this to determine if the CAP_PRIVACY_ON bit should 7682 * can use this to determine if the CAP_PRIVACY_ON bit should
7683 * be set. 7683 * be set.
7684 */ 7684 */
7685 struct ieee80211_security sec = { 7685 struct libipw_security sec = {
7686 .flags = SEC_ENABLED, 7686 .flags = SEC_ENABLED,
7687 .enabled = param->value, 7687 .enabled = param->value,
7688 }; 7688 };
@@ -7730,8 +7730,8 @@ static int ipw2100_wx_get_auth(struct net_device *dev,
7730 struct iw_request_info *info, 7730 struct iw_request_info *info,
7731 union iwreq_data *wrqu, char *extra) 7731 union iwreq_data *wrqu, char *extra)
7732{ 7732{
7733 struct ipw2100_priv *priv = ieee80211_priv(dev); 7733 struct ipw2100_priv *priv = libipw_priv(dev);
7734 struct ieee80211_device *ieee = priv->ieee; 7734 struct libipw_device *ieee = priv->ieee;
7735 struct lib80211_crypt_data *crypt; 7735 struct lib80211_crypt_data *crypt;
7736 struct iw_param *param = &wrqu->param; 7736 struct iw_param *param = &wrqu->param;
7737 int ret = 0; 7737 int ret = 0;
@@ -7792,8 +7792,8 @@ static int ipw2100_wx_set_encodeext(struct net_device *dev,
7792 struct iw_request_info *info, 7792 struct iw_request_info *info,
7793 union iwreq_data *wrqu, char *extra) 7793 union iwreq_data *wrqu, char *extra)
7794{ 7794{
7795 struct ipw2100_priv *priv = ieee80211_priv(dev); 7795 struct ipw2100_priv *priv = libipw_priv(dev);
7796 return ieee80211_wx_set_encodeext(priv->ieee, info, wrqu, extra); 7796 return libipw_wx_set_encodeext(priv->ieee, info, wrqu, extra);
7797} 7797}
7798 7798
7799/* SIOCGIWENCODEEXT */ 7799/* SIOCGIWENCODEEXT */
@@ -7801,8 +7801,8 @@ static int ipw2100_wx_get_encodeext(struct net_device *dev,
7801 struct iw_request_info *info, 7801 struct iw_request_info *info,
7802 union iwreq_data *wrqu, char *extra) 7802 union iwreq_data *wrqu, char *extra)
7803{ 7803{
7804 struct ipw2100_priv *priv = ieee80211_priv(dev); 7804 struct ipw2100_priv *priv = libipw_priv(dev);
7805 return ieee80211_wx_get_encodeext(priv->ieee, info, wrqu, extra); 7805 return libipw_wx_get_encodeext(priv->ieee, info, wrqu, extra);
7806} 7806}
7807 7807
7808/* SIOCSIWMLME */ 7808/* SIOCSIWMLME */
@@ -7810,7 +7810,7 @@ static int ipw2100_wx_set_mlme(struct net_device *dev,
7810 struct iw_request_info *info, 7810 struct iw_request_info *info,
7811 union iwreq_data *wrqu, char *extra) 7811 union iwreq_data *wrqu, char *extra)
7812{ 7812{
7813 struct ipw2100_priv *priv = ieee80211_priv(dev); 7813 struct ipw2100_priv *priv = libipw_priv(dev);
7814 struct iw_mlme *mlme = (struct iw_mlme *)extra; 7814 struct iw_mlme *mlme = (struct iw_mlme *)extra;
7815 __le16 reason; 7815 __le16 reason;
7816 7816
@@ -7841,7 +7841,7 @@ static int ipw2100_wx_set_promisc(struct net_device *dev,
7841 struct iw_request_info *info, 7841 struct iw_request_info *info,
7842 union iwreq_data *wrqu, char *extra) 7842 union iwreq_data *wrqu, char *extra)
7843{ 7843{
7844 struct ipw2100_priv *priv = ieee80211_priv(dev); 7844 struct ipw2100_priv *priv = libipw_priv(dev);
7845 int *parms = (int *)extra; 7845 int *parms = (int *)extra;
7846 int enable = (parms[0] > 0); 7846 int enable = (parms[0] > 0);
7847 int err = 0; 7847 int err = 0;
@@ -7872,7 +7872,7 @@ static int ipw2100_wx_reset(struct net_device *dev,
7872 struct iw_request_info *info, 7872 struct iw_request_info *info,
7873 union iwreq_data *wrqu, char *extra) 7873 union iwreq_data *wrqu, char *extra)
7874{ 7874{
7875 struct ipw2100_priv *priv = ieee80211_priv(dev); 7875 struct ipw2100_priv *priv = libipw_priv(dev);
7876 if (priv->status & STATUS_INITIALIZED) 7876 if (priv->status & STATUS_INITIALIZED)
7877 schedule_reset(priv); 7877 schedule_reset(priv);
7878 return 0; 7878 return 0;
@@ -7884,7 +7884,7 @@ static int ipw2100_wx_set_powermode(struct net_device *dev,
7884 struct iw_request_info *info, 7884 struct iw_request_info *info,
7885 union iwreq_data *wrqu, char *extra) 7885 union iwreq_data *wrqu, char *extra)
7886{ 7886{
7887 struct ipw2100_priv *priv = ieee80211_priv(dev); 7887 struct ipw2100_priv *priv = libipw_priv(dev);
7888 int err = 0, mode = *(int *)extra; 7888 int err = 0, mode = *(int *)extra;
7889 7889
7890 mutex_lock(&priv->action_mutex); 7890 mutex_lock(&priv->action_mutex);
@@ -7912,7 +7912,7 @@ static int ipw2100_wx_get_powermode(struct net_device *dev,
7912 * This can be called at any time. No action lock required 7912 * This can be called at any time. No action lock required
7913 */ 7913 */
7914 7914
7915 struct ipw2100_priv *priv = ieee80211_priv(dev); 7915 struct ipw2100_priv *priv = libipw_priv(dev);
7916 int level = IPW_POWER_LEVEL(priv->power_mode); 7916 int level = IPW_POWER_LEVEL(priv->power_mode);
7917 s32 timeout, period; 7917 s32 timeout, period;
7918 7918
@@ -7948,7 +7948,7 @@ static int ipw2100_wx_set_preamble(struct net_device *dev,
7948 struct iw_request_info *info, 7948 struct iw_request_info *info,
7949 union iwreq_data *wrqu, char *extra) 7949 union iwreq_data *wrqu, char *extra)
7950{ 7950{
7951 struct ipw2100_priv *priv = ieee80211_priv(dev); 7951 struct ipw2100_priv *priv = libipw_priv(dev);
7952 int err, mode = *(int *)extra; 7952 int err, mode = *(int *)extra;
7953 7953
7954 mutex_lock(&priv->action_mutex); 7954 mutex_lock(&priv->action_mutex);
@@ -7981,7 +7981,7 @@ static int ipw2100_wx_get_preamble(struct net_device *dev,
7981 * This can be called at any time. No action lock required 7981 * This can be called at any time. No action lock required
7982 */ 7982 */
7983 7983
7984 struct ipw2100_priv *priv = ieee80211_priv(dev); 7984 struct ipw2100_priv *priv = libipw_priv(dev);
7985 7985
7986 if (priv->config & CFG_LONG_PREAMBLE) 7986 if (priv->config & CFG_LONG_PREAMBLE)
7987 snprintf(wrqu->name, IFNAMSIZ, "long (1)"); 7987 snprintf(wrqu->name, IFNAMSIZ, "long (1)");
@@ -7996,7 +7996,7 @@ static int ipw2100_wx_set_crc_check(struct net_device *dev,
7996 struct iw_request_info *info, 7996 struct iw_request_info *info,
7997 union iwreq_data *wrqu, char *extra) 7997 union iwreq_data *wrqu, char *extra)
7998{ 7998{
7999 struct ipw2100_priv *priv = ieee80211_priv(dev); 7999 struct ipw2100_priv *priv = libipw_priv(dev);
8000 int err, mode = *(int *)extra; 8000 int err, mode = *(int *)extra;
8001 8001
8002 mutex_lock(&priv->action_mutex); 8002 mutex_lock(&priv->action_mutex);
@@ -8028,7 +8028,7 @@ static int ipw2100_wx_get_crc_check(struct net_device *dev,
8028 * This can be called at any time. No action lock required 8028 * This can be called at any time. No action lock required
8029 */ 8029 */
8030 8030
8031 struct ipw2100_priv *priv = ieee80211_priv(dev); 8031 struct ipw2100_priv *priv = libipw_priv(dev);
8032 8032
8033 if (priv->config & CFG_CRC_CHECK) 8033 if (priv->config & CFG_CRC_CHECK)
8034 snprintf(wrqu->name, IFNAMSIZ, "CRC checked (1)"); 8034 snprintf(wrqu->name, IFNAMSIZ, "CRC checked (1)");
@@ -8181,7 +8181,7 @@ static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device *dev)
8181 int beacon_qual; 8181 int beacon_qual;
8182 int quality; 8182 int quality;
8183 8183
8184 struct ipw2100_priv *priv = ieee80211_priv(dev); 8184 struct ipw2100_priv *priv = libipw_priv(dev);
8185 struct iw_statistics *wstats; 8185 struct iw_statistics *wstats;
8186 u32 rssi, tx_retries, missed_beacons, tx_failures; 8186 u32 rssi, tx_retries, missed_beacons, tx_failures;
8187 u32 ord_len = sizeof(u32); 8187 u32 ord_len = sizeof(u32);
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.h b/drivers/net/wireless/ipw2x00/ipw2100.h
index f183d951cd32..af175bdc9f29 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.h
+++ b/drivers/net/wireless/ipw2x00/ipw2100.h
@@ -46,7 +46,7 @@
46#include <linux/workqueue.h> 46#include <linux/workqueue.h>
47#include <linux/mutex.h> 47#include <linux/mutex.h>
48 48
49#include "ieee80211.h" 49#include "libipw.h"
50 50
51struct ipw2100_priv; 51struct ipw2100_priv;
52struct ipw2100_tx_packet; 52struct ipw2100_tx_packet;
@@ -343,7 +343,7 @@ struct ipw2100_tx_packet {
343 struct { /* DATA */ 343 struct { /* DATA */
344 struct ipw2100_data_header *data; 344 struct ipw2100_data_header *data;
345 dma_addr_t data_phys; 345 dma_addr_t data_phys;
346 struct ieee80211_txb *txb; 346 struct libipw_txb *txb;
347 } d_struct; 347 } d_struct;
348 } info; 348 } info;
349 int jiffy_start; 349 int jiffy_start;
@@ -492,7 +492,7 @@ struct ipw2100_priv {
492 int stop_hang_check; /* Set 1 when shutting down to kill hang_check */ 492 int stop_hang_check; /* Set 1 when shutting down to kill hang_check */
493 int stop_rf_kill; /* Set 1 when shutting down to kill rf_kill */ 493 int stop_rf_kill; /* Set 1 when shutting down to kill rf_kill */
494 494
495 struct ieee80211_device *ieee; 495 struct libipw_device *ieee;
496 unsigned long status; 496 unsigned long status;
497 unsigned long config; 497 unsigned long config;
498 unsigned long capability; 498 unsigned long capability;
@@ -788,7 +788,7 @@ struct ipw2100_priv {
788#define IPW_CARD_DISABLE_PHY_OFF_COMPLETE_WAIT 100 // 100 milli 788#define IPW_CARD_DISABLE_PHY_OFF_COMPLETE_WAIT 100 // 100 milli
789#define IPW_PREPARE_POWER_DOWN_COMPLETE_WAIT 100 // 100 milli 789#define IPW_PREPARE_POWER_DOWN_COMPLETE_WAIT 100 // 100 milli
790 790
791#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_hdr_3addr) 791#define IPW_HEADER_802_11_SIZE sizeof(struct libipw_hdr_3addr)
792#define IPW_MAX_80211_PAYLOAD_SIZE 2304U 792#define IPW_MAX_80211_PAYLOAD_SIZE 2304U
793#define IPW_MAX_802_11_PAYLOAD_LENGTH 2312 793#define IPW_MAX_802_11_PAYLOAD_LENGTH 2312
794#define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536 794#define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536
@@ -803,13 +803,13 @@ struct ipw2100_priv {
803 IPW_802_11_FCS_LENGTH) 803 IPW_802_11_FCS_LENGTH)
804 804
805#define IPW_802_11_PAYLOAD_OFFSET \ 805#define IPW_802_11_PAYLOAD_OFFSET \
806 (sizeof(struct ieee80211_hdr_3addr) + \ 806 (sizeof(struct libipw_hdr_3addr) + \
807 sizeof(struct ieee80211_snap_hdr)) 807 sizeof(struct libipw_snap_hdr))
808 808
809struct ipw2100_rx { 809struct ipw2100_rx {
810 union { 810 union {
811 unsigned char payload[IPW_RX_NIC_BUFFER_LENGTH]; 811 unsigned char payload[IPW_RX_NIC_BUFFER_LENGTH];
812 struct ieee80211_hdr_4addr header; 812 struct libipw_hdr_4addr header;
813 u32 status; 813 u32 status;
814 struct ipw2100_notification notification; 814 struct ipw2100_notification notification;
815 struct ipw2100_cmd_header command; 815 struct ipw2100_cmd_header command;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 8e18d5348350..3617e3c1e9ed 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -111,7 +111,7 @@ static int qos_no_ack_mask = 0;
111static int burst_duration_CCK = 0; 111static int burst_duration_CCK = 0;
112static int burst_duration_OFDM = 0; 112static int burst_duration_OFDM = 0;
113 113
114static struct ieee80211_qos_parameters def_qos_parameters_OFDM = { 114static struct libipw_qos_parameters def_qos_parameters_OFDM = {
115 {QOS_TX0_CW_MIN_OFDM, QOS_TX1_CW_MIN_OFDM, QOS_TX2_CW_MIN_OFDM, 115 {QOS_TX0_CW_MIN_OFDM, QOS_TX1_CW_MIN_OFDM, QOS_TX2_CW_MIN_OFDM,
116 QOS_TX3_CW_MIN_OFDM}, 116 QOS_TX3_CW_MIN_OFDM},
117 {QOS_TX0_CW_MAX_OFDM, QOS_TX1_CW_MAX_OFDM, QOS_TX2_CW_MAX_OFDM, 117 {QOS_TX0_CW_MAX_OFDM, QOS_TX1_CW_MAX_OFDM, QOS_TX2_CW_MAX_OFDM,
@@ -122,7 +122,7 @@ static struct ieee80211_qos_parameters def_qos_parameters_OFDM = {
122 QOS_TX2_TXOP_LIMIT_OFDM, QOS_TX3_TXOP_LIMIT_OFDM} 122 QOS_TX2_TXOP_LIMIT_OFDM, QOS_TX3_TXOP_LIMIT_OFDM}
123}; 123};
124 124
125static struct ieee80211_qos_parameters def_qos_parameters_CCK = { 125static struct libipw_qos_parameters def_qos_parameters_CCK = {
126 {QOS_TX0_CW_MIN_CCK, QOS_TX1_CW_MIN_CCK, QOS_TX2_CW_MIN_CCK, 126 {QOS_TX0_CW_MIN_CCK, QOS_TX1_CW_MIN_CCK, QOS_TX2_CW_MIN_CCK,
127 QOS_TX3_CW_MIN_CCK}, 127 QOS_TX3_CW_MIN_CCK},
128 {QOS_TX0_CW_MAX_CCK, QOS_TX1_CW_MAX_CCK, QOS_TX2_CW_MAX_CCK, 128 {QOS_TX0_CW_MAX_CCK, QOS_TX1_CW_MAX_CCK, QOS_TX2_CW_MAX_CCK,
@@ -133,7 +133,7 @@ static struct ieee80211_qos_parameters def_qos_parameters_CCK = {
133 QOS_TX3_TXOP_LIMIT_CCK} 133 QOS_TX3_TXOP_LIMIT_CCK}
134}; 134};
135 135
136static struct ieee80211_qos_parameters def_parameters_OFDM = { 136static struct libipw_qos_parameters def_parameters_OFDM = {
137 {DEF_TX0_CW_MIN_OFDM, DEF_TX1_CW_MIN_OFDM, DEF_TX2_CW_MIN_OFDM, 137 {DEF_TX0_CW_MIN_OFDM, DEF_TX1_CW_MIN_OFDM, DEF_TX2_CW_MIN_OFDM,
138 DEF_TX3_CW_MIN_OFDM}, 138 DEF_TX3_CW_MIN_OFDM},
139 {DEF_TX0_CW_MAX_OFDM, DEF_TX1_CW_MAX_OFDM, DEF_TX2_CW_MAX_OFDM, 139 {DEF_TX0_CW_MAX_OFDM, DEF_TX1_CW_MAX_OFDM, DEF_TX2_CW_MAX_OFDM,
@@ -144,7 +144,7 @@ static struct ieee80211_qos_parameters def_parameters_OFDM = {
144 DEF_TX2_TXOP_LIMIT_OFDM, DEF_TX3_TXOP_LIMIT_OFDM} 144 DEF_TX2_TXOP_LIMIT_OFDM, DEF_TX3_TXOP_LIMIT_OFDM}
145}; 145};
146 146
147static struct ieee80211_qos_parameters def_parameters_CCK = { 147static struct libipw_qos_parameters def_parameters_CCK = {
148 {DEF_TX0_CW_MIN_CCK, DEF_TX1_CW_MIN_CCK, DEF_TX2_CW_MIN_CCK, 148 {DEF_TX0_CW_MIN_CCK, DEF_TX1_CW_MIN_CCK, DEF_TX2_CW_MIN_CCK,
149 DEF_TX3_CW_MIN_CCK}, 149 DEF_TX3_CW_MIN_CCK},
150 {DEF_TX0_CW_MAX_CCK, DEF_TX1_CW_MAX_CCK, DEF_TX2_CW_MAX_CCK, 150 {DEF_TX0_CW_MAX_CCK, DEF_TX1_CW_MAX_CCK, DEF_TX2_CW_MAX_CCK,
@@ -164,9 +164,9 @@ static int from_priority_to_tx_queue[] = {
164 164
165static u32 ipw_qos_get_burst_duration(struct ipw_priv *priv); 165static u32 ipw_qos_get_burst_duration(struct ipw_priv *priv);
166 166
167static int ipw_send_qos_params_command(struct ipw_priv *priv, struct ieee80211_qos_parameters 167static int ipw_send_qos_params_command(struct ipw_priv *priv, struct libipw_qos_parameters
168 *qos_param); 168 *qos_param);
169static int ipw_send_qos_info_command(struct ipw_priv *priv, struct ieee80211_qos_information_element 169static int ipw_send_qos_info_command(struct ipw_priv *priv, struct libipw_qos_information_element
170 *qos_param); 170 *qos_param);
171#endif /* CONFIG_IPW2200_QOS */ 171#endif /* CONFIG_IPW2200_QOS */
172 172
@@ -1830,7 +1830,7 @@ static ssize_t store_speed_scan(struct device *d, struct device_attribute *attr,
1830 break; 1830 break;
1831 } 1831 }
1832 1832
1833 if (ieee80211_is_valid_channel(priv->ieee, channel)) 1833 if (libipw_is_valid_channel(priv->ieee, channel))
1834 priv->speed_scan[pos++] = channel; 1834 priv->speed_scan[pos++] = channel;
1835 else 1835 else
1836 IPW_WARNING("Skipping invalid channel request: %d\n", 1836 IPW_WARNING("Skipping invalid channel request: %d\n",
@@ -1882,7 +1882,7 @@ static ssize_t show_channels(struct device *d,
1882 char *buf) 1882 char *buf)
1883{ 1883{
1884 struct ipw_priv *priv = dev_get_drvdata(d); 1884 struct ipw_priv *priv = dev_get_drvdata(d);
1885 const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); 1885 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
1886 int len = 0, i; 1886 int len = 0, i;
1887 1887
1888 len = sprintf(&buf[len], 1888 len = sprintf(&buf[len],
@@ -1892,14 +1892,14 @@ static ssize_t show_channels(struct device *d,
1892 for (i = 0; i < geo->bg_channels; i++) { 1892 for (i = 0; i < geo->bg_channels; i++) {
1893 len += sprintf(&buf[len], "%d: BSS%s%s, %s, Band %s.\n", 1893 len += sprintf(&buf[len], "%d: BSS%s%s, %s, Band %s.\n",
1894 geo->bg[i].channel, 1894 geo->bg[i].channel,
1895 geo->bg[i].flags & IEEE80211_CH_RADAR_DETECT ? 1895 geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT ?
1896 " (radar spectrum)" : "", 1896 " (radar spectrum)" : "",
1897 ((geo->bg[i].flags & IEEE80211_CH_NO_IBSS) || 1897 ((geo->bg[i].flags & LIBIPW_CH_NO_IBSS) ||
1898 (geo->bg[i].flags & IEEE80211_CH_RADAR_DETECT)) 1898 (geo->bg[i].flags & LIBIPW_CH_RADAR_DETECT))
1899 ? "" : ", IBSS", 1899 ? "" : ", IBSS",
1900 geo->bg[i].flags & IEEE80211_CH_PASSIVE_ONLY ? 1900 geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY ?
1901 "passive only" : "active/passive", 1901 "passive only" : "active/passive",
1902 geo->bg[i].flags & IEEE80211_CH_B_ONLY ? 1902 geo->bg[i].flags & LIBIPW_CH_B_ONLY ?
1903 "B" : "B/G"); 1903 "B" : "B/G");
1904 } 1904 }
1905 1905
@@ -1909,12 +1909,12 @@ static ssize_t show_channels(struct device *d,
1909 for (i = 0; i < geo->a_channels; i++) { 1909 for (i = 0; i < geo->a_channels; i++) {
1910 len += sprintf(&buf[len], "%d: BSS%s%s, %s.\n", 1910 len += sprintf(&buf[len], "%d: BSS%s%s, %s.\n",
1911 geo->a[i].channel, 1911 geo->a[i].channel,
1912 geo->a[i].flags & IEEE80211_CH_RADAR_DETECT ? 1912 geo->a[i].flags & LIBIPW_CH_RADAR_DETECT ?
1913 " (radar spectrum)" : "", 1913 " (radar spectrum)" : "",
1914 ((geo->a[i].flags & IEEE80211_CH_NO_IBSS) || 1914 ((geo->a[i].flags & LIBIPW_CH_NO_IBSS) ||
1915 (geo->a[i].flags & IEEE80211_CH_RADAR_DETECT)) 1915 (geo->a[i].flags & LIBIPW_CH_RADAR_DETECT))
1916 ? "" : ", IBSS", 1916 ? "" : ", IBSS",
1917 geo->a[i].flags & IEEE80211_CH_PASSIVE_ONLY ? 1917 geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY ?
1918 "passive only" : "active/passive"); 1918 "passive only" : "active/passive");
1919 } 1919 }
1920 1920
@@ -2429,7 +2429,7 @@ static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power)
2429 2429
2430static int ipw_set_tx_power(struct ipw_priv *priv) 2430static int ipw_set_tx_power(struct ipw_priv *priv)
2431{ 2431{
2432 const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); 2432 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
2433 struct ipw_tx_power tx_power; 2433 struct ipw_tx_power tx_power;
2434 s8 max_power; 2434 s8 max_power;
2435 int i; 2435 int i;
@@ -2960,12 +2960,12 @@ static int ipw_fw_dma_wait(struct ipw_priv *priv)
2960static void ipw_remove_current_network(struct ipw_priv *priv) 2960static void ipw_remove_current_network(struct ipw_priv *priv)
2961{ 2961{
2962 struct list_head *element, *safe; 2962 struct list_head *element, *safe;
2963 struct ieee80211_network *network = NULL; 2963 struct libipw_network *network = NULL;
2964 unsigned long flags; 2964 unsigned long flags;
2965 2965
2966 spin_lock_irqsave(&priv->ieee->lock, flags); 2966 spin_lock_irqsave(&priv->ieee->lock, flags);
2967 list_for_each_safe(element, safe, &priv->ieee->network_list) { 2967 list_for_each_safe(element, safe, &priv->ieee->network_list) {
2968 network = list_entry(element, struct ieee80211_network, list); 2968 network = list_entry(element, struct libipw_network, list);
2969 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 2969 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
2970 list_del(element); 2970 list_del(element);
2971 list_add_tail(&network->list, 2971 list_add_tail(&network->list,
@@ -3751,7 +3751,7 @@ static void ipw_queue_tx_free_tfd(struct ipw_priv *priv,
3751 le16_to_cpu(bd->u.data.chunk_len[i]), 3751 le16_to_cpu(bd->u.data.chunk_len[i]),
3752 PCI_DMA_TODEVICE); 3752 PCI_DMA_TODEVICE);
3753 if (txq->txb[txq->q.last_used]) { 3753 if (txq->txb[txq->q.last_used]) {
3754 ieee80211_txb_free(txq->txb[txq->q.last_used]); 3754 libipw_txb_free(txq->txb[txq->q.last_used]);
3755 txq->txb[txq->q.last_used] = NULL; 3755 txq->txb[txq->q.last_used] = NULL;
3756 } 3756 }
3757 } 3757 }
@@ -4070,7 +4070,7 @@ static u32 ipw_get_max_rate(struct ipw_priv *priv)
4070 /* If currently associated in B mode, restrict the maximum 4070 /* If currently associated in B mode, restrict the maximum
4071 * rate match to B rates */ 4071 * rate match to B rates */
4072 if (priv->assoc_request.ieee_mode == IPW_B_MODE) 4072 if (priv->assoc_request.ieee_mode == IPW_B_MODE)
4073 mask &= IEEE80211_CCK_RATES_MASK; 4073 mask &= LIBIPW_CCK_RATES_MASK;
4074 4074
4075 /* TODO: Verify that the rate is supported by the current rates 4075 /* TODO: Verify that the rate is supported by the current rates
4076 * list. */ 4076 * list. */
@@ -4078,29 +4078,29 @@ static u32 ipw_get_max_rate(struct ipw_priv *priv)
4078 while (i && !(mask & i)) 4078 while (i && !(mask & i))
4079 i >>= 1; 4079 i >>= 1;
4080 switch (i) { 4080 switch (i) {
4081 case IEEE80211_CCK_RATE_1MB_MASK: 4081 case LIBIPW_CCK_RATE_1MB_MASK:
4082 return 1000000; 4082 return 1000000;
4083 case IEEE80211_CCK_RATE_2MB_MASK: 4083 case LIBIPW_CCK_RATE_2MB_MASK:
4084 return 2000000; 4084 return 2000000;
4085 case IEEE80211_CCK_RATE_5MB_MASK: 4085 case LIBIPW_CCK_RATE_5MB_MASK:
4086 return 5500000; 4086 return 5500000;
4087 case IEEE80211_OFDM_RATE_6MB_MASK: 4087 case LIBIPW_OFDM_RATE_6MB_MASK:
4088 return 6000000; 4088 return 6000000;
4089 case IEEE80211_OFDM_RATE_9MB_MASK: 4089 case LIBIPW_OFDM_RATE_9MB_MASK:
4090 return 9000000; 4090 return 9000000;
4091 case IEEE80211_CCK_RATE_11MB_MASK: 4091 case LIBIPW_CCK_RATE_11MB_MASK:
4092 return 11000000; 4092 return 11000000;
4093 case IEEE80211_OFDM_RATE_12MB_MASK: 4093 case LIBIPW_OFDM_RATE_12MB_MASK:
4094 return 12000000; 4094 return 12000000;
4095 case IEEE80211_OFDM_RATE_18MB_MASK: 4095 case LIBIPW_OFDM_RATE_18MB_MASK:
4096 return 18000000; 4096 return 18000000;
4097 case IEEE80211_OFDM_RATE_24MB_MASK: 4097 case LIBIPW_OFDM_RATE_24MB_MASK:
4098 return 24000000; 4098 return 24000000;
4099 case IEEE80211_OFDM_RATE_36MB_MASK: 4099 case LIBIPW_OFDM_RATE_36MB_MASK:
4100 return 36000000; 4100 return 36000000;
4101 case IEEE80211_OFDM_RATE_48MB_MASK: 4101 case LIBIPW_OFDM_RATE_48MB_MASK:
4102 return 48000000; 4102 return 48000000;
4103 case IEEE80211_OFDM_RATE_54MB_MASK: 4103 case LIBIPW_OFDM_RATE_54MB_MASK:
4104 return 54000000; 4104 return 54000000;
4105 } 4105 }
4106 4106
@@ -4466,11 +4466,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4466 == IEEE80211_STYPE_ASSOC_RESP)) { 4466 == IEEE80211_STYPE_ASSOC_RESP)) {
4467 if ((sizeof 4467 if ((sizeof
4468 (struct 4468 (struct
4469 ieee80211_assoc_response) 4469 libipw_assoc_response)
4470 <= size) 4470 <= size)
4471 && (size <= 2314)) { 4471 && (size <= 2314)) {
4472 struct 4472 struct
4473 ieee80211_rx_stats 4473 libipw_rx_stats
4474 stats = { 4474 stats = {
4475 .len = size - 1, 4475 .len = size - 1,
4476 }; 4476 };
@@ -4478,10 +4478,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4478 IPW_DEBUG_QOS 4478 IPW_DEBUG_QOS
4479 ("QoS Associate " 4479 ("QoS Associate "
4480 "size %d\n", size); 4480 "size %d\n", size);
4481 ieee80211_rx_mgt(priv-> 4481 libipw_rx_mgt(priv->
4482 ieee, 4482 ieee,
4483 (struct 4483 (struct
4484 ieee80211_hdr_4addr 4484 libipw_hdr_4addr
4485 *) 4485 *)
4486 &notif->u.raw, &stats); 4486 &notif->u.raw, &stats);
4487 } 4487 }
@@ -4537,11 +4537,11 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4537 case CMAS_INIT:{ 4537 case CMAS_INIT:{
4538 if (priv->status & STATUS_AUTH) { 4538 if (priv->status & STATUS_AUTH) {
4539 struct 4539 struct
4540 ieee80211_assoc_response 4540 libipw_assoc_response
4541 *resp; 4541 *resp;
4542 resp = 4542 resp =
4543 (struct 4543 (struct
4544 ieee80211_assoc_response 4544 libipw_assoc_response
4545 *)&notif->u.raw; 4545 *)&notif->u.raw;
4546 IPW_DEBUG(IPW_DL_NOTIF | 4546 IPW_DEBUG(IPW_DL_NOTIF |
4547 IPW_DL_STATE | 4547 IPW_DL_STATE |
@@ -5227,33 +5227,33 @@ static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv)
5227 5227
5228static int ipw_is_rate_in_mask(struct ipw_priv *priv, int ieee_mode, u8 rate) 5228static int ipw_is_rate_in_mask(struct ipw_priv *priv, int ieee_mode, u8 rate)
5229{ 5229{
5230 rate &= ~IEEE80211_BASIC_RATE_MASK; 5230 rate &= ~LIBIPW_BASIC_RATE_MASK;
5231 if (ieee_mode == IEEE_A) { 5231 if (ieee_mode == IEEE_A) {
5232 switch (rate) { 5232 switch (rate) {
5233 case IEEE80211_OFDM_RATE_6MB: 5233 case LIBIPW_OFDM_RATE_6MB:
5234 return priv->rates_mask & IEEE80211_OFDM_RATE_6MB_MASK ? 5234 return priv->rates_mask & LIBIPW_OFDM_RATE_6MB_MASK ?
5235 1 : 0; 5235 1 : 0;
5236 case IEEE80211_OFDM_RATE_9MB: 5236 case LIBIPW_OFDM_RATE_9MB:
5237 return priv->rates_mask & IEEE80211_OFDM_RATE_9MB_MASK ? 5237 return priv->rates_mask & LIBIPW_OFDM_RATE_9MB_MASK ?
5238 1 : 0; 5238 1 : 0;
5239 case IEEE80211_OFDM_RATE_12MB: 5239 case LIBIPW_OFDM_RATE_12MB:
5240 return priv-> 5240 return priv->
5241 rates_mask & IEEE80211_OFDM_RATE_12MB_MASK ? 1 : 0; 5241 rates_mask & LIBIPW_OFDM_RATE_12MB_MASK ? 1 : 0;
5242 case IEEE80211_OFDM_RATE_18MB: 5242 case LIBIPW_OFDM_RATE_18MB:
5243 return priv-> 5243 return priv->
5244 rates_mask & IEEE80211_OFDM_RATE_18MB_MASK ? 1 : 0; 5244 rates_mask & LIBIPW_OFDM_RATE_18MB_MASK ? 1 : 0;
5245 case IEEE80211_OFDM_RATE_24MB: 5245 case LIBIPW_OFDM_RATE_24MB:
5246 return priv-> 5246 return priv->
5247 rates_mask & IEEE80211_OFDM_RATE_24MB_MASK ? 1 : 0; 5247 rates_mask & LIBIPW_OFDM_RATE_24MB_MASK ? 1 : 0;
5248 case IEEE80211_OFDM_RATE_36MB: 5248 case LIBIPW_OFDM_RATE_36MB:
5249 return priv-> 5249 return priv->
5250 rates_mask & IEEE80211_OFDM_RATE_36MB_MASK ? 1 : 0; 5250 rates_mask & LIBIPW_OFDM_RATE_36MB_MASK ? 1 : 0;
5251 case IEEE80211_OFDM_RATE_48MB: 5251 case LIBIPW_OFDM_RATE_48MB:
5252 return priv-> 5252 return priv->
5253 rates_mask & IEEE80211_OFDM_RATE_48MB_MASK ? 1 : 0; 5253 rates_mask & LIBIPW_OFDM_RATE_48MB_MASK ? 1 : 0;
5254 case IEEE80211_OFDM_RATE_54MB: 5254 case LIBIPW_OFDM_RATE_54MB:
5255 return priv-> 5255 return priv->
5256 rates_mask & IEEE80211_OFDM_RATE_54MB_MASK ? 1 : 0; 5256 rates_mask & LIBIPW_OFDM_RATE_54MB_MASK ? 1 : 0;
5257 default: 5257 default:
5258 return 0; 5258 return 0;
5259 } 5259 }
@@ -5261,14 +5261,14 @@ static int ipw_is_rate_in_mask(struct ipw_priv *priv, int ieee_mode, u8 rate)
5261 5261
5262 /* B and G mixed */ 5262 /* B and G mixed */
5263 switch (rate) { 5263 switch (rate) {
5264 case IEEE80211_CCK_RATE_1MB: 5264 case LIBIPW_CCK_RATE_1MB:
5265 return priv->rates_mask & IEEE80211_CCK_RATE_1MB_MASK ? 1 : 0; 5265 return priv->rates_mask & LIBIPW_CCK_RATE_1MB_MASK ? 1 : 0;
5266 case IEEE80211_CCK_RATE_2MB: 5266 case LIBIPW_CCK_RATE_2MB:
5267 return priv->rates_mask & IEEE80211_CCK_RATE_2MB_MASK ? 1 : 0; 5267 return priv->rates_mask & LIBIPW_CCK_RATE_2MB_MASK ? 1 : 0;
5268 case IEEE80211_CCK_RATE_5MB: 5268 case LIBIPW_CCK_RATE_5MB:
5269 return priv->rates_mask & IEEE80211_CCK_RATE_5MB_MASK ? 1 : 0; 5269 return priv->rates_mask & LIBIPW_CCK_RATE_5MB_MASK ? 1 : 0;
5270 case IEEE80211_CCK_RATE_11MB: 5270 case LIBIPW_CCK_RATE_11MB:
5271 return priv->rates_mask & IEEE80211_CCK_RATE_11MB_MASK ? 1 : 0; 5271 return priv->rates_mask & LIBIPW_CCK_RATE_11MB_MASK ? 1 : 0;
5272 } 5272 }
5273 5273
5274 /* If we are limited to B modulations, bail at this point */ 5274 /* If we are limited to B modulations, bail at this point */
@@ -5277,29 +5277,29 @@ static int ipw_is_rate_in_mask(struct ipw_priv *priv, int ieee_mode, u8 rate)
5277 5277
5278 /* G */ 5278 /* G */
5279 switch (rate) { 5279 switch (rate) {
5280 case IEEE80211_OFDM_RATE_6MB: 5280 case LIBIPW_OFDM_RATE_6MB:
5281 return priv->rates_mask & IEEE80211_OFDM_RATE_6MB_MASK ? 1 : 0; 5281 return priv->rates_mask & LIBIPW_OFDM_RATE_6MB_MASK ? 1 : 0;
5282 case IEEE80211_OFDM_RATE_9MB: 5282 case LIBIPW_OFDM_RATE_9MB:
5283 return priv->rates_mask & IEEE80211_OFDM_RATE_9MB_MASK ? 1 : 0; 5283 return priv->rates_mask & LIBIPW_OFDM_RATE_9MB_MASK ? 1 : 0;
5284 case IEEE80211_OFDM_RATE_12MB: 5284 case LIBIPW_OFDM_RATE_12MB:
5285 return priv->rates_mask & IEEE80211_OFDM_RATE_12MB_MASK ? 1 : 0; 5285 return priv->rates_mask & LIBIPW_OFDM_RATE_12MB_MASK ? 1 : 0;
5286 case IEEE80211_OFDM_RATE_18MB: 5286 case LIBIPW_OFDM_RATE_18MB:
5287 return priv->rates_mask & IEEE80211_OFDM_RATE_18MB_MASK ? 1 : 0; 5287 return priv->rates_mask & LIBIPW_OFDM_RATE_18MB_MASK ? 1 : 0;
5288 case IEEE80211_OFDM_RATE_24MB: 5288 case LIBIPW_OFDM_RATE_24MB:
5289 return priv->rates_mask & IEEE80211_OFDM_RATE_24MB_MASK ? 1 : 0; 5289 return priv->rates_mask & LIBIPW_OFDM_RATE_24MB_MASK ? 1 : 0;
5290 case IEEE80211_OFDM_RATE_36MB: 5290 case LIBIPW_OFDM_RATE_36MB:
5291 return priv->rates_mask & IEEE80211_OFDM_RATE_36MB_MASK ? 1 : 0; 5291 return priv->rates_mask & LIBIPW_OFDM_RATE_36MB_MASK ? 1 : 0;
5292 case IEEE80211_OFDM_RATE_48MB: 5292 case LIBIPW_OFDM_RATE_48MB:
5293 return priv->rates_mask & IEEE80211_OFDM_RATE_48MB_MASK ? 1 : 0; 5293 return priv->rates_mask & LIBIPW_OFDM_RATE_48MB_MASK ? 1 : 0;
5294 case IEEE80211_OFDM_RATE_54MB: 5294 case LIBIPW_OFDM_RATE_54MB:
5295 return priv->rates_mask & IEEE80211_OFDM_RATE_54MB_MASK ? 1 : 0; 5295 return priv->rates_mask & LIBIPW_OFDM_RATE_54MB_MASK ? 1 : 0;
5296 } 5296 }
5297 5297
5298 return 0; 5298 return 0;
5299} 5299}
5300 5300
5301static int ipw_compatible_rates(struct ipw_priv *priv, 5301static int ipw_compatible_rates(struct ipw_priv *priv,
5302 const struct ieee80211_network *network, 5302 const struct libipw_network *network,
5303 struct ipw_supported_rates *rates) 5303 struct ipw_supported_rates *rates)
5304{ 5304{
5305 int num_rates, i; 5305 int num_rates, i;
@@ -5311,7 +5311,7 @@ static int ipw_compatible_rates(struct ipw_priv *priv,
5311 if (!ipw_is_rate_in_mask(priv, network->mode, 5311 if (!ipw_is_rate_in_mask(priv, network->mode,
5312 network->rates[i])) { 5312 network->rates[i])) {
5313 5313
5314 if (network->rates[i] & IEEE80211_BASIC_RATE_MASK) { 5314 if (network->rates[i] & LIBIPW_BASIC_RATE_MASK) {
5315 IPW_DEBUG_SCAN("Adding masked mandatory " 5315 IPW_DEBUG_SCAN("Adding masked mandatory "
5316 "rate %02X\n", 5316 "rate %02X\n",
5317 network->rates[i]); 5317 network->rates[i]);
@@ -5333,7 +5333,7 @@ static int ipw_compatible_rates(struct ipw_priv *priv,
5333 for (i = 0; i < num_rates; i++) { 5333 for (i = 0; i < num_rates; i++) {
5334 if (!ipw_is_rate_in_mask(priv, network->mode, 5334 if (!ipw_is_rate_in_mask(priv, network->mode,
5335 network->rates_ex[i])) { 5335 network->rates_ex[i])) {
5336 if (network->rates_ex[i] & IEEE80211_BASIC_RATE_MASK) { 5336 if (network->rates_ex[i] & LIBIPW_BASIC_RATE_MASK) {
5337 IPW_DEBUG_SCAN("Adding masked mandatory " 5337 IPW_DEBUG_SCAN("Adding masked mandatory "
5338 "rate %02X\n", 5338 "rate %02X\n",
5339 network->rates_ex[i]); 5339 network->rates_ex[i]);
@@ -5369,73 +5369,73 @@ static void ipw_copy_rates(struct ipw_supported_rates *dest,
5369static void ipw_add_cck_scan_rates(struct ipw_supported_rates *rates, 5369static void ipw_add_cck_scan_rates(struct ipw_supported_rates *rates,
5370 u8 modulation, u32 rate_mask) 5370 u8 modulation, u32 rate_mask)
5371{ 5371{
5372 u8 basic_mask = (IEEE80211_OFDM_MODULATION == modulation) ? 5372 u8 basic_mask = (LIBIPW_OFDM_MODULATION == modulation) ?
5373 IEEE80211_BASIC_RATE_MASK : 0; 5373 LIBIPW_BASIC_RATE_MASK : 0;
5374 5374
5375 if (rate_mask & IEEE80211_CCK_RATE_1MB_MASK) 5375 if (rate_mask & LIBIPW_CCK_RATE_1MB_MASK)
5376 rates->supported_rates[rates->num_rates++] = 5376 rates->supported_rates[rates->num_rates++] =
5377 IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_1MB; 5377 LIBIPW_BASIC_RATE_MASK | LIBIPW_CCK_RATE_1MB;
5378 5378
5379 if (rate_mask & IEEE80211_CCK_RATE_2MB_MASK) 5379 if (rate_mask & LIBIPW_CCK_RATE_2MB_MASK)
5380 rates->supported_rates[rates->num_rates++] = 5380 rates->supported_rates[rates->num_rates++] =
5381 IEEE80211_BASIC_RATE_MASK | IEEE80211_CCK_RATE_2MB; 5381 LIBIPW_BASIC_RATE_MASK | LIBIPW_CCK_RATE_2MB;
5382 5382
5383 if (rate_mask & IEEE80211_CCK_RATE_5MB_MASK) 5383 if (rate_mask & LIBIPW_CCK_RATE_5MB_MASK)
5384 rates->supported_rates[rates->num_rates++] = basic_mask | 5384 rates->supported_rates[rates->num_rates++] = basic_mask |
5385 IEEE80211_CCK_RATE_5MB; 5385 LIBIPW_CCK_RATE_5MB;
5386 5386
5387 if (rate_mask & IEEE80211_CCK_RATE_11MB_MASK) 5387 if (rate_mask & LIBIPW_CCK_RATE_11MB_MASK)
5388 rates->supported_rates[rates->num_rates++] = basic_mask | 5388 rates->supported_rates[rates->num_rates++] = basic_mask |
5389 IEEE80211_CCK_RATE_11MB; 5389 LIBIPW_CCK_RATE_11MB;
5390} 5390}
5391 5391
5392static void ipw_add_ofdm_scan_rates(struct ipw_supported_rates *rates, 5392static void ipw_add_ofdm_scan_rates(struct ipw_supported_rates *rates,
5393 u8 modulation, u32 rate_mask) 5393 u8 modulation, u32 rate_mask)
5394{ 5394{
5395 u8 basic_mask = (IEEE80211_OFDM_MODULATION == modulation) ? 5395 u8 basic_mask = (LIBIPW_OFDM_MODULATION == modulation) ?
5396 IEEE80211_BASIC_RATE_MASK : 0; 5396 LIBIPW_BASIC_RATE_MASK : 0;
5397 5397
5398 if (rate_mask & IEEE80211_OFDM_RATE_6MB_MASK) 5398 if (rate_mask & LIBIPW_OFDM_RATE_6MB_MASK)
5399 rates->supported_rates[rates->num_rates++] = basic_mask | 5399 rates->supported_rates[rates->num_rates++] = basic_mask |
5400 IEEE80211_OFDM_RATE_6MB; 5400 LIBIPW_OFDM_RATE_6MB;
5401 5401
5402 if (rate_mask & IEEE80211_OFDM_RATE_9MB_MASK) 5402 if (rate_mask & LIBIPW_OFDM_RATE_9MB_MASK)
5403 rates->supported_rates[rates->num_rates++] = 5403 rates->supported_rates[rates->num_rates++] =
5404 IEEE80211_OFDM_RATE_9MB; 5404 LIBIPW_OFDM_RATE_9MB;
5405 5405
5406 if (rate_mask & IEEE80211_OFDM_RATE_12MB_MASK) 5406 if (rate_mask & LIBIPW_OFDM_RATE_12MB_MASK)
5407 rates->supported_rates[rates->num_rates++] = basic_mask | 5407 rates->supported_rates[rates->num_rates++] = basic_mask |
5408 IEEE80211_OFDM_RATE_12MB; 5408 LIBIPW_OFDM_RATE_12MB;
5409 5409
5410 if (rate_mask & IEEE80211_OFDM_RATE_18MB_MASK) 5410 if (rate_mask & LIBIPW_OFDM_RATE_18MB_MASK)
5411 rates->supported_rates[rates->num_rates++] = 5411 rates->supported_rates[rates->num_rates++] =
5412 IEEE80211_OFDM_RATE_18MB; 5412 LIBIPW_OFDM_RATE_18MB;
5413 5413
5414 if (rate_mask & IEEE80211_OFDM_RATE_24MB_MASK) 5414 if (rate_mask & LIBIPW_OFDM_RATE_24MB_MASK)
5415 rates->supported_rates[rates->num_rates++] = basic_mask | 5415 rates->supported_rates[rates->num_rates++] = basic_mask |
5416 IEEE80211_OFDM_RATE_24MB; 5416 LIBIPW_OFDM_RATE_24MB;
5417 5417
5418 if (rate_mask & IEEE80211_OFDM_RATE_36MB_MASK) 5418 if (rate_mask & LIBIPW_OFDM_RATE_36MB_MASK)
5419 rates->supported_rates[rates->num_rates++] = 5419 rates->supported_rates[rates->num_rates++] =
5420 IEEE80211_OFDM_RATE_36MB; 5420 LIBIPW_OFDM_RATE_36MB;
5421 5421
5422 if (rate_mask & IEEE80211_OFDM_RATE_48MB_MASK) 5422 if (rate_mask & LIBIPW_OFDM_RATE_48MB_MASK)
5423 rates->supported_rates[rates->num_rates++] = 5423 rates->supported_rates[rates->num_rates++] =
5424 IEEE80211_OFDM_RATE_48MB; 5424 LIBIPW_OFDM_RATE_48MB;
5425 5425
5426 if (rate_mask & IEEE80211_OFDM_RATE_54MB_MASK) 5426 if (rate_mask & LIBIPW_OFDM_RATE_54MB_MASK)
5427 rates->supported_rates[rates->num_rates++] = 5427 rates->supported_rates[rates->num_rates++] =
5428 IEEE80211_OFDM_RATE_54MB; 5428 LIBIPW_OFDM_RATE_54MB;
5429} 5429}
5430 5430
5431struct ipw_network_match { 5431struct ipw_network_match {
5432 struct ieee80211_network *network; 5432 struct libipw_network *network;
5433 struct ipw_supported_rates rates; 5433 struct ipw_supported_rates rates;
5434}; 5434};
5435 5435
5436static int ipw_find_adhoc_network(struct ipw_priv *priv, 5436static int ipw_find_adhoc_network(struct ipw_priv *priv,
5437 struct ipw_network_match *match, 5437 struct ipw_network_match *match,
5438 struct ieee80211_network *network, 5438 struct libipw_network *network,
5439 int roaming) 5439 int roaming)
5440{ 5440{
5441 struct ipw_supported_rates rates; 5441 struct ipw_supported_rates rates;
@@ -5556,7 +5556,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5556 } 5556 }
5557 5557
5558 /* Filter out any incompatible freq / mode combinations */ 5558 /* Filter out any incompatible freq / mode combinations */
5559 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5559 if (!libipw_is_valid_mode(priv->ieee, network->mode)) {
5560 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5560 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5561 "because of invalid frequency/mode " 5561 "because of invalid frequency/mode "
5562 "combination.\n", 5562 "combination.\n",
@@ -5606,7 +5606,7 @@ static void ipw_merge_adhoc_network(struct work_struct *work)
5606 DECLARE_SSID_BUF(ssid); 5606 DECLARE_SSID_BUF(ssid);
5607 struct ipw_priv *priv = 5607 struct ipw_priv *priv =
5608 container_of(work, struct ipw_priv, merge_networks); 5608 container_of(work, struct ipw_priv, merge_networks);
5609 struct ieee80211_network *network = NULL; 5609 struct libipw_network *network = NULL;
5610 struct ipw_network_match match = { 5610 struct ipw_network_match match = {
5611 .network = priv->assoc_network 5611 .network = priv->assoc_network
5612 }; 5612 };
@@ -5648,7 +5648,7 @@ static void ipw_merge_adhoc_network(struct work_struct *work)
5648 5648
5649static int ipw_best_network(struct ipw_priv *priv, 5649static int ipw_best_network(struct ipw_priv *priv,
5650 struct ipw_network_match *match, 5650 struct ipw_network_match *match,
5651 struct ieee80211_network *network, int roaming) 5651 struct libipw_network *network, int roaming)
5652{ 5652{
5653 struct ipw_supported_rates rates; 5653 struct ipw_supported_rates rates;
5654 DECLARE_SSID_BUF(ssid); 5654 DECLARE_SSID_BUF(ssid);
@@ -5782,7 +5782,7 @@ static int ipw_best_network(struct ipw_priv *priv,
5782 } 5782 }
5783 5783
5784 /* Filter out any incompatible freq / mode combinations */ 5784 /* Filter out any incompatible freq / mode combinations */
5785 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5785 if (!libipw_is_valid_mode(priv->ieee, network->mode)) {
5786 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5786 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5787 "because of invalid frequency/mode " 5787 "because of invalid frequency/mode "
5788 "combination.\n", 5788 "combination.\n",
@@ -5793,7 +5793,7 @@ static int ipw_best_network(struct ipw_priv *priv,
5793 } 5793 }
5794 5794
5795 /* Filter out invalid channel in current GEO */ 5795 /* Filter out invalid channel in current GEO */
5796 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) { 5796 if (!libipw_is_valid_channel(priv->ieee, network->channel)) {
5797 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5797 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5798 "because of invalid channel in current GEO\n", 5798 "because of invalid channel in current GEO\n",
5799 print_ssid(ssid, network->ssid, 5799 print_ssid(ssid, network->ssid,
@@ -5839,9 +5839,9 @@ static int ipw_best_network(struct ipw_priv *priv,
5839} 5839}
5840 5840
5841static void ipw_adhoc_create(struct ipw_priv *priv, 5841static void ipw_adhoc_create(struct ipw_priv *priv,
5842 struct ieee80211_network *network) 5842 struct libipw_network *network)
5843{ 5843{
5844 const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); 5844 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
5845 int i; 5845 int i;
5846 5846
5847 /* 5847 /*
@@ -5856,25 +5856,25 @@ static void ipw_adhoc_create(struct ipw_priv *priv,
5856 * FW fatal error. 5856 * FW fatal error.
5857 * 5857 *
5858 */ 5858 */
5859 switch (ieee80211_is_valid_channel(priv->ieee, priv->channel)) { 5859 switch (libipw_is_valid_channel(priv->ieee, priv->channel)) {
5860 case IEEE80211_52GHZ_BAND: 5860 case LIBIPW_52GHZ_BAND:
5861 network->mode = IEEE_A; 5861 network->mode = IEEE_A;
5862 i = ieee80211_channel_to_index(priv->ieee, priv->channel); 5862 i = libipw_channel_to_index(priv->ieee, priv->channel);
5863 BUG_ON(i == -1); 5863 BUG_ON(i == -1);
5864 if (geo->a[i].flags & IEEE80211_CH_PASSIVE_ONLY) { 5864 if (geo->a[i].flags & LIBIPW_CH_PASSIVE_ONLY) {
5865 IPW_WARNING("Overriding invalid channel\n"); 5865 IPW_WARNING("Overriding invalid channel\n");
5866 priv->channel = geo->a[0].channel; 5866 priv->channel = geo->a[0].channel;
5867 } 5867 }
5868 break; 5868 break;
5869 5869
5870 case IEEE80211_24GHZ_BAND: 5870 case LIBIPW_24GHZ_BAND:
5871 if (priv->ieee->mode & IEEE_G) 5871 if (priv->ieee->mode & IEEE_G)
5872 network->mode = IEEE_G; 5872 network->mode = IEEE_G;
5873 else 5873 else
5874 network->mode = IEEE_B; 5874 network->mode = IEEE_B;
5875 i = ieee80211_channel_to_index(priv->ieee, priv->channel); 5875 i = libipw_channel_to_index(priv->ieee, priv->channel);
5876 BUG_ON(i == -1); 5876 BUG_ON(i == -1);
5877 if (geo->bg[i].flags & IEEE80211_CH_PASSIVE_ONLY) { 5877 if (geo->bg[i].flags & LIBIPW_CH_PASSIVE_ONLY) {
5878 IPW_WARNING("Overriding invalid channel\n"); 5878 IPW_WARNING("Overriding invalid channel\n");
5879 priv->channel = geo->bg[0].channel; 5879 priv->channel = geo->bg[0].channel;
5880 } 5880 }
@@ -6110,9 +6110,9 @@ static void ipw_set_fixed_rate(struct ipw_priv *priv, int mode)
6110 * Tx rates */ 6110 * Tx rates */
6111 6111
6112 switch (priv->ieee->freq_band) { 6112 switch (priv->ieee->freq_band) {
6113 case IEEE80211_52GHZ_BAND: /* A only */ 6113 case LIBIPW_52GHZ_BAND: /* A only */
6114 /* IEEE_A */ 6114 /* IEEE_A */
6115 if (priv->rates_mask & ~IEEE80211_OFDM_RATES_MASK) { 6115 if (priv->rates_mask & ~LIBIPW_OFDM_RATES_MASK) {
6116 /* Invalid fixed rate mask */ 6116 /* Invalid fixed rate mask */
6117 IPW_DEBUG_WX 6117 IPW_DEBUG_WX
6118 ("invalid fixed rate mask in ipw_set_fixed_rate\n"); 6118 ("invalid fixed rate mask in ipw_set_fixed_rate\n");
@@ -6120,13 +6120,13 @@ static void ipw_set_fixed_rate(struct ipw_priv *priv, int mode)
6120 break; 6120 break;
6121 } 6121 }
6122 6122
6123 new_tx_rates >>= IEEE80211_OFDM_SHIFT_MASK_A; 6123 new_tx_rates >>= LIBIPW_OFDM_SHIFT_MASK_A;
6124 break; 6124 break;
6125 6125
6126 default: /* 2.4Ghz or Mixed */ 6126 default: /* 2.4Ghz or Mixed */
6127 /* IEEE_B */ 6127 /* IEEE_B */
6128 if (mode == IEEE_B) { 6128 if (mode == IEEE_B) {
6129 if (new_tx_rates & ~IEEE80211_CCK_RATES_MASK) { 6129 if (new_tx_rates & ~LIBIPW_CCK_RATES_MASK) {
6130 /* Invalid fixed rate mask */ 6130 /* Invalid fixed rate mask */
6131 IPW_DEBUG_WX 6131 IPW_DEBUG_WX
6132 ("invalid fixed rate mask in ipw_set_fixed_rate\n"); 6132 ("invalid fixed rate mask in ipw_set_fixed_rate\n");
@@ -6136,8 +6136,8 @@ static void ipw_set_fixed_rate(struct ipw_priv *priv, int mode)
6136 } 6136 }
6137 6137
6138 /* IEEE_G */ 6138 /* IEEE_G */
6139 if (new_tx_rates & ~(IEEE80211_CCK_RATES_MASK | 6139 if (new_tx_rates & ~(LIBIPW_CCK_RATES_MASK |
6140 IEEE80211_OFDM_RATES_MASK)) { 6140 LIBIPW_OFDM_RATES_MASK)) {
6141 /* Invalid fixed rate mask */ 6141 /* Invalid fixed rate mask */
6142 IPW_DEBUG_WX 6142 IPW_DEBUG_WX
6143 ("invalid fixed rate mask in ipw_set_fixed_rate\n"); 6143 ("invalid fixed rate mask in ipw_set_fixed_rate\n");
@@ -6145,19 +6145,19 @@ static void ipw_set_fixed_rate(struct ipw_priv *priv, int mode)
6145 break; 6145 break;
6146 } 6146 }
6147 6147
6148 if (IEEE80211_OFDM_RATE_6MB_MASK & new_tx_rates) { 6148 if (LIBIPW_OFDM_RATE_6MB_MASK & new_tx_rates) {
6149 mask |= (IEEE80211_OFDM_RATE_6MB_MASK >> 1); 6149 mask |= (LIBIPW_OFDM_RATE_6MB_MASK >> 1);
6150 new_tx_rates &= ~IEEE80211_OFDM_RATE_6MB_MASK; 6150 new_tx_rates &= ~LIBIPW_OFDM_RATE_6MB_MASK;
6151 } 6151 }
6152 6152
6153 if (IEEE80211_OFDM_RATE_9MB_MASK & new_tx_rates) { 6153 if (LIBIPW_OFDM_RATE_9MB_MASK & new_tx_rates) {
6154 mask |= (IEEE80211_OFDM_RATE_9MB_MASK >> 1); 6154 mask |= (LIBIPW_OFDM_RATE_9MB_MASK >> 1);
6155 new_tx_rates &= ~IEEE80211_OFDM_RATE_9MB_MASK; 6155 new_tx_rates &= ~LIBIPW_OFDM_RATE_9MB_MASK;
6156 } 6156 }
6157 6157
6158 if (IEEE80211_OFDM_RATE_12MB_MASK & new_tx_rates) { 6158 if (LIBIPW_OFDM_RATE_12MB_MASK & new_tx_rates) {
6159 mask |= (IEEE80211_OFDM_RATE_12MB_MASK >> 1); 6159 mask |= (LIBIPW_OFDM_RATE_12MB_MASK >> 1);
6160 new_tx_rates &= ~IEEE80211_OFDM_RATE_12MB_MASK; 6160 new_tx_rates &= ~LIBIPW_OFDM_RATE_12MB_MASK;
6161 } 6161 }
6162 6162
6163 new_tx_rates |= mask; 6163 new_tx_rates |= mask;
@@ -6190,12 +6190,12 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
6190 int scan_type) 6190 int scan_type)
6191{ 6191{
6192 int channel_index = 0; 6192 int channel_index = 0;
6193 const struct ieee80211_geo *geo; 6193 const struct libipw_geo *geo;
6194 int i; 6194 int i;
6195 6195
6196 geo = ieee80211_get_geo(priv->ieee); 6196 geo = libipw_get_geo(priv->ieee);
6197 6197
6198 if (priv->ieee->freq_band & IEEE80211_52GHZ_BAND) { 6198 if (priv->ieee->freq_band & LIBIPW_52GHZ_BAND) {
6199 int start = channel_index; 6199 int start = channel_index;
6200 for (i = 0; i < geo->a_channels; i++) { 6200 for (i = 0; i < geo->a_channels; i++) {
6201 if ((priv->status & STATUS_ASSOCIATED) && 6201 if ((priv->status & STATUS_ASSOCIATED) &&
@@ -6205,7 +6205,7 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
6205 scan->channels_list[channel_index] = geo->a[i].channel; 6205 scan->channels_list[channel_index] = geo->a[i].channel;
6206 ipw_set_scan_type(scan, channel_index, 6206 ipw_set_scan_type(scan, channel_index,
6207 geo->a[i]. 6207 geo->a[i].
6208 flags & IEEE80211_CH_PASSIVE_ONLY ? 6208 flags & LIBIPW_CH_PASSIVE_ONLY ?
6209 IPW_SCAN_PASSIVE_FULL_DWELL_SCAN : 6209 IPW_SCAN_PASSIVE_FULL_DWELL_SCAN :
6210 scan_type); 6210 scan_type);
6211 } 6211 }
@@ -6217,11 +6217,11 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
6217 } 6217 }
6218 } 6218 }
6219 6219
6220 if (priv->ieee->freq_band & IEEE80211_24GHZ_BAND) { 6220 if (priv->ieee->freq_band & LIBIPW_24GHZ_BAND) {
6221 int start = channel_index; 6221 int start = channel_index;
6222 if (priv->config & CFG_SPEED_SCAN) { 6222 if (priv->config & CFG_SPEED_SCAN) {
6223 int index; 6223 int index;
6224 u8 channels[IEEE80211_24GHZ_CHANNELS] = { 6224 u8 channels[LIBIPW_24GHZ_CHANNELS] = {
6225 /* nop out the list */ 6225 /* nop out the list */
6226 [0] = 0 6226 [0] = 0
6227 }; 6227 };
@@ -6253,11 +6253,11 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
6253 channel_index++; 6253 channel_index++;
6254 scan->channels_list[channel_index] = channel; 6254 scan->channels_list[channel_index] = channel;
6255 index = 6255 index =
6256 ieee80211_channel_to_index(priv->ieee, channel); 6256 libipw_channel_to_index(priv->ieee, channel);
6257 ipw_set_scan_type(scan, channel_index, 6257 ipw_set_scan_type(scan, channel_index,
6258 geo->bg[index]. 6258 geo->bg[index].
6259 flags & 6259 flags &
6260 IEEE80211_CH_PASSIVE_ONLY ? 6260 LIBIPW_CH_PASSIVE_ONLY ?
6261 IPW_SCAN_PASSIVE_FULL_DWELL_SCAN 6261 IPW_SCAN_PASSIVE_FULL_DWELL_SCAN
6262 : scan_type); 6262 : scan_type);
6263 } 6263 }
@@ -6272,7 +6272,7 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
6272 ipw_set_scan_type(scan, channel_index, 6272 ipw_set_scan_type(scan, channel_index,
6273 geo->bg[i]. 6273 geo->bg[i].
6274 flags & 6274 flags &
6275 IEEE80211_CH_PASSIVE_ONLY ? 6275 LIBIPW_CH_PASSIVE_ONLY ?
6276 IPW_SCAN_PASSIVE_FULL_DWELL_SCAN 6276 IPW_SCAN_PASSIVE_FULL_DWELL_SCAN
6277 : scan_type); 6277 : scan_type);
6278 } 6278 }
@@ -6339,7 +6339,7 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct)
6339 } 6339 }
6340 6340
6341 memset(&scan, 0, sizeof(scan)); 6341 memset(&scan, 0, sizeof(scan));
6342 scan.full_scan_index = cpu_to_le32(ieee80211_get_scans(priv->ieee)); 6342 scan.full_scan_index = cpu_to_le32(libipw_get_scans(priv->ieee));
6343 6343
6344 if (type == IW_SCAN_TYPE_PASSIVE) { 6344 if (type == IW_SCAN_TYPE_PASSIVE) {
6345 IPW_DEBUG_WX("use passive scanning\n"); 6345 IPW_DEBUG_WX("use passive scanning\n");
@@ -6370,13 +6370,13 @@ static int ipw_request_scan_helper(struct ipw_priv *priv, int type, int direct)
6370 u8 channel; 6370 u8 channel;
6371 u8 band = 0; 6371 u8 band = 0;
6372 6372
6373 switch (ieee80211_is_valid_channel(priv->ieee, priv->channel)) { 6373 switch (libipw_is_valid_channel(priv->ieee, priv->channel)) {
6374 case IEEE80211_52GHZ_BAND: 6374 case LIBIPW_52GHZ_BAND:
6375 band = (u8) (IPW_A_MODE << 6) | 1; 6375 band = (u8) (IPW_A_MODE << 6) | 1;
6376 channel = priv->channel; 6376 channel = priv->channel;
6377 break; 6377 break;
6378 6378
6379 case IEEE80211_24GHZ_BAND: 6379 case LIBIPW_24GHZ_BAND:
6380 band = (u8) (IPW_B_MODE << 6) | 1; 6380 band = (u8) (IPW_B_MODE << 6) | 1;
6381 channel = priv->channel; 6381 channel = priv->channel;
6382 break; 6382 break;
@@ -6497,8 +6497,8 @@ static int ipw_wpa_enable(struct ipw_priv *priv, int value)
6497 6497
6498static int ipw_wpa_set_auth_algs(struct ipw_priv *priv, int value) 6498static int ipw_wpa_set_auth_algs(struct ipw_priv *priv, int value)
6499{ 6499{
6500 struct ieee80211_device *ieee = priv->ieee; 6500 struct libipw_device *ieee = priv->ieee;
6501 struct ieee80211_security sec = { 6501 struct libipw_security sec = {
6502 .flags = SEC_AUTH_MODE, 6502 .flags = SEC_AUTH_MODE,
6503 }; 6503 };
6504 int ret = 0; 6504 int ret = 0;
@@ -6548,8 +6548,8 @@ static int ipw_wx_set_genie(struct net_device *dev,
6548 struct iw_request_info *info, 6548 struct iw_request_info *info,
6549 union iwreq_data *wrqu, char *extra) 6549 union iwreq_data *wrqu, char *extra)
6550{ 6550{
6551 struct ipw_priv *priv = ieee80211_priv(dev); 6551 struct ipw_priv *priv = libipw_priv(dev);
6552 struct ieee80211_device *ieee = priv->ieee; 6552 struct libipw_device *ieee = priv->ieee;
6553 u8 *buf; 6553 u8 *buf;
6554 int err = 0; 6554 int err = 0;
6555 6555
@@ -6584,8 +6584,8 @@ static int ipw_wx_get_genie(struct net_device *dev,
6584 struct iw_request_info *info, 6584 struct iw_request_info *info,
6585 union iwreq_data *wrqu, char *extra) 6585 union iwreq_data *wrqu, char *extra)
6586{ 6586{
6587 struct ipw_priv *priv = ieee80211_priv(dev); 6587 struct ipw_priv *priv = libipw_priv(dev);
6588 struct ieee80211_device *ieee = priv->ieee; 6588 struct libipw_device *ieee = priv->ieee;
6589 int err = 0; 6589 int err = 0;
6590 6590
6591 if (ieee->wpa_ie_len == 0 || ieee->wpa_ie == NULL) { 6591 if (ieee->wpa_ie_len == 0 || ieee->wpa_ie == NULL) {
@@ -6627,8 +6627,8 @@ static int ipw_wx_set_auth(struct net_device *dev,
6627 struct iw_request_info *info, 6627 struct iw_request_info *info,
6628 union iwreq_data *wrqu, char *extra) 6628 union iwreq_data *wrqu, char *extra)
6629{ 6629{
6630 struct ipw_priv *priv = ieee80211_priv(dev); 6630 struct ipw_priv *priv = libipw_priv(dev);
6631 struct ieee80211_device *ieee = priv->ieee; 6631 struct libipw_device *ieee = priv->ieee;
6632 struct iw_param *param = &wrqu->param; 6632 struct iw_param *param = &wrqu->param;
6633 struct lib80211_crypt_data *crypt; 6633 struct lib80211_crypt_data *crypt;
6634 unsigned long flags; 6634 unsigned long flags;
@@ -6679,7 +6679,7 @@ static int ipw_wx_set_auth(struct net_device *dev,
6679 * can use this to determine if the CAP_PRIVACY_ON bit should 6679 * can use this to determine if the CAP_PRIVACY_ON bit should
6680 * be set. 6680 * be set.
6681 */ 6681 */
6682 struct ieee80211_security sec = { 6682 struct libipw_security sec = {
6683 .flags = SEC_ENABLED, 6683 .flags = SEC_ENABLED,
6684 .enabled = param->value, 6684 .enabled = param->value,
6685 }; 6685 };
@@ -6727,8 +6727,8 @@ static int ipw_wx_get_auth(struct net_device *dev,
6727 struct iw_request_info *info, 6727 struct iw_request_info *info,
6728 union iwreq_data *wrqu, char *extra) 6728 union iwreq_data *wrqu, char *extra)
6729{ 6729{
6730 struct ipw_priv *priv = ieee80211_priv(dev); 6730 struct ipw_priv *priv = libipw_priv(dev);
6731 struct ieee80211_device *ieee = priv->ieee; 6731 struct libipw_device *ieee = priv->ieee;
6732 struct lib80211_crypt_data *crypt; 6732 struct lib80211_crypt_data *crypt;
6733 struct iw_param *param = &wrqu->param; 6733 struct iw_param *param = &wrqu->param;
6734 int ret = 0; 6734 int ret = 0;
@@ -6786,7 +6786,7 @@ static int ipw_wx_set_encodeext(struct net_device *dev,
6786 struct iw_request_info *info, 6786 struct iw_request_info *info,
6787 union iwreq_data *wrqu, char *extra) 6787 union iwreq_data *wrqu, char *extra)
6788{ 6788{
6789 struct ipw_priv *priv = ieee80211_priv(dev); 6789 struct ipw_priv *priv = libipw_priv(dev);
6790 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 6790 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
6791 6791
6792 if (hwcrypto) { 6792 if (hwcrypto) {
@@ -6808,7 +6808,7 @@ static int ipw_wx_set_encodeext(struct net_device *dev,
6808 } 6808 }
6809 } 6809 }
6810 6810
6811 return ieee80211_wx_set_encodeext(priv->ieee, info, wrqu, extra); 6811 return libipw_wx_set_encodeext(priv->ieee, info, wrqu, extra);
6812} 6812}
6813 6813
6814/* SIOCGIWENCODEEXT */ 6814/* SIOCGIWENCODEEXT */
@@ -6816,8 +6816,8 @@ static int ipw_wx_get_encodeext(struct net_device *dev,
6816 struct iw_request_info *info, 6816 struct iw_request_info *info,
6817 union iwreq_data *wrqu, char *extra) 6817 union iwreq_data *wrqu, char *extra)
6818{ 6818{
6819 struct ipw_priv *priv = ieee80211_priv(dev); 6819 struct ipw_priv *priv = libipw_priv(dev);
6820 return ieee80211_wx_get_encodeext(priv->ieee, info, wrqu, extra); 6820 return libipw_wx_get_encodeext(priv->ieee, info, wrqu, extra);
6821} 6821}
6822 6822
6823/* SIOCSIWMLME */ 6823/* SIOCSIWMLME */
@@ -6825,7 +6825,7 @@ static int ipw_wx_set_mlme(struct net_device *dev,
6825 struct iw_request_info *info, 6825 struct iw_request_info *info,
6826 union iwreq_data *wrqu, char *extra) 6826 union iwreq_data *wrqu, char *extra)
6827{ 6827{
6828 struct ipw_priv *priv = ieee80211_priv(dev); 6828 struct ipw_priv *priv = libipw_priv(dev);
6829 struct iw_mlme *mlme = (struct iw_mlme *)extra; 6829 struct iw_mlme *mlme = (struct iw_mlme *)extra;
6830 __le16 reason; 6830 __le16 reason;
6831 6831
@@ -6875,9 +6875,9 @@ static u8 ipw_qos_current_mode(struct ipw_priv * priv)
6875*/ 6875*/
6876static int ipw_qos_handle_probe_response(struct ipw_priv *priv, 6876static int ipw_qos_handle_probe_response(struct ipw_priv *priv,
6877 int active_network, 6877 int active_network,
6878 struct ieee80211_network *network) 6878 struct libipw_network *network)
6879{ 6879{
6880 u32 size = sizeof(struct ieee80211_qos_parameters); 6880 u32 size = sizeof(struct libipw_qos_parameters);
6881 6881
6882 if (network->capability & WLAN_CAPABILITY_IBSS) 6882 if (network->capability & WLAN_CAPABILITY_IBSS)
6883 network->qos_data.active = network->qos_data.supported; 6883 network->qos_data.active = network->qos_data.supported;
@@ -6935,12 +6935,12 @@ static int ipw_qos_handle_probe_response(struct ipw_priv *priv,
6935* IPW_CMD_QOS_PARAMETERS and IPW_CMD_WME_INFO 6935* IPW_CMD_QOS_PARAMETERS and IPW_CMD_WME_INFO
6936*/ 6936*/
6937static int ipw_qos_activate(struct ipw_priv *priv, 6937static int ipw_qos_activate(struct ipw_priv *priv,
6938 struct ieee80211_qos_data *qos_network_data) 6938 struct libipw_qos_data *qos_network_data)
6939{ 6939{
6940 int err; 6940 int err;
6941 struct ieee80211_qos_parameters qos_parameters[QOS_QOS_SETS]; 6941 struct libipw_qos_parameters qos_parameters[QOS_QOS_SETS];
6942 struct ieee80211_qos_parameters *active_one = NULL; 6942 struct libipw_qos_parameters *active_one = NULL;
6943 u32 size = sizeof(struct ieee80211_qos_parameters); 6943 u32 size = sizeof(struct libipw_qos_parameters);
6944 u32 burst_duration; 6944 u32 burst_duration;
6945 int i; 6945 int i;
6946 u8 type; 6946 u8 type;
@@ -7001,7 +7001,7 @@ static int ipw_qos_activate(struct ipw_priv *priv,
7001 7001
7002 IPW_DEBUG_QOS("QoS sending IPW_CMD_QOS_PARAMETERS\n"); 7002 IPW_DEBUG_QOS("QoS sending IPW_CMD_QOS_PARAMETERS\n");
7003 err = ipw_send_qos_params_command(priv, 7003 err = ipw_send_qos_params_command(priv,
7004 (struct ieee80211_qos_parameters *) 7004 (struct libipw_qos_parameters *)
7005 &(qos_parameters[0])); 7005 &(qos_parameters[0]));
7006 if (err) 7006 if (err)
7007 IPW_DEBUG_QOS("QoS IPW_CMD_QOS_PARAMETERS failed\n"); 7007 IPW_DEBUG_QOS("QoS IPW_CMD_QOS_PARAMETERS failed\n");
@@ -7015,13 +7015,13 @@ static int ipw_qos_activate(struct ipw_priv *priv,
7015static int ipw_qos_set_info_element(struct ipw_priv *priv) 7015static int ipw_qos_set_info_element(struct ipw_priv *priv)
7016{ 7016{
7017 int ret = 0; 7017 int ret = 0;
7018 struct ieee80211_qos_information_element qos_info; 7018 struct libipw_qos_information_element qos_info;
7019 7019
7020 if (priv == NULL) 7020 if (priv == NULL)
7021 return -1; 7021 return -1;
7022 7022
7023 qos_info.elementID = QOS_ELEMENT_ID; 7023 qos_info.elementID = QOS_ELEMENT_ID;
7024 qos_info.length = sizeof(struct ieee80211_qos_information_element) - 2; 7024 qos_info.length = sizeof(struct libipw_qos_information_element) - 2;
7025 7025
7026 qos_info.version = QOS_VERSION_1; 7026 qos_info.version = QOS_VERSION_1;
7027 qos_info.ac_info = 0; 7027 qos_info.ac_info = 0;
@@ -7041,11 +7041,11 @@ static int ipw_qos_set_info_element(struct ipw_priv *priv)
7041* Set the QoS parameter with the association request structure 7041* Set the QoS parameter with the association request structure
7042*/ 7042*/
7043static int ipw_qos_association(struct ipw_priv *priv, 7043static int ipw_qos_association(struct ipw_priv *priv,
7044 struct ieee80211_network *network) 7044 struct libipw_network *network)
7045{ 7045{
7046 int err = 0; 7046 int err = 0;
7047 struct ieee80211_qos_data *qos_data = NULL; 7047 struct libipw_qos_data *qos_data = NULL;
7048 struct ieee80211_qos_data ibss_data = { 7048 struct libipw_qos_data ibss_data = {
7049 .supported = 1, 7049 .supported = 1,
7050 .active = 1, 7050 .active = 1,
7051 }; 7051 };
@@ -7087,11 +7087,11 @@ static int ipw_qos_association(struct ipw_priv *priv,
7087* setting 7087* setting
7088*/ 7088*/
7089static int ipw_qos_association_resp(struct ipw_priv *priv, 7089static int ipw_qos_association_resp(struct ipw_priv *priv,
7090 struct ieee80211_network *network) 7090 struct libipw_network *network)
7091{ 7091{
7092 int ret = 0; 7092 int ret = 0;
7093 unsigned long flags; 7093 unsigned long flags;
7094 u32 size = sizeof(struct ieee80211_qos_parameters); 7094 u32 size = sizeof(struct libipw_qos_parameters);
7095 int set_qos_param = 0; 7095 int set_qos_param = 0;
7096 7096
7097 if ((priv == NULL) || (network == NULL) || 7097 if ((priv == NULL) || (network == NULL) ||
@@ -7107,7 +7107,7 @@ static int ipw_qos_association_resp(struct ipw_priv *priv,
7107 spin_lock_irqsave(&priv->ieee->lock, flags); 7107 spin_lock_irqsave(&priv->ieee->lock, flags);
7108 if (network->flags & NETWORK_HAS_QOS_PARAMETERS) { 7108 if (network->flags & NETWORK_HAS_QOS_PARAMETERS) {
7109 memcpy(&priv->assoc_network->qos_data, &network->qos_data, 7109 memcpy(&priv->assoc_network->qos_data, &network->qos_data,
7110 sizeof(struct ieee80211_qos_data)); 7110 sizeof(struct libipw_qos_data));
7111 priv->assoc_network->qos_data.active = 1; 7111 priv->assoc_network->qos_data.active = 1;
7112 if ((network->qos_data.old_param_count != 7112 if ((network->qos_data.old_param_count !=
7113 network->qos_data.param_count)) { 7113 network->qos_data.param_count)) {
@@ -7143,7 +7143,7 @@ static u32 ipw_qos_get_burst_duration(struct ipw_priv *priv)
7143 if ((priv == NULL)) 7143 if ((priv == NULL))
7144 return 0; 7144 return 0;
7145 7145
7146 if (!(priv->ieee->modulation & IEEE80211_OFDM_MODULATION)) 7146 if (!(priv->ieee->modulation & LIBIPW_OFDM_MODULATION))
7147 ret = priv->qos_data.burst_duration_CCK; 7147 ret = priv->qos_data.burst_duration_CCK;
7148 else 7148 else
7149 ret = priv->qos_data.burst_duration_OFDM; 7149 ret = priv->qos_data.burst_duration_OFDM;
@@ -7195,8 +7195,8 @@ static int ipw_get_tx_queue_number(struct ipw_priv *priv, u16 priority)
7195static int ipw_is_qos_active(struct net_device *dev, 7195static int ipw_is_qos_active(struct net_device *dev,
7196 struct sk_buff *skb) 7196 struct sk_buff *skb)
7197{ 7197{
7198 struct ipw_priv *priv = ieee80211_priv(dev); 7198 struct ipw_priv *priv = libipw_priv(dev);
7199 struct ieee80211_qos_data *qos_data = NULL; 7199 struct libipw_qos_data *qos_data = NULL;
7200 int active, supported; 7200 int active, supported;
7201 u8 *daddr = skb->data + ETH_ALEN; 7201 u8 *daddr = skb->data + ETH_ALEN;
7202 int unicast = !is_multicast_ether_addr(daddr); 7202 int unicast = !is_multicast_ether_addr(daddr);
@@ -7260,10 +7260,10 @@ static void ipw_bg_qos_activate(struct work_struct *work)
7260} 7260}
7261 7261
7262static int ipw_handle_probe_response(struct net_device *dev, 7262static int ipw_handle_probe_response(struct net_device *dev,
7263 struct ieee80211_probe_response *resp, 7263 struct libipw_probe_response *resp,
7264 struct ieee80211_network *network) 7264 struct libipw_network *network)
7265{ 7265{
7266 struct ipw_priv *priv = ieee80211_priv(dev); 7266 struct ipw_priv *priv = libipw_priv(dev);
7267 int active_network = ((priv->status & STATUS_ASSOCIATED) && 7267 int active_network = ((priv->status & STATUS_ASSOCIATED) &&
7268 (network == priv->assoc_network)); 7268 (network == priv->assoc_network));
7269 7269
@@ -7273,10 +7273,10 @@ static int ipw_handle_probe_response(struct net_device *dev,
7273} 7273}
7274 7274
7275static int ipw_handle_beacon(struct net_device *dev, 7275static int ipw_handle_beacon(struct net_device *dev,
7276 struct ieee80211_beacon *resp, 7276 struct libipw_beacon *resp,
7277 struct ieee80211_network *network) 7277 struct libipw_network *network)
7278{ 7278{
7279 struct ipw_priv *priv = ieee80211_priv(dev); 7279 struct ipw_priv *priv = libipw_priv(dev);
7280 int active_network = ((priv->status & STATUS_ASSOCIATED) && 7280 int active_network = ((priv->status & STATUS_ASSOCIATED) &&
7281 (network == priv->assoc_network)); 7281 (network == priv->assoc_network));
7282 7282
@@ -7286,22 +7286,22 @@ static int ipw_handle_beacon(struct net_device *dev,
7286} 7286}
7287 7287
7288static int ipw_handle_assoc_response(struct net_device *dev, 7288static int ipw_handle_assoc_response(struct net_device *dev,
7289 struct ieee80211_assoc_response *resp, 7289 struct libipw_assoc_response *resp,
7290 struct ieee80211_network *network) 7290 struct libipw_network *network)
7291{ 7291{
7292 struct ipw_priv *priv = ieee80211_priv(dev); 7292 struct ipw_priv *priv = libipw_priv(dev);
7293 ipw_qos_association_resp(priv, network); 7293 ipw_qos_association_resp(priv, network);
7294 return 0; 7294 return 0;
7295} 7295}
7296 7296
7297static int ipw_send_qos_params_command(struct ipw_priv *priv, struct ieee80211_qos_parameters 7297static int ipw_send_qos_params_command(struct ipw_priv *priv, struct libipw_qos_parameters
7298 *qos_param) 7298 *qos_param)
7299{ 7299{
7300 return ipw_send_cmd_pdu(priv, IPW_CMD_QOS_PARAMETERS, 7300 return ipw_send_cmd_pdu(priv, IPW_CMD_QOS_PARAMETERS,
7301 sizeof(*qos_param) * 3, qos_param); 7301 sizeof(*qos_param) * 3, qos_param);
7302} 7302}
7303 7303
7304static int ipw_send_qos_info_command(struct ipw_priv *priv, struct ieee80211_qos_information_element 7304static int ipw_send_qos_info_command(struct ipw_priv *priv, struct libipw_qos_information_element
7305 *qos_param) 7305 *qos_param)
7306{ 7306{
7307 return ipw_send_cmd_pdu(priv, IPW_CMD_WME_INFO, sizeof(*qos_param), 7307 return ipw_send_cmd_pdu(priv, IPW_CMD_WME_INFO, sizeof(*qos_param),
@@ -7311,7 +7311,7 @@ static int ipw_send_qos_info_command(struct ipw_priv *priv, struct ieee80211_qos
7311#endif /* CONFIG_IPW2200_QOS */ 7311#endif /* CONFIG_IPW2200_QOS */
7312 7312
7313static int ipw_associate_network(struct ipw_priv *priv, 7313static int ipw_associate_network(struct ipw_priv *priv,
7314 struct ieee80211_network *network, 7314 struct libipw_network *network,
7315 struct ipw_supported_rates *rates, int roaming) 7315 struct ipw_supported_rates *rates, int roaming)
7316{ 7316{
7317 int err; 7317 int err;
@@ -7493,7 +7493,7 @@ static int ipw_associate_network(struct ipw_priv *priv,
7493static void ipw_roam(void *data) 7493static void ipw_roam(void *data)
7494{ 7494{
7495 struct ipw_priv *priv = data; 7495 struct ipw_priv *priv = data;
7496 struct ieee80211_network *network = NULL; 7496 struct libipw_network *network = NULL;
7497 struct ipw_network_match match = { 7497 struct ipw_network_match match = {
7498 .network = priv->assoc_network 7498 .network = priv->assoc_network
7499 }; 7499 };
@@ -7568,7 +7568,7 @@ static int ipw_associate(void *data)
7568{ 7568{
7569 struct ipw_priv *priv = data; 7569 struct ipw_priv *priv = data;
7570 7570
7571 struct ieee80211_network *network = NULL; 7571 struct libipw_network *network = NULL;
7572 struct ipw_network_match match = { 7572 struct ipw_network_match match = {
7573 .network = NULL 7573 .network = NULL
7574 }; 7574 };
@@ -7622,8 +7622,8 @@ static int ipw_associate(void *data)
7622 priv->config & CFG_STATIC_CHANNEL) { 7622 priv->config & CFG_STATIC_CHANNEL) {
7623 /* Use oldest network if the free list is empty */ 7623 /* Use oldest network if the free list is empty */
7624 if (list_empty(&priv->ieee->network_free_list)) { 7624 if (list_empty(&priv->ieee->network_free_list)) {
7625 struct ieee80211_network *oldest = NULL; 7625 struct libipw_network *oldest = NULL;
7626 struct ieee80211_network *target; 7626 struct libipw_network *target;
7627 7627
7628 list_for_each_entry(target, &priv->ieee->network_list, list) { 7628 list_for_each_entry(target, &priv->ieee->network_list, list) {
7629 if ((oldest == NULL) || 7629 if ((oldest == NULL) ||
@@ -7644,7 +7644,7 @@ static int ipw_associate(void *data)
7644 } 7644 }
7645 7645
7646 element = priv->ieee->network_free_list.next; 7646 element = priv->ieee->network_free_list.next;
7647 network = list_entry(element, struct ieee80211_network, list); 7647 network = list_entry(element, struct libipw_network, list);
7648 ipw_adhoc_create(priv, network); 7648 ipw_adhoc_create(priv, network);
7649 rates = &priv->rates; 7649 rates = &priv->rates;
7650 list_del(element); 7650 list_del(element);
@@ -7700,18 +7700,18 @@ static void ipw_rebuild_decrypted_skb(struct ipw_priv *priv,
7700 switch (priv->ieee->sec.level) { 7700 switch (priv->ieee->sec.level) {
7701 case SEC_LEVEL_3: 7701 case SEC_LEVEL_3:
7702 /* Remove CCMP HDR */ 7702 /* Remove CCMP HDR */
7703 memmove(skb->data + IEEE80211_3ADDR_LEN, 7703 memmove(skb->data + LIBIPW_3ADDR_LEN,
7704 skb->data + IEEE80211_3ADDR_LEN + 8, 7704 skb->data + LIBIPW_3ADDR_LEN + 8,
7705 skb->len - IEEE80211_3ADDR_LEN - 8); 7705 skb->len - LIBIPW_3ADDR_LEN - 8);
7706 skb_trim(skb, skb->len - 16); /* CCMP_HDR_LEN + CCMP_MIC_LEN */ 7706 skb_trim(skb, skb->len - 16); /* CCMP_HDR_LEN + CCMP_MIC_LEN */
7707 break; 7707 break;
7708 case SEC_LEVEL_2: 7708 case SEC_LEVEL_2:
7709 break; 7709 break;
7710 case SEC_LEVEL_1: 7710 case SEC_LEVEL_1:
7711 /* Remove IV */ 7711 /* Remove IV */
7712 memmove(skb->data + IEEE80211_3ADDR_LEN, 7712 memmove(skb->data + LIBIPW_3ADDR_LEN,
7713 skb->data + IEEE80211_3ADDR_LEN + 4, 7713 skb->data + LIBIPW_3ADDR_LEN + 4,
7714 skb->len - IEEE80211_3ADDR_LEN - 4); 7714 skb->len - LIBIPW_3ADDR_LEN - 4);
7715 skb_trim(skb, skb->len - 8); /* IV + ICV */ 7715 skb_trim(skb, skb->len - 8); /* IV + ICV */
7716 break; 7716 break;
7717 case SEC_LEVEL_0: 7717 case SEC_LEVEL_0:
@@ -7725,10 +7725,10 @@ static void ipw_rebuild_decrypted_skb(struct ipw_priv *priv,
7725 7725
7726static void ipw_handle_data_packet(struct ipw_priv *priv, 7726static void ipw_handle_data_packet(struct ipw_priv *priv,
7727 struct ipw_rx_mem_buffer *rxb, 7727 struct ipw_rx_mem_buffer *rxb,
7728 struct ieee80211_rx_stats *stats) 7728 struct libipw_rx_stats *stats)
7729{ 7729{
7730 struct net_device *dev = priv->net_dev; 7730 struct net_device *dev = priv->net_dev;
7731 struct ieee80211_hdr_4addr *hdr; 7731 struct libipw_hdr_4addr *hdr;
7732 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; 7732 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data;
7733 7733
7734 /* We received data from the HW, so stop the watchdog */ 7734 /* We received data from the HW, so stop the watchdog */
@@ -7758,15 +7758,15 @@ static void ipw_handle_data_packet(struct ipw_priv *priv,
7758 IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len); 7758 IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len);
7759 7759
7760 /* HW decrypt will not clear the WEP bit, MIC, PN, etc. */ 7760 /* HW decrypt will not clear the WEP bit, MIC, PN, etc. */
7761 hdr = (struct ieee80211_hdr_4addr *)rxb->skb->data; 7761 hdr = (struct libipw_hdr_4addr *)rxb->skb->data;
7762 if (priv->ieee->iw_mode != IW_MODE_MONITOR && 7762 if (priv->ieee->iw_mode != IW_MODE_MONITOR &&
7763 (is_multicast_ether_addr(hdr->addr1) ? 7763 (is_multicast_ether_addr(hdr->addr1) ?
7764 !priv->ieee->host_mc_decrypt : !priv->ieee->host_decrypt)) 7764 !priv->ieee->host_mc_decrypt : !priv->ieee->host_decrypt))
7765 ipw_rebuild_decrypted_skb(priv, rxb->skb); 7765 ipw_rebuild_decrypted_skb(priv, rxb->skb);
7766 7766
7767 if (!ieee80211_rx(priv->ieee, rxb->skb, stats)) 7767 if (!libipw_rx(priv->ieee, rxb->skb, stats))
7768 dev->stats.rx_errors++; 7768 dev->stats.rx_errors++;
7769 else { /* ieee80211_rx succeeded, so it now owns the SKB */ 7769 else { /* libipw_rx succeeded, so it now owns the SKB */
7770 rxb->skb = NULL; 7770 rxb->skb = NULL;
7771 __ipw_led_activity_on(priv); 7771 __ipw_led_activity_on(priv);
7772 } 7772 }
@@ -7775,7 +7775,7 @@ static void ipw_handle_data_packet(struct ipw_priv *priv,
7775#ifdef CONFIG_IPW2200_RADIOTAP 7775#ifdef CONFIG_IPW2200_RADIOTAP
7776static void ipw_handle_data_packet_monitor(struct ipw_priv *priv, 7776static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7777 struct ipw_rx_mem_buffer *rxb, 7777 struct ipw_rx_mem_buffer *rxb,
7778 struct ieee80211_rx_stats *stats) 7778 struct libipw_rx_stats *stats)
7779{ 7779{
7780 struct net_device *dev = priv->net_dev; 7780 struct net_device *dev = priv->net_dev;
7781 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; 7781 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data;
@@ -7921,9 +7921,9 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7921 7921
7922 IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len); 7922 IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len);
7923 7923
7924 if (!ieee80211_rx(priv->ieee, rxb->skb, stats)) 7924 if (!libipw_rx(priv->ieee, rxb->skb, stats))
7925 dev->stats.rx_errors++; 7925 dev->stats.rx_errors++;
7926 else { /* ieee80211_rx succeeded, so it now owns the SKB */ 7926 else { /* libipw_rx succeeded, so it now owns the SKB */
7927 rxb->skb = NULL; 7927 rxb->skb = NULL;
7928 /* no LED during capture */ 7928 /* no LED during capture */
7929 } 7929 }
@@ -7931,28 +7931,28 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7931#endif 7931#endif
7932 7932
7933#ifdef CONFIG_IPW2200_PROMISCUOUS 7933#ifdef CONFIG_IPW2200_PROMISCUOUS
7934#define ieee80211_is_probe_response(fc) \ 7934#define libipw_is_probe_response(fc) \
7935 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && \ 7935 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && \
7936 (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP ) 7936 (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP )
7937 7937
7938#define ieee80211_is_management(fc) \ 7938#define libipw_is_management(fc) \
7939 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) 7939 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)
7940 7940
7941#define ieee80211_is_control(fc) \ 7941#define libipw_is_control(fc) \
7942 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) 7942 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL)
7943 7943
7944#define ieee80211_is_data(fc) \ 7944#define libipw_is_data(fc) \
7945 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) 7945 ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA)
7946 7946
7947#define ieee80211_is_assoc_request(fc) \ 7947#define libipw_is_assoc_request(fc) \
7948 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ) 7948 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ)
7949 7949
7950#define ieee80211_is_reassoc_request(fc) \ 7950#define libipw_is_reassoc_request(fc) \
7951 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_REQ) 7951 ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_REQ)
7952 7952
7953static void ipw_handle_promiscuous_rx(struct ipw_priv *priv, 7953static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
7954 struct ipw_rx_mem_buffer *rxb, 7954 struct ipw_rx_mem_buffer *rxb,
7955 struct ieee80211_rx_stats *stats) 7955 struct libipw_rx_stats *stats)
7956{ 7956{
7957 struct net_device *dev = priv->prom_net_dev; 7957 struct net_device *dev = priv->prom_net_dev;
7958 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; 7958 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data;
@@ -8002,17 +8002,17 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8002 } 8002 }
8003 8003
8004 hdr = (void *)rxb->skb->data + IPW_RX_FRAME_SIZE; 8004 hdr = (void *)rxb->skb->data + IPW_RX_FRAME_SIZE;
8005 if (ieee80211_is_management(le16_to_cpu(hdr->frame_control))) { 8005 if (libipw_is_management(le16_to_cpu(hdr->frame_control))) {
8006 if (filter & IPW_PROM_NO_MGMT) 8006 if (filter & IPW_PROM_NO_MGMT)
8007 return; 8007 return;
8008 if (filter & IPW_PROM_MGMT_HEADER_ONLY) 8008 if (filter & IPW_PROM_MGMT_HEADER_ONLY)
8009 hdr_only = 1; 8009 hdr_only = 1;
8010 } else if (ieee80211_is_control(le16_to_cpu(hdr->frame_control))) { 8010 } else if (libipw_is_control(le16_to_cpu(hdr->frame_control))) {
8011 if (filter & IPW_PROM_NO_CTL) 8011 if (filter & IPW_PROM_NO_CTL)
8012 return; 8012 return;
8013 if (filter & IPW_PROM_CTL_HEADER_ONLY) 8013 if (filter & IPW_PROM_CTL_HEADER_ONLY)
8014 hdr_only = 1; 8014 hdr_only = 1;
8015 } else if (ieee80211_is_data(le16_to_cpu(hdr->frame_control))) { 8015 } else if (libipw_is_data(le16_to_cpu(hdr->frame_control))) {
8016 if (filter & IPW_PROM_NO_DATA) 8016 if (filter & IPW_PROM_NO_DATA)
8017 return; 8017 return;
8018 if (filter & IPW_PROM_DATA_HEADER_ONLY) 8018 if (filter & IPW_PROM_DATA_HEADER_ONLY)
@@ -8030,7 +8030,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8030 ipw_rt = (void *)skb->data; 8030 ipw_rt = (void *)skb->data;
8031 8031
8032 if (hdr_only) 8032 if (hdr_only)
8033 len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); 8033 len = libipw_get_hdrlen(le16_to_cpu(hdr->frame_control));
8034 8034
8035 memcpy(ipw_rt->payload, hdr, len); 8035 memcpy(ipw_rt->payload, hdr, len);
8036 8036
@@ -8127,7 +8127,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8127 8127
8128 IPW_DEBUG_RX("Rx packet of %d bytes.\n", skb->len); 8128 IPW_DEBUG_RX("Rx packet of %d bytes.\n", skb->len);
8129 8129
8130 if (!ieee80211_rx(priv->prom_priv->ieee, skb, stats)) { 8130 if (!libipw_rx(priv->prom_priv->ieee, skb, stats)) {
8131 dev->stats.rx_errors++; 8131 dev->stats.rx_errors++;
8132 dev_kfree_skb_any(skb); 8132 dev_kfree_skb_any(skb);
8133 } 8133 }
@@ -8135,7 +8135,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8135#endif 8135#endif
8136 8136
8137static int is_network_packet(struct ipw_priv *priv, 8137static int is_network_packet(struct ipw_priv *priv,
8138 struct ieee80211_hdr_4addr *header) 8138 struct libipw_hdr_4addr *header)
8139{ 8139{
8140 /* Filter incoming packets to determine if they are targetted toward 8140 /* Filter incoming packets to determine if they are targetted toward
8141 * this network, discarding packets coming from ourselves */ 8141 * this network, discarding packets coming from ourselves */
@@ -8173,7 +8173,7 @@ static int is_network_packet(struct ipw_priv *priv,
8173#define IPW_PACKET_RETRY_TIME HZ 8173#define IPW_PACKET_RETRY_TIME HZ
8174 8174
8175static int is_duplicate_packet(struct ipw_priv *priv, 8175static int is_duplicate_packet(struct ipw_priv *priv,
8176 struct ieee80211_hdr_4addr *header) 8176 struct libipw_hdr_4addr *header)
8177{ 8177{
8178 u16 sc = le16_to_cpu(header->seq_ctl); 8178 u16 sc = le16_to_cpu(header->seq_ctl);
8179 u16 seq = WLAN_GET_SEQ_SEQ(sc); 8179 u16 seq = WLAN_GET_SEQ_SEQ(sc);
@@ -8247,14 +8247,14 @@ static int is_duplicate_packet(struct ipw_priv *priv,
8247 8247
8248static void ipw_handle_mgmt_packet(struct ipw_priv *priv, 8248static void ipw_handle_mgmt_packet(struct ipw_priv *priv,
8249 struct ipw_rx_mem_buffer *rxb, 8249 struct ipw_rx_mem_buffer *rxb,
8250 struct ieee80211_rx_stats *stats) 8250 struct libipw_rx_stats *stats)
8251{ 8251{
8252 struct sk_buff *skb = rxb->skb; 8252 struct sk_buff *skb = rxb->skb;
8253 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)skb->data; 8253 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)skb->data;
8254 struct ieee80211_hdr_4addr *header = (struct ieee80211_hdr_4addr *) 8254 struct libipw_hdr_4addr *header = (struct libipw_hdr_4addr *)
8255 (skb->data + IPW_RX_FRAME_SIZE); 8255 (skb->data + IPW_RX_FRAME_SIZE);
8256 8256
8257 ieee80211_rx_mgt(priv->ieee, header, stats); 8257 libipw_rx_mgt(priv->ieee, header, stats);
8258 8258
8259 if (priv->ieee->iw_mode == IW_MODE_ADHOC && 8259 if (priv->ieee->iw_mode == IW_MODE_ADHOC &&
8260 ((WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) == 8260 ((WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) ==
@@ -8276,12 +8276,12 @@ static void ipw_handle_mgmt_packet(struct ipw_priv *priv,
8276 /* Advance past the ipw packet header to the 802.11 frame */ 8276 /* Advance past the ipw packet header to the 802.11 frame */
8277 skb_pull(skb, IPW_RX_FRAME_SIZE); 8277 skb_pull(skb, IPW_RX_FRAME_SIZE);
8278 8278
8279 /* Push the ieee80211_rx_stats before the 802.11 frame */ 8279 /* Push the libipw_rx_stats before the 802.11 frame */
8280 memcpy(skb_push(skb, sizeof(*stats)), stats, sizeof(*stats)); 8280 memcpy(skb_push(skb, sizeof(*stats)), stats, sizeof(*stats));
8281 8281
8282 skb->dev = priv->ieee->dev; 8282 skb->dev = priv->ieee->dev;
8283 8283
8284 /* Point raw at the ieee80211_stats */ 8284 /* Point raw at the libipw_stats */
8285 skb_reset_mac_header(skb); 8285 skb_reset_mac_header(skb);
8286 8286
8287 skb->pkt_type = PACKET_OTHERHOST; 8287 skb->pkt_type = PACKET_OTHERHOST;
@@ -8301,7 +8301,7 @@ static void ipw_rx(struct ipw_priv *priv)
8301{ 8301{
8302 struct ipw_rx_mem_buffer *rxb; 8302 struct ipw_rx_mem_buffer *rxb;
8303 struct ipw_rx_packet *pkt; 8303 struct ipw_rx_packet *pkt;
8304 struct ieee80211_hdr_4addr *header; 8304 struct libipw_hdr_4addr *header;
8305 u32 r, w, i; 8305 u32 r, w, i;
8306 u8 network_packet; 8306 u8 network_packet;
8307 u8 fill_rx = 0; 8307 u8 fill_rx = 0;
@@ -8332,7 +8332,7 @@ static void ipw_rx(struct ipw_priv *priv)
8332 8332
8333 switch (pkt->header.message_type) { 8333 switch (pkt->header.message_type) {
8334 case RX_FRAME_TYPE: /* 802.11 frame */ { 8334 case RX_FRAME_TYPE: /* 802.11 frame */ {
8335 struct ieee80211_rx_stats stats = { 8335 struct libipw_rx_stats stats = {
8336 .rssi = pkt->u.frame.rssi_dbm - 8336 .rssi = pkt->u.frame.rssi_dbm -
8337 IPW_RSSI_TO_DBM, 8337 IPW_RSSI_TO_DBM,
8338 .signal = 8338 .signal =
@@ -8347,19 +8347,19 @@ static void ipw_rx(struct ipw_priv *priv)
8347 .freq = 8347 .freq =
8348 (pkt->u.frame. 8348 (pkt->u.frame.
8349 control & (1 << 0)) ? 8349 control & (1 << 0)) ?
8350 IEEE80211_24GHZ_BAND : 8350 LIBIPW_24GHZ_BAND :
8351 IEEE80211_52GHZ_BAND, 8351 LIBIPW_52GHZ_BAND,
8352 .len = le16_to_cpu(pkt->u.frame.length), 8352 .len = le16_to_cpu(pkt->u.frame.length),
8353 }; 8353 };
8354 8354
8355 if (stats.rssi != 0) 8355 if (stats.rssi != 0)
8356 stats.mask |= IEEE80211_STATMASK_RSSI; 8356 stats.mask |= LIBIPW_STATMASK_RSSI;
8357 if (stats.signal != 0) 8357 if (stats.signal != 0)
8358 stats.mask |= IEEE80211_STATMASK_SIGNAL; 8358 stats.mask |= LIBIPW_STATMASK_SIGNAL;
8359 if (stats.noise != 0) 8359 if (stats.noise != 0)
8360 stats.mask |= IEEE80211_STATMASK_NOISE; 8360 stats.mask |= LIBIPW_STATMASK_NOISE;
8361 if (stats.rate != 0) 8361 if (stats.rate != 0)
8362 stats.mask |= IEEE80211_STATMASK_RATE; 8362 stats.mask |= LIBIPW_STATMASK_RATE;
8363 8363
8364 priv->rx_packets++; 8364 priv->rx_packets++;
8365 8365
@@ -8384,7 +8384,7 @@ static void ipw_rx(struct ipw_priv *priv)
8384#endif 8384#endif
8385 8385
8386 header = 8386 header =
8387 (struct ieee80211_hdr_4addr *)(rxb->skb-> 8387 (struct libipw_hdr_4addr *)(rxb->skb->
8388 data + 8388 data +
8389 IPW_RX_FRAME_SIZE); 8389 IPW_RX_FRAME_SIZE);
8390 /* TODO: Check Ad-Hoc dest/source and make sure 8390 /* TODO: Check Ad-Hoc dest/source and make sure
@@ -8407,7 +8407,7 @@ static void ipw_rx(struct ipw_priv *priv)
8407 le16_to_cpu(pkt->u.frame.length)); 8407 le16_to_cpu(pkt->u.frame.length));
8408 8408
8409 if (le16_to_cpu(pkt->u.frame.length) < 8409 if (le16_to_cpu(pkt->u.frame.length) <
8410 ieee80211_get_hdrlen(le16_to_cpu( 8410 libipw_get_hdrlen(le16_to_cpu(
8411 header->frame_ctl))) { 8411 header->frame_ctl))) {
8412 IPW_DEBUG_DROP 8412 IPW_DEBUG_DROP
8413 ("Received packet is too small. " 8413 ("Received packet is too small. "
@@ -8592,9 +8592,9 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
8592 ": Detected Intel PRO/Wireless 2915ABG Network " 8592 ": Detected Intel PRO/Wireless 2915ABG Network "
8593 "Connection\n"); 8593 "Connection\n");
8594 priv->ieee->abg_true = 1; 8594 priv->ieee->abg_true = 1;
8595 band = IEEE80211_52GHZ_BAND | IEEE80211_24GHZ_BAND; 8595 band = LIBIPW_52GHZ_BAND | LIBIPW_24GHZ_BAND;
8596 modulation = IEEE80211_OFDM_MODULATION | 8596 modulation = LIBIPW_OFDM_MODULATION |
8597 IEEE80211_CCK_MODULATION; 8597 LIBIPW_CCK_MODULATION;
8598 priv->adapter = IPW_2915ABG; 8598 priv->adapter = IPW_2915ABG;
8599 priv->ieee->mode = IEEE_A | IEEE_G | IEEE_B; 8599 priv->ieee->mode = IEEE_A | IEEE_G | IEEE_B;
8600 } else { 8600 } else {
@@ -8604,9 +8604,9 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
8604 "Connection\n"); 8604 "Connection\n");
8605 8605
8606 priv->ieee->abg_true = 0; 8606 priv->ieee->abg_true = 0;
8607 band = IEEE80211_24GHZ_BAND; 8607 band = LIBIPW_24GHZ_BAND;
8608 modulation = IEEE80211_OFDM_MODULATION | 8608 modulation = LIBIPW_OFDM_MODULATION |
8609 IEEE80211_CCK_MODULATION; 8609 LIBIPW_CCK_MODULATION;
8610 priv->adapter = IPW_2200BG; 8610 priv->adapter = IPW_2200BG;
8611 priv->ieee->mode = IEEE_G | IEEE_B; 8611 priv->ieee->mode = IEEE_G | IEEE_B;
8612 } 8612 }
@@ -8614,7 +8614,7 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
8614 priv->ieee->freq_band = band; 8614 priv->ieee->freq_band = band;
8615 priv->ieee->modulation = modulation; 8615 priv->ieee->modulation = modulation;
8616 8616
8617 priv->rates_mask = IEEE80211_DEFAULT_RATES_MASK; 8617 priv->rates_mask = LIBIPW_DEFAULT_RATES_MASK;
8618 8618
8619 priv->disassociate_threshold = IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT; 8619 priv->disassociate_threshold = IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT;
8620 priv->roaming_threshold = IPW_MB_ROAMING_THRESHOLD_DEFAULT; 8620 priv->roaming_threshold = IPW_MB_ROAMING_THRESHOLD_DEFAULT;
@@ -8644,7 +8644,7 @@ static int ipw_wx_get_name(struct net_device *dev,
8644 struct iw_request_info *info, 8644 struct iw_request_info *info,
8645 union iwreq_data *wrqu, char *extra) 8645 union iwreq_data *wrqu, char *extra)
8646{ 8646{
8647 struct ipw_priv *priv = ieee80211_priv(dev); 8647 struct ipw_priv *priv = libipw_priv(dev);
8648 mutex_lock(&priv->mutex); 8648 mutex_lock(&priv->mutex);
8649 if (priv->status & STATUS_RF_KILL_MASK) 8649 if (priv->status & STATUS_RF_KILL_MASK)
8650 strcpy(wrqu->name, "radio off"); 8650 strcpy(wrqu->name, "radio off");
@@ -8714,8 +8714,8 @@ static int ipw_wx_set_freq(struct net_device *dev,
8714 struct iw_request_info *info, 8714 struct iw_request_info *info,
8715 union iwreq_data *wrqu, char *extra) 8715 union iwreq_data *wrqu, char *extra)
8716{ 8716{
8717 struct ipw_priv *priv = ieee80211_priv(dev); 8717 struct ipw_priv *priv = libipw_priv(dev);
8718 const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); 8718 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
8719 struct iw_freq *fwrq = &wrqu->freq; 8719 struct iw_freq *fwrq = &wrqu->freq;
8720 int ret = 0, i; 8720 int ret = 0, i;
8721 u8 channel, flags; 8721 u8 channel, flags;
@@ -8730,23 +8730,23 @@ static int ipw_wx_set_freq(struct net_device *dev,
8730 } 8730 }
8731 /* if setting by freq convert to channel */ 8731 /* if setting by freq convert to channel */
8732 if (fwrq->e == 1) { 8732 if (fwrq->e == 1) {
8733 channel = ieee80211_freq_to_channel(priv->ieee, fwrq->m); 8733 channel = libipw_freq_to_channel(priv->ieee, fwrq->m);
8734 if (channel == 0) 8734 if (channel == 0)
8735 return -EINVAL; 8735 return -EINVAL;
8736 } else 8736 } else
8737 channel = fwrq->m; 8737 channel = fwrq->m;
8738 8738
8739 if (!(band = ieee80211_is_valid_channel(priv->ieee, channel))) 8739 if (!(band = libipw_is_valid_channel(priv->ieee, channel)))
8740 return -EINVAL; 8740 return -EINVAL;
8741 8741
8742 if (priv->ieee->iw_mode == IW_MODE_ADHOC) { 8742 if (priv->ieee->iw_mode == IW_MODE_ADHOC) {
8743 i = ieee80211_channel_to_index(priv->ieee, channel); 8743 i = libipw_channel_to_index(priv->ieee, channel);
8744 if (i == -1) 8744 if (i == -1)
8745 return -EINVAL; 8745 return -EINVAL;
8746 8746
8747 flags = (band == IEEE80211_24GHZ_BAND) ? 8747 flags = (band == LIBIPW_24GHZ_BAND) ?
8748 geo->bg[i].flags : geo->a[i].flags; 8748 geo->bg[i].flags : geo->a[i].flags;
8749 if (flags & IEEE80211_CH_PASSIVE_ONLY) { 8749 if (flags & LIBIPW_CH_PASSIVE_ONLY) {
8750 IPW_DEBUG_WX("Invalid Ad-Hoc channel for 802.11a\n"); 8750 IPW_DEBUG_WX("Invalid Ad-Hoc channel for 802.11a\n");
8751 return -EINVAL; 8751 return -EINVAL;
8752 } 8752 }
@@ -8763,7 +8763,7 @@ static int ipw_wx_get_freq(struct net_device *dev,
8763 struct iw_request_info *info, 8763 struct iw_request_info *info,
8764 union iwreq_data *wrqu, char *extra) 8764 union iwreq_data *wrqu, char *extra)
8765{ 8765{
8766 struct ipw_priv *priv = ieee80211_priv(dev); 8766 struct ipw_priv *priv = libipw_priv(dev);
8767 8767
8768 wrqu->freq.e = 0; 8768 wrqu->freq.e = 0;
8769 8769
@@ -8774,16 +8774,16 @@ static int ipw_wx_get_freq(struct net_device *dev,
8774 priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED)) { 8774 priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED)) {
8775 int i; 8775 int i;
8776 8776
8777 i = ieee80211_channel_to_index(priv->ieee, priv->channel); 8777 i = libipw_channel_to_index(priv->ieee, priv->channel);
8778 BUG_ON(i == -1); 8778 BUG_ON(i == -1);
8779 wrqu->freq.e = 1; 8779 wrqu->freq.e = 1;
8780 8780
8781 switch (ieee80211_is_valid_channel(priv->ieee, priv->channel)) { 8781 switch (libipw_is_valid_channel(priv->ieee, priv->channel)) {
8782 case IEEE80211_52GHZ_BAND: 8782 case LIBIPW_52GHZ_BAND:
8783 wrqu->freq.m = priv->ieee->geo.a[i].freq * 100000; 8783 wrqu->freq.m = priv->ieee->geo.a[i].freq * 100000;
8784 break; 8784 break;
8785 8785
8786 case IEEE80211_24GHZ_BAND: 8786 case LIBIPW_24GHZ_BAND:
8787 wrqu->freq.m = priv->ieee->geo.bg[i].freq * 100000; 8787 wrqu->freq.m = priv->ieee->geo.bg[i].freq * 100000;
8788 break; 8788 break;
8789 8789
@@ -8802,7 +8802,7 @@ static int ipw_wx_set_mode(struct net_device *dev,
8802 struct iw_request_info *info, 8802 struct iw_request_info *info,
8803 union iwreq_data *wrqu, char *extra) 8803 union iwreq_data *wrqu, char *extra)
8804{ 8804{
8805 struct ipw_priv *priv = ieee80211_priv(dev); 8805 struct ipw_priv *priv = libipw_priv(dev);
8806 int err = 0; 8806 int err = 0;
8807 8807
8808 IPW_DEBUG_WX("Set MODE: %d\n", wrqu->mode); 8808 IPW_DEBUG_WX("Set MODE: %d\n", wrqu->mode);
@@ -8854,7 +8854,7 @@ static int ipw_wx_get_mode(struct net_device *dev,
8854 struct iw_request_info *info, 8854 struct iw_request_info *info,
8855 union iwreq_data *wrqu, char *extra) 8855 union iwreq_data *wrqu, char *extra)
8856{ 8856{
8857 struct ipw_priv *priv = ieee80211_priv(dev); 8857 struct ipw_priv *priv = libipw_priv(dev);
8858 mutex_lock(&priv->mutex); 8858 mutex_lock(&priv->mutex);
8859 wrqu->mode = priv->ieee->iw_mode; 8859 wrqu->mode = priv->ieee->iw_mode;
8860 IPW_DEBUG_WX("Get MODE -> %d\n", wrqu->mode); 8860 IPW_DEBUG_WX("Get MODE -> %d\n", wrqu->mode);
@@ -8883,9 +8883,9 @@ static int ipw_wx_get_range(struct net_device *dev,
8883 struct iw_request_info *info, 8883 struct iw_request_info *info,
8884 union iwreq_data *wrqu, char *extra) 8884 union iwreq_data *wrqu, char *extra)
8885{ 8885{
8886 struct ipw_priv *priv = ieee80211_priv(dev); 8886 struct ipw_priv *priv = libipw_priv(dev);
8887 struct iw_range *range = (struct iw_range *)extra; 8887 struct iw_range *range = (struct iw_range *)extra;
8888 const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); 8888 const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
8889 int i = 0, j; 8889 int i = 0, j;
8890 8890
8891 wrqu->data.length = sizeof(*range); 8891 wrqu->data.length = sizeof(*range);
@@ -8929,7 +8929,7 @@ static int ipw_wx_get_range(struct net_device *dev,
8929 if (priv->ieee->mode & (IEEE_B | IEEE_G)) { 8929 if (priv->ieee->mode & (IEEE_B | IEEE_G)) {
8930 for (j = 0; j < geo->bg_channels && i < IW_MAX_FREQUENCIES; j++) { 8930 for (j = 0; j < geo->bg_channels && i < IW_MAX_FREQUENCIES; j++) {
8931 if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && 8931 if ((priv->ieee->iw_mode == IW_MODE_ADHOC) &&
8932 (geo->bg[j].flags & IEEE80211_CH_PASSIVE_ONLY)) 8932 (geo->bg[j].flags & LIBIPW_CH_PASSIVE_ONLY))
8933 continue; 8933 continue;
8934 8934
8935 range->freq[i].i = geo->bg[j].channel; 8935 range->freq[i].i = geo->bg[j].channel;
@@ -8942,7 +8942,7 @@ static int ipw_wx_get_range(struct net_device *dev,
8942 if (priv->ieee->mode & IEEE_A) { 8942 if (priv->ieee->mode & IEEE_A) {
8943 for (j = 0; j < geo->a_channels && i < IW_MAX_FREQUENCIES; j++) { 8943 for (j = 0; j < geo->a_channels && i < IW_MAX_FREQUENCIES; j++) {
8944 if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && 8944 if ((priv->ieee->iw_mode == IW_MODE_ADHOC) &&
8945 (geo->a[j].flags & IEEE80211_CH_PASSIVE_ONLY)) 8945 (geo->a[j].flags & LIBIPW_CH_PASSIVE_ONLY))
8946 continue; 8946 continue;
8947 8947
8948 range->freq[i].i = geo->a[j].channel; 8948 range->freq[i].i = geo->a[j].channel;
@@ -8977,7 +8977,7 @@ static int ipw_wx_set_wap(struct net_device *dev,
8977 struct iw_request_info *info, 8977 struct iw_request_info *info,
8978 union iwreq_data *wrqu, char *extra) 8978 union iwreq_data *wrqu, char *extra)
8979{ 8979{
8980 struct ipw_priv *priv = ieee80211_priv(dev); 8980 struct ipw_priv *priv = libipw_priv(dev);
8981 8981
8982 static const unsigned char any[] = { 8982 static const unsigned char any[] = {
8983 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 8983 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
@@ -9026,7 +9026,7 @@ static int ipw_wx_get_wap(struct net_device *dev,
9026 struct iw_request_info *info, 9026 struct iw_request_info *info,
9027 union iwreq_data *wrqu, char *extra) 9027 union iwreq_data *wrqu, char *extra)
9028{ 9028{
9029 struct ipw_priv *priv = ieee80211_priv(dev); 9029 struct ipw_priv *priv = libipw_priv(dev);
9030 9030
9031 /* If we are associated, trying to associate, or have a statically 9031 /* If we are associated, trying to associate, or have a statically
9032 * configured BSSID then return that; otherwise return ANY */ 9032 * configured BSSID then return that; otherwise return ANY */
@@ -9048,7 +9048,7 @@ static int ipw_wx_set_essid(struct net_device *dev,
9048 struct iw_request_info *info, 9048 struct iw_request_info *info,
9049 union iwreq_data *wrqu, char *extra) 9049 union iwreq_data *wrqu, char *extra)
9050{ 9050{
9051 struct ipw_priv *priv = ieee80211_priv(dev); 9051 struct ipw_priv *priv = libipw_priv(dev);
9052 int length; 9052 int length;
9053 DECLARE_SSID_BUF(ssid); 9053 DECLARE_SSID_BUF(ssid);
9054 9054
@@ -9094,7 +9094,7 @@ static int ipw_wx_get_essid(struct net_device *dev,
9094 struct iw_request_info *info, 9094 struct iw_request_info *info,
9095 union iwreq_data *wrqu, char *extra) 9095 union iwreq_data *wrqu, char *extra)
9096{ 9096{
9097 struct ipw_priv *priv = ieee80211_priv(dev); 9097 struct ipw_priv *priv = libipw_priv(dev);
9098 DECLARE_SSID_BUF(ssid); 9098 DECLARE_SSID_BUF(ssid);
9099 9099
9100 /* If we are associated, trying to associate, or have a statically 9100 /* If we are associated, trying to associate, or have a statically
@@ -9120,7 +9120,7 @@ static int ipw_wx_set_nick(struct net_device *dev,
9120 struct iw_request_info *info, 9120 struct iw_request_info *info,
9121 union iwreq_data *wrqu, char *extra) 9121 union iwreq_data *wrqu, char *extra)
9122{ 9122{
9123 struct ipw_priv *priv = ieee80211_priv(dev); 9123 struct ipw_priv *priv = libipw_priv(dev);
9124 9124
9125 IPW_DEBUG_WX("Setting nick to '%s'\n", extra); 9125 IPW_DEBUG_WX("Setting nick to '%s'\n", extra);
9126 if (wrqu->data.length > IW_ESSID_MAX_SIZE) 9126 if (wrqu->data.length > IW_ESSID_MAX_SIZE)
@@ -9139,7 +9139,7 @@ static int ipw_wx_get_nick(struct net_device *dev,
9139 struct iw_request_info *info, 9139 struct iw_request_info *info,
9140 union iwreq_data *wrqu, char *extra) 9140 union iwreq_data *wrqu, char *extra)
9141{ 9141{
9142 struct ipw_priv *priv = ieee80211_priv(dev); 9142 struct ipw_priv *priv = libipw_priv(dev);
9143 IPW_DEBUG_WX("Getting nick\n"); 9143 IPW_DEBUG_WX("Getting nick\n");
9144 mutex_lock(&priv->mutex); 9144 mutex_lock(&priv->mutex);
9145 wrqu->data.length = strlen(priv->nick); 9145 wrqu->data.length = strlen(priv->nick);
@@ -9153,7 +9153,7 @@ static int ipw_wx_set_sens(struct net_device *dev,
9153 struct iw_request_info *info, 9153 struct iw_request_info *info,
9154 union iwreq_data *wrqu, char *extra) 9154 union iwreq_data *wrqu, char *extra)
9155{ 9155{
9156 struct ipw_priv *priv = ieee80211_priv(dev); 9156 struct ipw_priv *priv = libipw_priv(dev);
9157 int err = 0; 9157 int err = 0;
9158 9158
9159 IPW_DEBUG_WX("Setting roaming threshold to %d\n", wrqu->sens.value); 9159 IPW_DEBUG_WX("Setting roaming threshold to %d\n", wrqu->sens.value);
@@ -9183,7 +9183,7 @@ static int ipw_wx_get_sens(struct net_device *dev,
9183 struct iw_request_info *info, 9183 struct iw_request_info *info,
9184 union iwreq_data *wrqu, char *extra) 9184 union iwreq_data *wrqu, char *extra)
9185{ 9185{
9186 struct ipw_priv *priv = ieee80211_priv(dev); 9186 struct ipw_priv *priv = libipw_priv(dev);
9187 mutex_lock(&priv->mutex); 9187 mutex_lock(&priv->mutex);
9188 wrqu->sens.fixed = 1; 9188 wrqu->sens.fixed = 1;
9189 wrqu->sens.value = priv->roaming_threshold; 9189 wrqu->sens.value = priv->roaming_threshold;
@@ -9200,7 +9200,7 @@ static int ipw_wx_set_rate(struct net_device *dev,
9200 union iwreq_data *wrqu, char *extra) 9200 union iwreq_data *wrqu, char *extra)
9201{ 9201{
9202 /* TODO: We should use semaphores or locks for access to priv */ 9202 /* TODO: We should use semaphores or locks for access to priv */
9203 struct ipw_priv *priv = ieee80211_priv(dev); 9203 struct ipw_priv *priv = libipw_priv(dev);
9204 u32 target_rate = wrqu->bitrate.value; 9204 u32 target_rate = wrqu->bitrate.value;
9205 u32 fixed, mask; 9205 u32 fixed, mask;
9206 9206
@@ -9210,7 +9210,7 @@ static int ipw_wx_set_rate(struct net_device *dev,
9210 9210
9211 if (target_rate == -1) { 9211 if (target_rate == -1) {
9212 fixed = 0; 9212 fixed = 0;
9213 mask = IEEE80211_DEFAULT_RATES_MASK; 9213 mask = LIBIPW_DEFAULT_RATES_MASK;
9214 /* Now we should reassociate */ 9214 /* Now we should reassociate */
9215 goto apply; 9215 goto apply;
9216 } 9216 }
@@ -9219,62 +9219,62 @@ static int ipw_wx_set_rate(struct net_device *dev,
9219 fixed = wrqu->bitrate.fixed; 9219 fixed = wrqu->bitrate.fixed;
9220 9220
9221 if (target_rate == 1000000 || !fixed) 9221 if (target_rate == 1000000 || !fixed)
9222 mask |= IEEE80211_CCK_RATE_1MB_MASK; 9222 mask |= LIBIPW_CCK_RATE_1MB_MASK;
9223 if (target_rate == 1000000) 9223 if (target_rate == 1000000)
9224 goto apply; 9224 goto apply;
9225 9225
9226 if (target_rate == 2000000 || !fixed) 9226 if (target_rate == 2000000 || !fixed)
9227 mask |= IEEE80211_CCK_RATE_2MB_MASK; 9227 mask |= LIBIPW_CCK_RATE_2MB_MASK;
9228 if (target_rate == 2000000) 9228 if (target_rate == 2000000)
9229 goto apply; 9229 goto apply;
9230 9230
9231 if (target_rate == 5500000 || !fixed) 9231 if (target_rate == 5500000 || !fixed)
9232 mask |= IEEE80211_CCK_RATE_5MB_MASK; 9232 mask |= LIBIPW_CCK_RATE_5MB_MASK;
9233 if (target_rate == 5500000) 9233 if (target_rate == 5500000)
9234 goto apply; 9234 goto apply;
9235 9235
9236 if (target_rate == 6000000 || !fixed) 9236 if (target_rate == 6000000 || !fixed)
9237 mask |= IEEE80211_OFDM_RATE_6MB_MASK; 9237 mask |= LIBIPW_OFDM_RATE_6MB_MASK;
9238 if (target_rate == 6000000) 9238 if (target_rate == 6000000)
9239 goto apply; 9239 goto apply;
9240 9240
9241 if (target_rate == 9000000 || !fixed) 9241 if (target_rate == 9000000 || !fixed)
9242 mask |= IEEE80211_OFDM_RATE_9MB_MASK; 9242 mask |= LIBIPW_OFDM_RATE_9MB_MASK;
9243 if (target_rate == 9000000) 9243 if (target_rate == 9000000)
9244 goto apply; 9244 goto apply;
9245 9245
9246 if (target_rate == 11000000 || !fixed) 9246 if (target_rate == 11000000 || !fixed)
9247 mask |= IEEE80211_CCK_RATE_11MB_MASK; 9247 mask |= LIBIPW_CCK_RATE_11MB_MASK;
9248 if (target_rate == 11000000) 9248 if (target_rate == 11000000)
9249 goto apply; 9249 goto apply;
9250 9250
9251 if (target_rate == 12000000 || !fixed) 9251 if (target_rate == 12000000 || !fixed)
9252 mask |= IEEE80211_OFDM_RATE_12MB_MASK; 9252 mask |= LIBIPW_OFDM_RATE_12MB_MASK;
9253 if (target_rate == 12000000) 9253 if (target_rate == 12000000)
9254 goto apply; 9254 goto apply;
9255 9255
9256 if (target_rate == 18000000 || !fixed) 9256 if (target_rate == 18000000 || !fixed)
9257 mask |= IEEE80211_OFDM_RATE_18MB_MASK; 9257 mask |= LIBIPW_OFDM_RATE_18MB_MASK;
9258 if (target_rate == 18000000) 9258 if (target_rate == 18000000)
9259 goto apply; 9259 goto apply;
9260 9260
9261 if (target_rate == 24000000 || !fixed) 9261 if (target_rate == 24000000 || !fixed)
9262 mask |= IEEE80211_OFDM_RATE_24MB_MASK; 9262 mask |= LIBIPW_OFDM_RATE_24MB_MASK;
9263 if (target_rate == 24000000) 9263 if (target_rate == 24000000)
9264 goto apply; 9264 goto apply;
9265 9265
9266 if (target_rate == 36000000 || !fixed) 9266 if (target_rate == 36000000 || !fixed)
9267 mask |= IEEE80211_OFDM_RATE_36MB_MASK; 9267 mask |= LIBIPW_OFDM_RATE_36MB_MASK;
9268 if (target_rate == 36000000) 9268 if (target_rate == 36000000)
9269 goto apply; 9269 goto apply;
9270 9270
9271 if (target_rate == 48000000 || !fixed) 9271 if (target_rate == 48000000 || !fixed)
9272 mask |= IEEE80211_OFDM_RATE_48MB_MASK; 9272 mask |= LIBIPW_OFDM_RATE_48MB_MASK;
9273 if (target_rate == 48000000) 9273 if (target_rate == 48000000)
9274 goto apply; 9274 goto apply;
9275 9275
9276 if (target_rate == 54000000 || !fixed) 9276 if (target_rate == 54000000 || !fixed)
9277 mask |= IEEE80211_OFDM_RATE_54MB_MASK; 9277 mask |= LIBIPW_OFDM_RATE_54MB_MASK;
9278 if (target_rate == 54000000) 9278 if (target_rate == 54000000)
9279 goto apply; 9279 goto apply;
9280 9280
@@ -9285,7 +9285,7 @@ static int ipw_wx_set_rate(struct net_device *dev,
9285 IPW_DEBUG_WX("Setting rate mask to 0x%08X [%s]\n", 9285 IPW_DEBUG_WX("Setting rate mask to 0x%08X [%s]\n",
9286 mask, fixed ? "fixed" : "sub-rates"); 9286 mask, fixed ? "fixed" : "sub-rates");
9287 mutex_lock(&priv->mutex); 9287 mutex_lock(&priv->mutex);
9288 if (mask == IEEE80211_DEFAULT_RATES_MASK) { 9288 if (mask == LIBIPW_DEFAULT_RATES_MASK) {
9289 priv->config &= ~CFG_FIXED_RATE; 9289 priv->config &= ~CFG_FIXED_RATE;
9290 ipw_set_fixed_rate(priv, priv->ieee->mode); 9290 ipw_set_fixed_rate(priv, priv->ieee->mode);
9291 } else 9291 } else
@@ -9312,7 +9312,7 @@ static int ipw_wx_get_rate(struct net_device *dev,
9312 struct iw_request_info *info, 9312 struct iw_request_info *info,
9313 union iwreq_data *wrqu, char *extra) 9313 union iwreq_data *wrqu, char *extra)
9314{ 9314{
9315 struct ipw_priv *priv = ieee80211_priv(dev); 9315 struct ipw_priv *priv = libipw_priv(dev);
9316 mutex_lock(&priv->mutex); 9316 mutex_lock(&priv->mutex);
9317 wrqu->bitrate.value = priv->last_rate; 9317 wrqu->bitrate.value = priv->last_rate;
9318 wrqu->bitrate.fixed = (priv->config & CFG_FIXED_RATE) ? 1 : 0; 9318 wrqu->bitrate.fixed = (priv->config & CFG_FIXED_RATE) ? 1 : 0;
@@ -9325,7 +9325,7 @@ static int ipw_wx_set_rts(struct net_device *dev,
9325 struct iw_request_info *info, 9325 struct iw_request_info *info,
9326 union iwreq_data *wrqu, char *extra) 9326 union iwreq_data *wrqu, char *extra)
9327{ 9327{
9328 struct ipw_priv *priv = ieee80211_priv(dev); 9328 struct ipw_priv *priv = libipw_priv(dev);
9329 mutex_lock(&priv->mutex); 9329 mutex_lock(&priv->mutex);
9330 if (wrqu->rts.disabled || !wrqu->rts.fixed) 9330 if (wrqu->rts.disabled || !wrqu->rts.fixed)
9331 priv->rts_threshold = DEFAULT_RTS_THRESHOLD; 9331 priv->rts_threshold = DEFAULT_RTS_THRESHOLD;
@@ -9348,7 +9348,7 @@ static int ipw_wx_get_rts(struct net_device *dev,
9348 struct iw_request_info *info, 9348 struct iw_request_info *info,
9349 union iwreq_data *wrqu, char *extra) 9349 union iwreq_data *wrqu, char *extra)
9350{ 9350{
9351 struct ipw_priv *priv = ieee80211_priv(dev); 9351 struct ipw_priv *priv = libipw_priv(dev);
9352 mutex_lock(&priv->mutex); 9352 mutex_lock(&priv->mutex);
9353 wrqu->rts.value = priv->rts_threshold; 9353 wrqu->rts.value = priv->rts_threshold;
9354 wrqu->rts.fixed = 0; /* no auto select */ 9354 wrqu->rts.fixed = 0; /* no auto select */
@@ -9362,7 +9362,7 @@ static int ipw_wx_set_txpow(struct net_device *dev,
9362 struct iw_request_info *info, 9362 struct iw_request_info *info,
9363 union iwreq_data *wrqu, char *extra) 9363 union iwreq_data *wrqu, char *extra)
9364{ 9364{
9365 struct ipw_priv *priv = ieee80211_priv(dev); 9365 struct ipw_priv *priv = libipw_priv(dev);
9366 int err = 0; 9366 int err = 0;
9367 9367
9368 mutex_lock(&priv->mutex); 9368 mutex_lock(&priv->mutex);
@@ -9396,7 +9396,7 @@ static int ipw_wx_get_txpow(struct net_device *dev,
9396 struct iw_request_info *info, 9396 struct iw_request_info *info,
9397 union iwreq_data *wrqu, char *extra) 9397 union iwreq_data *wrqu, char *extra)
9398{ 9398{
9399 struct ipw_priv *priv = ieee80211_priv(dev); 9399 struct ipw_priv *priv = libipw_priv(dev);
9400 mutex_lock(&priv->mutex); 9400 mutex_lock(&priv->mutex);
9401 wrqu->power.value = priv->tx_power; 9401 wrqu->power.value = priv->tx_power;
9402 wrqu->power.fixed = 1; 9402 wrqu->power.fixed = 1;
@@ -9414,7 +9414,7 @@ static int ipw_wx_set_frag(struct net_device *dev,
9414 struct iw_request_info *info, 9414 struct iw_request_info *info,
9415 union iwreq_data *wrqu, char *extra) 9415 union iwreq_data *wrqu, char *extra)
9416{ 9416{
9417 struct ipw_priv *priv = ieee80211_priv(dev); 9417 struct ipw_priv *priv = libipw_priv(dev);
9418 mutex_lock(&priv->mutex); 9418 mutex_lock(&priv->mutex);
9419 if (wrqu->frag.disabled || !wrqu->frag.fixed) 9419 if (wrqu->frag.disabled || !wrqu->frag.fixed)
9420 priv->ieee->fts = DEFAULT_FTS; 9420 priv->ieee->fts = DEFAULT_FTS;
@@ -9438,7 +9438,7 @@ static int ipw_wx_get_frag(struct net_device *dev,
9438 struct iw_request_info *info, 9438 struct iw_request_info *info,
9439 union iwreq_data *wrqu, char *extra) 9439 union iwreq_data *wrqu, char *extra)
9440{ 9440{
9441 struct ipw_priv *priv = ieee80211_priv(dev); 9441 struct ipw_priv *priv = libipw_priv(dev);
9442 mutex_lock(&priv->mutex); 9442 mutex_lock(&priv->mutex);
9443 wrqu->frag.value = priv->ieee->fts; 9443 wrqu->frag.value = priv->ieee->fts;
9444 wrqu->frag.fixed = 0; /* no auto select */ 9444 wrqu->frag.fixed = 0; /* no auto select */
@@ -9453,7 +9453,7 @@ static int ipw_wx_set_retry(struct net_device *dev,
9453 struct iw_request_info *info, 9453 struct iw_request_info *info,
9454 union iwreq_data *wrqu, char *extra) 9454 union iwreq_data *wrqu, char *extra)
9455{ 9455{
9456 struct ipw_priv *priv = ieee80211_priv(dev); 9456 struct ipw_priv *priv = libipw_priv(dev);
9457 9457
9458 if (wrqu->retry.flags & IW_RETRY_LIFETIME || wrqu->retry.disabled) 9458 if (wrqu->retry.flags & IW_RETRY_LIFETIME || wrqu->retry.disabled)
9459 return -EINVAL; 9459 return -EINVAL;
@@ -9486,7 +9486,7 @@ static int ipw_wx_get_retry(struct net_device *dev,
9486 struct iw_request_info *info, 9486 struct iw_request_info *info,
9487 union iwreq_data *wrqu, char *extra) 9487 union iwreq_data *wrqu, char *extra)
9488{ 9488{
9489 struct ipw_priv *priv = ieee80211_priv(dev); 9489 struct ipw_priv *priv = libipw_priv(dev);
9490 9490
9491 mutex_lock(&priv->mutex); 9491 mutex_lock(&priv->mutex);
9492 wrqu->retry.disabled = 0; 9492 wrqu->retry.disabled = 0;
@@ -9517,7 +9517,7 @@ static int ipw_wx_set_scan(struct net_device *dev,
9517 struct iw_request_info *info, 9517 struct iw_request_info *info,
9518 union iwreq_data *wrqu, char *extra) 9518 union iwreq_data *wrqu, char *extra)
9519{ 9519{
9520 struct ipw_priv *priv = ieee80211_priv(dev); 9520 struct ipw_priv *priv = libipw_priv(dev);
9521 struct iw_scan_req *req = (struct iw_scan_req *)extra; 9521 struct iw_scan_req *req = (struct iw_scan_req *)extra;
9522 struct delayed_work *work = NULL; 9522 struct delayed_work *work = NULL;
9523 9523
@@ -9553,20 +9553,20 @@ static int ipw_wx_get_scan(struct net_device *dev,
9553 struct iw_request_info *info, 9553 struct iw_request_info *info,
9554 union iwreq_data *wrqu, char *extra) 9554 union iwreq_data *wrqu, char *extra)
9555{ 9555{
9556 struct ipw_priv *priv = ieee80211_priv(dev); 9556 struct ipw_priv *priv = libipw_priv(dev);
9557 return ieee80211_wx_get_scan(priv->ieee, info, wrqu, extra); 9557 return libipw_wx_get_scan(priv->ieee, info, wrqu, extra);
9558} 9558}
9559 9559
9560static int ipw_wx_set_encode(struct net_device *dev, 9560static int ipw_wx_set_encode(struct net_device *dev,
9561 struct iw_request_info *info, 9561 struct iw_request_info *info,
9562 union iwreq_data *wrqu, char *key) 9562 union iwreq_data *wrqu, char *key)
9563{ 9563{
9564 struct ipw_priv *priv = ieee80211_priv(dev); 9564 struct ipw_priv *priv = libipw_priv(dev);
9565 int ret; 9565 int ret;
9566 u32 cap = priv->capability; 9566 u32 cap = priv->capability;
9567 9567
9568 mutex_lock(&priv->mutex); 9568 mutex_lock(&priv->mutex);
9569 ret = ieee80211_wx_set_encode(priv->ieee, info, wrqu, key); 9569 ret = libipw_wx_set_encode(priv->ieee, info, wrqu, key);
9570 9570
9571 /* In IBSS mode, we need to notify the firmware to update 9571 /* In IBSS mode, we need to notify the firmware to update
9572 * the beacon info after we changed the capability. */ 9572 * the beacon info after we changed the capability. */
@@ -9583,15 +9583,15 @@ static int ipw_wx_get_encode(struct net_device *dev,
9583 struct iw_request_info *info, 9583 struct iw_request_info *info,
9584 union iwreq_data *wrqu, char *key) 9584 union iwreq_data *wrqu, char *key)
9585{ 9585{
9586 struct ipw_priv *priv = ieee80211_priv(dev); 9586 struct ipw_priv *priv = libipw_priv(dev);
9587 return ieee80211_wx_get_encode(priv->ieee, info, wrqu, key); 9587 return libipw_wx_get_encode(priv->ieee, info, wrqu, key);
9588} 9588}
9589 9589
9590static int ipw_wx_set_power(struct net_device *dev, 9590static int ipw_wx_set_power(struct net_device *dev,
9591 struct iw_request_info *info, 9591 struct iw_request_info *info,
9592 union iwreq_data *wrqu, char *extra) 9592 union iwreq_data *wrqu, char *extra)
9593{ 9593{
9594 struct ipw_priv *priv = ieee80211_priv(dev); 9594 struct ipw_priv *priv = libipw_priv(dev);
9595 int err; 9595 int err;
9596 mutex_lock(&priv->mutex); 9596 mutex_lock(&priv->mutex);
9597 if (wrqu->power.disabled) { 9597 if (wrqu->power.disabled) {
@@ -9642,7 +9642,7 @@ static int ipw_wx_get_power(struct net_device *dev,
9642 struct iw_request_info *info, 9642 struct iw_request_info *info,
9643 union iwreq_data *wrqu, char *extra) 9643 union iwreq_data *wrqu, char *extra)
9644{ 9644{
9645 struct ipw_priv *priv = ieee80211_priv(dev); 9645 struct ipw_priv *priv = libipw_priv(dev);
9646 mutex_lock(&priv->mutex); 9646 mutex_lock(&priv->mutex);
9647 if (!(priv->power_mode & IPW_POWER_ENABLED)) 9647 if (!(priv->power_mode & IPW_POWER_ENABLED))
9648 wrqu->power.disabled = 1; 9648 wrqu->power.disabled = 1;
@@ -9659,7 +9659,7 @@ static int ipw_wx_set_powermode(struct net_device *dev,
9659 struct iw_request_info *info, 9659 struct iw_request_info *info,
9660 union iwreq_data *wrqu, char *extra) 9660 union iwreq_data *wrqu, char *extra)
9661{ 9661{
9662 struct ipw_priv *priv = ieee80211_priv(dev); 9662 struct ipw_priv *priv = libipw_priv(dev);
9663 int mode = *(int *)extra; 9663 int mode = *(int *)extra;
9664 int err; 9664 int err;
9665 9665
@@ -9685,7 +9685,7 @@ static int ipw_wx_get_powermode(struct net_device *dev,
9685 struct iw_request_info *info, 9685 struct iw_request_info *info,
9686 union iwreq_data *wrqu, char *extra) 9686 union iwreq_data *wrqu, char *extra)
9687{ 9687{
9688 struct ipw_priv *priv = ieee80211_priv(dev); 9688 struct ipw_priv *priv = libipw_priv(dev);
9689 int level = IPW_POWER_LEVEL(priv->power_mode); 9689 int level = IPW_POWER_LEVEL(priv->power_mode);
9690 char *p = extra; 9690 char *p = extra;
9691 9691
@@ -9717,7 +9717,7 @@ static int ipw_wx_set_wireless_mode(struct net_device *dev,
9717 struct iw_request_info *info, 9717 struct iw_request_info *info,
9718 union iwreq_data *wrqu, char *extra) 9718 union iwreq_data *wrqu, char *extra)
9719{ 9719{
9720 struct ipw_priv *priv = ieee80211_priv(dev); 9720 struct ipw_priv *priv = libipw_priv(dev);
9721 int mode = *(int *)extra; 9721 int mode = *(int *)extra;
9722 u8 band = 0, modulation = 0; 9722 u8 band = 0, modulation = 0;
9723 9723
@@ -9729,8 +9729,8 @@ static int ipw_wx_set_wireless_mode(struct net_device *dev,
9729 if (priv->adapter == IPW_2915ABG) { 9729 if (priv->adapter == IPW_2915ABG) {
9730 priv->ieee->abg_true = 1; 9730 priv->ieee->abg_true = 1;
9731 if (mode & IEEE_A) { 9731 if (mode & IEEE_A) {
9732 band |= IEEE80211_52GHZ_BAND; 9732 band |= LIBIPW_52GHZ_BAND;
9733 modulation |= IEEE80211_OFDM_MODULATION; 9733 modulation |= LIBIPW_OFDM_MODULATION;
9734 } else 9734 } else
9735 priv->ieee->abg_true = 0; 9735 priv->ieee->abg_true = 0;
9736 } else { 9736 } else {
@@ -9745,14 +9745,14 @@ static int ipw_wx_set_wireless_mode(struct net_device *dev,
9745 } 9745 }
9746 9746
9747 if (mode & IEEE_B) { 9747 if (mode & IEEE_B) {
9748 band |= IEEE80211_24GHZ_BAND; 9748 band |= LIBIPW_24GHZ_BAND;
9749 modulation |= IEEE80211_CCK_MODULATION; 9749 modulation |= LIBIPW_CCK_MODULATION;
9750 } else 9750 } else
9751 priv->ieee->abg_true = 0; 9751 priv->ieee->abg_true = 0;
9752 9752
9753 if (mode & IEEE_G) { 9753 if (mode & IEEE_G) {
9754 band |= IEEE80211_24GHZ_BAND; 9754 band |= LIBIPW_24GHZ_BAND;
9755 modulation |= IEEE80211_OFDM_MODULATION; 9755 modulation |= LIBIPW_OFDM_MODULATION;
9756 } else 9756 } else
9757 priv->ieee->abg_true = 0; 9757 priv->ieee->abg_true = 0;
9758 9758
@@ -9782,7 +9782,7 @@ static int ipw_wx_get_wireless_mode(struct net_device *dev,
9782 struct iw_request_info *info, 9782 struct iw_request_info *info,
9783 union iwreq_data *wrqu, char *extra) 9783 union iwreq_data *wrqu, char *extra)
9784{ 9784{
9785 struct ipw_priv *priv = ieee80211_priv(dev); 9785 struct ipw_priv *priv = libipw_priv(dev);
9786 mutex_lock(&priv->mutex); 9786 mutex_lock(&priv->mutex);
9787 switch (priv->ieee->mode) { 9787 switch (priv->ieee->mode) {
9788 case IEEE_A: 9788 case IEEE_A:
@@ -9823,7 +9823,7 @@ static int ipw_wx_set_preamble(struct net_device *dev,
9823 struct iw_request_info *info, 9823 struct iw_request_info *info,
9824 union iwreq_data *wrqu, char *extra) 9824 union iwreq_data *wrqu, char *extra)
9825{ 9825{
9826 struct ipw_priv *priv = ieee80211_priv(dev); 9826 struct ipw_priv *priv = libipw_priv(dev);
9827 int mode = *(int *)extra; 9827 int mode = *(int *)extra;
9828 mutex_lock(&priv->mutex); 9828 mutex_lock(&priv->mutex);
9829 /* Switching from SHORT -> LONG requires a disassociation */ 9829 /* Switching from SHORT -> LONG requires a disassociation */
@@ -9856,7 +9856,7 @@ static int ipw_wx_get_preamble(struct net_device *dev,
9856 struct iw_request_info *info, 9856 struct iw_request_info *info,
9857 union iwreq_data *wrqu, char *extra) 9857 union iwreq_data *wrqu, char *extra)
9858{ 9858{
9859 struct ipw_priv *priv = ieee80211_priv(dev); 9859 struct ipw_priv *priv = libipw_priv(dev);
9860 mutex_lock(&priv->mutex); 9860 mutex_lock(&priv->mutex);
9861 if (priv->config & CFG_PREAMBLE_LONG) 9861 if (priv->config & CFG_PREAMBLE_LONG)
9862 snprintf(wrqu->name, IFNAMSIZ, "long (1)"); 9862 snprintf(wrqu->name, IFNAMSIZ, "long (1)");
@@ -9871,7 +9871,7 @@ static int ipw_wx_set_monitor(struct net_device *dev,
9871 struct iw_request_info *info, 9871 struct iw_request_info *info,
9872 union iwreq_data *wrqu, char *extra) 9872 union iwreq_data *wrqu, char *extra)
9873{ 9873{
9874 struct ipw_priv *priv = ieee80211_priv(dev); 9874 struct ipw_priv *priv = libipw_priv(dev);
9875 int *parms = (int *)extra; 9875 int *parms = (int *)extra;
9876 int enable = (parms[0] > 0); 9876 int enable = (parms[0] > 0);
9877 mutex_lock(&priv->mutex); 9877 mutex_lock(&priv->mutex);
@@ -9905,7 +9905,7 @@ static int ipw_wx_reset(struct net_device *dev,
9905 struct iw_request_info *info, 9905 struct iw_request_info *info,
9906 union iwreq_data *wrqu, char *extra) 9906 union iwreq_data *wrqu, char *extra)
9907{ 9907{
9908 struct ipw_priv *priv = ieee80211_priv(dev); 9908 struct ipw_priv *priv = libipw_priv(dev);
9909 IPW_DEBUG_WX("RESET\n"); 9909 IPW_DEBUG_WX("RESET\n");
9910 queue_work(priv->workqueue, &priv->adapter_restart); 9910 queue_work(priv->workqueue, &priv->adapter_restart);
9911 return 0; 9911 return 0;
@@ -9915,7 +9915,7 @@ static int ipw_wx_sw_reset(struct net_device *dev,
9915 struct iw_request_info *info, 9915 struct iw_request_info *info,
9916 union iwreq_data *wrqu, char *extra) 9916 union iwreq_data *wrqu, char *extra)
9917{ 9917{
9918 struct ipw_priv *priv = ieee80211_priv(dev); 9918 struct ipw_priv *priv = libipw_priv(dev);
9919 union iwreq_data wrqu_sec = { 9919 union iwreq_data wrqu_sec = {
9920 .encoding = { 9920 .encoding = {
9921 .flags = IW_ENCODE_DISABLED, 9921 .flags = IW_ENCODE_DISABLED,
@@ -9938,7 +9938,7 @@ static int ipw_wx_sw_reset(struct net_device *dev,
9938 ipw_radio_kill_sw(priv, priv->status & STATUS_RF_KILL_SW); 9938 ipw_radio_kill_sw(priv, priv->status & STATUS_RF_KILL_SW);
9939 9939
9940 mutex_unlock(&priv->mutex); 9940 mutex_unlock(&priv->mutex);
9941 ieee80211_wx_set_encode(priv->ieee, info, &wrqu_sec, NULL); 9941 libipw_wx_set_encode(priv->ieee, info, &wrqu_sec, NULL);
9942 mutex_lock(&priv->mutex); 9942 mutex_lock(&priv->mutex);
9943 9943
9944 if (!(priv->status & STATUS_RF_KILL_MASK)) { 9944 if (!(priv->status & STATUS_RF_KILL_MASK)) {
@@ -10083,7 +10083,7 @@ static struct iw_handler_def ipw_wx_handler_def = {
10083 */ 10083 */
10084static struct iw_statistics *ipw_get_wireless_stats(struct net_device *dev) 10084static struct iw_statistics *ipw_get_wireless_stats(struct net_device *dev)
10085{ 10085{
10086 struct ipw_priv *priv = ieee80211_priv(dev); 10086 struct ipw_priv *priv = libipw_priv(dev);
10087 struct iw_statistics *wstats; 10087 struct iw_statistics *wstats;
10088 10088
10089 wstats = &priv->wstats; 10089 wstats = &priv->wstats;
@@ -10164,13 +10164,13 @@ static int ipw_net_stop(struct net_device *dev)
10164todo: 10164todo:
10165 10165
10166modify to send one tfd per fragment instead of using chunking. otherwise 10166modify to send one tfd per fragment instead of using chunking. otherwise
10167we need to heavily modify the ieee80211_skb_to_txb. 10167we need to heavily modify the libipw_skb_to_txb.
10168*/ 10168*/
10169 10169
10170static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, 10170static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb,
10171 int pri) 10171 int pri)
10172{ 10172{
10173 struct ieee80211_hdr_3addrqos *hdr = (struct ieee80211_hdr_3addrqos *) 10173 struct libipw_hdr_3addrqos *hdr = (struct libipw_hdr_3addrqos *)
10174 txb->fragments[0]->data; 10174 txb->fragments[0]->data;
10175 int i = 0; 10175 int i = 0;
10176 struct tfd_frame *tfd; 10176 struct tfd_frame *tfd;
@@ -10187,7 +10187,7 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10187 if (!(priv->status & STATUS_ASSOCIATED)) 10187 if (!(priv->status & STATUS_ASSOCIATED))
10188 goto drop; 10188 goto drop;
10189 10189
10190 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 10190 hdr_len = libipw_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
10191 switch (priv->ieee->iw_mode) { 10191 switch (priv->ieee->iw_mode) {
10192 case IW_MODE_ADHOC: 10192 case IW_MODE_ADHOC:
10193 unicast = !is_multicast_ether_addr(hdr->addr1); 10193 unicast = !is_multicast_ether_addr(hdr->addr1);
@@ -10356,13 +10356,13 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10356 10356
10357 drop: 10357 drop:
10358 IPW_DEBUG_DROP("Silently dropping Tx packet.\n"); 10358 IPW_DEBUG_DROP("Silently dropping Tx packet.\n");
10359 ieee80211_txb_free(txb); 10359 libipw_txb_free(txb);
10360 return NETDEV_TX_OK; 10360 return NETDEV_TX_OK;
10361} 10361}
10362 10362
10363static int ipw_net_is_queue_full(struct net_device *dev, int pri) 10363static int ipw_net_is_queue_full(struct net_device *dev, int pri)
10364{ 10364{
10365 struct ipw_priv *priv = ieee80211_priv(dev); 10365 struct ipw_priv *priv = libipw_priv(dev);
10366#ifdef CONFIG_IPW2200_QOS 10366#ifdef CONFIG_IPW2200_QOS
10367 int tx_id = ipw_get_tx_queue_number(priv, pri); 10367 int tx_id = ipw_get_tx_queue_number(priv, pri);
10368 struct clx2_tx_queue *txq = &priv->txq[tx_id]; 10368 struct clx2_tx_queue *txq = &priv->txq[tx_id];
@@ -10378,9 +10378,9 @@ static int ipw_net_is_queue_full(struct net_device *dev, int pri)
10378 10378
10379#ifdef CONFIG_IPW2200_PROMISCUOUS 10379#ifdef CONFIG_IPW2200_PROMISCUOUS
10380static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, 10380static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10381 struct ieee80211_txb *txb) 10381 struct libipw_txb *txb)
10382{ 10382{
10383 struct ieee80211_rx_stats dummystats; 10383 struct libipw_rx_stats dummystats;
10384 struct ieee80211_hdr *hdr; 10384 struct ieee80211_hdr *hdr;
10385 u8 n; 10385 u8 n;
10386 u16 filter = priv->prom_priv->filter; 10386 u16 filter = priv->prom_priv->filter;
@@ -10393,17 +10393,17 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10393 10393
10394 /* Filtering of fragment chains is done agains the first fragment */ 10394 /* Filtering of fragment chains is done agains the first fragment */
10395 hdr = (void *)txb->fragments[0]->data; 10395 hdr = (void *)txb->fragments[0]->data;
10396 if (ieee80211_is_management(le16_to_cpu(hdr->frame_control))) { 10396 if (libipw_is_management(le16_to_cpu(hdr->frame_control))) {
10397 if (filter & IPW_PROM_NO_MGMT) 10397 if (filter & IPW_PROM_NO_MGMT)
10398 return; 10398 return;
10399 if (filter & IPW_PROM_MGMT_HEADER_ONLY) 10399 if (filter & IPW_PROM_MGMT_HEADER_ONLY)
10400 hdr_only = 1; 10400 hdr_only = 1;
10401 } else if (ieee80211_is_control(le16_to_cpu(hdr->frame_control))) { 10401 } else if (libipw_is_control(le16_to_cpu(hdr->frame_control))) {
10402 if (filter & IPW_PROM_NO_CTL) 10402 if (filter & IPW_PROM_NO_CTL)
10403 return; 10403 return;
10404 if (filter & IPW_PROM_CTL_HEADER_ONLY) 10404 if (filter & IPW_PROM_CTL_HEADER_ONLY)
10405 hdr_only = 1; 10405 hdr_only = 1;
10406 } else if (ieee80211_is_data(le16_to_cpu(hdr->frame_control))) { 10406 } else if (libipw_is_data(le16_to_cpu(hdr->frame_control))) {
10407 if (filter & IPW_PROM_NO_DATA) 10407 if (filter & IPW_PROM_NO_DATA)
10408 return; 10408 return;
10409 if (filter & IPW_PROM_DATA_HEADER_ONLY) 10409 if (filter & IPW_PROM_DATA_HEADER_ONLY)
@@ -10418,7 +10418,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10418 10418
10419 if (hdr_only) { 10419 if (hdr_only) {
10420 hdr = (void *)src->data; 10420 hdr = (void *)src->data;
10421 len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); 10421 len = libipw_get_hdrlen(le16_to_cpu(hdr->frame_control));
10422 } else 10422 } else
10423 len = src->len; 10423 len = src->len;
10424 10424
@@ -10452,16 +10452,16 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10452 10452
10453 skb_copy_from_linear_data(src, skb_put(dst, len), len); 10453 skb_copy_from_linear_data(src, skb_put(dst, len), len);
10454 10454
10455 if (!ieee80211_rx(priv->prom_priv->ieee, dst, &dummystats)) 10455 if (!libipw_rx(priv->prom_priv->ieee, dst, &dummystats))
10456 dev_kfree_skb_any(dst); 10456 dev_kfree_skb_any(dst);
10457 } 10457 }
10458} 10458}
10459#endif 10459#endif
10460 10460
10461static int ipw_net_hard_start_xmit(struct ieee80211_txb *txb, 10461static int ipw_net_hard_start_xmit(struct libipw_txb *txb,
10462 struct net_device *dev, int pri) 10462 struct net_device *dev, int pri)
10463{ 10463{
10464 struct ipw_priv *priv = ieee80211_priv(dev); 10464 struct ipw_priv *priv = libipw_priv(dev);
10465 unsigned long flags; 10465 unsigned long flags;
10466 int ret; 10466 int ret;
10467 10467
@@ -10488,7 +10488,7 @@ static void ipw_net_set_multicast_list(struct net_device *dev)
10488 10488
10489static int ipw_net_set_mac_address(struct net_device *dev, void *p) 10489static int ipw_net_set_mac_address(struct net_device *dev, void *p)
10490{ 10490{
10491 struct ipw_priv *priv = ieee80211_priv(dev); 10491 struct ipw_priv *priv = libipw_priv(dev);
10492 struct sockaddr *addr = p; 10492 struct sockaddr *addr = p;
10493 10493
10494 if (!is_valid_ether_addr(addr->sa_data)) 10494 if (!is_valid_ether_addr(addr->sa_data))
@@ -10506,7 +10506,7 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p)
10506static void ipw_ethtool_get_drvinfo(struct net_device *dev, 10506static void ipw_ethtool_get_drvinfo(struct net_device *dev,
10507 struct ethtool_drvinfo *info) 10507 struct ethtool_drvinfo *info)
10508{ 10508{
10509 struct ipw_priv *p = ieee80211_priv(dev); 10509 struct ipw_priv *p = libipw_priv(dev);
10510 char vers[64]; 10510 char vers[64];
10511 char date[32]; 10511 char date[32];
10512 u32 len; 10512 u32 len;
@@ -10527,7 +10527,7 @@ static void ipw_ethtool_get_drvinfo(struct net_device *dev,
10527 10527
10528static u32 ipw_ethtool_get_link(struct net_device *dev) 10528static u32 ipw_ethtool_get_link(struct net_device *dev)
10529{ 10529{
10530 struct ipw_priv *priv = ieee80211_priv(dev); 10530 struct ipw_priv *priv = libipw_priv(dev);
10531 return (priv->status & STATUS_ASSOCIATED) != 0; 10531 return (priv->status & STATUS_ASSOCIATED) != 0;
10532} 10532}
10533 10533
@@ -10539,7 +10539,7 @@ static int ipw_ethtool_get_eeprom_len(struct net_device *dev)
10539static int ipw_ethtool_get_eeprom(struct net_device *dev, 10539static int ipw_ethtool_get_eeprom(struct net_device *dev,
10540 struct ethtool_eeprom *eeprom, u8 * bytes) 10540 struct ethtool_eeprom *eeprom, u8 * bytes)
10541{ 10541{
10542 struct ipw_priv *p = ieee80211_priv(dev); 10542 struct ipw_priv *p = libipw_priv(dev);
10543 10543
10544 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE) 10544 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE)
10545 return -EINVAL; 10545 return -EINVAL;
@@ -10552,7 +10552,7 @@ static int ipw_ethtool_get_eeprom(struct net_device *dev,
10552static int ipw_ethtool_set_eeprom(struct net_device *dev, 10552static int ipw_ethtool_set_eeprom(struct net_device *dev,
10553 struct ethtool_eeprom *eeprom, u8 * bytes) 10553 struct ethtool_eeprom *eeprom, u8 * bytes)
10554{ 10554{
10555 struct ipw_priv *p = ieee80211_priv(dev); 10555 struct ipw_priv *p = libipw_priv(dev);
10556 int i; 10556 int i;
10557 10557
10558 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE) 10558 if (eeprom->offset + eeprom->len > IPW_EEPROM_IMAGE_SIZE)
@@ -10768,9 +10768,9 @@ static int __devinit ipw_setup_deferred_work(struct ipw_priv *priv)
10768} 10768}
10769 10769
10770static void shim__set_security(struct net_device *dev, 10770static void shim__set_security(struct net_device *dev,
10771 struct ieee80211_security *sec) 10771 struct libipw_security *sec)
10772{ 10772{
10773 struct ipw_priv *priv = ieee80211_priv(dev); 10773 struct ipw_priv *priv = libipw_priv(dev);
10774 int i; 10774 int i;
10775 for (i = 0; i < 4; i++) { 10775 for (i = 0; i < 4; i++) {
10776 if (sec->flags & (1 << i)) { 10776 if (sec->flags & (1 << i)) {
@@ -10855,21 +10855,21 @@ static int init_supported_rates(struct ipw_priv *priv,
10855 memset(rates, 0, sizeof(*rates)); 10855 memset(rates, 0, sizeof(*rates));
10856 /* configure supported rates */ 10856 /* configure supported rates */
10857 switch (priv->ieee->freq_band) { 10857 switch (priv->ieee->freq_band) {
10858 case IEEE80211_52GHZ_BAND: 10858 case LIBIPW_52GHZ_BAND:
10859 rates->ieee_mode = IPW_A_MODE; 10859 rates->ieee_mode = IPW_A_MODE;
10860 rates->purpose = IPW_RATE_CAPABILITIES; 10860 rates->purpose = IPW_RATE_CAPABILITIES;
10861 ipw_add_ofdm_scan_rates(rates, IEEE80211_CCK_MODULATION, 10861 ipw_add_ofdm_scan_rates(rates, LIBIPW_CCK_MODULATION,
10862 IEEE80211_OFDM_DEFAULT_RATES_MASK); 10862 LIBIPW_OFDM_DEFAULT_RATES_MASK);
10863 break; 10863 break;
10864 10864
10865 default: /* Mixed or 2.4Ghz */ 10865 default: /* Mixed or 2.4Ghz */
10866 rates->ieee_mode = IPW_G_MODE; 10866 rates->ieee_mode = IPW_G_MODE;
10867 rates->purpose = IPW_RATE_CAPABILITIES; 10867 rates->purpose = IPW_RATE_CAPABILITIES;
10868 ipw_add_cck_scan_rates(rates, IEEE80211_CCK_MODULATION, 10868 ipw_add_cck_scan_rates(rates, LIBIPW_CCK_MODULATION,
10869 IEEE80211_CCK_DEFAULT_RATES_MASK); 10869 LIBIPW_CCK_DEFAULT_RATES_MASK);
10870 if (priv->ieee->modulation & IEEE80211_OFDM_MODULATION) { 10870 if (priv->ieee->modulation & LIBIPW_OFDM_MODULATION) {
10871 ipw_add_ofdm_scan_rates(rates, IEEE80211_CCK_MODULATION, 10871 ipw_add_ofdm_scan_rates(rates, LIBIPW_CCK_MODULATION,
10872 IEEE80211_OFDM_DEFAULT_RATES_MASK); 10872 LIBIPW_OFDM_DEFAULT_RATES_MASK);
10873 } 10873 }
10874 break; 10874 break;
10875 } 10875 }
@@ -10975,7 +10975,7 @@ static int ipw_config(struct ipw_priv *priv)
10975 * table. 10975 * table.
10976 * 10976 *
10977 */ 10977 */
10978static const struct ieee80211_geo ipw_geos[] = { 10978static const struct libipw_geo ipw_geos[] = {
10979 { /* Restricted */ 10979 { /* Restricted */
10980 "---", 10980 "---",
10981 .bg_channels = 11, 10981 .bg_channels = 11,
@@ -10997,10 +10997,10 @@ static const struct ieee80211_geo ipw_geos[] = {
10997 {5200, 40}, 10997 {5200, 40},
10998 {5220, 44}, 10998 {5220, 44},
10999 {5240, 48}, 10999 {5240, 48},
11000 {5260, 52, IEEE80211_CH_PASSIVE_ONLY}, 11000 {5260, 52, LIBIPW_CH_PASSIVE_ONLY},
11001 {5280, 56, IEEE80211_CH_PASSIVE_ONLY}, 11001 {5280, 56, LIBIPW_CH_PASSIVE_ONLY},
11002 {5300, 60, IEEE80211_CH_PASSIVE_ONLY}, 11002 {5300, 60, LIBIPW_CH_PASSIVE_ONLY},
11003 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}}, 11003 {5320, 64, LIBIPW_CH_PASSIVE_ONLY}},
11004 }, 11004 },
11005 11005
11006 { /* Rest of World */ 11006 { /* Rest of World */
@@ -11025,10 +11025,10 @@ static const struct ieee80211_geo ipw_geos[] = {
11025 {5200, 40}, 11025 {5200, 40},
11026 {5220, 44}, 11026 {5220, 44},
11027 {5240, 48}, 11027 {5240, 48},
11028 {5260, 52, IEEE80211_CH_PASSIVE_ONLY}, 11028 {5260, 52, LIBIPW_CH_PASSIVE_ONLY},
11029 {5280, 56, IEEE80211_CH_PASSIVE_ONLY}, 11029 {5280, 56, LIBIPW_CH_PASSIVE_ONLY},
11030 {5300, 60, IEEE80211_CH_PASSIVE_ONLY}, 11030 {5300, 60, LIBIPW_CH_PASSIVE_ONLY},
11031 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}, 11031 {5320, 64, LIBIPW_CH_PASSIVE_ONLY},
11032 {5745, 149}, 11032 {5745, 149},
11033 {5765, 153}, 11033 {5765, 153},
11034 {5785, 157}, 11034 {5785, 157},
@@ -11048,15 +11048,15 @@ static const struct ieee80211_geo ipw_geos[] = {
11048 {5200, 40}, 11048 {5200, 40},
11049 {5220, 44}, 11049 {5220, 44},
11050 {5240, 48}, 11050 {5240, 48},
11051 {5260, 52, IEEE80211_CH_PASSIVE_ONLY}, 11051 {5260, 52, LIBIPW_CH_PASSIVE_ONLY},
11052 {5280, 56, IEEE80211_CH_PASSIVE_ONLY}, 11052 {5280, 56, LIBIPW_CH_PASSIVE_ONLY},
11053 {5300, 60, IEEE80211_CH_PASSIVE_ONLY}, 11053 {5300, 60, LIBIPW_CH_PASSIVE_ONLY},
11054 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}, 11054 {5320, 64, LIBIPW_CH_PASSIVE_ONLY},
11055 {5745, 149, IEEE80211_CH_PASSIVE_ONLY}, 11055 {5745, 149, LIBIPW_CH_PASSIVE_ONLY},
11056 {5765, 153, IEEE80211_CH_PASSIVE_ONLY}, 11056 {5765, 153, LIBIPW_CH_PASSIVE_ONLY},
11057 {5785, 157, IEEE80211_CH_PASSIVE_ONLY}, 11057 {5785, 157, LIBIPW_CH_PASSIVE_ONLY},
11058 {5805, 161, IEEE80211_CH_PASSIVE_ONLY}, 11058 {5805, 161, LIBIPW_CH_PASSIVE_ONLY},
11059 {5825, 165, IEEE80211_CH_PASSIVE_ONLY}}, 11059 {5825, 165, LIBIPW_CH_PASSIVE_ONLY}},
11060 }, 11060 },
11061 11061
11062 { /* Custom Japan */ 11062 { /* Custom Japan */
@@ -11093,21 +11093,21 @@ static const struct ieee80211_geo ipw_geos[] = {
11093 {5200, 40}, 11093 {5200, 40},
11094 {5220, 44}, 11094 {5220, 44},
11095 {5240, 48}, 11095 {5240, 48},
11096 {5260, 52, IEEE80211_CH_PASSIVE_ONLY}, 11096 {5260, 52, LIBIPW_CH_PASSIVE_ONLY},
11097 {5280, 56, IEEE80211_CH_PASSIVE_ONLY}, 11097 {5280, 56, LIBIPW_CH_PASSIVE_ONLY},
11098 {5300, 60, IEEE80211_CH_PASSIVE_ONLY}, 11098 {5300, 60, LIBIPW_CH_PASSIVE_ONLY},
11099 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}, 11099 {5320, 64, LIBIPW_CH_PASSIVE_ONLY},
11100 {5500, 100, IEEE80211_CH_PASSIVE_ONLY}, 11100 {5500, 100, LIBIPW_CH_PASSIVE_ONLY},
11101 {5520, 104, IEEE80211_CH_PASSIVE_ONLY}, 11101 {5520, 104, LIBIPW_CH_PASSIVE_ONLY},
11102 {5540, 108, IEEE80211_CH_PASSIVE_ONLY}, 11102 {5540, 108, LIBIPW_CH_PASSIVE_ONLY},
11103 {5560, 112, IEEE80211_CH_PASSIVE_ONLY}, 11103 {5560, 112, LIBIPW_CH_PASSIVE_ONLY},
11104 {5580, 116, IEEE80211_CH_PASSIVE_ONLY}, 11104 {5580, 116, LIBIPW_CH_PASSIVE_ONLY},
11105 {5600, 120, IEEE80211_CH_PASSIVE_ONLY}, 11105 {5600, 120, LIBIPW_CH_PASSIVE_ONLY},
11106 {5620, 124, IEEE80211_CH_PASSIVE_ONLY}, 11106 {5620, 124, LIBIPW_CH_PASSIVE_ONLY},
11107 {5640, 128, IEEE80211_CH_PASSIVE_ONLY}, 11107 {5640, 128, LIBIPW_CH_PASSIVE_ONLY},
11108 {5660, 132, IEEE80211_CH_PASSIVE_ONLY}, 11108 {5660, 132, LIBIPW_CH_PASSIVE_ONLY},
11109 {5680, 136, IEEE80211_CH_PASSIVE_ONLY}, 11109 {5680, 136, LIBIPW_CH_PASSIVE_ONLY},
11110 {5700, 140, IEEE80211_CH_PASSIVE_ONLY}}, 11110 {5700, 140, LIBIPW_CH_PASSIVE_ONLY}},
11111 }, 11111 },
11112 11112
11113 { /* Custom Japan */ 11113 { /* Custom Japan */
@@ -11117,7 +11117,7 @@ static const struct ieee80211_geo ipw_geos[] = {
11117 {2427, 4}, {2432, 5}, {2437, 6}, 11117 {2427, 4}, {2432, 5}, {2437, 6},
11118 {2442, 7}, {2447, 8}, {2452, 9}, 11118 {2442, 7}, {2447, 8}, {2452, 9},
11119 {2457, 10}, {2462, 11}, {2467, 12}, 11119 {2457, 10}, {2462, 11}, {2467, 12},
11120 {2472, 13}, {2484, 14, IEEE80211_CH_B_ONLY}}, 11120 {2472, 13}, {2484, 14, LIBIPW_CH_B_ONLY}},
11121 .a_channels = 4, 11121 .a_channels = 4,
11122 .a = {{5170, 34}, {5190, 38}, 11122 .a = {{5170, 34}, {5190, 38},
11123 {5210, 42}, {5230, 46}}, 11123 {5210, 42}, {5230, 46}},
@@ -11130,8 +11130,8 @@ static const struct ieee80211_geo ipw_geos[] = {
11130 {2427, 4}, {2432, 5}, {2437, 6}, 11130 {2427, 4}, {2432, 5}, {2437, 6},
11131 {2442, 7}, {2447, 8}, {2452, 9}, 11131 {2442, 7}, {2447, 8}, {2452, 9},
11132 {2457, 10}, {2462, 11}, {2467, 12}, 11132 {2457, 10}, {2462, 11}, {2467, 12},
11133 {2472, 13}, {2484, 14, IEEE80211_CH_B_ONLY | 11133 {2472, 13}, {2484, 14, LIBIPW_CH_B_ONLY |
11134 IEEE80211_CH_PASSIVE_ONLY}}, 11134 LIBIPW_CH_PASSIVE_ONLY}},
11135 }, 11135 },
11136 11136
11137 { /* High Band */ 11137 { /* High Band */
@@ -11141,8 +11141,8 @@ static const struct ieee80211_geo ipw_geos[] = {
11141 {2427, 4}, {2432, 5}, {2437, 6}, 11141 {2427, 4}, {2432, 5}, {2437, 6},
11142 {2442, 7}, {2447, 8}, {2452, 9}, 11142 {2442, 7}, {2447, 8}, {2452, 9},
11143 {2457, 10}, {2462, 11}, 11143 {2457, 10}, {2462, 11},
11144 {2467, 12, IEEE80211_CH_PASSIVE_ONLY}, 11144 {2467, 12, LIBIPW_CH_PASSIVE_ONLY},
11145 {2472, 13, IEEE80211_CH_PASSIVE_ONLY}}, 11145 {2472, 13, LIBIPW_CH_PASSIVE_ONLY}},
11146 .a_channels = 4, 11146 .a_channels = 4,
11147 .a = {{5745, 149}, {5765, 153}, 11147 .a = {{5745, 149}, {5765, 153},
11148 {5785, 157}, {5805, 161}}, 11148 {5785, 157}, {5805, 161}},
@@ -11168,33 +11168,33 @@ static const struct ieee80211_geo ipw_geos[] = {
11168 {2427, 4}, {2432, 5}, {2437, 6}, 11168 {2427, 4}, {2432, 5}, {2437, 6},
11169 {2442, 7}, {2447, 8}, {2452, 9}, 11169 {2442, 7}, {2447, 8}, {2452, 9},
11170 {2457, 10}, {2462, 11}, 11170 {2457, 10}, {2462, 11},
11171 {2467, 12, IEEE80211_CH_PASSIVE_ONLY}, 11171 {2467, 12, LIBIPW_CH_PASSIVE_ONLY},
11172 {2472, 13, IEEE80211_CH_PASSIVE_ONLY}}, 11172 {2472, 13, LIBIPW_CH_PASSIVE_ONLY}},
11173 .a_channels = 24, 11173 .a_channels = 24,
11174 .a = {{5180, 36, IEEE80211_CH_PASSIVE_ONLY}, 11174 .a = {{5180, 36, LIBIPW_CH_PASSIVE_ONLY},
11175 {5200, 40, IEEE80211_CH_PASSIVE_ONLY}, 11175 {5200, 40, LIBIPW_CH_PASSIVE_ONLY},
11176 {5220, 44, IEEE80211_CH_PASSIVE_ONLY}, 11176 {5220, 44, LIBIPW_CH_PASSIVE_ONLY},
11177 {5240, 48, IEEE80211_CH_PASSIVE_ONLY}, 11177 {5240, 48, LIBIPW_CH_PASSIVE_ONLY},
11178 {5260, 52, IEEE80211_CH_PASSIVE_ONLY}, 11178 {5260, 52, LIBIPW_CH_PASSIVE_ONLY},
11179 {5280, 56, IEEE80211_CH_PASSIVE_ONLY}, 11179 {5280, 56, LIBIPW_CH_PASSIVE_ONLY},
11180 {5300, 60, IEEE80211_CH_PASSIVE_ONLY}, 11180 {5300, 60, LIBIPW_CH_PASSIVE_ONLY},
11181 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}, 11181 {5320, 64, LIBIPW_CH_PASSIVE_ONLY},
11182 {5500, 100, IEEE80211_CH_PASSIVE_ONLY}, 11182 {5500, 100, LIBIPW_CH_PASSIVE_ONLY},
11183 {5520, 104, IEEE80211_CH_PASSIVE_ONLY}, 11183 {5520, 104, LIBIPW_CH_PASSIVE_ONLY},
11184 {5540, 108, IEEE80211_CH_PASSIVE_ONLY}, 11184 {5540, 108, LIBIPW_CH_PASSIVE_ONLY},
11185 {5560, 112, IEEE80211_CH_PASSIVE_ONLY}, 11185 {5560, 112, LIBIPW_CH_PASSIVE_ONLY},
11186 {5580, 116, IEEE80211_CH_PASSIVE_ONLY}, 11186 {5580, 116, LIBIPW_CH_PASSIVE_ONLY},
11187 {5600, 120, IEEE80211_CH_PASSIVE_ONLY}, 11187 {5600, 120, LIBIPW_CH_PASSIVE_ONLY},
11188 {5620, 124, IEEE80211_CH_PASSIVE_ONLY}, 11188 {5620, 124, LIBIPW_CH_PASSIVE_ONLY},
11189 {5640, 128, IEEE80211_CH_PASSIVE_ONLY}, 11189 {5640, 128, LIBIPW_CH_PASSIVE_ONLY},
11190 {5660, 132, IEEE80211_CH_PASSIVE_ONLY}, 11190 {5660, 132, LIBIPW_CH_PASSIVE_ONLY},
11191 {5680, 136, IEEE80211_CH_PASSIVE_ONLY}, 11191 {5680, 136, LIBIPW_CH_PASSIVE_ONLY},
11192 {5700, 140, IEEE80211_CH_PASSIVE_ONLY}, 11192 {5700, 140, LIBIPW_CH_PASSIVE_ONLY},
11193 {5745, 149, IEEE80211_CH_PASSIVE_ONLY}, 11193 {5745, 149, LIBIPW_CH_PASSIVE_ONLY},
11194 {5765, 153, IEEE80211_CH_PASSIVE_ONLY}, 11194 {5765, 153, LIBIPW_CH_PASSIVE_ONLY},
11195 {5785, 157, IEEE80211_CH_PASSIVE_ONLY}, 11195 {5785, 157, LIBIPW_CH_PASSIVE_ONLY},
11196 {5805, 161, IEEE80211_CH_PASSIVE_ONLY}, 11196 {5805, 161, LIBIPW_CH_PASSIVE_ONLY},
11197 {5825, 165, IEEE80211_CH_PASSIVE_ONLY}}, 11197 {5825, 165, LIBIPW_CH_PASSIVE_ONLY}},
11198 }, 11198 },
11199 11199
11200 { /* Europe */ 11200 { /* Europe */
@@ -11205,19 +11205,19 @@ static const struct ieee80211_geo ipw_geos[] = {
11205 {2442, 7}, {2447, 8}, {2452, 9}, 11205 {2442, 7}, {2447, 8}, {2452, 9},
11206 {2457, 10}, {2462, 11}}, 11206 {2457, 10}, {2462, 11}},
11207 .a_channels = 13, 11207 .a_channels = 13,
11208 .a = {{5180, 36, IEEE80211_CH_PASSIVE_ONLY}, 11208 .a = {{5180, 36, LIBIPW_CH_PASSIVE_ONLY},
11209 {5200, 40, IEEE80211_CH_PASSIVE_ONLY}, 11209 {5200, 40, LIBIPW_CH_PASSIVE_ONLY},
11210 {5220, 44, IEEE80211_CH_PASSIVE_ONLY}, 11210 {5220, 44, LIBIPW_CH_PASSIVE_ONLY},
11211 {5240, 48, IEEE80211_CH_PASSIVE_ONLY}, 11211 {5240, 48, LIBIPW_CH_PASSIVE_ONLY},
11212 {5260, 52, IEEE80211_CH_PASSIVE_ONLY}, 11212 {5260, 52, LIBIPW_CH_PASSIVE_ONLY},
11213 {5280, 56, IEEE80211_CH_PASSIVE_ONLY}, 11213 {5280, 56, LIBIPW_CH_PASSIVE_ONLY},
11214 {5300, 60, IEEE80211_CH_PASSIVE_ONLY}, 11214 {5300, 60, LIBIPW_CH_PASSIVE_ONLY},
11215 {5320, 64, IEEE80211_CH_PASSIVE_ONLY}, 11215 {5320, 64, LIBIPW_CH_PASSIVE_ONLY},
11216 {5745, 149, IEEE80211_CH_PASSIVE_ONLY}, 11216 {5745, 149, LIBIPW_CH_PASSIVE_ONLY},
11217 {5765, 153, IEEE80211_CH_PASSIVE_ONLY}, 11217 {5765, 153, LIBIPW_CH_PASSIVE_ONLY},
11218 {5785, 157, IEEE80211_CH_PASSIVE_ONLY}, 11218 {5785, 157, LIBIPW_CH_PASSIVE_ONLY},
11219 {5805, 161, IEEE80211_CH_PASSIVE_ONLY}, 11219 {5805, 161, LIBIPW_CH_PASSIVE_ONLY},
11220 {5825, 165, IEEE80211_CH_PASSIVE_ONLY}}, 11220 {5825, 165, LIBIPW_CH_PASSIVE_ONLY}},
11221 } 11221 }
11222}; 11222};
11223 11223
@@ -11228,7 +11228,7 @@ static int ipw_up(struct ipw_priv *priv)
11228 11228
11229 /* Age scan list entries found before suspend */ 11229 /* Age scan list entries found before suspend */
11230 if (priv->suspend_time) { 11230 if (priv->suspend_time) {
11231 ieee80211_networks_age(priv->ieee, priv->suspend_time); 11231 libipw_networks_age(priv->ieee, priv->suspend_time);
11232 priv->suspend_time = 0; 11232 priv->suspend_time = 0;
11233 } 11233 }
11234 11234
@@ -11273,7 +11273,7 @@ static int ipw_up(struct ipw_priv *priv)
11273 priv->eeprom[EEPROM_COUNTRY_CODE + 2]); 11273 priv->eeprom[EEPROM_COUNTRY_CODE + 2]);
11274 j = 0; 11274 j = 0;
11275 } 11275 }
11276 if (ieee80211_set_geo(priv->ieee, &ipw_geos[j])) { 11276 if (libipw_set_geo(priv->ieee, &ipw_geos[j])) {
11277 IPW_WARNING("Could not set geography."); 11277 IPW_WARNING("Could not set geography.");
11278 return 0; 11278 return 0;
11279 } 11279 }
@@ -11401,7 +11401,7 @@ static void ipw_bg_down(struct work_struct *work)
11401/* Called by register_netdev() */ 11401/* Called by register_netdev() */
11402static int ipw_net_init(struct net_device *dev) 11402static int ipw_net_init(struct net_device *dev)
11403{ 11403{
11404 struct ipw_priv *priv = ieee80211_priv(dev); 11404 struct ipw_priv *priv = libipw_priv(dev);
11405 mutex_lock(&priv->mutex); 11405 mutex_lock(&priv->mutex);
11406 11406
11407 if (ipw_up(priv)) { 11407 if (ipw_up(priv)) {
@@ -11480,7 +11480,7 @@ static struct attribute_group ipw_attribute_group = {
11480#ifdef CONFIG_IPW2200_PROMISCUOUS 11480#ifdef CONFIG_IPW2200_PROMISCUOUS
11481static int ipw_prom_open(struct net_device *dev) 11481static int ipw_prom_open(struct net_device *dev)
11482{ 11482{
11483 struct ipw_prom_priv *prom_priv = ieee80211_priv(dev); 11483 struct ipw_prom_priv *prom_priv = libipw_priv(dev);
11484 struct ipw_priv *priv = prom_priv->priv; 11484 struct ipw_priv *priv = prom_priv->priv;
11485 11485
11486 IPW_DEBUG_INFO("prom dev->open\n"); 11486 IPW_DEBUG_INFO("prom dev->open\n");
@@ -11500,7 +11500,7 @@ static int ipw_prom_open(struct net_device *dev)
11500 11500
11501static int ipw_prom_stop(struct net_device *dev) 11501static int ipw_prom_stop(struct net_device *dev)
11502{ 11502{
11503 struct ipw_prom_priv *prom_priv = ieee80211_priv(dev); 11503 struct ipw_prom_priv *prom_priv = libipw_priv(dev);
11504 struct ipw_priv *priv = prom_priv->priv; 11504 struct ipw_priv *priv = prom_priv->priv;
11505 11505
11506 IPW_DEBUG_INFO("prom dev->stop\n"); 11506 IPW_DEBUG_INFO("prom dev->stop\n");
@@ -11528,7 +11528,7 @@ static const struct net_device_ops ipw_prom_netdev_ops = {
11528 .ndo_open = ipw_prom_open, 11528 .ndo_open = ipw_prom_open,
11529 .ndo_stop = ipw_prom_stop, 11529 .ndo_stop = ipw_prom_stop,
11530 .ndo_start_xmit = ipw_prom_hard_start_xmit, 11530 .ndo_start_xmit = ipw_prom_hard_start_xmit,
11531 .ndo_change_mtu = ieee80211_change_mtu, 11531 .ndo_change_mtu = libipw_change_mtu,
11532 .ndo_set_mac_address = eth_mac_addr, 11532 .ndo_set_mac_address = eth_mac_addr,
11533 .ndo_validate_addr = eth_validate_addr, 11533 .ndo_validate_addr = eth_validate_addr,
11534}; 11534};
@@ -11544,7 +11544,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
11544 if (priv->prom_net_dev == NULL) 11544 if (priv->prom_net_dev == NULL)
11545 return -ENOMEM; 11545 return -ENOMEM;
11546 11546
11547 priv->prom_priv = ieee80211_priv(priv->prom_net_dev); 11547 priv->prom_priv = libipw_priv(priv->prom_net_dev);
11548 priv->prom_priv->ieee = netdev_priv(priv->prom_net_dev); 11548 priv->prom_priv->ieee = netdev_priv(priv->prom_net_dev);
11549 priv->prom_priv->priv = priv; 11549 priv->prom_priv->priv = priv;
11550 11550
@@ -11586,8 +11586,8 @@ static const struct net_device_ops ipw_netdev_ops = {
11586 .ndo_stop = ipw_net_stop, 11586 .ndo_stop = ipw_net_stop,
11587 .ndo_set_multicast_list = ipw_net_set_multicast_list, 11587 .ndo_set_multicast_list = ipw_net_set_multicast_list,
11588 .ndo_set_mac_address = ipw_net_set_mac_address, 11588 .ndo_set_mac_address = ipw_net_set_mac_address,
11589 .ndo_start_xmit = ieee80211_xmit, 11589 .ndo_start_xmit = libipw_xmit,
11590 .ndo_change_mtu = ieee80211_change_mtu, 11590 .ndo_change_mtu = libipw_change_mtu,
11591 .ndo_validate_addr = eth_validate_addr, 11591 .ndo_validate_addr = eth_validate_addr,
11592}; 11592};
11593 11593
@@ -11607,7 +11607,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11607 goto out; 11607 goto out;
11608 } 11608 }
11609 11609
11610 priv = ieee80211_priv(net_dev); 11610 priv = libipw_priv(net_dev);
11611 priv->ieee = netdev_priv(net_dev); 11611 priv->ieee = netdev_priv(net_dev);
11612 11612
11613 priv->net_dev = net_dev; 11613 priv->net_dev = net_dev;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.h b/drivers/net/wireless/ipw2x00/ipw2200.h
index 05e8ccf01c5f..4448bad51b8a 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.h
+++ b/drivers/net/wireless/ipw2x00/ipw2200.h
@@ -55,7 +55,7 @@
55 55
56#include <linux/workqueue.h> 56#include <linux/workqueue.h>
57 57
58#include "ieee80211.h" 58#include "libipw.h"
59 59
60/* Authentication and Association States */ 60/* Authentication and Association States */
61enum connection_manager_assoc_states { 61enum connection_manager_assoc_states {
@@ -365,8 +365,8 @@ enum connection_manager_assoc_states {
365/* QoS sturctures */ 365/* QoS sturctures */
366struct ipw_qos_info { 366struct ipw_qos_info {
367 int qos_enable; 367 int qos_enable;
368 struct ieee80211_qos_parameters *def_qos_parm_OFDM; 368 struct libipw_qos_parameters *def_qos_parm_OFDM;
369 struct ieee80211_qos_parameters *def_qos_parm_CCK; 369 struct libipw_qos_parameters *def_qos_parm_CCK;
370 u32 burst_duration_CCK; 370 u32 burst_duration_CCK;
371 u32 burst_duration_OFDM; 371 u32 burst_duration_OFDM;
372 u16 qos_no_ack_mask; 372 u16 qos_no_ack_mask;
@@ -534,7 +534,7 @@ typedef void destructor_func(const void *);
534struct clx2_tx_queue { 534struct clx2_tx_queue {
535 struct clx2_queue q; 535 struct clx2_queue q;
536 struct tfd_frame *bd; 536 struct tfd_frame *bd;
537 struct ieee80211_txb **txb; 537 struct libipw_txb **txb;
538}; 538};
539 539
540/* 540/*
@@ -1144,7 +1144,7 @@ enum ipw_prom_filter {
1144struct ipw_priv; 1144struct ipw_priv;
1145struct ipw_prom_priv { 1145struct ipw_prom_priv {
1146 struct ipw_priv *priv; 1146 struct ipw_priv *priv;
1147 struct ieee80211_device *ieee; 1147 struct libipw_device *ieee;
1148 enum ipw_prom_filter filter; 1148 enum ipw_prom_filter filter;
1149 int tx_packets; 1149 int tx_packets;
1150 int rx_packets; 1150 int rx_packets;
@@ -1175,7 +1175,7 @@ struct ipw_rt_hdr {
1175 1175
1176struct ipw_priv { 1176struct ipw_priv {
1177 /* ieee device used by generic ieee processing code */ 1177 /* ieee device used by generic ieee processing code */
1178 struct ieee80211_device *ieee; 1178 struct libipw_device *ieee;
1179 1179
1180 spinlock_t lock; 1180 spinlock_t lock;
1181 spinlock_t irq_lock; 1181 spinlock_t irq_lock;
@@ -1222,7 +1222,7 @@ struct ipw_priv {
1222 u32 roaming_threshold; 1222 u32 roaming_threshold;
1223 1223
1224 struct ipw_associate assoc_request; 1224 struct ipw_associate assoc_request;
1225 struct ieee80211_network *assoc_network; 1225 struct libipw_network *assoc_network;
1226 1226
1227 unsigned long ts_scan_abort; 1227 unsigned long ts_scan_abort;
1228 struct ipw_supported_rates rates; 1228 struct ipw_supported_rates rates;
diff --git a/drivers/net/wireless/ipw2x00/ieee80211.h b/drivers/net/wireless/ipw2x00/libipw.h
index 70755c1336d5..cefb94262cc2 100644
--- a/drivers/net/wireless/ipw2x00/ieee80211.h
+++ b/drivers/net/wireless/ipw2x00/libipw.h
@@ -20,11 +20,11 @@
20 * 20 *
21 * API Version History 21 * API Version History
22 * 1.0.x -- Initial version 22 * 1.0.x -- Initial version
23 * 1.1.x -- Added radiotap, QoS, TIM, ieee80211_geo APIs, 23 * 1.1.x -- Added radiotap, QoS, TIM, libipw_geo APIs,
24 * various structure changes, and crypto API init method 24 * various structure changes, and crypto API init method
25 */ 25 */
26#ifndef IEEE80211_H 26#ifndef LIBIPW_H
27#define IEEE80211_H 27#define LIBIPW_H
28#include <linux/if_ether.h> /* ETH_ALEN */ 28#include <linux/if_ether.h> /* ETH_ALEN */
29#include <linux/kernel.h> /* ARRAY_SIZE */ 29#include <linux/kernel.h> /* ARRAY_SIZE */
30#include <linux/wireless.h> 30#include <linux/wireless.h>
@@ -32,9 +32,9 @@
32 32
33#include <net/lib80211.h> 33#include <net/lib80211.h>
34 34
35#define IEEE80211_VERSION "git-1.1.13" 35#define LIBIPW_VERSION "git-1.1.13"
36 36
37#define IEEE80211_DATA_LEN 2304 37#define LIBIPW_DATA_LEN 2304
38/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 38/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
39 6.2.1.1.2. 39 6.2.1.1.2.
40 40
@@ -43,35 +43,35 @@
43 represents the 2304 bytes of real data, plus a possible 8 bytes of 43 represents the 2304 bytes of real data, plus a possible 8 bytes of
44 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ 44 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
45 45
46#define IEEE80211_1ADDR_LEN 10 46#define LIBIPW_1ADDR_LEN 10
47#define IEEE80211_2ADDR_LEN 16 47#define LIBIPW_2ADDR_LEN 16
48#define IEEE80211_3ADDR_LEN 24 48#define LIBIPW_3ADDR_LEN 24
49#define IEEE80211_4ADDR_LEN 30 49#define LIBIPW_4ADDR_LEN 30
50#define IEEE80211_FCS_LEN 4 50#define LIBIPW_FCS_LEN 4
51#define IEEE80211_HLEN (IEEE80211_4ADDR_LEN) 51#define LIBIPW_HLEN (LIBIPW_4ADDR_LEN)
52#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) 52#define LIBIPW_FRAME_LEN (LIBIPW_DATA_LEN + LIBIPW_HLEN)
53 53
54#define MIN_FRAG_THRESHOLD 256U 54#define MIN_FRAG_THRESHOLD 256U
55#define MAX_FRAG_THRESHOLD 2346U 55#define MAX_FRAG_THRESHOLD 2346U
56 56
57/* QOS control */ 57/* QOS control */
58#define IEEE80211_QCTL_TID 0x000F 58#define LIBIPW_QCTL_TID 0x000F
59 59
60/* debug macros */ 60/* debug macros */
61 61
62#ifdef CONFIG_LIBIPW_DEBUG 62#ifdef CONFIG_LIBIPW_DEBUG
63extern u32 ieee80211_debug_level; 63extern u32 libipw_debug_level;
64#define IEEE80211_DEBUG(level, fmt, args...) \ 64#define LIBIPW_DEBUG(level, fmt, args...) \
65do { if (ieee80211_debug_level & (level)) \ 65do { if (libipw_debug_level & (level)) \
66 printk(KERN_DEBUG "ieee80211: %c %s " fmt, \ 66 printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
67 in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0) 67 in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)
68static inline bool ieee80211_ratelimit_debug(u32 level) 68static inline bool libipw_ratelimit_debug(u32 level)
69{ 69{
70 return (ieee80211_debug_level & level) && net_ratelimit(); 70 return (libipw_debug_level & level) && net_ratelimit();
71} 71}
72#else 72#else
73#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) 73#define LIBIPW_DEBUG(level, fmt, args...) do {} while (0)
74static inline bool ieee80211_ratelimit_debug(u32 level) 74static inline bool libipw_ratelimit_debug(u32 level)
75{ 75{
76 return false; 76 return false;
77} 77}
@@ -83,51 +83,51 @@ static inline bool ieee80211_ratelimit_debug(u32 level)
83 * If you are defining a new debug classification, simply add it to the #define 83 * If you are defining a new debug classification, simply add it to the #define
84 * list here in the form of: 84 * list here in the form of:
85 * 85 *
86 * #define IEEE80211_DL_xxxx VALUE 86 * #define LIBIPW_DL_xxxx VALUE
87 * 87 *
88 * shifting value to the left one bit from the previous entry. xxxx should be 88 * shifting value to the left one bit from the previous entry. xxxx should be
89 * the name of the classification (for example, WEP) 89 * the name of the classification (for example, WEP)
90 * 90 *
91 * You then need to either add a IEEE80211_xxxx_DEBUG() macro definition for your 91 * You then need to either add a LIBIPW_xxxx_DEBUG() macro definition for your
92 * classification, or use IEEE80211_DEBUG(IEEE80211_DL_xxxx, ...) whenever you want 92 * classification, or use LIBIPW_DEBUG(LIBIPW_DL_xxxx, ...) whenever you want
93 * to send output to that classification. 93 * to send output to that classification.
94 * 94 *
95 * To add your debug level to the list of levels seen when you perform 95 * To add your debug level to the list of levels seen when you perform
96 * 96 *
97 * % cat /proc/net/ieee80211/debug_level 97 * % cat /proc/net/ieee80211/debug_level
98 * 98 *
99 * you simply need to add your entry to the ieee80211_debug_level array. 99 * you simply need to add your entry to the libipw_debug_level array.
100 * 100 *
101 * If you do not see debug_level in /proc/net/ieee80211 then you do not have 101 * If you do not see debug_level in /proc/net/ieee80211 then you do not have
102 * CONFIG_LIBIPW_DEBUG defined in your kernel configuration 102 * CONFIG_LIBIPW_DEBUG defined in your kernel configuration
103 * 103 *
104 */ 104 */
105 105
106#define IEEE80211_DL_INFO (1<<0) 106#define LIBIPW_DL_INFO (1<<0)
107#define IEEE80211_DL_WX (1<<1) 107#define LIBIPW_DL_WX (1<<1)
108#define IEEE80211_DL_SCAN (1<<2) 108#define LIBIPW_DL_SCAN (1<<2)
109#define IEEE80211_DL_STATE (1<<3) 109#define LIBIPW_DL_STATE (1<<3)
110#define IEEE80211_DL_MGMT (1<<4) 110#define LIBIPW_DL_MGMT (1<<4)
111#define IEEE80211_DL_FRAG (1<<5) 111#define LIBIPW_DL_FRAG (1<<5)
112#define IEEE80211_DL_DROP (1<<7) 112#define LIBIPW_DL_DROP (1<<7)
113 113
114#define IEEE80211_DL_TX (1<<8) 114#define LIBIPW_DL_TX (1<<8)
115#define IEEE80211_DL_RX (1<<9) 115#define LIBIPW_DL_RX (1<<9)
116#define IEEE80211_DL_QOS (1<<31) 116#define LIBIPW_DL_QOS (1<<31)
117 117
118#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a) 118#define LIBIPW_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
119#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a) 119#define LIBIPW_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
120#define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a) 120#define LIBIPW_DEBUG_INFO(f, a...) LIBIPW_DEBUG(LIBIPW_DL_INFO, f, ## a)
121 121
122#define IEEE80211_DEBUG_WX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_WX, f, ## a) 122#define LIBIPW_DEBUG_WX(f, a...) LIBIPW_DEBUG(LIBIPW_DL_WX, f, ## a)
123#define IEEE80211_DEBUG_SCAN(f, a...) IEEE80211_DEBUG(IEEE80211_DL_SCAN, f, ## a) 123#define LIBIPW_DEBUG_SCAN(f, a...) LIBIPW_DEBUG(LIBIPW_DL_SCAN, f, ## a)
124#define IEEE80211_DEBUG_STATE(f, a...) IEEE80211_DEBUG(IEEE80211_DL_STATE, f, ## a) 124#define LIBIPW_DEBUG_STATE(f, a...) LIBIPW_DEBUG(LIBIPW_DL_STATE, f, ## a)
125#define IEEE80211_DEBUG_MGMT(f, a...) IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, ## a) 125#define LIBIPW_DEBUG_MGMT(f, a...) LIBIPW_DEBUG(LIBIPW_DL_MGMT, f, ## a)
126#define IEEE80211_DEBUG_FRAG(f, a...) IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, ## a) 126#define LIBIPW_DEBUG_FRAG(f, a...) LIBIPW_DEBUG(LIBIPW_DL_FRAG, f, ## a)
127#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a) 127#define LIBIPW_DEBUG_DROP(f, a...) LIBIPW_DEBUG(LIBIPW_DL_DROP, f, ## a)
128#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a) 128#define LIBIPW_DEBUG_TX(f, a...) LIBIPW_DEBUG(LIBIPW_DL_TX, f, ## a)
129#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) 129#define LIBIPW_DEBUG_RX(f, a...) LIBIPW_DEBUG(LIBIPW_DL_RX, f, ## a)
130#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a) 130#define LIBIPW_DEBUG_QOS(f, a...) LIBIPW_DEBUG(LIBIPW_DL_QOS, f, ## a)
131#include <linux/netdevice.h> 131#include <linux/netdevice.h>
132#include <linux/if_arp.h> /* ARPHRD_ETHER */ 132#include <linux/if_arp.h> /* ARPHRD_ETHER */
133 133
@@ -146,7 +146,7 @@ static inline bool ieee80211_ratelimit_debug(u32 level)
146 146
147#define P80211_OUI_LEN 3 147#define P80211_OUI_LEN 3
148 148
149struct ieee80211_snap_hdr { 149struct libipw_snap_hdr {
150 150
151 u8 dsap; /* always 0xAA */ 151 u8 dsap; /* always 0xAA */
152 u8 ssap; /* always 0xAA */ 152 u8 ssap; /* always 0xAA */
@@ -155,7 +155,7 @@ struct ieee80211_snap_hdr {
155 155
156} __attribute__ ((packed)); 156} __attribute__ ((packed));
157 157
158#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) 158#define SNAP_SIZE sizeof(struct libipw_snap_hdr)
159 159
160#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS) 160#define WLAN_FC_GET_VERS(fc) ((fc) & IEEE80211_FCTL_VERS)
161#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) 161#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
@@ -164,74 +164,74 @@ struct ieee80211_snap_hdr {
164#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) 164#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
165#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) 165#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
166 166
167#define IEEE80211_STATMASK_SIGNAL (1<<0) 167#define LIBIPW_STATMASK_SIGNAL (1<<0)
168#define IEEE80211_STATMASK_RSSI (1<<1) 168#define LIBIPW_STATMASK_RSSI (1<<1)
169#define IEEE80211_STATMASK_NOISE (1<<2) 169#define LIBIPW_STATMASK_NOISE (1<<2)
170#define IEEE80211_STATMASK_RATE (1<<3) 170#define LIBIPW_STATMASK_RATE (1<<3)
171#define IEEE80211_STATMASK_WEMASK 0x7 171#define LIBIPW_STATMASK_WEMASK 0x7
172 172
173#define IEEE80211_CCK_MODULATION (1<<0) 173#define LIBIPW_CCK_MODULATION (1<<0)
174#define IEEE80211_OFDM_MODULATION (1<<1) 174#define LIBIPW_OFDM_MODULATION (1<<1)
175 175
176#define IEEE80211_24GHZ_BAND (1<<0) 176#define LIBIPW_24GHZ_BAND (1<<0)
177#define IEEE80211_52GHZ_BAND (1<<1) 177#define LIBIPW_52GHZ_BAND (1<<1)
178 178
179#define IEEE80211_CCK_RATE_1MB 0x02 179#define LIBIPW_CCK_RATE_1MB 0x02
180#define IEEE80211_CCK_RATE_2MB 0x04 180#define LIBIPW_CCK_RATE_2MB 0x04
181#define IEEE80211_CCK_RATE_5MB 0x0B 181#define LIBIPW_CCK_RATE_5MB 0x0B
182#define IEEE80211_CCK_RATE_11MB 0x16 182#define LIBIPW_CCK_RATE_11MB 0x16
183#define IEEE80211_OFDM_RATE_6MB 0x0C 183#define LIBIPW_OFDM_RATE_6MB 0x0C
184#define IEEE80211_OFDM_RATE_9MB 0x12 184#define LIBIPW_OFDM_RATE_9MB 0x12
185#define IEEE80211_OFDM_RATE_12MB 0x18 185#define LIBIPW_OFDM_RATE_12MB 0x18
186#define IEEE80211_OFDM_RATE_18MB 0x24 186#define LIBIPW_OFDM_RATE_18MB 0x24
187#define IEEE80211_OFDM_RATE_24MB 0x30 187#define LIBIPW_OFDM_RATE_24MB 0x30
188#define IEEE80211_OFDM_RATE_36MB 0x48 188#define LIBIPW_OFDM_RATE_36MB 0x48
189#define IEEE80211_OFDM_RATE_48MB 0x60 189#define LIBIPW_OFDM_RATE_48MB 0x60
190#define IEEE80211_OFDM_RATE_54MB 0x6C 190#define LIBIPW_OFDM_RATE_54MB 0x6C
191#define IEEE80211_BASIC_RATE_MASK 0x80 191#define LIBIPW_BASIC_RATE_MASK 0x80
192 192
193#define IEEE80211_CCK_RATE_1MB_MASK (1<<0) 193#define LIBIPW_CCK_RATE_1MB_MASK (1<<0)
194#define IEEE80211_CCK_RATE_2MB_MASK (1<<1) 194#define LIBIPW_CCK_RATE_2MB_MASK (1<<1)
195#define IEEE80211_CCK_RATE_5MB_MASK (1<<2) 195#define LIBIPW_CCK_RATE_5MB_MASK (1<<2)
196#define IEEE80211_CCK_RATE_11MB_MASK (1<<3) 196#define LIBIPW_CCK_RATE_11MB_MASK (1<<3)
197#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4) 197#define LIBIPW_OFDM_RATE_6MB_MASK (1<<4)
198#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5) 198#define LIBIPW_OFDM_RATE_9MB_MASK (1<<5)
199#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6) 199#define LIBIPW_OFDM_RATE_12MB_MASK (1<<6)
200#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7) 200#define LIBIPW_OFDM_RATE_18MB_MASK (1<<7)
201#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8) 201#define LIBIPW_OFDM_RATE_24MB_MASK (1<<8)
202#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9) 202#define LIBIPW_OFDM_RATE_36MB_MASK (1<<9)
203#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) 203#define LIBIPW_OFDM_RATE_48MB_MASK (1<<10)
204#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) 204#define LIBIPW_OFDM_RATE_54MB_MASK (1<<11)
205 205
206#define IEEE80211_CCK_RATES_MASK 0x0000000F 206#define LIBIPW_CCK_RATES_MASK 0x0000000F
207#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ 207#define LIBIPW_CCK_BASIC_RATES_MASK (LIBIPW_CCK_RATE_1MB_MASK | \
208 IEEE80211_CCK_RATE_2MB_MASK) 208 LIBIPW_CCK_RATE_2MB_MASK)
209#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ 209#define LIBIPW_CCK_DEFAULT_RATES_MASK (LIBIPW_CCK_BASIC_RATES_MASK | \
210 IEEE80211_CCK_RATE_5MB_MASK | \ 210 LIBIPW_CCK_RATE_5MB_MASK | \
211 IEEE80211_CCK_RATE_11MB_MASK) 211 LIBIPW_CCK_RATE_11MB_MASK)
212 212
213#define IEEE80211_OFDM_RATES_MASK 0x00000FF0 213#define LIBIPW_OFDM_RATES_MASK 0x00000FF0
214#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ 214#define LIBIPW_OFDM_BASIC_RATES_MASK (LIBIPW_OFDM_RATE_6MB_MASK | \
215 IEEE80211_OFDM_RATE_12MB_MASK | \ 215 LIBIPW_OFDM_RATE_12MB_MASK | \
216 IEEE80211_OFDM_RATE_24MB_MASK) 216 LIBIPW_OFDM_RATE_24MB_MASK)
217#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \ 217#define LIBIPW_OFDM_DEFAULT_RATES_MASK (LIBIPW_OFDM_BASIC_RATES_MASK | \
218 IEEE80211_OFDM_RATE_9MB_MASK | \ 218 LIBIPW_OFDM_RATE_9MB_MASK | \
219 IEEE80211_OFDM_RATE_18MB_MASK | \ 219 LIBIPW_OFDM_RATE_18MB_MASK | \
220 IEEE80211_OFDM_RATE_36MB_MASK | \ 220 LIBIPW_OFDM_RATE_36MB_MASK | \
221 IEEE80211_OFDM_RATE_48MB_MASK | \ 221 LIBIPW_OFDM_RATE_48MB_MASK | \
222 IEEE80211_OFDM_RATE_54MB_MASK) 222 LIBIPW_OFDM_RATE_54MB_MASK)
223#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ 223#define LIBIPW_DEFAULT_RATES_MASK (LIBIPW_OFDM_DEFAULT_RATES_MASK | \
224 IEEE80211_CCK_DEFAULT_RATES_MASK) 224 LIBIPW_CCK_DEFAULT_RATES_MASK)
225 225
226#define IEEE80211_NUM_OFDM_RATES 8 226#define LIBIPW_NUM_OFDM_RATES 8
227#define IEEE80211_NUM_CCK_RATES 4 227#define LIBIPW_NUM_CCK_RATES 4
228#define IEEE80211_OFDM_SHIFT_MASK_A 4 228#define LIBIPW_OFDM_SHIFT_MASK_A 4
229 229
230/* NOTE: This data is for statistical purposes; not all hardware provides this 230/* NOTE: This data is for statistical purposes; not all hardware provides this
231 * information for frames received. 231 * information for frames received.
232 * For ieee80211_rx_mgt, you need to set at least the 'len' parameter. 232 * For libipw_rx_mgt, you need to set at least the 'len' parameter.
233 */ 233 */
234struct ieee80211_rx_stats { 234struct libipw_rx_stats {
235 u32 mac_time; 235 u32 mac_time;
236 s8 rssi; 236 s8 rssi;
237 u8 signal; 237 u8 signal;
@@ -250,9 +250,9 @@ struct ieee80211_rx_stats {
250 * three fragmented frames. This define can be increased to support more 250 * three fragmented frames. This define can be increased to support more
251 * concurrent frames, but it should be noted that each entry can consume about 251 * concurrent frames, but it should be noted that each entry can consume about
252 * 2 kB of RAM and increasing cache size will slow down frame reassembly. */ 252 * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
253#define IEEE80211_FRAG_CACHE_LEN 4 253#define LIBIPW_FRAG_CACHE_LEN 4
254 254
255struct ieee80211_frag_entry { 255struct libipw_frag_entry {
256 unsigned long first_frag_time; 256 unsigned long first_frag_time;
257 unsigned int seq; 257 unsigned int seq;
258 unsigned int last_frag; 258 unsigned int last_frag;
@@ -261,7 +261,7 @@ struct ieee80211_frag_entry {
261 u8 dst_addr[ETH_ALEN]; 261 u8 dst_addr[ETH_ALEN];
262}; 262};
263 263
264struct ieee80211_stats { 264struct libipw_stats {
265 unsigned int tx_unicast_frames; 265 unsigned int tx_unicast_frames;
266 unsigned int tx_multicast_frames; 266 unsigned int tx_multicast_frames;
267 unsigned int tx_fragments; 267 unsigned int tx_fragments;
@@ -285,7 +285,7 @@ struct ieee80211_stats {
285 unsigned int rx_message_in_bad_msg_fragments; 285 unsigned int rx_message_in_bad_msg_fragments;
286}; 286};
287 287
288struct ieee80211_device; 288struct libipw_device;
289 289
290#define SEC_KEY_1 (1<<0) 290#define SEC_KEY_1 (1<<0)
291#define SEC_KEY_2 (1<<1) 291#define SEC_KEY_2 (1<<1)
@@ -314,7 +314,7 @@ struct ieee80211_device;
314#define SCM_KEY_LEN 32 314#define SCM_KEY_LEN 32
315#define SCM_TEMPORAL_KEY_LENGTH 16 315#define SCM_TEMPORAL_KEY_LENGTH 16
316 316
317struct ieee80211_security { 317struct libipw_security {
318 u16 active_key:2, enabled:1, unicast_uses_group:1, encrypt:1; 318 u16 active_key:2, enabled:1, unicast_uses_group:1, encrypt:1;
319 u8 auth_mode; 319 u8 auth_mode;
320 u8 encode_alg[WEP_KEYS]; 320 u8 encode_alg[WEP_KEYS];
@@ -341,14 +341,14 @@ Total: 28-2340 bytes
341 341
342#define BEACON_PROBE_SSID_ID_POSITION 12 342#define BEACON_PROBE_SSID_ID_POSITION 12
343 343
344struct ieee80211_hdr_1addr { 344struct libipw_hdr_1addr {
345 __le16 frame_ctl; 345 __le16 frame_ctl;
346 __le16 duration_id; 346 __le16 duration_id;
347 u8 addr1[ETH_ALEN]; 347 u8 addr1[ETH_ALEN];
348 u8 payload[0]; 348 u8 payload[0];
349} __attribute__ ((packed)); 349} __attribute__ ((packed));
350 350
351struct ieee80211_hdr_2addr { 351struct libipw_hdr_2addr {
352 __le16 frame_ctl; 352 __le16 frame_ctl;
353 __le16 duration_id; 353 __le16 duration_id;
354 u8 addr1[ETH_ALEN]; 354 u8 addr1[ETH_ALEN];
@@ -356,7 +356,7 @@ struct ieee80211_hdr_2addr {
356 u8 payload[0]; 356 u8 payload[0];
357} __attribute__ ((packed)); 357} __attribute__ ((packed));
358 358
359struct ieee80211_hdr_3addr { 359struct libipw_hdr_3addr {
360 __le16 frame_ctl; 360 __le16 frame_ctl;
361 __le16 duration_id; 361 __le16 duration_id;
362 u8 addr1[ETH_ALEN]; 362 u8 addr1[ETH_ALEN];
@@ -366,7 +366,7 @@ struct ieee80211_hdr_3addr {
366 u8 payload[0]; 366 u8 payload[0];
367} __attribute__ ((packed)); 367} __attribute__ ((packed));
368 368
369struct ieee80211_hdr_4addr { 369struct libipw_hdr_4addr {
370 __le16 frame_ctl; 370 __le16 frame_ctl;
371 __le16 duration_id; 371 __le16 duration_id;
372 u8 addr1[ETH_ALEN]; 372 u8 addr1[ETH_ALEN];
@@ -377,7 +377,7 @@ struct ieee80211_hdr_4addr {
377 u8 payload[0]; 377 u8 payload[0];
378} __attribute__ ((packed)); 378} __attribute__ ((packed));
379 379
380struct ieee80211_hdr_3addrqos { 380struct libipw_hdr_3addrqos {
381 __le16 frame_ctl; 381 __le16 frame_ctl;
382 __le16 duration_id; 382 __le16 duration_id;
383 u8 addr1[ETH_ALEN]; 383 u8 addr1[ETH_ALEN];
@@ -388,7 +388,7 @@ struct ieee80211_hdr_3addrqos {
388 __le16 qos_ctl; 388 __le16 qos_ctl;
389} __attribute__ ((packed)); 389} __attribute__ ((packed));
390 390
391struct ieee80211_info_element { 391struct libipw_info_element {
392 u8 id; 392 u8 id;
393 u8 len; 393 u8 len;
394 u8 data[0]; 394 u8 data[0];
@@ -411,16 +411,16 @@ struct ieee80211_info_element {
411 u16 status; 411 u16 status;
412*/ 412*/
413 413
414struct ieee80211_auth { 414struct libipw_auth {
415 struct ieee80211_hdr_3addr header; 415 struct libipw_hdr_3addr header;
416 __le16 algorithm; 416 __le16 algorithm;
417 __le16 transaction; 417 __le16 transaction;
418 __le16 status; 418 __le16 status;
419 /* challenge */ 419 /* challenge */
420 struct ieee80211_info_element info_element[0]; 420 struct libipw_info_element info_element[0];
421} __attribute__ ((packed)); 421} __attribute__ ((packed));
422 422
423struct ieee80211_channel_switch { 423struct libipw_channel_switch {
424 u8 id; 424 u8 id;
425 u8 len; 425 u8 len;
426 u8 mode; 426 u8 mode;
@@ -428,73 +428,73 @@ struct ieee80211_channel_switch {
428 u8 count; 428 u8 count;
429} __attribute__ ((packed)); 429} __attribute__ ((packed));
430 430
431struct ieee80211_action { 431struct libipw_action {
432 struct ieee80211_hdr_3addr header; 432 struct libipw_hdr_3addr header;
433 u8 category; 433 u8 category;
434 u8 action; 434 u8 action;
435 union { 435 union {
436 struct ieee80211_action_exchange { 436 struct libipw_action_exchange {
437 u8 token; 437 u8 token;
438 struct ieee80211_info_element info_element[0]; 438 struct libipw_info_element info_element[0];
439 } exchange; 439 } exchange;
440 struct ieee80211_channel_switch channel_switch; 440 struct libipw_channel_switch channel_switch;
441 441
442 } format; 442 } format;
443} __attribute__ ((packed)); 443} __attribute__ ((packed));
444 444
445struct ieee80211_disassoc { 445struct libipw_disassoc {
446 struct ieee80211_hdr_3addr header; 446 struct libipw_hdr_3addr header;
447 __le16 reason; 447 __le16 reason;
448} __attribute__ ((packed)); 448} __attribute__ ((packed));
449 449
450/* Alias deauth for disassoc */ 450/* Alias deauth for disassoc */
451#define ieee80211_deauth ieee80211_disassoc 451#define libipw_deauth libipw_disassoc
452 452
453struct ieee80211_probe_request { 453struct libipw_probe_request {
454 struct ieee80211_hdr_3addr header; 454 struct libipw_hdr_3addr header;
455 /* SSID, supported rates */ 455 /* SSID, supported rates */
456 struct ieee80211_info_element info_element[0]; 456 struct libipw_info_element info_element[0];
457} __attribute__ ((packed)); 457} __attribute__ ((packed));
458 458
459struct ieee80211_probe_response { 459struct libipw_probe_response {
460 struct ieee80211_hdr_3addr header; 460 struct libipw_hdr_3addr header;
461 __le32 time_stamp[2]; 461 __le32 time_stamp[2];
462 __le16 beacon_interval; 462 __le16 beacon_interval;
463 __le16 capability; 463 __le16 capability;
464 /* SSID, supported rates, FH params, DS params, 464 /* SSID, supported rates, FH params, DS params,
465 * CF params, IBSS params, TIM (if beacon), RSN */ 465 * CF params, IBSS params, TIM (if beacon), RSN */
466 struct ieee80211_info_element info_element[0]; 466 struct libipw_info_element info_element[0];
467} __attribute__ ((packed)); 467} __attribute__ ((packed));
468 468
469/* Alias beacon for probe_response */ 469/* Alias beacon for probe_response */
470#define ieee80211_beacon ieee80211_probe_response 470#define libipw_beacon libipw_probe_response
471 471
472struct ieee80211_assoc_request { 472struct libipw_assoc_request {
473 struct ieee80211_hdr_3addr header; 473 struct libipw_hdr_3addr header;
474 __le16 capability; 474 __le16 capability;
475 __le16 listen_interval; 475 __le16 listen_interval;
476 /* SSID, supported rates, RSN */ 476 /* SSID, supported rates, RSN */
477 struct ieee80211_info_element info_element[0]; 477 struct libipw_info_element info_element[0];
478} __attribute__ ((packed)); 478} __attribute__ ((packed));
479 479
480struct ieee80211_reassoc_request { 480struct libipw_reassoc_request {
481 struct ieee80211_hdr_3addr header; 481 struct libipw_hdr_3addr header;
482 __le16 capability; 482 __le16 capability;
483 __le16 listen_interval; 483 __le16 listen_interval;
484 u8 current_ap[ETH_ALEN]; 484 u8 current_ap[ETH_ALEN];
485 struct ieee80211_info_element info_element[0]; 485 struct libipw_info_element info_element[0];
486} __attribute__ ((packed)); 486} __attribute__ ((packed));
487 487
488struct ieee80211_assoc_response { 488struct libipw_assoc_response {
489 struct ieee80211_hdr_3addr header; 489 struct libipw_hdr_3addr header;
490 __le16 capability; 490 __le16 capability;
491 __le16 status; 491 __le16 status;
492 __le16 aid; 492 __le16 aid;
493 /* supported rates */ 493 /* supported rates */
494 struct ieee80211_info_element info_element[0]; 494 struct libipw_info_element info_element[0];
495} __attribute__ ((packed)); 495} __attribute__ ((packed));
496 496
497struct ieee80211_txb { 497struct libipw_txb {
498 u8 nr_frags; 498 u8 nr_frags;
499 u8 encrypted; 499 u8 encrypted;
500 u8 rts_included; 500 u8 rts_included;
@@ -546,7 +546,7 @@ struct ieee80211_txb {
546#define QOS_VERSION_1 1 546#define QOS_VERSION_1 1
547#define QOS_AIFSN_MIN_VALUE 2 547#define QOS_AIFSN_MIN_VALUE 2
548 548
549struct ieee80211_qos_information_element { 549struct libipw_qos_information_element {
550 u8 elementID; 550 u8 elementID;
551 u8 length; 551 u8 length;
552 u8 qui[QOS_OUI_LEN]; 552 u8 qui[QOS_OUI_LEN];
@@ -556,19 +556,19 @@ struct ieee80211_qos_information_element {
556 u8 ac_info; 556 u8 ac_info;
557} __attribute__ ((packed)); 557} __attribute__ ((packed));
558 558
559struct ieee80211_qos_ac_parameter { 559struct libipw_qos_ac_parameter {
560 u8 aci_aifsn; 560 u8 aci_aifsn;
561 u8 ecw_min_max; 561 u8 ecw_min_max;
562 __le16 tx_op_limit; 562 __le16 tx_op_limit;
563} __attribute__ ((packed)); 563} __attribute__ ((packed));
564 564
565struct ieee80211_qos_parameter_info { 565struct libipw_qos_parameter_info {
566 struct ieee80211_qos_information_element info_element; 566 struct libipw_qos_information_element info_element;
567 u8 reserved; 567 u8 reserved;
568 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; 568 struct libipw_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
569} __attribute__ ((packed)); 569} __attribute__ ((packed));
570 570
571struct ieee80211_qos_parameters { 571struct libipw_qos_parameters {
572 __le16 cw_min[QOS_QUEUE_NUM]; 572 __le16 cw_min[QOS_QUEUE_NUM];
573 __le16 cw_max[QOS_QUEUE_NUM]; 573 __le16 cw_max[QOS_QUEUE_NUM];
574 u8 aifs[QOS_QUEUE_NUM]; 574 u8 aifs[QOS_QUEUE_NUM];
@@ -576,107 +576,107 @@ struct ieee80211_qos_parameters {
576 __le16 tx_op_limit[QOS_QUEUE_NUM]; 576 __le16 tx_op_limit[QOS_QUEUE_NUM];
577} __attribute__ ((packed)); 577} __attribute__ ((packed));
578 578
579struct ieee80211_qos_data { 579struct libipw_qos_data {
580 struct ieee80211_qos_parameters parameters; 580 struct libipw_qos_parameters parameters;
581 int active; 581 int active;
582 int supported; 582 int supported;
583 u8 param_count; 583 u8 param_count;
584 u8 old_param_count; 584 u8 old_param_count;
585}; 585};
586 586
587struct ieee80211_tim_parameters { 587struct libipw_tim_parameters {
588 u8 tim_count; 588 u8 tim_count;
589 u8 tim_period; 589 u8 tim_period;
590} __attribute__ ((packed)); 590} __attribute__ ((packed));
591 591
592/*******************************************************/ 592/*******************************************************/
593 593
594enum { /* ieee80211_basic_report.map */ 594enum { /* libipw_basic_report.map */
595 IEEE80211_BASIC_MAP_BSS = (1 << 0), 595 LIBIPW_BASIC_MAP_BSS = (1 << 0),
596 IEEE80211_BASIC_MAP_OFDM = (1 << 1), 596 LIBIPW_BASIC_MAP_OFDM = (1 << 1),
597 IEEE80211_BASIC_MAP_UNIDENTIFIED = (1 << 2), 597 LIBIPW_BASIC_MAP_UNIDENTIFIED = (1 << 2),
598 IEEE80211_BASIC_MAP_RADAR = (1 << 3), 598 LIBIPW_BASIC_MAP_RADAR = (1 << 3),
599 IEEE80211_BASIC_MAP_UNMEASURED = (1 << 4), 599 LIBIPW_BASIC_MAP_UNMEASURED = (1 << 4),
600 /* Bits 5-7 are reserved */ 600 /* Bits 5-7 are reserved */
601 601
602}; 602};
603struct ieee80211_basic_report { 603struct libipw_basic_report {
604 u8 channel; 604 u8 channel;
605 __le64 start_time; 605 __le64 start_time;
606 __le16 duration; 606 __le16 duration;
607 u8 map; 607 u8 map;
608} __attribute__ ((packed)); 608} __attribute__ ((packed));
609 609
610enum { /* ieee80211_measurement_request.mode */ 610enum { /* libipw_measurement_request.mode */
611 /* Bit 0 is reserved */ 611 /* Bit 0 is reserved */
612 IEEE80211_MEASUREMENT_ENABLE = (1 << 1), 612 LIBIPW_MEASUREMENT_ENABLE = (1 << 1),
613 IEEE80211_MEASUREMENT_REQUEST = (1 << 2), 613 LIBIPW_MEASUREMENT_REQUEST = (1 << 2),
614 IEEE80211_MEASUREMENT_REPORT = (1 << 3), 614 LIBIPW_MEASUREMENT_REPORT = (1 << 3),
615 /* Bits 4-7 are reserved */ 615 /* Bits 4-7 are reserved */
616}; 616};
617 617
618enum { 618enum {
619 IEEE80211_REPORT_BASIC = 0, /* required */ 619 LIBIPW_REPORT_BASIC = 0, /* required */
620 IEEE80211_REPORT_CCA = 1, /* optional */ 620 LIBIPW_REPORT_CCA = 1, /* optional */
621 IEEE80211_REPORT_RPI = 2, /* optional */ 621 LIBIPW_REPORT_RPI = 2, /* optional */
622 /* 3-255 reserved */ 622 /* 3-255 reserved */
623}; 623};
624 624
625struct ieee80211_measurement_params { 625struct libipw_measurement_params {
626 u8 channel; 626 u8 channel;
627 __le64 start_time; 627 __le64 start_time;
628 __le16 duration; 628 __le16 duration;
629} __attribute__ ((packed)); 629} __attribute__ ((packed));
630 630
631struct ieee80211_measurement_request { 631struct libipw_measurement_request {
632 struct ieee80211_info_element ie; 632 struct libipw_info_element ie;
633 u8 token; 633 u8 token;
634 u8 mode; 634 u8 mode;
635 u8 type; 635 u8 type;
636 struct ieee80211_measurement_params params[0]; 636 struct libipw_measurement_params params[0];
637} __attribute__ ((packed)); 637} __attribute__ ((packed));
638 638
639struct ieee80211_measurement_report { 639struct libipw_measurement_report {
640 struct ieee80211_info_element ie; 640 struct libipw_info_element ie;
641 u8 token; 641 u8 token;
642 u8 mode; 642 u8 mode;
643 u8 type; 643 u8 type;
644 union { 644 union {
645 struct ieee80211_basic_report basic[0]; 645 struct libipw_basic_report basic[0];
646 } u; 646 } u;
647} __attribute__ ((packed)); 647} __attribute__ ((packed));
648 648
649struct ieee80211_tpc_report { 649struct libipw_tpc_report {
650 u8 transmit_power; 650 u8 transmit_power;
651 u8 link_margin; 651 u8 link_margin;
652} __attribute__ ((packed)); 652} __attribute__ ((packed));
653 653
654struct ieee80211_channel_map { 654struct libipw_channel_map {
655 u8 channel; 655 u8 channel;
656 u8 map; 656 u8 map;
657} __attribute__ ((packed)); 657} __attribute__ ((packed));
658 658
659struct ieee80211_ibss_dfs { 659struct libipw_ibss_dfs {
660 struct ieee80211_info_element ie; 660 struct libipw_info_element ie;
661 u8 owner[ETH_ALEN]; 661 u8 owner[ETH_ALEN];
662 u8 recovery_interval; 662 u8 recovery_interval;
663 struct ieee80211_channel_map channel_map[0]; 663 struct libipw_channel_map channel_map[0];
664}; 664};
665 665
666struct ieee80211_csa { 666struct libipw_csa {
667 u8 mode; 667 u8 mode;
668 u8 channel; 668 u8 channel;
669 u8 count; 669 u8 count;
670} __attribute__ ((packed)); 670} __attribute__ ((packed));
671 671
672struct ieee80211_quiet { 672struct libipw_quiet {
673 u8 count; 673 u8 count;
674 u8 period; 674 u8 period;
675 u8 duration; 675 u8 duration;
676 u8 offset; 676 u8 offset;
677} __attribute__ ((packed)); 677} __attribute__ ((packed));
678 678
679struct ieee80211_network { 679struct libipw_network {
680 /* These entries are used to identify a unique network */ 680 /* These entries are used to identify a unique network */
681 u8 bssid[ETH_ALEN]; 681 u8 bssid[ETH_ALEN];
682 u8 channel; 682 u8 channel;
@@ -684,10 +684,10 @@ struct ieee80211_network {
684 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 684 u8 ssid[IW_ESSID_MAX_SIZE + 1];
685 u8 ssid_len; 685 u8 ssid_len;
686 686
687 struct ieee80211_qos_data qos_data; 687 struct libipw_qos_data qos_data;
688 688
689 /* These are network statistics */ 689 /* These are network statistics */
690 struct ieee80211_rx_stats stats; 690 struct libipw_rx_stats stats;
691 u16 capability; 691 u16 capability;
692 u8 rates[MAX_RATES_LENGTH]; 692 u8 rates[MAX_RATES_LENGTH];
693 u8 rates_len; 693 u8 rates_len;
@@ -706,7 +706,7 @@ struct ieee80211_network {
706 size_t wpa_ie_len; 706 size_t wpa_ie_len;
707 u8 rsn_ie[MAX_WPA_IE_LEN]; 707 u8 rsn_ie[MAX_WPA_IE_LEN];
708 size_t rsn_ie_len; 708 size_t rsn_ie_len;
709 struct ieee80211_tim_parameters tim; 709 struct libipw_tim_parameters tim;
710 710
711 /* 802.11h info */ 711 /* 802.11h info */
712 712
@@ -714,86 +714,86 @@ struct ieee80211_network {
714 u8 power_constraint; 714 u8 power_constraint;
715 715
716 /* TPC Report - mandatory if spctrm mgmt required */ 716 /* TPC Report - mandatory if spctrm mgmt required */
717 struct ieee80211_tpc_report tpc_report; 717 struct libipw_tpc_report tpc_report;
718 718
719 /* IBSS DFS - mandatory if spctrm mgmt required and IBSS 719 /* IBSS DFS - mandatory if spctrm mgmt required and IBSS
720 * NOTE: This is variable length and so must be allocated dynamically */ 720 * NOTE: This is variable length and so must be allocated dynamically */
721 struct ieee80211_ibss_dfs *ibss_dfs; 721 struct libipw_ibss_dfs *ibss_dfs;
722 722
723 /* Channel Switch Announcement - optional if spctrm mgmt required */ 723 /* Channel Switch Announcement - optional if spctrm mgmt required */
724 struct ieee80211_csa csa; 724 struct libipw_csa csa;
725 725
726 /* Quiet - optional if spctrm mgmt required */ 726 /* Quiet - optional if spctrm mgmt required */
727 struct ieee80211_quiet quiet; 727 struct libipw_quiet quiet;
728 728
729 struct list_head list; 729 struct list_head list;
730}; 730};
731 731
732enum ieee80211_state { 732enum libipw_state {
733 IEEE80211_UNINITIALIZED = 0, 733 LIBIPW_UNINITIALIZED = 0,
734 IEEE80211_INITIALIZED, 734 LIBIPW_INITIALIZED,
735 IEEE80211_ASSOCIATING, 735 LIBIPW_ASSOCIATING,
736 IEEE80211_ASSOCIATED, 736 LIBIPW_ASSOCIATED,
737 IEEE80211_AUTHENTICATING, 737 LIBIPW_AUTHENTICATING,
738 IEEE80211_AUTHENTICATED, 738 LIBIPW_AUTHENTICATED,
739 IEEE80211_SHUTDOWN 739 LIBIPW_SHUTDOWN
740}; 740};
741 741
742#define DEFAULT_MAX_SCAN_AGE (15 * HZ) 742#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
743#define DEFAULT_FTS 2346 743#define DEFAULT_FTS 2346
744 744
745#define CFG_IEEE80211_RESERVE_FCS (1<<0) 745#define CFG_LIBIPW_RESERVE_FCS (1<<0)
746#define CFG_IEEE80211_COMPUTE_FCS (1<<1) 746#define CFG_LIBIPW_COMPUTE_FCS (1<<1)
747#define CFG_IEEE80211_RTS (1<<2) 747#define CFG_LIBIPW_RTS (1<<2)
748 748
749#define IEEE80211_24GHZ_MIN_CHANNEL 1 749#define LIBIPW_24GHZ_MIN_CHANNEL 1
750#define IEEE80211_24GHZ_MAX_CHANNEL 14 750#define LIBIPW_24GHZ_MAX_CHANNEL 14
751#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ 751#define LIBIPW_24GHZ_CHANNELS (LIBIPW_24GHZ_MAX_CHANNEL - \
752 IEEE80211_24GHZ_MIN_CHANNEL + 1) 752 LIBIPW_24GHZ_MIN_CHANNEL + 1)
753 753
754#define IEEE80211_52GHZ_MIN_CHANNEL 34 754#define LIBIPW_52GHZ_MIN_CHANNEL 34
755#define IEEE80211_52GHZ_MAX_CHANNEL 165 755#define LIBIPW_52GHZ_MAX_CHANNEL 165
756#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ 756#define LIBIPW_52GHZ_CHANNELS (LIBIPW_52GHZ_MAX_CHANNEL - \
757 IEEE80211_52GHZ_MIN_CHANNEL + 1) 757 LIBIPW_52GHZ_MIN_CHANNEL + 1)
758 758
759enum { 759enum {
760 IEEE80211_CH_PASSIVE_ONLY = (1 << 0), 760 LIBIPW_CH_PASSIVE_ONLY = (1 << 0),
761 IEEE80211_CH_80211H_RULES = (1 << 1), 761 LIBIPW_CH_80211H_RULES = (1 << 1),
762 IEEE80211_CH_B_ONLY = (1 << 2), 762 LIBIPW_CH_B_ONLY = (1 << 2),
763 IEEE80211_CH_NO_IBSS = (1 << 3), 763 LIBIPW_CH_NO_IBSS = (1 << 3),
764 IEEE80211_CH_UNIFORM_SPREADING = (1 << 4), 764 LIBIPW_CH_UNIFORM_SPREADING = (1 << 4),
765 IEEE80211_CH_RADAR_DETECT = (1 << 5), 765 LIBIPW_CH_RADAR_DETECT = (1 << 5),
766 IEEE80211_CH_INVALID = (1 << 6), 766 LIBIPW_CH_INVALID = (1 << 6),
767}; 767};
768 768
769struct ieee80211_channel { 769struct libipw_channel {
770 u32 freq; /* in MHz */ 770 u32 freq; /* in MHz */
771 u8 channel; 771 u8 channel;
772 u8 flags; 772 u8 flags;
773 u8 max_power; /* in dBm */ 773 u8 max_power; /* in dBm */
774}; 774};
775 775
776struct ieee80211_geo { 776struct libipw_geo {
777 u8 name[4]; 777 u8 name[4];
778 u8 bg_channels; 778 u8 bg_channels;
779 u8 a_channels; 779 u8 a_channels;
780 struct ieee80211_channel bg[IEEE80211_24GHZ_CHANNELS]; 780 struct libipw_channel bg[LIBIPW_24GHZ_CHANNELS];
781 struct ieee80211_channel a[IEEE80211_52GHZ_CHANNELS]; 781 struct libipw_channel a[LIBIPW_52GHZ_CHANNELS];
782}; 782};
783 783
784struct ieee80211_device { 784struct libipw_device {
785 struct net_device *dev; 785 struct net_device *dev;
786 struct ieee80211_security sec; 786 struct libipw_security sec;
787 787
788 /* Bookkeeping structures */ 788 /* Bookkeeping structures */
789 struct ieee80211_stats ieee_stats; 789 struct libipw_stats ieee_stats;
790 790
791 struct ieee80211_geo geo; 791 struct libipw_geo geo;
792 792
793 /* Probe / Beacon management */ 793 /* Probe / Beacon management */
794 struct list_head network_free_list; 794 struct list_head network_free_list;
795 struct list_head network_list; 795 struct list_head network_list;
796 struct ieee80211_network *networks; 796 struct libipw_network *networks;
797 int scans; 797 int scans;
798 int scan_age; 798 int scan_age;
799 799
@@ -840,7 +840,7 @@ struct ieee80211_device {
840 * with RX of broad/multicast frames */ 840 * with RX of broad/multicast frames */
841 841
842 /* Fragmentation structures */ 842 /* Fragmentation structures */
843 struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN]; 843 struct libipw_frag_entry frag_cache[LIBIPW_FRAG_CACHE_LEN];
844 unsigned int frag_next_idx; 844 unsigned int frag_next_idx;
845 u16 fts; /* Fragmentation Threshold */ 845 u16 fts; /* Fragmentation Threshold */
846 u16 rts; /* RTS threshold */ 846 u16 rts; /* RTS threshold */
@@ -848,7 +848,7 @@ struct ieee80211_device {
848 /* Association info */ 848 /* Association info */
849 u8 bssid[ETH_ALEN]; 849 u8 bssid[ETH_ALEN];
850 850
851 enum ieee80211_state state; 851 enum libipw_state state;
852 852
853 int mode; /* A, B, G */ 853 int mode; /* A, B, G */
854 int modulation; /* CCK, OFDM */ 854 int modulation; /* CCK, OFDM */
@@ -862,43 +862,43 @@ struct ieee80211_device {
862 862
863 /* Callback functions */ 863 /* Callback functions */
864 void (*set_security) (struct net_device * dev, 864 void (*set_security) (struct net_device * dev,
865 struct ieee80211_security * sec); 865 struct libipw_security * sec);
866 int (*hard_start_xmit) (struct ieee80211_txb * txb, 866 int (*hard_start_xmit) (struct libipw_txb * txb,
867 struct net_device * dev, int pri); 867 struct net_device * dev, int pri);
868 int (*reset_port) (struct net_device * dev); 868 int (*reset_port) (struct net_device * dev);
869 int (*is_queue_full) (struct net_device * dev, int pri); 869 int (*is_queue_full) (struct net_device * dev, int pri);
870 870
871 int (*handle_management) (struct net_device * dev, 871 int (*handle_management) (struct net_device * dev,
872 struct ieee80211_network * network, u16 type); 872 struct libipw_network * network, u16 type);
873 int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb); 873 int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb);
874 874
875 /* Typical STA methods */ 875 /* Typical STA methods */
876 int (*handle_auth) (struct net_device * dev, 876 int (*handle_auth) (struct net_device * dev,
877 struct ieee80211_auth * auth); 877 struct libipw_auth * auth);
878 int (*handle_deauth) (struct net_device * dev, 878 int (*handle_deauth) (struct net_device * dev,
879 struct ieee80211_deauth * auth); 879 struct libipw_deauth * auth);
880 int (*handle_action) (struct net_device * dev, 880 int (*handle_action) (struct net_device * dev,
881 struct ieee80211_action * action, 881 struct libipw_action * action,
882 struct ieee80211_rx_stats * stats); 882 struct libipw_rx_stats * stats);
883 int (*handle_disassoc) (struct net_device * dev, 883 int (*handle_disassoc) (struct net_device * dev,
884 struct ieee80211_disassoc * assoc); 884 struct libipw_disassoc * assoc);
885 int (*handle_beacon) (struct net_device * dev, 885 int (*handle_beacon) (struct net_device * dev,
886 struct ieee80211_beacon * beacon, 886 struct libipw_beacon * beacon,
887 struct ieee80211_network * network); 887 struct libipw_network * network);
888 int (*handle_probe_response) (struct net_device * dev, 888 int (*handle_probe_response) (struct net_device * dev,
889 struct ieee80211_probe_response * resp, 889 struct libipw_probe_response * resp,
890 struct ieee80211_network * network); 890 struct libipw_network * network);
891 int (*handle_probe_request) (struct net_device * dev, 891 int (*handle_probe_request) (struct net_device * dev,
892 struct ieee80211_probe_request * req, 892 struct libipw_probe_request * req,
893 struct ieee80211_rx_stats * stats); 893 struct libipw_rx_stats * stats);
894 int (*handle_assoc_response) (struct net_device * dev, 894 int (*handle_assoc_response) (struct net_device * dev,
895 struct ieee80211_assoc_response * resp, 895 struct libipw_assoc_response * resp,
896 struct ieee80211_network * network); 896 struct libipw_network * network);
897 897
898 /* Typical AP methods */ 898 /* Typical AP methods */
899 int (*handle_assoc_request) (struct net_device * dev); 899 int (*handle_assoc_request) (struct net_device * dev);
900 int (*handle_reassoc_request) (struct net_device * dev, 900 int (*handle_reassoc_request) (struct net_device * dev,
901 struct ieee80211_reassoc_request * req); 901 struct libipw_reassoc_request * req);
902 902
903 /* This must be the last item so that it points to the data 903 /* This must be the last item so that it points to the data
904 * allocated beyond this structure by alloc_ieee80211 */ 904 * allocated beyond this structure by alloc_ieee80211 */
@@ -910,12 +910,12 @@ struct ieee80211_device {
910#define IEEE_G (1<<2) 910#define IEEE_G (1<<2)
911#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) 911#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
912 912
913static inline void *ieee80211_priv(struct net_device *dev) 913static inline void *libipw_priv(struct net_device *dev)
914{ 914{
915 return ((struct ieee80211_device *)netdev_priv(dev))->priv; 915 return ((struct libipw_device *)netdev_priv(dev))->priv;
916} 916}
917 917
918static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, 918static inline int libipw_is_valid_mode(struct libipw_device *ieee,
919 int mode) 919 int mode)
920{ 920{
921 /* 921 /*
@@ -925,32 +925,32 @@ static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
925 * 925 *
926 */ 926 */
927 if ((mode & IEEE_A) && 927 if ((mode & IEEE_A) &&
928 (ieee->modulation & IEEE80211_OFDM_MODULATION) && 928 (ieee->modulation & LIBIPW_OFDM_MODULATION) &&
929 (ieee->freq_band & IEEE80211_52GHZ_BAND)) 929 (ieee->freq_band & LIBIPW_52GHZ_BAND))
930 return 1; 930 return 1;
931 931
932 if ((mode & IEEE_G) && 932 if ((mode & IEEE_G) &&
933 (ieee->modulation & IEEE80211_OFDM_MODULATION) && 933 (ieee->modulation & LIBIPW_OFDM_MODULATION) &&
934 (ieee->freq_band & IEEE80211_24GHZ_BAND)) 934 (ieee->freq_band & LIBIPW_24GHZ_BAND))
935 return 1; 935 return 1;
936 936
937 if ((mode & IEEE_B) && 937 if ((mode & IEEE_B) &&
938 (ieee->modulation & IEEE80211_CCK_MODULATION) && 938 (ieee->modulation & LIBIPW_CCK_MODULATION) &&
939 (ieee->freq_band & IEEE80211_24GHZ_BAND)) 939 (ieee->freq_band & LIBIPW_24GHZ_BAND))
940 return 1; 940 return 1;
941 941
942 return 0; 942 return 0;
943} 943}
944 944
945static inline int ieee80211_get_hdrlen(u16 fc) 945static inline int libipw_get_hdrlen(u16 fc)
946{ 946{
947 int hdrlen = IEEE80211_3ADDR_LEN; 947 int hdrlen = LIBIPW_3ADDR_LEN;
948 u16 stype = WLAN_FC_GET_STYPE(fc); 948 u16 stype = WLAN_FC_GET_STYPE(fc);
949 949
950 switch (WLAN_FC_GET_TYPE(fc)) { 950 switch (WLAN_FC_GET_TYPE(fc)) {
951 case IEEE80211_FTYPE_DATA: 951 case IEEE80211_FTYPE_DATA:
952 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) 952 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
953 hdrlen = IEEE80211_4ADDR_LEN; 953 hdrlen = LIBIPW_4ADDR_LEN;
954 if (stype & IEEE80211_STYPE_QOS_DATA) 954 if (stype & IEEE80211_STYPE_QOS_DATA)
955 hdrlen += 2; 955 hdrlen += 2;
956 break; 956 break;
@@ -958,10 +958,10 @@ static inline int ieee80211_get_hdrlen(u16 fc)
958 switch (WLAN_FC_GET_STYPE(fc)) { 958 switch (WLAN_FC_GET_STYPE(fc)) {
959 case IEEE80211_STYPE_CTS: 959 case IEEE80211_STYPE_CTS:
960 case IEEE80211_STYPE_ACK: 960 case IEEE80211_STYPE_ACK:
961 hdrlen = IEEE80211_1ADDR_LEN; 961 hdrlen = LIBIPW_1ADDR_LEN;
962 break; 962 break;
963 default: 963 default:
964 hdrlen = IEEE80211_2ADDR_LEN; 964 hdrlen = LIBIPW_2ADDR_LEN;
965 break; 965 break;
966 } 966 }
967 break; 967 break;
@@ -970,44 +970,44 @@ static inline int ieee80211_get_hdrlen(u16 fc)
970 return hdrlen; 970 return hdrlen;
971} 971}
972 972
973static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) 973static inline u8 *libipw_get_payload(struct ieee80211_hdr *hdr)
974{ 974{
975 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control))) { 975 switch (libipw_get_hdrlen(le16_to_cpu(hdr->frame_control))) {
976 case IEEE80211_1ADDR_LEN: 976 case LIBIPW_1ADDR_LEN:
977 return ((struct ieee80211_hdr_1addr *)hdr)->payload; 977 return ((struct libipw_hdr_1addr *)hdr)->payload;
978 case IEEE80211_2ADDR_LEN: 978 case LIBIPW_2ADDR_LEN:
979 return ((struct ieee80211_hdr_2addr *)hdr)->payload; 979 return ((struct libipw_hdr_2addr *)hdr)->payload;
980 case IEEE80211_3ADDR_LEN: 980 case LIBIPW_3ADDR_LEN:
981 return ((struct ieee80211_hdr_3addr *)hdr)->payload; 981 return ((struct libipw_hdr_3addr *)hdr)->payload;
982 case IEEE80211_4ADDR_LEN: 982 case LIBIPW_4ADDR_LEN:
983 return ((struct ieee80211_hdr_4addr *)hdr)->payload; 983 return ((struct libipw_hdr_4addr *)hdr)->payload;
984 } 984 }
985 return NULL; 985 return NULL;
986} 986}
987 987
988static inline int ieee80211_is_ofdm_rate(u8 rate) 988static inline int libipw_is_ofdm_rate(u8 rate)
989{ 989{
990 switch (rate & ~IEEE80211_BASIC_RATE_MASK) { 990 switch (rate & ~LIBIPW_BASIC_RATE_MASK) {
991 case IEEE80211_OFDM_RATE_6MB: 991 case LIBIPW_OFDM_RATE_6MB:
992 case IEEE80211_OFDM_RATE_9MB: 992 case LIBIPW_OFDM_RATE_9MB:
993 case IEEE80211_OFDM_RATE_12MB: 993 case LIBIPW_OFDM_RATE_12MB:
994 case IEEE80211_OFDM_RATE_18MB: 994 case LIBIPW_OFDM_RATE_18MB:
995 case IEEE80211_OFDM_RATE_24MB: 995 case LIBIPW_OFDM_RATE_24MB:
996 case IEEE80211_OFDM_RATE_36MB: 996 case LIBIPW_OFDM_RATE_36MB:
997 case IEEE80211_OFDM_RATE_48MB: 997 case LIBIPW_OFDM_RATE_48MB:
998 case IEEE80211_OFDM_RATE_54MB: 998 case LIBIPW_OFDM_RATE_54MB:
999 return 1; 999 return 1;
1000 } 1000 }
1001 return 0; 1001 return 0;
1002} 1002}
1003 1003
1004static inline int ieee80211_is_cck_rate(u8 rate) 1004static inline int libipw_is_cck_rate(u8 rate)
1005{ 1005{
1006 switch (rate & ~IEEE80211_BASIC_RATE_MASK) { 1006 switch (rate & ~LIBIPW_BASIC_RATE_MASK) {
1007 case IEEE80211_CCK_RATE_1MB: 1007 case LIBIPW_CCK_RATE_1MB:
1008 case IEEE80211_CCK_RATE_2MB: 1008 case LIBIPW_CCK_RATE_2MB:
1009 case IEEE80211_CCK_RATE_5MB: 1009 case LIBIPW_CCK_RATE_5MB:
1010 case IEEE80211_CCK_RATE_11MB: 1010 case LIBIPW_CCK_RATE_11MB:
1011 return 1; 1011 return 1;
1012 } 1012 }
1013 return 0; 1013 return 0;
@@ -1016,72 +1016,72 @@ static inline int ieee80211_is_cck_rate(u8 rate)
1016/* ieee80211.c */ 1016/* ieee80211.c */
1017extern void free_ieee80211(struct net_device *dev); 1017extern void free_ieee80211(struct net_device *dev);
1018extern struct net_device *alloc_ieee80211(int sizeof_priv); 1018extern struct net_device *alloc_ieee80211(int sizeof_priv);
1019extern int ieee80211_change_mtu(struct net_device *dev, int new_mtu); 1019extern int libipw_change_mtu(struct net_device *dev, int new_mtu);
1020 1020
1021extern void ieee80211_networks_age(struct ieee80211_device *ieee, 1021extern void libipw_networks_age(struct libipw_device *ieee,
1022 unsigned long age_secs); 1022 unsigned long age_secs);
1023 1023
1024extern int ieee80211_set_encryption(struct ieee80211_device *ieee); 1024extern int libipw_set_encryption(struct libipw_device *ieee);
1025 1025
1026/* ieee80211_tx.c */ 1026/* libipw_tx.c */
1027extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); 1027extern int libipw_xmit(struct sk_buff *skb, struct net_device *dev);
1028extern void ieee80211_txb_free(struct ieee80211_txb *); 1028extern void libipw_txb_free(struct libipw_txb *);
1029 1029
1030/* ieee80211_rx.c */ 1030/* libipw_rx.c */
1031extern void ieee80211_rx_any(struct ieee80211_device *ieee, 1031extern void libipw_rx_any(struct libipw_device *ieee,
1032 struct sk_buff *skb, struct ieee80211_rx_stats *stats); 1032 struct sk_buff *skb, struct libipw_rx_stats *stats);
1033extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, 1033extern int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
1034 struct ieee80211_rx_stats *rx_stats); 1034 struct libipw_rx_stats *rx_stats);
1035/* make sure to set stats->len */ 1035/* make sure to set stats->len */
1036extern void ieee80211_rx_mgt(struct ieee80211_device *ieee, 1036extern void libipw_rx_mgt(struct libipw_device *ieee,
1037 struct ieee80211_hdr_4addr *header, 1037 struct libipw_hdr_4addr *header,
1038 struct ieee80211_rx_stats *stats); 1038 struct libipw_rx_stats *stats);
1039extern void ieee80211_network_reset(struct ieee80211_network *network); 1039extern void libipw_network_reset(struct libipw_network *network);
1040 1040
1041/* ieee80211_geo.c */ 1041/* libipw_geo.c */
1042extern const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device 1042extern const struct libipw_geo *libipw_get_geo(struct libipw_device
1043 *ieee); 1043 *ieee);
1044extern int ieee80211_set_geo(struct ieee80211_device *ieee, 1044extern int libipw_set_geo(struct libipw_device *ieee,
1045 const struct ieee80211_geo *geo); 1045 const struct libipw_geo *geo);
1046 1046
1047extern int ieee80211_is_valid_channel(struct ieee80211_device *ieee, 1047extern int libipw_is_valid_channel(struct libipw_device *ieee,
1048 u8 channel); 1048 u8 channel);
1049extern int ieee80211_channel_to_index(struct ieee80211_device *ieee, 1049extern int libipw_channel_to_index(struct libipw_device *ieee,
1050 u8 channel); 1050 u8 channel);
1051extern u8 ieee80211_freq_to_channel(struct ieee80211_device *ieee, u32 freq); 1051extern u8 libipw_freq_to_channel(struct libipw_device *ieee, u32 freq);
1052extern u8 ieee80211_get_channel_flags(struct ieee80211_device *ieee, 1052extern u8 libipw_get_channel_flags(struct libipw_device *ieee,
1053 u8 channel); 1053 u8 channel);
1054extern const struct ieee80211_channel *ieee80211_get_channel(struct 1054extern const struct libipw_channel *libipw_get_channel(struct
1055 ieee80211_device 1055 libipw_device
1056 *ieee, u8 channel); 1056 *ieee, u8 channel);
1057extern u32 ieee80211_channel_to_freq(struct ieee80211_device * ieee, 1057extern u32 libipw_channel_to_freq(struct libipw_device * ieee,
1058 u8 channel); 1058 u8 channel);
1059 1059
1060/* ieee80211_wx.c */ 1060/* libipw_wx.c */
1061extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 1061extern int libipw_wx_get_scan(struct libipw_device *ieee,
1062 struct iw_request_info *info, 1062 struct iw_request_info *info,
1063 union iwreq_data *wrqu, char *key); 1063 union iwreq_data *wrqu, char *key);
1064extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee, 1064extern int libipw_wx_set_encode(struct libipw_device *ieee,
1065 struct iw_request_info *info, 1065 struct iw_request_info *info,
1066 union iwreq_data *wrqu, char *key); 1066 union iwreq_data *wrqu, char *key);
1067extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, 1067extern int libipw_wx_get_encode(struct libipw_device *ieee,
1068 struct iw_request_info *info, 1068 struct iw_request_info *info,
1069 union iwreq_data *wrqu, char *key); 1069 union iwreq_data *wrqu, char *key);
1070extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, 1070extern int libipw_wx_set_encodeext(struct libipw_device *ieee,
1071 struct iw_request_info *info, 1071 struct iw_request_info *info,
1072 union iwreq_data *wrqu, char *extra); 1072 union iwreq_data *wrqu, char *extra);
1073extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, 1073extern int libipw_wx_get_encodeext(struct libipw_device *ieee,
1074 struct iw_request_info *info, 1074 struct iw_request_info *info,
1075 union iwreq_data *wrqu, char *extra); 1075 union iwreq_data *wrqu, char *extra);
1076 1076
1077static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) 1077static inline void libipw_increment_scans(struct libipw_device *ieee)
1078{ 1078{
1079 ieee->scans++; 1079 ieee->scans++;
1080} 1080}
1081 1081
1082static inline int ieee80211_get_scans(struct ieee80211_device *ieee) 1082static inline int libipw_get_scans(struct libipw_device *ieee)
1083{ 1083{
1084 return ieee->scans; 1084 return ieee->scans;
1085} 1085}
1086 1086
1087#endif /* IEEE80211_H */ 1087#endif /* LIBIPW_H */
diff --git a/drivers/net/wireless/ipw2x00/libipw_geo.c b/drivers/net/wireless/ipw2x00/libipw_geo.c
index 9dfbb8760f67..d04979ba2a5b 100644
--- a/drivers/net/wireless/ipw2x00/libipw_geo.c
+++ b/drivers/net/wireless/ipw2x00/libipw_geo.c
@@ -41,9 +41,9 @@
41#include <linux/etherdevice.h> 41#include <linux/etherdevice.h>
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43 43
44#include "ieee80211.h" 44#include "libipw.h"
45 45
46int ieee80211_is_valid_channel(struct ieee80211_device *ieee, u8 channel) 46int libipw_is_valid_channel(struct libipw_device *ieee, u8 channel)
47{ 47{
48 int i; 48 int i;
49 49
@@ -52,27 +52,27 @@ int ieee80211_is_valid_channel(struct ieee80211_device *ieee, u8 channel)
52 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) 52 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
53 return 0; 53 return 0;
54 54
55 if (ieee->freq_band & IEEE80211_24GHZ_BAND) 55 if (ieee->freq_band & LIBIPW_24GHZ_BAND)
56 for (i = 0; i < ieee->geo.bg_channels; i++) 56 for (i = 0; i < ieee->geo.bg_channels; i++)
57 /* NOTE: If G mode is currently supported but 57 /* NOTE: If G mode is currently supported but
58 * this is a B only channel, we don't see it 58 * this is a B only channel, we don't see it
59 * as valid. */ 59 * as valid. */
60 if ((ieee->geo.bg[i].channel == channel) && 60 if ((ieee->geo.bg[i].channel == channel) &&
61 !(ieee->geo.bg[i].flags & IEEE80211_CH_INVALID) && 61 !(ieee->geo.bg[i].flags & LIBIPW_CH_INVALID) &&
62 (!(ieee->mode & IEEE_G) || 62 (!(ieee->mode & IEEE_G) ||
63 !(ieee->geo.bg[i].flags & IEEE80211_CH_B_ONLY))) 63 !(ieee->geo.bg[i].flags & LIBIPW_CH_B_ONLY)))
64 return IEEE80211_24GHZ_BAND; 64 return LIBIPW_24GHZ_BAND;
65 65
66 if (ieee->freq_band & IEEE80211_52GHZ_BAND) 66 if (ieee->freq_band & LIBIPW_52GHZ_BAND)
67 for (i = 0; i < ieee->geo.a_channels; i++) 67 for (i = 0; i < ieee->geo.a_channels; i++)
68 if ((ieee->geo.a[i].channel == channel) && 68 if ((ieee->geo.a[i].channel == channel) &&
69 !(ieee->geo.a[i].flags & IEEE80211_CH_INVALID)) 69 !(ieee->geo.a[i].flags & LIBIPW_CH_INVALID))
70 return IEEE80211_52GHZ_BAND; 70 return LIBIPW_52GHZ_BAND;
71 71
72 return 0; 72 return 0;
73} 73}
74 74
75int ieee80211_channel_to_index(struct ieee80211_device *ieee, u8 channel) 75int libipw_channel_to_index(struct libipw_device *ieee, u8 channel)
76{ 76{
77 int i; 77 int i;
78 78
@@ -81,12 +81,12 @@ int ieee80211_channel_to_index(struct ieee80211_device *ieee, u8 channel)
81 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) 81 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
82 return -1; 82 return -1;
83 83
84 if (ieee->freq_band & IEEE80211_24GHZ_BAND) 84 if (ieee->freq_band & LIBIPW_24GHZ_BAND)
85 for (i = 0; i < ieee->geo.bg_channels; i++) 85 for (i = 0; i < ieee->geo.bg_channels; i++)
86 if (ieee->geo.bg[i].channel == channel) 86 if (ieee->geo.bg[i].channel == channel)
87 return i; 87 return i;
88 88
89 if (ieee->freq_band & IEEE80211_52GHZ_BAND) 89 if (ieee->freq_band & LIBIPW_52GHZ_BAND)
90 for (i = 0; i < ieee->geo.a_channels; i++) 90 for (i = 0; i < ieee->geo.a_channels; i++)
91 if (ieee->geo.a[i].channel == channel) 91 if (ieee->geo.a[i].channel == channel)
92 return i; 92 return i;
@@ -94,22 +94,22 @@ int ieee80211_channel_to_index(struct ieee80211_device *ieee, u8 channel)
94 return -1; 94 return -1;
95} 95}
96 96
97u32 ieee80211_channel_to_freq(struct ieee80211_device * ieee, u8 channel) 97u32 libipw_channel_to_freq(struct libipw_device * ieee, u8 channel)
98{ 98{
99 const struct ieee80211_channel * ch; 99 const struct libipw_channel * ch;
100 100
101 /* Driver needs to initialize the geography map before using 101 /* Driver needs to initialize the geography map before using
102 * these helper functions */ 102 * these helper functions */
103 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0) 103 if (ieee->geo.bg_channels == 0 && ieee->geo.a_channels == 0)
104 return 0; 104 return 0;
105 105
106 ch = ieee80211_get_channel(ieee, channel); 106 ch = libipw_get_channel(ieee, channel);
107 if (!ch->channel) 107 if (!ch->channel)
108 return 0; 108 return 0;
109 return ch->freq; 109 return ch->freq;
110} 110}
111 111
112u8 ieee80211_freq_to_channel(struct ieee80211_device * ieee, u32 freq) 112u8 libipw_freq_to_channel(struct libipw_device * ieee, u32 freq)
113{ 113{
114 int i; 114 int i;
115 115
@@ -120,12 +120,12 @@ u8 ieee80211_freq_to_channel(struct ieee80211_device * ieee, u32 freq)
120 120
121 freq /= 100000; 121 freq /= 100000;
122 122
123 if (ieee->freq_band & IEEE80211_24GHZ_BAND) 123 if (ieee->freq_band & LIBIPW_24GHZ_BAND)
124 for (i = 0; i < ieee->geo.bg_channels; i++) 124 for (i = 0; i < ieee->geo.bg_channels; i++)
125 if (ieee->geo.bg[i].freq == freq) 125 if (ieee->geo.bg[i].freq == freq)
126 return ieee->geo.bg[i].channel; 126 return ieee->geo.bg[i].channel;
127 127
128 if (ieee->freq_band & IEEE80211_52GHZ_BAND) 128 if (ieee->freq_band & LIBIPW_52GHZ_BAND)
129 for (i = 0; i < ieee->geo.a_channels; i++) 129 for (i = 0; i < ieee->geo.a_channels; i++)
130 if (ieee->geo.a[i].freq == freq) 130 if (ieee->geo.a[i].freq == freq)
131 return ieee->geo.a[i].channel; 131 return ieee->geo.a[i].channel;
@@ -133,63 +133,63 @@ u8 ieee80211_freq_to_channel(struct ieee80211_device * ieee, u32 freq)
133 return 0; 133 return 0;
134} 134}
135 135
136int ieee80211_set_geo(struct ieee80211_device *ieee, 136int libipw_set_geo(struct libipw_device *ieee,
137 const struct ieee80211_geo *geo) 137 const struct libipw_geo *geo)
138{ 138{
139 memcpy(ieee->geo.name, geo->name, 3); 139 memcpy(ieee->geo.name, geo->name, 3);
140 ieee->geo.name[3] = '\0'; 140 ieee->geo.name[3] = '\0';
141 ieee->geo.bg_channels = geo->bg_channels; 141 ieee->geo.bg_channels = geo->bg_channels;
142 ieee->geo.a_channels = geo->a_channels; 142 ieee->geo.a_channels = geo->a_channels;
143 memcpy(ieee->geo.bg, geo->bg, geo->bg_channels * 143 memcpy(ieee->geo.bg, geo->bg, geo->bg_channels *
144 sizeof(struct ieee80211_channel)); 144 sizeof(struct libipw_channel));
145 memcpy(ieee->geo.a, geo->a, ieee->geo.a_channels * 145 memcpy(ieee->geo.a, geo->a, ieee->geo.a_channels *
146 sizeof(struct ieee80211_channel)); 146 sizeof(struct libipw_channel));
147 return 0; 147 return 0;
148} 148}
149 149
150const struct ieee80211_geo *ieee80211_get_geo(struct ieee80211_device *ieee) 150const struct libipw_geo *libipw_get_geo(struct libipw_device *ieee)
151{ 151{
152 return &ieee->geo; 152 return &ieee->geo;
153} 153}
154 154
155u8 ieee80211_get_channel_flags(struct ieee80211_device * ieee, u8 channel) 155u8 libipw_get_channel_flags(struct libipw_device * ieee, u8 channel)
156{ 156{
157 int index = ieee80211_channel_to_index(ieee, channel); 157 int index = libipw_channel_to_index(ieee, channel);
158 158
159 if (index == -1) 159 if (index == -1)
160 return IEEE80211_CH_INVALID; 160 return LIBIPW_CH_INVALID;
161 161
162 if (channel <= IEEE80211_24GHZ_CHANNELS) 162 if (channel <= LIBIPW_24GHZ_CHANNELS)
163 return ieee->geo.bg[index].flags; 163 return ieee->geo.bg[index].flags;
164 164
165 return ieee->geo.a[index].flags; 165 return ieee->geo.a[index].flags;
166} 166}
167 167
168static const struct ieee80211_channel bad_channel = { 168static const struct libipw_channel bad_channel = {
169 .channel = 0, 169 .channel = 0,
170 .flags = IEEE80211_CH_INVALID, 170 .flags = LIBIPW_CH_INVALID,
171 .max_power = 0, 171 .max_power = 0,
172}; 172};
173 173
174const struct ieee80211_channel *ieee80211_get_channel(struct ieee80211_device 174const struct libipw_channel *libipw_get_channel(struct libipw_device
175 *ieee, u8 channel) 175 *ieee, u8 channel)
176{ 176{
177 int index = ieee80211_channel_to_index(ieee, channel); 177 int index = libipw_channel_to_index(ieee, channel);
178 178
179 if (index == -1) 179 if (index == -1)
180 return &bad_channel; 180 return &bad_channel;
181 181
182 if (channel <= IEEE80211_24GHZ_CHANNELS) 182 if (channel <= LIBIPW_24GHZ_CHANNELS)
183 return &ieee->geo.bg[index]; 183 return &ieee->geo.bg[index];
184 184
185 return &ieee->geo.a[index]; 185 return &ieee->geo.a[index];
186} 186}
187 187
188EXPORT_SYMBOL(ieee80211_get_channel); 188EXPORT_SYMBOL(libipw_get_channel);
189EXPORT_SYMBOL(ieee80211_get_channel_flags); 189EXPORT_SYMBOL(libipw_get_channel_flags);
190EXPORT_SYMBOL(ieee80211_is_valid_channel); 190EXPORT_SYMBOL(libipw_is_valid_channel);
191EXPORT_SYMBOL(ieee80211_freq_to_channel); 191EXPORT_SYMBOL(libipw_freq_to_channel);
192EXPORT_SYMBOL(ieee80211_channel_to_freq); 192EXPORT_SYMBOL(libipw_channel_to_freq);
193EXPORT_SYMBOL(ieee80211_channel_to_index); 193EXPORT_SYMBOL(libipw_channel_to_index);
194EXPORT_SYMBOL(ieee80211_set_geo); 194EXPORT_SYMBOL(libipw_set_geo);
195EXPORT_SYMBOL(ieee80211_get_geo); 195EXPORT_SYMBOL(libipw_get_geo);
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index 8ce6e961c5da..00c3640b0f8a 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -50,11 +50,11 @@
50#include <net/net_namespace.h> 50#include <net/net_namespace.h>
51#include <net/arp.h> 51#include <net/arp.h>
52 52
53#include "ieee80211.h" 53#include "libipw.h"
54 54
55#define DRV_DESCRIPTION "802.11 data/management/control stack" 55#define DRV_DESCRIPTION "802.11 data/management/control stack"
56#define DRV_NAME "ieee80211" 56#define DRV_NAME "ieee80211"
57#define DRV_VERSION IEEE80211_VERSION 57#define DRV_VERSION LIBIPW_VERSION
58#define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>" 58#define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>"
59 59
60MODULE_VERSION(DRV_VERSION); 60MODULE_VERSION(DRV_VERSION);
@@ -62,13 +62,13 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
62MODULE_AUTHOR(DRV_COPYRIGHT); 62MODULE_AUTHOR(DRV_COPYRIGHT);
63MODULE_LICENSE("GPL"); 63MODULE_LICENSE("GPL");
64 64
65static int ieee80211_networks_allocate(struct ieee80211_device *ieee) 65static int libipw_networks_allocate(struct libipw_device *ieee)
66{ 66{
67 if (ieee->networks) 67 if (ieee->networks)
68 return 0; 68 return 0;
69 69
70 ieee->networks = 70 ieee->networks =
71 kzalloc(MAX_NETWORK_COUNT * sizeof(struct ieee80211_network), 71 kzalloc(MAX_NETWORK_COUNT * sizeof(struct libipw_network),
72 GFP_KERNEL); 72 GFP_KERNEL);
73 if (!ieee->networks) { 73 if (!ieee->networks) {
74 printk(KERN_WARNING "%s: Out of memory allocating beacons\n", 74 printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
@@ -79,7 +79,7 @@ static int ieee80211_networks_allocate(struct ieee80211_device *ieee)
79 return 0; 79 return 0;
80} 80}
81 81
82void ieee80211_network_reset(struct ieee80211_network *network) 82void libipw_network_reset(struct libipw_network *network)
83{ 83{
84 if (!network) 84 if (!network)
85 return; 85 return;
@@ -90,7 +90,7 @@ void ieee80211_network_reset(struct ieee80211_network *network)
90 } 90 }
91} 91}
92 92
93static inline void ieee80211_networks_free(struct ieee80211_device *ieee) 93static inline void libipw_networks_free(struct libipw_device *ieee)
94{ 94{
95 int i; 95 int i;
96 96
@@ -105,10 +105,10 @@ static inline void ieee80211_networks_free(struct ieee80211_device *ieee)
105 ieee->networks = NULL; 105 ieee->networks = NULL;
106} 106}
107 107
108void ieee80211_networks_age(struct ieee80211_device *ieee, 108void libipw_networks_age(struct libipw_device *ieee,
109 unsigned long age_secs) 109 unsigned long age_secs)
110{ 110{
111 struct ieee80211_network *network = NULL; 111 struct libipw_network *network = NULL;
112 unsigned long flags; 112 unsigned long flags;
113 unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); 113 unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC);
114 114
@@ -118,9 +118,9 @@ void ieee80211_networks_age(struct ieee80211_device *ieee,
118 } 118 }
119 spin_unlock_irqrestore(&ieee->lock, flags); 119 spin_unlock_irqrestore(&ieee->lock, flags);
120} 120}
121EXPORT_SYMBOL(ieee80211_networks_age); 121EXPORT_SYMBOL(libipw_networks_age);
122 122
123static void ieee80211_networks_initialize(struct ieee80211_device *ieee) 123static void libipw_networks_initialize(struct libipw_device *ieee)
124{ 124{
125 int i; 125 int i;
126 126
@@ -131,38 +131,38 @@ static void ieee80211_networks_initialize(struct ieee80211_device *ieee)
131 &ieee->network_free_list); 131 &ieee->network_free_list);
132} 132}
133 133
134int ieee80211_change_mtu(struct net_device *dev, int new_mtu) 134int libipw_change_mtu(struct net_device *dev, int new_mtu)
135{ 135{
136 if ((new_mtu < 68) || (new_mtu > IEEE80211_DATA_LEN)) 136 if ((new_mtu < 68) || (new_mtu > LIBIPW_DATA_LEN))
137 return -EINVAL; 137 return -EINVAL;
138 dev->mtu = new_mtu; 138 dev->mtu = new_mtu;
139 return 0; 139 return 0;
140} 140}
141EXPORT_SYMBOL(ieee80211_change_mtu); 141EXPORT_SYMBOL(libipw_change_mtu);
142 142
143struct net_device *alloc_ieee80211(int sizeof_priv) 143struct net_device *alloc_ieee80211(int sizeof_priv)
144{ 144{
145 struct ieee80211_device *ieee; 145 struct libipw_device *ieee;
146 struct net_device *dev; 146 struct net_device *dev;
147 int err; 147 int err;
148 148
149 IEEE80211_DEBUG_INFO("Initializing...\n"); 149 LIBIPW_DEBUG_INFO("Initializing...\n");
150 150
151 dev = alloc_etherdev(sizeof(struct ieee80211_device) + sizeof_priv); 151 dev = alloc_etherdev(sizeof(struct libipw_device) + sizeof_priv);
152 if (!dev) { 152 if (!dev) {
153 IEEE80211_ERROR("Unable to allocate network device.\n"); 153 LIBIPW_ERROR("Unable to allocate network device.\n");
154 goto failed; 154 goto failed;
155 } 155 }
156 ieee = netdev_priv(dev); 156 ieee = netdev_priv(dev);
157 157
158 ieee->dev = dev; 158 ieee->dev = dev;
159 159
160 err = ieee80211_networks_allocate(ieee); 160 err = libipw_networks_allocate(ieee);
161 if (err) { 161 if (err) {
162 IEEE80211_ERROR("Unable to allocate beacon storage: %d\n", err); 162 LIBIPW_ERROR("Unable to allocate beacon storage: %d\n", err);
163 goto failed_free_netdev; 163 goto failed_free_netdev;
164 } 164 }
165 ieee80211_networks_initialize(ieee); 165 libipw_networks_initialize(ieee);
166 166
167 /* Default fragmentation threshold is maximum payload size */ 167 /* Default fragmentation threshold is maximum payload size */
168 ieee->fts = DEFAULT_FTS; 168 ieee->fts = DEFAULT_FTS;
@@ -201,25 +201,25 @@ failed:
201 201
202void free_ieee80211(struct net_device *dev) 202void free_ieee80211(struct net_device *dev)
203{ 203{
204 struct ieee80211_device *ieee = netdev_priv(dev); 204 struct libipw_device *ieee = netdev_priv(dev);
205 205
206 lib80211_crypt_info_free(&ieee->crypt_info); 206 lib80211_crypt_info_free(&ieee->crypt_info);
207 207
208 ieee80211_networks_free(ieee); 208 libipw_networks_free(ieee);
209 free_netdev(dev); 209 free_netdev(dev);
210} 210}
211 211
212#ifdef CONFIG_LIBIPW_DEBUG 212#ifdef CONFIG_LIBIPW_DEBUG
213 213
214static int debug = 0; 214static int debug = 0;
215u32 ieee80211_debug_level = 0; 215u32 libipw_debug_level = 0;
216EXPORT_SYMBOL_GPL(ieee80211_debug_level); 216EXPORT_SYMBOL_GPL(libipw_debug_level);
217static struct proc_dir_entry *ieee80211_proc = NULL; 217static struct proc_dir_entry *libipw_proc = NULL;
218 218
219static int show_debug_level(char *page, char **start, off_t offset, 219static int show_debug_level(char *page, char **start, off_t offset,
220 int count, int *eof, void *data) 220 int count, int *eof, void *data)
221{ 221{
222 return snprintf(page, count, "0x%08X\n", ieee80211_debug_level); 222 return snprintf(page, count, "0x%08X\n", libipw_debug_level);
223} 223}
224 224
225static int store_debug_level(struct file *file, const char __user * buffer, 225static int store_debug_level(struct file *file, const char __user * buffer,
@@ -236,29 +236,29 @@ static int store_debug_level(struct file *file, const char __user * buffer,
236 printk(KERN_INFO DRV_NAME 236 printk(KERN_INFO DRV_NAME
237 ": %s is not in hex or decimal form.\n", buf); 237 ": %s is not in hex or decimal form.\n", buf);
238 else 238 else
239 ieee80211_debug_level = val; 239 libipw_debug_level = val;
240 240
241 return strnlen(buf, len); 241 return strnlen(buf, len);
242} 242}
243#endif /* CONFIG_LIBIPW_DEBUG */ 243#endif /* CONFIG_LIBIPW_DEBUG */
244 244
245static int __init ieee80211_init(void) 245static int __init libipw_init(void)
246{ 246{
247#ifdef CONFIG_LIBIPW_DEBUG 247#ifdef CONFIG_LIBIPW_DEBUG
248 struct proc_dir_entry *e; 248 struct proc_dir_entry *e;
249 249
250 ieee80211_debug_level = debug; 250 libipw_debug_level = debug;
251 ieee80211_proc = proc_mkdir(DRV_NAME, init_net.proc_net); 251 libipw_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
252 if (ieee80211_proc == NULL) { 252 if (libipw_proc == NULL) {
253 IEEE80211_ERROR("Unable to create " DRV_NAME 253 LIBIPW_ERROR("Unable to create " DRV_NAME
254 " proc directory\n"); 254 " proc directory\n");
255 return -EIO; 255 return -EIO;
256 } 256 }
257 e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR, 257 e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR,
258 ieee80211_proc); 258 libipw_proc);
259 if (!e) { 259 if (!e) {
260 remove_proc_entry(DRV_NAME, init_net.proc_net); 260 remove_proc_entry(DRV_NAME, init_net.proc_net);
261 ieee80211_proc = NULL; 261 libipw_proc = NULL;
262 return -EIO; 262 return -EIO;
263 } 263 }
264 e->read_proc = show_debug_level; 264 e->read_proc = show_debug_level;
@@ -272,13 +272,13 @@ static int __init ieee80211_init(void)
272 return 0; 272 return 0;
273} 273}
274 274
275static void __exit ieee80211_exit(void) 275static void __exit libipw_exit(void)
276{ 276{
277#ifdef CONFIG_LIBIPW_DEBUG 277#ifdef CONFIG_LIBIPW_DEBUG
278 if (ieee80211_proc) { 278 if (libipw_proc) {
279 remove_proc_entry("debug_level", ieee80211_proc); 279 remove_proc_entry("debug_level", libipw_proc);
280 remove_proc_entry(DRV_NAME, init_net.proc_net); 280 remove_proc_entry(DRV_NAME, init_net.proc_net);
281 ieee80211_proc = NULL; 281 libipw_proc = NULL;
282 } 282 }
283#endif /* CONFIG_LIBIPW_DEBUG */ 283#endif /* CONFIG_LIBIPW_DEBUG */
284} 284}
@@ -289,8 +289,8 @@ module_param(debug, int, 0444);
289MODULE_PARM_DESC(debug, "debug output mask"); 289MODULE_PARM_DESC(debug, "debug output mask");
290#endif /* CONFIG_LIBIPW_DEBUG */ 290#endif /* CONFIG_LIBIPW_DEBUG */
291 291
292module_exit(ieee80211_exit); 292module_exit(libipw_exit);
293module_init(ieee80211_init); 293module_init(libipw_init);
294 294
295EXPORT_SYMBOL(alloc_ieee80211); 295EXPORT_SYMBOL(alloc_ieee80211);
296EXPORT_SYMBOL(free_ieee80211); 296EXPORT_SYMBOL(free_ieee80211);
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index dae4b8e4d8e9..282b1f7ff1e9 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -34,18 +34,18 @@
34 34
35#include <net/lib80211.h> 35#include <net/lib80211.h>
36 36
37#include "ieee80211.h" 37#include "libipw.h"
38 38
39static void ieee80211_monitor_rx(struct ieee80211_device *ieee, 39static void libipw_monitor_rx(struct libipw_device *ieee,
40 struct sk_buff *skb, 40 struct sk_buff *skb,
41 struct ieee80211_rx_stats *rx_stats) 41 struct libipw_rx_stats *rx_stats)
42{ 42{
43 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 43 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
44 u16 fc = le16_to_cpu(hdr->frame_control); 44 u16 fc = le16_to_cpu(hdr->frame_control);
45 45
46 skb->dev = ieee->dev; 46 skb->dev = ieee->dev;
47 skb_reset_mac_header(skb); 47 skb_reset_mac_header(skb);
48 skb_pull(skb, ieee80211_get_hdrlen(fc)); 48 skb_pull(skb, libipw_get_hdrlen(fc));
49 skb->pkt_type = PACKET_OTHERHOST; 49 skb->pkt_type = PACKET_OTHERHOST;
50 skb->protocol = htons(ETH_P_80211_RAW); 50 skb->protocol = htons(ETH_P_80211_RAW);
51 memset(skb->cb, 0, sizeof(skb->cb)); 51 memset(skb->cb, 0, sizeof(skb->cb));
@@ -53,22 +53,22 @@ static void ieee80211_monitor_rx(struct ieee80211_device *ieee,
53} 53}
54 54
55/* Called only as a tasklet (software IRQ) */ 55/* Called only as a tasklet (software IRQ) */
56static struct ieee80211_frag_entry *ieee80211_frag_cache_find(struct 56static struct libipw_frag_entry *libipw_frag_cache_find(struct
57 ieee80211_device 57 libipw_device
58 *ieee, 58 *ieee,
59 unsigned int seq, 59 unsigned int seq,
60 unsigned int frag, 60 unsigned int frag,
61 u8 * src, 61 u8 * src,
62 u8 * dst) 62 u8 * dst)
63{ 63{
64 struct ieee80211_frag_entry *entry; 64 struct libipw_frag_entry *entry;
65 int i; 65 int i;
66 66
67 for (i = 0; i < IEEE80211_FRAG_CACHE_LEN; i++) { 67 for (i = 0; i < LIBIPW_FRAG_CACHE_LEN; i++) {
68 entry = &ieee->frag_cache[i]; 68 entry = &ieee->frag_cache[i];
69 if (entry->skb != NULL && 69 if (entry->skb != NULL &&
70 time_after(jiffies, entry->first_frag_time + 2 * HZ)) { 70 time_after(jiffies, entry->first_frag_time + 2 * HZ)) {
71 IEEE80211_DEBUG_FRAG("expiring fragment cache entry " 71 LIBIPW_DEBUG_FRAG("expiring fragment cache entry "
72 "seq=%u last_frag=%u\n", 72 "seq=%u last_frag=%u\n",
73 entry->seq, entry->last_frag); 73 entry->seq, entry->last_frag);
74 dev_kfree_skb_any(entry->skb); 74 dev_kfree_skb_any(entry->skb);
@@ -86,13 +86,13 @@ static struct ieee80211_frag_entry *ieee80211_frag_cache_find(struct
86} 86}
87 87
88/* Called only as a tasklet (software IRQ) */ 88/* Called only as a tasklet (software IRQ) */
89static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee, 89static struct sk_buff *libipw_frag_cache_get(struct libipw_device *ieee,
90 struct ieee80211_hdr_4addr *hdr) 90 struct libipw_hdr_4addr *hdr)
91{ 91{
92 struct sk_buff *skb = NULL; 92 struct sk_buff *skb = NULL;
93 u16 sc; 93 u16 sc;
94 unsigned int frag, seq; 94 unsigned int frag, seq;
95 struct ieee80211_frag_entry *entry; 95 struct libipw_frag_entry *entry;
96 96
97 sc = le16_to_cpu(hdr->seq_ctl); 97 sc = le16_to_cpu(hdr->seq_ctl);
98 frag = WLAN_GET_SEQ_FRAG(sc); 98 frag = WLAN_GET_SEQ_FRAG(sc);
@@ -101,7 +101,7 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
101 if (frag == 0) { 101 if (frag == 0) {
102 /* Reserve enough space to fit maximum frame length */ 102 /* Reserve enough space to fit maximum frame length */
103 skb = dev_alloc_skb(ieee->dev->mtu + 103 skb = dev_alloc_skb(ieee->dev->mtu +
104 sizeof(struct ieee80211_hdr_4addr) + 104 sizeof(struct libipw_hdr_4addr) +
105 8 /* LLC */ + 105 8 /* LLC */ +
106 2 /* alignment */ + 106 2 /* alignment */ +
107 8 /* WEP */ + ETH_ALEN /* WDS */ ); 107 8 /* WEP */ + ETH_ALEN /* WDS */ );
@@ -110,7 +110,7 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
110 110
111 entry = &ieee->frag_cache[ieee->frag_next_idx]; 111 entry = &ieee->frag_cache[ieee->frag_next_idx];
112 ieee->frag_next_idx++; 112 ieee->frag_next_idx++;
113 if (ieee->frag_next_idx >= IEEE80211_FRAG_CACHE_LEN) 113 if (ieee->frag_next_idx >= LIBIPW_FRAG_CACHE_LEN)
114 ieee->frag_next_idx = 0; 114 ieee->frag_next_idx = 0;
115 115
116 if (entry->skb != NULL) 116 if (entry->skb != NULL)
@@ -125,7 +125,7 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
125 } else { 125 } else {
126 /* received a fragment of a frame for which the head fragment 126 /* received a fragment of a frame for which the head fragment
127 * should have already been received */ 127 * should have already been received */
128 entry = ieee80211_frag_cache_find(ieee, seq, frag, hdr->addr2, 128 entry = libipw_frag_cache_find(ieee, seq, frag, hdr->addr2,
129 hdr->addr1); 129 hdr->addr1);
130 if (entry != NULL) { 130 if (entry != NULL) {
131 entry->last_frag = frag; 131 entry->last_frag = frag;
@@ -137,21 +137,21 @@ static struct sk_buff *ieee80211_frag_cache_get(struct ieee80211_device *ieee,
137} 137}
138 138
139/* Called only as a tasklet (software IRQ) */ 139/* Called only as a tasklet (software IRQ) */
140static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee, 140static int libipw_frag_cache_invalidate(struct libipw_device *ieee,
141 struct ieee80211_hdr_4addr *hdr) 141 struct libipw_hdr_4addr *hdr)
142{ 142{
143 u16 sc; 143 u16 sc;
144 unsigned int seq; 144 unsigned int seq;
145 struct ieee80211_frag_entry *entry; 145 struct libipw_frag_entry *entry;
146 146
147 sc = le16_to_cpu(hdr->seq_ctl); 147 sc = le16_to_cpu(hdr->seq_ctl);
148 seq = WLAN_GET_SEQ_SEQ(sc); 148 seq = WLAN_GET_SEQ_SEQ(sc);
149 149
150 entry = ieee80211_frag_cache_find(ieee, seq, -1, hdr->addr2, 150 entry = libipw_frag_cache_find(ieee, seq, -1, hdr->addr2,
151 hdr->addr1); 151 hdr->addr1);
152 152
153 if (entry == NULL) { 153 if (entry == NULL) {
154 IEEE80211_DEBUG_FRAG("could not invalidate fragment cache " 154 LIBIPW_DEBUG_FRAG("could not invalidate fragment cache "
155 "entry (seq=%u)\n", seq); 155 "entry (seq=%u)\n", seq);
156 return -1; 156 return -1;
157 } 157 }
@@ -161,14 +161,14 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee,
161} 161}
162 162
163#ifdef NOT_YET 163#ifdef NOT_YET
164/* ieee80211_rx_frame_mgtmt 164/* libipw_rx_frame_mgtmt
165 * 165 *
166 * Responsible for handling management control frames 166 * Responsible for handling management control frames
167 * 167 *
168 * Called by ieee80211_rx */ 168 * Called by libipw_rx */
169static int 169static int
170ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, 170libipw_rx_frame_mgmt(struct libipw_device *ieee, struct sk_buff *skb,
171 struct ieee80211_rx_stats *rx_stats, u16 type, 171 struct libipw_rx_stats *rx_stats, u16 type,
172 u16 stype) 172 u16 stype)
173{ 173{
174 if (ieee->iw_mode == IW_MODE_MASTER) { 174 if (ieee->iw_mode == IW_MODE_MASTER) {
@@ -176,7 +176,7 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
176 ieee->dev->name); 176 ieee->dev->name);
177 return 0; 177 return 0;
178/* 178/*
179 hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr_4addr *) 179 hostap_update_sta_ps(ieee, (struct hostap_libipw_hdr_4addr *)
180 skb->data);*/ 180 skb->data);*/
181 } 181 }
182 182
@@ -219,26 +219,27 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
219 219
220/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ 220/* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
221/* Ethernet-II snap header (RFC1042 for most EtherTypes) */ 221/* Ethernet-II snap header (RFC1042 for most EtherTypes) */
222static unsigned char rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 222static unsigned char libipw_rfc1042_header[] =
223 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
223 224
224/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ 225/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
225static unsigned char bridge_tunnel_header[] = 226static unsigned char libipw_bridge_tunnel_header[] =
226 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; 227 { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
227/* No encapsulation header if EtherType < 0x600 (=length) */ 228/* No encapsulation header if EtherType < 0x600 (=length) */
228 229
229/* Called by ieee80211_rx_frame_decrypt */ 230/* Called by libipw_rx_frame_decrypt */
230static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee, 231static int libipw_is_eapol_frame(struct libipw_device *ieee,
231 struct sk_buff *skb) 232 struct sk_buff *skb)
232{ 233{
233 struct net_device *dev = ieee->dev; 234 struct net_device *dev = ieee->dev;
234 u16 fc, ethertype; 235 u16 fc, ethertype;
235 struct ieee80211_hdr_3addr *hdr; 236 struct libipw_hdr_3addr *hdr;
236 u8 *pos; 237 u8 *pos;
237 238
238 if (skb->len < 24) 239 if (skb->len < 24)
239 return 0; 240 return 0;
240 241
241 hdr = (struct ieee80211_hdr_3addr *)skb->data; 242 hdr = (struct libipw_hdr_3addr *)skb->data;
242 fc = le16_to_cpu(hdr->frame_ctl); 243 fc = le16_to_cpu(hdr->frame_ctl);
243 244
244 /* check that the frame is unicast frame to us */ 245 /* check that the frame is unicast frame to us */
@@ -266,28 +267,28 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee,
266 return 0; 267 return 0;
267} 268}
268 269
269/* Called only as a tasklet (software IRQ), by ieee80211_rx */ 270/* Called only as a tasklet (software IRQ), by libipw_rx */
270static int 271static int
271ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb, 272libipw_rx_frame_decrypt(struct libipw_device *ieee, struct sk_buff *skb,
272 struct lib80211_crypt_data *crypt) 273 struct lib80211_crypt_data *crypt)
273{ 274{
274 struct ieee80211_hdr_3addr *hdr; 275 struct libipw_hdr_3addr *hdr;
275 int res, hdrlen; 276 int res, hdrlen;
276 277
277 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 278 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
278 return 0; 279 return 0;
279 280
280 hdr = (struct ieee80211_hdr_3addr *)skb->data; 281 hdr = (struct libipw_hdr_3addr *)skb->data;
281 hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 282 hdrlen = libipw_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
282 283
283 atomic_inc(&crypt->refcnt); 284 atomic_inc(&crypt->refcnt);
284 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 285 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
285 atomic_dec(&crypt->refcnt); 286 atomic_dec(&crypt->refcnt);
286 if (res < 0) { 287 if (res < 0) {
287 IEEE80211_DEBUG_DROP("decryption failed (SA=%pM) res=%d\n", 288 LIBIPW_DEBUG_DROP("decryption failed (SA=%pM) res=%d\n",
288 hdr->addr2, res); 289 hdr->addr2, res);
289 if (res == -2) 290 if (res == -2)
290 IEEE80211_DEBUG_DROP("Decryption failed ICV " 291 LIBIPW_DEBUG_DROP("Decryption failed ICV "
291 "mismatch (key %d)\n", 292 "mismatch (key %d)\n",
292 skb->data[hdrlen + 3] >> 6); 293 skb->data[hdrlen + 3] >> 6);
293 ieee->ieee_stats.rx_discards_undecryptable++; 294 ieee->ieee_stats.rx_discards_undecryptable++;
@@ -297,20 +298,20 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
297 return res; 298 return res;
298} 299}
299 300
300/* Called only as a tasklet (software IRQ), by ieee80211_rx */ 301/* Called only as a tasklet (software IRQ), by libipw_rx */
301static int 302static int
302ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, 303libipw_rx_frame_decrypt_msdu(struct libipw_device *ieee,
303 struct sk_buff *skb, int keyidx, 304 struct sk_buff *skb, int keyidx,
304 struct lib80211_crypt_data *crypt) 305 struct lib80211_crypt_data *crypt)
305{ 306{
306 struct ieee80211_hdr_3addr *hdr; 307 struct libipw_hdr_3addr *hdr;
307 int res, hdrlen; 308 int res, hdrlen;
308 309
309 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 310 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
310 return 0; 311 return 0;
311 312
312 hdr = (struct ieee80211_hdr_3addr *)skb->data; 313 hdr = (struct libipw_hdr_3addr *)skb->data;
313 hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 314 hdrlen = libipw_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
314 315
315 atomic_inc(&crypt->refcnt); 316 atomic_inc(&crypt->refcnt);
316 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv); 317 res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
@@ -328,11 +329,11 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee,
328/* All received frames are sent to this function. @skb contains the frame in 329/* All received frames are sent to this function. @skb contains the frame in
329 * IEEE 802.11 format, i.e., in the format it was sent over air. 330 * IEEE 802.11 format, i.e., in the format it was sent over air.
330 * This function is called only as a tasklet (software IRQ). */ 331 * This function is called only as a tasklet (software IRQ). */
331int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, 332int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
332 struct ieee80211_rx_stats *rx_stats) 333 struct libipw_rx_stats *rx_stats)
333{ 334{
334 struct net_device *dev = ieee->dev; 335 struct net_device *dev = ieee->dev;
335 struct ieee80211_hdr_4addr *hdr; 336 struct libipw_hdr_4addr *hdr;
336 size_t hdrlen; 337 size_t hdrlen;
337 u16 fc, type, stype, sc; 338 u16 fc, type, stype, sc;
338 unsigned int frag; 339 unsigned int frag;
@@ -352,7 +353,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
352 int keyidx = 0; 353 int keyidx = 0;
353 int can_be_decrypted = 0; 354 int can_be_decrypted = 0;
354 355
355 hdr = (struct ieee80211_hdr_4addr *)skb->data; 356 hdr = (struct libipw_hdr_4addr *)skb->data;
356 if (skb->len < 10) { 357 if (skb->len < 10) {
357 printk(KERN_INFO "%s: SKB length < 10\n", dev->name); 358 printk(KERN_INFO "%s: SKB length < 10\n", dev->name);
358 goto rx_dropped; 359 goto rx_dropped;
@@ -363,7 +364,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
363 stype = WLAN_FC_GET_STYPE(fc); 364 stype = WLAN_FC_GET_STYPE(fc);
364 sc = le16_to_cpu(hdr->seq_ctl); 365 sc = le16_to_cpu(hdr->seq_ctl);
365 frag = WLAN_GET_SEQ_FRAG(sc); 366 frag = WLAN_GET_SEQ_FRAG(sc);
366 hdrlen = ieee80211_get_hdrlen(fc); 367 hdrlen = libipw_get_hdrlen(fc);
367 368
368 if (skb->len < hdrlen) { 369 if (skb->len < hdrlen) {
369 printk(KERN_INFO "%s: invalid SKB length %d\n", 370 printk(KERN_INFO "%s: invalid SKB length %d\n",
@@ -380,19 +381,19 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
380 struct iw_quality wstats; 381 struct iw_quality wstats;
381 382
382 wstats.updated = 0; 383 wstats.updated = 0;
383 if (rx_stats->mask & IEEE80211_STATMASK_RSSI) { 384 if (rx_stats->mask & LIBIPW_STATMASK_RSSI) {
384 wstats.level = rx_stats->signal; 385 wstats.level = rx_stats->signal;
385 wstats.updated |= IW_QUAL_LEVEL_UPDATED; 386 wstats.updated |= IW_QUAL_LEVEL_UPDATED;
386 } else 387 } else
387 wstats.updated |= IW_QUAL_LEVEL_INVALID; 388 wstats.updated |= IW_QUAL_LEVEL_INVALID;
388 389
389 if (rx_stats->mask & IEEE80211_STATMASK_NOISE) { 390 if (rx_stats->mask & LIBIPW_STATMASK_NOISE) {
390 wstats.noise = rx_stats->noise; 391 wstats.noise = rx_stats->noise;
391 wstats.updated |= IW_QUAL_NOISE_UPDATED; 392 wstats.updated |= IW_QUAL_NOISE_UPDATED;
392 } else 393 } else
393 wstats.updated |= IW_QUAL_NOISE_INVALID; 394 wstats.updated |= IW_QUAL_NOISE_INVALID;
394 395
395 if (rx_stats->mask & IEEE80211_STATMASK_SIGNAL) { 396 if (rx_stats->mask & LIBIPW_STATMASK_SIGNAL) {
396 wstats.qual = rx_stats->signal; 397 wstats.qual = rx_stats->signal;
397 wstats.updated |= IW_QUAL_QUAL_UPDATED; 398 wstats.updated |= IW_QUAL_QUAL_UPDATED;
398 } else 399 } else
@@ -411,7 +412,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
411 if (ieee->iw_mode == IW_MODE_MONITOR) { 412 if (ieee->iw_mode == IW_MODE_MONITOR) {
412 dev->stats.rx_packets++; 413 dev->stats.rx_packets++;
413 dev->stats.rx_bytes += skb->len; 414 dev->stats.rx_bytes += skb->len;
414 ieee80211_monitor_rx(ieee, skb, rx_stats); 415 libipw_monitor_rx(ieee, skb, rx_stats);
415 return 1; 416 return 1;
416 } 417 }
417 418
@@ -457,7 +458,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
457 * frames from other than current BSS, so just drop the 458 * frames from other than current BSS, so just drop the
458 * frames silently instead of filling system log with 459 * frames silently instead of filling system log with
459 * these reports. */ 460 * these reports. */
460 IEEE80211_DEBUG_DROP("Decryption failed (not set)" 461 LIBIPW_DEBUG_DROP("Decryption failed (not set)"
461 " (SA=%pM)\n", hdr->addr2); 462 " (SA=%pM)\n", hdr->addr2);
462 ieee->ieee_stats.rx_discards_undecryptable++; 463 ieee->ieee_stats.rx_discards_undecryptable++;
463 goto rx_dropped; 464 goto rx_dropped;
@@ -475,7 +476,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
475 goto rx_dropped; 476 goto rx_dropped;
476 } 477 }
477 478
478 if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype)) 479 if (libipw_rx_frame_mgmt(ieee, skb, rx_stats, type, stype))
479 goto rx_dropped; 480 goto rx_dropped;
480 else 481 else
481 goto rx_exit; 482 goto rx_exit;
@@ -488,7 +489,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
488 ieee->prev_seq_ctl = sc; 489 ieee->prev_seq_ctl = sc;
489 490
490 /* Data frame - extract src/dst addresses */ 491 /* Data frame - extract src/dst addresses */
491 if (skb->len < IEEE80211_3ADDR_LEN) 492 if (skb->len < LIBIPW_3ADDR_LEN)
492 goto rx_dropped; 493 goto rx_dropped;
493 494
494 switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { 495 switch (fc & (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) {
@@ -501,7 +502,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
501 memcpy(src, hdr->addr2, ETH_ALEN); 502 memcpy(src, hdr->addr2, ETH_ALEN);
502 break; 503 break;
503 case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS: 504 case IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS:
504 if (skb->len < IEEE80211_4ADDR_LEN) 505 if (skb->len < LIBIPW_4ADDR_LEN)
505 goto rx_dropped; 506 goto rx_dropped;
506 memcpy(dst, hdr->addr3, ETH_ALEN); 507 memcpy(dst, hdr->addr3, ETH_ALEN);
507 memcpy(src, hdr->addr4, ETH_ALEN); 508 memcpy(src, hdr->addr4, ETH_ALEN);
@@ -560,7 +561,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
560 stype != IEEE80211_STYPE_DATA_CFPOLL && 561 stype != IEEE80211_STYPE_DATA_CFPOLL &&
561 stype != IEEE80211_STYPE_DATA_CFACKPOLL) { 562 stype != IEEE80211_STYPE_DATA_CFACKPOLL) {
562 if (stype != IEEE80211_STYPE_NULLFUNC) 563 if (stype != IEEE80211_STYPE_NULLFUNC)
563 IEEE80211_DEBUG_DROP("RX: dropped data frame " 564 LIBIPW_DEBUG_DROP("RX: dropped data frame "
564 "with no data (type=0x%02x, " 565 "with no data (type=0x%02x, "
565 "subtype=0x%02x, len=%d)\n", 566 "subtype=0x%02x, len=%d)\n",
566 type, stype, skb->len); 567 type, stype, skb->len);
@@ -570,21 +571,21 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
570 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ 571 /* skb: hdr + (possibly fragmented, possibly encrypted) payload */
571 572
572 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && 573 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted &&
573 (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0) 574 (keyidx = libipw_rx_frame_decrypt(ieee, skb, crypt)) < 0)
574 goto rx_dropped; 575 goto rx_dropped;
575 576
576 hdr = (struct ieee80211_hdr_4addr *)skb->data; 577 hdr = (struct libipw_hdr_4addr *)skb->data;
577 578
578 /* skb: hdr + (possibly fragmented) plaintext payload */ 579 /* skb: hdr + (possibly fragmented) plaintext payload */
579 // PR: FIXME: hostap has additional conditions in the "if" below: 580 // PR: FIXME: hostap has additional conditions in the "if" below:
580 // ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) && 581 // ieee->host_decrypt && (fc & IEEE80211_FCTL_PROTECTED) &&
581 if ((frag != 0) || (fc & IEEE80211_FCTL_MOREFRAGS)) { 582 if ((frag != 0) || (fc & IEEE80211_FCTL_MOREFRAGS)) {
582 int flen; 583 int flen;
583 struct sk_buff *frag_skb = ieee80211_frag_cache_get(ieee, hdr); 584 struct sk_buff *frag_skb = libipw_frag_cache_get(ieee, hdr);
584 IEEE80211_DEBUG_FRAG("Rx Fragment received (%u)\n", frag); 585 LIBIPW_DEBUG_FRAG("Rx Fragment received (%u)\n", frag);
585 586
586 if (!frag_skb) { 587 if (!frag_skb) {
587 IEEE80211_DEBUG(IEEE80211_DL_RX | IEEE80211_DL_FRAG, 588 LIBIPW_DEBUG(LIBIPW_DL_RX | LIBIPW_DL_FRAG,
588 "Rx cannot get skb from fragment " 589 "Rx cannot get skb from fragment "
589 "cache (morefrag=%d seq=%u frag=%u)\n", 590 "cache (morefrag=%d seq=%u frag=%u)\n",
590 (fc & IEEE80211_FCTL_MOREFRAGS) != 0, 591 (fc & IEEE80211_FCTL_MOREFRAGS) != 0,
@@ -600,7 +601,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
600 printk(KERN_WARNING "%s: host decrypted and " 601 printk(KERN_WARNING "%s: host decrypted and "
601 "reassembled frame did not fit skb\n", 602 "reassembled frame did not fit skb\n",
602 dev->name); 603 dev->name);
603 ieee80211_frag_cache_invalidate(ieee, hdr); 604 libipw_frag_cache_invalidate(ieee, hdr);
604 goto rx_dropped; 605 goto rx_dropped;
605 } 606 }
606 607
@@ -627,24 +628,24 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
627 /* this was the last fragment and the frame will be 628 /* this was the last fragment and the frame will be
628 * delivered, so remove skb from fragment cache */ 629 * delivered, so remove skb from fragment cache */
629 skb = frag_skb; 630 skb = frag_skb;
630 hdr = (struct ieee80211_hdr_4addr *)skb->data; 631 hdr = (struct libipw_hdr_4addr *)skb->data;
631 ieee80211_frag_cache_invalidate(ieee, hdr); 632 libipw_frag_cache_invalidate(ieee, hdr);
632 } 633 }
633 634
634 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still 635 /* skb: hdr + (possible reassembled) full MSDU payload; possibly still
635 * encrypted/authenticated */ 636 * encrypted/authenticated */
636 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted && 637 if ((fc & IEEE80211_FCTL_PROTECTED) && can_be_decrypted &&
637 ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt)) 638 libipw_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt))
638 goto rx_dropped; 639 goto rx_dropped;
639 640
640 hdr = (struct ieee80211_hdr_4addr *)skb->data; 641 hdr = (struct libipw_hdr_4addr *)skb->data;
641 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep) { 642 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep) {
642 if ( /*ieee->ieee802_1x && */ 643 if ( /*ieee->ieee802_1x && */
643 ieee80211_is_eapol_frame(ieee, skb)) { 644 libipw_is_eapol_frame(ieee, skb)) {
644 /* pass unencrypted EAPOL frames even if encryption is 645 /* pass unencrypted EAPOL frames even if encryption is
645 * configured */ 646 * configured */
646 } else { 647 } else {
647 IEEE80211_DEBUG_DROP("encryption configured, but RX " 648 LIBIPW_DEBUG_DROP("encryption configured, but RX "
648 "frame not encrypted (SA=%pM)\n", 649 "frame not encrypted (SA=%pM)\n",
649 hdr->addr2); 650 hdr->addr2);
650 goto rx_dropped; 651 goto rx_dropped;
@@ -652,8 +653,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
652 } 653 }
653 654
654 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep && 655 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
655 !ieee80211_is_eapol_frame(ieee, skb)) { 656 !libipw_is_eapol_frame(ieee, skb)) {
656 IEEE80211_DEBUG_DROP("dropped unencrypted RX data " 657 LIBIPW_DEBUG_DROP("dropped unencrypted RX data "
657 "frame from %pM (drop_unencrypted=1)\n", 658 "frame from %pM (drop_unencrypted=1)\n",
658 hdr->addr2); 659 hdr->addr2);
659 goto rx_dropped; 660 goto rx_dropped;
@@ -736,9 +737,9 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
736 737
737 /* convert hdr + possible LLC headers into Ethernet header */ 738 /* convert hdr + possible LLC headers into Ethernet header */
738 if (skb->len - hdrlen >= 8 && 739 if (skb->len - hdrlen >= 8 &&
739 ((memcmp(payload, rfc1042_header, SNAP_SIZE) == 0 && 740 ((memcmp(payload, libipw_rfc1042_header, SNAP_SIZE) == 0 &&
740 ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) || 741 ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
741 memcmp(payload, bridge_tunnel_header, SNAP_SIZE) == 0)) { 742 memcmp(payload, libipw_bridge_tunnel_header, SNAP_SIZE) == 0)) {
742 /* remove RFC1042 or Bridge-Tunnel encapsulation and 743 /* remove RFC1042 or Bridge-Tunnel encapsulation and
743 * replace EtherType */ 744 * replace EtherType */
744 skb_pull(skb, hdrlen + SNAP_SIZE); 745 skb_pull(skb, hdrlen + SNAP_SIZE);
@@ -807,7 +808,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
807 /* netif_rx always succeeds, but it might drop 808 /* netif_rx always succeeds, but it might drop
808 * the packet. If it drops the packet, we log that 809 * the packet. If it drops the packet, we log that
809 * in our stats. */ 810 * in our stats. */
810 IEEE80211_DEBUG_DROP 811 LIBIPW_DEBUG_DROP
811 ("RX: netif_rx dropped the packet\n"); 812 ("RX: netif_rx dropped the packet\n");
812 dev->stats.rx_dropped++; 813 dev->stats.rx_dropped++;
813 } 814 }
@@ -829,18 +830,18 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
829 return 0; 830 return 0;
830} 831}
831 832
832/* Filter out unrelated packets, call ieee80211_rx[_mgt] 833/* Filter out unrelated packets, call libipw_rx[_mgt]
833 * This function takes over the skb, it should not be used again after calling 834 * This function takes over the skb, it should not be used again after calling
834 * this function. */ 835 * this function. */
835void ieee80211_rx_any(struct ieee80211_device *ieee, 836void libipw_rx_any(struct libipw_device *ieee,
836 struct sk_buff *skb, struct ieee80211_rx_stats *stats) 837 struct sk_buff *skb, struct libipw_rx_stats *stats)
837{ 838{
838 struct ieee80211_hdr_4addr *hdr; 839 struct libipw_hdr_4addr *hdr;
839 int is_packet_for_us; 840 int is_packet_for_us;
840 u16 fc; 841 u16 fc;
841 842
842 if (ieee->iw_mode == IW_MODE_MONITOR) { 843 if (ieee->iw_mode == IW_MODE_MONITOR) {
843 if (!ieee80211_rx(ieee, skb, stats)) 844 if (!libipw_rx(ieee, skb, stats))
844 dev_kfree_skb_irq(skb); 845 dev_kfree_skb_irq(skb);
845 return; 846 return;
846 } 847 }
@@ -848,7 +849,7 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
848 if (skb->len < sizeof(struct ieee80211_hdr)) 849 if (skb->len < sizeof(struct ieee80211_hdr))
849 goto drop_free; 850 goto drop_free;
850 851
851 hdr = (struct ieee80211_hdr_4addr *)skb->data; 852 hdr = (struct libipw_hdr_4addr *)skb->data;
852 fc = le16_to_cpu(hdr->frame_ctl); 853 fc = le16_to_cpu(hdr->frame_ctl);
853 854
854 if ((fc & IEEE80211_FCTL_VERS) != 0) 855 if ((fc & IEEE80211_FCTL_VERS) != 0)
@@ -856,9 +857,9 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
856 857
857 switch (fc & IEEE80211_FCTL_FTYPE) { 858 switch (fc & IEEE80211_FCTL_FTYPE) {
858 case IEEE80211_FTYPE_MGMT: 859 case IEEE80211_FTYPE_MGMT:
859 if (skb->len < sizeof(struct ieee80211_hdr_3addr)) 860 if (skb->len < sizeof(struct libipw_hdr_3addr))
860 goto drop_free; 861 goto drop_free;
861 ieee80211_rx_mgt(ieee, hdr, stats); 862 libipw_rx_mgt(ieee, hdr, stats);
862 dev_kfree_skb_irq(skb); 863 dev_kfree_skb_irq(skb);
863 return; 864 return;
864 case IEEE80211_FTYPE_DATA: 865 case IEEE80211_FTYPE_DATA:
@@ -910,7 +911,7 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
910 } 911 }
911 912
912 if (is_packet_for_us) 913 if (is_packet_for_us)
913 if (!ieee80211_rx(ieee, skb, stats)) 914 if (!libipw_rx(ieee, skb, stats))
914 dev_kfree_skb_irq(skb); 915 dev_kfree_skb_irq(skb);
915 return; 916 return;
916 917
@@ -928,7 +929,7 @@ static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 };
928* Make ther structure we read from the beacon packet has 929* Make ther structure we read from the beacon packet has
929* the right values 930* the right values
930*/ 931*/
931static int ieee80211_verify_qos_info(struct ieee80211_qos_information_element 932static int libipw_verify_qos_info(struct libipw_qos_information_element
932 *info_element, int sub_type) 933 *info_element, int sub_type)
933{ 934{
934 935
@@ -947,12 +948,12 @@ static int ieee80211_verify_qos_info(struct ieee80211_qos_information_element
947/* 948/*
948 * Parse a QoS parameter element 949 * Parse a QoS parameter element
949 */ 950 */
950static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info 951static int libipw_read_qos_param_element(struct libipw_qos_parameter_info
951 *element_param, struct ieee80211_info_element 952 *element_param, struct libipw_info_element
952 *info_element) 953 *info_element)
953{ 954{
954 int ret = 0; 955 int ret = 0;
955 u16 size = sizeof(struct ieee80211_qos_parameter_info) - 2; 956 u16 size = sizeof(struct libipw_qos_parameter_info) - 2;
956 957
957 if ((info_element == NULL) || (element_param == NULL)) 958 if ((info_element == NULL) || (element_param == NULL))
958 return -1; 959 return -1;
@@ -965,7 +966,7 @@ static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info
965 } else 966 } else
966 ret = -1; 967 ret = -1;
967 if (ret == 0) 968 if (ret == 0)
968 ret = ieee80211_verify_qos_info(&element_param->info_element, 969 ret = libipw_verify_qos_info(&element_param->info_element,
969 QOS_OUI_PARAM_SUB_TYPE); 970 QOS_OUI_PARAM_SUB_TYPE);
970 return ret; 971 return ret;
971} 972}
@@ -973,13 +974,13 @@ static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info
973/* 974/*
974 * Parse a QoS information element 975 * Parse a QoS information element
975 */ 976 */
976static int ieee80211_read_qos_info_element(struct 977static int libipw_read_qos_info_element(struct
977 ieee80211_qos_information_element 978 libipw_qos_information_element
978 *element_info, struct ieee80211_info_element 979 *element_info, struct libipw_info_element
979 *info_element) 980 *info_element)
980{ 981{
981 int ret = 0; 982 int ret = 0;
982 u16 size = sizeof(struct ieee80211_qos_information_element) - 2; 983 u16 size = sizeof(struct libipw_qos_information_element) - 2;
983 984
984 if (element_info == NULL) 985 if (element_info == NULL)
985 return -1; 986 return -1;
@@ -995,7 +996,7 @@ static int ieee80211_read_qos_info_element(struct
995 ret = -1; 996 ret = -1;
996 997
997 if (ret == 0) 998 if (ret == 0)
998 ret = ieee80211_verify_qos_info(element_info, 999 ret = libipw_verify_qos_info(element_info,
999 QOS_OUI_INFO_SUB_TYPE); 1000 QOS_OUI_INFO_SUB_TYPE);
1000 return ret; 1001 return ret;
1001} 1002}
@@ -1003,15 +1004,15 @@ static int ieee80211_read_qos_info_element(struct
1003/* 1004/*
1004 * Write QoS parameters from the ac parameters. 1005 * Write QoS parameters from the ac parameters.
1005 */ 1006 */
1006static int ieee80211_qos_convert_ac_to_parameters(struct 1007static int libipw_qos_convert_ac_to_parameters(struct
1007 ieee80211_qos_parameter_info 1008 libipw_qos_parameter_info
1008 *param_elm, struct 1009 *param_elm, struct
1009 ieee80211_qos_parameters 1010 libipw_qos_parameters
1010 *qos_param) 1011 *qos_param)
1011{ 1012{
1012 int rc = 0; 1013 int rc = 0;
1013 int i; 1014 int i;
1014 struct ieee80211_qos_ac_parameter *ac_params; 1015 struct libipw_qos_ac_parameter *ac_params;
1015 u32 txop; 1016 u32 txop;
1016 u8 cw_min; 1017 u8 cw_min;
1017 u8 cw_max; 1018 u8 cw_max;
@@ -1042,27 +1043,27 @@ static int ieee80211_qos_convert_ac_to_parameters(struct
1042 * parameters element. check the information element length to decide 1043 * parameters element. check the information element length to decide
1043 * which type to read 1044 * which type to read
1044 */ 1045 */
1045static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element 1046static int libipw_parse_qos_info_param_IE(struct libipw_info_element
1046 *info_element, 1047 *info_element,
1047 struct ieee80211_network *network) 1048 struct libipw_network *network)
1048{ 1049{
1049 int rc = 0; 1050 int rc = 0;
1050 struct ieee80211_qos_parameters *qos_param = NULL; 1051 struct libipw_qos_parameters *qos_param = NULL;
1051 struct ieee80211_qos_information_element qos_info_element; 1052 struct libipw_qos_information_element qos_info_element;
1052 1053
1053 rc = ieee80211_read_qos_info_element(&qos_info_element, info_element); 1054 rc = libipw_read_qos_info_element(&qos_info_element, info_element);
1054 1055
1055 if (rc == 0) { 1056 if (rc == 0) {
1056 network->qos_data.param_count = qos_info_element.ac_info & 0x0F; 1057 network->qos_data.param_count = qos_info_element.ac_info & 0x0F;
1057 network->flags |= NETWORK_HAS_QOS_INFORMATION; 1058 network->flags |= NETWORK_HAS_QOS_INFORMATION;
1058 } else { 1059 } else {
1059 struct ieee80211_qos_parameter_info param_element; 1060 struct libipw_qos_parameter_info param_element;
1060 1061
1061 rc = ieee80211_read_qos_param_element(&param_element, 1062 rc = libipw_read_qos_param_element(&param_element,
1062 info_element); 1063 info_element);
1063 if (rc == 0) { 1064 if (rc == 0) {
1064 qos_param = &(network->qos_data.parameters); 1065 qos_param = &(network->qos_data.parameters);
1065 ieee80211_qos_convert_ac_to_parameters(&param_element, 1066 libipw_qos_convert_ac_to_parameters(&param_element,
1066 qos_param); 1067 qos_param);
1067 network->flags |= NETWORK_HAS_QOS_PARAMETERS; 1068 network->flags |= NETWORK_HAS_QOS_PARAMETERS;
1068 network->qos_data.param_count = 1069 network->qos_data.param_count =
@@ -1071,7 +1072,7 @@ static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element
1071 } 1072 }
1072 1073
1073 if (rc == 0) { 1074 if (rc == 0) {
1074 IEEE80211_DEBUG_QOS("QoS is supported\n"); 1075 LIBIPW_DEBUG_QOS("QoS is supported\n");
1075 network->qos_data.supported = 1; 1076 network->qos_data.supported = 1;
1076 } 1077 }
1077 return rc; 1078 return rc;
@@ -1116,9 +1117,9 @@ static const char *get_info_element_string(u16 id)
1116} 1117}
1117#endif 1118#endif
1118 1119
1119static int ieee80211_parse_info_param(struct ieee80211_info_element 1120static int libipw_parse_info_param(struct libipw_info_element
1120 *info_element, u16 length, 1121 *info_element, u16 length,
1121 struct ieee80211_network *network) 1122 struct libipw_network *network)
1122{ 1123{
1123 DECLARE_SSID_BUF(ssid); 1124 DECLARE_SSID_BUF(ssid);
1124 u8 i; 1125 u8 i;
@@ -1129,7 +1130,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1129 1130
1130 while (length >= sizeof(*info_element)) { 1131 while (length >= sizeof(*info_element)) {
1131 if (sizeof(*info_element) + info_element->len > length) { 1132 if (sizeof(*info_element) + info_element->len > length) {
1132 IEEE80211_DEBUG_MGMT("Info elem: parse failed: " 1133 LIBIPW_DEBUG_MGMT("Info elem: parse failed: "
1133 "info_element->len + 2 > left : " 1134 "info_element->len + 2 > left : "
1134 "info_element->len+2=%zd left=%d, id=%d.\n", 1135 "info_element->len+2=%zd left=%d, id=%d.\n",
1135 info_element->len + 1136 info_element->len +
@@ -1151,7 +1152,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1151 memset(network->ssid + network->ssid_len, 0, 1152 memset(network->ssid + network->ssid_len, 0,
1152 IW_ESSID_MAX_SIZE - network->ssid_len); 1153 IW_ESSID_MAX_SIZE - network->ssid_len);
1153 1154
1154 IEEE80211_DEBUG_MGMT("WLAN_EID_SSID: '%s' len=%d.\n", 1155 LIBIPW_DEBUG_MGMT("WLAN_EID_SSID: '%s' len=%d.\n",
1155 print_ssid(ssid, network->ssid, 1156 print_ssid(ssid, network->ssid,
1156 network->ssid_len), 1157 network->ssid_len),
1157 network->ssid_len); 1158 network->ssid_len);
@@ -1170,17 +1171,17 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1170 (p - rates_str), "%02X ", 1171 (p - rates_str), "%02X ",
1171 network->rates[i]); 1172 network->rates[i]);
1172#endif 1173#endif
1173 if (ieee80211_is_ofdm_rate 1174 if (libipw_is_ofdm_rate
1174 (info_element->data[i])) { 1175 (info_element->data[i])) {
1175 network->flags |= NETWORK_HAS_OFDM; 1176 network->flags |= NETWORK_HAS_OFDM;
1176 if (info_element->data[i] & 1177 if (info_element->data[i] &
1177 IEEE80211_BASIC_RATE_MASK) 1178 LIBIPW_BASIC_RATE_MASK)
1178 network->flags &= 1179 network->flags &=
1179 ~NETWORK_HAS_CCK; 1180 ~NETWORK_HAS_CCK;
1180 } 1181 }
1181 } 1182 }
1182 1183
1183 IEEE80211_DEBUG_MGMT("WLAN_EID_SUPP_RATES: '%s' (%d)\n", 1184 LIBIPW_DEBUG_MGMT("WLAN_EID_SUPP_RATES: '%s' (%d)\n",
1184 rates_str, network->rates_len); 1185 rates_str, network->rates_len);
1185 break; 1186 break;
1186 1187
@@ -1197,61 +1198,61 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1197 (p - rates_str), "%02X ", 1198 (p - rates_str), "%02X ",
1198 network->rates[i]); 1199 network->rates[i]);
1199#endif 1200#endif
1200 if (ieee80211_is_ofdm_rate 1201 if (libipw_is_ofdm_rate
1201 (info_element->data[i])) { 1202 (info_element->data[i])) {
1202 network->flags |= NETWORK_HAS_OFDM; 1203 network->flags |= NETWORK_HAS_OFDM;
1203 if (info_element->data[i] & 1204 if (info_element->data[i] &
1204 IEEE80211_BASIC_RATE_MASK) 1205 LIBIPW_BASIC_RATE_MASK)
1205 network->flags &= 1206 network->flags &=
1206 ~NETWORK_HAS_CCK; 1207 ~NETWORK_HAS_CCK;
1207 } 1208 }
1208 } 1209 }
1209 1210
1210 IEEE80211_DEBUG_MGMT("WLAN_EID_EXT_SUPP_RATES: '%s' (%d)\n", 1211 LIBIPW_DEBUG_MGMT("WLAN_EID_EXT_SUPP_RATES: '%s' (%d)\n",
1211 rates_str, network->rates_ex_len); 1212 rates_str, network->rates_ex_len);
1212 break; 1213 break;
1213 1214
1214 case WLAN_EID_DS_PARAMS: 1215 case WLAN_EID_DS_PARAMS:
1215 IEEE80211_DEBUG_MGMT("WLAN_EID_DS_PARAMS: %d\n", 1216 LIBIPW_DEBUG_MGMT("WLAN_EID_DS_PARAMS: %d\n",
1216 info_element->data[0]); 1217 info_element->data[0]);
1217 network->channel = info_element->data[0]; 1218 network->channel = info_element->data[0];
1218 break; 1219 break;
1219 1220
1220 case WLAN_EID_FH_PARAMS: 1221 case WLAN_EID_FH_PARAMS:
1221 IEEE80211_DEBUG_MGMT("WLAN_EID_FH_PARAMS: ignored\n"); 1222 LIBIPW_DEBUG_MGMT("WLAN_EID_FH_PARAMS: ignored\n");
1222 break; 1223 break;
1223 1224
1224 case WLAN_EID_CF_PARAMS: 1225 case WLAN_EID_CF_PARAMS:
1225 IEEE80211_DEBUG_MGMT("WLAN_EID_CF_PARAMS: ignored\n"); 1226 LIBIPW_DEBUG_MGMT("WLAN_EID_CF_PARAMS: ignored\n");
1226 break; 1227 break;
1227 1228
1228 case WLAN_EID_TIM: 1229 case WLAN_EID_TIM:
1229 network->tim.tim_count = info_element->data[0]; 1230 network->tim.tim_count = info_element->data[0];
1230 network->tim.tim_period = info_element->data[1]; 1231 network->tim.tim_period = info_element->data[1];
1231 IEEE80211_DEBUG_MGMT("WLAN_EID_TIM: partially ignored\n"); 1232 LIBIPW_DEBUG_MGMT("WLAN_EID_TIM: partially ignored\n");
1232 break; 1233 break;
1233 1234
1234 case WLAN_EID_ERP_INFO: 1235 case WLAN_EID_ERP_INFO:
1235 network->erp_value = info_element->data[0]; 1236 network->erp_value = info_element->data[0];
1236 network->flags |= NETWORK_HAS_ERP_VALUE; 1237 network->flags |= NETWORK_HAS_ERP_VALUE;
1237 IEEE80211_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n", 1238 LIBIPW_DEBUG_MGMT("MFIE_TYPE_ERP_SET: %d\n",
1238 network->erp_value); 1239 network->erp_value);
1239 break; 1240 break;
1240 1241
1241 case WLAN_EID_IBSS_PARAMS: 1242 case WLAN_EID_IBSS_PARAMS:
1242 network->atim_window = info_element->data[0]; 1243 network->atim_window = info_element->data[0];
1243 IEEE80211_DEBUG_MGMT("WLAN_EID_IBSS_PARAMS: %d\n", 1244 LIBIPW_DEBUG_MGMT("WLAN_EID_IBSS_PARAMS: %d\n",
1244 network->atim_window); 1245 network->atim_window);
1245 break; 1246 break;
1246 1247
1247 case WLAN_EID_CHALLENGE: 1248 case WLAN_EID_CHALLENGE:
1248 IEEE80211_DEBUG_MGMT("WLAN_EID_CHALLENGE: ignored\n"); 1249 LIBIPW_DEBUG_MGMT("WLAN_EID_CHALLENGE: ignored\n");
1249 break; 1250 break;
1250 1251
1251 case WLAN_EID_GENERIC: 1252 case WLAN_EID_GENERIC:
1252 IEEE80211_DEBUG_MGMT("WLAN_EID_GENERIC: %d bytes\n", 1253 LIBIPW_DEBUG_MGMT("WLAN_EID_GENERIC: %d bytes\n",
1253 info_element->len); 1254 info_element->len);
1254 if (!ieee80211_parse_qos_info_param_IE(info_element, 1255 if (!libipw_parse_qos_info_param_IE(info_element,
1255 network)) 1256 network))
1256 break; 1257 break;
1257 1258
@@ -1268,7 +1269,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1268 break; 1269 break;
1269 1270
1270 case WLAN_EID_RSN: 1271 case WLAN_EID_RSN:
1271 IEEE80211_DEBUG_MGMT("WLAN_EID_RSN: %d bytes\n", 1272 LIBIPW_DEBUG_MGMT("WLAN_EID_RSN: %d bytes\n",
1272 info_element->len); 1273 info_element->len);
1273 network->rsn_ie_len = min(info_element->len + 2, 1274 network->rsn_ie_len = min(info_element->len + 2,
1274 MAX_WPA_IE_LEN); 1275 MAX_WPA_IE_LEN);
@@ -1318,7 +1319,7 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1318 break; 1319 break;
1319 1320
1320 default: 1321 default:
1321 IEEE80211_DEBUG_MGMT 1322 LIBIPW_DEBUG_MGMT
1322 ("Unsupported info element: %s (%d)\n", 1323 ("Unsupported info element: %s (%d)\n",
1323 get_info_element_string(info_element->id), 1324 get_info_element_string(info_element->id),
1324 info_element->id); 1325 info_element->id);
@@ -1327,20 +1328,20 @@ static int ieee80211_parse_info_param(struct ieee80211_info_element
1327 1328
1328 length -= sizeof(*info_element) + info_element->len; 1329 length -= sizeof(*info_element) + info_element->len;
1329 info_element = 1330 info_element =
1330 (struct ieee80211_info_element *)&info_element-> 1331 (struct libipw_info_element *)&info_element->
1331 data[info_element->len]; 1332 data[info_element->len];
1332 } 1333 }
1333 1334
1334 return 0; 1335 return 0;
1335} 1336}
1336 1337
1337static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct ieee80211_assoc_response 1338static int libipw_handle_assoc_resp(struct libipw_device *ieee, struct libipw_assoc_response
1338 *frame, struct ieee80211_rx_stats *stats) 1339 *frame, struct libipw_rx_stats *stats)
1339{ 1340{
1340 struct ieee80211_network network_resp = { 1341 struct libipw_network network_resp = {
1341 .ibss_dfs = NULL, 1342 .ibss_dfs = NULL,
1342 }; 1343 };
1343 struct ieee80211_network *network = &network_resp; 1344 struct libipw_network *network = &network_resp;
1344 struct net_device *dev = ieee->dev; 1345 struct net_device *dev = ieee->dev;
1345 1346
1346 network->flags = 0; 1347 network->flags = 0;
@@ -1361,7 +1362,7 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
1361 network->erp_value = 1362 network->erp_value =
1362 (network->capability & WLAN_CAPABILITY_IBSS) ? 0x3 : 0x0; 1363 (network->capability & WLAN_CAPABILITY_IBSS) ? 0x3 : 0x0;
1363 1364
1364 if (stats->freq == IEEE80211_52GHZ_BAND) { 1365 if (stats->freq == LIBIPW_52GHZ_BAND) {
1365 /* for A band (No DS info) */ 1366 /* for A band (No DS info) */
1366 network->channel = stats->received_channel; 1367 network->channel = stats->received_channel;
1367 } else 1368 } else
@@ -1370,12 +1371,12 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
1370 network->wpa_ie_len = 0; 1371 network->wpa_ie_len = 0;
1371 network->rsn_ie_len = 0; 1372 network->rsn_ie_len = 0;
1372 1373
1373 if (ieee80211_parse_info_param 1374 if (libipw_parse_info_param
1374 (frame->info_element, stats->len - sizeof(*frame), network)) 1375 (frame->info_element, stats->len - sizeof(*frame), network))
1375 return 1; 1376 return 1;
1376 1377
1377 network->mode = 0; 1378 network->mode = 0;
1378 if (stats->freq == IEEE80211_52GHZ_BAND) 1379 if (stats->freq == LIBIPW_52GHZ_BAND)
1379 network->mode = IEEE_A; 1380 network->mode = IEEE_A;
1380 else { 1381 else {
1381 if (network->flags & NETWORK_HAS_OFDM) 1382 if (network->flags & NETWORK_HAS_OFDM)
@@ -1394,10 +1395,10 @@ static int ieee80211_handle_assoc_resp(struct ieee80211_device *ieee, struct iee
1394 1395
1395/***************************************************/ 1396/***************************************************/
1396 1397
1397static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee80211_probe_response 1398static int libipw_network_init(struct libipw_device *ieee, struct libipw_probe_response
1398 *beacon, 1399 *beacon,
1399 struct ieee80211_network *network, 1400 struct libipw_network *network,
1400 struct ieee80211_rx_stats *stats) 1401 struct libipw_rx_stats *stats)
1401{ 1402{
1402 DECLARE_SSID_BUF(ssid); 1403 DECLARE_SSID_BUF(ssid);
1403 1404
@@ -1423,7 +1424,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1423 network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ? 1424 network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ?
1424 0x3 : 0x0; 1425 0x3 : 0x0;
1425 1426
1426 if (stats->freq == IEEE80211_52GHZ_BAND) { 1427 if (stats->freq == LIBIPW_52GHZ_BAND) {
1427 /* for A band (No DS info) */ 1428 /* for A band (No DS info) */
1428 network->channel = stats->received_channel; 1429 network->channel = stats->received_channel;
1429 } else 1430 } else
@@ -1432,12 +1433,12 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1432 network->wpa_ie_len = 0; 1433 network->wpa_ie_len = 0;
1433 network->rsn_ie_len = 0; 1434 network->rsn_ie_len = 0;
1434 1435
1435 if (ieee80211_parse_info_param 1436 if (libipw_parse_info_param
1436 (beacon->info_element, stats->len - sizeof(*beacon), network)) 1437 (beacon->info_element, stats->len - sizeof(*beacon), network))
1437 return 1; 1438 return 1;
1438 1439
1439 network->mode = 0; 1440 network->mode = 0;
1440 if (stats->freq == IEEE80211_52GHZ_BAND) 1441 if (stats->freq == LIBIPW_52GHZ_BAND)
1441 network->mode = IEEE_A; 1442 network->mode = IEEE_A;
1442 else { 1443 else {
1443 if (network->flags & NETWORK_HAS_OFDM) 1444 if (network->flags & NETWORK_HAS_OFDM)
@@ -1447,7 +1448,7 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1447 } 1448 }
1448 1449
1449 if (network->mode == 0) { 1450 if (network->mode == 0) {
1450 IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' " 1451 LIBIPW_DEBUG_SCAN("Filtered out '%s (%pM)' "
1451 "network.\n", 1452 "network.\n",
1452 print_ssid(ssid, network->ssid, 1453 print_ssid(ssid, network->ssid,
1453 network->ssid_len), 1454 network->ssid_len),
@@ -1460,8 +1461,8 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1460 return 0; 1461 return 0;
1461} 1462}
1462 1463
1463static inline int is_same_network(struct ieee80211_network *src, 1464static inline int is_same_network(struct libipw_network *src,
1464 struct ieee80211_network *dst) 1465 struct libipw_network *dst)
1465{ 1466{
1466 /* A network is only a duplicate if the channel, BSSID, and ESSID 1467 /* A network is only a duplicate if the channel, BSSID, and ESSID
1467 * all match. We treat all <hidden> with the same BSSID and channel 1468 * all match. We treat all <hidden> with the same BSSID and channel
@@ -1472,13 +1473,13 @@ static inline int is_same_network(struct ieee80211_network *src,
1472 !memcmp(src->ssid, dst->ssid, src->ssid_len)); 1473 !memcmp(src->ssid, dst->ssid, src->ssid_len));
1473} 1474}
1474 1475
1475static void update_network(struct ieee80211_network *dst, 1476static void update_network(struct libipw_network *dst,
1476 struct ieee80211_network *src) 1477 struct libipw_network *src)
1477{ 1478{
1478 int qos_active; 1479 int qos_active;
1479 u8 old_param; 1480 u8 old_param;
1480 1481
1481 ieee80211_network_reset(dst); 1482 libipw_network_reset(dst);
1482 dst->ibss_dfs = src->ibss_dfs; 1483 dst->ibss_dfs = src->ibss_dfs;
1483 1484
1484 /* We only update the statistics if they were created by receiving 1485 /* We only update the statistics if they were created by receiving
@@ -1488,9 +1489,9 @@ static void update_network(struct ieee80211_network *dst,
1488 * down the signal level of an AP. */ 1489 * down the signal level of an AP. */
1489 if (dst->channel == src->stats.received_channel) 1490 if (dst->channel == src->stats.received_channel)
1490 memcpy(&dst->stats, &src->stats, 1491 memcpy(&dst->stats, &src->stats,
1491 sizeof(struct ieee80211_rx_stats)); 1492 sizeof(struct libipw_rx_stats));
1492 else 1493 else
1493 IEEE80211_DEBUG_SCAN("Network %pM info received " 1494 LIBIPW_DEBUG_SCAN("Network %pM info received "
1494 "off channel (%d vs. %d)\n", src->bssid, 1495 "off channel (%d vs. %d)\n", src->bssid,
1495 dst->channel, src->stats.received_channel); 1496 dst->channel, src->stats.received_channel);
1496 1497
@@ -1521,7 +1522,7 @@ static void update_network(struct ieee80211_network *dst,
1521 old_param = dst->qos_data.old_param_count; 1522 old_param = dst->qos_data.old_param_count;
1522 if (dst->flags & NETWORK_HAS_QOS_MASK) 1523 if (dst->flags & NETWORK_HAS_QOS_MASK)
1523 memcpy(&dst->qos_data, &src->qos_data, 1524 memcpy(&dst->qos_data, &src->qos_data,
1524 sizeof(struct ieee80211_qos_data)); 1525 sizeof(struct libipw_qos_data));
1525 else { 1526 else {
1526 dst->qos_data.supported = src->qos_data.supported; 1527 dst->qos_data.supported = src->qos_data.supported;
1527 dst->qos_data.param_count = src->qos_data.param_count; 1528 dst->qos_data.param_count = src->qos_data.param_count;
@@ -1529,11 +1530,11 @@ static void update_network(struct ieee80211_network *dst,
1529 1530
1530 if (dst->qos_data.supported == 1) { 1531 if (dst->qos_data.supported == 1) {
1531 if (dst->ssid_len) 1532 if (dst->ssid_len)
1532 IEEE80211_DEBUG_QOS 1533 LIBIPW_DEBUG_QOS
1533 ("QoS the network %s is QoS supported\n", 1534 ("QoS the network %s is QoS supported\n",
1534 dst->ssid); 1535 dst->ssid);
1535 else 1536 else
1536 IEEE80211_DEBUG_QOS 1537 LIBIPW_DEBUG_QOS
1537 ("QoS the network is QoS supported\n"); 1538 ("QoS the network is QoS supported\n");
1538 } 1539 }
1539 dst->qos_data.active = qos_active; 1540 dst->qos_data.active = qos_active;
@@ -1547,25 +1548,25 @@ static inline int is_beacon(__le16 fc)
1547 return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON); 1548 return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON);
1548} 1549}
1549 1550
1550static void ieee80211_process_probe_response(struct ieee80211_device 1551static void libipw_process_probe_response(struct libipw_device
1551 *ieee, struct 1552 *ieee, struct
1552 ieee80211_probe_response 1553 libipw_probe_response
1553 *beacon, struct ieee80211_rx_stats 1554 *beacon, struct libipw_rx_stats
1554 *stats) 1555 *stats)
1555{ 1556{
1556 struct net_device *dev = ieee->dev; 1557 struct net_device *dev = ieee->dev;
1557 struct ieee80211_network network = { 1558 struct libipw_network network = {
1558 .ibss_dfs = NULL, 1559 .ibss_dfs = NULL,
1559 }; 1560 };
1560 struct ieee80211_network *target; 1561 struct libipw_network *target;
1561 struct ieee80211_network *oldest = NULL; 1562 struct libipw_network *oldest = NULL;
1562#ifdef CONFIG_LIBIPW_DEBUG 1563#ifdef CONFIG_LIBIPW_DEBUG
1563 struct ieee80211_info_element *info_element = beacon->info_element; 1564 struct libipw_info_element *info_element = beacon->info_element;
1564#endif 1565#endif
1565 unsigned long flags; 1566 unsigned long flags;
1566 DECLARE_SSID_BUF(ssid); 1567 DECLARE_SSID_BUF(ssid);
1567 1568
1568 IEEE80211_DEBUG_SCAN("'%s' (%pM" 1569 LIBIPW_DEBUG_SCAN("'%s' (%pM"
1569 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", 1570 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
1570 print_ssid(ssid, info_element->data, info_element->len), 1571 print_ssid(ssid, info_element->data, info_element->len),
1571 beacon->header.addr3, 1572 beacon->header.addr3,
@@ -1586,8 +1587,8 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1586 (beacon->capability & cpu_to_le16(1 << 0x1)) ? '1' : '0', 1587 (beacon->capability & cpu_to_le16(1 << 0x1)) ? '1' : '0',
1587 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0'); 1588 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0');
1588 1589
1589 if (ieee80211_network_init(ieee, beacon, &network, stats)) { 1590 if (libipw_network_init(ieee, beacon, &network, stats)) {
1590 IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n", 1591 LIBIPW_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
1591 print_ssid(ssid, info_element->data, 1592 print_ssid(ssid, info_element->data,
1592 info_element->len), 1593 info_element->len),
1593 beacon->header.addr3, 1594 beacon->header.addr3,
@@ -1624,21 +1625,21 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1624 /* If there are no more slots, expire the oldest */ 1625 /* If there are no more slots, expire the oldest */
1625 list_del(&oldest->list); 1626 list_del(&oldest->list);
1626 target = oldest; 1627 target = oldest;
1627 IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from " 1628 LIBIPW_DEBUG_SCAN("Expired '%s' (%pM) from "
1628 "network list.\n", 1629 "network list.\n",
1629 print_ssid(ssid, target->ssid, 1630 print_ssid(ssid, target->ssid,
1630 target->ssid_len), 1631 target->ssid_len),
1631 target->bssid); 1632 target->bssid);
1632 ieee80211_network_reset(target); 1633 libipw_network_reset(target);
1633 } else { 1634 } else {
1634 /* Otherwise just pull from the free list */ 1635 /* Otherwise just pull from the free list */
1635 target = list_entry(ieee->network_free_list.next, 1636 target = list_entry(ieee->network_free_list.next,
1636 struct ieee80211_network, list); 1637 struct libipw_network, list);
1637 list_del(ieee->network_free_list.next); 1638 list_del(ieee->network_free_list.next);
1638 } 1639 }
1639 1640
1640#ifdef CONFIG_LIBIPW_DEBUG 1641#ifdef CONFIG_LIBIPW_DEBUG
1641 IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n", 1642 LIBIPW_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
1642 print_ssid(ssid, network.ssid, 1643 print_ssid(ssid, network.ssid,
1643 network.ssid_len), 1644 network.ssid_len),
1644 network.bssid, 1645 network.bssid,
@@ -1649,7 +1650,7 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1649 network.ibss_dfs = NULL; 1650 network.ibss_dfs = NULL;
1650 list_add_tail(&target->list, &ieee->network_list); 1651 list_add_tail(&target->list, &ieee->network_list);
1651 } else { 1652 } else {
1652 IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", 1653 LIBIPW_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
1653 print_ssid(ssid, target->ssid, 1654 print_ssid(ssid, target->ssid,
1654 target->ssid_len), 1655 target->ssid_len),
1655 target->bssid, 1656 target->bssid,
@@ -1670,121 +1671,121 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1670 } 1671 }
1671} 1672}
1672 1673
1673void ieee80211_rx_mgt(struct ieee80211_device *ieee, 1674void libipw_rx_mgt(struct libipw_device *ieee,
1674 struct ieee80211_hdr_4addr *header, 1675 struct libipw_hdr_4addr *header,
1675 struct ieee80211_rx_stats *stats) 1676 struct libipw_rx_stats *stats)
1676{ 1677{
1677 switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) { 1678 switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
1678 case IEEE80211_STYPE_ASSOC_RESP: 1679 case IEEE80211_STYPE_ASSOC_RESP:
1679 IEEE80211_DEBUG_MGMT("received ASSOCIATION RESPONSE (%d)\n", 1680 LIBIPW_DEBUG_MGMT("received ASSOCIATION RESPONSE (%d)\n",
1680 WLAN_FC_GET_STYPE(le16_to_cpu 1681 WLAN_FC_GET_STYPE(le16_to_cpu
1681 (header->frame_ctl))); 1682 (header->frame_ctl)));
1682 ieee80211_handle_assoc_resp(ieee, 1683 libipw_handle_assoc_resp(ieee,
1683 (struct ieee80211_assoc_response *) 1684 (struct libipw_assoc_response *)
1684 header, stats); 1685 header, stats);
1685 break; 1686 break;
1686 1687
1687 case IEEE80211_STYPE_REASSOC_RESP: 1688 case IEEE80211_STYPE_REASSOC_RESP:
1688 IEEE80211_DEBUG_MGMT("received REASSOCIATION RESPONSE (%d)\n", 1689 LIBIPW_DEBUG_MGMT("received REASSOCIATION RESPONSE (%d)\n",
1689 WLAN_FC_GET_STYPE(le16_to_cpu 1690 WLAN_FC_GET_STYPE(le16_to_cpu
1690 (header->frame_ctl))); 1691 (header->frame_ctl)));
1691 break; 1692 break;
1692 1693
1693 case IEEE80211_STYPE_PROBE_REQ: 1694 case IEEE80211_STYPE_PROBE_REQ:
1694 IEEE80211_DEBUG_MGMT("received auth (%d)\n", 1695 LIBIPW_DEBUG_MGMT("received auth (%d)\n",
1695 WLAN_FC_GET_STYPE(le16_to_cpu 1696 WLAN_FC_GET_STYPE(le16_to_cpu
1696 (header->frame_ctl))); 1697 (header->frame_ctl)));
1697 1698
1698 if (ieee->handle_probe_request != NULL) 1699 if (ieee->handle_probe_request != NULL)
1699 ieee->handle_probe_request(ieee->dev, 1700 ieee->handle_probe_request(ieee->dev,
1700 (struct 1701 (struct
1701 ieee80211_probe_request *) 1702 libipw_probe_request *)
1702 header, stats); 1703 header, stats);
1703 break; 1704 break;
1704 1705
1705 case IEEE80211_STYPE_PROBE_RESP: 1706 case IEEE80211_STYPE_PROBE_RESP:
1706 IEEE80211_DEBUG_MGMT("received PROBE RESPONSE (%d)\n", 1707 LIBIPW_DEBUG_MGMT("received PROBE RESPONSE (%d)\n",
1707 WLAN_FC_GET_STYPE(le16_to_cpu 1708 WLAN_FC_GET_STYPE(le16_to_cpu
1708 (header->frame_ctl))); 1709 (header->frame_ctl)));
1709 IEEE80211_DEBUG_SCAN("Probe response\n"); 1710 LIBIPW_DEBUG_SCAN("Probe response\n");
1710 ieee80211_process_probe_response(ieee, 1711 libipw_process_probe_response(ieee,
1711 (struct 1712 (struct
1712 ieee80211_probe_response *) 1713 libipw_probe_response *)
1713 header, stats); 1714 header, stats);
1714 break; 1715 break;
1715 1716
1716 case IEEE80211_STYPE_BEACON: 1717 case IEEE80211_STYPE_BEACON:
1717 IEEE80211_DEBUG_MGMT("received BEACON (%d)\n", 1718 LIBIPW_DEBUG_MGMT("received BEACON (%d)\n",
1718 WLAN_FC_GET_STYPE(le16_to_cpu 1719 WLAN_FC_GET_STYPE(le16_to_cpu
1719 (header->frame_ctl))); 1720 (header->frame_ctl)));
1720 IEEE80211_DEBUG_SCAN("Beacon\n"); 1721 LIBIPW_DEBUG_SCAN("Beacon\n");
1721 ieee80211_process_probe_response(ieee, 1722 libipw_process_probe_response(ieee,
1722 (struct 1723 (struct
1723 ieee80211_probe_response *) 1724 libipw_probe_response *)
1724 header, stats); 1725 header, stats);
1725 break; 1726 break;
1726 case IEEE80211_STYPE_AUTH: 1727 case IEEE80211_STYPE_AUTH:
1727 1728
1728 IEEE80211_DEBUG_MGMT("received auth (%d)\n", 1729 LIBIPW_DEBUG_MGMT("received auth (%d)\n",
1729 WLAN_FC_GET_STYPE(le16_to_cpu 1730 WLAN_FC_GET_STYPE(le16_to_cpu
1730 (header->frame_ctl))); 1731 (header->frame_ctl)));
1731 1732
1732 if (ieee->handle_auth != NULL) 1733 if (ieee->handle_auth != NULL)
1733 ieee->handle_auth(ieee->dev, 1734 ieee->handle_auth(ieee->dev,
1734 (struct ieee80211_auth *)header); 1735 (struct libipw_auth *)header);
1735 break; 1736 break;
1736 1737
1737 case IEEE80211_STYPE_DISASSOC: 1738 case IEEE80211_STYPE_DISASSOC:
1738 if (ieee->handle_disassoc != NULL) 1739 if (ieee->handle_disassoc != NULL)
1739 ieee->handle_disassoc(ieee->dev, 1740 ieee->handle_disassoc(ieee->dev,
1740 (struct ieee80211_disassoc *) 1741 (struct libipw_disassoc *)
1741 header); 1742 header);
1742 break; 1743 break;
1743 1744
1744 case IEEE80211_STYPE_ACTION: 1745 case IEEE80211_STYPE_ACTION:
1745 IEEE80211_DEBUG_MGMT("ACTION\n"); 1746 LIBIPW_DEBUG_MGMT("ACTION\n");
1746 if (ieee->handle_action) 1747 if (ieee->handle_action)
1747 ieee->handle_action(ieee->dev, 1748 ieee->handle_action(ieee->dev,
1748 (struct ieee80211_action *) 1749 (struct libipw_action *)
1749 header, stats); 1750 header, stats);
1750 break; 1751 break;
1751 1752
1752 case IEEE80211_STYPE_REASSOC_REQ: 1753 case IEEE80211_STYPE_REASSOC_REQ:
1753 IEEE80211_DEBUG_MGMT("received reassoc (%d)\n", 1754 LIBIPW_DEBUG_MGMT("received reassoc (%d)\n",
1754 WLAN_FC_GET_STYPE(le16_to_cpu 1755 WLAN_FC_GET_STYPE(le16_to_cpu
1755 (header->frame_ctl))); 1756 (header->frame_ctl)));
1756 1757
1757 IEEE80211_DEBUG_MGMT("%s: IEEE80211_REASSOC_REQ received\n", 1758 LIBIPW_DEBUG_MGMT("%s: LIBIPW_REASSOC_REQ received\n",
1758 ieee->dev->name); 1759 ieee->dev->name);
1759 if (ieee->handle_reassoc_request != NULL) 1760 if (ieee->handle_reassoc_request != NULL)
1760 ieee->handle_reassoc_request(ieee->dev, 1761 ieee->handle_reassoc_request(ieee->dev,
1761 (struct ieee80211_reassoc_request *) 1762 (struct libipw_reassoc_request *)
1762 header); 1763 header);
1763 break; 1764 break;
1764 1765
1765 case IEEE80211_STYPE_ASSOC_REQ: 1766 case IEEE80211_STYPE_ASSOC_REQ:
1766 IEEE80211_DEBUG_MGMT("received assoc (%d)\n", 1767 LIBIPW_DEBUG_MGMT("received assoc (%d)\n",
1767 WLAN_FC_GET_STYPE(le16_to_cpu 1768 WLAN_FC_GET_STYPE(le16_to_cpu
1768 (header->frame_ctl))); 1769 (header->frame_ctl)));
1769 1770
1770 IEEE80211_DEBUG_MGMT("%s: IEEE80211_ASSOC_REQ received\n", 1771 LIBIPW_DEBUG_MGMT("%s: LIBIPW_ASSOC_REQ received\n",
1771 ieee->dev->name); 1772 ieee->dev->name);
1772 if (ieee->handle_assoc_request != NULL) 1773 if (ieee->handle_assoc_request != NULL)
1773 ieee->handle_assoc_request(ieee->dev); 1774 ieee->handle_assoc_request(ieee->dev);
1774 break; 1775 break;
1775 1776
1776 case IEEE80211_STYPE_DEAUTH: 1777 case IEEE80211_STYPE_DEAUTH:
1777 IEEE80211_DEBUG_MGMT("DEAUTH\n"); 1778 LIBIPW_DEBUG_MGMT("DEAUTH\n");
1778 if (ieee->handle_deauth != NULL) 1779 if (ieee->handle_deauth != NULL)
1779 ieee->handle_deauth(ieee->dev, 1780 ieee->handle_deauth(ieee->dev,
1780 (struct ieee80211_deauth *) 1781 (struct libipw_deauth *)
1781 header); 1782 header);
1782 break; 1783 break;
1783 default: 1784 default:
1784 IEEE80211_DEBUG_MGMT("received UNKNOWN (%d)\n", 1785 LIBIPW_DEBUG_MGMT("received UNKNOWN (%d)\n",
1785 WLAN_FC_GET_STYPE(le16_to_cpu 1786 WLAN_FC_GET_STYPE(le16_to_cpu
1786 (header->frame_ctl))); 1787 (header->frame_ctl)));
1787 IEEE80211_DEBUG_MGMT("%s: Unknown management packet: %d\n", 1788 LIBIPW_DEBUG_MGMT("%s: Unknown management packet: %d\n",
1788 ieee->dev->name, 1789 ieee->dev->name,
1789 WLAN_FC_GET_STYPE(le16_to_cpu 1790 WLAN_FC_GET_STYPE(le16_to_cpu
1790 (header->frame_ctl))); 1791 (header->frame_ctl)));
@@ -1792,6 +1793,6 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee,
1792 } 1793 }
1793} 1794}
1794 1795
1795EXPORT_SYMBOL_GPL(ieee80211_rx_any); 1796EXPORT_SYMBOL_GPL(libipw_rx_any);
1796EXPORT_SYMBOL(ieee80211_rx_mgt); 1797EXPORT_SYMBOL(libipw_rx_mgt);
1797EXPORT_SYMBOL(ieee80211_rx); 1798EXPORT_SYMBOL(libipw_rx);
diff --git a/drivers/net/wireless/ipw2x00/libipw_tx.c b/drivers/net/wireless/ipw2x00/libipw_tx.c
index 2e8f84fb29fa..ce1855f32b7d 100644
--- a/drivers/net/wireless/ipw2x00/libipw_tx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_tx.c
@@ -41,7 +41,7 @@
41#include <linux/etherdevice.h> 41#include <linux/etherdevice.h>
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43 43
44#include "ieee80211.h" 44#include "libipw.h"
45 45
46/* 46/*
47 47
@@ -126,12 +126,12 @@ payload of each frame is reduced to 492 bytes.
126static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 }; 126static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };
127static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 }; 127static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };
128 128
129static int ieee80211_copy_snap(u8 * data, __be16 h_proto) 129static int libipw_copy_snap(u8 * data, __be16 h_proto)
130{ 130{
131 struct ieee80211_snap_hdr *snap; 131 struct libipw_snap_hdr *snap;
132 u8 *oui; 132 u8 *oui;
133 133
134 snap = (struct ieee80211_snap_hdr *)data; 134 snap = (struct libipw_snap_hdr *)data;
135 snap->dsap = 0xaa; 135 snap->dsap = 0xaa;
136 snap->ssap = 0xaa; 136 snap->ssap = 0xaa;
137 snap->ctrl = 0x03; 137 snap->ctrl = 0x03;
@@ -149,7 +149,7 @@ static int ieee80211_copy_snap(u8 * data, __be16 h_proto)
149 return SNAP_SIZE + sizeof(u16); 149 return SNAP_SIZE + sizeof(u16);
150} 150}
151 151
152static int ieee80211_encrypt_fragment(struct ieee80211_device *ieee, 152static int libipw_encrypt_fragment(struct libipw_device *ieee,
153 struct sk_buff *frag, int hdr_len) 153 struct sk_buff *frag, int hdr_len)
154{ 154{
155 struct lib80211_crypt_data *crypt = 155 struct lib80211_crypt_data *crypt =
@@ -177,7 +177,7 @@ static int ieee80211_encrypt_fragment(struct ieee80211_device *ieee,
177 return 0; 177 return 0;
178} 178}
179 179
180void ieee80211_txb_free(struct ieee80211_txb *txb) 180void libipw_txb_free(struct libipw_txb *txb)
181{ 181{
182 int i; 182 int i;
183 if (unlikely(!txb)) 183 if (unlikely(!txb))
@@ -188,17 +188,17 @@ void ieee80211_txb_free(struct ieee80211_txb *txb)
188 kfree(txb); 188 kfree(txb);
189} 189}
190 190
191static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size, 191static struct libipw_txb *libipw_alloc_txb(int nr_frags, int txb_size,
192 int headroom, gfp_t gfp_mask) 192 int headroom, gfp_t gfp_mask)
193{ 193{
194 struct ieee80211_txb *txb; 194 struct libipw_txb *txb;
195 int i; 195 int i;
196 txb = kmalloc(sizeof(struct ieee80211_txb) + (sizeof(u8 *) * nr_frags), 196 txb = kmalloc(sizeof(struct libipw_txb) + (sizeof(u8 *) * nr_frags),
197 gfp_mask); 197 gfp_mask);
198 if (!txb) 198 if (!txb)
199 return NULL; 199 return NULL;
200 200
201 memset(txb, 0, sizeof(struct ieee80211_txb)); 201 memset(txb, 0, sizeof(struct libipw_txb));
202 txb->nr_frags = nr_frags; 202 txb->nr_frags = nr_frags;
203 txb->frag_size = txb_size; 203 txb->frag_size = txb_size;
204 204
@@ -220,7 +220,7 @@ static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size,
220 return txb; 220 return txb;
221} 221}
222 222
223static int ieee80211_classify(struct sk_buff *skb) 223static int libipw_classify(struct sk_buff *skb)
224{ 224{
225 struct ethhdr *eth; 225 struct ethhdr *eth;
226 struct iphdr *ip; 226 struct iphdr *ip;
@@ -252,11 +252,11 @@ static int ieee80211_classify(struct sk_buff *skb)
252 252
253/* Incoming skb is converted to a txb which consists of 253/* Incoming skb is converted to a txb which consists of
254 * a block of 802.11 fragment packets (stored as skbs) */ 254 * a block of 802.11 fragment packets (stored as skbs) */
255int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) 255int libipw_xmit(struct sk_buff *skb, struct net_device *dev)
256{ 256{
257 struct ieee80211_device *ieee = netdev_priv(dev); 257 struct libipw_device *ieee = netdev_priv(dev);
258 struct ieee80211_txb *txb = NULL; 258 struct libipw_txb *txb = NULL;
259 struct ieee80211_hdr_3addrqos *frag_hdr; 259 struct libipw_hdr_3addrqos *frag_hdr;
260 int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size, 260 int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size,
261 rts_required; 261 rts_required;
262 unsigned long flags; 262 unsigned long flags;
@@ -264,7 +264,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
264 __be16 ether_type; 264 __be16 ether_type;
265 int bytes, fc, hdr_len; 265 int bytes, fc, hdr_len;
266 struct sk_buff *skb_frag; 266 struct sk_buff *skb_frag;
267 struct ieee80211_hdr_3addrqos header = {/* Ensure zero initialized */ 267 struct libipw_hdr_3addrqos header = {/* Ensure zero initialized */
268 .duration_id = 0, 268 .duration_id = 0,
269 .seq_ctl = 0, 269 .seq_ctl = 0,
270 .qos_ctl = 0 270 .qos_ctl = 0
@@ -331,14 +331,14 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
331 memcpy(header.addr2, src, ETH_ALEN); 331 memcpy(header.addr2, src, ETH_ALEN);
332 memcpy(header.addr3, ieee->bssid, ETH_ALEN); 332 memcpy(header.addr3, ieee->bssid, ETH_ALEN);
333 } 333 }
334 hdr_len = IEEE80211_3ADDR_LEN; 334 hdr_len = LIBIPW_3ADDR_LEN;
335 335
336 if (ieee->is_qos_active && ieee->is_qos_active(dev, skb)) { 336 if (ieee->is_qos_active && ieee->is_qos_active(dev, skb)) {
337 fc |= IEEE80211_STYPE_QOS_DATA; 337 fc |= IEEE80211_STYPE_QOS_DATA;
338 hdr_len += 2; 338 hdr_len += 2;
339 339
340 skb->priority = ieee80211_classify(skb); 340 skb->priority = libipw_classify(skb);
341 header.qos_ctl |= cpu_to_le16(skb->priority & IEEE80211_QCTL_TID); 341 header.qos_ctl |= cpu_to_le16(skb->priority & LIBIPW_QCTL_TID);
342 } 342 }
343 header.frame_ctl = cpu_to_le16(fc); 343 header.frame_ctl = cpu_to_le16(fc);
344 344
@@ -362,12 +362,12 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
362 skb_reserve(skb_new, crypt->ops->extra_msdu_prefix_len); 362 skb_reserve(skb_new, crypt->ops->extra_msdu_prefix_len);
363 memcpy(skb_put(skb_new, hdr_len), &header, hdr_len); 363 memcpy(skb_put(skb_new, hdr_len), &header, hdr_len);
364 snapped = 1; 364 snapped = 1;
365 ieee80211_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)), 365 libipw_copy_snap(skb_put(skb_new, SNAP_SIZE + sizeof(u16)),
366 ether_type); 366 ether_type);
367 skb_copy_from_linear_data(skb, skb_put(skb_new, skb->len), skb->len); 367 skb_copy_from_linear_data(skb, skb_put(skb_new, skb->len), skb->len);
368 res = crypt->ops->encrypt_msdu(skb_new, hdr_len, crypt->priv); 368 res = crypt->ops->encrypt_msdu(skb_new, hdr_len, crypt->priv);
369 if (res < 0) { 369 if (res < 0) {
370 IEEE80211_ERROR("msdu encryption failed\n"); 370 LIBIPW_ERROR("msdu encryption failed\n");
371 dev_kfree_skb_any(skb_new); 371 dev_kfree_skb_any(skb_new);
372 goto failed; 372 goto failed;
373 } 373 }
@@ -393,8 +393,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
393 * for it when determining the amount of payload space. */ 393 * for it when determining the amount of payload space. */
394 bytes_per_frag = frag_size - hdr_len; 394 bytes_per_frag = frag_size - hdr_len;
395 if (ieee->config & 395 if (ieee->config &
396 (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) 396 (CFG_LIBIPW_COMPUTE_FCS | CFG_LIBIPW_RESERVE_FCS))
397 bytes_per_frag -= IEEE80211_FCS_LEN; 397 bytes_per_frag -= LIBIPW_FCS_LEN;
398 398
399 /* Each fragment may need to have room for encryptiong 399 /* Each fragment may need to have room for encryptiong
400 * pre/postfix */ 400 * pre/postfix */
@@ -417,14 +417,14 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
417 } 417 }
418 418
419 rts_required = (frag_size > ieee->rts 419 rts_required = (frag_size > ieee->rts
420 && ieee->config & CFG_IEEE80211_RTS); 420 && ieee->config & CFG_LIBIPW_RTS);
421 if (rts_required) 421 if (rts_required)
422 nr_frags++; 422 nr_frags++;
423 423
424 /* When we allocate the TXB we allocate enough space for the reserve 424 /* When we allocate the TXB we allocate enough space for the reserve
425 * and full fragment bytes (bytes_per_frag doesn't include prefix, 425 * and full fragment bytes (bytes_per_frag doesn't include prefix,
426 * postfix, header, FCS, etc.) */ 426 * postfix, header, FCS, etc.) */
427 txb = ieee80211_alloc_txb(nr_frags, frag_size, 427 txb = libipw_alloc_txb(nr_frags, frag_size,
428 ieee->tx_headroom, GFP_ATOMIC); 428 ieee->tx_headroom, GFP_ATOMIC);
429 if (unlikely(!txb)) { 429 if (unlikely(!txb)) {
430 printk(KERN_WARNING "%s: Could not allocate TXB\n", 430 printk(KERN_WARNING "%s: Could not allocate TXB\n",
@@ -441,7 +441,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
441 if (rts_required) { 441 if (rts_required) {
442 skb_frag = txb->fragments[0]; 442 skb_frag = txb->fragments[0];
443 frag_hdr = 443 frag_hdr =
444 (struct ieee80211_hdr_3addrqos *)skb_put(skb_frag, hdr_len); 444 (struct libipw_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
445 445
446 /* 446 /*
447 * Set header frame_ctl to the RTS. 447 * Set header frame_ctl to the RTS.
@@ -456,7 +456,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
456 header.frame_ctl = cpu_to_le16(fc); 456 header.frame_ctl = cpu_to_le16(fc);
457 457
458 if (ieee->config & 458 if (ieee->config &
459 (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) 459 (CFG_LIBIPW_COMPUTE_FCS | CFG_LIBIPW_RESERVE_FCS))
460 skb_put(skb_frag, 4); 460 skb_put(skb_frag, 4);
461 461
462 txb->rts_included = 1; 462 txb->rts_included = 1;
@@ -472,7 +472,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
472 crypt->ops->extra_mpdu_prefix_len); 472 crypt->ops->extra_mpdu_prefix_len);
473 473
474 frag_hdr = 474 frag_hdr =
475 (struct ieee80211_hdr_3addrqos *)skb_put(skb_frag, hdr_len); 475 (struct libipw_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
476 memcpy(frag_hdr, &header, hdr_len); 476 memcpy(frag_hdr, &header, hdr_len);
477 477
478 /* If this is not the last fragment, then add the MOREFRAGS 478 /* If this is not the last fragment, then add the MOREFRAGS
@@ -487,7 +487,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
487 } 487 }
488 488
489 if (i == 0 && !snapped) { 489 if (i == 0 && !snapped) {
490 ieee80211_copy_snap(skb_put 490 libipw_copy_snap(skb_put
491 (skb_frag, SNAP_SIZE + sizeof(u16)), 491 (skb_frag, SNAP_SIZE + sizeof(u16)),
492 ether_type); 492 ether_type);
493 bytes -= SNAP_SIZE + sizeof(u16); 493 bytes -= SNAP_SIZE + sizeof(u16);
@@ -501,7 +501,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
501 /* Encryption routine will move the header forward in order 501 /* Encryption routine will move the header forward in order
502 * to insert the IV between the header and the payload */ 502 * to insert the IV between the header and the payload */
503 if (host_encrypt) 503 if (host_encrypt)
504 ieee80211_encrypt_fragment(ieee, skb_frag, hdr_len); 504 libipw_encrypt_fragment(ieee, skb_frag, hdr_len);
505 else if (host_build_iv) { 505 else if (host_build_iv) {
506 atomic_inc(&crypt->refcnt); 506 atomic_inc(&crypt->refcnt);
507 if (crypt->ops->build_iv) 507 if (crypt->ops->build_iv)
@@ -513,7 +513,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
513 } 513 }
514 514
515 if (ieee->config & 515 if (ieee->config &
516 (CFG_IEEE80211_COMPUTE_FCS | CFG_IEEE80211_RESERVE_FCS)) 516 (CFG_LIBIPW_COMPUTE_FCS | CFG_LIBIPW_RESERVE_FCS))
517 skb_put(skb_frag, 4); 517 skb_put(skb_frag, 4);
518 } 518 }
519 519
@@ -530,7 +530,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
530 return NETDEV_TX_OK; 530 return NETDEV_TX_OK;
531 } 531 }
532 532
533 ieee80211_txb_free(txb); 533 libipw_txb_free(txb);
534 } 534 }
535 535
536 return NETDEV_TX_OK; 536 return NETDEV_TX_OK;
@@ -541,6 +541,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
541 dev->stats.tx_errors++; 541 dev->stats.tx_errors++;
542 return NETDEV_TX_BUSY; 542 return NETDEV_TX_BUSY;
543} 543}
544EXPORT_SYMBOL(ieee80211_xmit); 544EXPORT_SYMBOL(libipw_xmit);
545 545
546EXPORT_SYMBOL(ieee80211_txb_free); 546EXPORT_SYMBOL(libipw_txb_free);
diff --git a/drivers/net/wireless/ipw2x00/libipw_wx.c b/drivers/net/wireless/ipw2x00/libipw_wx.c
index 3c0812db030a..f79ce57ebe68 100644
--- a/drivers/net/wireless/ipw2x00/libipw_wx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_wx.c
@@ -37,9 +37,9 @@
37#include <net/lib80211.h> 37#include <net/lib80211.h>
38#include <linux/wireless.h> 38#include <linux/wireless.h>
39 39
40#include "ieee80211.h" 40#include "libipw.h"
41 41
42static const char *ieee80211_modes[] = { 42static const char *libipw_modes[] = {
43 "?", "a", "b", "ab", "g", "ag", "bg", "abg" 43 "?", "a", "b", "ab", "g", "ag", "bg", "abg"
44}; 44};
45 45
@@ -54,9 +54,9 @@ static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
54} 54}
55 55
56#define MAX_CUSTOM_LEN 64 56#define MAX_CUSTOM_LEN 64
57static char *ieee80211_translate_scan(struct ieee80211_device *ieee, 57static char *libipw_translate_scan(struct libipw_device *ieee,
58 char *start, char *stop, 58 char *start, char *stop,
59 struct ieee80211_network *network, 59 struct libipw_network *network,
60 struct iw_request_info *info) 60 struct iw_request_info *info)
61{ 61{
62 char custom[MAX_CUSTOM_LEN]; 62 char custom[MAX_CUSTOM_LEN];
@@ -84,7 +84,7 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
84 /* Add the protocol name */ 84 /* Add the protocol name */
85 iwe.cmd = SIOCGIWNAME; 85 iwe.cmd = SIOCGIWNAME;
86 snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11%s", 86 snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11%s",
87 ieee80211_modes[network->mode]); 87 libipw_modes[network->mode]);
88 start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_CHAR_LEN); 88 start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_CHAR_LEN);
89 89
90 /* Add mode */ 90 /* Add mode */
@@ -102,7 +102,7 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
102 /* Add channel and frequency */ 102 /* Add channel and frequency */
103 /* Note : userspace automatically computes channel using iwrange */ 103 /* Note : userspace automatically computes channel using iwrange */
104 iwe.cmd = SIOCGIWFREQ; 104 iwe.cmd = SIOCGIWFREQ;
105 iwe.u.freq.m = ieee80211_channel_to_freq(ieee, network->channel); 105 iwe.u.freq.m = libipw_channel_to_freq(ieee, network->channel);
106 iwe.u.freq.e = 6; 106 iwe.u.freq.e = 6;
107 iwe.u.freq.i = 0; 107 iwe.u.freq.i = 0;
108 start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_FREQ_LEN); 108 start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_FREQ_LEN);
@@ -155,7 +155,7 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
155 iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | 155 iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED |
156 IW_QUAL_NOISE_UPDATED; 156 IW_QUAL_NOISE_UPDATED;
157 157
158 if (!(network->stats.mask & IEEE80211_STATMASK_RSSI)) { 158 if (!(network->stats.mask & LIBIPW_STATMASK_RSSI)) {
159 iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID | 159 iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID |
160 IW_QUAL_LEVEL_INVALID; 160 IW_QUAL_LEVEL_INVALID;
161 iwe.u.qual.qual = 0; 161 iwe.u.qual.qual = 0;
@@ -180,14 +180,14 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
180 iwe.u.qual.qual = 0; 180 iwe.u.qual.qual = 0;
181 } 181 }
182 182
183 if (!(network->stats.mask & IEEE80211_STATMASK_NOISE)) { 183 if (!(network->stats.mask & LIBIPW_STATMASK_NOISE)) {
184 iwe.u.qual.updated |= IW_QUAL_NOISE_INVALID; 184 iwe.u.qual.updated |= IW_QUAL_NOISE_INVALID;
185 iwe.u.qual.noise = 0; 185 iwe.u.qual.noise = 0;
186 } else { 186 } else {
187 iwe.u.qual.noise = network->stats.noise; 187 iwe.u.qual.noise = network->stats.noise;
188 } 188 }
189 189
190 if (!(network->stats.mask & IEEE80211_STATMASK_SIGNAL)) { 190 if (!(network->stats.mask & LIBIPW_STATMASK_SIGNAL)) {
191 iwe.u.qual.updated |= IW_QUAL_LEVEL_INVALID; 191 iwe.u.qual.updated |= IW_QUAL_LEVEL_INVALID;
192 iwe.u.qual.level = 0; 192 iwe.u.qual.level = 0;
193 } else { 193 } else {
@@ -237,14 +237,14 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
237 p = custom; 237 p = custom;
238 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), " Channel flags: "); 238 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), " Channel flags: ");
239 239
240 if (ieee80211_get_channel_flags(ieee, network->channel) & 240 if (libipw_get_channel_flags(ieee, network->channel) &
241 IEEE80211_CH_INVALID) { 241 LIBIPW_CH_INVALID) {
242 iwe.cmd = IWEVCUSTOM; 242 iwe.cmd = IWEVCUSTOM;
243 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), "INVALID "); 243 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), "INVALID ");
244 } 244 }
245 245
246 if (ieee80211_get_channel_flags(ieee, network->channel) & 246 if (libipw_get_channel_flags(ieee, network->channel) &
247 IEEE80211_CH_RADAR_DETECT) { 247 LIBIPW_CH_RADAR_DETECT) {
248 iwe.cmd = IWEVCUSTOM; 248 iwe.cmd = IWEVCUSTOM;
249 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), "DFS "); 249 p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), "DFS ");
250 } 250 }
@@ -259,11 +259,11 @@ static char *ieee80211_translate_scan(struct ieee80211_device *ieee,
259 259
260#define SCAN_ITEM_SIZE 128 260#define SCAN_ITEM_SIZE 128
261 261
262int ieee80211_wx_get_scan(struct ieee80211_device *ieee, 262int libipw_wx_get_scan(struct libipw_device *ieee,
263 struct iw_request_info *info, 263 struct iw_request_info *info,
264 union iwreq_data *wrqu, char *extra) 264 union iwreq_data *wrqu, char *extra)
265{ 265{
266 struct ieee80211_network *network; 266 struct libipw_network *network;
267 unsigned long flags; 267 unsigned long flags;
268 int err = 0; 268 int err = 0;
269 269
@@ -272,7 +272,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
272 int i = 0; 272 int i = 0;
273 DECLARE_SSID_BUF(ssid); 273 DECLARE_SSID_BUF(ssid);
274 274
275 IEEE80211_DEBUG_WX("Getting scan\n"); 275 LIBIPW_DEBUG_WX("Getting scan\n");
276 276
277 spin_lock_irqsave(&ieee->lock, flags); 277 spin_lock_irqsave(&ieee->lock, flags);
278 278
@@ -285,10 +285,10 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
285 285
286 if (ieee->scan_age == 0 || 286 if (ieee->scan_age == 0 ||
287 time_after(network->last_scanned + ieee->scan_age, jiffies)) 287 time_after(network->last_scanned + ieee->scan_age, jiffies))
288 ev = ieee80211_translate_scan(ieee, ev, stop, network, 288 ev = libipw_translate_scan(ieee, ev, stop, network,
289 info); 289 info);
290 else { 290 else {
291 IEEE80211_DEBUG_SCAN("Not showing network '%s (" 291 LIBIPW_DEBUG_SCAN("Not showing network '%s ("
292 "%pM)' due to age (%ums).\n", 292 "%pM)' due to age (%ums).\n",
293 print_ssid(ssid, network->ssid, 293 print_ssid(ssid, network->ssid,
294 network->ssid_len), 294 network->ssid_len),
@@ -303,18 +303,18 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
303 wrqu->data.length = ev - extra; 303 wrqu->data.length = ev - extra;
304 wrqu->data.flags = 0; 304 wrqu->data.flags = 0;
305 305
306 IEEE80211_DEBUG_WX("exit: %d networks returned.\n", i); 306 LIBIPW_DEBUG_WX("exit: %d networks returned.\n", i);
307 307
308 return err; 308 return err;
309} 309}
310 310
311int ieee80211_wx_set_encode(struct ieee80211_device *ieee, 311int libipw_wx_set_encode(struct libipw_device *ieee,
312 struct iw_request_info *info, 312 struct iw_request_info *info,
313 union iwreq_data *wrqu, char *keybuf) 313 union iwreq_data *wrqu, char *keybuf)
314{ 314{
315 struct iw_point *erq = &(wrqu->encoding); 315 struct iw_point *erq = &(wrqu->encoding);
316 struct net_device *dev = ieee->dev; 316 struct net_device *dev = ieee->dev;
317 struct ieee80211_security sec = { 317 struct libipw_security sec = {
318 .flags = 0 318 .flags = 0
319 }; 319 };
320 int i, key, key_provided, len; 320 int i, key, key_provided, len;
@@ -322,7 +322,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
322 int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv; 322 int host_crypto = ieee->host_encrypt || ieee->host_decrypt || ieee->host_build_iv;
323 DECLARE_SSID_BUF(ssid); 323 DECLARE_SSID_BUF(ssid);
324 324
325 IEEE80211_DEBUG_WX("SET_ENCODE\n"); 325 LIBIPW_DEBUG_WX("SET_ENCODE\n");
326 326
327 key = erq->flags & IW_ENCODE_INDEX; 327 key = erq->flags & IW_ENCODE_INDEX;
328 if (key) { 328 if (key) {
@@ -335,18 +335,18 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
335 key = ieee->crypt_info.tx_keyidx; 335 key = ieee->crypt_info.tx_keyidx;
336 } 336 }
337 337
338 IEEE80211_DEBUG_WX("Key: %d [%s]\n", key, key_provided ? 338 LIBIPW_DEBUG_WX("Key: %d [%s]\n", key, key_provided ?
339 "provided" : "default"); 339 "provided" : "default");
340 340
341 crypt = &ieee->crypt_info.crypt[key]; 341 crypt = &ieee->crypt_info.crypt[key];
342 342
343 if (erq->flags & IW_ENCODE_DISABLED) { 343 if (erq->flags & IW_ENCODE_DISABLED) {
344 if (key_provided && *crypt) { 344 if (key_provided && *crypt) {
345 IEEE80211_DEBUG_WX("Disabling encryption on key %d.\n", 345 LIBIPW_DEBUG_WX("Disabling encryption on key %d.\n",
346 key); 346 key);
347 lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt); 347 lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
348 } else 348 } else
349 IEEE80211_DEBUG_WX("Disabling encryption.\n"); 349 LIBIPW_DEBUG_WX("Disabling encryption.\n");
350 350
351 /* Check all the keys to see if any are still configured, 351 /* Check all the keys to see if any are still configured,
352 * and if no key index was provided, de-init them all */ 352 * and if no key index was provided, de-init them all */
@@ -410,7 +410,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
410 410
411 /* If a new key was provided, set it up */ 411 /* If a new key was provided, set it up */
412 if (erq->length > 0) { 412 if (erq->length > 0) {
413#ifdef CONFIG_IEEE80211_DEBUG 413#ifdef CONFIG_LIBIPW_DEBUG
414 DECLARE_SSID_BUF(ssid); 414 DECLARE_SSID_BUF(ssid);
415#endif 415#endif
416 416
@@ -419,7 +419,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
419 if (len > erq->length) 419 if (len > erq->length)
420 memset(sec.keys[key] + erq->length, 0, 420 memset(sec.keys[key] + erq->length, 0,
421 len - erq->length); 421 len - erq->length);
422 IEEE80211_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n", 422 LIBIPW_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n",
423 key, print_ssid(ssid, sec.keys[key], len), 423 key, print_ssid(ssid, sec.keys[key], len),
424 erq->length, len); 424 erq->length, len);
425 sec.key_sizes[key] = len; 425 sec.key_sizes[key] = len;
@@ -438,7 +438,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
438 NULL, (*crypt)->priv); 438 NULL, (*crypt)->priv);
439 if (len == 0) { 439 if (len == 0) {
440 /* Set a default key of all 0 */ 440 /* Set a default key of all 0 */
441 IEEE80211_DEBUG_WX("Setting key %d to all " 441 LIBIPW_DEBUG_WX("Setting key %d to all "
442 "zero.\n", key); 442 "zero.\n", key);
443 memset(sec.keys[key], 0, 13); 443 memset(sec.keys[key], 0, 13);
444 (*crypt)->ops->set_key(sec.keys[key], 13, NULL, 444 (*crypt)->ops->set_key(sec.keys[key], 13, NULL,
@@ -449,7 +449,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
449 } 449 }
450 /* No key data - just set the default TX key index */ 450 /* No key data - just set the default TX key index */
451 if (key_provided) { 451 if (key_provided) {
452 IEEE80211_DEBUG_WX("Setting key %d to default Tx " 452 LIBIPW_DEBUG_WX("Setting key %d to default Tx "
453 "key.\n", key); 453 "key.\n", key);
454 ieee->crypt_info.tx_keyidx = key; 454 ieee->crypt_info.tx_keyidx = key;
455 sec.active_key = key; 455 sec.active_key = key;
@@ -461,7 +461,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
461 sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : 461 sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN :
462 WLAN_AUTH_SHARED_KEY; 462 WLAN_AUTH_SHARED_KEY;
463 sec.flags |= SEC_AUTH_MODE; 463 sec.flags |= SEC_AUTH_MODE;
464 IEEE80211_DEBUG_WX("Auth: %s\n", 464 LIBIPW_DEBUG_WX("Auth: %s\n",
465 sec.auth_mode == WLAN_AUTH_OPEN ? 465 sec.auth_mode == WLAN_AUTH_OPEN ?
466 "OPEN" : "SHARED KEY"); 466 "OPEN" : "SHARED KEY");
467 } 467 }
@@ -490,16 +490,16 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
490 return 0; 490 return 0;
491} 491}
492 492
493int ieee80211_wx_get_encode(struct ieee80211_device *ieee, 493int libipw_wx_get_encode(struct libipw_device *ieee,
494 struct iw_request_info *info, 494 struct iw_request_info *info,
495 union iwreq_data *wrqu, char *keybuf) 495 union iwreq_data *wrqu, char *keybuf)
496{ 496{
497 struct iw_point *erq = &(wrqu->encoding); 497 struct iw_point *erq = &(wrqu->encoding);
498 int len, key; 498 int len, key;
499 struct lib80211_crypt_data *crypt; 499 struct lib80211_crypt_data *crypt;
500 struct ieee80211_security *sec = &ieee->sec; 500 struct libipw_security *sec = &ieee->sec;
501 501
502 IEEE80211_DEBUG_WX("GET_ENCODE\n"); 502 LIBIPW_DEBUG_WX("GET_ENCODE\n");
503 503
504 key = erq->flags & IW_ENCODE_INDEX; 504 key = erq->flags & IW_ENCODE_INDEX;
505 if (key) { 505 if (key) {
@@ -532,7 +532,7 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
532 return 0; 532 return 0;
533} 533}
534 534
535int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, 535int libipw_wx_set_encodeext(struct libipw_device *ieee,
536 struct iw_request_info *info, 536 struct iw_request_info *info,
537 union iwreq_data *wrqu, char *extra) 537 union iwreq_data *wrqu, char *extra)
538{ 538{
@@ -545,7 +545,7 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
545 struct lib80211_crypto_ops *ops; 545 struct lib80211_crypto_ops *ops;
546 struct lib80211_crypt_data **crypt; 546 struct lib80211_crypt_data **crypt;
547 547
548 struct ieee80211_security sec = { 548 struct libipw_security sec = {
549 .flags = 0, 549 .flags = 0,
550 }; 550 };
551 551
@@ -611,7 +611,7 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
611 module = "lib80211_crypt_ccmp"; 611 module = "lib80211_crypt_ccmp";
612 break; 612 break;
613 default: 613 default:
614 IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", 614 LIBIPW_DEBUG_WX("%s: unknown crypto alg %d\n",
615 dev->name, ext->alg); 615 dev->name, ext->alg);
616 ret = -EINVAL; 616 ret = -EINVAL;
617 goto done; 617 goto done;
@@ -623,7 +623,7 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
623 ops = lib80211_get_crypto_ops(alg); 623 ops = lib80211_get_crypto_ops(alg);
624 } 624 }
625 if (ops == NULL) { 625 if (ops == NULL) {
626 IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", 626 LIBIPW_DEBUG_WX("%s: unknown crypto alg %d\n",
627 dev->name, ext->alg); 627 dev->name, ext->alg);
628 ret = -EINVAL; 628 ret = -EINVAL;
629 goto done; 629 goto done;
@@ -653,7 +653,7 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
653 if (ext->key_len > 0 && (*crypt)->ops->set_key && 653 if (ext->key_len > 0 && (*crypt)->ops->set_key &&
654 (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq, 654 (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq,
655 (*crypt)->priv) < 0) { 655 (*crypt)->priv) < 0) {
656 IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name); 656 LIBIPW_DEBUG_WX("%s: key setting failed\n", dev->name);
657 ret = -EINVAL; 657 ret = -EINVAL;
658 goto done; 658 goto done;
659 } 659 }
@@ -700,20 +700,20 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
700 if (ieee->reset_on_keychange && 700 if (ieee->reset_on_keychange &&
701 ieee->iw_mode != IW_MODE_INFRA && 701 ieee->iw_mode != IW_MODE_INFRA &&
702 ieee->reset_port && ieee->reset_port(dev)) { 702 ieee->reset_port && ieee->reset_port(dev)) {
703 IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); 703 LIBIPW_DEBUG_WX("%s: reset_port failed\n", dev->name);
704 return -EINVAL; 704 return -EINVAL;
705 } 705 }
706 706
707 return ret; 707 return ret;
708} 708}
709 709
710int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, 710int libipw_wx_get_encodeext(struct libipw_device *ieee,
711 struct iw_request_info *info, 711 struct iw_request_info *info,
712 union iwreq_data *wrqu, char *extra) 712 union iwreq_data *wrqu, char *extra)
713{ 713{
714 struct iw_point *encoding = &wrqu->encoding; 714 struct iw_point *encoding = &wrqu->encoding;
715 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 715 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
716 struct ieee80211_security *sec = &ieee->sec; 716 struct libipw_security *sec = &ieee->sec;
717 int idx, max_key_len; 717 int idx, max_key_len;
718 718
719 max_key_len = encoding->length - sizeof(*ext); 719 max_key_len = encoding->length - sizeof(*ext);
@@ -763,9 +763,9 @@ int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee,
763 return 0; 763 return 0;
764} 764}
765 765
766EXPORT_SYMBOL(ieee80211_wx_set_encodeext); 766EXPORT_SYMBOL(libipw_wx_set_encodeext);
767EXPORT_SYMBOL(ieee80211_wx_get_encodeext); 767EXPORT_SYMBOL(libipw_wx_get_encodeext);
768 768
769EXPORT_SYMBOL(ieee80211_wx_get_scan); 769EXPORT_SYMBOL(libipw_wx_get_scan);
770EXPORT_SYMBOL(ieee80211_wx_set_encode); 770EXPORT_SYMBOL(libipw_wx_set_encode);
771EXPORT_SYMBOL(ieee80211_wx_get_encode); 771EXPORT_SYMBOL(libipw_wx_get_encode);