ソースを参照

qcacld-3.0: Put a wrapper around wireless_send_event()

Function wireless_send_event() is only present in the kernel when
wireless extensions are enabled. In order to allow the driver to build
when wireless extensions are disabled, put a wrapper around that
function.

Note that this is only a partial solution to the problem since this
means that when wireless extensions are disabled that the event will
not be sent to userspace. A subsequent effort will need to evaluate
each event to see if a cfg80211-based notification mechanism is
already in place, and if not, if one needs to be added in order to
maintain the underlying functionality.

Change-Id: Icbdddf6735bdc5ffd1ee189b5fabfa67fcce59ea
CRs-Fixed: 2621699
Jeff Johnson 5 年 前
コミット
0ab57fee82

+ 14 - 0
core/hdd/inc/wlan_hdd_wext.h

@@ -197,6 +197,14 @@ void hdd_register_wext(struct net_device *dev);
  */
 void hdd_wext_unregister(struct net_device *dev,
 			 bool rtnl_held);
+
+static inline
+void hdd_wext_send_event(struct net_device *dev, unsigned int cmd,
+			 union iwreq_data *wrqu, const char *extra)
+{
+	wireless_send_event(dev, cmd, wrqu, extra);
+}
+
 void hdd_wlan_get_stats(struct hdd_adapter *adapter, uint16_t *length,
 		       char *buffer, uint16_t buf_len);
 void hdd_wlan_list_fw_profile(uint16_t *length,
@@ -381,6 +389,12 @@ static inline void hdd_wext_unregister(struct net_device *dev,
 				       bool rtnl_locked)
 {
 }
+
+static inline
+void hdd_wext_send_event(struct net_device *dev, unsigned int cmd,
+			 union iwreq_data *wrqu, const char *extra)
+{
+}
 #endif /* WLAN_WEXT_SUPPORT_ENABLE */
 
 #if defined(WLAN_WEXT_SUPPORT_ENABLE) && defined(HASTINGS_BT_WAR)

+ 11 - 11
core/hdd/src/wlan_hdd_assoc.c

@@ -1095,7 +1095,7 @@ hdd_send_ft_assoc_response(struct net_device *dev,
 		return;
 
 	memcpy(buff, assoc_rsp, len);
-	wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, buff);
+	hdd_wext_send_event(dev, IWEVASSOCRESPIE, &wrqu, buff);
 
 	qdf_mem_free(buff);
 }
@@ -1184,7 +1184,7 @@ static void hdd_send_ft_event(struct hdd_adapter *adapter)
 		hdd_warn("Do not send RIC IEs as length is 0");
 	} else {
 		wrqu.data.length = str_len + ric_ies_length;
-		wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buff);
+		hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buff);
 	}
 
 	/* Sme needs to provide the Auth Resp */
@@ -1201,7 +1201,7 @@ static void hdd_send_ft_event(struct hdd_adapter *adapter)
 	}
 
 	wrqu.data.length = str_len + auth_resp_len;
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buff);
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buff);
 
 	qdf_mem_free(buff);
 #endif
@@ -1255,7 +1255,7 @@ hdd_send_new_ap_channel_info(struct net_device *dev,
 	wrqu.freq.m = wlan_reg_freq_to_chan(pdev, descriptor->chan_freq);
 	wrqu.freq.e = 0;
 	wrqu.freq.i = 0;
-	wireless_send_event(adapter->dev, SIOCGIWFREQ, &wrqu, NULL);
+	hdd_wext_send_event(adapter->dev, SIOCGIWFREQ, &wrqu, NULL);
 }
 
 #endif /* FEATURE_WLAN_ESE */
@@ -1325,7 +1325,7 @@ hdd_send_update_beacon_ies_event(struct hdd_adapter *adapter,
 
 		hdd_debug("Beacon IEs length to supplicant = %d",
 			   currentLen);
-		wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buff);
+		hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buff);
 	} while (totalIeLen > 0);
 
 	qdf_mem_free(buff);
@@ -1503,7 +1503,7 @@ static void hdd_send_association_event(struct net_device *dev,
 	 * driver so not sending the status of the connection to supplicant
 	 */
 	if (cds_is_load_or_unload_in_progress()) {
-		wireless_send_event(dev, we_event, &wrqu, msg);
+		hdd_wext_send_event(dev, we_event, &wrqu, msg);
 #ifdef FEATURE_WLAN_ESE
 		if (eConnectionState_Associated ==
 			 sta_ctx->conn_info.conn_state) {
@@ -4157,7 +4157,7 @@ hdd_indicate_tsm_ie(struct hdd_adapter *adapter, uint8_t tid,
 	wrqu.data.pointer = buf;
 	wrqu.data.length = nBytes;
 	/* send the event */
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
 }
 
 /**
@@ -4207,7 +4207,7 @@ hdd_indicate_cckm_pre_auth(struct hdd_adapter *adapter,
 	wrqu.data.length = (IW_CUSTOM_MAX - freeBytes);
 
 	/* send the event */
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
 }
 
 /**
@@ -4242,7 +4242,7 @@ hdd_indicate_ese_adj_ap_rep_ind(struct hdd_adapter *adapter,
 	wrqu.data.length = nBytes;
 
 	/* send the event */
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
 }
 
 /**
@@ -4280,7 +4280,7 @@ hdd_indicate_ese_bcn_report_no_results(const struct hdd_adapter *adapter,
 	wrqu.data.pointer = buf;
 	wrqu.data.length = nBytes;
 	/* send the event */
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
 }
 
 /**
@@ -4492,7 +4492,7 @@ hdd_indicate_ese_bcn_report_ind(const struct hdd_adapter *adapter,
 			wrqu.data.length = IW_CUSTOM_MAX - freeBytes;
 
 			/* send the event */
