drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2_tlv_multi.c

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2_tlv_multi.c

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/mellanox/mlxfw/mlxfw_mfa2_tlv_multi.c
Extension
.c
Size
2384 bytes
Lines
98
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

if (!tlv) {
			pr_err("TLV parsing error\n");
			return NULL;
		}
		if (tlv->type == type)
			if (skip++ == index)
				return tlv;
	}
	return NULL;
}

int mlxfw_mfa2_tlv_multi_child_count(const struct mlxfw_mfa2_file *mfa2_file,
				     const struct mlxfw_mfa2_tlv_multi *multi,
				     enum mlxfw_mfa2_tlv_type type,
				     u16 *p_count)
{
	const struct mlxfw_mfa2_tlv *tlv;
	u16 count = 0;
	u16 idx;

	mlxfw_mfa2_tlv_multi_foreach(mfa2_file, tlv, idx, multi) {
		if (!tlv) {
			pr_err("TLV parsing error\n");
			return -EINVAL;
		}

		if (tlv->type == type)
			count++;
	}
	*p_count = count;
	return 0;
}

Annotation

Implementation Notes