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

wext: Parameterize the standard/private handlers.

The WEXT standard and private handlers to use are now
arguments to wireless_process_ioctl().

Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David S. Miller and committed by
David S. Miller
ca1e8bb8 67dd7608

+16 -8
+16 -8
net/wireless/wext.c
··· 1015 1015 } 1016 1016 1017 1017 /* ---------------------------------------------------------------- */ 1018 + typedef int (*wext_ioctl_func)(struct net_device *, struct ifreq *, 1019 + unsigned int, iw_handler); 1020 + 1018 1021 /* 1019 1022 * Main IOCTl dispatcher. 1020 1023 * Check the type of IOCTL and call the appropriate wrapper... 1021 1024 */ 1022 - static int wireless_process_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd) 1025 + static int wireless_process_ioctl(struct net *net, struct ifreq *ifr, 1026 + unsigned int cmd, 1027 + wext_ioctl_func standard, 1028 + wext_ioctl_func private) 1023 1029 { 1024 1030 struct net_device *dev; 1025 1031 iw_handler handler; ··· 1041 1035 * Note that 'cmd' is already filtered in dev_ioctl() with 1042 1036 * (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) */ 1043 1037 if (cmd == SIOCGIWSTATS) 1044 - return ioctl_standard_call(dev, ifr, cmd, 1045 - &iw_handler_get_iwstats); 1038 + return standard(dev, ifr, cmd, 1039 + &iw_handler_get_iwstats); 1046 1040 1047 1041 if (cmd == SIOCGIWPRIV && dev->wireless_handlers) 1048 - return ioctl_standard_call(dev, ifr, cmd, 1049 - &iw_handler_get_private); 1042 + return standard(dev, ifr, cmd, 1043 + &iw_handler_get_private); 1050 1044 1051 1045 /* Basic check */ 1052 1046 if (!netif_device_present(dev)) ··· 1057 1051 if (handler) { 1058 1052 /* Standard and private are not the same */ 1059 1053 if (cmd < SIOCIWFIRSTPRIV) 1060 - return ioctl_standard_call(dev, ifr, cmd, handler); 1054 + return standard(dev, ifr, cmd, handler); 1061 1055 else 1062 - return ioctl_private_call(dev, ifr, cmd, handler); 1056 + return private(dev, ifr, cmd, handler); 1063 1057 } 1064 1058 /* Old driver API : call driver ioctl handler */ 1065 1059 if (dev->do_ioctl) ··· 1090 1084 1091 1085 dev_load(net, ifr->ifr_name); 1092 1086 rtnl_lock(); 1093 - ret = wireless_process_ioctl(net, ifr, cmd); 1087 + ret = wireless_process_ioctl(net, ifr, cmd, 1088 + ioctl_standard_call, 1089 + ioctl_private_call); 1094 1090 rtnl_unlock(); 1095 1091 if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct iwreq))) 1096 1092 return -EFAULT;