Johannes Berg wrote:
Now the code is completely incorrect -- you're now loading the lower 16 bits of the 'buffer' _pointer_ into the variable as an unaligned load. It really needs to be fc = get_unaligned((__le16 *)buffer); I think. johannes
It does look wrong, now that I look at it further, but I'm pretty sure that what was happening was that only the lower 8 bits of the dereferenced value were being accessed. What's odd is that it works on my machine, though. Whatever. Your version is clearer, in any case.
What follows is hopefully the last version of this patch. Signed-off-by: Patrick Simmons <linuxrocks123@xxxxxxxxxxxx> --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c @@ -694,7 +694,7 @@ && !mac->pass_ctrl) return 0; - fc = *(__le16 *)buffer; + fc = get_unaligned((__le16*)buffer); need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc); skb = dev_alloc_skb(length + (need_padding ? 2 : 0)); --Patrick -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html