qcacmn: Add CONFIG_MULTI_IF_LOG to support multi if log

This is a propagation of qcacld-2.0 commit 98821c7dcf49d ("qcacld-2.0:
Add CONFIG_MULTI_IF_LOG to support multi if log"). Add CONFIG_MULTI_IF_LOG
to support multi if log by assigning the specific netlink protocol
when dual wlan cards are loaded.

Change-Id: I827fbd46893c47ed2d9b123bf753c06b2e115fbb
CRs-Fixed: 2525488
This commit is contained in:
Hangtian Zhu
2019-09-11 17:53:40 +08:00
committed by nshrivas
parent 1d97e0c080
commit 24dab77dbe
3 changed files with 11 additions and 10 deletions

View File

@@ -3453,7 +3453,7 @@ qdf_export_symbol(QDF_PRINT_INFO);
void qdf_logging_init(void)
{
wlan_logging_sock_init_svc();
nl_srv_init(NULL);
nl_srv_init(NULL, WLAN_NLINK_PROTO_FAMILY);
wlan_logging_set_flush_timer(qdf_log_flush_timer_period);
}
@@ -3479,7 +3479,7 @@ void qdf_logging_flush_logs(void)
#else
void qdf_logging_init(void)
{
nl_srv_init(NULL);
nl_srv_init(NULL, WLAN_NLINK_PROTO_FAMILY);
}
void qdf_logging_exit(void)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2017, 2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -40,7 +40,7 @@
typedef int (*nl_srv_msg_callback)(struct sk_buff *skb);
int nl_srv_init(void *wiphy);
int nl_srv_init(void *wiphy, int proto);
void nl_srv_exit(void);
int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler);
int nl_srv_unregister(tWlanNlModTypes msg_type,

View File

@@ -48,6 +48,7 @@ static bool logger_initialized;
/**
* nl_srv_init() - wrapper function to register to cnss_logger
* @wiphy: the pointer to the wiphy structure
* @proto: the host log netlink protocol
*
* The netlink socket is no longer initialized in the driver itself, instead
* will be initialized in the cnss_logger module, the driver should register
@@ -60,7 +61,7 @@ static bool logger_initialized;
*
* Return: radio index for success and -EINVAL for failure
*/
int nl_srv_init(void *wiphy)
int nl_srv_init(void *wiphy, int proto)
{
if (logger_initialized)
goto initialized;
@@ -267,7 +268,7 @@ qdf_export_symbol(nl_srv_is_initialized);
#include <net/cnss_nl.h>
/* For CNSS_GENL netlink sockets will be initialized by CNSS Kernel Module */
int nl_srv_init(void *wiphy)
int nl_srv_init(void *wiphy, int proto)
{
return 0;
}
@@ -481,7 +482,7 @@ int nl_srv_ucast(struct sk_buff *skb, int dst_pid, int flag,
return 0;
}
#elif !defined(MULTI_IF_NAME)
#elif !defined(MULTI_IF_NAME) || defined(MULTI_IF_LOG)
/* Global variables */
static DEFINE_MUTEX(nl_srv_sem);
@@ -497,7 +498,7 @@ static void nl_srv_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh);
* Initialize the netlink service.
* Netlink service is usable after this.
*/
int nl_srv_init(void *wiphy)
int nl_srv_init(void *wiphy, int proto)
{
int retcode = 0;
struct netlink_kernel_cfg cfg = {
@@ -505,7 +506,7 @@ int nl_srv_init(void *wiphy)
.input = nl_srv_rcv
};
nl_srv_sock = netlink_kernel_create(&init_net, WLAN_NLINK_PROTO_FAMILY,
nl_srv_sock = netlink_kernel_create(&init_net, proto,
&cfg);
if (nl_srv_sock) {
@@ -738,7 +739,7 @@ qdf_export_symbol(nl_srv_is_initialized);
#else
int nl_srv_init(void *wiphy)
int nl_srv_init(void *wiphy, int proto)
{
return 0;
}