On Saturday 15 September 2007 00:12:00 Larry Finger wrote: > Pavel Roskin wrote: > > On Fri, 2007-09-14 at 23:33 +0200, Michael Buesch wrote: > > > >> - macstat = le32_to_cpu(rxhdr->mac_status); > >> + macstat = le16_to_cpu(rxhdr->mac_status); > >> mactime = le16_to_cpu(rxhdr->mac_time); > >> chanstat = le16_to_cpu(rxhdr->channel); > >> > >> But I think in this case this also didn't change the actual > >> result in macstat. > > > > I don't think so. Suppose rxhdr->mac_status is 1. le32_to_cpu() will > > return 0x1000000,
How would it return 0x1000000? if mac_status is 1 in the lowest byte, le32_to_cpu would not put that 1 into the highest byte of the result. > > which would turn into 0 on conversion to u16. > > le16_to_cpu() will return 0x100. Since rxhdr->mac_status is accessed by > > value (not by pointer), it will be 1 whether it's treated as 32-bit or > > 16-bit. Ok, I didn't know it's passed by value. I thought it was casted to pointer inline. If it's passed to leX_to_cpu by value, of course it's a different story. > If your analysis is correct (and I think it is), that could explain a problem > we are having with > b43legacy on a Powerbook. With V4 firmware, rxhdr->mac_status is 32 bit, thus > b43 wouldn't have this > problem, and it wouldn't show up on my x86 hardware with b43legacy. -- Greetings Michael. _______________________________________________ Bcm43xx-dev mailing list [email protected] https://lists.berlios.de/mailman/listinfo/bcm43xx-dev
