]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] rt2x00: Don't use changed_flags inside configure_packet_filter
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 6 Oct 2007 12:13:38 +0000 (14:13 +0200)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:55:10 +0000 (16:55 -0700)
We shouldn't use changed_flags when configuring the packet filter,
we work directly with the total_flags which is safe enough since
we already check if something has changed after we applied our
packet filtering flag rules.
Also make sure that when the packet filter is scheduled, the
rt2x00dev->interface.filter is cleared to make sure the drivers
will update the packet filter instead of failing at the check:
*total_flags == rt2x00dev->interface.filter

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2400pci.c
drivers/net/wireless/rt2x00/rt2500pci.c
drivers/net/wireless/rt2x00/rt2500usb.c
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt61pci.c
drivers/net/wireless/rt2x00/rt73usb.c

index 7b2a85ade13541ebf74a4969e9f206209f30a463..e3cac0f26d7bbe8bf4e99fa723f5fe93f4555782 100644 (file)
@@ -1497,8 +1497,8 @@ static void rt2400pci_configure_filter(struct ieee80211_hw *hw,
         * - Some filters are set based on interface type.
         */
        *total_flags |= FIF_ALLMULTI;
-       if (changed_flags & FIF_OTHER_BSS ||
-           changed_flags & FIF_PROMISC_IN_BSS)
+       if (*total_flags & FIF_OTHER_BSS ||
+           *total_flags & FIF_PROMISC_IN_BSS)
                *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
        if (is_interface_type(intf, IEEE80211_IF_TYPE_AP))
                *total_flags |= FIF_PROMISC_IN_BSS;
index 63a7b3cdf0cd1bee3481cf6ddfab47503d0c5256..5d982316b85477fdd9cf371923f22bd09ac538e7 100644 (file)
@@ -1830,8 +1830,8 @@ static void rt2500pci_configure_filter(struct ieee80211_hw *hw,
         */
        if (mc_count)
                *total_flags |= FIF_ALLMULTI;
-       if (changed_flags & FIF_OTHER_BSS ||
-           changed_flags & FIF_PROMISC_IN_BSS)
+       if (*total_flags & FIF_OTHER_BSS ||
+           *total_flags & FIF_PROMISC_IN_BSS)
                *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
        if (is_interface_type(intf, IEEE80211_IF_TYPE_AP))
                *total_flags |= FIF_PROMISC_IN_BSS;
index 973f653ecfc2562adef247ff50a641b0968e1fe2..3dbd381f142838f845071767a91bb9b7c0d91bfd 100644 (file)
@@ -1602,8 +1602,8 @@ static void rt2500usb_configure_filter(struct ieee80211_hw *hw,
         */
        if (mc_count)
                *total_flags |= FIF_ALLMULTI;
-       if (changed_flags & FIF_OTHER_BSS ||
-           changed_flags & FIF_PROMISC_IN_BSS)
+       if (*total_flags & FIF_OTHER_BSS ||
+           *total_flags & FIF_PROMISC_IN_BSS)
                *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
        if (is_interface_type(intf, IEEE80211_IF_TYPE_AP))
                *total_flags |= FIF_PROMISC_IN_BSS;
index 82dfcd95bb26f8329bc9a737844d8f1f0878f4c7..9bb5fb964a211bcb812eece43d5d9a764be9ff55 100644 (file)
@@ -410,8 +410,6 @@ struct rt2x00lib_ops {
         */
        void (*config_mac_addr) (struct rt2x00_dev *rt2x00dev, __le32 *mac);
        void (*config_bssid) (struct rt2x00_dev *rt2x00dev, __le32 *bssid);
-       void (*config_packet_filter) (struct rt2x00_dev *rt2x00dev,
-                                     const unsigned int filter);
        void (*config_type) (struct rt2x00_dev *rt2x00dev, const int type);
        void (*config) (struct rt2x00_dev *rt2x00dev, const unsigned int flags,
                        struct ieee80211_conf *conf);
index f25475318c9b5ce3937bb497ea379a6cd4f8d2bb..1e07c3938cb310685928842679b83f996b526df6 100644 (file)
@@ -276,11 +276,18 @@ static void rt2x00lib_packetfilter_scheduled(struct work_struct *work)
 {
        struct rt2x00_dev *rt2x00dev =
            container_of(work, struct rt2x00_dev, filter_work);
+       unsigned int filter = rt2x00dev->interface.filter;
+
+       /*
+        * Since we had stored the filter inside interface.filter,
+        * we should now clear that field. Otherwise the driver will
+        * assume nothing has changed (*total_flags will be compared
+        * to interface.filter to determine if any action is required).
+        */
+       rt2x00dev->interface.filter = 0;
 
        rt2x00dev->ops->hw->configure_filter(rt2x00dev->hw,
-                                            rt2x00dev->interface.filter,
-                                            &rt2x00dev->interface.filter,
-                                            0, NULL);
+                                            filter, &filter, 0, NULL);
 }
 
 /*
index 5d31ced111492e6d9ee88f7e0c867fdef2a4107a..588b22b164196a6521eca19f6f951a0a1e2d2fc4 100644 (file)
@@ -2389,8 +2389,8 @@ static void rt61pci_configure_filter(struct ieee80211_hw *hw,
         */
        if (mc_count)
                *total_flags |= FIF_ALLMULTI;
-       if (changed_flags & FIF_OTHER_BSS ||
-           changed_flags & FIF_PROMISC_IN_BSS)
+       if (*total_flags & FIF_OTHER_BSS ||
+           *total_flags & FIF_PROMISC_IN_BSS)
                *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
        if (is_interface_type(intf, IEEE80211_IF_TYPE_AP))
                *total_flags |= FIF_PROMISC_IN_BSS;
index 5fa697bfaa14bfa8a2f2eec12f5310f926b2de18..6d1635b5cd07baa7eb8e505514277fdc6e10ffc8 100644 (file)
@@ -1856,8 +1856,8 @@ static void rt73usb_configure_filter(struct ieee80211_hw *hw,
         */
        if (mc_count)
                *total_flags |= FIF_ALLMULTI;
-       if (changed_flags & FIF_OTHER_BSS ||
-           changed_flags & FIF_PROMISC_IN_BSS)
+       if (*total_flags & FIF_OTHER_BSS ||
+           *total_flags & FIF_PROMISC_IN_BSS)
                *total_flags |= FIF_PROMISC_IN_BSS | FIF_OTHER_BSS;
        if (is_interface_type(intf, IEEE80211_IF_TYPE_AP))
                *total_flags |= FIF_PROMISC_IN_BSS;