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

wext: Pass iwreq pointer down into standard/private handlers.

They have no need to see the object as an ifreq.

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

authored by

David S. Miller and committed by
David S. Miller
d2911255 ca1e8bb8

+8 -9
+8 -9
net/wireless/wext.c
··· 832 832 * user space and kernel space. 833 833 */ 834 834 static int ioctl_standard_call(struct net_device * dev, 835 - struct ifreq * ifr, 835 + struct iwreq *iwr, 836 836 unsigned int cmd, 837 837 iw_handler handler) 838 838 { 839 - struct iwreq * iwr = (struct iwreq *) ifr; 840 839 const struct iw_ioctl_description * descr; 841 840 struct iw_request_info info; 842 841 int ret = -EINVAL; ··· 983 984 return err; 984 985 } 985 986 986 - static int ioctl_private_call(struct net_device *dev, struct ifreq *ifr, 987 + static int ioctl_private_call(struct net_device *dev, struct iwreq *iwr, 987 988 unsigned int cmd, iw_handler handler) 988 989 { 989 - struct iwreq *iwr = (struct iwreq *) ifr; 990 990 int extra_size = 0, ret = -EINVAL; 991 991 const struct iw_priv_args *descr; 992 992 struct iw_request_info info; ··· 1013 1015 } 1014 1016 1015 1017 /* ---------------------------------------------------------------- */ 1016 - typedef int (*wext_ioctl_func)(struct net_device *, struct ifreq *, 1018 + typedef int (*wext_ioctl_func)(struct net_device *, struct iwreq *, 1017 1019 unsigned int, iw_handler); 1018 1020 1019 1021 /* ··· 1025 1027 wext_ioctl_func standard, 1026 1028 wext_ioctl_func private) 1027 1029 { 1030 + struct iwreq *iwr = (struct iwreq *) ifr; 1028 1031 struct net_device *dev; 1029 1032 iw_handler handler; 1030 1033 ··· 1040 1041 * Note that 'cmd' is already filtered in dev_ioctl() with 1041 1042 * (cmd >= SIOCIWFIRST && cmd <= SIOCIWLAST) */ 1042 1043 if (cmd == SIOCGIWSTATS) 1043 - return standard(dev, ifr, cmd, 1044 + return standard(dev, iwr, cmd, 1044 1045 &iw_handler_get_iwstats); 1045 1046 1046 1047 if (cmd == SIOCGIWPRIV && dev->wireless_handlers) 1047 - return standard(dev, ifr, cmd, 1048 + return standard(dev, iwr, cmd, 1048 1049 &iw_handler_get_private); 1049 1050 1050 1051 /* Basic check */ ··· 1056 1057 if (handler) { 1057 1058 /* Standard and private are not the same */ 1058 1059 if (cmd < SIOCIWFIRSTPRIV) 1059 - return standard(dev, ifr, cmd, handler); 1060 + return standard(dev, iwr, cmd, handler); 1060 1061 else 1061 - return private(dev, ifr, cmd, handler); 1062 + return private(dev, iwr, cmd, handler); 1062 1063 } 1063 1064 /* Old driver API : call driver ioctl handler */ 1064 1065 if (dev->do_ioctl)