lkml.org 
[lkml]   [2014]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ieee80211: Print human-readable disassoc/deauth reason codes
From
Date
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.




\
 
 \ /
  Last update: 2014-02-10 18:21    [W:0.127 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site