FILE
hinic3_nic_dev.h
File preview with syntax highlighting.
linux-6.19.14/drivers/net/ethernet/huawei/hinic3/hinic3_nic_dev.h
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved. */ 3 4#ifndef _HINIC3_NIC_DEV_H_ 5#define _HINIC3_NIC_DEV_H_ 6 7#include <linux/netdevice.h> 8 9#include "hinic3_hw_cfg.h" 10#include "hinic3_mgmt_interface.h" 11 12enum hinic3_flags { 13 HINIC3_RSS_ENABLE, 14}; 15 16enum hinic3_rss_hash_type { 17 HINIC3_RSS_HASH_ENGINE_TYPE_XOR = 0, 18 HINIC3_RSS_HASH_ENGINE_TYPE_TOEP = 1, 19}; 20 21struct hinic3_rss_type { 22 u8 tcp_ipv6_ext; 23 u8 ipv6_ext; 24 u8 tcp_ipv6; 25 u8 ipv6; 26 u8 tcp_ipv4; 27 u8 ipv4; 28 u8 udp_ipv6; 29 u8 udp_ipv4; 30}; 31 32struct hinic3_irq_cfg { 33 struct net_device *netdev; 34 u16 msix_entry_idx; 35 /* provided by OS */ 36 u32 irq_id; 37 char irq_name[IFNAMSIZ + 16]; 38 struct napi_struct napi; 39 cpumask_t affinity_mask; 40 struct hinic3_txq *txq; 41 struct hinic3_rxq *rxq; 42}; 43 44struct hinic3_dyna_txrxq_params { 45 u16 num_qps; 46 u32 sq_depth; 47 u32 rq_depth; 48 49 struct hinic3_dyna_txq_res *txqs_res; 50 struct hinic3_dyna_rxq_res *rxqs_res; 51 struct hinic3_irq_cfg *irq_cfg; 52}; 53 54struct hinic3_intr_coal_info { 55 u8 pending_limit; 56 u8 coalesce_timer_cfg; 57 u8 resend_timer_cfg; 58}; 59 60struct hinic3_nic_dev { 61 struct pci_dev *pdev; 62 struct net_device *netdev; 63 struct hinic3_hwdev *hwdev; 64 struct hinic3_nic_io *nic_io; 65 66 u16 max_qps; 67 u16 rx_buf_len; 68 u32 lro_replenish_thld; 69 unsigned long flags; 70 struct hinic3_nic_service_cap nic_svc_cap; 71 72 struct hinic3_dyna_txrxq_params q_params; 73 struct hinic3_txq *txqs; 74 struct hinic3_rxq *rxqs; 75 76 enum hinic3_rss_hash_type rss_hash_type; 77 struct hinic3_rss_type rss_type; 78 u8 *rss_hkey; 79 u16 *rss_indir; 80 81 u16 num_qp_irq; 82 struct msix_entry *qps_msix_entries; 83 84 struct hinic3_intr_coal_info *intr_coalesce; 85 86 bool link_status_up; 87}; 88 89void hinic3_set_netdev_ops(struct net_device *netdev); 90int hinic3_qps_irq_init(struct net_device *netdev); 91void hinic3_qps_irq_uninit(struct net_device *netdev); 92 93#endif
~/
Read-only file preview.