linux/drivers/net/ethernet/intel/ixd/ixd_devlink.h
Amritha Nambiar f290d48f02 ixd: add devlink support
Enable initial support for the devlink interface with the ixd driver. The
ixd hardware is a single function PCIe device. So, the PCIe adapter gets
its own devlink instance to manage device-wide resources or configuration.

$ devlink dev show
pci/0000:83:00.6

$ devlink dev info pci/0000:83:00.6
pci/0000:83:00.6:
  driver ixd
  serial_number 00-a0-c9-ff-ff-23-45-67
  versions:
      fixed:
        device.type MEV
      running:
        fw.mgmt.api 2.0

Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Bharath R <Bharath.r@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2026-08-12 13:56:51 -07:00

51 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2025, Intel Corporation. */
#ifndef _IXD_DEVLINK_H_
#define _IXD_DEVLINK_H_
#include <net/devlink.h>
#include "ixd.h"
struct ixd_adapter *ixd_adapter_alloc(struct device *dev);
/**
* ixd_devlink_free - teardown the devlink
* @adapter: the adapter structure to free
*
*/
static inline void ixd_devlink_free(struct ixd_adapter *adapter)
{
struct devlink *devlink = priv_to_devlink(adapter);
devlink_free(devlink);
}
/**
* ixd_devlink_unregister - Unregister devlink for this adapter.
* @adapter: the adapter structure to cleanup
*
* Init task must be completed or cancelled beforehand.
*/
static inline void ixd_devlink_unregister(struct ixd_adapter *adapter)
{
if (!adapter->init_task.success)
return;
devlink_unregister(priv_to_devlink(adapter));
}
/**
* ixd_devlink_register - Register devlink interface for this adapter
* @adapter: pointer to ixd adapter structure to be associated with devlink
*
* Register the devlink instance associated with this adapter
*/
static inline void ixd_devlink_register(struct ixd_adapter *adapter)
{
devlink_register(priv_to_devlink(adapter));
}
#endif /* _IXD_DEVLINK_H_ */