linux/drivers/hsi/clients/hsi_char.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * HSI character device driver, implements the character device
 * interface.
 *
 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
 *
 * Contact: Andras Domokos <[email protected]>
 */

#include <linux/errno.h>
#include <linux/types.h>
#include <linux/atomic.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/kmemleak.h>
#include <linux/ioctl.h>
#include <linux/wait.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/device.h>
#include <linux/cdev.h>
#include <linux/uaccess.h>
#include <linux/scatterlist.h>
#include <linux/stat.h>
#include <linux/hsi/hsi.h>
#include <linux/hsi/hsi_char.h>

#define HSC_DEVS
#define HSC_MSGS

#define HSC_RXBREAK

#define HSC_ID_BITS
#define HSC_PORT_ID_BITS
#define HSC_ID_MASK
#define HSC_PORT_ID_MASK
#define HSC_CH_MASK

/*
 * We support up to 4 controllers that can have up to 4
 * ports, which should currently be more than enough.
 */
#define HSC_BASEMINOR(id, port_id)

enum {};

enum {};

struct hsc_client_data;
/**
 * struct hsc_channel - hsi_char internal channel data
 * @ch: channel number
 * @flags: Keeps state of the channel (open/close, reading, writing)
 * @free_msgs_list: List of free HSI messages/requests
 * @rx_msgs_queue: List of pending RX requests
 * @tx_msgs_queue: List of pending TX requests
 * @lock: Serialize access to the lists
 * @cl: reference to the associated hsi_client
 * @cl_data: reference to the client data that this channels belongs to
 * @rx_wait: RX requests wait queue
 * @tx_wait: TX requests wait queue
 */
struct hsc_channel {};

/**
 * struct hsc_client_data - hsi_char internal client data
 * @cdev: Characther device associated to the hsi_client
 * @lock: Lock to serialize open/close access
 * @flags: Keeps track of port state (rx hwbreak armed)
 * @usecnt: Use count for claiming the HSI port (mutex protected)
 * @cl: Referece to the HSI client
 * @channels: Array of channels accessible by the client
 */
struct hsc_client_data {};

/* Stores the major number dynamically allocated for hsi_char */
static unsigned int hsc_major;
/* Maximum buffer size that hsi_char will accept from userspace */
static unsigned int max_data_size =;
module_param(max_data_size, uint, 0);
MODULE_PARM_DESC();

static void hsc_add_tail(struct hsc_channel *channel, struct hsi_msg *msg,
							struct list_head *queue)
{}

static struct hsi_msg *hsc_get_first_msg(struct hsc_channel *channel,
							struct list_head *queue)
{}

static inline void hsc_msg_free(struct hsi_msg *msg)
{}

static void hsc_free_list(struct list_head *list)
{}

static void hsc_reset_list(struct hsc_channel *channel, struct list_head *l)
{}

static inline struct hsi_msg *hsc_msg_alloc(unsigned int alloc_size)
{}

static inline int hsc_msgs_alloc(struct hsc_channel *channel)
{}

static inline unsigned int hsc_msg_len_get(struct hsi_msg *msg)
{}

static inline void hsc_msg_len_set(struct hsi_msg *msg, unsigned int len)
{}

static void hsc_rx_completed(struct hsi_msg *msg)
{}

static void hsc_rx_msg_destructor(struct hsi_msg *msg)
{}

static void hsc_tx_completed(struct hsi_msg *msg)
{}

static void hsc_tx_msg_destructor(struct hsi_msg *msg)
{}

static void hsc_break_req_destructor(struct hsi_msg *msg)
{}

static void hsc_break_received(struct hsi_msg *msg)
{}

static int hsc_break_request(struct hsi_client *cl)
{}

static int hsc_break_send(struct hsi_client *cl)
{}

static int hsc_rx_set(struct hsi_client *cl, struct hsc_rx_config *rxc)
{}

static inline void hsc_rx_get(struct hsi_client *cl, struct hsc_rx_config *rxc)
{}

static int hsc_tx_set(struct hsi_client *cl, struct hsc_tx_config *txc)
{}

static inline void hsc_tx_get(struct hsi_client *cl, struct hsc_tx_config *txc)
{}

static ssize_t hsc_read(struct file *file, char __user *buf, size_t len,
						loff_t *ppos __maybe_unused)
{}

static ssize_t hsc_write(struct file *file, const char __user *buf, size_t len,
						loff_t *ppos __maybe_unused)
{}

static long hsc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{}

static inline void __hsc_port_release(struct hsc_client_data *cl_data)
{}

static int hsc_open(struct inode *inode, struct file *file)
{}

static int hsc_release(struct inode *inode __maybe_unused, struct file *file)
{}

static const struct file_operations hsc_fops =;

static void hsc_channel_init(struct hsc_channel *channel)
{}

static int hsc_probe(struct device *dev)
{}

static int hsc_remove(struct device *dev)
{}

static struct hsi_client_driver hsc_driver =;

static int __init hsc_init(void)
{}
module_init();

static void __exit hsc_exit(void)
{}
module_exit(hsc_exit);

MODULE_AUTHOR();
MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_LICENSE();