On Tue, Jan 10, 2012 at 06:35:11PM +0100, Johannes Berg wrote: > On Tue, 2012-01-10 at 18:28 +0100, Simon Wunderlich wrote: > > Hello Johannes, > > > > All this logic is pretty complex, maybe we could translate the bitmap to > > > an array of unsigned longs and use test_bit() instead of open-coding it > > > for 8-bit words? > > > > Mhm, I would rather not add further copies into this fast path function, and > > simply casting will result in bad behaviour (alignment, endianess). > > Well you don't want to copy it, you want to maintain the data that way, > I think? Ok I think I see -- you're concerned about the masking etc. > Dunno. Maybe at least there's a way to abstract out all the > calculations? > I have looked into bitmap.h which offers a great set of functions for unsigned long arrays, but unfortunately I couldn't find anything equivalent for u8. Writing our own u8 bitmap function set would be overkill here (IMHO), and abstracting/hiding these functions into defines or changing everything to unsigned long to be consistent (including ht_caps.mcs.rx_mask) would be ugly as well. I also don't consider this piece of code to be beautiful, but would suggest to keep it for now - or maybe someone else has a better idea. > > Generally > > changing the mcs_mask to u32 is possible, > > No, u64 might work today but maybe somebody will want to use higher > MCSes in the future? Yeah, u64 is possible on some architectures too - most of my routers are 32 bit however. :) Cheers, Simon
Attachment:
signature.asc
Description: Digital signature