--- linux-2.6.18.noarch/include/net/wireless.h.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/include/net/wireless.h 2007-05-07 15:30:43.000000000 -0400 @@ -32,9 +32,9 @@ struct wiphy { /* fields below are read-only, assigned by cfg80211 */ - /* the item in /sys/class/ieee80211/ points to this, - * you need use set_wiphy_dev() (see below) */ - struct device dev; + /* dir in /sys/class/ieee80211/, you need + * to assign its dev pointer */ + struct class_device class_dev; /* dir in debugfs: ieee80211/ */ struct dentry *debugfsdir; @@ -73,7 +73,7 @@ static inline void *wiphy_priv(struct wi */ static inline void set_wiphy_dev(struct wiphy *wiphy, struct device *dev) { - wiphy->dev.parent = dev; + wiphy->class_dev.dev = dev; } /** @@ -81,7 +81,7 @@ static inline void set_wiphy_dev(struct */ static inline struct device *wiphy_dev(struct wiphy *wiphy) { - return wiphy->dev.parent; + return wiphy->class_dev.dev; } /** @@ -89,7 +89,7 @@ static inline struct device *wiphy_dev(s */ static inline char *wiphy_name(struct wiphy *wiphy) { - return wiphy->dev.bus_id; + return wiphy->class_dev.class_id; } /** --- linux-2.6.18.noarch/net/wireless/sysfs.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/wireless/sysfs.c 2007-05-07 15:37:59.000000000 -0400 @@ -17,55 +17,54 @@ #include "sysfs.h" #include "core.h" -static inline struct cfg80211_registered_device *dev_to_rdev( - struct device *dev) +static inline struct cfg80211_registered_device *cdev_to_rdev( + struct class_device *cdev) { - return container_of(dev, struct cfg80211_registered_device, wiphy.dev); + return container_of(cdev, struct cfg80211_registered_device, + wiphy.class_dev); } -static ssize_t _show_index(struct device *dev, struct device_attribute *attr, +static ssize_t _show_index(struct class_device *cdev, char *buf) { - return sprintf(buf, "%d\n", dev_to_rdev(dev)->idx); + return sprintf(buf, "%d\n", cdev_to_rdev(cdev)->idx); } -static ssize_t _show_permaddr(struct device *dev, - struct device_attribute *attr, +static ssize_t _show_permaddr(struct class_device *cdev, char *buf) { - char *addr = dev_to_rdev(dev)->wiphy.perm_addr; + char *addr = cdev_to_rdev(cdev)->wiphy.perm_addr; return sprintf(buf, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); } -static struct device_attribute ieee80211_dev_attrs[] = { +static struct class_device_attribute ieee80211_class_dev_attrs[] = { __ATTR(index, S_IRUGO, _show_index, NULL), __ATTR(macaddress, S_IRUGO, _show_permaddr, NULL), {} }; -static void wiphy_dev_release(struct device *dev) +static void wiphy_class_dev_release(struct class_device *cdev) { - struct cfg80211_registered_device *rdev = dev_to_rdev(dev); + struct cfg80211_registered_device *dev = cdev_to_rdev(cdev); - cfg80211_dev_free(rdev); + cfg80211_dev_free(dev); } -static int wiphy_uevent(struct device *dev, char **envp, +static int wiphy_uevent(struct class_device *cdev, char **envp, int num_envp, char *buf, int size) { - /* TODO, we probably need stuff here */ return 0; } struct class ieee80211_class = { .name = "ieee80211", .owner = THIS_MODULE, - .dev_release = wiphy_dev_release, - .dev_attrs = ieee80211_dev_attrs, + .release = wiphy_class_dev_release, + .class_dev_attrs = ieee80211_class_dev_attrs, #ifdef CONFIG_HOTPLUG - .dev_uevent = wiphy_uevent, + .uevent = wiphy_uevent, #endif }; --- linux-2.6.18.noarch/net/wireless/core.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/wireless/core.c 2007-05-07 15:35:48.000000000 -0400 @@ -69,16 +69,16 @@ struct wiphy *wiphy_new(struct cfg80211_ } /* give it a proper name */ - snprintf(drv->wiphy.dev.bus_id, BUS_ID_SIZE, + snprintf(drv->wiphy.class_dev.class_id, BUS_ID_SIZE, PHY_NAME "%d", drv->idx); mutex_init(&drv->mtx); mutex_init(&drv->devlist_mtx); INIT_LIST_HEAD(&drv->netdev_list); - device_initialize(&drv->wiphy.dev); - drv->wiphy.dev.class = &ieee80211_class; - drv->wiphy.dev.platform_data = drv; + drv->wiphy.class_dev.class = &ieee80211_class; + drv->wiphy.class_dev.class_data = &drv->wiphy; + class_device_initialize(&drv->wiphy.class_dev); return &drv->wiphy; } @@ -91,7 +91,7 @@ int wiphy_register(struct wiphy *wiphy) mutex_lock(&cfg80211_drv_mutex); - res = device_add(&drv->wiphy.dev); + res = class_device_add(&drv->wiphy.class_dev); if (res) goto out_unlock; @@ -133,7 +133,7 @@ void wiphy_unregister(struct wiphy *wiph mutex_unlock(&drv->mtx); list_del(&drv->list); - device_del(&drv->wiphy.dev); + class_device_del(&drv->wiphy.class_dev); debugfs_remove(drv->wiphy.debugfsdir); mutex_unlock(&cfg80211_drv_mutex); @@ -149,7 +149,7 @@ void cfg80211_dev_free(struct cfg80211_r void wiphy_free(struct wiphy *wiphy) { - put_device(&wiphy->dev); + class_device_put(&wiphy->class_dev); } EXPORT_SYMBOL(wiphy_free); @@ -169,7 +169,8 @@ static int cfg80211_netdev_notifier_call case NETDEV_REGISTER: mutex_lock(&rdev->devlist_mtx); list_add(&dev->ieee80211_ptr->list, &rdev->netdev_list); - if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, + if (sysfs_create_link(&dev->class_dev.kobj, + &rdev->wiphy.class_dev.kobj, "phy80211")) { printk(KERN_ERR "wireless: failed to add phy80211 " "symlink to netdev!\n"); @@ -180,7 +181,7 @@ static int cfg80211_netdev_notifier_call case NETDEV_UNREGISTER: mutex_lock(&rdev->devlist_mtx); if (!list_empty(&dev->ieee80211_ptr->list)) { - sysfs_remove_link(&dev->dev.kobj, "phy80211"); + sysfs_remove_link(&dev->class_dev.kobj, "phy80211"); list_del_init(&dev->ieee80211_ptr->list); } mutex_unlock(&rdev->devlist_mtx); --- linux-2.6.18.noarch/net/mac80211/wme.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/wme.c 2007-05-07 15:56:14.000000000 -0400 @@ -18,6 +18,8 @@ #include "ieee80211_i.h" #include "wme.h" +#define CHILD_QDISC_OPS pfifo_qdisc_ops + static inline int WLAN_FC_IS_QOS_DATA(u16 fc) { return (fc & 0x8C) == 0x88; @@ -353,10 +355,13 @@ static void wme_qdiscop_destroy(struct Q struct ieee80211_sched_data *q = qdisc_priv(qd); struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); struct ieee80211_hw *hw = &local->hw; + struct tcf_proto *tp; int queue; - tcf_destroy_chain(q->filter_list); - q->filter_list = NULL; + while ((tp = q->filter_list) != NULL) { + q->filter_list = tp->next; + tp->ops->destroy(tp); + } for (queue=0; queue < hw->queues; queue++) { skb_queue_purge(&q->requeued[queue]); @@ -422,8 +427,7 @@ static int wme_qdiscop_init(struct Qdisc /* create child queues */ for (i = 0; i < queues; i++) { skb_queue_head_init(&q->requeued[i]); - q->queues[i] = qdisc_create_dflt(qd->dev, &pfifo_qdisc_ops, - qd->handle); + q->queues[i] = qdisc_create_dflt(qd->dev, &CHILD_QDISC_OPS); if (q->queues[i] == 0) { q->queues[i] = &noop_qdisc; printk(KERN_ERR "%s child qdisc %i creation failed", dev->name, i); @@ -643,7 +647,7 @@ void ieee80211_install_qdisc(struct net_ { struct Qdisc *qdisc; - qdisc = qdisc_create_dflt(dev, &wme_qdisc_ops, TC_H_ROOT); + qdisc = qdisc_create_dflt(dev, &wme_qdisc_ops); if (!qdisc) { printk(KERN_ERR "%s: qdisc installation failed\n", dev->name); return; --- linux-2.6.18.noarch/net/mac80211/wep.h.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/wep.h 2007-05-07 15:30:53.000000000 -0400 @@ -26,9 +26,9 @@ u8 * ieee80211_wep_add_iv(struct ieee802 void ieee80211_wep_remove_iv(struct ieee80211_local *local, struct sk_buff *skb, struct ieee80211_key *key); -void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, +void ieee80211_wep_encrypt_data(struct crypto_tfm *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len); -int ieee80211_wep_decrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, +int ieee80211_wep_decrypt_data(struct crypto_tfm *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len); int ieee80211_wep_encrypt(struct ieee80211_local *local, struct sk_buff *skb, struct ieee80211_key *key); --- linux-2.6.18.noarch/net/mac80211/aes_ccm.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/aes_ccm.c 2007-05-07 15:30:53.000000000 -0400 @@ -17,14 +17,24 @@ #include "aes_ccm.h" -static void ieee80211_aes_encrypt(struct crypto_cipher *tfm, +static void ieee80211_aes_encrypt(struct crypto_tfm *tfm, const u8 pt[16], u8 ct[16]) { - crypto_cipher_encrypt_one(tfm, ct, pt); + struct scatterlist src, dst; + + src.page = virt_to_page(pt); + src.offset = offset_in_page(pt); + src.length = AES_BLOCK_LEN; + + dst.page = virt_to_page(ct); + dst.offset = offset_in_page(ct); + dst.length = AES_BLOCK_LEN; + + crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN); } -static inline void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, +static inline void aes_ccm_prepare(struct crypto_tfm *tfm, u8 *b_0, u8 *aad, u8 *b, u8 *s_0, u8 *a) { int i; @@ -52,7 +62,7 @@ static inline void aes_ccm_prepare(struc } -void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, +void ieee80211_aes_ccm_encrypt(struct crypto_tfm *tfm, u8 *scratch, u8 *b_0, u8 *aad, u8 *data, size_t data_len, u8 *cdata, u8 *mic) { @@ -91,7 +101,7 @@ void ieee80211_aes_ccm_encrypt(struct cr } -int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, +int ieee80211_aes_ccm_decrypt(struct crypto_tfm *tfm, u8 *scratch, u8 *b_0, u8 *aad, u8 *cdata, size_t data_len, u8 *mic, u8 *data) { @@ -134,12 +144,12 @@ int ieee80211_aes_ccm_decrypt(struct cry } -struct crypto_cipher * ieee80211_aes_key_setup_encrypt(const u8 key[]) +struct crypto_tfm * ieee80211_aes_key_setup_encrypt(const u8 key[]) { - struct crypto_cipher *tfm; + struct crypto_tfm *tfm; - tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); - if (IS_ERR(tfm)) + tfm = crypto_alloc_tfm("aes", 0); + if (!tfm) return NULL; crypto_cipher_setkey(tfm, key, ALG_CCMP_KEY_LEN); @@ -148,8 +158,8 @@ struct crypto_cipher * ieee80211_aes_key } -void ieee80211_aes_key_free(struct crypto_cipher *tfm) +void ieee80211_aes_key_free(struct crypto_tfm *tfm) { if (tfm) - crypto_free_cipher(tfm); + crypto_free_tfm(tfm); } --- /dev/null 2007-05-07 08:18:18.935534568 -0400 +++ linux-2.6.18.noarch/net/mac80211/fifo_qdisc.c 2007-05-07 15:30:53.000000000 -0400 @@ -0,0 +1,102 @@ +/* + * Copyright 2005, Devicescape Software, 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. + * + * If building without CONFIG_NET_SCHED we need a simple + * fifo qdisc to install by default as the sub-qdisc. + * This is a simple replacement for sch_fifo. + */ + +#include +#include +#include +#include "ieee80211_i.h" +#include "wme.h" + +static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc* qd) +{ + struct sk_buff_head *q = qdisc_priv(qd); + + if (skb_queue_len(q) > qd->dev->tx_queue_len) { + qd->qstats.drops++; + kfree_skb(skb); + return NET_XMIT_DROP; + } + + skb_queue_tail(q, skb); + qd->q.qlen++; + qd->bstats.bytes += skb->len; + qd->bstats.packets++; + + return NET_XMIT_SUCCESS; +} + + +static int pfifo_requeue(struct sk_buff *skb, struct Qdisc* qd) +{ + struct sk_buff_head *q = qdisc_priv(qd); + + skb_queue_head(q, skb); + qd->q.qlen++; + qd->bstats.bytes += skb->len; + qd->bstats.packets++; + + return NET_XMIT_SUCCESS; +} + + +static struct sk_buff *pfifo_dequeue(struct Qdisc* qd) +{ + struct sk_buff_head *q = qdisc_priv(qd); + + return skb_dequeue(q); +} + + +static int pfifo_init(struct Qdisc* qd, struct rtattr *opt) +{ + struct sk_buff_head *q = qdisc_priv(qd); + + skb_queue_head_init(q); + return 0; +} + + +static void pfifo_reset(struct Qdisc* qd) +{ + struct sk_buff_head *q = qdisc_priv(qd); + + skb_queue_purge(q); + qd->q.qlen = 0; +} + + +static int pfifo_dump(struct Qdisc *qd, struct sk_buff *skb) +{ + return skb->len; +} + + +struct Qdisc_ops pfifo_qdisc_ops = +{ + .next = NULL, + .cl_ops = NULL, + .id = "ieee80211_pfifo", + .priv_size = sizeof(struct sk_buff_head), + + .enqueue = pfifo_enqueue, + .dequeue = pfifo_dequeue, + .requeue = pfifo_requeue, + .drop = NULL, + + .init = pfifo_init, + .reset = pfifo_reset, + .destroy = NULL, + .change = NULL, + + .dump = pfifo_dump, +}; + --- linux-2.6.18.noarch/net/mac80211/Makefile.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/Makefile 2007-05-07 15:30:53.000000000 -0400 @@ -18,3 +18,7 @@ mac80211-objs := \ wme.o \ ieee80211_cfg.o \ $(mac80211-objs-y) + +ifeq ($(CONFIG_NET_SCHED),) + mac80211-objs += fifo_qdisc.o +endif --- linux-2.6.18.noarch/net/mac80211/aes_ccm.h.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/aes_ccm.h 2007-05-07 15:30:53.000000000 -0400 @@ -14,13 +14,13 @@ #define AES_BLOCK_LEN 16 -struct crypto_cipher * ieee80211_aes_key_setup_encrypt(const u8 key[]); -void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, +struct crypto_tfm * ieee80211_aes_key_setup_encrypt(const u8 key[]); +void ieee80211_aes_ccm_encrypt(struct crypto_tfm *tfm, u8 *scratch, u8 *b_0, u8 *aad, u8 *data, size_t data_len, u8 *cdata, u8 *mic); -int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, +int ieee80211_aes_ccm_decrypt(struct crypto_tfm *tfm, u8 *scratch, u8 *b_0, u8 *aad, u8 *cdata, size_t data_len, u8 *mic, u8 *data); -void ieee80211_aes_key_free(struct crypto_cipher *tfm); +void ieee80211_aes_key_free(struct crypto_tfm *tfm); #endif /* AES_CCM_H */ --- linux-2.6.18.noarch/net/mac80211/tkip.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/tkip.c 2007-05-07 15:30:53.000000000 -0400 @@ -218,7 +218,7 @@ void ieee80211_tkip_gen_rc4key(struct ie * headroom of eight octets for IV and Ext. IV and taildroom of four octets * for ICV. @payload_len is the length of payload (_not_ including extra * headroom and tailroom). @ta is the transmitter addresses. */ -void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm, +void ieee80211_tkip_encrypt_data(struct crypto_tfm *tfm, struct ieee80211_key *key, u8 *pos, size_t payload_len, u8 *ta) { @@ -234,7 +234,7 @@ void ieee80211_tkip_encrypt_data(struct * beginning of the buffer containing IEEE 802.11 header payload, i.e., * including IV, Ext. IV, real data, Michael MIC, ICV. @payload_len is the * length of payload, including IV, Ext. IV, MIC, ICV. */ -int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm, +int ieee80211_tkip_decrypt_data(struct crypto_tfm *tfm, struct ieee80211_key *key, u8 *payload, size_t payload_len, u8 *ta, int only_iv, int queue) --- linux-2.6.18.noarch/net/mac80211/ieee80211_i.h.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/ieee80211_i.h 2007-05-07 15:30:53.000000000 -0400 @@ -443,8 +443,8 @@ struct ieee80211_local { int long_retry_limit; /* dot11LongRetryLimit */ int short_preamble; /* use short preamble with IEEE 802.11b */ - struct crypto_blkcipher *wep_tx_tfm; - struct crypto_blkcipher *wep_rx_tfm; + struct crypto_tfm *wep_tx_tfm; + struct crypto_tfm *wep_rx_tfm; u32 wep_iv; int key_tx_rx_threshold; /* number of times any key can be used in TX * or RX before generating a rekey @@ -465,7 +465,7 @@ struct ieee80211_local { int scan_channel_idx; enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state; unsigned long last_scan_completed; - struct delayed_work scan_work; + struct work_struct scan_work; struct net_device *scan_dev; struct ieee80211_channel *oper_channel, *scan_channel; struct ieee80211_hw_mode *oper_hw_mode, *scan_hw_mode; @@ -757,8 +757,8 @@ int ieee80211_init_client(struct net_dev int ieee80211_set_channel(struct ieee80211_local *local, int channel, int freq); /* ieee80211_sta.c */ void ieee80211_sta_timer(unsigned long data); -void ieee80211_sta_work(struct work_struct *work); -void ieee80211_sta_scan_work(struct work_struct *work); +void ieee80211_sta_scan_work(void *l); +void ieee80211_sta_work(void *ptr); void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb, struct ieee80211_rx_status *rx_status); int ieee80211_sta_set_ssid(struct net_device *dev, char *ssid, size_t len); --- linux-2.6.18.noarch/net/mac80211/ieee80211_key.h.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/ieee80211_key.h 2007-05-07 15:30:53.000000000 -0400 @@ -63,7 +63,7 @@ struct ieee80211_key { struct { u8 tx_pn[6]; u8 rx_pn[NUM_RX_DATA_QUEUES][6]; - struct crypto_cipher *tfm; + struct crypto_tfm *tfm; u32 replays; /* dot11RSNAStatsCCMPReplays */ /* scratch buffers for virt_to_page() (crypto API) */ #ifndef AES_BLOCK_LEN --- linux-2.6.18.noarch/net/mac80211/ieee80211_iface.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/ieee80211_iface.c 2007-05-07 15:30:53.000000000 -0400 @@ -177,7 +177,7 @@ void ieee80211_if_set_type(struct net_de struct ieee80211_if_sta *ifsta; ifsta = &sdata->u.sta; - INIT_WORK(&ifsta->work, ieee80211_sta_work); + INIT_WORK(&ifsta->work, ieee80211_sta_work, dev); setup_timer(&ifsta->timer, ieee80211_sta_timer, (unsigned long) sdata); skb_queue_head_init(&ifsta->skb_queue); --- linux-2.6.18.noarch/net/mac80211/Kconfig.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/Kconfig 2007-05-07 15:30:53.000000000 -0400 @@ -2,13 +2,11 @@ config MAC80211 tristate "Generic IEEE 802.11 Networking Stack (mac80211)" depends on EXPERIMENTAL select CRYPTO - select CRYPTO_ECB select CRYPTO_ARC4 select CRYPTO_AES select CRC32 select WIRELESS_EXT select CFG80211 - select NET_SCH_FIFO ---help--- This option enables the hardware independent IEEE 802.11 networking stack. --- linux-2.6.18.noarch/net/mac80211/wep.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/wep.c 2007-05-07 15:30:53.000000000 -0400 @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -28,15 +27,13 @@ int ieee80211_wep_init(struct ieee80211_ /* start WEP IV from a random value */ get_random_bytes(&local->wep_iv, WEP_IV_LEN); - local->wep_tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, - CRYPTO_ALG_ASYNC); - if (IS_ERR(local->wep_tx_tfm)) + local->wep_tx_tfm = crypto_alloc_tfm("arc4", 0); + if (!local->wep_tx_tfm) return -ENOMEM; - local->wep_rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, - CRYPTO_ALG_ASYNC); - if (IS_ERR(local->wep_rx_tfm)) { - crypto_free_blkcipher(local->wep_tx_tfm); + local->wep_rx_tfm = crypto_alloc_tfm("arc4", 0); + if (!local->wep_rx_tfm) { + crypto_free_tfm(local->wep_tx_tfm); return -ENOMEM; } @@ -45,8 +42,8 @@ int ieee80211_wep_init(struct ieee80211_ void ieee80211_wep_free(struct ieee80211_local *local) { - crypto_free_blkcipher(local->wep_tx_tfm); - crypto_free_blkcipher(local->wep_rx_tfm); + crypto_free_tfm(local->wep_tx_tfm); + crypto_free_tfm(local->wep_rx_tfm); } static inline int ieee80211_wep_weak_iv(u32 iv, int keylen) @@ -127,21 +124,20 @@ void ieee80211_wep_remove_iv(struct ieee /* Perform WEP encryption using given key. data buffer must have tailroom * for 4-byte ICV. data_len must not include this ICV. Note: this function * does _not_ add IV. data = RC4(data | CRC32(data)) */ -void ieee80211_wep_encrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, +void ieee80211_wep_encrypt_data(struct crypto_tfm *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len) { - struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist sg; __le32 *icv; icv = (__le32 *)(data + data_len); *icv = cpu_to_le32(~crc32_le(~0, data, data_len)); - crypto_blkcipher_setkey(tfm, rc4key, klen); + crypto_cipher_setkey(tfm, rc4key, klen); sg.page = virt_to_page(data); sg.offset = offset_in_page(data); sg.length = data_len + WEP_ICV_LEN; - crypto_blkcipher_encrypt(&desc, &sg, &sg, sg.length); + crypto_cipher_encrypt(tfm, &sg, &sg, sg.length); } @@ -196,18 +192,17 @@ int ieee80211_wep_encrypt(struct ieee802 /* Perform WEP decryption using given key. data buffer includes encrypted * payload, including 4-byte ICV, but _not_ IV. data_len must not include ICV. * Return 0 on success and -1 on ICV mismatch. */ -int ieee80211_wep_decrypt_data(struct crypto_blkcipher *tfm, u8 *rc4key, +int ieee80211_wep_decrypt_data(struct crypto_tfm *tfm, u8 *rc4key, size_t klen, u8 *data, size_t data_len) { - struct blkcipher_desc desc = { .tfm = tfm }; struct scatterlist sg; __le32 crc; - crypto_blkcipher_setkey(tfm, rc4key, klen); + crypto_cipher_setkey(tfm, rc4key, klen); sg.page = virt_to_page(data); sg.offset = offset_in_page(data); sg.length = data_len + WEP_ICV_LEN; - crypto_blkcipher_decrypt(&desc, &sg, &sg, sg.length); + crypto_cipher_decrypt(tfm, &sg, &sg, sg.length); crc = cpu_to_le32(~crc32_le(~0, data, data_len)); if (memcmp(&crc, data + data_len, WEP_ICV_LEN) != 0) --- linux-2.6.18.noarch/net/mac80211/ieee80211.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/ieee80211.c 2007-05-07 15:48:06.000000000 -0400 @@ -292,11 +292,8 @@ int ieee80211_get_hdrlen(u16 fc) * The QoS Control field is two bytes and its presence is * indicated by the IEEE80211_STYPE_QOS_DATA bit. Add 2 to * hdrlen if that bit is set. - * This works by masking out the bit and shifting it to - * bit position 1 so the result has the value 0 or 2. */ - hdrlen += (fc & IEEE80211_STYPE_QOS_DATA) - >> (ilog2(IEEE80211_STYPE_QOS_DATA)-1); + hdrlen += (fc & IEEE80211_STYPE_QOS_DATA) ? 2 : 0; break; case IEEE80211_FTYPE_CTL: /* @@ -1531,8 +1528,8 @@ static int ieee80211_subif_start_xmit(st goto fail; } - nh_pos = skb_network_header(skb) - skb->data; - h_pos = skb_transport_header(skb) - skb->data; + nh_pos = skb->nh.raw - skb->data; + h_pos = skb->h.raw - skb->data; /* convert Ethernet header to proper 802.11 header (based on * operation mode) */ @@ -1669,9 +1666,9 @@ static int ieee80211_subif_start_xmit(st /* Update skb pointers to various headers since this modified frame * is going to go through Linux networking code that may potentially * need things like pointer to IP header. */ - skb_set_mac_header(skb, 0); - skb_set_network_header(skb, nh_pos); - skb_set_transport_header(skb, h_pos); + skb->mac.raw = skb->data; + skb->nh.raw = skb->data + nh_pos; + skb->h.raw = skb->data + h_pos; dev->trans_start = jiffies; dev_queue_xmit(skb); @@ -2535,7 +2532,7 @@ static int ieee80211_stop(struct net_dev static int header_parse_80211(struct sk_buff *skb, unsigned char *haddr) { - memcpy(haddr, skb_mac_header(skb) + 10, ETH_ALEN); /* addr2 */ + memcpy(haddr, skb->mac.raw + 10, ETH_ALEN); /* addr2 */ return ETH_ALEN; } @@ -2711,8 +2708,7 @@ ieee80211_rx_h_data(struct ieee80211_txr if (skb2) { /* send to wireless media */ skb2->protocol = __constant_htons(ETH_P_802_3); - skb_set_network_header(skb2, 0); - skb_set_mac_header(skb2, 0); + skb2->mac.raw = skb2->nh.raw = skb2->data; dev_queue_xmit(skb2); } @@ -2840,7 +2836,7 @@ ieee80211_rx_mgmt(struct ieee80211_local sdata->stats.rx_packets++; sdata->stats.rx_bytes += skb->len; - skb_set_mac_header(skb, 0); + skb->mac.raw = skb->data; skb->ip_summed = CHECKSUM_UNNECESSARY; skb->pkt_type = PACKET_OTHERHOST; skb->protocol = htons(ETH_P_802_2); @@ -2903,7 +2899,7 @@ ieee80211_rx_monitor(struct net_device * sdata->stats.rx_packets++; sdata->stats.rx_bytes += skb->len; - skb_set_mac_header(skb, 0); + skb->mac.raw = skb->data; skb->ip_summed = CHECKSUM_UNNECESSARY; skb->pkt_type = PACKET_OTHERHOST; skb->protocol = htons(ETH_P_802_2); @@ -4653,7 +4649,7 @@ struct ieee80211_hw *ieee80211_alloc_hw( rwlock_init(&local->sub_if_lock); INIT_LIST_HEAD(&local->sub_if_list); - INIT_DELAYED_WORK(&local->scan_work, ieee80211_sta_scan_work); + INIT_WORK(&local->scan_work, ieee80211_sta_scan_work, local); init_timer(&local->stat_timer); local->stat_timer.function = ieee80211_stat_refresh; local->stat_timer.data = (unsigned long) local; --- linux-2.6.18.noarch/net/mac80211/tkip.h.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/tkip.h 2007-05-07 15:30:53.000000000 -0400 @@ -19,7 +19,7 @@ void ieee80211_tkip_gen_phase1key(struct u16 *phase1key); void ieee80211_tkip_gen_rc4key(struct ieee80211_key *key, u8 *ta, u8 *rc4key); -void ieee80211_tkip_encrypt_data(struct crypto_blkcipher *tfm, +void ieee80211_tkip_encrypt_data(struct crypto_tfm *tfm, struct ieee80211_key *key, u8 *pos, size_t payload_len, u8 *ta); enum { @@ -28,7 +28,7 @@ enum { TKIP_DECRYPT_INVALID_KEYIDX = -2, TKIP_DECRYPT_REPLAY = -3, }; -int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm, +int ieee80211_tkip_decrypt_data(struct crypto_tfm *tfm, struct ieee80211_key *key, u8 *payload, size_t payload_len, u8 *ta, int only_iv, int queue); --- linux-2.6.18.noarch/net/mac80211/ieee80211_sta.c.orig 2007-05-07 15:24:30.000000000 -0400 +++ linux-2.6.18.noarch/net/mac80211/ieee80211_sta.c 2007-05-07 15:53:36.000000000 -0400 @@ -408,9 +408,7 @@ static void ieee80211_sta_tx(struct net_ sdata = IEEE80211_DEV_TO_SUB_IF(dev); skb->dev = sdata->local->mdev; - skb_set_mac_header(skb, 0); - skb_set_network_header(skb, 0); - skb_set_transport_header(skb, 0); + skb->mac.raw = skb->nh.raw = skb->h.raw = skb->data; pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; memset(pkt_data, 0, sizeof(struct ieee80211_tx_packet_data)); @@ -1915,11 +1913,10 @@ void ieee80211_sta_timer(unsigned long d } -void ieee80211_sta_work(struct work_struct *work) +void ieee80211_sta_work(void *ptr) { - struct ieee80211_sub_if_data *sdata = - container_of(work, struct ieee80211_sub_if_data, u.sta.work); - struct net_device *dev = sdata->dev; + struct net_device *dev = ptr; + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_if_sta *ifsta; struct sk_buff *skb; @@ -2610,10 +2607,9 @@ void ieee80211_scan_completed(struct iee } EXPORT_SYMBOL(ieee80211_scan_completed); -void ieee80211_sta_scan_work(struct work_struct *work) +void ieee80211_sta_scan_work(void *l) { - struct ieee80211_local *local = - container_of(work, struct ieee80211_local, scan_work.work); + struct ieee80211_local *local = l; struct net_device *dev = local->scan_dev; struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_hw_mode *mode;