Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99cfaeb3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "icnss: Add dev to all export APIs in ICNSS"

parents 99f33fe8 5159763f
Loading
Loading
Loading
Loading
+26 −22
Original line number Original line Diff line number Diff line
@@ -1384,7 +1384,8 @@ static int icnss_enable_recovery(struct icnss_priv *priv)
	return 0;
	return 0;
}
}


int icnss_register_driver(struct icnss_driver_ops *ops)
int __icnss_register_driver(struct icnss_driver_ops *ops,
			    struct module *owner, const char *mod_name)
{
{
	int ret = 0;
	int ret = 0;


@@ -1415,7 +1416,7 @@ int icnss_register_driver(struct icnss_driver_ops *ops)
out:
out:
	return ret;
	return ret;
}
}
EXPORT_SYMBOL(icnss_register_driver);
EXPORT_SYMBOL(__icnss_register_driver);


int icnss_unregister_driver(struct icnss_driver_ops *ops)
int icnss_unregister_driver(struct icnss_driver_ops *ops)
{
{
@@ -1441,7 +1442,7 @@ int icnss_unregister_driver(struct icnss_driver_ops *ops)
}
}
EXPORT_SYMBOL(icnss_unregister_driver);
EXPORT_SYMBOL(icnss_unregister_driver);


