#include <linux/hardirq.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>
#include <linux/tty.h>
#include <linux/file.h>
#include <linux/if_arp.h>
#include <net/caif/caif_device.h>
#include <net/caif/cfcnfg.h>
#include <linux/err.h>
#include <linux/debugfs.h>
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS_LDISC(…);
#define SEND_QUEUE_LOW …
#define SEND_QUEUE_HIGH …
#define CAIF_SENDING …
#define CAIF_FLOW_OFF_SENT …
#define MAX_WRITE_CHUNK …
#define ON …
#define OFF …
#define CAIF_MAX_MTU …
static DEFINE_SPINLOCK(ser_lock);
static LIST_HEAD(ser_list);
static LIST_HEAD(ser_release_list);
static bool ser_loop;
module_param(ser_loop, bool, 0444);
MODULE_PARM_DESC(…) …;
static bool ser_use_stx = …;
module_param(ser_use_stx, bool, 0444);
MODULE_PARM_DESC(…) …;
static bool ser_use_fcs = …;
module_param(ser_use_fcs, bool, 0444);
MODULE_PARM_DESC(…) …;
static int ser_write_chunk = …;
module_param(ser_write_chunk, int, 0444);
MODULE_PARM_DESC(…) …;
static struct dentry *debugfsdir;
static int caif_net_open(struct net_device *dev);
static int caif_net_close(struct net_device *dev);
struct ser_device { … };
static void caifdev_setup(struct net_device *dev);
static void ldisc_tx_wakeup(struct tty_struct *tty);
#ifdef CONFIG_DEBUG_FS
static inline void update_tty_status(struct ser_device *ser)
{ … }
static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty)
{ … }
static inline void debugfs_deinit(struct ser_device *ser)
{ … }
static inline void debugfs_rx(struct ser_device *ser, const u8 *data, int size)
{ … }
static inline void debugfs_tx(struct ser_device *ser, const u8 *data, int size)
{ … }
#else
static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty)
{
}
static inline void debugfs_deinit(struct ser_device *ser)
{
}
static inline void update_tty_status(struct ser_device *ser)
{
}
static inline void debugfs_rx(struct ser_device *ser, const u8 *data, int size)
{
}
static inline void debugfs_tx(struct ser_device *ser, const u8 *data, int size)
{
}
#endif
static void ldisc_receive(struct tty_struct *tty, const u8 *data,
const u8 *flags, size_t count)
{ … }
static int handle_tx(struct ser_device *ser)
{ … }
static netdev_tx_t caif_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static void ldisc_tx_wakeup(struct tty_struct *tty)
{ … }
static void ser_release(struct work_struct *work)
{ … }
static DECLARE_WORK(ser_release_work, ser_release);
static int ldisc_open(struct tty_struct *tty)
{ … }
static void ldisc_close(struct tty_struct *tty)
{ … }
static struct tty_ldisc_ops caif_ldisc = …;
static const struct net_device_ops netdev_ops = …;
static void caifdev_setup(struct net_device *dev)
{ … }
static int caif_net_open(struct net_device *dev)
{ … }
static int caif_net_close(struct net_device *dev)
{ … }
static int __init caif_ser_init(void)
{ … }
static void __exit caif_ser_exit(void)
{ … }
module_init(…) …;
module_exit(caif_ser_exit);