#include <linux/kthread.h>
#include <linux/sizes.h>
#include <linux/usb.h>
#include <linux/kfifo.h>
#include <linux/debugfs.h>
#include <linux/list.h>
#include <linux/greybus.h>
#include <asm/unaligned.h>
#include "arpc.h"
#include "greybus_trace.h"
#define ES2_USB_CTRL_TIMEOUT …
#define ES2_ARPC_CPORT_TIMEOUT …
#define ES2_CPORT_CDSI0 …
#define ES2_CPORT_CDSI1 …
#define ES2_GBUF_MSG_SIZE_MAX …
#define ARPC_OUT_SIZE_MAX …
#define ARPC_IN_SIZE_MAX …
static const struct usb_device_id id_table[] = …;
MODULE_DEVICE_TABLE(usb, id_table);
#define APB1_LOG_SIZE …
#define NUM_CPORT_IN_URB …
#define NUM_CPORT_OUT_URB …
#define NUM_ARPC_IN_URB …
struct es2_cport_in { … };
struct es2_ap_dev { … };
struct arpc { … };
static inline struct es2_ap_dev *hd_to_es2(struct gb_host_device *hd)
{ … }
static void cport_out_callback(struct urb *urb);
static void usb_log_enable(struct es2_ap_dev *es2);
static void usb_log_disable(struct es2_ap_dev *es2);
static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload,
size_t size, int *result, unsigned int timeout);
static int output_sync(struct es2_ap_dev *es2, void *req, u16 size, u8 cmd)
{ … }
static void ap_urb_complete(struct urb *urb)
{ … }
static int output_async(struct es2_ap_dev *es2, void *req, u16 size, u8 cmd)
{ … }
static int output(struct gb_host_device *hd, void *req, u16 size, u8 cmd,
bool async)
{ … }
static int es2_cport_in_enable(struct es2_ap_dev *es2,
struct es2_cport_in *cport_in)
{ … }
static void es2_cport_in_disable(struct es2_ap_dev *es2,
struct es2_cport_in *cport_in)
{ … }
static int es2_arpc_in_enable(struct es2_ap_dev *es2)
{ … }
static void es2_arpc_in_disable(struct es2_ap_dev *es2)
{ … }
static struct urb *next_free_urb(struct es2_ap_dev *es2, gfp_t gfp_mask)
{ … }
static void free_urb(struct es2_ap_dev *es2, struct urb *urb)
{ … }
static void
gb_message_cport_pack(struct gb_operation_msg_hdr *header, u16 cport_id)
{ … }
static void gb_message_cport_clear(struct gb_operation_msg_hdr *header)
{ … }
static u16 gb_message_cport_unpack(struct gb_operation_msg_hdr *header)
{ … }
static int message_send(struct gb_host_device *hd, u16 cport_id,
struct gb_message *message, gfp_t gfp_mask)
{ … }
static void message_cancel(struct gb_message *message)
{ … }
static int es2_cport_allocate(struct gb_host_device *hd, int cport_id,
unsigned long flags)
{ … }
static void es2_cport_release(struct gb_host_device *hd, u16 cport_id)
{ … }
static int cport_enable(struct gb_host_device *hd, u16 cport_id,
unsigned long flags)
{ … }
static int es2_cport_connected(struct gb_host_device *hd, u16 cport_id)
{ … }
static int es2_cport_flush(struct gb_host_device *hd, u16 cport_id)
{ … }
static int es2_cport_shutdown(struct gb_host_device *hd, u16 cport_id,
u8 phase, unsigned int timeout)
{ … }
static int es2_cport_quiesce(struct gb_host_device *hd, u16 cport_id,
size_t peer_space, unsigned int timeout)
{ … }
static int es2_cport_clear(struct gb_host_device *hd, u16 cport_id)
{ … }
static int latency_tag_enable(struct gb_host_device *hd, u16 cport_id)
{ … }
static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id)
{ … }
static struct gb_hd_driver es2_driver = …;
static int check_urb_status(struct urb *urb)
{ … }
static void es2_destroy(struct es2_ap_dev *es2)
{ … }
static void cport_in_callback(struct urb *urb)
{ … }
static void cport_out_callback(struct urb *urb)
{ … }
static struct arpc *arpc_alloc(void *payload, u16 size, u8 type)
{ … }
static void arpc_free(struct arpc *rpc)
{ … }
static struct arpc *arpc_find(struct es2_ap_dev *es2, __le16 id)
{ … }
static void arpc_add(struct es2_ap_dev *es2, struct arpc *rpc)
{ … }
static void arpc_del(struct es2_ap_dev *es2, struct arpc *rpc)
{ … }
static int arpc_send(struct es2_ap_dev *es2, struct arpc *rpc, int timeout)
{ … }
static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload,
size_t size, int *result, unsigned int timeout)
{ … }
static void arpc_in_callback(struct urb *urb)
{ … }
#define APB1_LOG_MSG_SIZE …
static void apb_log_get(struct es2_ap_dev *es2, char *buf)
{ … }
static int apb_log_poll(void *data)
{ … }
static ssize_t apb_log_read(struct file *f, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations apb_log_fops = …;
static void usb_log_enable(struct es2_ap_dev *es2)
{ … }
static void usb_log_disable(struct es2_ap_dev *es2)
{ … }
static ssize_t apb_log_enable_read(struct file *f, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t apb_log_enable_write(struct file *f, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations apb_log_enable_fops = …;
static int apb_get_cport_count(struct usb_device *udev)
{ … }
static int ap_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{ … }
static void ap_disconnect(struct usb_interface *interface)
{ … }
static struct usb_driver es2_ap_driver = …;
module_usb_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;