diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/compat_ioctl.c | 722 |
1 files changed, 0 insertions, 722 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 50d2a5fdc94a..cacf8a83e394 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -246,422 +246,6 @@ static int do_video_set_spu_palette(unsigned int fd, unsigned int cmd, unsigned | |||
246 | return err; | 246 | return err; |
247 | } | 247 | } |
248 | 248 | ||
249 | #ifdef CONFIG_NET | ||
250 | static int do_siocgstamp(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
251 | { | ||
252 | struct compat_timeval __user *up = compat_ptr(arg); | ||
253 | struct timeval ktv; | ||
254 | mm_segment_t old_fs = get_fs(); | ||
255 | int err; | ||
256 | |||
257 | set_fs(KERNEL_DS); | ||
258 | err = sys_ioctl(fd, cmd, (unsigned long)&ktv); | ||
259 | set_fs(old_fs); | ||
260 | if(!err) { | ||
261 | err = put_user(ktv.tv_sec, &up->tv_sec); | ||
262 | err |= __put_user(ktv.tv_usec, &up->tv_usec); | ||
263 | } | ||
264 | return err; | ||
265 | } | ||
266 | |||
267 | static int do_siocgstampns(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
268 | { | ||
269 | struct compat_timespec __user *up = compat_ptr(arg); | ||
270 | struct timespec kts; | ||
271 | mm_segment_t old_fs = get_fs(); | ||
272 | int err; | ||
273 | |||
274 | set_fs(KERNEL_DS); | ||
275 | err = sys_ioctl(fd, cmd, (unsigned long)&kts); | ||
276 | set_fs(old_fs); | ||
277 | if (!err) { | ||
278 | err = put_user(kts.tv_sec, &up->tv_sec); | ||
279 | err |= __put_user(kts.tv_nsec, &up->tv_nsec); | ||
280 | } | ||
281 | return err; | ||
282 | } | ||
283 | |||
284 | struct ifmap32 { | ||
285 | compat_ulong_t mem_start; | ||
286 | compat_ulong_t mem_end; | ||
287 | unsigned short base_addr; | ||
288 | unsigned char irq; | ||
289 | unsigned char dma; | ||
290 | unsigned char port; | ||
291 | }; | ||
292 | |||
293 | struct ifreq32 { | ||
294 | #define IFHWADDRLEN 6 | ||
295 | #define IFNAMSIZ 16 | ||
296 | union { | ||
297 | char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | ||
298 | } ifr_ifrn; | ||
299 | union { | ||
300 | struct sockaddr ifru_addr; | ||
301 | struct sockaddr ifru_dstaddr; | ||
302 | struct sockaddr ifru_broadaddr; | ||
303 | struct sockaddr ifru_netmask; | ||
304 | struct sockaddr ifru_hwaddr; | ||
305 | short ifru_flags; | ||
306 | compat_int_t ifru_ivalue; | ||
307 | compat_int_t ifru_mtu; | ||
308 | struct ifmap32 ifru_map; | ||
309 | char ifru_slave[IFNAMSIZ]; /* Just fits the size */ | ||
310 | char ifru_newname[IFNAMSIZ]; | ||
311 | compat_caddr_t ifru_data; | ||
312 | /* XXXX? ifru_settings should be here */ | ||
313 | } ifr_ifru; | ||
314 | }; | ||
315 | |||
316 | struct ifconf32 { | ||
317 | compat_int_t ifc_len; /* size of buffer */ | ||
318 | compat_caddr_t ifcbuf; | ||
319 | }; | ||
320 | |||
321 | static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
322 | { | ||
323 | struct ifreq __user *uifr; | ||
324 | int err; | ||
325 | |||
326 | uifr = compat_alloc_user_space(sizeof(struct ifreq)); | ||
327 | if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32))) | ||
328 | return -EFAULT; | ||
329 | |||
330 | err = sys_ioctl(fd, SIOCGIFNAME, (unsigned long)uifr); | ||
331 | if (err) | ||
332 | return err; | ||
333 | |||
334 | if (copy_in_user(compat_ptr(arg), uifr, sizeof(struct ifreq32))) | ||
335 | return -EFAULT; | ||
336 | |||
337 | return 0; | ||
338 | } | ||
339 | |||
340 | static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
341 | { | ||
342 | struct ifconf32 ifc32; | ||
343 | struct ifconf ifc; | ||
344 | struct ifconf __user *uifc; | ||
345 | struct ifreq32 __user *ifr32; | ||
346 | struct ifreq __user *ifr; | ||
347 | unsigned int i, j; | ||
348 | int err; | ||
349 | |||
350 | if (copy_from_user(&ifc32, compat_ptr(arg), sizeof(struct ifconf32))) | ||
351 | return -EFAULT; | ||
352 | |||
353 | if (ifc32.ifcbuf == 0) { | ||
354 | ifc32.ifc_len = 0; | ||
355 | ifc.ifc_len = 0; | ||
356 | ifc.ifc_req = NULL; | ||
357 | uifc = compat_alloc_user_space(sizeof(struct ifconf)); | ||
358 | } else { | ||
359 | size_t len =((ifc32.ifc_len / sizeof (struct ifreq32)) + 1) * | ||
360 | sizeof (struct ifreq); | ||
361 | uifc = compat_alloc_user_space(sizeof(struct ifconf) + len); | ||
362 | ifc.ifc_len = len; | ||
363 | ifr = ifc.ifc_req = (void __user *)(uifc + 1); | ||
364 | ifr32 = compat_ptr(ifc32.ifcbuf); | ||
365 | for (i = 0; i < ifc32.ifc_len; i += sizeof (struct ifreq32)) { | ||
366 | if (copy_in_user(ifr, ifr32, sizeof(struct ifreq32))) | ||
367 | return -EFAULT; | ||
368 | ifr++; | ||
369 | ifr32++; | ||
370 | } | ||
371 | } | ||
372 | if (copy_to_user(uifc, &ifc, sizeof(struct ifconf))) | ||
373 | return -EFAULT; | ||
374 | |||
375 | err = sys_ioctl (fd, SIOCGIFCONF, (unsigned long)uifc); | ||
376 | if (err) | ||
377 | return err; | ||
378 | |||
379 | if (copy_from_user(&ifc, uifc, sizeof(struct ifconf))) | ||
380 | return -EFAULT; | ||
381 | |||
382 | ifr = ifc.ifc_req; | ||
383 | ifr32 = compat_ptr(ifc32.ifcbuf); | ||
384 | for (i = 0, j = 0; | ||
385 | i + sizeof (struct ifreq32) <= ifc32.ifc_len && j < ifc.ifc_len; | ||
386 | i += sizeof (struct ifreq32), j += sizeof (struct ifreq)) { | ||
387 | if (copy_in_user(ifr32, ifr, sizeof (struct ifreq32))) | ||
388 | return -EFAULT; | ||
389 | ifr32++; | ||
390 | ifr++; | ||
391 | } | ||
392 | |||
393 | if (ifc32.ifcbuf == 0) { | ||
394 | /* Translate from 64-bit structure multiple to | ||
395 | * a 32-bit one. | ||
396 | */ | ||
397 | i = ifc.ifc_len; | ||
398 | i = ((i / sizeof(struct ifreq)) * sizeof(struct ifreq32)); | ||
399 | ifc32.ifc_len = i; | ||
400 | } else { | ||
401 | ifc32.ifc_len = i; | ||
402 | } | ||
403 | if (copy_to_user(compat_ptr(arg), &ifc32, sizeof(struct ifconf32))) | ||
404 | return -EFAULT; | ||
405 | |||
406 | return 0; | ||
407 | } | ||
408 | |||
409 | static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
410 | { | ||
411 | struct ifreq __user *ifr; | ||
412 | struct ifreq32 __user *ifr32; | ||
413 | u32 data; | ||
414 | void __user *datap; | ||
415 | |||
416 | ifr = compat_alloc_user_space(sizeof(*ifr)); | ||
417 | ifr32 = compat_ptr(arg); | ||
418 | |||
419 | if (copy_in_user(&ifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ)) | ||
420 | return -EFAULT; | ||
421 | |||
422 | if (get_user(data, &ifr32->ifr_ifru.ifru_data)) | ||
423 | return -EFAULT; | ||
424 | |||
425 | datap = compat_ptr(data); | ||
426 | if (put_user(datap, &ifr->ifr_ifru.ifru_data)) | ||
427 | return -EFAULT; | ||
428 | |||
429 | return sys_ioctl(fd, cmd, (unsigned long) ifr); | ||
430 | } | ||
431 | |||
432 | static int bond_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
433 | { | ||
434 | struct ifreq kifr; | ||
435 | struct ifreq __user *uifr; | ||
436 | struct ifreq32 __user *ifr32 = compat_ptr(arg); | ||
437 | mm_segment_t old_fs; | ||
438 | int err; | ||
439 | u32 data; | ||
440 | void __user *datap; | ||
441 | |||
442 | switch (cmd) { | ||
443 | case SIOCBONDENSLAVE: | ||
444 | case SIOCBONDRELEASE: | ||
445 | case SIOCBONDSETHWADDR: | ||
446 | case SIOCBONDCHANGEACTIVE: | ||
447 | if (copy_from_user(&kifr, ifr32, sizeof(struct ifreq32))) | ||
448 | return -EFAULT; | ||
449 | |||
450 | old_fs = get_fs(); | ||
451 | set_fs (KERNEL_DS); | ||
452 | err = sys_ioctl (fd, cmd, (unsigned long)&kifr); | ||
453 | set_fs (old_fs); | ||
454 | |||
455 | return err; | ||
456 | case SIOCBONDSLAVEINFOQUERY: | ||
457 | case SIOCBONDINFOQUERY: | ||
458 | uifr = compat_alloc_user_space(sizeof(*uifr)); | ||
459 | if (copy_in_user(&uifr->ifr_name, &ifr32->ifr_name, IFNAMSIZ)) | ||
460 | return -EFAULT; | ||
461 | |||
462 | if (get_user(data, &ifr32->ifr_ifru.ifru_data)) | ||
463 | return -EFAULT; | ||
464 | |||
465 | datap = compat_ptr(data); | ||
466 | if (put_user(datap, &uifr->ifr_ifru.ifru_data)) | ||
467 | return -EFAULT; | ||
468 | |||
469 | return sys_ioctl (fd, cmd, (unsigned long)uifr); | ||
470 | default: | ||
471 | return -EINVAL; | ||
472 | }; | ||
473 | } | ||
474 | |||
475 | static int siocdevprivate_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
476 | { | ||
477 | struct ifreq __user *u_ifreq64; | ||
478 | struct ifreq32 __user *u_ifreq32 = compat_ptr(arg); | ||
479 | char tmp_buf[IFNAMSIZ]; | ||
480 | void __user *data64; | ||
481 | u32 data32; | ||
482 | |||
483 | if (copy_from_user(&tmp_buf[0], &(u_ifreq32->ifr_ifrn.ifrn_name[0]), | ||
484 | IFNAMSIZ)) | ||
485 | return -EFAULT; | ||
486 | if (__get_user(data32, &u_ifreq32->ifr_ifru.ifru_data)) | ||
487 | return -EFAULT; | ||
488 | data64 = compat_ptr(data32); | ||
489 | |||
490 | u_ifreq64 = compat_alloc_user_space(sizeof(*u_ifreq64)); | ||
491 | |||
492 | /* Don't check these user accesses, just let that get trapped | ||
493 | * in the ioctl handler instead. | ||
494 | */ | ||
495 | if (copy_to_user(&u_ifreq64->ifr_ifrn.ifrn_name[0], &tmp_buf[0], | ||
496 | IFNAMSIZ)) | ||
497 | return -EFAULT; | ||
498 | if (__put_user(data64, &u_ifreq64->ifr_ifru.ifru_data)) | ||
499 | return -EFAULT; | ||
500 | |||
501 | return sys_ioctl(fd, cmd, (unsigned long) u_ifreq64); | ||
502 | } | ||
503 | |||
504 | static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
505 | { | ||
506 | struct ifreq ifr; | ||
507 | struct ifreq32 __user *uifr32; | ||
508 | struct ifmap32 __user *uifmap32; | ||
509 | mm_segment_t old_fs; | ||
510 | int err; | ||
511 | |||
512 | uifr32 = compat_ptr(arg); | ||
513 | uifmap32 = &uifr32->ifr_ifru.ifru_map; | ||
514 | switch (cmd) { | ||
515 | case SIOCSIFMAP: | ||
516 | err = copy_from_user(&ifr, uifr32, sizeof(ifr.ifr_name)); | ||
517 | err |= __get_user(ifr.ifr_map.mem_start, &uifmap32->mem_start); | ||
518 | err |= __get_user(ifr.ifr_map.mem_end, &uifmap32->mem_end); | ||
519 | err |= __get_user(ifr.ifr_map.base_addr, &uifmap32->base_addr); | ||
520 | err |= __get_user(ifr.ifr_map.irq, &uifmap32->irq); | ||
521 | err |= __get_user(ifr.ifr_map.dma, &uifmap32->dma); | ||
522 | err |= __get_user(ifr.ifr_map.port, &uifmap32->port); | ||
523 | if (err) | ||
524 | return -EFAULT; | ||
525 | break; | ||
526 | case SIOCSHWTSTAMP: | ||
527 | if (copy_from_user(&ifr, uifr32, sizeof(*uifr32))) | ||
528 | return -EFAULT; | ||
529 | ifr.ifr_data = compat_ptr(uifr32->ifr_ifru.ifru_data); | ||
530 | break; | ||
531 | default: | ||
532 | if (copy_from_user(&ifr, uifr32, sizeof(*uifr32))) | ||
533 | return -EFAULT; | ||
534 | break; | ||
535 | } | ||
536 | old_fs = get_fs(); | ||
537 | set_fs (KERNEL_DS); | ||
538 | err = sys_ioctl (fd, cmd, (unsigned long)&ifr); | ||
539 | set_fs (old_fs); | ||
540 | if (!err) { | ||
541 | switch (cmd) { | ||
542 | case SIOCGIFFLAGS: | ||
543 | case SIOCGIFMETRIC: | ||
544 | case SIOCGIFMTU: | ||
545 | case SIOCGIFMEM: | ||
546 | case SIOCGIFHWADDR: | ||
547 | case SIOCGIFINDEX: | ||
548 | case SIOCGIFADDR: | ||
549 | case SIOCGIFBRDADDR: | ||
550 | case SIOCGIFDSTADDR: | ||
551 | case SIOCGIFNETMASK: | ||
552 | case SIOCGIFTXQLEN: | ||
553 | if (copy_to_user(uifr32, &ifr, sizeof(*uifr32))) | ||
554 | return -EFAULT; | ||
555 | break; | ||
556 | case SIOCGIFMAP: | ||
557 | err = copy_to_user(uifr32, &ifr, sizeof(ifr.ifr_name)); | ||
558 | err |= __put_user(ifr.ifr_map.mem_start, &uifmap32->mem_start); | ||
559 | err |= __put_user(ifr.ifr_map.mem_end, &uifmap32->mem_end); | ||
560 | err |= __put_user(ifr.ifr_map.base_addr, &uifmap32->base_addr); | ||
561 | err |= __put_user(ifr.ifr_map.irq, &uifmap32->irq); | ||
562 | err |= __put_user(ifr.ifr_map.dma, &uifmap32->dma); | ||
563 | err |= __put_user(ifr.ifr_map.port, &uifmap32->port); | ||
564 | if (err) | ||
565 | err = -EFAULT; | ||
566 | break; | ||
567 | } | ||
568 | } | ||
569 | return err; | ||
570 | } | ||
571 | |||
572 | struct rtentry32 { | ||
573 | u32 rt_pad1; | ||
574 | struct sockaddr rt_dst; /* target address */ | ||
575 | struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */ | ||
576 | struct sockaddr rt_genmask; /* target network mask (IP) */ | ||
577 | unsigned short rt_flags; | ||
578 | short rt_pad2; | ||
579 | u32 rt_pad3; | ||
580 | unsigned char rt_tos; | ||
581 | unsigned char rt_class; | ||
582 | short rt_pad4; | ||
583 | short rt_metric; /* +1 for binary compatibility! */ | ||
584 | /* char * */ u32 rt_dev; /* forcing the device at add */ | ||
585 | u32 rt_mtu; /* per route MTU/Window */ | ||
586 | u32 rt_window; /* Window clamping */ | ||
587 | unsigned short rt_irtt; /* Initial RTT */ | ||
588 | |||
589 | }; | ||
590 | |||
591 | struct in6_rtmsg32 { | ||
592 | struct in6_addr rtmsg_dst; | ||
593 | struct in6_addr rtmsg_src; | ||
594 | struct in6_addr rtmsg_gateway; | ||
595 | u32 rtmsg_type; | ||
596 | u16 rtmsg_dst_len; | ||
597 | u16 rtmsg_src_len; | ||
598 | u32 rtmsg_metric; | ||
599 | u32 rtmsg_info; | ||
600 | u32 rtmsg_flags; | ||
601 | s32 rtmsg_ifindex; | ||
602 | }; | ||
603 | |||
604 | static int routing_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
605 | { | ||
606 | int ret; | ||
607 | void *r = NULL; | ||
608 | struct in6_rtmsg r6; | ||
609 | struct rtentry r4; | ||
610 | char devname[16]; | ||
611 | u32 rtdev; | ||
612 | mm_segment_t old_fs = get_fs(); | ||
613 | |||
614 | struct socket *mysock = sockfd_lookup(fd, &ret); | ||
615 | |||
616 | if (mysock && mysock->sk && mysock->sk->sk_family == AF_INET6) { /* ipv6 */ | ||
617 | struct in6_rtmsg32 __user *ur6 = compat_ptr(arg); | ||
618 | ret = copy_from_user (&r6.rtmsg_dst, &(ur6->rtmsg_dst), | ||
619 | 3 * sizeof(struct in6_addr)); | ||
620 | ret |= __get_user (r6.rtmsg_type, &(ur6->rtmsg_type)); | ||
621 | ret |= __get_user (r6.rtmsg_dst_len, &(ur6->rtmsg_dst_len)); | ||
622 | ret |= __get_user (r6.rtmsg_src_len, &(ur6->rtmsg_src_len)); | ||
623 | ret |= __get_user (r6.rtmsg_metric, &(ur6->rtmsg_metric)); | ||
624 | ret |= __get_user (r6.rtmsg_info, &(ur6->rtmsg_info)); | ||
625 | ret |= __get_user (r6.rtmsg_flags, &(ur6->rtmsg_flags)); | ||
626 | ret |= __get_user (r6.rtmsg_ifindex, &(ur6->rtmsg_ifindex)); | ||
627 | |||
628 | r = (void *) &r6; | ||
629 | } else { /* ipv4 */ | ||
630 | struct rtentry32 __user *ur4 = compat_ptr(arg); | ||
631 | ret = copy_from_user (&r4.rt_dst, &(ur4->rt_dst), | ||
632 | 3 * sizeof(struct sockaddr)); | ||
633 | ret |= __get_user (r4.rt_flags, &(ur4->rt_flags)); | ||
634 | ret |= __get_user (r4.rt_metric, &(ur4->rt_metric)); | ||
635 | ret |= __get_user (r4.rt_mtu, &(ur4->rt_mtu)); | ||
636 | ret |= __get_user (r4.rt_window, &(ur4->rt_window)); | ||
637 | ret |= __get_user (r4.rt_irtt, &(ur4->rt_irtt)); | ||
638 | ret |= __get_user (rtdev, &(ur4->rt_dev)); | ||
639 | if (rtdev) { | ||
640 | ret |= copy_from_user (devname, compat_ptr(rtdev), 15); | ||
641 | r4.rt_dev = devname; devname[15] = 0; | ||
642 | } else | ||
643 | r4.rt_dev = NULL; | ||
644 | |||
645 | r = (void *) &r4; | ||
646 | } | ||
647 | |||
648 | if (ret) { | ||
649 | ret = -EFAULT; | ||
650 | goto out; | ||
651 | } | ||
652 | |||
653 | set_fs (KERNEL_DS); | ||
654 | ret = sys_ioctl (fd, cmd, (unsigned long) r); | ||
655 | set_fs (old_fs); | ||
656 | |||
657 | out: | ||
658 | if (mysock) | ||
659 | sockfd_put(mysock); | ||
660 | |||
661 | return ret; | ||
662 | } | ||
663 | #endif | ||
664 | |||
665 | #ifdef CONFIG_BLOCK | 249 | #ifdef CONFIG_BLOCK |
666 | typedef struct sg_io_hdr32 { | 250 | typedef struct sg_io_hdr32 { |
667 | compat_int_t interface_id; /* [i] 'S' for SCSI generic (required) */ | 251 | compat_int_t interface_id; /* [i] 'S' for SCSI generic (required) */ |
@@ -1206,170 +790,6 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, unsigned long a | |||
1206 | return err; | 790 | return err; |
1207 | } | 791 | } |
1208 | 792 | ||
1209 | struct atmif_sioc32 { | ||
1210 | compat_int_t number; | ||
1211 | compat_int_t length; | ||
1212 | compat_caddr_t arg; | ||
1213 | }; | ||
1214 | |||
1215 | struct atm_iobuf32 { | ||
1216 | compat_int_t length; | ||
1217 | compat_caddr_t buffer; | ||
1218 | }; | ||
1219 | |||
1220 | #define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32) | ||
1221 | #define ATM_GETNAMES32 _IOW('a', ATMIOC_ITF+3, struct atm_iobuf32) | ||
1222 | #define ATM_GETTYPE32 _IOW('a', ATMIOC_ITF+4, struct atmif_sioc32) | ||
1223 | #define ATM_GETESI32 _IOW('a', ATMIOC_ITF+5, struct atmif_sioc32) | ||
1224 | #define ATM_GETADDR32 _IOW('a', ATMIOC_ITF+6, struct atmif_sioc32) | ||
1225 | #define ATM_RSTADDR32 _IOW('a', ATMIOC_ITF+7, struct atmif_sioc32) | ||
1226 | #define ATM_ADDADDR32 _IOW('a', ATMIOC_ITF+8, struct atmif_sioc32) | ||
1227 | #define ATM_DELADDR32 _IOW('a', ATMIOC_ITF+9, struct atmif_sioc32) | ||
1228 | #define ATM_GETCIRANGE32 _IOW('a', ATMIOC_ITF+10, struct atmif_sioc32) | ||
1229 | #define ATM_SETCIRANGE32 _IOW('a', ATMIOC_ITF+11, struct atmif_sioc32) | ||
1230 | #define ATM_SETESI32 _IOW('a', ATMIOC_ITF+12, struct atmif_sioc32) | ||
1231 | #define ATM_SETESIF32 _IOW('a', ATMIOC_ITF+13, struct atmif_sioc32) | ||
1232 | #define ATM_GETSTAT32 _IOW('a', ATMIOC_SARCOM+0, struct atmif_sioc32) | ||
1233 | #define ATM_GETSTATZ32 _IOW('a', ATMIOC_SARCOM+1, struct atmif_sioc32) | ||
1234 | #define ATM_GETLOOP32 _IOW('a', ATMIOC_SARCOM+2, struct atmif_sioc32) | ||
1235 | #define ATM_SETLOOP32 _IOW('a', ATMIOC_SARCOM+3, struct atmif_sioc32) | ||
1236 | #define ATM_QUERYLOOP32 _IOW('a', ATMIOC_SARCOM+4, struct atmif_sioc32) | ||
1237 | |||
1238 | static struct { | ||
1239 | unsigned int cmd32; | ||
1240 | unsigned int cmd; | ||
1241 | } atm_ioctl_map[] = { | ||
1242 | { ATM_GETLINKRATE32, ATM_GETLINKRATE }, | ||
1243 | { ATM_GETNAMES32, ATM_GETNAMES }, | ||
1244 | { ATM_GETTYPE32, ATM_GETTYPE }, | ||
1245 | { ATM_GETESI32, ATM_GETESI }, | ||
1246 | { ATM_GETADDR32, ATM_GETADDR }, | ||
1247 | { ATM_RSTADDR32, ATM_RSTADDR }, | ||
1248 | { ATM_ADDADDR32, ATM_ADDADDR }, | ||
1249 | { ATM_DELADDR32, ATM_DELADDR }, | ||
1250 | { ATM_GETCIRANGE32, ATM_GETCIRANGE }, | ||
1251 | { ATM_SETCIRANGE32, ATM_SETCIRANGE }, | ||
1252 | { ATM_SETESI32, ATM_SETESI }, | ||
1253 | { ATM_SETESIF32, ATM_SETESIF }, | ||
1254 | { ATM_GETSTAT32, ATM_GETSTAT }, | ||
1255 | { ATM_GETSTATZ32, ATM_GETSTATZ }, | ||
1256 | { ATM_GETLOOP32, ATM_GETLOOP }, | ||
1257 | { ATM_SETLOOP32, ATM_SETLOOP }, | ||
1258 | { ATM_QUERYLOOP32, ATM_QUERYLOOP } | ||
1259 | }; | ||
1260 | |||
1261 | #define NR_ATM_IOCTL ARRAY_SIZE(atm_ioctl_map) | ||
1262 | |||
1263 | static int do_atm_iobuf(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
1264 | { | ||
1265 | struct atm_iobuf __user *iobuf; | ||
1266 | struct atm_iobuf32 __user *iobuf32; | ||
1267 | u32 data; | ||
1268 | void __user *datap; | ||
1269 | int len, err; | ||
1270 | |||
1271 | iobuf = compat_alloc_user_space(sizeof(*iobuf)); | ||
1272 | iobuf32 = compat_ptr(arg); | ||
1273 | |||
1274 | if (get_user(len, &iobuf32->length) || | ||
1275 | get_user(data, &iobuf32->buffer)) | ||
1276 | return -EFAULT; | ||
1277 | datap = compat_ptr(data); | ||
1278 | if (put_user(len, &iobuf->length) || | ||
1279 | put_user(datap, &iobuf->buffer)) | ||
1280 | return -EFAULT; | ||
1281 | |||
1282 | err = sys_ioctl(fd, cmd, (unsigned long)iobuf); | ||
1283 | |||
1284 | if (!err) { | ||
1285 | if (copy_in_user(&iobuf32->length, &iobuf->length, | ||
1286 | sizeof(int))) | ||
1287 | err = -EFAULT; | ||
1288 | } | ||
1289 | |||
1290 | return err; | ||
1291 | } | ||
1292 | |||
1293 | static int do_atmif_sioc(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
1294 | { | ||
1295 | struct atmif_sioc __user *sioc; | ||
1296 | struct atmif_sioc32 __user *sioc32; | ||
1297 | u32 data; | ||
1298 | void __user *datap; | ||
1299 | int err; | ||
1300 | |||
1301 | sioc = compat_alloc_user_space(sizeof(*sioc)); | ||
1302 | sioc32 = compat_ptr(arg); | ||
1303 | |||
1304 | if (copy_in_user(&sioc->number, &sioc32->number, 2 * sizeof(int)) || | ||
1305 | get_user(data, &sioc32->arg)) | ||
1306 | return -EFAULT; | ||
1307 | datap = compat_ptr(data); | ||
1308 | if (put_user(datap, &sioc->arg)) | ||
1309 | return -EFAULT; | ||
1310 | |||
1311 | err = sys_ioctl(fd, cmd, (unsigned long) sioc); | ||
1312 | |||
1313 | if (!err) { | ||
1314 | if (copy_in_user(&sioc32->length, &sioc->length, | ||
1315 | sizeof(int))) | ||
1316 | err = -EFAULT; | ||
1317 | } | ||
1318 | return err; | ||
1319 | } | ||
1320 | |||
1321 | static int do_atm_ioctl(unsigned int fd, unsigned int cmd32, unsigned long arg) | ||
1322 | { | ||
1323 | int i; | ||
1324 | unsigned int cmd = 0; | ||
1325 | |||
1326 | switch (cmd32) { | ||
1327 | case SONET_GETSTAT: | ||
1328 | case SONET_GETSTATZ: | ||
1329 | case SONET_GETDIAG: | ||
1330 | case SONET_SETDIAG: | ||
1331 | case SONET_CLRDIAG: | ||
1332 | case SONET_SETFRAMING: | ||
1333 | case SONET_GETFRAMING: | ||
1334 | case SONET_GETFRSENSE: | ||
1335 | return do_atmif_sioc(fd, cmd32, arg); | ||
1336 | } | ||
1337 | |||
1338 | for (i = 0; i < NR_ATM_IOCTL; i++) { | ||
1339 | if (cmd32 == atm_ioctl_map[i].cmd32) { | ||
1340 | cmd = atm_ioctl_map[i].cmd; | ||
1341 | break; | ||
1342 | } | ||
1343 | } | ||
1344 | if (i == NR_ATM_IOCTL) | ||
1345 | return -EINVAL; | ||
1346 | |||
1347 | switch (cmd) { | ||
1348 | case ATM_GETNAMES: | ||
1349 | return do_atm_iobuf(fd, cmd, arg); | ||
1350 | |||
1351 | case ATM_GETLINKRATE: | ||
1352 | case ATM_GETTYPE: | ||
1353 | case ATM_GETESI: | ||
1354 | case ATM_GETADDR: | ||
1355 | case ATM_RSTADDR: | ||
1356 | case ATM_ADDADDR: | ||
1357 | case ATM_DELADDR: | ||
1358 | case ATM_GETCIRANGE: | ||
1359 | case ATM_SETCIRANGE: | ||
1360 | case ATM_SETESI: | ||
1361 | case ATM_SETESIF: | ||
1362 | case ATM_GETSTAT: | ||
1363 | case ATM_GETSTATZ: | ||
1364 | case ATM_GETLOOP: | ||
1365 | case ATM_SETLOOP: | ||
1366 | case ATM_QUERYLOOP: | ||
1367 | return do_atmif_sioc(fd, cmd, arg); | ||
1368 | } | ||
1369 | |||
1370 | return -EINVAL; | ||
1371 | } | ||
1372 | |||
1373 | static __used int | 793 | static __used int |
1374 | ret_einval(unsigned int fd, unsigned int cmd, unsigned long arg) | 794 | ret_einval(unsigned int fd, unsigned int cmd, unsigned long arg) |
1375 | { | 795 | { |
@@ -1712,21 +1132,6 @@ static int do_i2c_smbus_ioctl(unsigned int fd, unsigned int cmd, unsigned long a | |||
1712 | return sys_ioctl(fd, cmd, (unsigned long)tdata); | 1132 | return sys_ioctl(fd, cmd, (unsigned long)tdata); |
1713 | } | 1133 | } |
1714 | 1134 | ||
1715 | /* Since old style bridge ioctl's endup using SIOCDEVPRIVATE | ||
1716 | * for some operations; this forces use of the newer bridge-utils that | ||
1717 | * use compatible ioctls | ||
1718 | */ | ||
1719 | static int old_bridge_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) | ||
1720 | { | ||
1721 | u32 tmp; | ||
1722 | |||
1723 | if (get_user(tmp, (u32 __user *) arg)) | ||
1724 | return -EFAULT; | ||
1725 | if (tmp == BRCTL_GET_VERSION) | ||
1726 | return BRCTL_VERSION + 1; | ||
1727 | return -EINVAL; | ||
1728 | } | ||
1729 | |||
1730 | #define RTC_IRQP_READ32 _IOR('p', 0x0b, compat_ulong_t) | 1135 | #define RTC_IRQP_READ32 _IOR('p', 0x0b, compat_ulong_t) |
1731 | #define RTC_IRQP_SET32 _IOW('p', 0x0c, compat_ulong_t) | 1136 | #define RTC_IRQP_SET32 _IOW('p', 0x0c, compat_ulong_t) |
1732 | #define RTC_EPOCH_READ32 _IOR('p', 0x0d, compat_ulong_t) | 1137 | #define RTC_EPOCH_READ32 _IOR('p', 0x0d, compat_ulong_t) |
@@ -2014,28 +1419,6 @@ COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */ | |||
2014 | COMPATIBLE_IOCTL(MTIOCTOP) | 1419 | COMPATIBLE_IOCTL(MTIOCTOP) |
2015 | /* Socket level stuff */ | 1420 | /* Socket level stuff */ |
2016 | COMPATIBLE_IOCTL(FIOQSIZE) | 1421 | COMPATIBLE_IOCTL(FIOQSIZE) |
2017 | COMPATIBLE_IOCTL(FIOSETOWN) | ||
2018 | COMPATIBLE_IOCTL(SIOCSPGRP) | ||
2019 | COMPATIBLE_IOCTL(FIOGETOWN) | ||
2020 | COMPATIBLE_IOCTL(SIOCGPGRP) | ||
2021 | COMPATIBLE_IOCTL(SIOCATMARK) | ||
2022 | COMPATIBLE_IOCTL(SIOCSIFLINK) | ||
2023 | COMPATIBLE_IOCTL(SIOCSIFNAME) | ||
2024 | COMPATIBLE_IOCTL(SIOCSARP) | ||
2025 | COMPATIBLE_IOCTL(SIOCGARP) | ||
2026 | COMPATIBLE_IOCTL(SIOCDARP) | ||
2027 | COMPATIBLE_IOCTL(SIOCSRARP) | ||
2028 | COMPATIBLE_IOCTL(SIOCGRARP) | ||
2029 | COMPATIBLE_IOCTL(SIOCDRARP) | ||
2030 | COMPATIBLE_IOCTL(SIOCADDDLCI) | ||
2031 | COMPATIBLE_IOCTL(SIOCDELDLCI) | ||
2032 | COMPATIBLE_IOCTL(SIOCGMIIPHY) | ||
2033 | COMPATIBLE_IOCTL(SIOCGMIIREG) | ||
2034 | COMPATIBLE_IOCTL(SIOCSMIIREG) | ||
2035 | COMPATIBLE_IOCTL(SIOCGIFVLAN) | ||
2036 | COMPATIBLE_IOCTL(SIOCSIFVLAN) | ||
2037 | COMPATIBLE_IOCTL(SIOCBRADDBR) | ||
2038 | COMPATIBLE_IOCTL(SIOCBRDELBR) | ||
2039 | #ifdef CONFIG_BLOCK | 1422 | #ifdef CONFIG_BLOCK |
2040 | /* SG stuff */ | 1423 | /* SG stuff */ |
2041 | COMPATIBLE_IOCTL(SG_SET_TIMEOUT) | 1424 | COMPATIBLE_IOCTL(SG_SET_TIMEOUT) |
@@ -2291,22 +1674,6 @@ COMPATIBLE_IOCTL(RAW_SETBIND) | |||
2291 | COMPATIBLE_IOCTL(RAW_GETBIND) | 1674 | COMPATIBLE_IOCTL(RAW_GETBIND) |
2292 | /* SMB ioctls which do not need any translations */ | 1675 | /* SMB ioctls which do not need any translations */ |
2293 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) | 1676 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) |
2294 | /* Little a */ | ||
2295 | COMPATIBLE_IOCTL(ATMSIGD_CTRL) | ||
2296 | COMPATIBLE_IOCTL(ATMARPD_CTRL) | ||
2297 | COMPATIBLE_IOCTL(ATMLEC_CTRL) | ||
2298 | COMPATIBLE_IOCTL(ATMLEC_MCAST) | ||
2299 | COMPATIBLE_IOCTL(ATMLEC_DATA) | ||
2300 | COMPATIBLE_IOCTL(ATM_SETSC) | ||
2301 | COMPATIBLE_IOCTL(SIOCSIFATMTCP) | ||
2302 | COMPATIBLE_IOCTL(SIOCMKCLIP) | ||
2303 | COMPATIBLE_IOCTL(ATMARP_MKIP) | ||
2304 | COMPATIBLE_IOCTL(ATMARP_SETENTRY) | ||
2305 | COMPATIBLE_IOCTL(ATMARP_ENCAP) | ||
2306 | COMPATIBLE_IOCTL(ATMTCP_CREATE) | ||
2307 | COMPATIBLE_IOCTL(ATMTCP_REMOVE) | ||
2308 | COMPATIBLE_IOCTL(ATMMPC_CTRL) | ||
2309 | COMPATIBLE_IOCTL(ATMMPC_DATA) | ||
2310 | /* Watchdog */ | 1677 | /* Watchdog */ |
2311 | COMPATIBLE_IOCTL(WDIOC_GETSUPPORT) | 1678 | COMPATIBLE_IOCTL(WDIOC_GETSUPPORT) |
2312 | COMPATIBLE_IOCTL(WDIOC_GETSTATUS) | 1679 | COMPATIBLE_IOCTL(WDIOC_GETSTATUS) |
@@ -2512,60 +1879,6 @@ COMPATIBLE_IOCTL(JSIOCGBUTTONS) | |||
2512 | COMPATIBLE_IOCTL(JSIOCGNAME(0)) | 1879 | COMPATIBLE_IOCTL(JSIOCGNAME(0)) |
2513 | 1880 | ||
2514 | /* now things that need handlers */ | 1881 | /* now things that need handlers */ |
2515 | #ifdef CONFIG_NET | ||
2516 | HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32) | ||
2517 | HANDLE_IOCTL(SIOCGIFCONF, dev_ifconf) | ||
2518 | HANDLE_IOCTL(SIOCGIFFLAGS, dev_ifsioc) | ||
2519 | HANDLE_IOCTL(SIOCSIFFLAGS, dev_ifsioc) | ||
2520 | HANDLE_IOCTL(SIOCGIFMETRIC, dev_ifsioc) | ||
2521 | HANDLE_IOCTL(SIOCSIFMETRIC, dev_ifsioc) | ||
2522 | HANDLE_IOCTL(SIOCGIFMTU, dev_ifsioc) | ||
2523 | HANDLE_IOCTL(SIOCSIFMTU, dev_ifsioc) | ||
2524 | HANDLE_IOCTL(SIOCGIFMEM, dev_ifsioc) | ||
2525 | HANDLE_IOCTL(SIOCSIFMEM, dev_ifsioc) | ||
2526 | HANDLE_IOCTL(SIOCGIFHWADDR, dev_ifsioc) | ||
2527 | HANDLE_IOCTL(SIOCSIFHWADDR, dev_ifsioc) | ||
2528 | HANDLE_IOCTL(SIOCADDMULTI, dev_ifsioc) | ||
2529 | HANDLE_IOCTL(SIOCDELMULTI, dev_ifsioc) | ||
2530 | HANDLE_IOCTL(SIOCGIFINDEX, dev_ifsioc) | ||
2531 | HANDLE_IOCTL(SIOCGIFMAP, dev_ifsioc) | ||
2532 | HANDLE_IOCTL(SIOCSIFMAP, dev_ifsioc) | ||
2533 | HANDLE_IOCTL(SIOCGIFADDR, dev_ifsioc) | ||
2534 | HANDLE_IOCTL(SIOCSIFADDR, dev_ifsioc) | ||
2535 | HANDLE_IOCTL(SIOCSIFHWBROADCAST, dev_ifsioc) | ||
2536 | HANDLE_IOCTL(SIOCSHWTSTAMP, dev_ifsioc) | ||
2537 | |||
2538 | /* ioctls used by appletalk ddp.c */ | ||
2539 | HANDLE_IOCTL(SIOCDIFADDR, dev_ifsioc) | ||
2540 | HANDLE_IOCTL(SIOCSARP, dev_ifsioc) | ||
2541 | HANDLE_IOCTL(SIOCDARP, dev_ifsioc) | ||
2542 | |||
2543 | HANDLE_IOCTL(SIOCGIFBRDADDR, dev_ifsioc) | ||
2544 | HANDLE_IOCTL(SIOCSIFBRDADDR, dev_ifsioc) | ||
2545 | HANDLE_IOCTL(SIOCGIFDSTADDR, dev_ifsioc) | ||
2546 | HANDLE_IOCTL(SIOCSIFDSTADDR, dev_ifsioc) | ||
2547 | HANDLE_IOCTL(SIOCGIFNETMASK, dev_ifsioc) | ||
2548 | HANDLE_IOCTL(SIOCSIFNETMASK, dev_ifsioc) | ||
2549 | HANDLE_IOCTL(SIOCSIFPFLAGS, dev_ifsioc) | ||
2550 | HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc) | ||
2551 | HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc) | ||
2552 | HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc) | ||
2553 | HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl) | ||
2554 | HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl) | ||
2555 | HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl) | ||
2556 | HANDLE_IOCTL(SIOCBONDSETHWADDR, bond_ioctl) | ||
2557 | HANDLE_IOCTL(SIOCBONDSLAVEINFOQUERY, bond_ioctl) | ||
2558 | HANDLE_IOCTL(SIOCBONDINFOQUERY, bond_ioctl) | ||
2559 | HANDLE_IOCTL(SIOCBONDCHANGEACTIVE, bond_ioctl) | ||
2560 | HANDLE_IOCTL(SIOCADDRT, routing_ioctl) | ||
2561 | HANDLE_IOCTL(SIOCDELRT, routing_ioctl) | ||
2562 | HANDLE_IOCTL(SIOCBRADDIF, dev_ifsioc) | ||
2563 | HANDLE_IOCTL(SIOCBRDELIF, dev_ifsioc) | ||
2564 | /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */ | ||
2565 | HANDLE_IOCTL(SIOCRTMSG, ret_einval) | ||
2566 | HANDLE_IOCTL(SIOCGSTAMP, do_siocgstamp) | ||
2567 | HANDLE_IOCTL(SIOCGSTAMPNS, do_siocgstampns) | ||
2568 | #endif | ||
2569 | #ifdef CONFIG_BLOCK | 1882 | #ifdef CONFIG_BLOCK |
2570 | HANDLE_IOCTL(SG_IO,sg_ioctl_trans) | 1883 | HANDLE_IOCTL(SG_IO,sg_ioctl_trans) |
2571 | HANDLE_IOCTL(SG_GET_REQUEST_TABLE, sg_grt_trans) | 1884 | HANDLE_IOCTL(SG_GET_REQUEST_TABLE, sg_grt_trans) |
@@ -2590,31 +1903,6 @@ HANDLE_IOCTL(KDFONTOP, do_kdfontop_ioctl) | |||
2590 | /* One SMB ioctl needs translations. */ | 1903 | /* One SMB ioctl needs translations. */ |
2591 | #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) | 1904 | #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) |
2592 | HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid) | 1905 | HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32, do_smb_getmountuid) |
2593 | HANDLE_IOCTL(ATM_GETLINKRATE32, do_atm_ioctl) | ||
2594 | HANDLE_IOCTL(ATM_GETNAMES32, do_atm_ioctl) | ||
2595 | HANDLE_IOCTL(ATM_GETTYPE32, do_atm_ioctl) | ||
2596 | HANDLE_IOCTL(ATM_GETESI32, do_atm_ioctl) | ||
2597 | HANDLE_IOCTL(ATM_GETADDR32, do_atm_ioctl) | ||
2598 | HANDLE_IOCTL(ATM_RSTADDR32, do_atm_ioctl) | ||
2599 | HANDLE_IOCTL(ATM_ADDADDR32, do_atm_ioctl) | ||
2600 | HANDLE_IOCTL(ATM_DELADDR32, do_atm_ioctl) | ||
2601 | HANDLE_IOCTL(ATM_GETCIRANGE32, do_atm_ioctl) | ||
2602 | HANDLE_IOCTL(ATM_SETCIRANGE32, do_atm_ioctl) | ||
2603 | HANDLE_IOCTL(ATM_SETESI32, do_atm_ioctl) | ||
2604 | HANDLE_IOCTL(ATM_SETESIF32, do_atm_ioctl) | ||
2605 | HANDLE_IOCTL(ATM_GETSTAT32, do_atm_ioctl) | ||
2606 | HANDLE_IOCTL(ATM_GETSTATZ32, do_atm_ioctl) | ||
2607 | HANDLE_IOCTL(ATM_GETLOOP32, do_atm_ioctl) | ||
2608 | HANDLE_IOCTL(ATM_SETLOOP32, do_atm_ioctl) | ||
2609 | HANDLE_IOCTL(ATM_QUERYLOOP32, do_atm_ioctl) | ||
2610 | HANDLE_IOCTL(SONET_GETSTAT, do_atm_ioctl) | ||
2611 | HANDLE_IOCTL(SONET_GETSTATZ, do_atm_ioctl) | ||
2612 | HANDLE_IOCTL(SONET_GETDIAG, do_atm_ioctl) | ||
2613 | HANDLE_IOCTL(SONET_SETDIAG, do_atm_ioctl) | ||
2614 | HANDLE_IOCTL(SONET_CLRDIAG, do_atm_ioctl) | ||
2615 | HANDLE_IOCTL(SONET_SETFRAMING, do_atm_ioctl) | ||
2616 | HANDLE_IOCTL(SONET_GETFRAMING, do_atm_ioctl) | ||
2617 | HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl) | ||
2618 | /* block stuff */ | 1906 | /* block stuff */ |
2619 | #ifdef CONFIG_BLOCK | 1907 | #ifdef CONFIG_BLOCK |
2620 | /* loop */ | 1908 | /* loop */ |
@@ -2649,11 +1937,7 @@ COMPATIBLE_IOCTL(USBDEVFS_IOCTL32) | |||
2649 | HANDLE_IOCTL(I2C_FUNCS, w_long) | 1937 | HANDLE_IOCTL(I2C_FUNCS, w_long) |
2650 | HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctl) | 1938 | HANDLE_IOCTL(I2C_RDWR, do_i2c_rdwr_ioctl) |
2651 | HANDLE_IOCTL(I2C_SMBUS, do_i2c_smbus_ioctl) | 1939 | HANDLE_IOCTL(I2C_SMBUS, do_i2c_smbus_ioctl) |
2652 | /* bridge */ | ||
2653 | HANDLE_IOCTL(SIOCSIFBR, old_bridge_ioctl) | ||
2654 | HANDLE_IOCTL(SIOCGIFBR, old_bridge_ioctl) | ||
2655 | /* Not implemented in the native kernel */ | 1940 | /* Not implemented in the native kernel */ |
2656 | IGNORE_IOCTL(SIOCGIFCOUNT) | ||
2657 | HANDLE_IOCTL(RTC_IRQP_READ32, rtc_ioctl) | 1941 | HANDLE_IOCTL(RTC_IRQP_READ32, rtc_ioctl) |
2658 | HANDLE_IOCTL(RTC_IRQP_SET32, rtc_ioctl) | 1942 | HANDLE_IOCTL(RTC_IRQP_SET32, rtc_ioctl) |
2659 | HANDLE_IOCTL(RTC_EPOCH_READ32, rtc_ioctl) | 1943 | HANDLE_IOCTL(RTC_EPOCH_READ32, rtc_ioctl) |
@@ -2808,12 +2092,6 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | |||
2808 | goto found_handler; | 2092 | goto found_handler; |
2809 | } | 2093 | } |
2810 | 2094 | ||
2811 | #ifdef CONFIG_NET | ||
2812 | if (S_ISSOCK(filp->f_path.dentry->d_inode->i_mode) && | ||
2813 | cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { | ||
2814 | error = siocdevprivate_ioctl(fd, cmd, arg); | ||
2815 | } else | ||
2816 | #endif | ||
2817 | { | 2095 | { |
2818 | static int count; | 2096 | static int count; |
2819 | 2097 | ||