#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/types.h>
#include <linux/auxiliary_bus.h>
#include <linux/idr.h>
#include <linux/gfp.h>
#include <linux/slab.h>
#include <net/devlink.h>
#include "core.h"
#define MLXSW_LINECARD_DEV_ID_NAME …
struct mlxsw_linecard_dev { … };
struct mlxsw_linecard_bdev { … };
static DEFINE_IDA(mlxsw_linecard_bdev_ida);
static int mlxsw_linecard_bdev_id_alloc(void)
{ … }
static void mlxsw_linecard_bdev_id_free(int id)
{ … }
static void mlxsw_linecard_bdev_release(struct device *device)
{ … }
int mlxsw_linecard_bdev_add(struct mlxsw_linecard *linecard)
{ … }
void mlxsw_linecard_bdev_del(struct mlxsw_linecard *linecard)
{ … }
static int mlxsw_linecard_dev_devlink_info_get(struct devlink *devlink,
struct devlink_info_req *req,
struct netlink_ext_ack *extack)
{ … }
static int
mlxsw_linecard_dev_devlink_flash_update(struct devlink *devlink,
struct devlink_flash_update_params *params,
struct netlink_ext_ack *extack)
{ … }
static const struct devlink_ops mlxsw_linecard_dev_devlink_ops = …;
static int mlxsw_linecard_bdev_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *id)
{ … }
static void mlxsw_linecard_bdev_remove(struct auxiliary_device *adev)
{ … }
static const struct auxiliary_device_id mlxsw_linecard_bdev_id_table[] = …;
MODULE_DEVICE_TABLE(auxiliary, mlxsw_linecard_bdev_id_table);
static struct auxiliary_driver mlxsw_linecard_driver = …;
int mlxsw_linecard_driver_register(void)
{ … }
void mlxsw_linecard_driver_unregister(void)
{ … }