diff options
author | M Chetan Kumar <m.chetan.kumar@linux.intel.com> | 2021-11-20 21:51:55 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-11-22 13:23:08 +0000 |
commit | 00ef32565b9bd03c63ed944bc27878fbbc1c4e0a (patch) | |
tree | 8005f0dd0a7164b49ddb8d0c4618ca7f739a8abd /drivers/net/wwan/iosm/iosm_ipc_imem_ops.c | |
parent | c4804670026b93f4ebddda30af89fd737bf93931 (diff) | |
download | linux-00ef32565b9bd03c63ed944bc27878fbbc1c4e0a.tar.gz linux-00ef32565b9bd03c63ed944bc27878fbbc1c4e0a.tar.bz2 linux-00ef32565b9bd03c63ed944bc27878fbbc1c4e0a.zip |
net: wwan: iosm: device trace collection using relayfs
This patch brings in support for device trace collection.
It implements relayfs interface for pushing device trace
from kernel space to user space.
Driver gets the debugfs base directory associated to WWAN
Device and creates trace_control and trace debugfs for
device tracing. Both trace_control & trace debugfs are
created under /sys/kernel/debug/wwan/wwan0/.
In order to collect device trace on trace0 interface, user
need to write 1 to trace_ctl interface.
Signed-off-by: M Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_imem_ops.c')
-rw-r--r-- | drivers/net/wwan/iosm/iosm_ipc_imem_ops.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c b/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c index 825e8e5ffb2a..43f1796a8984 100644 --- a/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c +++ b/drivers/net/wwan/iosm/iosm_ipc_imem_ops.c @@ -11,6 +11,7 @@ #include "iosm_ipc_imem_ops.h" #include "iosm_ipc_port.h" #include "iosm_ipc_task_queue.h" +#include "iosm_ipc_trace.h" /* Open a packet data online channel between the network layer and CP. */ int ipc_imem_sys_wwan_open(struct iosm_imem *ipc_imem, int if_id) @@ -107,6 +108,23 @@ void ipc_imem_wwan_channel_init(struct iosm_imem *ipc_imem, "failed to register the ipc_wwan interfaces"); } +/** + * ipc_imem_trace_channel_init - Initializes trace channel. + * @ipc_imem: Pointer to iosm_imem struct. + * + * Returns: Pointer to trace instance on success else NULL + */ +struct iosm_trace *ipc_imem_trace_channel_init(struct iosm_imem *ipc_imem) +{ + struct ipc_chnl_cfg chnl_cfg = { 0 }; + + ipc_chnl_cfg_get(&chnl_cfg, IPC_MEM_CTRL_CHL_ID_3); + ipc_imem_channel_init(ipc_imem, IPC_CTYPE_CTRL, chnl_cfg, + IRQ_MOD_OFF); + + return ipc_trace_init(ipc_imem); +} + /* Map SKB to DMA for transfer */ static int ipc_imem_map_skb_to_dma(struct iosm_imem *ipc_imem, struct sk_buff *skb) @@ -182,11 +200,14 @@ channel_unavailable: return false; } -/* Release a sio link to CP. */ -void ipc_imem_sys_cdev_close(struct iosm_cdev *ipc_cdev) +/** + * ipc_imem_sys_port_close - Release a sio link to CP. + * @ipc_imem: Imem instance. + * @channel: Channel instance. + */ +void ipc_imem_sys_port_close(struct iosm_imem *ipc_imem, + struct ipc_mem_channel *channel) { - struct iosm_imem *ipc_imem = ipc_cdev->ipc_imem; - struct ipc_mem_channel *channel = ipc_cdev->channel; enum ipc_phase curr_phase; int status = 0; u32 tail = 0; @@ -643,6 +664,6 @@ int ipc_imem_sys_devlink_read(struct iosm_devlink *devlink, u8 *data, memcpy(data, skb->data, skb->len); devlink_read_fail: - ipc_pcie_kfree_skb(devlink->pcie, skb); + dev_kfree_skb(skb); return rc; } |