mwifiex: add support for GTK rekey offload
[deliverable/linux.git] / drivers / net / wireless / marvell / mwifiex / cfg80211.c
index bb7235e1b9d16fd6024a131aefda6f1c81039761..ca8cdd2ec4092be6bcb2e049b009e231d923c226 100644 (file)
@@ -3272,8 +3272,11 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
 
        for (i = 0; i < adapter->priv_num; i++) {
                priv = adapter->priv[i];
-               if (priv && priv->netdev)
+               if (priv && priv->netdev) {
                        mwifiex_stop_net_dev_queue(priv->netdev, adapter);
+                       if (netif_carrier_ok(priv->netdev))
+                               netif_carrier_off(priv->netdev);
+               }
        }
 
        for (i = 0; i < retry_num; i++) {
@@ -3344,8 +3347,11 @@ static int mwifiex_cfg80211_resume(struct wiphy *wiphy)
 
        for (i = 0; i < adapter->priv_num; i++) {
                priv = adapter->priv[i];
-               if (priv && priv->netdev)
+               if (priv && priv->netdev) {
+                       if (!netif_carrier_ok(priv->netdev))
+                               netif_carrier_on(priv->netdev);
                        mwifiex_wake_up_net_dev_queue(priv->netdev, adapter);
+               }
        }
 
        priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
@@ -3410,6 +3416,16 @@ static void mwifiex_cfg80211_set_wakeup(struct wiphy *wiphy,
 
        device_set_wakeup_enable(adapter->dev, enabled);
 }
+
+static int mwifiex_set_rekey_data(struct wiphy *wiphy, struct net_device *dev,
+                                 struct cfg80211_gtk_rekey_data *data)
+{
+       struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
+
+       return mwifiex_send_cmd(priv, HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG,
+                               HostCmd_ACT_GEN_SET, 0, data, true);
+}
+
 #endif
 
 static int mwifiex_get_coalesce_pkt_type(u8 *byte_seq)
@@ -3932,6 +3948,7 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
        .suspend = mwifiex_cfg80211_suspend,
        .resume = mwifiex_cfg80211_resume,
        .set_wakeup = mwifiex_cfg80211_set_wakeup,
+       .set_rekey_data = mwifiex_set_rekey_data,
 #endif
        .set_coalesce = mwifiex_cfg80211_set_coalesce,
        .tdls_mgmt = mwifiex_cfg80211_tdls_mgmt,
@@ -3948,7 +3965,7 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
 #ifdef CONFIG_PM
 static const struct wiphy_wowlan_support mwifiex_wowlan_support = {
        .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT |
-               WIPHY_WOWLAN_NET_DETECT,
+               WIPHY_WOWLAN_NET_DETECT | WIPHY_WOWLAN_SUPPORTS_GTK_REKEY,
        .n_patterns = MWIFIEX_MEF_MAX_FILTERS,
        .pattern_min_len = 1,
        .pattern_max_len = MWIFIEX_MAX_PATTERN_LEN,
@@ -4086,6 +4103,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
 
        wiphy->features |= NL80211_FEATURE_HT_IBSS |
                           NL80211_FEATURE_INACTIVITY_TIMER |
+                          NL80211_FEATURE_LOW_PRIORITY_SCAN |
                           NL80211_FEATURE_NEED_OBSS_SCAN;
 
        if (ISSUPP_TDLS_ENABLED(adapter->fw_cap_info))
This page took 0.029775 seconds and 5 git commands to generate.