|
34 | 34 | #include <net/bluetooth/bluetooth.h> |
35 | 35 | #include <linux/proc_fs.h> |
36 | 36 |
|
37 | | -#include <linux/ethtool.h> |
38 | | -#include <linux/sockios.h> |
39 | | - |
40 | 37 | #include "leds.h" |
41 | 38 | #include "selftest.h" |
42 | 39 |
|
@@ -566,86 +563,6 @@ __poll_t bt_sock_poll(struct file *file, struct socket *sock, |
566 | 563 | } |
567 | 564 | EXPORT_SYMBOL(bt_sock_poll); |
568 | 565 |
|
569 | | -static int bt_ethtool_get_ts_info(struct sock *sk, unsigned int index, |
570 | | - void __user *useraddr) |
571 | | -{ |
572 | | - struct ethtool_ts_info info; |
573 | | - struct kernel_ethtool_ts_info ts_info = {}; |
574 | | - int ret; |
575 | | - |
576 | | - ret = hci_ethtool_ts_info(index, sk->sk_protocol, &ts_info); |
577 | | - if (ret == -ENODEV) |
578 | | - return ret; |
579 | | - else if (ret < 0) |
580 | | - return -EIO; |
581 | | - |
582 | | - memset(&info, 0, sizeof(info)); |
583 | | - |
584 | | - info.cmd = ETHTOOL_GET_TS_INFO; |
585 | | - info.so_timestamping = ts_info.so_timestamping; |
586 | | - info.phc_index = ts_info.phc_index; |
587 | | - info.tx_types = ts_info.tx_types; |
588 | | - info.rx_filters = ts_info.rx_filters; |
589 | | - |
590 | | - if (copy_to_user(useraddr, &info, sizeof(info))) |
591 | | - return -EFAULT; |
592 | | - |
593 | | - return 0; |
594 | | -} |
595 | | - |
596 | | -static int bt_ethtool(struct sock *sk, const struct ifreq *ifr, |
597 | | - void __user *useraddr) |
598 | | -{ |
599 | | - unsigned int index; |
600 | | - u32 ethcmd; |
601 | | - int n; |
602 | | - |
603 | | - if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd))) |
604 | | - return -EFAULT; |
605 | | - |
606 | | - if (sscanf(ifr->ifr_name, "hci%u%n", &index, &n) != 1 || |
607 | | - n != strlen(ifr->ifr_name)) |
608 | | - return -ENODEV; |
609 | | - |
610 | | - switch (ethcmd) { |
611 | | - case ETHTOOL_GET_TS_INFO: |
612 | | - return bt_ethtool_get_ts_info(sk, index, useraddr); |
613 | | - } |
614 | | - |
615 | | - return -EOPNOTSUPP; |
616 | | -} |
617 | | - |
618 | | -static int bt_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg) |
619 | | -{ |
620 | | - struct sock *sk = sock->sk; |
621 | | - struct ifreq ifr = {}; |
622 | | - void __user *data; |
623 | | - char *colon; |
624 | | - int ret = -ENOIOCTLCMD; |
625 | | - |
626 | | - if (get_user_ifreq(&ifr, &data, arg)) |
627 | | - return -EFAULT; |
628 | | - |
629 | | - ifr.ifr_name[IFNAMSIZ - 1] = 0; |
630 | | - colon = strchr(ifr.ifr_name, ':'); |
631 | | - if (colon) |
632 | | - *colon = 0; |
633 | | - |
634 | | - switch (cmd) { |
635 | | - case SIOCETHTOOL: |
636 | | - ret = bt_ethtool(sk, &ifr, data); |
637 | | - break; |
638 | | - } |
639 | | - |
640 | | - if (colon) |
641 | | - *colon = ':'; |
642 | | - |
643 | | - if (put_user_ifreq(&ifr, arg)) |
644 | | - return -EFAULT; |
645 | | - |
646 | | - return ret; |
647 | | -} |
648 | | - |
649 | 566 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
650 | 567 | { |
651 | 568 | struct sock *sk = sock->sk; |
@@ -678,10 +595,6 @@ int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
678 | 595 | err = put_user(amount, (int __user *)arg); |
679 | 596 | break; |
680 | 597 |
|
681 | | - case SIOCETHTOOL: |
682 | | - err = bt_dev_ioctl(sock, cmd, (void __user *)arg); |
683 | | - break; |
684 | | - |
685 | 598 | default: |
686 | 599 | err = -ENOIOCTLCMD; |
687 | 600 | break; |
|
0 commit comments