drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlx5/core/lib/mlx5.h
Extension
.h
Size
2848 bytes
Lines
78
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __LIB_MLX5_H__
#define __LIB_MLX5_H__

#include "mlx5_core.h"

void mlx5_init_reserved_gids(struct mlx5_core_dev *dev);
void mlx5_cleanup_reserved_gids(struct mlx5_core_dev *dev);
int  mlx5_core_reserve_gids(struct mlx5_core_dev *dev, unsigned int count);
void mlx5_core_unreserve_gids(struct mlx5_core_dev *dev, unsigned int count);
int  mlx5_core_reserved_gid_alloc(struct mlx5_core_dev *dev, int *gid_index);
void mlx5_core_reserved_gid_free(struct mlx5_core_dev *dev, int gid_index);
int mlx5_crdump_enable(struct mlx5_core_dev *dev);
void mlx5_crdump_disable(struct mlx5_core_dev *dev);
int mlx5_crdump_collect(struct mlx5_core_dev *dev, u32 *cr_data);

static inline struct net_device *mlx5_uplink_netdev_get(struct mlx5_core_dev *mdev)
{
	struct mlx5e_resources *mlx5e_res = &mdev->mlx5e_res;
	struct net_device *netdev;

	mutex_lock(&mlx5e_res->uplink_netdev_lock);
	netdev = mlx5e_res->uplink_netdev;
	netdev_hold(netdev, &mlx5e_res->tracker, GFP_KERNEL);
	mutex_unlock(&mlx5e_res->uplink_netdev_lock);
	return netdev;
}

static inline void mlx5_uplink_netdev_put(struct mlx5_core_dev *mdev,
					  struct net_device *netdev)
{
	netdev_put(netdev, &mdev->mlx5e_res.tracker);
}

struct mlx5_sd;

static inline struct mlx5_sd *mlx5_get_sd(struct mlx5_core_dev *dev)
{
	return dev->sd;
}

static inline void mlx5_set_sd(struct mlx5_core_dev *dev, struct mlx5_sd *sd)
{
	dev->sd = sd;
}
#endif

Annotation

Implementation Notes