|
@@ -3316,6 +3316,64 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy,
|
|
|
|
|
|
static int mwifiex_cfg80211_resume(struct wiphy *wiphy)
|
|
|
{
|
|
|
+ struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy);
|
|
|
+ struct mwifiex_private *priv =
|
|
|
+ mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
|
|
|
+ struct mwifiex_ds_wakeup_reason wakeup_reason;
|
|
|
+ struct cfg80211_wowlan_wakeup wakeup_report;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ mwifiex_get_wakeup_reason(priv, HostCmd_ACT_GEN_GET, MWIFIEX_SYNC_CMD,
|
|
|
+ &wakeup_reason);
|
|
|
+ memset(&wakeup_report, 0, sizeof(struct cfg80211_wowlan_wakeup));
|
|
|
+
|
|
|
+ wakeup_report.pattern_idx = -1;
|
|
|
+
|
|
|
+ switch (wakeup_reason.hs_wakeup_reason) {
|
|
|
+ case NO_HSWAKEUP_REASON:
|
|
|
+ break;
|
|
|
+ case BCAST_DATA_MATCHED:
|
|
|
+ break;
|
|
|
+ case MCAST_DATA_MATCHED:
|
|
|
+ break;
|
|
|
+ case UCAST_DATA_MATCHED:
|
|
|
+ break;
|
|
|
+ case MASKTABLE_EVENT_MATCHED:
|
|
|
+ break;
|
|
|
+ case NON_MASKABLE_EVENT_MATCHED:
|
|
|
+ if (wiphy->wowlan_config->disconnect)
|
|
|
+ wakeup_report.disconnect = true;
|
|
|
+ if (wiphy->wowlan_config->nd_config)
|
|
|
+ wakeup_report.net_detect = adapter->nd_info;
|
|
|
+ break;
|
|
|
+ case NON_MASKABLE_CONDITION_MATCHED:
|
|
|
+ break;
|
|
|
+ case MAGIC_PATTERN_MATCHED:
|
|
|
+ if (wiphy->wowlan_config->magic_pkt)
|
|
|
+ wakeup_report.magic_pkt = true;
|
|
|
+ if (wiphy->wowlan_config->n_patterns)
|
|
|
+ wakeup_report.pattern_idx = 1;
|
|
|
+ break;
|
|
|
+ case CONTROL_FRAME_MATCHED:
|
|
|
+ break;
|
|
|
+ case MANAGEMENT_FRAME_MATCHED:
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ((wakeup_reason.hs_wakeup_reason > 0) &&
|
|
|
+ (wakeup_reason.hs_wakeup_reason <= 7))
|
|
|
+ cfg80211_report_wowlan_wakeup(&priv->wdev, &wakeup_report,
|
|
|
+ GFP_KERNEL);
|
|
|
+
|
|
|
+ if (adapter->nd_info) {
|
|
|
+ for (i = 0 ; i < adapter->nd_info->n_matches ; i++)
|
|
|
+ kfree(adapter->nd_info->matches[i]);
|
|
|
+ kfree(adapter->nd_info);
|
|
|
+ adapter->nd_info = NULL;
|
|
|
+ }
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|