1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Aquantia Corporation
12 #include <netinet/in.h>
22 #define min(a, b) RTE_MIN(a, b)
23 #define max(a, b) RTE_MAX(a, b)
25 #include "hw_atl/hw_atl_b0_internal.h"
26 #include "hw_atl/hw_atl_utils.h"
28 struct aq_hw_link_status_s {
54 struct aq_rss_parameters {
56 u16 indirection_table_size;
57 u16 hash_secret_key_size;
58 u32 hash_secret_key[HW_ATL_B0_RSS_HASHKEY_BITS / 8];
59 u8 indirection_table[HW_ATL_B0_RSS_REDIRECTION_MAX];
65 unsigned int num_rss_queues;
74 uint32_t vlan_filter[HW_ATL_B0_MAX_VLAN_IDS];
75 uint32_t flow_control;
77 struct aq_rss_parameters aq_rss;
86 struct aq_hw_cfg_s *aq_nic_cfg;
87 const struct aq_fw_ops *aq_fw_ops;
90 struct aq_hw_link_status_s aq_link_status;
93 struct hw_aq_atl_utils_mbox mbox;
94 struct hw_atl_stats_s last_stats;
95 struct aq_stats_s curr_stats;
98 unsigned int chip_features;
103 struct hw_aq_atl_utils_fw_rpc rpc;
107 int (*init)(struct aq_hw_s *self);
109 int (*deinit)(struct aq_hw_s *self);
111 int (*reset)(struct aq_hw_s *self);
113 int (*get_mac_permanent)(struct aq_hw_s *self, u8 *mac);
115 int (*set_link_speed)(struct aq_hw_s *self, u32 speed);
117 int (*set_state)(struct aq_hw_s *self,
118 enum hal_atl_utils_fw_state_e state);
120 int (*update_link_status)(struct aq_hw_s *self);
122 int (*update_stats)(struct aq_hw_s *self);
124 int (*set_power)(struct aq_hw_s *self, unsigned int power_state,
127 int (*get_temp)(struct aq_hw_s *self, int *temp);
129 int (*get_cable_len)(struct aq_hw_s *self, int *cable_len);
131 int (*set_eee_rate)(struct aq_hw_s *self, u32 speed);
133 int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate,
134 u32 *supported_rates);
136 int (*set_flow_control)(struct aq_hw_s *self);
138 int (*led_control)(struct aq_hw_s *self, u32 mode);
140 int (*get_eeprom)(struct aq_hw_s *self, int dev_addr,
141 u32 *data, u32 len, u32 offset);
143 int (*set_eeprom)(struct aq_hw_s *self, int dev_addr,
148 struct atl_sw_stats {
182 u64 q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
183 u64 q_opackets[RTE_ETHDEV_QUEUE_STAT_CNTRS];
184 u64 q_ibytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
185 u64 q_obytes[RTE_ETHDEV_QUEUE_STAT_CNTRS];
186 u64 q_errors[RTE_ETHDEV_QUEUE_STAT_CNTRS];