Remove support for old kernels. Index: netdev/net/ieee80211/wpa.c =================================================================== --- netdev.orig/net/ieee80211/wpa.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/wpa.c 2005-10-19 11:19:31.000000000 +0200 @@ -15,9 +15,7 @@ #include #include #include -#if WIRELESS_EXT > 12 #include -#endif /* WIRELESS_EXT > 12 */ #include #include @@ -254,7 +252,6 @@ ieee80211_rx_h_michael_mic_verify(struct printk(" (%d)\n", authenticator); #endif /* CONFIG_HOSTAPD_WPA_TESTING */ -#if WIRELESS_EXT >= 15 do { struct ieee80211_hdr *hdr; union iwreq_data wrqu; @@ -274,7 +271,6 @@ ieee80211_rx_h_michael_mic_verify(struct wireless_send_event(rx->dev, IWEVCUSTOM, &wrqu, buf); kfree(buf); } while (0); -#endif /* WIRELESS_EXT >= 15 */ ieee80211_rx_mgmt(rx->dev, rx->skb, rx->u.rx.status, ieee80211_msg_michael_mic_failure); Index: netdev/net/ieee80211/rate_control.c =================================================================== --- netdev.orig/net/ieee80211/rate_control.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/rate_control.c 2005-10-19 11:19:31.000000000 +0200 @@ -291,9 +291,6 @@ static void * rate_control_simple_alloc( return NULL; } memset(rctrl, 0, sizeof(*rctrl)); -#ifndef NEW_MODULE_CODE - MOD_INC_USE_COUNT; -#endif return rctrl; } @@ -302,9 +299,6 @@ static void rate_control_simple_free(voi { struct global_rate_control *rctrl = priv; kfree(rctrl); -#ifndef NEW_MODULE_CODE - MOD_DEC_USE_COUNT; -#endif } @@ -322,9 +316,6 @@ static void * rate_control_simple_alloc_ return NULL; } memset(rctrl, 0, sizeof(*rctrl)); -#ifndef NEW_MODULE_CODE - MOD_INC_USE_COUNT; -#endif return rctrl; } @@ -333,9 +324,6 @@ static void rate_control_simple_free_sta { struct sta_rate_control *rctrl = priv; kfree(rctrl); -#ifndef NEW_MODULE_CODE - MOD_DEC_USE_COUNT; -#endif } Index: netdev/net/ieee80211/wme.c =================================================================== --- netdev.orig/net/ieee80211/wme.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/wme.c 2005-10-19 11:19:31.000000000 +0200 @@ -282,21 +282,12 @@ static int wme_qdiscop_enqueue(struct sk err = qdisc->enqueue(skb, qdisc); if (err == NET_XMIT_SUCCESS) { qd->q.qlen++; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) qd->bstats.bytes += skb->len; qd->bstats.packets++; -#else - qd->stats.bytes += skb->len; - qd->stats.packets++; -#endif return NET_XMIT_SUCCESS; } } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) qd->qstats.drops++; -#else - qd->stats.drops++; -#endif return err; } @@ -319,11 +310,7 @@ static int wme_qdiscop_requeue(struct sk qd->q.qlen++; return 0; } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) qd->qstats.drops++; -#else - qd->stats.drops++; -#endif return err; } @@ -688,12 +675,7 @@ void ieee80211_install_qdisc(struct net_ qdisc->handle = 0x80010000; write_lock(&qdisc_tree_lock); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,28)) list_add_tail(&qdisc->list, &dev->qdisc_list); -#else - qdisc->next = dev->qdisc_list; - dev->qdisc_list = qdisc; -#endif dev->qdisc_sleeping = qdisc; write_unlock(&qdisc_tree_lock); } Index: netdev/net/ieee80211/fifo_qdisc.c =================================================================== --- netdev.orig/net/ieee80211/fifo_qdisc.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/fifo_qdisc.c 2005-10-19 11:19:31.000000000 +0200 @@ -22,24 +22,15 @@ static int pfifo_enqueue(struct sk_buff struct sk_buff_head *q = qdisc_priv(qd); if (skb_queue_len(q) > qd->dev->tx_queue_len) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) qd->qstats.drops++; -#else - qd->stats.drops++; -#endif kfree_skb(skb); return NET_XMIT_DROP; } skb_queue_tail(q, skb); qd->q.qlen++; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) qd->bstats.bytes += skb->len; qd->bstats.packets++; -#else - qd->stats.bytes += skb->len; - qd->stats.packets++; -#endif return NET_XMIT_SUCCESS; } @@ -51,13 +42,8 @@ static int pfifo_requeue(struct sk_buff skb_queue_head(q, skb); qd->q.qlen++; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)) qd->bstats.bytes += skb->len; qd->bstats.packets++; -#else - qd->stats.bytes += skb->len; - qd->stats.packets++; -#endif return NET_XMIT_SUCCESS; } Index: netdev/net/ieee80211/ieee80211.c =================================================================== --- netdev.orig/net/ieee80211/ieee80211.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/ieee80211.c 2005-10-19 11:19:31.000000000 +0200 @@ -22,9 +22,7 @@ #include #include #include -#if WIRELESS_EXT > 12 #include -#endif /* WIRELESS_EXT > 12 */ #include #include @@ -39,10 +37,6 @@ #include "wme.h" -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47)) -#define NEW_MODULE_CODE -#endif - /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */ /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ static unsigned char rfc1042_header[] = @@ -1868,10 +1862,6 @@ static int ieee80211_open(struct net_dev } local->open_count++; -#ifndef NEW_MODULE_CODE - MOD_INC_USE_COUNT; -#endif - netif_start_queue(dev); return 0; } @@ -1895,10 +1885,6 @@ static int ieee80211_stop(struct net_dev return res; } -#ifndef NEW_MODULE_CODE - MOD_DEC_USE_COUNT; -#endif - return 0; } @@ -3188,7 +3174,6 @@ static void ieee80211_rx_michael_mic_rep goto ignore; } -#if WIRELESS_EXT >= 15 do { union iwreq_data wrqu; char *buf = kmalloc(128, GFP_ATOMIC); @@ -3205,7 +3190,6 @@ static void ieee80211_rx_michael_mic_rep wireless_send_event(rx->dev, IWEVCUSTOM, &wrqu, buf); kfree(buf); } while (0); -#endif /* WIRELESS_EXT >= 15 */ /* TODO: consider verifying the MIC error report with software * implementation if we get too many spurious reports from the Index: netdev/net/ieee80211/wme.h =================================================================== --- netdev.orig/net/ieee80211/wme.h 2005-10-19 11:19:29.000000000 +0200 +++ netdev/net/ieee80211/wme.h 2005-10-20 14:52:04.000000000 +0200 @@ -10,19 +10,6 @@ #include #include -#ifndef TCQ_F_INGRESS -/* Typo fixed in Linux 2.4.28 */ -#define TCQ_F_INGRESS TCQ_F_INGRES -#endif - - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) -static inline void *qdisc_priv(struct Qdisc *q) -{ - return q->data; -} -#endif - #define QOS_CONTROL_LEN 2 Index: netdev/net/ieee80211/sta_info.c =================================================================== --- netdev.orig/net/ieee80211/sta_info.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/sta_info.c 2005-10-19 11:19:31.000000000 +0200 @@ -22,11 +22,6 @@ #include "rate_control.h" -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47)) -#define NEW_MODULE_CODE -#endif - - /* Caller must hold local->sta_lock */ static void sta_info_hash_add(struct ieee80211_local *local, struct sta_info *sta) @@ -171,7 +166,7 @@ struct sta_info * sta_info_add(struct ie /* procfs entry adding might sleep, so schedule process context * task for adding proc entry for STAs that do not yet have * one. */ - TASK_SCHEDULE(&local->sta_proc_add); + schedule_work(&local->sta_proc_add); } return sta; @@ -349,10 +344,6 @@ static void sta_info_proc_add_task(void max_adds--; } - -#ifndef NEW_MODULE_CODE - MOD_DEC_USE_COUNT; -#endif } @@ -367,7 +358,7 @@ void sta_info_init(struct ieee80211_loca local->sta_cleanup.function = sta_info_cleanup; add_timer(&local->sta_cleanup); - TASK_QUEUE_INIT(&local->sta_proc_add, sta_info_proc_add_task, local); + INIT_WORK(&local->sta_proc_add, sta_info_proc_add_task, local); } void sta_info_deinit(struct ieee80211_local *local) Index: netdev/net/ieee80211/ieee80211_compat.h =================================================================== --- netdev.orig/net/ieee80211/ieee80211_compat.h 2005-10-19 11:19:29.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * IEEE 802.11 driver (80211.o) -- Linux 2.4/2.6 compatibility code - * Copyright 2003, Instant802 Networks, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef IEEE80211_COMPAT_H -#define IEEE80211_COMPAT_H - -#define NEW_MODULE_CODE - -#define TASK_QUEUE struct work_struct - -#define TASK_SCHEDULE(q) schedule_work(q); - -#define TASK_FLUSH_SCHEDULED() flush_scheduled_work() - -static inline void TASK_QUEUE_INIT(struct work_struct *wq, - void (*routine)(void *), void *data) -{ - INIT_WORK(wq, routine, data); -} - -#endif /* IEEE80211_COMPAT_H */ Index: netdev/net/ieee80211/ieee80211_i.h =================================================================== --- netdev.orig/net/ieee80211/ieee80211_i.h 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/ieee80211_i.h 2005-10-19 17:01:44.000000000 +0200 @@ -17,28 +17,15 @@ #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ #endif /* ETH_P_PAE */ -#ifndef ARPHRD_IEEE80211_PRISM -#define ARPHRD_IEEE80211_PRISM 802 -#endif /* ARPHRD_IEEE80211_PRISM */ - #define IEEE80211_MAX_SSID_LEN 32 struct ieee80211_local; #include "ieee80211_key.h" -#include "ieee80211_compat.h" #include "sta_info.h" #define BIT(x) (1 << (x)) -#if HZ == 100 -#define JIFFIES2MSEC(j) (10 * (j)) -#elif HZ == 1000 -#define JIFFIES2MSEC(j) (j) -#else -#define JIFFIES2MSEC(j) (((j) / HZ) * 1000 + (((j) % HZ) * 1000) / HZ) -#endif - #define IEEE80211_ALIGN32_PAD(a) ((4 - ((a) & 3)) & 3) @@ -547,7 +534,7 @@ struct ieee80211_local { u32 rate_limit_bucket; struct proc_dir_entry *proc, *proc_sta, *proc_iface; - TASK_QUEUE sta_proc_add; + struct work_struct sta_proc_add; enum { STA_ANTENNA_SEL_AUTO = 0, Index: netdev/net/ieee80211/ieee80211_ioctl.c =================================================================== --- netdev.orig/net/ieee80211/ieee80211_ioctl.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/ieee80211_ioctl.c 2005-10-19 17:02:49.000000000 +0200 @@ -17,9 +17,7 @@ #include #include #include -#if WIRELESS_EXT > 12 #include -#endif /* WIRELESS_EXT > 12 */ #include #include @@ -31,12 +29,6 @@ #include "aes_ccm.h" -#if WIRELESS_EXT <= 12 -/* Wireless extensions backward compatibility */ -struct iw_request_info; -#endif /* WIRELESS_EXT <= 12 */ - - static int ieee80211_regdom = 0x10; /* FCC */ MODULE_PARM(ieee80211_regdom, "i"); MODULE_PARM_DESC(ieee80211_regdom, "IEEE 802.11 regulatory domain; 64=MKK"); @@ -387,7 +379,7 @@ static int ieee80211_ioctl_get_info_sta( return -ENOENT; param->u.get_info_sta.inactive_msec = - JIFFIES2MSEC(jiffies - sta->last_rx); + jiffies_to_msecs(jiffies - sta->last_rx); param->u.get_info_sta.rx_packets = sta->rx_packets; param->u.get_info_sta.tx_packets = sta->tx_packets; param->u.get_info_sta.rx_bytes = sta->rx_bytes; Index: netdev/net/ieee80211/ieee80211_sta.c =================================================================== --- netdev.orig/net/ieee80211/ieee80211_sta.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/ieee80211_sta.c 2005-10-19 11:19:31.000000000 +0200 @@ -23,9 +23,7 @@ #include #include #include -#if WIRELESS_EXT > 12 #include -#endif /* WIRELESS_EXT > 12 */ #include #include @@ -313,7 +311,6 @@ static void ieee80211_sta_wmm_params(str static void ieee80211_sta_send_associnfo(struct net_device *dev, struct ieee80211_if_sta *ifsta) { -#if WIRELESS_EXT > 14 char *buf; size_t len; int i; @@ -359,7 +356,6 @@ static void ieee80211_sta_send_associnfo wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); kfree(buf); -#endif /* WIRELESS_EXT > 14 */ } @@ -2638,7 +2634,6 @@ ieee80211_sta_scan_result(struct net_dev iwe.u.data.length = 0; current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, ""); -#if WIRELESS_EXT > 14 if (bss && bss->wpa_ie) { char *buf, *p; int i; @@ -2734,7 +2729,6 @@ ieee80211_sta_scan_result(struct net_dev kfree(buf); break; } while (0); -#endif /* WIRELESS_EXT > 14 */ return current_ev; } Index: netdev/net/ieee80211/ieee80211_proc.c =================================================================== --- netdev.orig/net/ieee80211/ieee80211_proc.c 2005-10-19 11:19:30.000000000 +0200 +++ netdev/net/ieee80211/ieee80211_proc.c 2005-10-19 17:05:29.000000000 +0200 @@ -282,10 +282,10 @@ static int ieee80211_proc_sta_read(char sta->last_ack_rssi[0], sta->last_ack_rssi[1], sta->last_ack_rssi[2]); if (sta->last_ack) - p += sprintf(p, "last_ack_ms=%ld\n", - JIFFIES2MSEC(jiffies - sta->last_ack)); + p += sprintf(p, "last_ack_ms=%d\n", + jiffies_to_msecs(jiffies - sta->last_ack)); inactive = jiffies - sta->last_rx; - p += sprintf(p, "inactive_msec=%d\n", JIFFIES2MSEC(inactive)); + p += sprintf(p, "inactive_msec=%d\n", jiffies_to_msecs(inactive)); p += sprintf(p, "channel_use=%d\n", sta->channel_use); p += sprintf(p, "wep_weak_iv_count=%d\n", sta->wep_weak_iv_count); #ifdef CONFIG_IEEE80211_DEBUG_COUNTERS