mctp: Add MCTP-over-serial transport binding
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 23 Nov 2021 07:50:46 +0000 (15:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Nov 2021 11:47:51 +0000 (11:47 +0000)
commita0c2ccd9b5ad0a9e838158404e041b5a8ff762dd
tree8757b1cb67837a3bb9bc557f3a6b8f080e9ea222
parent25e2735de8613e5677e53730e751bbaf83998be5
mctp: Add MCTP-over-serial transport binding

This change adds a MCTP Serial transport binding, as defined by DMTF
specificiation DSP0253 - "MCTP Serial Transport Binding". This is
implemented as a new serial line discipline, and can be attached to
arbitrary tty devices.

From the Kconfig description:

  This driver provides an MCTP-over-serial interface, through a
  serial line-discipline, as defined by DMTF specification "DSP0253 -
  MCTP Serial Transport Binding". By attaching the ldisc to a serial
  device, we get a new net device to transport MCTP packets.

  This allows communication with external MCTP endpoints which use
  serial as their transport. It can also be used as an easy way to
  provide MCTP connectivity between virtual machines, by forwarding
  data between simple virtual serial devices.

  Say y here if you need to connect to MCTP endpoints over serial. To
  compile as a module, use m; the module will be called mctp-serial.

Once the N_MCTP line discipline is set [using ioctl(TCIOSETD)], we get a
new netdev suitable for MCTP communication.

The 'mctp' utility[1] provides a simple wrapper for this ioctl, using
'link serial <device>':

  # mctp link serial /dev/ttyS0 &
  # mctp link
  dev lo index 1 address 0x00:00:00:00:00:00 net 1 mtu 65536 up
  dev mctpserial0 index 5 address 0x(no-addr) net 1 mtu 68 down

[1]: https://github.com/CodeConstruct/mctp

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mctp/Kconfig
drivers/net/mctp/Makefile
drivers/net/mctp/mctp-serial.c [new file with mode: 0644]
include/uapi/linux/tty.h