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

wifi: hostap: remove unused ioctl function

The ioctl handler has no actual callers in the kernel and is useless.
All the functionality should be reachable through the regualar interfaces.

Acked-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231011140225.253106-9-arnd@kernel.org

authored by

Arnd Bergmann and committed by
Kalle Valo
f35ccb65 166ab7ca

-232
-1
drivers/net/wireless/intersil/hostap/hostap.h
··· 92 92 extern const struct iw_handler_def hostap_iw_handler_def; 93 93 extern const struct ethtool_ops prism2_ethtool_ops; 94 94 95 - int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); 96 95 int hostap_siocdevprivate(struct net_device *dev, struct ifreq *ifr, 97 96 void __user *data, int cmd); 98 97
-228
drivers/net/wireless/intersil/hostap/hostap_ioctl.c
··· 2316 2316 }; 2317 2317 2318 2318 2319 - static int prism2_ioctl_priv_inquire(struct net_device *dev, int *i) 2320 - { 2321 - struct hostap_interface *iface; 2322 - local_info_t *local; 2323 - 2324 - iface = netdev_priv(dev); 2325 - local = iface->local; 2326 - 2327 - if (local->func->cmd(dev, HFA384X_CMDCODE_INQUIRE, *i, NULL, NULL)) 2328 - return -EOPNOTSUPP; 2329 - 2330 - return 0; 2331 - } 2332 - 2333 - 2334 2319 static int prism2_ioctl_priv_prism2_param(struct net_device *dev, 2335 2320 struct iw_request_info *info, 2336 2321 union iwreq_data *uwrq, char *extra) ··· 2893 2908 2894 2909 return 0; 2895 2910 } 2896 - 2897 - 2898 - static int prism2_ioctl_priv_monitor(struct net_device *dev, int *i) 2899 - { 2900 - struct hostap_interface *iface; 2901 - local_info_t *local; 2902 - int ret = 0; 2903 - union iwreq_data wrqu; 2904 - 2905 - iface = netdev_priv(dev); 2906 - local = iface->local; 2907 - 2908 - printk(KERN_DEBUG "%s: process %d (%s) used deprecated iwpriv monitor " 2909 - "- update software to use iwconfig mode monitor\n", 2910 - dev->name, task_pid_nr(current), current->comm); 2911 - 2912 - /* Backward compatibility code - this can be removed at some point */ 2913 - 2914 - if (*i == 0) { 2915 - /* Disable monitor mode - old mode was not saved, so go to 2916 - * Master mode */ 2917 - wrqu.mode = IW_MODE_MASTER; 2918 - ret = prism2_ioctl_siwmode(dev, NULL, &wrqu, NULL); 2919 - } else if (*i == 1) { 2920 - /* netlink socket mode is not supported anymore since it did 2921 - * not separate different devices from each other and was not 2922 - * best method for delivering large amount of packets to 2923 - * user space */ 2924 - ret = -EOPNOTSUPP; 2925 - } else if (*i == 2 || *i == 3) { 2926 - switch (*i) { 2927 - case 2: 2928 - local->monitor_type = PRISM2_MONITOR_80211; 2929 - break; 2930 - case 3: 2931 - local->monitor_type = PRISM2_MONITOR_PRISM; 2932 - break; 2933 - } 2934 - wrqu.mode = IW_MODE_MONITOR; 2935 - ret = prism2_ioctl_siwmode(dev, NULL, &wrqu, NULL); 2936 - hostap_monitor_mode_enable(local); 2937 - } else 2938 - ret = -EINVAL; 2939 - 2940 - return ret; 2941 - } 2942 - 2943 - 2944 - static int prism2_ioctl_priv_reset(struct net_device *dev, int *i) 2945 - { 2946 - struct hostap_interface *iface; 2947 - local_info_t *local; 2948 - 2949 - iface = netdev_priv(dev); 2950 - local = iface->local; 2951 - 2952 - printk(KERN_DEBUG "%s: manual reset request(%d)\n", dev->name, *i); 2953 - switch (*i) { 2954 - case 0: 2955 - /* Disable and enable card */ 2956 - local->func->hw_shutdown(dev, 1); 2957 - local->func->hw_config(dev, 0); 2958 - break; 2959 - 2960 - case 1: 2961 - /* COR sreset */ 2962 - local->func->hw_reset(dev); 2963 - break; 2964 - 2965 - case 2: 2966 - /* Disable and enable port 0 */ 2967 - local->func->reset_port(dev); 2968 - break; 2969 - 2970 - case 3: 2971 - prism2_sta_deauth(local, WLAN_REASON_DEAUTH_LEAVING); 2972 - if (local->func->cmd(dev, HFA384X_CMDCODE_DISABLE, 0, NULL, 2973 - NULL)) 2974 - return -EINVAL; 2975 - break; 2976 - 2977 - case 4: 2978 - if (local->func->cmd(dev, HFA384X_CMDCODE_ENABLE, 0, NULL, 2979 - NULL)) 2980 - return -EINVAL; 2981 - break; 2982 - 2983 - default: 2984 - printk(KERN_DEBUG "Unknown reset request %d\n", *i); 2985 - return -EOPNOTSUPP; 2986 - } 2987 - 2988 - return 0; 2989 - } 2990 - 2991 - 2992 - static int prism2_ioctl_priv_set_rid_word(struct net_device *dev, int *i) 2993 - { 2994 - int rid = *i; 2995 - int value = *(i + 1); 2996 - 2997 - printk(KERN_DEBUG "%s: Set RID[0x%X] = %d\n", dev->name, rid, value); 2998 - 2999 - if (hostap_set_word(dev, rid, value)) 3000 - return -EINVAL; 3001 - 3002 - return 0; 3003 - } 3004 - 3005 - 3006 - #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 3007 - static int ap_mac_cmd_ioctl(local_info_t *local, int *cmd) 3008 - { 3009 - int ret = 0; 3010 - 3011 - switch (*cmd) { 3012 - case AP_MAC_CMD_POLICY_OPEN: 3013 - local->ap->mac_restrictions.policy = MAC_POLICY_OPEN; 3014 - break; 3015 - case AP_MAC_CMD_POLICY_ALLOW: 3016 - local->ap->mac_restrictions.policy = MAC_POLICY_ALLOW; 3017 - break; 3018 - case AP_MAC_CMD_POLICY_DENY: 3019 - local->ap->mac_restrictions.policy = MAC_POLICY_DENY; 3020 - break; 3021 - case AP_MAC_CMD_FLUSH: 3022 - ap_control_flush_macs(&local->ap->mac_restrictions); 3023 - break; 3024 - case AP_MAC_CMD_KICKALL: 3025 - ap_control_kickall(local->ap); 3026 - hostap_deauth_all_stas(local->dev, local->ap, 0); 3027 - break; 3028 - default: 3029 - ret = -EOPNOTSUPP; 3030 - break; 3031 - } 3032 - 3033 - return ret; 3034 - } 3035 - #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3036 2911 3037 2912 3038 2913 #ifdef PRISM2_DOWNLOAD_SUPPORT ··· 3808 3963 .get_wireless_stats = hostap_get_wireless_stats, 3809 3964 }; 3810 3965 3811 - /* Private ioctls (iwpriv) that have not yet been converted 3812 - * into new wireless extensions API */ 3813 - int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) 3814 - { 3815 - struct iwreq *wrq = (struct iwreq *) ifr; 3816 - struct hostap_interface *iface; 3817 - local_info_t *local; 3818 - int ret = 0; 3819 - 3820 - iface = netdev_priv(dev); 3821 - local = iface->local; 3822 - 3823 - switch (cmd) { 3824 - case PRISM2_IOCTL_INQUIRE: 3825 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3826 - else ret = prism2_ioctl_priv_inquire(dev, (int *) wrq->u.name); 3827 - break; 3828 - 3829 - case PRISM2_IOCTL_MONITOR: 3830 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3831 - else ret = prism2_ioctl_priv_monitor(dev, (int *) wrq->u.name); 3832 - break; 3833 - 3834 - case PRISM2_IOCTL_RESET: 3835 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3836 - else ret = prism2_ioctl_priv_reset(dev, (int *) wrq->u.name); 3837 - break; 3838 - 3839 - case PRISM2_IOCTL_WDS_ADD: 3840 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3841 - else ret = prism2_wds_add(local, wrq->u.ap_addr.sa_data, 1); 3842 - break; 3843 - 3844 - case PRISM2_IOCTL_WDS_DEL: 3845 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3846 - else ret = prism2_wds_del(local, wrq->u.ap_addr.sa_data, 1, 0); 3847 - break; 3848 - 3849 - case PRISM2_IOCTL_SET_RID_WORD: 3850 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3851 - else ret = prism2_ioctl_priv_set_rid_word(dev, 3852 - (int *) wrq->u.name); 3853 - break; 3854 - 3855 - #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 3856 - case PRISM2_IOCTL_MACCMD: 3857 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3858 - else ret = ap_mac_cmd_ioctl(local, (int *) wrq->u.name); 3859 - break; 3860 - 3861 - case PRISM2_IOCTL_ADDMAC: 3862 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3863 - else ret = ap_control_add_mac(&local->ap->mac_restrictions, 3864 - wrq->u.ap_addr.sa_data); 3865 - break; 3866 - case PRISM2_IOCTL_DELMAC: 3867 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3868 - else ret = ap_control_del_mac(&local->ap->mac_restrictions, 3869 - wrq->u.ap_addr.sa_data); 3870 - break; 3871 - case PRISM2_IOCTL_KICKMAC: 3872 - if (!capable(CAP_NET_ADMIN)) ret = -EPERM; 3873 - else ret = ap_control_kick_mac(local->ap, local->dev, 3874 - wrq->u.ap_addr.sa_data); 3875 - break; 3876 - #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3877 - default: 3878 - ret = -EOPNOTSUPP; 3879 - break; 3880 - } 3881 - 3882 - return ret; 3883 - } 3884 3966 3885 3967 /* Private ioctls that are not used with iwpriv; 3886 3968 * in SIOCDEVPRIVATE range */
-3
drivers/net/wireless/intersil/hostap/hostap_main.c
··· 796 796 797 797 .ndo_open = prism2_open, 798 798 .ndo_stop = prism2_close, 799 - .ndo_do_ioctl = hostap_ioctl, 800 799 .ndo_siocdevprivate = hostap_siocdevprivate, 801 800 .ndo_set_mac_address = prism2_set_mac_address, 802 801 .ndo_set_rx_mode = hostap_set_multicast_list, ··· 808 809 809 810 .ndo_open = prism2_open, 810 811 .ndo_stop = prism2_close, 811 - .ndo_do_ioctl = hostap_ioctl, 812 812 .ndo_siocdevprivate = hostap_siocdevprivate, 813 813 .ndo_set_mac_address = prism2_set_mac_address, 814 814 .ndo_set_rx_mode = hostap_set_multicast_list, ··· 820 822 821 823 .ndo_open = prism2_open, 822 824 .ndo_stop = prism2_close, 823 - .ndo_do_ioctl = hostap_ioctl, 824 825 .ndo_siocdevprivate = hostap_siocdevprivate, 825 826 .ndo_set_mac_address = prism2_set_mac_address, 826 827 .ndo_set_rx_mode = hostap_set_multicast_list,