Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

orinoco: Use a macro to define wireless handlers

The macro identifiers for the various ioctls required for WPA support
are longer than those currently used by the driver. This makes it messy
to keep line length below 80 character.

By defining a macro to initialise the handler table, we recover the
common text.

Signed-off-by: David Kilroy <kilroyd@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

David Kilroy and committed by
John W. Linville
409644a9 6cd90b1c

+34 -32
+34 -32
drivers/net/wireless/orinoco.c
··· 5043 5043 * Structures to export the Wireless Handlers 5044 5044 */ 5045 5045 5046 + #define STD_IW_HANDLER(id, func) \ 5047 + [IW_IOCTL_IDX(id)] = (iw_handler) func 5046 5048 static const iw_handler orinoco_handler[] = { 5047 - [SIOCSIWCOMMIT-SIOCIWFIRST] = (iw_handler) orinoco_ioctl_commit, 5048 - [SIOCGIWNAME -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getname, 5049 - [SIOCSIWFREQ -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setfreq, 5050 - [SIOCGIWFREQ -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getfreq, 5051 - [SIOCSIWMODE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setmode, 5052 - [SIOCGIWMODE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getmode, 5053 - [SIOCSIWSENS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setsens, 5054 - [SIOCGIWSENS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getsens, 5055 - [SIOCGIWRANGE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getiwrange, 5056 - [SIOCSIWSPY -SIOCIWFIRST] = (iw_handler) iw_handler_set_spy, 5057 - [SIOCGIWSPY -SIOCIWFIRST] = (iw_handler) iw_handler_get_spy, 5058 - [SIOCSIWTHRSPY-SIOCIWFIRST] = (iw_handler) iw_handler_set_thrspy, 5059 - [SIOCGIWTHRSPY-SIOCIWFIRST] = (iw_handler) iw_handler_get_thrspy, 5060 - [SIOCSIWAP -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setwap, 5061 - [SIOCGIWAP -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getwap, 5062 - [SIOCSIWSCAN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setscan, 5063 - [SIOCGIWSCAN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getscan, 5064 - [SIOCSIWESSID -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setessid, 5065 - [SIOCGIWESSID -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getessid, 5066 - [SIOCSIWNICKN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setnick, 5067 - [SIOCGIWNICKN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getnick, 5068 - [SIOCSIWRATE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setrate, 5069 - [SIOCGIWRATE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getrate, 5070 - [SIOCSIWRTS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setrts, 5071 - [SIOCGIWRTS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getrts, 5072 - [SIOCSIWFRAG -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setfrag, 5073 - [SIOCGIWFRAG -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getfrag, 5074 - [SIOCGIWRETRY -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getretry, 5075 - [SIOCSIWENCODE-SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setiwencode, 5076 - [SIOCGIWENCODE-SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getiwencode, 5077 - [SIOCSIWPOWER -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setpower, 5078 - [SIOCGIWPOWER -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getpower, 5049 + STD_IW_HANDLER(SIOCSIWCOMMIT, orinoco_ioctl_commit), 5050 + STD_IW_HANDLER(SIOCGIWNAME, orinoco_ioctl_getname), 5051 + STD_IW_HANDLER(SIOCSIWFREQ, orinoco_ioctl_setfreq), 5052 + STD_IW_HANDLER(SIOCGIWFREQ, orinoco_ioctl_getfreq), 5053 + STD_IW_HANDLER(SIOCSIWMODE, orinoco_ioctl_setmode), 5054 + STD_IW_HANDLER(SIOCGIWMODE, orinoco_ioctl_getmode), 5055 + STD_IW_HANDLER(SIOCSIWSENS, orinoco_ioctl_setsens), 5056 + STD_IW_HANDLER(SIOCGIWSENS, orinoco_ioctl_getsens), 5057 + STD_IW_HANDLER(SIOCGIWRANGE, orinoco_ioctl_getiwrange), 5058 + STD_IW_HANDLER(SIOCSIWSPY, iw_handler_set_spy), 5059 + STD_IW_HANDLER(SIOCGIWSPY, iw_handler_get_spy), 5060 + STD_IW_HANDLER(SIOCSIWTHRSPY, iw_handler_set_thrspy), 5061 + STD_IW_HANDLER(SIOCGIWTHRSPY, iw_handler_get_thrspy), 5062 + STD_IW_HANDLER(SIOCSIWAP, orinoco_ioctl_setwap), 5063 + STD_IW_HANDLER(SIOCGIWAP, orinoco_ioctl_getwap), 5064 + STD_IW_HANDLER(SIOCSIWSCAN, orinoco_ioctl_setscan), 5065 + STD_IW_HANDLER(SIOCGIWSCAN, orinoco_ioctl_getscan), 5066 + STD_IW_HANDLER(SIOCSIWESSID, orinoco_ioctl_setessid), 5067 + STD_IW_HANDLER(SIOCGIWESSID, orinoco_ioctl_getessid), 5068 + STD_IW_HANDLER(SIOCSIWNICKN, orinoco_ioctl_setnick), 5069 + STD_IW_HANDLER(SIOCGIWNICKN, orinoco_ioctl_getnick), 5070 + STD_IW_HANDLER(SIOCSIWRATE, orinoco_ioctl_setrate), 5071 + STD_IW_HANDLER(SIOCGIWRATE, orinoco_ioctl_getrate), 5072 + STD_IW_HANDLER(SIOCSIWRTS, orinoco_ioctl_setrts), 5073 + STD_IW_HANDLER(SIOCGIWRTS, orinoco_ioctl_getrts), 5074 + STD_IW_HANDLER(SIOCSIWFRAG, orinoco_ioctl_setfrag), 5075 + STD_IW_HANDLER(SIOCGIWFRAG, orinoco_ioctl_getfrag), 5076 + STD_IW_HANDLER(SIOCGIWRETRY, orinoco_ioctl_getretry), 5077 + STD_IW_HANDLER(SIOCSIWENCODE, orinoco_ioctl_setiwencode), 5078 + STD_IW_HANDLER(SIOCGIWENCODE, orinoco_ioctl_getiwencode), 5079 + STD_IW_HANDLER(SIOCSIWPOWER, orinoco_ioctl_setpower), 5080 + STD_IW_HANDLER(SIOCGIWPOWER, orinoco_ioctl_getpower), 5079 5081 }; 5080 5082 5081 5083