> > > Ahhh, I see what you are getting at now, how about ieee80211_stype_mask? > > > > > > That makes the & a little clearer and has better semantic meaning. > > > > > > The other option is still to call it stype_mask, but change it to > > > return a __le16....so tests against != 0 still work and really > > > is just a wrapper around the byteswap of the constant and the &. > > > > Hmm. I'm not sure, how is all this really used? It seems you want > > > > ieee80211_has_qos_stype(hdr) > > and > > > > ieee80211_has_stype(hdr, stype) > > > > instead, no? > > Just the latter I think. But I'll do a few patches to see how it looks > first. If there end up being a few common ones (like qos) a few > short-hand versions might be appropriate, I'll see how it goes. Yeah but I was thinking of ieee80211_stype_is() or whatever you want to call it (I think I actually like it that way around better than is_stype/ftype) to check the exact match of the four bits, i.e. fc & stypemask == argument and the QoS one check that the bit is set. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part