rmnet_ctl: remove dependencies

Removes hard dependendencies between rmnet_core and rmnet_ctl.

Change-Id: I9931380fc6406eec5842a824181a0bacbb6ce73a
Acked-by: Weiyi Chen <weiyic@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
此提交包含在:
Subash Abhinov Kasiviswanathan
2020-04-11 15:33:27 -07:00
父節點 2724751ae6
當前提交 e87877cb0c
共有 4 個檔案被更改,包括 59 行新增48 行删除

查看文件

@@ -10,8 +10,6 @@
#include <linux/skbuff.h>
#define CONFIG_RMNET_CTL 1
enum rmnet_ctl_log_lvl {
RMNET_CTL_LOG_CRIT,
RMNET_CTL_LOG_ERR,
@@ -19,50 +17,16 @@ enum rmnet_ctl_log_lvl {
RMNET_CTL_LOG_DEBUG,
};
#define rmnet_ctl_log_err(msg, rc, data, len) \
rmnet_ctl_log(RMNET_CTL_LOG_ERR, msg, rc, data, len)
#define rmnet_ctl_log_info(msg, data, len) \
rmnet_ctl_log(RMNET_CTL_LOG_INFO, msg, 0, data, len)
#define rmnet_ctl_log_debug(msg, data, len) \
rmnet_ctl_log(RMNET_CTL_LOG_DEBUG, msg, 0, data, len)
struct rmnet_ctl_client_hooks {
void (*ctl_dl_client_hook)(struct sk_buff *skb);
};
#ifdef CONFIG_RMNET_CTL
void *rmnet_ctl_register_client(struct rmnet_ctl_client_hooks *hook);
int rmnet_ctl_unregister_client(void *handle);
int rmnet_ctl_send_client(void *handle, struct sk_buff *skb);
void rmnet_ctl_log(enum rmnet_ctl_log_lvl lvl, const char *msg,
int rc, const void *data, unsigned int len);
#else
static inline void *rmnet_ctl_register_client(
struct rmnet_ctl_client_hooks *hook)
{
return NULL;
}
static inline int rmnet_ctl_unregister_client(void *handle)
{
return -EINVAL;
}
static inline int rmnet_ctl_send_client(void *handle, struct sk_buff *skb)
{
return -EINVAL;
}
static inline void rmnet_ctl_log(enum rmnet_ctl_log_lvl lvl, const char *msg,
int rc, const void *data, unsigned int len)
{
}
#endif /* CONFIG_RMNET_CTL */
struct rmnet_ctl_client_if {
void * (*reg)(struct rmnet_ctl_client_hooks *hook);
int (*dereg)(void *handle);
int (*send)(void *handle, struct sk_buff *skb);
void (*log)(enum rmnet_ctl_log_lvl lvl, const char *msg, int rc,
const void *data, unsigned int len);
};
#endif /* _RMNET_CTL_H_ */