#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/spinlock.h>
#include <linux/idr.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/of_device.h>
#include <linux/soc/qcom/apr.h>
#include <linux/soc/qcom/pdr.h>
#include <linux/rpmsg.h>
#include <linux/of.h>
enum { … };
#define GPR_DYNAMIC_PORT_START …
#define GPR_DYNAMIC_PORT_END …
struct packet_router { … };
struct apr_rx_buf { … };
int apr_send_pkt(struct apr_device *adev, struct apr_pkt *pkt)
{ … }
EXPORT_SYMBOL_GPL(…);
void gpr_free_port(gpr_port_t *port)
{ … }
EXPORT_SYMBOL_GPL(…);
gpr_port_t *gpr_alloc_port(struct apr_device *gdev, struct device *dev,
gpr_port_cb cb, void *priv)
{ … }
EXPORT_SYMBOL_GPL(…);
static int pkt_router_send_svc_pkt(struct pkt_router_svc *svc, struct gpr_pkt *pkt)
{ … }
int gpr_send_pkt(struct apr_device *gdev, struct gpr_pkt *pkt)
{ … }
EXPORT_SYMBOL_GPL(…);
int gpr_send_port_pkt(gpr_port_t *port, struct gpr_pkt *pkt)
{ … }
EXPORT_SYMBOL_GPL(…);
static void apr_dev_release(struct device *dev)
{ … }
static int apr_callback(struct rpmsg_device *rpdev, void *buf,
int len, void *priv, u32 addr)
{ … }
static int apr_do_rx_callback(struct packet_router *apr, struct apr_rx_buf *abuf)
{ … }
static int gpr_do_rx_callback(struct packet_router *gpr, struct apr_rx_buf *abuf)
{ … }
static void apr_rxwq(struct work_struct *work)
{ … }
static int apr_device_match(struct device *dev, const struct device_driver *drv)
{ … }
static int apr_device_probe(struct device *dev)
{ … }
static void apr_device_remove(struct device *dev)
{ … }
static int apr_uevent(const struct device *dev, struct kobj_uevent_env *env)
{ … }
const struct bus_type aprbus = …;
EXPORT_SYMBOL_GPL(…);
static int apr_add_device(struct device *dev, struct device_node *np,
u32 svc_id, u32 domain_id)
{ … }
static int of_apr_add_pd_lookups(struct device *dev)
{ … }
static void of_register_apr_devices(struct device *dev, const char *svc_path)
{ … }
static int apr_remove_device(struct device *dev, void *svc_path)
{ … }
static void apr_pd_status(int state, char *svc_path, void *priv)
{ … }
static int apr_probe(struct rpmsg_device *rpdev)
{ … }
static void apr_remove(struct rpmsg_device *rpdev)
{ … }
int __apr_driver_register(struct apr_driver *drv, struct module *owner)
{ … }
EXPORT_SYMBOL_GPL(…);
void apr_driver_unregister(struct apr_driver *drv)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct of_device_id pkt_router_of_match[] = …;
MODULE_DEVICE_TABLE(of, pkt_router_of_match);
static struct rpmsg_driver packet_router_driver = …;
static int __init apr_init(void)
{ … }
static void __exit apr_exit(void)
{ … }
subsys_initcall(apr_init);
module_exit(apr_exit);
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;