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

hostap: convert to net_device_ops

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
5ae4efbc 4cfa8e45

+52 -18
-1
drivers/net/wireless/hostap/hostap_hw.c
··· 3222 3222 3223 3223 hostap_setup_dev(dev, local, HOSTAP_INTERFACE_MASTER); 3224 3224 3225 - dev->hard_start_xmit = hostap_master_start_xmit; 3226 3225 dev->type = ARPHRD_IEEE80211; 3227 3226 dev->header_ops = &hostap_80211_ops; 3228 3227
+52 -17
drivers/net/wireless/hostap/hostap_main.c
··· 815 815 }; 816 816 EXPORT_SYMBOL(hostap_80211_ops); 817 817 818 + 819 + static const struct net_device_ops hostap_netdev_ops = { 820 + .ndo_start_xmit = hostap_data_start_xmit, 821 + 822 + .ndo_open = prism2_open, 823 + .ndo_stop = prism2_close, 824 + .ndo_do_ioctl = hostap_ioctl, 825 + .ndo_set_mac_address = prism2_set_mac_address, 826 + .ndo_set_multicast_list = hostap_set_multicast_list, 827 + .ndo_change_mtu = prism2_change_mtu, 828 + .ndo_tx_timeout = prism2_tx_timeout, 829 + .ndo_validate_addr = eth_validate_addr, 830 + }; 831 + 832 + static const struct net_device_ops hostap_mgmt_netdev_ops = { 833 + .ndo_start_xmit = hostap_mgmt_start_xmit, 834 + 835 + .ndo_open = prism2_open, 836 + .ndo_stop = prism2_close, 837 + .ndo_do_ioctl = hostap_ioctl, 838 + .ndo_set_mac_address = prism2_set_mac_address, 839 + .ndo_set_multicast_list = hostap_set_multicast_list, 840 + .ndo_change_mtu = prism2_change_mtu, 841 + .ndo_tx_timeout = prism2_tx_timeout, 842 + .ndo_validate_addr = eth_validate_addr, 843 + }; 844 + 845 + static const struct net_device_ops hostap_master_ops = { 846 + .ndo_start_xmit = hostap_master_start_xmit, 847 + 848 + .ndo_open = prism2_open, 849 + .ndo_stop = prism2_close, 850 + .ndo_do_ioctl = hostap_ioctl, 851 + .ndo_set_mac_address = prism2_set_mac_address, 852 + .ndo_set_multicast_list = hostap_set_multicast_list, 853 + .ndo_change_mtu = prism2_change_mtu, 854 + .ndo_tx_timeout = prism2_tx_timeout, 855 + .ndo_validate_addr = eth_validate_addr, 856 + }; 857 + 818 858 void hostap_setup_dev(struct net_device *dev, local_info_t *local, 819 859 int type) 820 860 { ··· 870 830 iface->wireless_data.spy_data = &iface->spy_data; 871 831 dev->wireless_data = &iface->wireless_data; 872 832 } 873 - dev->wireless_handlers = 874 - (struct iw_handler_def *) &hostap_iw_handler_def; 875 - dev->do_ioctl = hostap_ioctl; 876 - dev->open = prism2_open; 877 - dev->stop = prism2_close; 878 - dev->set_mac_address = prism2_set_mac_address; 879 - dev->set_multicast_list = hostap_set_multicast_list; 880 - dev->change_mtu = prism2_change_mtu; 881 - dev->tx_timeout = prism2_tx_timeout; 833 + dev->wireless_handlers = &hostap_iw_handler_def; 882 834 dev->watchdog_timeo = TX_TIMEOUT; 883 835 884 - if (type == HOSTAP_INTERFACE_AP) { 885 - dev->hard_start_xmit = hostap_mgmt_start_xmit; 836 + switch(type) { 837 + case HOSTAP_INTERFACE_AP: 838 + dev->netdev_ops = &hostap_mgmt_netdev_ops; 886 839 dev->type = ARPHRD_IEEE80211; 887 840 dev->header_ops = &hostap_80211_ops; 888 - } else { 889 - dev->hard_start_xmit = hostap_data_start_xmit; 841 + break; 842 + case HOSTAP_INTERFACE_MASTER: 843 + dev->tx_queue_len = 0; /* use main radio device queue */ 844 + dev->netdev_ops = &hostap_master_ops; 845 + break; 846 + default: 847 + dev->netdev_ops = &hostap_netdev_ops; 890 848 } 891 849 892 850 dev->mtu = local->mtu; 893 - if (type != HOSTAP_INTERFACE_MASTER) { 894 - /* use main radio device queue */ 895 - dev->tx_queue_len = 0; 896 - } 851 + 897 852 898 853 SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops); 899 854