#define pr_fmt(fmt) …
#include <linux/filter.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/sched/signal.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/wait.h>
#include <linux/poll.h>
#include <linux/tcp.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <linux/caif/caif_socket.h>
#include <linux/pkt_sched.h>
#include <net/sock.h>
#include <net/tcp_states.h>
#include <net/caif/caif_layer.h>
#include <net/caif/caif_dev.h>
#include <net/caif/cfpkt.h>
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS_NETPROTO(…);
enum caif_states { … };
#define TX_FLOW_ON_BIT …
#define RX_FLOW_ON_BIT …
struct caifsock { … };
static int rx_flow_is_on(struct caifsock *cf_sk)
{ … }
static int tx_flow_is_on(struct caifsock *cf_sk)
{ … }
static void set_rx_flow_off(struct caifsock *cf_sk)
{ … }
static void set_rx_flow_on(struct caifsock *cf_sk)
{ … }
static void set_tx_flow_off(struct caifsock *cf_sk)
{ … }
static void set_tx_flow_on(struct caifsock *cf_sk)
{ … }
static void caif_read_lock(struct sock *sk)
{ … }
static void caif_read_unlock(struct sock *sk)
{ … }
static int sk_rcvbuf_lowwater(struct caifsock *cf_sk)
{ … }
static void caif_flow_ctrl(struct sock *sk, int mode)
{ … }
static void caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{ … }
static int caif_sktrecv_cb(struct cflayer *layr, struct cfpkt *pkt)
{ … }
static void cfsk_hold(struct cflayer *layr)
{ … }
static void cfsk_put(struct cflayer *layr)
{ … }
static void caif_ctrl_cb(struct cflayer *layr,
enum caif_ctrlcmd flow,
int phyid)
{ … }
static void caif_check_flow_release(struct sock *sk)
{ … }
static int caif_seqpkt_recvmsg(struct socket *sock, struct msghdr *m,
size_t len, int flags)
{ … }
static long caif_stream_data_wait(struct sock *sk, long timeo)
{ … }
static int caif_stream_recvmsg(struct socket *sock, struct msghdr *msg,
size_t size, int flags)
{ … }
static long caif_wait_for_flow_on(struct caifsock *cf_sk,
int wait_writeable, long timeo, int *err)
{ … }
static int transmit_skb(struct sk_buff *skb, struct caifsock *cf_sk,
int noblock, long timeo)
{ … }
static int caif_seqpkt_sendmsg(struct socket *sock, struct msghdr *msg,
size_t len)
{ … }
static int caif_stream_sendmsg(struct socket *sock, struct msghdr *msg,
size_t len)
{ … }
static int setsockopt(struct socket *sock, int lvl, int opt, sockptr_t ov,
unsigned int ol)
{ … }
static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
int addr_len, int flags)
{ … }
static int caif_release(struct socket *sock)
{ … }
static __poll_t caif_poll(struct file *file,
struct socket *sock, poll_table *wait)
{ … }
static const struct proto_ops caif_seqpacket_ops = …;
static const struct proto_ops caif_stream_ops = …;
static void caif_sock_destructor(struct sock *sk)
{ … }
static int caif_create(struct net *net, struct socket *sock, int protocol,
int kern)
{ … }
static const struct net_proto_family caif_family_ops = …;
static int __init caif_sktinit_module(void)
{ … }
static void __exit caif_sktexit_module(void)
{ … }
module_init(…) …;
module_exit(caif_sktexit_module);