mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-31 14:13:39 +00:00

In preparation of supporting more than a single core PCI driver for RDMA, move ice specific structs like qset_params, qos_info and qos_params from iidc_rdma.h to iidc_rdma_ice.h. Previously, the ice driver was just exporting its entire PF struct to the auxiliary driver, but since each core driver will have its own different PF struct, implement a universal struct that all core drivers can provide to the auxiliary driver through the probe call. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Co-developed-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Co-developed-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Co-developed-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright (C) 2021-2025, Intel Corporation. */
|
|
|
|
#ifndef _IIDC_RDMA_H_
|
|
#define _IIDC_RDMA_H_
|
|
|
|
#include <linux/auxiliary_bus.h>
|
|
#include <linux/device.h>
|
|
#include <linux/if_ether.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/netdevice.h>
|
|
#include <net/dscp.h>
|
|
|
|
enum iidc_rdma_event_type {
|
|
IIDC_RDMA_EVENT_BEFORE_MTU_CHANGE,
|
|
IIDC_RDMA_EVENT_AFTER_MTU_CHANGE,
|
|
IIDC_RDMA_EVENT_BEFORE_TC_CHANGE,
|
|
IIDC_RDMA_EVENT_AFTER_TC_CHANGE,
|
|
IIDC_RDMA_EVENT_WARN_RESET,
|
|
IIDC_RDMA_EVENT_CRIT_ERR,
|
|
IIDC_RDMA_EVENT_NBITS /* must be last */
|
|
};
|
|
|
|
struct iidc_rdma_event {
|
|
DECLARE_BITMAP(type, IIDC_RDMA_EVENT_NBITS);
|
|
u32 reg;
|
|
};
|
|
|
|
enum iidc_rdma_reset_type {
|
|
IIDC_FUNC_RESET,
|
|
IIDC_DEV_RESET,
|
|
};
|
|
|
|
enum iidc_rdma_protocol {
|
|
IIDC_RDMA_PROTOCOL_IWARP = BIT(0),
|
|
IIDC_RDMA_PROTOCOL_ROCEV2 = BIT(1),
|
|
};
|
|
|
|
/* Structure to be populated by core LAN PCI driver */
|
|
struct iidc_rdma_core_dev_info {
|
|
struct pci_dev *pdev; /* PCI device of corresponding to main function */
|
|
struct auxiliary_device *adev;
|
|
/* Current active RDMA protocol */
|
|
enum iidc_rdma_protocol rdma_protocol;
|
|
void *iidc_priv; /* elements unique to each driver */
|
|
};
|
|
|
|
/* Structure representing auxiliary driver tailored information about the core
|
|
* PCI dev, each auxiliary driver using the IIDC interface will have an
|
|
* instance of this struct dedicated to it.
|
|
*/
|
|
struct iidc_rdma_core_auxiliary_dev {
|
|
struct auxiliary_device adev;
|
|
struct iidc_rdma_core_dev_info *cdev_info;
|
|
};
|
|
|
|
/* structure representing the auxiliary driver. This struct is to be
|
|
* allocated and populated by the auxiliary driver's owner. The core PCI
|
|
* driver will access these ops by performing a container_of on the
|
|
* auxiliary_device->dev.driver.
|
|
*/
|
|
struct iidc_rdma_core_auxiliary_drv {
|
|
struct auxiliary_driver adrv;
|
|
void (*event_handler)(struct iidc_rdma_core_dev_info *cdev,
|
|
struct iidc_rdma_event *event);
|
|
};
|
|
|
|
#endif /* _IIDC_RDMA_H_*/
|