Messages in this thread | | | Subject | Re: [PATCH] ieee80211: Print human-readable disassoc/deauth reason codes | From | Joe Perches <> | Date | Mon, 10 Feb 2014 08:39:19 -0800 |
| |
On Mon, 2014-02-10 at 12:09 +0100, Johannes Berg wrote: > On Wed, 2014-02-05 at 20:44 -0800, Joe Perches wrote: > > > Perhaps use a more common kernel style > > > > struct ieee80211_reason_descriptions { > > u16 code; > > const char * desc; > > } > > > > and enumerate the reason codes with #defines and use a > > macro to populate the descriptions > > > > #define IEEE80211_REASON_RESERVED 0 > > #define IEEE80211_REASON_UNSPECIFIED 1 [] > Isn't it more efficient to just let the compiler generate it with a big > switch() statement?
That'd be fine too.
The benefit of the #defines is that you typically get an external .h file for the entries.
Calvin's suggested code looked pretty fragile.
| |