Browse Source

qcacmn: Add wrapper to call legacy userspace or GENL socket API

Add single wrapper API to send message over legacy userspace socket
or GENL socket.

Change-Id: I7cf46651d64467e77d85c147080d74a7470e42d6
CRs-Fixed: 2003488
Naveen Rawat 8 years ago
parent
commit
e3e6f491d1
2 changed files with 27 additions and 0 deletions
  1. 2 0
      utils/nlink/inc/wlan_nlink_srv.h
  2. 25 0
      utils/nlink/src/wlan_nlink_srv.c

+ 2 - 0
utils/nlink/inc/wlan_nlink_srv.h

@@ -65,4 +65,6 @@ int nl_srv_bcast(struct sk_buff *skb);
 #endif
 
 int nl_srv_is_initialized(void);
+void nl_srv_ucast_oem(struct sk_buff *skb, int dst_pid, int flag);
+
 #endif

+ 25 - 0
utils/nlink/src/wlan_nlink_srv.c

@@ -753,3 +753,28 @@ int nl_srv_is_initialized(void)
 	return 0;
 }
 #endif
+
+
+/**
+ * nl_srv_ucast_oem() - Wrapper function to send ucast msgs to OEM
+ * @skb: sk buffer pointer
+ * @dst_pid: Destination PID
+ * @flag: flags
+ *
+ * Sends the ucast message to OEM with generic nl socket if CNSS_GENL
+ * is enabled. Else, use the legacy netlink socket to send.
+ *
+ * Return: None
+ */
+#ifdef CNSS_GENL
+void nl_srv_ucast_oem(struct sk_buff *skb, int dst_pid, int flag)
+{
+	nl_srv_ucast(skb, dst_pid, flag, WLAN_NL_MSG_OEM,
+					CLD80211_MCGRP_OEM_MSGS);
+}
+#else
+void nl_srv_ucast_oem(struct sk_buff *skb, int dst_pid, int flag)
+{
+	nl_srv_ucast(skb, dst_pid, flag);
+}
+#endif