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;
73 uint32_t flow_control;
75 struct aq_rss_parameters aq_rss;
84 struct aq_hw_cfg_s *aq_nic_cfg;
85 const struct aq_fw_ops *aq_fw_ops;
88 struct aq_hw_link_status_s aq_link_status;
91 struct hw_aq_atl_utils_mbox mbox;
92 struct hw_atl_stats_s last_stats;
93 struct aq_stats_s curr_stats;
96 unsigned int chip_features;
101 struct hw_aq_atl_utils_fw_rpc rpc;
105 int (*init)(struct aq_hw_s *self);
107 int (*deinit)(struct aq_hw_s *self);
109 int (*reset)(struct aq_hw_s *self);
111 int (*get_mac_permanent)(struct aq_hw_s *self, u8 *mac);
113 int (*set_link_speed)(struct aq_hw_s *self, u32 speed);
115 int (*set_state)(struct aq_hw_s *self,
116 enum hal_atl_utils_fw_state_e state);
118 int (*update_link_status)(struct aq_hw_s *self);
120 int (*update_stats)(struct aq_hw_s *self);
122 int (*set_power)(struct aq_hw_s *self, unsigned int power_state,
125 int (*get_temp)(struct aq_hw_s *self, int *temp);
127 int (*get_cable_len)(struct aq_hw_s *self, int *cable_len);
129 int (*set_eee_rate)(struct aq_hw_s *self, u32 speed);
131 int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate,
132 u32 *supported_rates);
134 int (*set_flow_control)(struct aq_hw_s *self);
136 int (*led_control)(struct aq_hw_s *self, u32 mode);
138 int (*get_eeprom)(struct aq_hw_s *self, u32 *data, u32 len);
140 int (*set_eeprom)(struct aq_hw_s *self, u32 *data, u32 len);