File Index
Files and directories
Sign in
FILE

bnge_auxr.h

File preview with syntax highlighting.

linux-6.19.14/drivers/net/ethernet/broadcom/bnge/bnge_auxr.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright (c) 2025 Broadcom */
 3
 4#ifndef _BNGE_AUXR_H_
 5#define _BNGE_AUXR_H_
 6
 7#include <linux/auxiliary_bus.h>
 8
 9#define BNGE_MIN_ROCE_CP_RINGS	2
10#define BNGE_MIN_ROCE_STAT_CTXS	1
11
12#define BNGE_MAX_ROCE_MSIX	64
13
14struct hwrm_async_event_cmpl;
15struct bnge;
16
17struct bnge_msix_info {
18	u32	vector;
19	u32	ring_idx;
20	u32	db_offset;
21};
22
23struct bnge_fw_msg {
24	void	*msg;
25	int	msg_len;
26	void	*resp;
27	int	resp_max_len;
28	int	timeout;
29};
30
31struct bnge_auxr_info {
32	void		*handle;
33	u16		msix_requested;
34};
35
36enum {
37	BNGE_ARDEV_ROCEV1_SUPP		= BIT(0),
38	BNGE_ARDEV_ROCEV2_SUPP		= BIT(1),
39	BNGE_ARDEV_MSIX_ALLOC		= BIT(2),
40};
41
42#define BNGE_ARDEV_ROCE_SUPP	(BNGE_ARDEV_ROCEV1_SUPP | \
43				 BNGE_ARDEV_ROCEV2_SUPP)
44
45struct bnge_auxr_dev {
46	struct net_device	*net;
47	struct pci_dev		*pdev;
48	void __iomem		*bar0;
49
50	struct bnge_msix_info	msix_info[BNGE_MAX_ROCE_MSIX];
51
52	u32 flags;
53
54	struct bnge_auxr_info	*auxr_info;
55
56	/* Doorbell BAR size in bytes mapped by L2 driver. */
57	int	l2_db_size;
58	/* Doorbell BAR size in bytes mapped as non-cacheable. */
59	int	l2_db_size_nc;
60	/* Doorbell offset in bytes within l2_db_size_nc. */
61	int	l2_db_offset;
62
63	u16		chip_num;
64	u16		hw_ring_stats_size;
65	u16		pf_port_id;
66	unsigned long	en_state;
67
68	u16	auxr_num_msix_vec;
69	u16	auxr_num_ctxs;
70
71	/* serialize auxr operations */
72	struct mutex	auxr_dev_lock;
73};
74
75void bnge_rdma_aux_device_uninit(struct bnge_dev *bdev);
76void bnge_rdma_aux_device_del(struct bnge_dev *bdev);
77void bnge_rdma_aux_device_add(struct bnge_dev *bdev);
78void bnge_rdma_aux_device_init(struct bnge_dev *bdev);
79int bnge_register_dev(struct bnge_auxr_dev *adev,
80		      void *handle);
81void bnge_unregister_dev(struct bnge_auxr_dev *adev);
82int bnge_send_msg(struct bnge_auxr_dev *adev, struct bnge_fw_msg *fw_msg);
83
84#endif /* _BNGE_AUXR_H_ */
~/ Read-only file preview.