1 /* SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2020-21 Intel Corporation.
6 #ifndef IOSM_IPC_PORT_H
7 #define IOSM_IPC_PORT_H
9 #include <linux/wwan.h>
11 #include "iosm_ipc_imem_ops.h"
14 * struct iosm_cdev - State of the char driver layer.
15 * @iosm_port: Pointer of type wwan_port
16 * @ipc_imem: imem instance
17 * @dev: Pointer to device struct
18 * @pcie: PCIe component
19 * @port_type: WWAN port type
20 * @channel: Channel instance
21 * @chl_id: Channel Identifier
24 struct wwan_port *iosm_port;
25 struct iosm_imem *ipc_imem;
27 struct iosm_pcie *pcie;
28 enum wwan_port_type port_type;
29 struct ipc_mem_channel *channel;
30 enum ipc_channel_id chl_id;
34 * ipc_port_init - Allocate IPC port & register to wwan subsystem for AT/MBIM
36 * @ipc_imem: Pointer to iosm_imem structure
37 * @ipc_port_cfg: IPC Port Config
39 * Returns: 0 on success & NULL on failure
41 struct iosm_cdev *ipc_port_init(struct iosm_imem *ipc_imem,
42 struct ipc_chnl_cfg ipc_port_cfg);
45 * ipc_port_deinit - Free IPC port & unregister port with wwan subsystem.
46 * @ipc_port: Array of pointer to the ipc port data-struct
48 void ipc_port_deinit(struct iosm_cdev *ipc_port[]);