Ver Fonte

qcacld-3.0: Integrate DSC (misc - part 3/3)

As part of DSC integration, replace cds_ssr_protect/unprotect with
appropriate osif_sync op start/stop calls in the miscellaneous
remaining callback handlers.

Change-Id: Id16db2dc5ba426b696a23d6bbc6ea49ba64f344a
CRs-Fixed: 2413760
Dustin Brown há 6 anos atrás
pai
commit
96b98dddb9

+ 12 - 7
core/hdd/src/wlan_hdd_cfg80211.c

@@ -19873,7 +19873,7 @@ __wlan_hdd_cfg80211_update_owe_info(struct wiphy *wiphy,
 	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	QDF_STATUS status;
-	int errno = 0;
+	int errno;
 
 	hdd_enter_dev(dev);
 
@@ -19915,16 +19915,21 @@ __wlan_hdd_cfg80211_update_owe_info(struct wiphy *wiphy,
  */
 static int
 wlan_hdd_cfg80211_update_owe_info(struct wiphy *wiphy,
-				  struct net_device *dev,
+				  struct net_device *net_dev,
 				  struct cfg80211_update_owe_info *owe_info)
 {
-	int ret;
+	struct osif_vdev_sync *vdev_sync;
+	int errno;
 
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_update_owe_info(wiphy, dev, owe_info);
-	cds_ssr_unprotect(__func__);
+	errno = osif_vdev_sync_op_start(net_dev, &vdev_sync);
+	if (errno)
+		return errno;
 
-	return ret;
+	errno = __wlan_hdd_cfg80211_update_owe_info(wiphy, net_dev, owe_info);
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif
 

+ 1 - 7
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1026,13 +1026,7 @@ int wlan_hdd_bus_suspend(void)
 #ifdef WLAN_SUSPEND_RESUME_TEST
 int wlan_hdd_unit_test_bus_suspend(struct wow_enable_params wow_params)
 {
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_bus_suspend(wow_params);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
+	return __wlan_hdd_bus_suspend(wow_params);
 }
 #endif
 

+ 14 - 8
core/hdd/src/wlan_hdd_fw_state.c

@@ -22,11 +22,12 @@
  * The implementation for getting firmware state
  */
 
-#include "wlan_hdd_main.h"
-#include "wmi_unified_param.h"
-#include "wlan_hdd_fw_state.h"
+#include "osif_sync.h"
 #include "qca_vendor.h"
+#include "wlan_hdd_fw_state.h"
+#include "wlan_hdd_main.h"
 #include "wlan_osif_request_manager.h"
+#include "wmi_unified_param.h"
 
 struct fw_state {
 	bool fw_active;
@@ -194,11 +195,16 @@ int wlan_hdd_cfg80211_get_fw_state(struct wiphy *wiphy,
 				   const void *data,
 				   int data_len)
 {
-	int ret;
+	struct osif_psoc_sync *psoc_sync;
+	int errno;
+
+	errno = osif_psoc_sync_op_start(wiphy_dev(wiphy), &psoc_sync);
+	if (errno)
+		return errno;
+
+	errno = __wlan_hdd_cfg80211_get_fw_state(wiphy, wdev, data, data_len);
 
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_cfg80211_get_fw_state(wiphy, wdev, data, data_len);
-	cds_ssr_unprotect(__func__);
+	osif_psoc_sync_op_stop(psoc_sync);
 
-	return ret;
+	return errno;
 }

+ 7 - 18
core/hdd/src/wlan_hdd_hostapd.c

@@ -544,28 +544,30 @@ int hdd_hostapd_stop(struct net_device *net_dev)
 }
 
 /**
- * __hdd_hostapd_uninit() - hdd uninit function
+ * hdd_hostapd_uninit() - hdd uninit function
+ * @dev: pointer to net_device structure
+ *
  * This is called during the netdev unregister to uninitialize all data
  * associated with the device.
  *
- * @dev: pointer to net_device structure
+ * This function must be protected by a transition
  *
  * Return: None
  */
-static void __hdd_hostapd_uninit(struct net_device *dev)
+static void hdd_hostapd_uninit(struct net_device *dev)
 {
 	struct hdd_adapter *adapter = netdev_priv(dev);
 	struct hdd_context *hdd_ctx;
 
 	hdd_enter_dev(dev);
 
-	if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
+	if (adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
 		hdd_err("Invalid magic");
 		return;
 	}
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	if (NULL == hdd_ctx) {
+	if (!hdd_ctx) {
 		hdd_err("NULL hdd_ctx");
 		return;
 	}
@@ -579,19 +581,6 @@ static void __hdd_hostapd_uninit(struct net_device *dev)
 	hdd_exit();
 }
 
-/**
- * hdd_hostapd_uninit() - SSR wrapper for __hdd_hostapd_uninit
- * @net_dev: pointer to net_device
- *
- * Return: 0 on success, error number otherwise
- */
-static void hdd_hostapd_uninit(struct net_device *net_dev)
-{
-	cds_ssr_protect(__func__);
-	__hdd_hostapd_uninit(net_dev);
-	cds_ssr_unprotect(__func__);
-}
-
 /**
  * __hdd_hostapd_change_mtu() - change mtu
  * @dev: pointer to net_device

+ 36 - 37
core/hdd/src/wlan_hdd_main.c

@@ -793,7 +793,7 @@ static int __hdd_netdev_notifier_call(struct net_device *net_dev,
 		hdd_objmgr_put_vdev(vdev);
 		cds_flush_work(&adapter->scan_block_work);
 		/* Need to clean up blocked scan request */
-		wlan_hdd_cfg80211_scan_block_cb(&adapter->scan_block_work);
+		wlan_hdd_cfg80211_scan_block(adapter);
 		hdd_debug("Scan is not Pending from user");
 		/*
 		 * After NETDEV_GOING_DOWN, kernel calls hdd_stop.Irrespective
@@ -3299,62 +3299,47 @@ static int hdd_stop(struct net_device *net_dev)
 }
 
 /**
- * __hdd_uninit() - HDD uninit function
- * @dev:	Pointer to net_device structure
+ * hdd_uninit() - HDD uninit function
+ * @dev: Pointer to net_device structure
  *
  * This is called during the netdev unregister to uninitialize all data
  * associated with the device
  *
+ * This function must be protected by a transition
+ *
  * Return: None
  */
-static void __hdd_uninit(struct net_device *dev)
+static void hdd_uninit(struct net_device *dev)
 {
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	struct hdd_context *hdd_ctx;
 
 	hdd_enter_dev(dev);
 
-	do {
-		if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
-			hdd_err("Invalid magic");
-			break;
-		}
+	if (adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
+		hdd_err("Invalid magic");
+		goto exit;
+	}
 
-		hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-		if (!hdd_ctx) {
-			hdd_err("NULL hdd_ctx");
-			break;
-		}
+	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+	if (!hdd_ctx) {
+		hdd_err("NULL hdd_ctx");
+		goto exit;
+	}
 
-		if (dev != adapter->dev)
-			hdd_err("Invalid device reference");
+	if (dev != adapter->dev)
+		hdd_err("Invalid device reference");
 
-		hdd_deinit_adapter(hdd_ctx, adapter, true);
+	hdd_deinit_adapter(hdd_ctx, adapter, true);
 
-		/* after uninit our adapter structure will no longer be valid */
-		adapter->dev = NULL;
-		adapter->magic = 0;
-	} while (0);
+	/* after uninit our adapter structure will no longer be valid */
+	adapter->dev = NULL;
+	adapter->magic = 0;
 
+exit:
 	hdd_exit();
 }
 
-/**
- * hdd_uninit() - Wrapper function to protect __hdd_uninit from SSR
- * @net_dev: pointer to net_device structure
- *
- * This is called during the netdev unregister to uninitialize all data
- * associated with the device
- *
- * Return: none
- */
-static void hdd_uninit(struct net_device *net_dev)
-{
-	cds_ssr_protect(__func__);
-	__hdd_uninit(net_dev);
-	cds_ssr_unprotect(__func__);
-}
-
 static int hdd_open_cesium_nl_sock(void)
 {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
@@ -4991,6 +4976,20 @@ static void hdd_reset_locally_admin_bit(struct hdd_context *hdd_ctx,
 		 MAC_ADDRESS_STR, MAC_ADDR_ARRAY(macAddr));
 }
 
+static void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
+{
+	struct hdd_adapter *adapter =
+		container_of(work, struct hdd_adapter, scan_block_work);
+	struct osif_vdev_sync *vdev_sync;
+
+	if (osif_vdev_sync_op_start(adapter->dev, &vdev_sync))
+		return;
+
+	wlan_hdd_cfg80211_scan_block(adapter);
+
+	osif_vdev_sync_op_stop(vdev_sync);
+}
+
 /**
  * hdd_open_adapter() - open and setup the hdd adatper
  * @hdd_ctx: global hdd context

+ 0 - 2
core/hdd/src/wlan_hdd_nan.c

@@ -162,10 +162,8 @@ int wlan_hdd_cfg80211_nan_ext_request(struct wiphy *wiphy,
 	if (errno)
 		return errno;
 
-	cds_ssr_protect(__func__);
 	errno = __wlan_hdd_cfg80211_nan_ext_request(wiphy, wdev,
 						    data, data_len);
-	cds_ssr_unprotect(__func__);
 
 	osif_psoc_sync_op_stop(psoc_sync);
 

+ 3 - 12
core/hdd/src/wlan_hdd_scan.c

@@ -269,15 +269,13 @@ static bool wlan_hdd_sap_skip_scan_check(struct hdd_context *hdd_ctx,
 }
 #endif
 
-static void __wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
+void wlan_hdd_cfg80211_scan_block(struct hdd_adapter *adapter)
 {
-	struct hdd_adapter *adapter;
 	struct cfg80211_scan_request *request;
 	struct scan_req *blocked_scan_req;
-	qdf_list_node_t *node = NULL;
+	qdf_list_node_t *node;
 
-	adapter = container_of(work, struct hdd_adapter, scan_block_work);
-	if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) {
+	if (adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
 		hdd_err("HDD adapter context is invalid");
 		return;
 	}
@@ -305,13 +303,6 @@ static void __wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
 	qdf_mutex_release(&adapter->blocked_scan_request_q_lock);
 }
 
-void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work)
-{
-	cds_ssr_protect(__func__);
-	__wlan_hdd_cfg80211_scan_block_cb(work);
-	cds_ssr_unprotect(__func__);
-}
-
 void hdd_init_scan_reject_params(struct hdd_context *hdd_ctx)
 {
 	if (hdd_ctx) {

+ 3 - 5
core/hdd/src/wlan_hdd_scan.h

@@ -125,13 +125,11 @@ void hdd_reset_scan_reject_params(struct hdd_context *hdd_ctx,
 				  eCsrRoamResult roam_result);
 
 /**
- * wlan_hdd_cfg80211_scan_block_cb() - scan block work handler
- * @work: Pointer to work
- *
- * This function is used to do scan block work handler
+ * wlan_hdd_cfg80211_scan_block() - scan block handler
+ * @adapter: HDD adapter to work against
  *
  * Return: none
  */
-void wlan_hdd_cfg80211_scan_block_cb(struct work_struct *work);
+void wlan_hdd_cfg80211_scan_block(struct hdd_adapter *adapter);
 #endif /* end #if !defined(WLAN_HDD_SCAN_H) */
 

+ 23 - 16
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -21,6 +21,7 @@
 
 /* Include files */
 #include <linux/semaphore.h>
+#include "osif_sync.h"
 #include <wlan_hdd_tx_rx.h>
 #include <wlan_hdd_softap_tx_rx.h>
 #include <linux/netdevice.h>
@@ -436,10 +437,10 @@ int hdd_inspect_dhcp_packet(struct hdd_adapter *adapter,
  * In case of any packet drop or error, log the error with
  * INFO HIGH/LOW/MEDIUM to avoid excessive logging in kmsg.
  *
- * Return: Always returns NETDEV_TX_OK
+ * Return: None
  */
-static netdev_tx_t __hdd_softap_hard_start_xmit(struct sk_buff *skb,
-						struct net_device *dev)
+static void __hdd_softap_hard_start_xmit(struct sk_buff *skb,
+					 struct net_device *dev)
 {
 	sme_ac_enum_type ac = SME_AC_BE;
 	struct hdd_adapter *adapter = (struct hdd_adapter *) netdev_priv(dev);
@@ -631,7 +632,7 @@ static netdev_tx_t __hdd_softap_hard_start_xmit(struct sk_buff *skb,
 	}
 	netif_trans_update(dev);
 
-	return NETDEV_TX_OK;
+	return;
 
 drop_pkt_and_release_skb:
 	qdf_net_buf_debug_release_skb(skb);
@@ -645,20 +646,21 @@ drop_pkt:
 drop_pkt_accounting:
 	++adapter->stats.tx_dropped;
 	++adapter->hdd_stats.tx_rx_stats.tx_dropped;
-
-	return NETDEV_TX_OK;
 }
 
 netdev_tx_t hdd_softap_hard_start_xmit(struct sk_buff *skb,
-				       struct net_device *dev)
+				       struct net_device *net_dev)
 {
-	netdev_tx_t ret;
+	struct osif_vdev_sync *vdev_sync;
+
+	if (osif_vdev_sync_op_start(net_dev, &vdev_sync))
+		return NETDEV_TX_OK;
+
+	__hdd_softap_hard_start_xmit(skb, net_dev);
 
-	cds_ssr_protect(__func__);
-	ret = __hdd_softap_hard_start_xmit(skb, dev);
-	cds_ssr_unprotect(__func__);
+	osif_vdev_sync_op_stop(vdev_sync);
 
-	return ret;
+	return NETDEV_TX_OK;
 }
 
 static void __hdd_softap_tx_timeout(struct net_device *dev)
@@ -718,11 +720,16 @@ static void __hdd_softap_tx_timeout(struct net_device *dev)
 	}
 }
 
-void hdd_softap_tx_timeout(struct net_device *dev)
+void hdd_softap_tx_timeout(struct net_device *net_dev)
 {
-	cds_ssr_protect(__func__);
-	__hdd_softap_tx_timeout(dev);
-	cds_ssr_unprotect(__func__);
+	struct osif_vdev_sync *vdev_sync;
+
+	if (osif_vdev_sync_op_start(net_dev, &vdev_sync))
+		return;
+
+	__hdd_softap_tx_timeout(net_dev);
+
+	osif_vdev_sync_op_stop(vdev_sync);
 }
 
 QDF_STATUS hdd_softap_init_tx_rx(struct hdd_adapter *adapter)

+ 5 - 18
core/hdd/src/wlan_hdd_stats.c

@@ -5062,7 +5062,7 @@ static void wlan_hdd_get_rcpi_cb(void *context, struct qdf_mac_addr mac_addr,
 }
 
 /**
- * __wlan_hdd_get_rcpi() - local function to get RCPI
+ * wlan_hdd_get_rcpi() - local function to get RCPI
  * @adapter: adapter upon which the measurement is requested
  * @mac: peer addr for which measurement is requested
  * @rcpi_value: pointer to where the RCPI should be returned
@@ -5070,10 +5070,10 @@ static void wlan_hdd_get_rcpi_cb(void *context, struct qdf_mac_addr mac_addr,
  *
  * Return: 0 for success, non-zero for failure
  */
-static int __wlan_hdd_get_rcpi(struct hdd_adapter *adapter,
-			       uint8_t *mac,
-			       int32_t *rcpi_value,
-			       enum rcpi_measurement_type measurement_type)
+int wlan_hdd_get_rcpi(struct hdd_adapter *adapter,
+		      uint8_t *mac,
+		      int32_t *rcpi_value,
+		      enum rcpi_measurement_type measurement_type)
 {
 	struct hdd_context *hdd_ctx;
 	int status = 0, ret = 0;
@@ -5179,19 +5179,6 @@ out:
 	return status;
 }
 
-int wlan_hdd_get_rcpi(struct hdd_adapter *adapter, uint8_t *mac,
-		      int32_t *rcpi_value,
-		      enum rcpi_measurement_type measurement_type)
-{
-	int ret;
-
-	cds_ssr_protect(__func__);
-	ret = __wlan_hdd_get_rcpi(adapter, mac, rcpi_value, measurement_type);
-	cds_ssr_unprotect(__func__);
-
-	return ret;
-}
-
 #ifdef QCA_SUPPORT_CP_STATS
 QDF_STATUS wlan_hdd_get_rssi(struct hdd_adapter *adapter, int8_t *rssi_value)
 {

+ 11 - 5
core/hdd/src/wlan_hdd_tsf.c

@@ -1038,13 +1038,19 @@ static inline void hdd_update_tsf(struct hdd_adapter *adapter, uint64_t tsf)
 static ssize_t hdd_wlan_tsf_show(struct device *dev,
 				 struct device_attribute *attr, char *buf)
 {
-	ssize_t ret;
+	struct net_device *net_dev = container_of(dev, struct net_device, dev);
+	struct osif_vdev_sync *vdev_sync;
+	ssize_t err_size;
 
-	cds_ssr_protect(__func__);
-	ret = __hdd_wlan_tsf_show(dev, attr, buf);
-	cds_ssr_unprotect(__func__);
+	err_size = osif_vdev_sync_op_start(net_dev, &vdev_sync);
+	if (err_size)
+		return err_size;
 
-	return ret;
+	err_size = __hdd_wlan_tsf_show(dev, attr, buf);
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return err_size;
 }
 
 static DEVICE_ATTR(tsf, 0400, hdd_wlan_tsf_show, NULL);

+ 26 - 19
core/hdd/src/wlan_hdd_tx_rx.c

@@ -24,6 +24,7 @@
 
 /* denote that this file does not allow legacy hddLog */
 #define HDD_DISALLOW_LEGACY_HDDLOG 1
+#include "osif_sync.h"
 #include <wlan_hdd_tx_rx.h>
 #include <wlan_hdd_softap_tx_rx.h>
 #include <wlan_hdd_napi.h>
@@ -903,10 +904,10 @@ void hdd_tx_rx_collect_connectivity_stats_info(struct sk_buff *skb,
  * In case of any packet drop or error, log the error with
  * INFO HIGH/LOW/MEDIUM to avoid excessive logging in kmsg.
  *
- * Return: Always returns NETDEV_TX_OK
+ * Return: None
  */
-static netdev_tx_t __hdd_hard_start_xmit(struct sk_buff *skb,
-					 struct net_device *dev)
+static void __hdd_hard_start_xmit(struct sk_buff *skb,
+				  struct net_device *dev)
 {
 	QDF_STATUS status;
 	sme_ac_enum_type ac;
@@ -924,7 +925,7 @@ static netdev_tx_t __hdd_hard_start_xmit(struct sk_buff *skb,
 #ifdef QCA_WIFI_FTM
 	if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) {
 		kfree_skb(skb);
-		return NETDEV_TX_OK;
+		return;
 	}
 #endif
 
@@ -1128,7 +1129,7 @@ static netdev_tx_t __hdd_hard_start_xmit(struct sk_buff *skb,
 
 	netif_trans_update(dev);
 
-	return NETDEV_TX_OK;
+	return;
 
 drop_pkt_and_release_skb:
 	qdf_net_buf_debug_release_skb(skb);
@@ -1153,29 +1154,30 @@ drop_pkt_accounting:
 		QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_INFO_HIGH,
 			"%s : ARP packet dropped", __func__);
 	}
-
-	return NETDEV_TX_OK;
 }
 
 /**
  * hdd_hard_start_xmit() - Wrapper function to protect
  * __hdd_hard_start_xmit from SSR
  * @skb: pointer to OS packet
- * @dev: pointer to net_device structure
+ * @net_dev: pointer to net_device structure
  *
  * Function called by OS if any packet needs to transmit.
  *
  * Return: Always returns NETDEV_TX_OK
  */
-netdev_tx_t hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
+netdev_tx_t hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *net_dev)
 {
-	netdev_tx_t ret;
+	struct osif_vdev_sync *vdev_sync;
 
-	cds_ssr_protect(__func__);
-	ret = __hdd_hard_start_xmit(skb, dev);
-	cds_ssr_unprotect(__func__);
+	if (osif_vdev_sync_op_start(net_dev, &vdev_sync))
+		return NETDEV_TX_OK;
 
-	return ret;
+	__hdd_hard_start_xmit(skb, net_dev);
+
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return NETDEV_TX_OK;
 }
 
 QDF_STATUS hdd_get_peer_sta_id(struct hdd_station_ctx *sta_ctx,
@@ -1282,7 +1284,7 @@ static void __hdd_tx_timeout(struct net_device *dev)
 
 /**
  * hdd_tx_timeout() - Wrapper function to protect __hdd_tx_timeout from SSR
- * @dev: pointer to net_device structure
+ * @net_dev: pointer to net_device structure
  *
  * Function called by OS if there is any timeout during transmission.
  * Since HDD simply enqueues packet and returns control to OS right away,
@@ -1290,11 +1292,16 @@ static void __hdd_tx_timeout(struct net_device *dev)
  *
  * Return: none
  */
-void hdd_tx_timeout(struct net_device *dev)
+void hdd_tx_timeout(struct net_device *net_dev)
 {
-	cds_ssr_protect(__func__);
-	__hdd_tx_timeout(dev);
-	cds_ssr_unprotect(__func__);
+	struct osif_vdev_sync *vdev_sync;
+
+	if (osif_vdev_sync_op_start(net_dev, &vdev_sync))
+		return;
+
+	__hdd_tx_timeout(net_dev);
+
+	osif_vdev_sync_op_stop(vdev_sync);
 }
 
 /**

+ 11 - 6
core/hdd/src/wlan_hdd_wext.c

@@ -3907,17 +3907,22 @@ static int __iw_get_wlm_stats(struct net_device *dev,
 	return 0;
 }
 
-static int iw_get_wlm_stats(struct net_device *dev,
+static int iw_get_wlm_stats(struct net_device *net_dev,
 			    struct iw_request_info *info,
 			    union iwreq_data *wrqu, char *extra)
 {
-	int ret;
+	struct osif_vdev_sync *vdev_sync;
+	int errno;
+
+	errno = osif_vdev_sync_op_start(net_dev, &vdev_sync);
+	if (errno)
+		return errno;
 
-	cds_ssr_protect(__func__);
-	ret = __iw_get_wlm_stats(dev, info, wrqu, extra);
-	cds_ssr_unprotect(__func__);
+	errno = __iw_get_wlm_stats(net_dev, info, wrqu, extra);
 
-	return ret;
+	osif_vdev_sync_op_stop(vdev_sync);
+
+	return errno;
 }
 #endif /* FEATURE_WLM_STATS */