diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-01-05 17:18:59 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-05 17:18:59 -0500 |
commit | 4f9b2a7dea2bf1dd81f280aa5e8a40ed910d2f0a (patch) | |
tree | 52046049957a87103a383869155f43461963f089 /net/mac80211/iface.c | |
parent | f3f66b69c8ff08b46975d9e99c7ecb92a8b12eda (diff) | |
parent | 7a4a77b7771164d61ce702a588067d1e1d66db7c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
net/mac80211/iface.c
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 72189661fc49..c20ddddc3f2b 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -15,12 +15,14 @@ | |||
15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
16 | #include <linux/rtnetlink.h> | 16 | #include <linux/rtnetlink.h> |
17 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
18 | #include <net/ieee80211_radiotap.h> | ||
18 | #include "ieee80211_i.h" | 19 | #include "ieee80211_i.h" |
19 | #include "sta_info.h" | 20 | #include "sta_info.h" |
20 | #include "debugfs_netdev.h" | 21 | #include "debugfs_netdev.h" |
21 | #include "mesh.h" | 22 | #include "mesh.h" |
22 | #include "led.h" | 23 | #include "led.h" |
23 | #include "driver-ops.h" | 24 | #include "driver-ops.h" |
25 | #include "wme.h" | ||
24 | 26 | ||
25 | /** | 27 | /** |
26 | * DOC: Interface list locking | 28 | * DOC: Interface list locking |
@@ -658,6 +660,12 @@ static void ieee80211_teardown_sdata(struct net_device *dev) | |||
658 | WARN_ON(flushed); | 660 | WARN_ON(flushed); |
659 | } | 661 | } |
660 | 662 | ||
663 | static u16 ieee80211_netdev_select_queue(struct net_device *dev, | ||
664 | struct sk_buff *skb) | ||
665 | { | ||
666 | return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); | ||
667 | } | ||
668 | |||
661 | static const struct net_device_ops ieee80211_dataif_ops = { | 669 | static const struct net_device_ops ieee80211_dataif_ops = { |
662 | .ndo_open = ieee80211_open, | 670 | .ndo_open = ieee80211_open, |
663 | .ndo_stop = ieee80211_stop, | 671 | .ndo_stop = ieee80211_stop, |
@@ -666,8 +674,34 @@ static const struct net_device_ops ieee80211_dataif_ops = { | |||
666 | .ndo_set_multicast_list = ieee80211_set_multicast_list, | 674 | .ndo_set_multicast_list = ieee80211_set_multicast_list, |
667 | .ndo_change_mtu = ieee80211_change_mtu, | 675 | .ndo_change_mtu = ieee80211_change_mtu, |
668 | .ndo_set_mac_address = ieee80211_change_mac, | 676 | .ndo_set_mac_address = ieee80211_change_mac, |
677 | .ndo_select_queue = ieee80211_netdev_select_queue, | ||
669 | }; | 678 | }; |
670 | 679 | ||
680 | static u16 ieee80211_monitor_select_queue(struct net_device *dev, | ||
681 | struct sk_buff *skb) | ||
682 | { | ||
683 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
684 | struct ieee80211_local *local = sdata->local; | ||
685 | struct ieee80211_hdr *hdr; | ||
686 | struct ieee80211_radiotap_header *rtap = (void *)skb->data; | ||
687 | |||
688 | if (local->hw.queues < 4) | ||
689 | return 0; | ||
690 | |||
691 | if (skb->len < 4 || | ||
692 | skb->len < rtap->it_len + 2 /* frame control */) | ||
693 | return 0; /* doesn't matter, frame will be dropped */ | ||
694 | |||
695 | hdr = (void *)((u8 *)skb->data + rtap->it_len); | ||
696 | |||
697 | if (!ieee80211_is_data(hdr->frame_control)) { | ||
698 | skb->priority = 7; | ||
699 | return ieee802_1d_to_ac[skb->priority]; | ||
700 | } | ||
701 | |||
702 | return ieee80211_downgrade_queue(local, skb); | ||
703 | } | ||
704 | |||
671 | static const struct net_device_ops ieee80211_monitorif_ops = { | 705 | static const struct net_device_ops ieee80211_monitorif_ops = { |
672 | .ndo_open = ieee80211_open, | 706 | .ndo_open = ieee80211_open, |
673 | .ndo_stop = ieee80211_stop, | 707 | .ndo_stop = ieee80211_stop, |
@@ -676,6 +710,7 @@ static const struct net_device_ops ieee80211_monitorif_ops = { | |||
676 | .ndo_set_multicast_list = ieee80211_set_multicast_list, | 710 | .ndo_set_multicast_list = ieee80211_set_multicast_list, |
677 | .ndo_change_mtu = ieee80211_change_mtu, | 711 | .ndo_change_mtu = ieee80211_change_mtu, |
678 | .ndo_set_mac_address = eth_mac_addr, | 712 | .ndo_set_mac_address = eth_mac_addr, |
713 | .ndo_select_queue = ieee80211_monitor_select_queue, | ||
679 | }; | 714 | }; |
680 | 715 | ||
681 | static void ieee80211_if_setup(struct net_device *dev) | 716 | static void ieee80211_if_setup(struct net_device *dev) |
@@ -782,8 +817,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
782 | 817 | ||
783 | ASSERT_RTNL(); | 818 | ASSERT_RTNL(); |
784 | 819 | ||
785 | ndev = alloc_netdev(sizeof(*sdata) + local->hw.vif_data_size, | 820 | ndev = alloc_netdev_mq(sizeof(*sdata) + local->hw.vif_data_size, |
786 | name, ieee80211_if_setup); | 821 | name, ieee80211_if_setup, local->hw.queues); |
787 | if (!ndev) | 822 | if (!ndev) |
788 | return -ENOMEM; | 823 | return -ENOMEM; |
789 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); | 824 | dev_net_set(ndev, wiphy_net(local->hw.wiphy)); |