int icnss_ce_request_irq(unsigned int ce_id,
int icnss_ce_request_irq(struct device *dev, unsigned int ce_id,
	irqreturn_t (*handler)(int, void *),
	irqreturn_t (*handler)(int, void *),
		unsigned long flags, const char *name, void *ctx)
		unsigned long flags, const char *name, void *ctx)
{
{
@@ -1449,7 +1450,7 @@ int icnss_ce_request_irq(unsigned int ce_id,
	unsigned int irq;
	unsigned int irq;
	struct ce_irq_list *irq_entry;
	struct ce_irq_list *irq_entry;


	if (!penv || !penv->pdev) {
	if (!penv || !penv->pdev || !dev) {
		ret = -ENODEV;
		ret = -ENODEV;
		goto out;
		goto out;
	}
	}
@@ -1488,13 +1489,13 @@ int icnss_ce_request_irq(unsigned int ce_id,
}
}
EXPORT_SYMBOL(icnss_ce_request_irq);
EXPORT_SYMBOL(icnss_ce_request_irq);


int icnss_ce_free_irq(unsigned int ce_id, void *ctx)
int icnss_ce_free_irq(struct device *dev, unsigned int ce_id, void *ctx)
{
{
	int ret = 0;
	int ret = 0;
	unsigned int irq;
	unsigned int irq;
	struct ce_irq_list *irq_entry;
	struct ce_irq_list *irq_entry;


	if (!penv || !penv->pdev) {
	if (!penv || !penv->pdev || !dev) {
		ret = -ENODEV;
		ret = -ENODEV;
		goto out;
		goto out;
	}
	}
@@ -1524,11 +1525,11 @@ int icnss_ce_free_irq(unsigned int ce_id, void *ctx)
}
}
EXPORT_SYMBOL(icnss_ce_free_irq);
EXPORT_SYMBOL(icnss_ce_free_irq);


void icnss_enable_irq(unsigned int ce_id)
void icnss_enable_irq(struct device *dev, unsigned int ce_id)
{
{
	unsigned int irq;
	unsigned int irq;


	if (!penv || !penv->pdev) {
	if (!penv || !penv->pdev || !dev) {
		icnss_pr_err("Platform driver not initialized\n");
		icnss_pr_err("Platform driver not initialized\n");
		return;
		return;
	}
	}
@@ -1548,11 +1549,11 @@ void icnss_enable_irq(unsigned int ce_id)
}
}
EXPORT_SYMBOL(icnss_enable_irq);
EXPORT_SYMBOL(icnss_enable_irq);


void icnss_disable_irq(unsigned int ce_id)
void icnss_disable_irq(struct device *dev, unsigned int ce_id)
{
{
	unsigned int irq;
	unsigned int irq;


	if (!penv || !penv->pdev) {
	if (!penv || !penv->pdev || !dev) {
		icnss_pr_err("Platform driver not initialized\n");
		icnss_pr_err("Platform driver not initialized\n");
		return;
		return;
	}
	}
@@ -1573,9 +1574,9 @@ void icnss_disable_irq(unsigned int ce_id)
}
}
EXPORT_SYMBOL(icnss_disable_irq);
EXPORT_SYMBOL(icnss_disable_irq);


int icnss_get_soc_info(struct icnss_soc_info *info)
int icnss_get_soc_info(struct device *dev, struct icnss_soc_info *info)
{
{
	if (!penv) {
	if (!penv || !dev) {
		icnss_pr_err("Platform driver not initialized\n");
		icnss_pr_err("Platform driver not initialized\n");
		return -EINVAL;
		return -EINVAL;
	}
	}
@@ -1595,10 +1596,13 @@ int icnss_get_soc_info(struct icnss_soc_info *info)
}
}
EXPORT_SYMBOL(icnss_get_soc_info);
EXPORT_SYMBOL(icnss_get_soc_info);


int icnss_set_fw_log_mode(uint8_t fw_log_mode)
int icnss_set_fw_log_mode(struct device *dev, uint8_t fw_log_mode)
{
{
	int ret;
	int ret;


	if (!dev)
		return -ENODEV;

	icnss_pr_dbg("FW log mode: %u\n", fw_log_mode);
	icnss_pr_dbg("FW log mode: %u\n", fw_log_mode);


	ret = wlfw_ini_send_sync_msg(penv, fw_log_mode);
	ret = wlfw_ini_send_sync_msg(penv, fw_log_mode);
@@ -1681,7 +1685,7 @@ int icnss_athdiag_write(struct device *dev, uint32_t offset,
}
}
EXPORT_SYMBOL(icnss_athdiag_write);
EXPORT_SYMBOL(icnss_athdiag_write);


int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config,
int icnss_wlan_enable(struct device *dev, struct icnss_wlan_enable_cfg *config,
		      enum icnss_driver_mode mode,
		      enum icnss_driver_mode mode,
		      const char *host_version)
		      const char *host_version)
{
{
@@ -1689,23 +1693,23 @@ int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config,
}
}
EXPORT_SYMBOL(icnss_wlan_enable);
EXPORT_SYMBOL(icnss_wlan_enable);


int icnss_wlan_disable(enum icnss_driver_mode mode)
int icnss_wlan_disable(struct device *dev, enum icnss_driver_mode mode)
{
{
	return icnss_send_wlan_disable_to_fw(penv);
	return icnss_send_wlan_disable_to_fw(penv);
}
}
EXPORT_SYMBOL(icnss_wlan_disable);
EXPORT_SYMBOL(icnss_wlan_disable);


bool icnss_is_qmi_disable(void)
bool icnss_is_qmi_disable(struct device *dev)
{
{
	return test_bit(SKIP_QMI, &quirks) ? true : false;
	return test_bit(SKIP_QMI, &quirks) ? true : false;
}
}
EXPORT_SYMBOL(icnss_is_qmi_disable);
EXPORT_SYMBOL(icnss_is_qmi_disable);


int icnss_get_ce_id(int irq)
int icnss_get_ce_id(struct device *dev, int irq)
{
{
	int i;
	int i;


	if (!penv || !penv->pdev)
	if (!penv || !penv->pdev || !dev)
		return -ENODEV;
		return -ENODEV;


	for (i = 0; i < ICNSS_MAX_IRQ_REGISTRATIONS; i++) {
	for (i = 0; i < ICNSS_MAX_IRQ_REGISTRATIONS; i++) {
@@ -1719,11 +1723,11 @@ int icnss_get_ce_id(int irq)
}
}
EXPORT_SYMBOL(icnss_get_ce_id);
EXPORT_SYMBOL(icnss_get_ce_id);


int icnss_get_irq(int ce_id)
int icnss_get_irq(struct device *dev, int ce_id)
{
{
	int irq;
	int irq;


	if (!penv || !penv->pdev)
	if (!penv || !penv->pdev || !dev)
		return -ENODEV;
		return -ENODEV;


	if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS)
	if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS)
@@ -2086,7 +2090,7 @@ static int icnss_test_mode_fw_test_off(struct icnss_priv *priv)
		goto out;
		goto out;
	}
	}


	icnss_wlan_disable(ICNSS_OFF);
	icnss_wlan_disable(&priv->pdev->dev, ICNSS_OFF);


	ret = icnss_hw_power_off(priv);
	ret = icnss_hw_power_off(priv);


@@ -2127,7 +2131,7 @@ static int icnss_test_mode_fw_test(struct icnss_priv *priv,


	set_bit(ICNSS_FW_TEST_MODE, &priv->state);
	set_bit(ICNSS_FW_TEST_MODE, &priv->state);


	ret = icnss_wlan_enable(NULL, mode, NULL);
	ret = icnss_wlan_enable(&priv->pdev->dev, NULL, mode, NULL);
	if (ret)
	if (ret)
		goto power_off;
		goto power_off;


+27 −14
Original line number Original line Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -13,10 +13,15 @@
#define _ICNSS_WLAN_H_
#define _ICNSS_WLAN_H_


#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/device.h>


#define ICNSS_MAX_IRQ_REGISTRATIONS    12
#define ICNSS_MAX_IRQ_REGISTRATIONS    12
#define ICNSS_MAX_TIMESTAMP_LEN        32
#define ICNSS_MAX_TIMESTAMP_LEN        32


#ifndef ICNSS_API_WITH_DEV
#define ICNSS_API_WITH_DEV
#endif

enum icnss_uevent {
enum icnss_uevent {
	ICNSS_UEVENT_FW_READY,
	ICNSS_UEVENT_FW_READY,
	ICNSS_UEVENT_FW_CRASHED,
	ICNSS_UEVENT_FW_CRASHED,
@@ -34,6 +39,8 @@ struct icnss_uevent_data {


struct icnss_driver_ops {
struct icnss_driver_ops {
	char *name;
	char *name;
	unsigned long drv_state;
	struct device_driver driver;
	int (*probe)(struct device *dev);
	int (*probe)(struct device *dev);
	void (*remove)(struct device *dev);
	void (*remove)(struct device *dev);
	void (*shutdown)(struct device *dev);
	void (*shutdown)(struct device *dev);
@@ -99,35 +106,41 @@ struct icnss_soc_info {
	char fw_build_timestamp[ICNSS_MAX_TIMESTAMP_LEN + 1];
	char fw_build_timestamp[ICNSS_MAX_TIMESTAMP_LEN + 1];
};
};


extern int icnss_register_driver(struct icnss_driver_ops *driver);
#define icnss_register_driver(ops)		\
extern int icnss_unregister_driver(struct icnss_driver_ops *driver);
	__icnss_register_driver(ops, THIS_MODULE, KBUILD_MODNAME)
extern int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config,
extern int __icnss_register_driver(struct icnss_driver_ops *ops,
				   struct module *owner, const char *mod_name);

extern int icnss_unregister_driver(struct icnss_driver_ops *ops);

extern int icnss_wlan_enable(struct device *dev,
			     struct icnss_wlan_enable_cfg *config,
			     enum icnss_driver_mode mode,
			     enum icnss_driver_mode mode,
			     const char *host_version);
			     const char *host_version);
extern int icnss_wlan_disable(enum icnss_driver_mode mode);
extern int icnss_wlan_disable(struct device *dev, enum icnss_driver_mode mode);
extern void icnss_enable_irq(unsigned int ce_id);
extern void icnss_enable_irq(struct device *dev, unsigned int ce_id);
extern void icnss_disable_irq(unsigned int ce_id);
extern void icnss_disable_irq(struct device *dev, unsigned int ce_id);
extern int icnss_get_soc_info(struct icnss_soc_info *info);
extern int icnss_get_soc_info(struct device *dev, struct icnss_soc_info *info);
extern int icnss_ce_free_irq(unsigned int ce_id, void *ctx);
extern int icnss_ce_free_irq(struct device *dev, unsigned int ce_id, void *ctx);
extern int icnss_ce_request_irq(unsigned int ce_id,
extern int icnss_ce_request_irq(struct device *dev, unsigned int ce_id,
	irqreturn_t (*handler)(int, void *),
	irqreturn_t (*handler)(int, void *),
	unsigned long flags, const char *name, void *ctx);
	unsigned long flags, const char *name, void *ctx);
extern int icnss_get_ce_id(int irq);
extern int icnss_get_ce_id(struct device *dev, int irq);
extern int icnss_set_fw_log_mode(uint8_t fw_log_mode);
extern int icnss_set_fw_log_mode(struct device *dev, uint8_t fw_log_mode);
extern int icnss_athdiag_read(struct device *dev, uint32_t offset,
extern int icnss_athdiag_read(struct device *dev, uint32_t offset,
			      uint32_t mem_type, uint32_t data_len,
			      uint32_t mem_type, uint32_t data_len,
			      uint8_t *output);
			      uint8_t *output);
extern int icnss_athdiag_write(struct device *dev, uint32_t offset,
extern int icnss_athdiag_write(struct device *dev, uint32_t offset,
			       uint32_t mem_type, uint32_t data_len,
			       uint32_t mem_type, uint32_t data_len,
			       uint8_t *input);
			       uint8_t *input);
extern int icnss_get_irq(int ce_id);
extern int icnss_get_irq(struct device *dev, int ce_id);
extern int icnss_power_on(struct device *dev);
extern int icnss_power_on(struct device *dev);
extern int icnss_power_off(struct device *dev);
extern int icnss_power_off(struct device *dev);
extern struct dma_iommu_mapping *icnss_smmu_get_mapping(struct device *dev);
extern struct dma_iommu_mapping *icnss_smmu_get_mapping(struct device *dev);
extern int icnss_smmu_map(struct device *dev, phys_addr_t paddr,
extern int icnss_smmu_map(struct device *dev, phys_addr_t paddr,
			  uint32_t *iova_addr, size_t size);
			  uint32_t *iova_addr, size_t size);
extern unsigned int icnss_socinfo_get_serial_number(struct device *dev);
extern unsigned int icnss_socinfo_get_serial_number(struct device *dev);
extern bool icnss_is_qmi_disable(void);
extern bool icnss_is_qmi_disable(struct device *dev);
extern bool icnss_is_fw_ready(void);
extern bool icnss_is_fw_ready(void);
extern int icnss_trigger_recovery(struct device *dev);
extern int icnss_trigger_recovery(struct device *dev);
#endif /* _ICNSS_WLAN_H_ */
#endif /* _ICNSS_WLAN_H_ */