use IW_HANDLER to declare wext handlers

Use the IW_HANDLER macro to declare the handler functions for
wext ioctls. We don't have to skip unused ioctl numbers manually.

The same modification was applied to the deprecated rtl8188eu driver in
commit af249fce390f ("staging: rtl8188eu: use IW_HANDLER to declare wext
handlers").

Link: https://lore.kernel.org/r/20210807153636.11712-11-martin@kaiser.cx
This commit is contained in:
Martin Kaiser 2021-08-07 17:36:34 +02:00 committed by Carlos Garcés
parent 03af80bee9
commit 0faae6386e

View File

@ -12023,62 +12023,47 @@ free_buf:
} }
static iw_handler rtw_handlers[] = { static iw_handler rtw_handlers[] = {
NULL, /* SIOCSIWCOMMIT */ IW_HANDLER(SIOCGIWNAME, rtw_wx_get_name),
rtw_wx_get_name, /* SIOCGIWNAME */ IW_HANDLER(SIOCSIWNWID, dummy),
dummy, /* SIOCSIWNWID */ IW_HANDLER(SIOCGIWNWID, dummy),
dummy, /* SIOCGIWNWID */ IW_HANDLER(SIOCGIWFREQ, rtw_wx_set_freq),
rtw_wx_set_freq, /* SIOCSIWFREQ */ IW_HANDLER(SIOCGIWFREQ, rtw_wx_get_freq),
rtw_wx_get_freq, /* SIOCGIWFREQ */ IW_HANDLER(SIOCSIWMODE, rtw_wx_set_mode),
rtw_wx_set_mode, /* SIOCSIWMODE */ IW_HANDLER(SIOCGIWMODE, rtw_wx_get_mode),
rtw_wx_get_mode, /* SIOCGIWMODE */ IW_HANDLER(SIOCSIWSENS, dummy),
dummy, /* SIOCSIWSENS */ IW_HANDLER(SIOCGIWSENS, rtw_wx_get_sens),
rtw_wx_get_sens, /* SIOCGIWSENS */ IW_HANDLER(SIOCGIWRANGE, rtw_wx_get_range),
NULL, /* SIOCSIWRANGE */ IW_HANDLER(SIOCSIWPRIV, rtw_wx_set_priv),
rtw_wx_get_range, /* SIOCGIWRANGE */ IW_HANDLER(SIOCSIWSPY, dummy),
rtw_wx_set_priv, /* SIOCSIWPRIV */ IW_HANDLER(SIOCGIWSPY, dummy),
NULL, /* SIOCGIWPRIV */ IW_HANDLER(SIOCSIWAP, rtw_wx_set_wap),
NULL, /* SIOCSIWSTATS */ IW_HANDLER(SIOCGIWAP, rtw_wx_get_wap),
NULL, /* SIOCGIWSTATS */ IW_HANDLER(SIOCSIWMLME, rtw_wx_set_mlme),
dummy, /* SIOCSIWSPY */ IW_HANDLER(SIOCGIWAPLIST, dummy),
dummy, /* SIOCGIWSPY */ IW_HANDLER(SIOCSIWSCAN, rtw_wx_set_scan),
NULL, /* SIOCGIWTHRSPY */ IW_HANDLER(SIOCGIWSCAN, rtw_wx_get_scan),
NULL, /* SIOCWIWTHRSPY */ IW_HANDLER(SIOCSIWESSID, rtw_wx_set_essid),
rtw_wx_set_wap, /* SIOCSIWAP */ IW_HANDLER(SIOCGIWESSID, rtw_wx_get_essid),
rtw_wx_get_wap, /* SIOCGIWAP */ IW_HANDLER(SIOCSIWNICKN, dummy),
rtw_wx_set_mlme, /* request MLME operation; uses struct iw_mlme */ IW_HANDLER(SIOCGIWNICKN, rtw_wx_get_nick),
dummy, /* SIOCGIWAPLIST -- depricated */ IW_HANDLER(SIOCSIWRATE, rtw_wx_set_rate),
rtw_wx_set_scan, /* SIOCSIWSCAN */ IW_HANDLER(SIOCGIWRATE, rtw_wx_get_rate),
rtw_wx_get_scan, /* SIOCGIWSCAN */ IW_HANDLER(SIOCSIWRTS, rtw_wx_set_rts),
rtw_wx_set_essid, /* SIOCSIWESSID */ IW_HANDLER(SIOCGIWRTS, rtw_wx_get_rts),
rtw_wx_get_essid, /* SIOCGIWESSID */ IW_HANDLER(SIOCSIWFRAG, rtw_wx_set_frag),
dummy, /* SIOCSIWNICKN */ IW_HANDLER(SIOCGIWFRAG, rtw_wx_get_frag),
rtw_wx_get_nick, /* SIOCGIWNICKN */ IW_HANDLER(SIOCSIWTXPOW, dummy),
NULL, /* -- hole -- */ IW_HANDLER(SIOCGIWTXPOW, dummy),
NULL, /* -- hole -- */ IW_HANDLER(SIOCSIWRETRY, dummy),
rtw_wx_set_rate, /* SIOCSIWRATE */ IW_HANDLER(SIOCGIWRETRY, rtw_wx_get_retry),
rtw_wx_get_rate, /* SIOCGIWRATE */ IW_HANDLER(SIOCSIWENCODE, rtw_wx_set_enc),
rtw_wx_set_rts, /* SIOCSIWRTS */ IW_HANDLER(SIOCGIWENCODE, rtw_wx_get_enc),
rtw_wx_get_rts, /* SIOCGIWRTS */ IW_HANDLER(SIOCSIWPOWER, dummy),
rtw_wx_set_frag, /* SIOCSIWFRAG */ IW_HANDLER(SIOCGIWPOWER, rtw_wx_get_power),
rtw_wx_get_frag, /* SIOCGIWFRAG */ IW_HANDLER(SIOCSIWGENIE, rtw_wx_set_gen_ie),
dummy, /* SIOCSIWTXPOW */ IW_HANDLER(SIOCSIWAUTH, rtw_wx_set_auth),
dummy, /* SIOCGIWTXPOW */ IW_HANDLER(SIOCSIWENCODEEXT, rtw_wx_set_enc_ext),
dummy, /* SIOCSIWRETRY */ IW_HANDLER(SIOCSIWPMKSA, rtw_wx_set_pmkid),
rtw_wx_get_retry, /* SIOCGIWRETRY */
rtw_wx_set_enc, /* SIOCSIWENCODE */
rtw_wx_get_enc, /* SIOCGIWENCODE */
dummy, /* SIOCSIWPOWER */
rtw_wx_get_power, /* SIOCGIWPOWER */
NULL, /*---hole---*/
NULL, /*---hole---*/
rtw_wx_set_gen_ie, /* SIOCSIWGENIE */
NULL, /* SIOCGWGENIE */
rtw_wx_set_auth, /* SIOCSIWAUTH */
NULL, /* SIOCGIWAUTH */
rtw_wx_set_enc_ext, /* SIOCSIWENCODEEXT */
NULL, /* SIOCGIWENCODEEXT */
rtw_wx_set_pmkid, /* SIOCSIWPMKSA */
NULL, /*---hole---*/
}; };