linux/drivers/staging/greybus/raw.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Greybus driver for the Raw protocol
 *
 * Copyright 2015 Google Inc.
 * Copyright 2015 Linaro Ltd.
 */
#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);

/* Number of minor devices this driver supports */
#define NUM_MINORS

/* Maximum size of any one send data buffer we support */
#define MAX_PACKET_SIZE

/*
 * Maximum size of the data in the receive buffer we allow before we start to
 * drop messages on the floor
 */
#define MAX_DATA_SIZE

/*
 * Add the raw data message to the list of received messages.
 */
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)
{}

/*
 * Character device node interfaces.
 *
 * Note, we are using read/write to only allow a single read/write per message.
 * This means for read(), you have to provide a big enough buffer for the full
 * message to be copied into.  If the buffer isn't big enough, the read() will
 * fail with -ENOSPC.
 */

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();