#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
#include <linux/if_arp.h>
#include <net/mctp.h>
#include <net/mctpdevice.h>
#define MCTP_I2C_MAXBLOCK …
#define MCTP_I2C_MAXMTU …
#define MCTP_I2C_MINMTU …
#define MCTP_I2C_BUFSZ …
#define MCTP_I2C_MINLEN …
#define MCTP_I2C_COMMANDCODE …
#define MCTP_I2C_TX_WORK_LEN …
#define MCTP_I2C_TX_QUEUE_LEN …
#define MCTP_I2C_OF_PROP …
enum { … };
static DEFINE_MUTEX(driver_clients_lock);
static LIST_HEAD(driver_clients);
struct mctp_i2c_client;
struct mctp_i2c_dev { … };
struct mctp_i2c_client { … };
struct mctp_i2c_hdr { … };
static int mctp_i2c_recv(struct mctp_i2c_dev *midev);
static int mctp_i2c_slave_cb(struct i2c_client *client,
enum i2c_slave_event event, u8 *val);
static void mctp_i2c_ndo_uninit(struct net_device *dev);
static int mctp_i2c_ndo_open(struct net_device *dev);
static struct i2c_adapter *mux_root_adapter(struct i2c_adapter *adap)
{ … }
static struct mctp_i2c_client *mctp_i2c_new_client(struct i2c_client *client)
{ … }
static void mctp_i2c_free_client(struct mctp_i2c_client *mcli)
{ … }
static void __mctp_i2c_device_select(struct mctp_i2c_client *mcli,
struct mctp_i2c_dev *midev)
{ … }
static void mctp_i2c_device_select(struct mctp_i2c_client *mcli,
struct mctp_i2c_dev *midev)
{ … }
static int mctp_i2c_slave_cb(struct i2c_client *client,
enum i2c_slave_event event, u8 *val)
{ … }
static int mctp_i2c_recv(struct mctp_i2c_dev *midev)
{ … }
enum mctp_i2c_flow_state { … };
static enum mctp_i2c_flow_state
mctp_i2c_get_tx_flow_state(struct mctp_i2c_dev *midev, struct sk_buff *skb)
{ … }
static void mctp_i2c_lock_nest(struct mctp_i2c_dev *midev)
{ … }
static void mctp_i2c_unlock_nest(struct mctp_i2c_dev *midev)
{ … }
static void mctp_i2c_unlock_reset(struct mctp_i2c_dev *midev)
{ … }
static void mctp_i2c_invalidate_tx_flow(struct mctp_i2c_dev *midev,
struct sk_buff *skb)
{ … }
static void mctp_i2c_xmit(struct mctp_i2c_dev *midev, struct sk_buff *skb)
{ … }
static void mctp_i2c_flow_release(struct mctp_i2c_dev *midev)
{ … }
static int mctp_i2c_header_create(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned int len)
{ … }
static int mctp_i2c_tx_thread(void *data)
{ … }
static netdev_tx_t mctp_i2c_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{ … }
static void mctp_i2c_release_flow(struct mctp_dev *mdev,
struct mctp_sk_key *key)
{ … }
static const struct net_device_ops mctp_i2c_ops = …;
static const struct header_ops mctp_i2c_headops = …;
static const struct mctp_netdev_ops mctp_i2c_mctp_ops = …;
static void mctp_i2c_net_setup(struct net_device *dev)
{ … }
static struct mctp_i2c_dev *mctp_i2c_midev_init(struct net_device *dev,
struct mctp_i2c_client *mcli,
struct i2c_adapter *adap)
{ … }
static void mctp_i2c_midev_free(struct mctp_i2c_dev *midev)
{ … }
static void mctp_i2c_unregister(struct mctp_i2c_dev *midev)
{ … }
static void mctp_i2c_ndo_uninit(struct net_device *dev)
{ … }
static int mctp_i2c_ndo_open(struct net_device *dev)
{ … }
static int mctp_i2c_add_netdev(struct mctp_i2c_client *mcli,
struct i2c_adapter *adap)
{ … }
static void mctp_i2c_remove_netdev(struct mctp_i2c_client *mcli,
struct i2c_adapter *adap)
{ … }
static struct i2c_adapter *mctp_i2c_get_adapter(struct device *dev,
struct i2c_adapter **ret_root)
{ … }
static bool mctp_i2c_adapter_match(struct i2c_adapter *adap, bool match_no_of)
{ … }
static int mctp_i2c_client_try_attach(struct device *dev, void *data)
{ … }
static void mctp_i2c_notify_add(struct device *dev)
{ … }
static void mctp_i2c_notify_del(struct device *dev)
{ … }
static int mctp_i2c_probe(struct i2c_client *client)
{ … }
static void mctp_i2c_remove(struct i2c_client *client)
{ … }
static int mctp_i2c_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static struct notifier_block mctp_i2c_notifier = …;
static const struct i2c_device_id mctp_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, mctp_i2c_id);
static const struct of_device_id mctp_i2c_of_match[] = …;
MODULE_DEVICE_TABLE(of, mctp_i2c_of_match);
static struct i2c_driver mctp_i2c_driver = …;
static __init int mctp_i2c_mod_init(void)
{ … }
static __exit void mctp_i2c_mod_exit(void)
{ … }
module_init(…) …;
module_exit(mctp_i2c_mod_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;