Loading drivers/soc/qcom/icnss.c +32 −22 Original line number Diff line number Diff line Loading @@ -2819,7 +2819,8 @@ enable_pdr: 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; Loading Loading @@ -2850,7 +2851,7 @@ int icnss_register_driver(struct icnss_driver_ops *ops) out: return ret; } EXPORT_SYMBOL(icnss_register_driver); EXPORT_SYMBOL(__icnss_register_driver); int icnss_unregister_driver(struct icnss_driver_ops *ops) { Loading @@ -2876,7 +2877,7 @@ out: } 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 *), unsigned long flags, const char *name, void *ctx) { Loading @@ -2884,7 +2885,7 @@ int icnss_ce_request_irq(unsigned int ce_id, unsigned int irq; struct ce_irq_list *irq_entry; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { ret = -ENODEV; goto out; } Loading Loading @@ -2923,13 +2924,13 @@ out: } 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; unsigned int irq; struct ce_irq_list *irq_entry; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { ret = -ENODEV; goto out; } Loading Loading @@ -2959,11 +2960,11 @@ out: } 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; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { icnss_pr_err("Platform driver not initialized\n"); return; } Loading @@ -2983,11 +2984,11 @@ void icnss_enable_irq(unsigned int ce_id) } 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; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { icnss_pr_err("Platform driver not initialized\n"); return; } Loading @@ -3008,9 +3009,9 @@ void icnss_disable_irq(unsigned int ce_id) } 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"); return -EINVAL; } Loading @@ -3030,10 +3031,13 @@ int icnss_get_soc_info(struct icnss_soc_info *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; if (!dev) return -ENODEV; icnss_pr_dbg("FW log mode: %u\n", fw_log_mode); ret = wlfw_ini_send_sync_msg(fw_log_mode); Loading Loading @@ -3116,7 +3120,7 @@ out: } 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, const char *host_version) { Loading @@ -3124,6 +3128,9 @@ int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config, u32 i; int ret; if (!dev) return -ENODEV; icnss_pr_dbg("Mode: %d, config: %p, host_version: %s\n", mode, config, host_version); Loading Loading @@ -3190,23 +3197,26 @@ out: } 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) { if (!dev) return -ENODEV; return wlfw_wlan_mode_send_sync_msg(QMI_WLFW_OFF_V01); } 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; } 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; if (!penv || !penv->pdev) if (!penv || !penv->pdev || !dev) return -ENODEV; for (i = 0; i < ICNSS_MAX_IRQ_REGISTRATIONS; i++) { Loading @@ -3220,11 +3230,11 @@ int icnss_get_ce_id(int irq) } 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; if (!penv || !penv->pdev) if (!penv || !penv->pdev || !dev) return -ENODEV; if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS) Loading Loading @@ -3658,7 +3668,7 @@ static int icnss_test_mode_fw_test_off(struct icnss_priv *priv) goto out; } icnss_wlan_disable(ICNSS_OFF); icnss_wlan_disable(&priv->pdev->dev, ICNSS_OFF); ret = icnss_hw_power_off(priv); Loading Loading @@ -3699,7 +3709,7 @@ static int icnss_test_mode_fw_test(struct icnss_priv *priv, 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) goto power_off; Loading include/soc/qcom/icnss.h +26 −13 Original line number Diff line number Diff line Loading @@ -13,10 +13,15 @@ #define _ICNSS_WLAN_H_ #include <linux/interrupt.h> #include <linux/device.h> #define ICNSS_MAX_IRQ_REGISTRATIONS 12 #define ICNSS_MAX_TIMESTAMP_LEN 32 #ifndef ICNSS_API_WITH_DEV #define ICNSS_API_WITH_DEV #endif enum icnss_uevent { ICNSS_UEVENT_FW_READY, ICNSS_UEVENT_FW_CRASHED, Loading @@ -40,6 +45,8 @@ struct icnss_uevent_data { struct icnss_driver_ops { char *name; unsigned long drv_state; struct device_driver driver; int (*probe)(struct device *dev); void (*remove)(struct device *dev); void (*shutdown)(struct device *dev); Loading Loading @@ -105,28 +112,34 @@ struct icnss_soc_info { char fw_build_timestamp[ICNSS_MAX_TIMESTAMP_LEN + 1]; }; extern int icnss_register_driver(struct icnss_driver_ops *driver); extern int icnss_unregister_driver(struct icnss_driver_ops *driver); extern int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config, #define icnss_register_driver(ops) \ __icnss_register_driver(ops, THIS_MODULE, KBUILD_MODNAME) 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, const char *host_version); extern int icnss_wlan_disable(enum icnss_driver_mode mode); extern void icnss_enable_irq(unsigned int ce_id); extern void icnss_disable_irq(unsigned int ce_id); extern int icnss_get_soc_info(struct icnss_soc_info *info); extern int icnss_ce_free_irq(unsigned int ce_id, void *ctx); extern int icnss_ce_request_irq(unsigned int ce_id, extern int icnss_wlan_disable(struct device *dev, enum icnss_driver_mode mode); extern void icnss_enable_irq(struct device *dev, unsigned int ce_id); extern void icnss_disable_irq(struct device *dev, unsigned int ce_id); extern int icnss_get_soc_info(struct device *dev, struct icnss_soc_info *info); extern int icnss_ce_free_irq(struct device *dev, unsigned int ce_id, void *ctx); extern int icnss_ce_request_irq(struct device *dev, unsigned int ce_id, irqreturn_t (*handler)(int, void *), unsigned long flags, const char *name, void *ctx); extern int icnss_get_ce_id(int irq); extern int icnss_set_fw_log_mode(uint8_t fw_log_mode); extern int icnss_get_ce_id(struct device *dev, int irq); 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, uint32_t mem_type, uint32_t data_len, uint8_t *output); extern int icnss_athdiag_write(struct device *dev, uint32_t offset, uint32_t mem_type, uint32_t data_len, 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_off(struct device *dev); extern struct dma_iommu_mapping *icnss_smmu_get_mapping(struct device *dev); Loading @@ -138,7 +151,7 @@ extern int icnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 *ch_count, u16 buf_len); extern int icnss_wlan_set_dfs_nol(const void *info, u16 info_len); extern int icnss_wlan_get_dfs_nol(void *info, u16 info_len); extern bool icnss_is_qmi_disable(void); extern bool icnss_is_qmi_disable(struct device *dev); extern bool icnss_is_fw_ready(void); extern int icnss_set_wlan_mac_address(const u8 *in, const uint32_t len); extern u8 *icnss_get_wlan_mac_address(struct device *dev, uint32_t *num); Loading Loading
drivers/soc/qcom/icnss.c +32 −22 Original line number Diff line number Diff line Loading @@ -2819,7 +2819,8 @@ enable_pdr: 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; Loading Loading @@ -2850,7 +2851,7 @@ int icnss_register_driver(struct icnss_driver_ops *ops) out: return ret; } EXPORT_SYMBOL(icnss_register_driver); EXPORT_SYMBOL(__icnss_register_driver); int icnss_unregister_driver(struct icnss_driver_ops *ops) { Loading @@ -2876,7 +2877,7 @@ out: } 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 *), unsigned long flags, const char *name, void *ctx) { Loading @@ -2884,7 +2885,7 @@ int icnss_ce_request_irq(unsigned int ce_id, unsigned int irq; struct ce_irq_list *irq_entry; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { ret = -ENODEV; goto out; } Loading Loading @@ -2923,13 +2924,13 @@ out: } 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; unsigned int irq; struct ce_irq_list *irq_entry; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { ret = -ENODEV; goto out; } Loading Loading @@ -2959,11 +2960,11 @@ out: } 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; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { icnss_pr_err("Platform driver not initialized\n"); return; } Loading @@ -2983,11 +2984,11 @@ void icnss_enable_irq(unsigned int ce_id) } 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; if (!penv || !penv->pdev) { if (!penv || !penv->pdev || !dev) { icnss_pr_err("Platform driver not initialized\n"); return; } Loading @@ -3008,9 +3009,9 @@ void icnss_disable_irq(unsigned int ce_id) } 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"); return -EINVAL; } Loading @@ -3030,10 +3031,13 @@ int icnss_get_soc_info(struct icnss_soc_info *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; if (!dev) return -ENODEV; icnss_pr_dbg("FW log mode: %u\n", fw_log_mode); ret = wlfw_ini_send_sync_msg(fw_log_mode); Loading Loading @@ -3116,7 +3120,7 @@ out: } 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, const char *host_version) { Loading @@ -3124,6 +3128,9 @@ int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config, u32 i; int ret; if (!dev) return -ENODEV; icnss_pr_dbg("Mode: %d, config: %p, host_version: %s\n", mode, config, host_version); Loading Loading @@ -3190,23 +3197,26 @@ out: } 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) { if (!dev) return -ENODEV; return wlfw_wlan_mode_send_sync_msg(QMI_WLFW_OFF_V01); } 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; } 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; if (!penv || !penv->pdev) if (!penv || !penv->pdev || !dev) return -ENODEV; for (i = 0; i < ICNSS_MAX_IRQ_REGISTRATIONS; i++) { Loading @@ -3220,11 +3230,11 @@ int icnss_get_ce_id(int irq) } 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; if (!penv || !penv->pdev) if (!penv || !penv->pdev || !dev) return -ENODEV; if (ce_id >= ICNSS_MAX_IRQ_REGISTRATIONS) Loading Loading @@ -3658,7 +3668,7 @@ static int icnss_test_mode_fw_test_off(struct icnss_priv *priv) goto out; } icnss_wlan_disable(ICNSS_OFF); icnss_wlan_disable(&priv->pdev->dev, ICNSS_OFF); ret = icnss_hw_power_off(priv); Loading Loading @@ -3699,7 +3709,7 @@ static int icnss_test_mode_fw_test(struct icnss_priv *priv, 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) goto power_off; Loading
include/soc/qcom/icnss.h +26 −13 Original line number Diff line number Diff line Loading @@ -13,10 +13,15 @@ #define _ICNSS_WLAN_H_ #include <linux/interrupt.h> #include <linux/device.h> #define ICNSS_MAX_IRQ_REGISTRATIONS 12 #define ICNSS_MAX_TIMESTAMP_LEN 32 #ifndef ICNSS_API_WITH_DEV #define ICNSS_API_WITH_DEV #endif enum icnss_uevent { ICNSS_UEVENT_FW_READY, ICNSS_UEVENT_FW_CRASHED, Loading @@ -40,6 +45,8 @@ struct icnss_uevent_data { struct icnss_driver_ops { char *name; unsigned long drv_state; struct device_driver driver; int (*probe)(struct device *dev); void (*remove)(struct device *dev); void (*shutdown)(struct device *dev); Loading Loading @@ -105,28 +112,34 @@ struct icnss_soc_info { char fw_build_timestamp[ICNSS_MAX_TIMESTAMP_LEN + 1]; }; extern int icnss_register_driver(struct icnss_driver_ops *driver); extern int icnss_unregister_driver(struct icnss_driver_ops *driver); extern int icnss_wlan_enable(struct icnss_wlan_enable_cfg *config, #define icnss_register_driver(ops) \ __icnss_register_driver(ops, THIS_MODULE, KBUILD_MODNAME) 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, const char *host_version); extern int icnss_wlan_disable(enum icnss_driver_mode mode); extern void icnss_enable_irq(unsigned int ce_id); extern void icnss_disable_irq(unsigned int ce_id); extern int icnss_get_soc_info(struct icnss_soc_info *info); extern int icnss_ce_free_irq(unsigned int ce_id, void *ctx); extern int icnss_ce_request_irq(unsigned int ce_id, extern int icnss_wlan_disable(struct device *dev, enum icnss_driver_mode mode); extern void icnss_enable_irq(struct device *dev, unsigned int ce_id); extern void icnss_disable_irq(struct device *dev, unsigned int ce_id); extern int icnss_get_soc_info(struct device *dev, struct icnss_soc_info *info); extern int icnss_ce_free_irq(struct device *dev, unsigned int ce_id, void *ctx); extern int icnss_ce_request_irq(struct device *dev, unsigned int ce_id, irqreturn_t (*handler)(int, void *), unsigned long flags, const char *name, void *ctx); extern int icnss_get_ce_id(int irq); extern int icnss_set_fw_log_mode(uint8_t fw_log_mode); extern int icnss_get_ce_id(struct device *dev, int irq); 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, uint32_t mem_type, uint32_t data_len, uint8_t *output); extern int icnss_athdiag_write(struct device *dev, uint32_t offset, uint32_t mem_type, uint32_t data_len, 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_off(struct device *dev); extern struct dma_iommu_mapping *icnss_smmu_get_mapping(struct device *dev); Loading @@ -138,7 +151,7 @@ extern int icnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 *ch_count, u16 buf_len); extern int icnss_wlan_set_dfs_nol(const void *info, u16 info_len); extern int icnss_wlan_get_dfs_nol(void *info, u16 info_len); extern bool icnss_is_qmi_disable(void); extern bool icnss_is_qmi_disable(struct device *dev); extern bool icnss_is_fw_ready(void); extern int icnss_set_wlan_mac_address(const u8 *in, const uint32_t len); extern u8 *icnss_get_wlan_mac_address(struct device *dev, uint32_t *num); Loading