Lines Matching +full:sub +full:- +full:space

4  * Authors :	Jean Tourrilhes - HPL - <[email protected]>
5 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
22 if ((dev->wireless_handlers->num_private_args == 0) || in iw_handler_get_private()
23 (dev->wireless_handlers->private_args == NULL)) in iw_handler_get_private()
24 return -EOPNOTSUPP; in iw_handler_get_private()
27 if (wrqu->data.length < dev->wireless_handlers->num_private_args) { in iw_handler_get_private()
28 /* User space can't know in advance how large the buffer in iw_handler_get_private()
31 wrqu->data.length = dev->wireless_handlers->num_private_args; in iw_handler_get_private()
32 return -E2BIG; in iw_handler_get_private()
36 wrqu->data.length = dev->wireless_handlers->num_private_args; in iw_handler_get_private()
39 memcpy(extra, dev->wireless_handlers->private_args, in iw_handler_get_private()
40 sizeof(struct iw_priv_args) * wrqu->data.length); in iw_handler_get_private()
67 int num = iwp->length; in adjust_priv_size()
81 * user space and kernel space.
100 for (i = 0; i < dev->wireless_handlers->num_private_args; i++) { in get_priv_descr_and_size()
101 if (cmd == dev->wireless_handlers->private_args[i].cmd) { in get_priv_descr_and_size()
102 descr = &dev->wireless_handlers->private_args[i]; in get_priv_descr_and_size()
110 int offset = 0; /* For sub-ioctls */ in get_priv_descr_and_size()
111 /* Check for sub-ioctl handler */ in get_priv_descr_and_size()
112 if (descr->name[0] == '\0') in get_priv_descr_and_size()
113 /* Reserve one int for sub-ioctl index */ in get_priv_descr_and_size()
117 extra_size = get_priv_size(descr->set_args); in get_priv_descr_and_size()
120 if ((descr->set_args & IW_PRIV_SIZE_FIXED) && in get_priv_descr_and_size()
125 extra_size = get_priv_size(descr->get_args); in get_priv_descr_and_size()
128 if ((descr->get_args & IW_PRIV_SIZE_FIXED) && in get_priv_descr_and_size()
145 /* Check what user space is giving us */ in ioctl_private_iw_point()
147 if (!iwp->pointer && iwp->length != 0) in ioctl_private_iw_point()
148 return -EFAULT; in ioctl_private_iw_point()
150 if (iwp->length > (descr->set_args & IW_PRIV_SIZE_MASK)) in ioctl_private_iw_point()
151 return -E2BIG; in ioctl_private_iw_point()
152 } else if (!iwp->pointer) in ioctl_private_iw_point()
153 return -EFAULT; in ioctl_private_iw_point()
157 return -ENOMEM; in ioctl_private_iw_point()
160 if (IW_IS_SET(cmd) && (iwp->length != 0)) { in ioctl_private_iw_point()
161 if (copy_from_user(extra, iwp->pointer, extra_size)) { in ioctl_private_iw_point()
162 err = -EFAULT; in ioctl_private_iw_point()
175 if (!(descr->get_args & IW_PRIV_SIZE_FIXED)) in ioctl_private_iw_point()
176 extra_size = adjust_priv_size(descr->get_args, iwp); in ioctl_private_iw_point()
178 if (copy_to_user(iwp->pointer, extra, extra_size)) in ioctl_private_iw_point()
179 err = -EFAULT; in ioctl_private_iw_point()
191 int extra_size = 0, ret = -EINVAL; in ioctl_private_call()
196 /* Check if we have a pointer to user space data or not. */ in ioctl_private_call()
199 ret = handler(dev, info, &(iwr->u), (char *) &(iwr->u)); in ioctl_private_call()
201 ret = ioctl_private_iw_point(&iwr->u.data, cmd, descr, in ioctl_private_call()
206 if (ret == -EIWCOMMIT) in ioctl_private_call()
222 /* Check if we have a pointer to user space data or not. */ in compat_private_call()
225 ret = handler(dev, info, &(iwr->u), (char *) &(iwr->u)); in compat_private_call()
230 iwp_compat = (struct compat_iw_point *) &iwr->u.data; in compat_private_call()
231 iwp.pointer = compat_ptr(iwp_compat->pointer); in compat_private_call()
232 iwp.length = iwp_compat->length; in compat_private_call()
233 iwp.flags = iwp_compat->flags; in compat_private_call()
238 iwp_compat->pointer = ptr_to_compat(iwp.pointer); in compat_private_call()
239 iwp_compat->length = iwp.length; in compat_private_call()
240 iwp_compat->flags = iwp.flags; in compat_private_call()
244 if (ret == -EIWCOMMIT) in compat_private_call()