]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - iw.h
info: macro-ify ext_feat_print()
[thirdparty/iw.git] / iw.h
diff --git a/iw.h b/iw.h
index 16ff0765307ea3d46114e4f9939d7e716cb61f18..bc0b3acbc408a649baa34bb8f8ba42f99624322a 100644 (file)
--- a/iw.h
+++ b/iw.h
@@ -106,8 +106,7 @@ struct chandef {
 
 #define __COMMAND(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help, _sel)\
        static struct cmd                                               \
-       __cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden\
-       __attribute__((used)) __attribute__((section("__cmd"))) = {     \
+       __cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden = {\
                .name = (_name),                                        \
                .args = (_args),                                        \
                .cmd = (_nlcmd),                                        \
@@ -118,7 +117,10 @@ struct chandef {
                .help = (_help),                                        \
                .parent = _section,                                     \
                .selector = (_sel),                                     \
-       }
+       };                                                              \
+       static struct cmd *__cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden ## _p \
+       __attribute__((used,section("__cmd"))) =                        \
+       &__cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden
 #define __ACMD(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help, _sel, _alias)\
        __COMMAND(_section, _symname, _name, _args, _nlcmd, _flags, _hidden, _idby, _handler, _help, _sel);\
        static const struct cmd *_alias = &__cmd ## _ ## _symname ## _ ## _handler ## _ ## _nlcmd ## _ ## _idby ## _ ## _hidden
@@ -130,10 +132,7 @@ struct chandef {
        __COMMAND(&(__section ## _ ## section), name, #name, args, cmd, flags, 1, idby, handler, NULL, NULL)
 
 #define TOPLEVEL(_name, _args, _nlcmd, _flags, _idby, _handler, _help) \
-       extern struct cmd __section ## _ ## _name; /* sparse */         \
-       struct cmd                                                      \
-       __section ## _ ## _name                                         \
-       __attribute__((used)) __attribute__((section("__cmd"))) = {     \
+       struct cmd __section ## _ ## _name = {                          \
                .name = (#_name),                                       \
                .args = (_args),                                        \
                .cmd = (_nlcmd),                                        \
@@ -141,14 +140,17 @@ struct chandef {
                .idby = (_idby),                                        \
                .handler = (_handler),                                  \
                .help = (_help),                                        \
-        }
+        };                                                             \
+       static struct cmd *__section ## _ ## _name ## _p                \
+       __attribute__((used,section("__cmd"))) = &__section ## _ ## _name
+
 #define SECTION(_name)                                                 \
-       extern struct cmd __section ## _ ## _name; /* sparse */         \
-       struct cmd __section ## _ ## _name                              \
-       __attribute__((used)) __attribute__((section("__cmd"))) = {     \
+       struct cmd __section ## _ ## _name = {                          \
                .name = (#_name),                                       \
                .hidden = 1,                                            \
-       }
+       };                                                              \
+       static struct cmd *__section ## _ ## _name ## _p                \
+       __attribute__((used,section("__cmd"))) = &__section ## _ ## _name
 
 #define DECLARE_SECTION(_name)                                         \
        extern struct cmd __section ## _ ## _name;
@@ -195,6 +197,7 @@ void print_ampdu_length(__u8 exponent);
 void print_ampdu_spacing(__u8 spacing);
 void print_ht_capability(__u16 cap);
 void print_vht_info(__u32 capa, const __u8 *mcs);
+void print_he_info(struct nlattr *nl_iftype);
 
 char *channel_width_name(enum nl80211_chan_width width);
 const char *iftype_name(enum nl80211_iftype iftype);