#include <linux/idr.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/list.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/rpmsg.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/mailbox_client.h>
#include "rpmsg_internal.h"
#include "qcom_glink_native.h"
#define GLINK_NAME_SIZE …
#define GLINK_VERSION_1 …
#define RPM_GLINK_CID_MIN …
#define RPM_GLINK_CID_MAX …
struct glink_msg { … } __packed;
struct glink_defer_cmd { … };
struct glink_core_rx_intent { … };
struct qcom_glink { … };
enum { … };
struct glink_channel { … };
#define to_glink_channel(_ept) …
static const struct rpmsg_endpoint_ops glink_endpoint_ops;
#define GLINK_CMD_VERSION …
#define GLINK_CMD_VERSION_ACK …
#define GLINK_CMD_OPEN …
#define GLINK_CMD_CLOSE …
#define GLINK_CMD_OPEN_ACK …
#define GLINK_CMD_INTENT …
#define GLINK_CMD_RX_DONE …
#define GLINK_CMD_RX_INTENT_REQ …
#define GLINK_CMD_RX_INTENT_REQ_ACK …
#define GLINK_CMD_TX_DATA …
#define GLINK_CMD_CLOSE_ACK …
#define GLINK_CMD_TX_DATA_CONT …
#define GLINK_CMD_READ_NOTIF …
#define GLINK_CMD_RX_DONE_W_REUSE …
#define GLINK_CMD_SIGNALS …
#define GLINK_FEATURE_INTENTLESS …
#define NATIVE_DTR_SIG …
#define NATIVE_DSR_SIG …
#define NATIVE_RTS_SIG …
#define NATIVE_CTS_SIG …
static void qcom_glink_rx_done_work(struct work_struct *work);
static struct glink_channel *qcom_glink_alloc_channel(struct qcom_glink *glink,
const char *name)
{ … }
static void qcom_glink_channel_release(struct kref *ref)
{ … }
static size_t qcom_glink_rx_avail(struct qcom_glink *glink)
{ … }
static void qcom_glink_rx_peek(struct qcom_glink *glink,
void *data, unsigned int offset, size_t count)
{ … }
static void qcom_glink_rx_advance(struct qcom_glink *glink, size_t count)
{ … }
static size_t qcom_glink_tx_avail(struct qcom_glink *glink)
{ … }
static void qcom_glink_tx_write(struct qcom_glink *glink,
const void *hdr, size_t hlen,
const void *data, size_t dlen)
{ … }
static void qcom_glink_tx_kick(struct qcom_glink *glink)
{ … }
static void qcom_glink_send_read_notify(struct qcom_glink *glink)
{ … }
static int qcom_glink_tx(struct qcom_glink *glink,
const void *hdr, size_t hlen,
const void *data, size_t dlen, bool wait)
{ … }
static int qcom_glink_send_version(struct qcom_glink *glink)
{ … }
static void qcom_glink_send_version_ack(struct qcom_glink *glink)
{ … }
static void qcom_glink_send_open_ack(struct qcom_glink *glink,
struct glink_channel *channel)
{ … }
static void qcom_glink_handle_intent_req_ack(struct qcom_glink *glink,
unsigned int cid, bool granted)
{ … }
static void qcom_glink_intent_req_abort(struct glink_channel *channel)
{ … }
static int qcom_glink_send_open_req(struct qcom_glink *glink,
struct glink_channel *channel)
{ … }
static void qcom_glink_send_close_req(struct qcom_glink *glink,
struct glink_channel *channel)
{ … }
static void qcom_glink_send_close_ack(struct qcom_glink *glink,
unsigned int rcid)
{ … }
static void qcom_glink_rx_done_work(struct work_struct *work)
{ … }
static void qcom_glink_rx_done(struct qcom_glink *glink,
struct glink_channel *channel,
struct glink_core_rx_intent *intent)
{ … }
static void qcom_glink_receive_version(struct qcom_glink *glink,
u32 version,
u32 features)
{ … }
static void qcom_glink_receive_version_ack(struct qcom_glink *glink,
u32 version,
u32 features)
{ … }
static int qcom_glink_send_intent_req_ack(struct qcom_glink *glink,
struct glink_channel *channel,
bool granted)
{ … }
static int qcom_glink_advertise_intent(struct qcom_glink *glink,
struct glink_channel *channel,
struct glink_core_rx_intent *intent)
{ … }
static struct glink_core_rx_intent *
qcom_glink_alloc_intent(struct qcom_glink *glink,
struct glink_channel *channel,
size_t size,
bool reuseable)
{ … }
static void qcom_glink_handle_rx_done(struct qcom_glink *glink,
u32 cid, uint32_t iid,
bool reuse)
{ … }
static void qcom_glink_handle_intent_req(struct qcom_glink *glink,
u32 cid, size_t size)
{ … }
static int qcom_glink_rx_defer(struct qcom_glink *glink, size_t extra)
{ … }
static int qcom_glink_rx_data(struct qcom_glink *glink, size_t avail)
{ … }
static void qcom_glink_handle_intent(struct qcom_glink *glink,
unsigned int cid,
unsigned int count,
size_t avail)
{ … }
static int qcom_glink_rx_open_ack(struct qcom_glink *glink, unsigned int lcid)
{ … }
static int qcom_glink_set_flow_control(struct rpmsg_endpoint *ept, bool pause, u32 dst)
{ … }
static void qcom_glink_handle_signals(struct qcom_glink *glink,
unsigned int rcid, unsigned int sigs)
{ … }
void qcom_glink_native_rx(struct qcom_glink *glink)
{ … }
EXPORT_SYMBOL(…);
static struct glink_channel *qcom_glink_create_local(struct qcom_glink *glink,
const char *name)
{ … }
static int qcom_glink_create_remote(struct qcom_glink *glink,
struct glink_channel *channel)
{ … }
static struct rpmsg_endpoint *qcom_glink_create_ept(struct rpmsg_device *rpdev,
rpmsg_rx_cb_t cb,
void *priv,
struct rpmsg_channel_info
chinfo)
{ … }
static int qcom_glink_announce_create(struct rpmsg_device *rpdev)
{ … }
static void qcom_glink_destroy_ept(struct rpmsg_endpoint *ept)
{ … }
static int qcom_glink_request_intent(struct qcom_glink *glink,
struct glink_channel *channel,
size_t size)
{ … }
static int __qcom_glink_send(struct glink_channel *channel,
void *data, int len, bool wait)
{ … }
static int qcom_glink_send(struct rpmsg_endpoint *ept, void *data, int len)
{ … }
static int qcom_glink_trysend(struct rpmsg_endpoint *ept, void *data, int len)
{ … }
static int qcom_glink_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
{ … }
static int qcom_glink_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
{ … }
static struct device_node *qcom_glink_match_channel(struct device_node *node,
const char *channel)
{ … }
static const struct rpmsg_device_ops glink_device_ops = …;
static const struct rpmsg_endpoint_ops glink_endpoint_ops = …;
static void qcom_glink_rpdev_release(struct device *dev)
{ … }
static int qcom_glink_rx_open(struct qcom_glink *glink, unsigned int rcid,
char *name)
{ … }
static void qcom_glink_rx_close(struct qcom_glink *glink, unsigned int rcid)
{ … }
static void qcom_glink_rx_close_ack(struct qcom_glink *glink, unsigned int lcid)
{ … }
static void qcom_glink_work(struct work_struct *work)
{ … }
static void qcom_glink_cancel_rx_work(struct qcom_glink *glink)
{ … }
static ssize_t rpmsg_name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(rpmsg_name);
static struct attribute *qcom_glink_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void qcom_glink_device_release(struct device *dev)
{ … }
static int qcom_glink_create_chrdev(struct qcom_glink *glink)
{ … }
struct qcom_glink *qcom_glink_native_probe(struct device *dev,
unsigned long features,
struct qcom_glink_pipe *rx,
struct qcom_glink_pipe *tx,
bool intentless)
{ … }
EXPORT_SYMBOL_GPL(…);
static int qcom_glink_remove_device(struct device *dev, void *data)
{ … }
void qcom_glink_native_remove(struct qcom_glink *glink)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;