1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2005 - 2016 Broadcom
7 * linux-drivers@emulex.com
11 * Costa Mesa, CA 92626
17 #include <linux/pci.h>
18 #include <linux/netdevice.h>
20 #define BE_ROCE_ABI_VERSION 1
24 enum be_interrupt_mode
{
25 BE_INTERRUPT_MODE_MSIX
= 0,
26 BE_INTERRUPT_MODE_INTX
= 1,
27 BE_INTERRUPT_MODE_MSI
= 2,
30 #define MAX_MSIX_VECTORS 32
36 u64 dpp_unmapped_addr
;
39 struct net_device
*netdev
;
40 u8 mac_addr
[ETH_ALEN
];
42 enum be_interrupt_mode intr_mode
;
46 u32 vector_list
[MAX_MSIX_VECTORS
];
50 /* ocrdma driver register's the callback functions with nic driver. */
51 struct ocrdma_driver
{
52 unsigned char name
[32];
54 struct ocrdma_dev
*(*add
) (struct be_dev_info
*dev_info
);
55 void (*remove
) (struct ocrdma_dev
*);
56 void (*state_change_handler
) (struct ocrdma_dev
*, u32 new_state
);
63 /* APIs for RoCE driver to register callback handlers,
64 * which will be invoked when device is added, removed, ifup, ifdown
66 int be_roce_register_driver(struct ocrdma_driver
*drv
);
67 void be_roce_unregister_driver(struct ocrdma_driver
*drv
);
69 /* API for RoCE driver to issue mailbox commands */
70 int be_roce_mcc_cmd(void *netdev_handle
, void *wrb_payload
,
71 int wrb_payload_size
, u16
*cmd_status
, u16
*ext_status
);
73 #endif /* BE_ROCE_H */