diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-01-30 07:36:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-09 15:03:45 -0500 |
commit | 7230645e329b4a9c566fefa9327eb8734c7d392c (patch) | |
tree | 085932aa70168016cb9ecca3b984fc1e451babf3 | |
parent | 587e729ecff959482d25c73278a1fbadbc6a54fe (diff) |
mac80211: convert master interface to netdev_ops
Also call our own ieee80211_master_setup routine instead of
overwriting almost all the values from ether_setup; this
loses a few assignments that are pointless on the master
interface anyway.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/main.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 7247b303e966..caf92424c76d 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -791,6 +791,23 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
791 | } | 791 | } |
792 | EXPORT_SYMBOL(ieee80211_alloc_hw); | 792 | EXPORT_SYMBOL(ieee80211_alloc_hw); |
793 | 793 | ||
794 | static const struct net_device_ops ieee80211_master_ops = { | ||
795 | .ndo_start_xmit = ieee80211_master_start_xmit, | ||
796 | .ndo_open = ieee80211_master_open, | ||
797 | .ndo_stop = ieee80211_master_stop, | ||
798 | .ndo_set_multicast_list = ieee80211_master_set_multicast_list, | ||
799 | .ndo_select_queue = ieee80211_select_queue, | ||
800 | }; | ||
801 | |||
802 | static void ieee80211_master_setup(struct net_device *mdev) | ||
803 | { | ||
804 | mdev->type = ARPHRD_IEEE80211; | ||
805 | mdev->netdev_ops = &ieee80211_master_ops; | ||
806 | mdev->header_ops = &ieee80211_header_ops; | ||
807 | mdev->tx_queue_len = 1000; | ||
808 | mdev->addr_len = ETH_ALEN; | ||
809 | } | ||
810 | |||
794 | int ieee80211_register_hw(struct ieee80211_hw *hw) | 811 | int ieee80211_register_hw(struct ieee80211_hw *hw) |
795 | { | 812 | { |
796 | struct ieee80211_local *local = hw_to_local(hw); | 813 | struct ieee80211_local *local = hw_to_local(hw); |
@@ -840,7 +857,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
840 | hw->ampdu_queues = 0; | 857 | hw->ampdu_queues = 0; |
841 | 858 | ||
842 | mdev = alloc_netdev_mq(sizeof(struct ieee80211_master_priv), | 859 | mdev = alloc_netdev_mq(sizeof(struct ieee80211_master_priv), |
843 | "wmaster%d", ether_setup, | 860 | "wmaster%d", ieee80211_master_setup, |
844 | ieee80211_num_queues(hw)); | 861 | ieee80211_num_queues(hw)); |
845 | if (!mdev) | 862 | if (!mdev) |
846 | goto fail_mdev_alloc; | 863 | goto fail_mdev_alloc; |
@@ -851,13 +868,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
851 | 868 | ||
852 | ieee80211_rx_bss_list_init(local); | 869 | ieee80211_rx_bss_list_init(local); |
853 | 870 | ||
854 | mdev->hard_start_xmit = ieee80211_master_start_xmit; | ||
855 | mdev->open = ieee80211_master_open; | ||
856 | mdev->stop = ieee80211_master_stop; | ||
857 | mdev->type = ARPHRD_IEEE80211; | ||
858 | mdev->header_ops = &ieee80211_header_ops; | ||
859 | mdev->set_multicast_list = ieee80211_master_set_multicast_list; | ||
860 | |||
861 | local->hw.workqueue = | 871 | local->hw.workqueue = |
862 | create_singlethread_workqueue(wiphy_name(local->hw.wiphy)); | 872 | create_singlethread_workqueue(wiphy_name(local->hw.wiphy)); |
863 | if (!local->hw.workqueue) { | 873 | if (!local->hw.workqueue) { |
@@ -923,8 +933,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
923 | goto fail_wep; | 933 | goto fail_wep; |
924 | } | 934 | } |
925 | 935 | ||
926 | local->mdev->select_queue = ieee80211_select_queue; | ||
927 | |||
928 | /* add one default STA interface if supported */ | 936 | /* add one default STA interface if supported */ |
929 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) { | 937 | if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) { |
930 | result = ieee80211_if_add(local, "wlan%d", NULL, | 938 | result = ieee80211_if_add(local, "wlan%d", NULL, |