#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/i3c/device.h>
#include <linux/i3c/master.h>
#include <linux/if_arp.h>
#include <linux/unaligned.h>
#include <net/mctp.h>
#include <net/mctpdevice.h>
#define MCTP_I3C_MAXBUF …
#define PID_SIZE …
static const int MCTP_I3C_MINMTU = …;
static const int MCTP_I3C_MAXMTU = …;
static const int MCTP_I3C_MINLEN = …;
static const int MCTP_I3C_TX_QUEUE_LEN = …;
static const int MCTP_I3C_IBI_SLOTS = …;
#define I3C_MDB_MCTP …
#define I3C_DCR_MCTP …
static const char *MCTP_I3C_OF_PROP = …;
static LIST_HEAD(busdevs);
static DEFINE_MUTEX(busdevs_lock);
struct mctp_i3c_bus { … };
struct mctp_i3c_device { … };
struct mctp_i3c_internal_hdr { … } __packed;
static int mctp_i3c_read(struct mctp_i3c_device *mi)
{ … }
static void mctp_i3c_ibi_handler(struct i3c_device *i3c,
const struct i3c_ibi_payload *payload)
{ … }
static int mctp_i3c_setup(struct mctp_i3c_device *mi)
{ … }
static int mctp_i3c_add_device(struct mctp_i3c_bus *mbus,
struct i3c_device *i3c)
__must_hold(&busdevs_lock)
{ … }
static int mctp_i3c_probe(struct i3c_device *i3c)
{ … }
static void mctp_i3c_remove_device(struct mctp_i3c_device *mi)
__must_hold(&busdevs_lock)
{ … }
static void mctp_i3c_remove(struct i3c_device *i3c)
{ … }
static struct mctp_i3c_device *
mctp_i3c_lookup(struct mctp_i3c_bus *mbus, u64 pid)
{ … }
static void mctp_i3c_xmit(struct mctp_i3c_bus *mbus, struct sk_buff *skb)
{ … }
static int mctp_i3c_tx_thread(void *data)
{ … }
static netdev_tx_t mctp_i3c_start_xmit(struct sk_buff *skb,
struct net_device *ndev)
{ … }
static void mctp_i3c_bus_free(struct mctp_i3c_bus *mbus)
__must_hold(&busdevs_lock)
{ … }
static void mctp_i3c_ndo_uninit(struct net_device *ndev)
{ … }
static int mctp_i3c_header_create(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned int len)
{ … }
static const struct net_device_ops mctp_i3c_ops = …;
static const struct header_ops mctp_i3c_headops = …;
static void mctp_i3c_net_setup(struct net_device *dev)
{ … }
static bool mctp_i3c_is_mctp_controller(struct i3c_bus *bus)
{ … }
static int mctp_i3c_bus_local_pid(struct i3c_bus *bus, u64 *ret_pid)
{ … }
static struct mctp_i3c_bus *mctp_i3c_bus_add(struct i3c_bus *bus)
__must_hold(&busdevs_lock)
{ … }
static void mctp_i3c_bus_remove(struct mctp_i3c_bus *mbus)
__must_hold(&busdevs_lock)
{ … }
static void mctp_i3c_bus_remove_all(void)
{ … }
static int mctp_i3c_bus_add_new(struct i3c_bus *bus, void *data)
{ … }
static void mctp_i3c_notify_bus_remove(struct i3c_bus *bus)
{ … }
static int mctp_i3c_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static struct notifier_block mctp_i3c_notifier = …;
static const struct i3c_device_id mctp_i3c_ids[] = …;
static struct i3c_driver mctp_i3c_driver = …;
static __init int mctp_i3c_mod_init(void)
{ … }
static __exit void mctp_i3c_mod_exit(void)
{ … }
module_init(…) …;
module_exit(mctp_i3c_mod_exit);
MODULE_DEVICE_TABLE(i3c, mctp_i3c_ids);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;