aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap/hostap_main.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2007-09-26 16:45:24 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:54:09 -0400
commit09703f5e79a64c744721b9c27502075232ba0ea2 (patch)
tree77bf66f19e5b020533b466408aef768d145ac42b /drivers/net/wireless/hostap/hostap_main.c
parentf74347d7ac0aa175b2bbd85eb58a13fbe80a3785 (diff)
[HOSTAP]: set netdev type before registering AP interface
As detailed at https://bugs.gentoo.org/159646 hostap with hostapd confuses udev by presenting 2 interfaces with the same MAC address. Also, at the time of detection, the 'type' attribute is 1, identical to other hostap interfaces. The AP interface is supposed to have type ARPHRD_IEEE80211 (801), but this is not set until after registration. Setting it before register_netdev() is called allows us to avoid this confusion. We can do this by propogating the HOSTAP_INTERFACE type through to hostap_setup_dev(). Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_main.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index b75cf9205ce0..17c58e9bdad5 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -73,7 +73,7 @@ struct net_device * hostap_add_interface(struct local_info *local,
73 dev->mem_start = mdev->mem_start; 73 dev->mem_start = mdev->mem_start;
74 dev->mem_end = mdev->mem_end; 74 dev->mem_end = mdev->mem_end;
75 75
76 hostap_setup_dev(dev, local, 0); 76 hostap_setup_dev(dev, local, type);
77 dev->destructor = free_netdev; 77 dev->destructor = free_netdev;
78 78
79 sprintf(dev->name, "%s%s", prefix, name); 79 sprintf(dev->name, "%s%s", prefix, name);
@@ -857,7 +857,7 @@ const struct header_ops hostap_80211_ops = {
857EXPORT_SYMBOL(hostap_80211_ops); 857EXPORT_SYMBOL(hostap_80211_ops);
858 858
859void hostap_setup_dev(struct net_device *dev, local_info_t *local, 859void hostap_setup_dev(struct net_device *dev, local_info_t *local,
860 int main_dev) 860 int type)
861{ 861{
862 struct hostap_interface *iface; 862 struct hostap_interface *iface;
863 863
@@ -877,15 +877,22 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
877 dev->do_ioctl = hostap_ioctl; 877 dev->do_ioctl = hostap_ioctl;
878 dev->open = prism2_open; 878 dev->open = prism2_open;
879 dev->stop = prism2_close; 879 dev->stop = prism2_close;
880 dev->hard_start_xmit = hostap_data_start_xmit;
881 dev->set_mac_address = prism2_set_mac_address; 880 dev->set_mac_address = prism2_set_mac_address;
882 dev->set_multicast_list = hostap_set_multicast_list; 881 dev->set_multicast_list = hostap_set_multicast_list;
883 dev->change_mtu = prism2_change_mtu; 882 dev->change_mtu = prism2_change_mtu;
884 dev->tx_timeout = prism2_tx_timeout; 883 dev->tx_timeout = prism2_tx_timeout;
885 dev->watchdog_timeo = TX_TIMEOUT; 884 dev->watchdog_timeo = TX_TIMEOUT;
886 885
886 if (type == HOSTAP_INTERFACE_AP) {
887 dev->hard_start_xmit = hostap_mgmt_start_xmit;
888 dev->type = ARPHRD_IEEE80211;
889 dev->header_ops = &hostap_80211_ops;
890 } else {
891 dev->hard_start_xmit = hostap_data_start_xmit;
892 }
893
887 dev->mtu = local->mtu; 894 dev->mtu = local->mtu;
888 if (!main_dev) { 895 if (type != HOSTAP_INTERFACE_MASTER) {
889 /* use main radio device queue */ 896 /* use main radio device queue */
890 dev->tx_queue_len = 0; 897 dev->tx_queue_len = 0;
891 } 898 }
@@ -910,10 +917,6 @@ static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)
910 if (local->apdev == NULL) 917 if (local->apdev == NULL)
911 return -ENOMEM; 918 return -ENOMEM;
912 919
913 local->apdev->hard_start_xmit = hostap_mgmt_start_xmit;
914 local->apdev->type = ARPHRD_IEEE80211;
915 local->apdev->header_ops = &hostap_80211_ops;
916
917 return 0; 920 return 0;
918} 921}
919 922