at master 1.9 kB view raw
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright (C) 2021-2025, Intel Corporation. */ 3 4#ifndef _IIDC_RDMA_H_ 5#define _IIDC_RDMA_H_ 6 7#include <linux/auxiliary_bus.h> 8#include <linux/device.h> 9#include <linux/if_ether.h> 10#include <linux/kernel.h> 11#include <linux/netdevice.h> 12#include <net/dscp.h> 13 14enum iidc_rdma_event_type { 15 IIDC_RDMA_EVENT_BEFORE_MTU_CHANGE, 16 IIDC_RDMA_EVENT_AFTER_MTU_CHANGE, 17 IIDC_RDMA_EVENT_BEFORE_TC_CHANGE, 18 IIDC_RDMA_EVENT_AFTER_TC_CHANGE, 19 IIDC_RDMA_EVENT_WARN_RESET, 20 IIDC_RDMA_EVENT_CRIT_ERR, 21 IIDC_RDMA_EVENT_NBITS /* must be last */ 22}; 23 24struct iidc_rdma_event { 25 DECLARE_BITMAP(type, IIDC_RDMA_EVENT_NBITS); 26 u32 reg; 27}; 28 29enum iidc_rdma_reset_type { 30 IIDC_FUNC_RESET, 31 IIDC_DEV_RESET, 32}; 33 34enum iidc_rdma_protocol { 35 IIDC_RDMA_PROTOCOL_IWARP = BIT(0), 36 IIDC_RDMA_PROTOCOL_ROCEV2 = BIT(1), 37}; 38 39/* Structure to be populated by core LAN PCI driver */ 40struct iidc_rdma_core_dev_info { 41 struct pci_dev *pdev; /* PCI device of corresponding to main function */ 42 struct auxiliary_device *adev; 43 /* Current active RDMA protocol */ 44 enum iidc_rdma_protocol rdma_protocol; 45 void *iidc_priv; /* elements unique to each driver */ 46}; 47 48/* Structure representing auxiliary driver tailored information about the core 49 * PCI dev, each auxiliary driver using the IIDC interface will have an 50 * instance of this struct dedicated to it. 51 */ 52struct iidc_rdma_core_auxiliary_dev { 53 struct auxiliary_device adev; 54 struct iidc_rdma_core_dev_info *cdev_info; 55}; 56 57/* structure representing the auxiliary driver. This struct is to be 58 * allocated and populated by the auxiliary driver's owner. The core PCI 59 * driver will access these ops by performing a container_of on the 60 * auxiliary_device->dev.driver. 61 */ 62struct iidc_rdma_core_auxiliary_drv { 63 struct auxiliary_driver adrv; 64 void (*event_handler)(struct iidc_rdma_core_dev_info *cdev, 65 struct iidc_rdma_event *event); 66}; 67 68#endif /* _IIDC_RDMA_H_*/