linux/drivers/net/mctp/mctp-serial.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Management Component Transport Protocol (MCTP) - serial transport
 * binding. This driver is an implementation of the DMTF specificiation
 * "DSP0253 - Management Component Transport Protocol (MCTP) Serial Transport
 * Binding", available at:
 *
 *  https://www.dmtf.org/sites/default/files/standards/documents/DSP0253_1.0.0.pdf
 *
 * This driver provides DSP0253-type MCTP-over-serial transport using a Linux
 * tty device, by setting the N_MCTP line discipline on the tty.
 *
 * Copyright (c) 2021 Code Construct
 */

#include <linux/idr.h>
#include <linux/if_arp.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/tty.h>
#include <linux/workqueue.h>
#include <linux/crc-ccitt.h>

#include <linux/mctp.h>
#include <net/mctp.h>
#include <net/pkt_sched.h>

#define MCTP_SERIAL_MTU
#define MCTP_SERIAL_FRAME_MTU

#define MCTP_SERIAL_VERSION

#define BUFSIZE

#define BYTE_FRAME
#define BYTE_ESC

#define FCS_INIT

static DEFINE_IDA(mctp_serial_ida);

enum mctp_serial_state {};

struct mctp_serial {};

static bool needs_escape(unsigned char c)
{}

static int next_chunk_len(struct mctp_serial *dev)
{}

static int write_chunk(struct mctp_serial *dev, unsigned char *buf, int len)
{}

static void mctp_serial_tx_work(struct work_struct *work)
{}

static netdev_tx_t mctp_serial_tx(struct sk_buff *skb, struct net_device *ndev)
{}

static void mctp_serial_tty_write_wakeup(struct tty_struct *tty)
{}

static void mctp_serial_rx(struct mctp_serial *dev)
{}

static void mctp_serial_push_header(struct mctp_serial *dev, unsigned char c)
{}

static void mctp_serial_push_trailer(struct mctp_serial *dev, unsigned char c)
{}

static void mctp_serial_push(struct mctp_serial *dev, unsigned char c)
{}

static void mctp_serial_tty_receive_buf(struct tty_struct *tty, const u8 *c,
					const u8 *f, size_t len)
{}

static void mctp_serial_uninit(struct net_device *ndev)
{}

static const struct net_device_ops mctp_serial_netdev_ops =;

static void mctp_serial_setup(struct net_device *ndev)
{}

static int mctp_serial_open(struct tty_struct *tty)
{}

static void mctp_serial_close(struct tty_struct *tty)
{}

static struct tty_ldisc_ops mctp_ldisc =;

static int __init mctp_serial_init(void)
{}

static void __exit mctp_serial_exit(void)
{}

module_init();
module_exit(mctp_serial_exit);

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