-			wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
+			hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
 					    buf);
 			lastSent += sendBss;
 		}

+ 3 - 3
core/hdd/src/wlan_hdd_cfg80211.c

@@ -17340,7 +17340,7 @@ wlan_hdd_cfg80211_roam_metrics_preauth(struct hdd_adapter *adapter,
 				     "QCOM: LFR_PREAUTH_INIT " QDF_MAC_ADDR_STR,
 				     QDF_MAC_ADDR_ARRAY(roam_info->bssid.bytes));
 
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
 			    metrics_notification);
 
 	hdd_exit();
@@ -17391,7 +17391,7 @@ wlan_hdd_cfg80211_roam_metrics_preauth_status(struct hdd_adapter *adapter,
 	wrqu.data.pointer = metrics_notification;
 	wrqu.data.length = strlen(metrics_notification);
 
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
 			    metrics_notification);
 
 	hdd_exit();
@@ -17433,7 +17433,7 @@ wlan_hdd_cfg80211_roam_metrics_handover(struct hdd_adapter *adapter,
 				     QDF_MAC_ADDR_STR,
 				     QDF_MAC_ADDR_ARRAY(roam_info->bssid.bytes));
 
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu,
 			    metrics_notification);
 
 	hdd_exit();

+ 2 - 2
core/hdd/src/wlan_hdd_hostapd.c

@@ -2621,7 +2621,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		goto stopbss;
 		return QDF_STATUS_SUCCESS;
 	}
-	wireless_send_event(dev, we_event, &wrqu,
+	hdd_wext_send_event(dev, we_event, &wrqu,
 			    (char *)we_custom_event_generic);
 	qdf_mem_free(we_custom_start_event);
 	qdf_mem_free(unknownSTAEvent);
@@ -2684,7 +2684,7 @@ stopbss:
 		wrqu.data.length = event_len;
 		we_event = IWEVCUSTOM;
 		we_custom_event_generic = we_custom_event;
-		wireless_send_event(dev, we_event, &wrqu,
+		hdd_wext_send_event(dev, we_event, &wrqu,
 				    (char *)we_custom_event_generic);
 
 		qdf_mem_free(we_custom_start_event);

+ 2 - 2
core/hdd/src/wlan_hdd_main.c

@@ -6065,7 +6065,7 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
 			memset(&wrqu, '\0', sizeof(wrqu));
 			wrqu.ap_addr.sa_family = ARPHRD_ETHER;
 			memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
-			wireless_send_event(adapter->dev, SIOCGIWAP, &wrqu,
+			hdd_wext_send_event(adapter->dev, SIOCGIWAP, &wrqu,
 					    NULL);
 		} else if (adapter->device_mode == QDF_NAN_DISC_MODE &&
 			   ucfg_is_nan_disc_active(hdd_ctx->psoc))
@@ -7133,7 +7133,7 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx)
 				memset(&wrqu, '\0', sizeof(wrqu));
 				wrqu.ap_addr.sa_family = ARPHRD_ETHER;
 				memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
-				wireless_send_event(adapter->dev, SIOCGIWAP,
+				hdd_wext_send_event(adapter->dev, SIOCGIWAP,
 						    &wrqu, NULL);
 				adapter->session.station.
 				hdd_reassoc_scenario = false;

+ 1 - 1
core/hdd/src/wlan_hdd_wext.c

@@ -9224,7 +9224,7 @@ static void found_pref_network_cb(struct wlan_objmgr_vdev *vdev,
 
 	/* send the event */
 
-	wireless_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf);
+	hdd_wext_send_event(wdev->netdev, IWEVCUSTOM, &wrqu, buf);
 }
 
 /**

+ 1 - 1
core/hdd/src/wlan_hdd_wmm.c

@@ -294,7 +294,7 @@ static void hdd_wmm_notify_app(struct hdd_wmm_qos_context *qos_context)
 
 	/* send the event */
 	hdd_debug("Sending [%s]", buf);
-	wireless_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
+	hdd_wext_send_event(adapter->dev, IWEVCUSTOM, &wrqu, buf);
 }
 
 #ifdef FEATURE_WLAN_ESE