Sfoglia il codice sorgente

qcacld-3.0: Indicate driver ready event to user space

In the event of driver reinit due to internal failues,
send an event to user space to indicate driver ready.

Change-Id: I3e8b11e24ad167b6812d95e468384c8f3f6040fd
CRs-Fixed: 3226425
Vinod Kumar Pirla 2 anni fa
parent
commit
1fa6a9b260
2 ha cambiato i file con 35 aggiunte e 0 eliminazioni
  1. 4 0
      core/hdd/src/wlan_hdd_cfg80211.c
  2. 31 0
      core/hdd/src/wlan_hdd_driver_ops.c

+ 4 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -1756,6 +1756,10 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] =
 	},
 #endif
 	FEATURE_MCC_QUOTA_VENDOR_EVENTS
+	[QCA_NL80211_VENDOR_SUBCMD_DRIVER_READY_INDEX] = {
+		.vendor_id = QCA_NL80211_VENDOR_ID,
+		.subcmd = QCA_NL80211_VENDOR_SUBCMD_DRIVER_READY,
+	},
 };
 
 /**

+ 31 - 0
core/hdd/src/wlan_hdd_driver_ops.c

@@ -210,6 +210,36 @@ static bool hdd_is_target_ready(void *data)
 	return cds_is_target_ready();
 }
 
+/**
+ * hdd_send_driver_ready_to_user() - API to indicate driver ready
+ * to userspace.
+ */
+static void hdd_send_driver_ready_to_user(void)
+{
+	struct sk_buff *nl_event;
+	struct hdd_context *hdd_ctx;
+	int flags = cds_get_gfp_flags();
+
+	hdd_enter();
+
+	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+	if (!hdd_ctx) {
+		hdd_err("HDD Context is NULL");
+		return;
+	}
+
+	nl_event = cfg80211_vendor_event_alloc(
+			hdd_ctx->wiphy, NULL, 0,
+			QCA_NL80211_VENDOR_SUBCMD_DRIVER_READY_INDEX,
+			flags);
+	if (!nl_event) {
+		hdd_err("cfg80211_vendor_event_alloc failed");
+		return;
+	}
+
+	cfg80211_vendor_event(nl_event, flags);
+}
+
 /**
  * hdd_hif_init_driver_state_callbacks() - API to initialize HIF callbacks
  * @data: Private Data
@@ -750,6 +780,7 @@ static int __hdd_soc_recovery_reinit(struct device *dev,
 	}
 
 	hdd_soc_load_unlock(dev);
+	hdd_send_driver_ready_to_user();
 
 	return 0;