1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Aquantia Corporation
22 #define min(a, b) RTE_MIN(a, b)
23 #define max(a, b) RTE_MAX(a, b)
25 #include "hw_atl/hw_atl_utils.h"
27 struct aq_hw_link_status_s {
62 uint32_t flow_control;
67 struct aq_hw_cfg_s *aq_nic_cfg;
68 const struct aq_fw_ops *aq_fw_ops;
71 struct aq_hw_link_status_s aq_link_status;
73 struct hw_aq_atl_utils_mbox mbox;
74 struct hw_atl_stats_s last_stats;
75 struct aq_stats_s curr_stats;
77 unsigned int chip_features;
82 struct hw_aq_atl_utils_fw_rpc rpc;
86 int (*init)(struct aq_hw_s *self);
88 int (*deinit)(struct aq_hw_s *self);
90 int (*reset)(struct aq_hw_s *self);
92 int (*get_mac_permanent)(struct aq_hw_s *self, u8 *mac);
94 int (*set_link_speed)(struct aq_hw_s *self, u32 speed);
96 int (*set_state)(struct aq_hw_s *self,
97 enum hal_atl_utils_fw_state_e state);
99 int (*update_link_status)(struct aq_hw_s *self);
101 int (*update_stats)(struct aq_hw_s *self);
103 int (*set_power)(struct aq_hw_s *self, unsigned int power_state,
106 int (*get_temp)(struct aq_hw_s *self, int *temp);
108 int (*get_cable_len)(struct aq_hw_s *self, int *cable_len);
110 int (*set_eee_rate)(struct aq_hw_s *self, u32 speed);
112 int (*get_eee_rate)(struct aq_hw_s *self, u32 *rate,
113 u32 *supported_rates);
115 int (*set_flow_control)(struct aq_hw_s *self);
117 int (*led_control)(struct aq_hw_s *self, u32 mode);
119 int (*get_eeprom)(struct aq_hw_s *self, u32 *data, u32 len);
121 int (*set_eeprom)(struct aq_hw_s *self, u32 *data, u32 len);