#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/sizes.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <linux/idr.h>
#include <linux/uaccess.h>
#include <linux/greybus.h>
struct gb_raw { … };
struct raw_data { … };
static const struct class raw_class = …;
static int raw_major;
static const struct file_operations raw_fops;
static DEFINE_IDA(minors);
#define NUM_MINORS …
#define MAX_PACKET_SIZE …
#define MAX_DATA_SIZE …
static int receive_data(struct gb_raw *raw, u32 len, u8 *data)
{ … }
static int gb_raw_request_handler(struct gb_operation *op)
{ … }
static int gb_raw_send(struct gb_raw *raw, u32 len, const char __user *data)
{ … }
static int gb_raw_probe(struct gb_bundle *bundle,
const struct greybus_bundle_id *id)
{ … }
static void gb_raw_disconnect(struct gb_bundle *bundle)
{ … }
static int raw_open(struct inode *inode, struct file *file)
{ … }
static ssize_t raw_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t raw_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos)
{ … }
static const struct file_operations raw_fops = …;
static const struct greybus_bundle_id gb_raw_id_table[] = …;
MODULE_DEVICE_TABLE(greybus, gb_raw_id_table);
static struct greybus_driver gb_raw_driver = …;
static int raw_init(void)
{ … }
module_init(…) …;
static void __exit raw_exit(void)
{ … }
module_exit(raw_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;