cfg80211: move all regulatory hints to workqueue
[deliverable/linux.git] / drivers / net / wireless / zd1211rw / zd_mac.c
index 9caa96a135866c8c79cbc240d63ebfadc9c5e699..da9214e33a5fbb9f59548880aac58aa28f256c26 100644 (file)
@@ -170,10 +170,10 @@ int zd_mac_init_hw(struct ieee80211_hw *hw)
                goto disable_int;
 
        r = zd_reg2alpha2(mac->regdomain, alpha2);
-       if (!r)
-               regulatory_hint(hw->wiphy, alpha2);
+       if (r)
+               goto disable_int;
 
-       r = 0;
+       r = regulatory_hint(hw->wiphy, alpha2);
 disable_int:
        zd_chip_disable_int(chip);
 out:
@@ -287,7 +287,7 @@ static void zd_op_stop(struct ieee80211_hw *hw)
  * @skb - a sk-buffer
  * @flags: extra flags to set in the TX status info
  * @ackssi: ACK signal strength
- * @success - True for successfull transmission of the frame
+ * @success - True for successful transmission of the frame
  *
  * This information calls ieee80211_tx_status_irqsafe() if required by the
  * control information. It copies the control information into the status
@@ -768,13 +768,23 @@ static int zd_op_config_interface(struct ieee80211_hw *hw,
                        if (!beacon)
                                return -ENOMEM;
                        r = zd_mac_config_beacon(hw, beacon);
+                       kfree_skb(beacon);
+
                        if (r < 0)
                                return r;
-                       r = zd_set_beacon_interval(&mac->chip, BCN_MODE_IBSS |
-                                       hw->conf.beacon_int);
+               }
+
+               if (conf->changed & IEEE80211_IFCC_BEACON_ENABLED) {
+                       u32 interval;
+
+                       if (conf->enable_beacon)
+                               interval = BCN_MODE_IBSS | hw->conf.beacon_int;
+                       else
+                               interval = 0;
+
+                       r = zd_set_beacon_interval(&mac->chip, interval);
                        if (r < 0)
                                return r;
-                       kfree_skb(beacon);
                }
        } else
                associated = is_valid_ether_addr(conf->bssid);
@@ -793,10 +803,9 @@ static void zd_process_intr(struct work_struct *work)
        struct zd_mac *mac = container_of(work, struct zd_mac, process_intr);
 
        int_status = le16_to_cpu(*(__le16 *)(mac->intr_buffer+4));
-       if (int_status & INT_CFG_NEXT_BCN) {
-               if (net_ratelimit())
-                       dev_dbg_f(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n");
-       } else
+       if (int_status & INT_CFG_NEXT_BCN)
+               dev_dbg_f_limit(zd_mac_dev(mac), "INT_CFG_NEXT_BCN\n");
+       else
                dev_dbg_f(zd_mac_dev(mac), "Unsupported interrupt\n");
 
        zd_chip_enable_hwint(&mac->chip);
@@ -967,7 +976,7 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
        hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &mac->band;
 
        hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
-                   IEEE80211_HW_SIGNAL_DB;
+                   IEEE80211_HW_SIGNAL_UNSPEC;
 
        hw->wiphy->interface_modes =
                BIT(NL80211_IFTYPE_MESH_POINT) |
This page took 0.024068 seconds and 5 git commands to generate.