#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 …
#define HSC_BASEMINOR(id, port_id) …
enum { … };
enum { … };
struct hsc_client_data;
struct hsc_channel { … };
struct hsc_client_data { … };
static unsigned int hsc_major;
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(…) …;