On 09/11/08 14:06, Shaddy Baddah wrote:
(attached. Note, it also includes remnants of the patch recommended by Sebastian Andrzej Siewior in http://marc.info/?l=linux-wireless&m=122493409906326&w=2). The problem occurs within compare_ether_addr() and this immediately reminded me that
This time, really attached. Sorry about that. Regards, Shaddy
diff -urN -x '*.o' -x '*.ko' ./linux-source-2.6.26.orig/drivers/net/wireless/zd1211rw/zd_mac.c ./linux-source-2.6.26/drivers/net/wireless/zd1211rw/zd_mac.c --- ./linux-source-2.6.26.orig/drivers/net/wireless/zd1211rw/zd_mac.c 2008-07-14 07:51:29.000000000 +1000 +++ ./linux-source-2.6.26/drivers/net/wireless/zd1211rw/zd_mac.c 2008-11-09 03:52:45.000000000 +1100 @@ -25,6 +25,7 @@ #include <linux/usb.h> #include <linux/jiffies.h> #include <net/ieee80211_radiotap.h> +#include <asm/unaligned.h> #include "zd_def.h" #include "zd_chip.h" @@ -632,7 +633,7 @@ struct ieee80211_hdr *tx_hdr; tx_hdr = (struct ieee80211_hdr *)skb->data; - if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1))) + if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN))) { struct ieee80211_tx_status status; @@ -716,7 +717,7 @@ && !mac->pass_ctrl) return 0; - fc = le16_to_cpu(*((__le16 *) buffer)); + fc = get_unaligned_le16(buffer); is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && (fc & IEEE80211_STYPE_QOS_DATA); @@ -806,7 +807,7 @@ u16 int_status; struct zd_mac *mac = container_of(work, struct zd_mac, process_intr); - int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer+4)); + int_status = get_unaligned_le16(mac->intr_buffer+4); if (int_status & INT_CFG_NEXT_BCN) { if (net_ratelimit()) dev_dbg_f(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n");