qcacld-3.0: Add QMI send related APIs

These APIs can be used to send data request to firmware over QMI
as well as receive response from firmware.

Change-Id: I186d4c53e846af028b5ea75079027217af1580b4
CRs-fixed: 2517225
This commit is contained in:
Yue Ma
2019-08-22 13:47:17 -07:00
committed by nshrivas
父節點 667a5aab35
當前提交 a36c0f1a99
共有 3 個文件被更改,包括 128 次插入0 次删除

查看文件

@@ -643,6 +643,11 @@ int pld_is_fw_down(struct device *dev);
void pld_block_shutdown(struct device *dev, bool status);
int pld_force_assert_target(struct device *dev);
int pld_collect_rddm(struct device *dev);
int pld_qmi_send_get(struct device *dev);
int pld_qmi_send_put(struct device *dev);
int pld_qmi_send(struct device *dev, int type, void *cmd,
int cmd_len, void *cb_ctx,
int (*cb)(void *ctx, void *event, int event_len));
bool pld_is_fw_dump_skipped(struct device *dev);
/**

查看文件

@@ -1768,6 +1768,93 @@ int pld_collect_rddm(struct device *dev)
}
}
/**
* pld_qmi_send_get() - Indicate certain data to be sent over QMI
* @dev: device pointer
*
* This API can be used to indicate certain data to be sent over QMI.
* pld_qmi_send() is expected to be called later.
*
* Return: 0 for success
* Non zero failure code for errors
*/
int pld_qmi_send_get(struct device *dev)
{
enum pld_bus_type type = pld_get_bus_type(dev);
switch (type) {
case PLD_BUS_TYPE_PCIE:
return pld_pcie_qmi_send_get(dev);
case PLD_BUS_TYPE_SNOC:
case PLD_BUS_TYPE_SDIO:
case PLD_BUS_TYPE_USB:
return 0;
default:
pr_err("Invalid device type %d\n", type);
return -EINVAL;
}
}
/**
* pld_qmi_send_put() - Indicate response sent over QMI has been processed
* @dev: device pointer
*
* This API can be used to indicate response of the data sent over QMI has
* been processed.
*
* Return: 0 for success
* Non zero failure code for errors
*/
int pld_qmi_send_put(struct device *dev)
{
enum pld_bus_type type = pld_get_bus_type(dev);
switch (type) {
case PLD_BUS_TYPE_PCIE:
return pld_pcie_qmi_send_put(dev);
case PLD_BUS_TYPE_SNOC:
case PLD_BUS_TYPE_SDIO:
case PLD_BUS_TYPE_USB:
return 0;
default:
pr_err("Invalid device type %d\n", type);
return -EINVAL;
}
}
/**
* pld_qmi_send() - Send data request over QMI
* @dev: device pointer
* @type: type of the send data operation
* @cmd: buffer pointer of send data request command
* @cmd_len: size of the command buffer
* @cb_ctx: context pointer if any to pass back in callback
* @cb: callback pointer to pass response back
*
* This API can be used to send data request over QMI.
*
* Return: 0 if data request sends successfully
* Non zero failure code for errors
*/
int pld_qmi_send(struct device *dev, int type, void *cmd,
int cmd_len, void *cb_ctx,
int (*cb)(void *ctx, void *event, int event_len))
{
enum pld_bus_type bus_type = pld_get_bus_type(dev);
switch (bus_type) {
case PLD_BUS_TYPE_PCIE:
return pld_pcie_qmi_send(dev, type, cmd, cmd_len, cb_ctx, cb);
case PLD_BUS_TYPE_SNOC:
case PLD_BUS_TYPE_SDIO:
case PLD_BUS_TYPE_USB:
return -EINVAL;
default:
pr_err("Invalid device type %d\n", bus_type);
return -EINVAL;
}
}
/**
* pld_is_fw_dump_skipped() - get fw dump skipped status.
* The subsys ssr status help the driver to decide whether to skip

查看文件

@@ -312,6 +312,24 @@ static inline int pld_pcie_collect_rddm(struct device *dev)
return 0;
}
static inline int pld_pcie_qmi_send_get(struct device *dev)
{
return 0;
}
static inline int pld_pcie_qmi_send_put(struct device *dev)
{
return 0;
}
static inline int
pld_pcie_qmi_send(struct device *dev, int type, void *cmd,
int cmd_len, void *cb_ctx,
int (*cb)(void *ctx, void *event, int event_len))
{
return -EINVAL;
}
static inline int pld_pcie_get_user_msi_assignment(struct device *dev,
char *user_name,
int *num_vectors,
@@ -357,6 +375,24 @@ static inline int pld_pcie_collect_rddm(struct device *dev)
return cnss_force_collect_rddm(dev);
}
static inline int pld_pcie_qmi_send_get(struct device *dev)
{
return cnss_qmi_send_get(dev);
}
static inline int pld_pcie_qmi_send_put(struct device *dev)
{
return cnss_qmi_send_put(dev);
}
static inline int
pld_pcie_qmi_send(struct device *dev, int type, void *cmd,
int cmd_len, void *cb_ctx,
int (*cb)(void *ctx, void *event, int event_len))
{
return cnss_qmi_send(dev, type, cmd, cmd_len, cb_ctx, cb);
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
static inline void *pld_pcie_smmu_get_domain(struct device *dev)
{