소스 검색

qcacld-3.0: Add son os_if tx/rx registration APIs

Add APIs to register SON callback with os_if/lmac_if.
Export os_if APIs called by SON KO.

Change-Id: Ia19dd1822bfba1b41744505a2af52b4b7e0c01f5
CRs-Fixed: 3118965
nakul kachhwaha 3 년 전
부모
커밋
6343e7e90d
2개의 변경된 파일103개의 추가작업 그리고 0개의 파일을 삭제
  1. 58 0
      os_if/son/inc/os_if_son.h
  2. 45 0
      os_if/son/src/os_if_son.c

+ 58 - 0
os_if/son/inc/os_if_son.h

@@ -127,6 +127,64 @@ struct son_callbacks {
 				    struct ieee80211_acs_dbg *acs_r);
 };
 
+/**
+ * enum os_if_son_vendor_cmd_type - Enum to specify get/set command
+ * @OS_IF_SON_VENDOR_GET_CMD: Get type command called from wificonfiguration
+ *                            vendor command handler
+ * @OS_IF_SON_VENDOR_SET_CMD: Set type command called from wificonfiguration
+ *                            vendor command handler
+ * @OS_IF_SON_VENDOR_MAX_CMD: Max cmd type
+ */
+enum os_if_son_vendor_cmd_type {
+	OS_IF_SON_VENDOR_GET_CMD,
+	OS_IF_SON_VENDOR_SET_CMD,
+	OS_IF_SON_VENDOR_MAX_CMD,
+};
+
+/**
+ * struct os_if_son_rx_ops - Contains cb for os_if rx ops used by SON
+ * @parse_generic_nl_cmd: Callback for parsing generic nl vendor commands
+ */
+struct os_if_son_rx_ops {
+	int (*parse_generic_nl_cmd)(struct wiphy *wiphy,
+				    struct wireless_dev *wdev, void *params,
+				    enum os_if_son_vendor_cmd_type type);
+};
+
+/**
+ * struct wlan_os_if_son_ops - Contains cb for os_if txrx ops used by SON
+ * @son_osif_rx_ops: structure to contain rx ops
+ */
+struct wlan_os_if_son_ops {
+	struct os_if_son_rx_ops son_osif_rx_ops;
+};
+
+/**
+ * wlan_os_if_son_ops_register_cb() - Set son os_if ops cb
+ * @handler: son os_if ops cb table
+ *
+ * Return: void
+ */
+void
+wlan_os_if_son_ops_register_cb(void (*handler)(struct wlan_os_if_son_ops *));
+
+/**
+ * os_if_son_register_osif_ops() - Register son os_if ops with os_if
+ *
+ * Return: void
+ */
+void os_if_son_register_osif_ops(void);
+
+/**
+ * os_if_son_register_lmac_if_ops() - Register son lmac_if rx_ops with lmac
+ * @psoc: objmrg psoc handle
+ *
+ * Register son lmac_if rx_ops with lmac to be called by SON DLKM
+ *
+ * Return: void
+ */
+void os_if_son_register_lmac_if_ops(struct wlan_objmgr_psoc *psoc);
+
 /**
  * os_if_son_register_hdd_callbacks() - register son hdd callback
  * @psoc: psoc

+ 45 - 0
os_if/son/src/os_if_son.c

@@ -37,6 +37,8 @@
 #include <wlan_dcs_ucfg_api.h>
 
 static struct son_callbacks g_son_os_if_cb;
+static struct wlan_os_if_son_ops g_son_os_if_txrx_ops;
+static void (*os_if_son_ops_cb)(struct wlan_os_if_son_ops *son_ops);
 
 void os_if_son_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
 				      struct son_callbacks *cb_obj)
@@ -1441,3 +1443,46 @@ int os_if_son_get_acs_report(struct wlan_objmgr_vdev *vdev,
 }
 
 qdf_export_symbol(os_if_son_get_acs_report);
+
+void
+wlan_os_if_son_ops_register_cb(void (*handler)(struct wlan_os_if_son_ops *))
+{
+	os_if_son_ops_cb = handler;
+}
+
+qdf_export_symbol(wlan_os_if_son_ops_register_cb);
+
+static void wlan_son_register_os_if_ops(struct wlan_os_if_son_ops *son_ops)
+{
+	if (os_if_son_ops_cb)
+		os_if_son_ops_cb(son_ops);
+	else
+		osif_err("\n***** OS_IF: SON MODULE NOT LOADED *****\n");
+}
+
+void os_if_son_register_lmac_if_ops(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_lmac_if_rx_ops *rx_ops;
+
+	if (!psoc) {
+		osif_err("psoc is NULL");
+		return;
+	}
+
+	rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
+	if (!rx_ops) {
+		osif_err("rx_ops is null");
+		return;
+	}
+
+	wlan_lmac_if_son_mod_register_rx_ops(rx_ops);
+}
+
+qdf_export_symbol(os_if_son_register_lmac_if_ops);
+
+void os_if_son_register_osif_ops(void)
+{
+	wlan_son_register_os_if_ops(&g_son_os_if_txrx_ops);
+}
+
+qdf_export_symbol(os_if_son_register_osif_ops);