1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Atlantic Network Driver
3 * Copyright (C) 2020 Marvell International Ltd.
6 #ifndef HW_ATL2_UTILS_H
7 #define HW_ATL2_UTILS_H
13 struct link_options_s
{
15 u8 link_renegotiate
:1;
16 u8 minimal_link_speed
:1;
17 u8 internal_loopback
:1;
18 u8 external_loopback
:1;
46 struct link_control_s
{
48 u8 disable_crc_corruption
:1;
49 u8 discard_short_frames
:1;
50 u8 flow_control_mode
:1;
51 u8 disable_length_check
:1;
53 u8 discard_errored_frames
:1;
54 u8 control_frame_enable
:1;
55 u8 enable_tx_padding
:1;
56 u8 enable_crc_forwarding
:1;
57 u8 enable_frame_padding_removal_rx
: 1;
58 u8 promiscuous_mode
: 1;
64 struct thermal_shutdown_s
{
69 u8 shutdown_temperature
;
71 u8 warning_temperature
;
74 struct mac_address_s
{
78 struct mac_address_aligned_s
{
79 struct mac_address_s aligned
;
83 struct sleep_proxy_s
{
84 struct wake_on_lan_s
{
85 u8 wake_on_magic_packet
:1;
88 u8 wake_on_link_down
:1;
97 u32 link_down_timeout
;
104 } wake_up_pattern
[8];
112 u8 ignore_fragmented
:1;
119 u32 ipv4_offload_addr
[8];
134 u32 ipv6_offload_addr
[16][4];
153 u8 remote_mac_addr
[6];
163 } ka4_connection
[16];
174 u8 remote_mac_addr
[6];
184 } ka6_connection
[16];
194 struct pause_quanta_s
{
209 struct data_buffer_status_s
{
214 struct device_caps_s
{
215 u8 finite_flashless
:1;
227 struct bundle_version_t
{
232 struct mac_version_t
{
237 struct phy_version_t
{
245 struct link_status_s
{
258 struct wol_status_s
{
262 u16 wake_up_packet_length
:12;
263 u16 wake_up_pattern_number
:3;
266 u32 wake_up_packet
[379];
269 struct mac_health_monitor_s
{
272 u8 mac_flashless_finished
:1;
281 struct phy_health_monitor_s
{
284 u8 phy_hot_warning
:1;
293 struct device_link_caps_s
{
295 u8 internal_loopback
:1;
296 u8 external_loopback
:1;
323 u8 downshift_retry
:4;
326 struct sleep_proxy_caps_s
{
329 u8 tcp_port_offload
:1;
330 u8 udp_port_offload
:1;
336 u8 wake_on_magic_packet
:1;
337 u8 wake_on_pattern
:1;
340 u8 wake_patterns_count
:4;
345 u8 tcp_port_offload_count
;
346 u8 udp_port_offload_count
;
359 struct lkp_link_caps_s
{
401 u32 mem_buffer
[0x1ff];
404 struct cable_diag_control_s
{
412 struct cable_diag_lane_data_s
{
419 struct cable_diag_status_s
{
420 struct cable_diag_lane_data_s lane_data
[4];
427 struct statistics_s
{
434 u64 tx_unicast_octets
;
435 u64 tx_multicast_octets
;
436 u64 tx_broadcast_octets
;
437 u64 rx_unicast_octets
;
438 u64 rx_multicast_octets
;
439 u64 rx_broadcast_octets
;
441 u32 tx_unicast_frames
;
442 u32 tx_multicast_frames
;
443 u32 tx_broadcast_frames
;
446 u32 rx_unicast_frames
;
447 u32 rx_multicast_frames
;
448 u32 rx_broadcast_frames
;
449 u32 rx_dropped_frames
;
456 u32 main_loop_cycles
;
460 struct filter_caps_s
{
461 u8 l2_filters_base_index
:6;
462 u8 flexible_filter_mask
:2;
464 u8 ethertype_filter_base_index
;
465 u8 ethertype_filter_count
;
467 u8 vlan_filter_base_index
;
468 u8 vlan_filter_count
;
469 u8 l3_ip4_filter_base_index
:4;
470 u8 l3_ip4_filter_count
:4;
471 u8 l3_ip6_filter_base_index
:4;
472 u8 l3_ip6_filter_count
:4;
474 u8 l4_filter_base_index
:4;
475 u8 l4_filter_count
:4;
476 u8 l4_flex_filter_base_index
:4;
477 u8 l4_flex_filter_count
:4;
478 u8 rslv_tbl_base_index
;
482 struct request_policy_s
{
486 u8 rx_queue_tc_index
:5;
493 u8 rx_queue_tc_index
:5;
500 u8 rx_queue_tc_index
:5;
507 struct fw_interface_in
{
510 struct mac_address_aligned_s mac_address
;
511 struct link_control_s link_control
;
513 struct link_options_s link_options
;
515 struct thermal_shutdown_s thermal_shutdown
;
517 struct sleep_proxy_s sleep_proxy
;
519 struct pause_quanta_s pause_quanta
[8];
520 struct cable_diag_control_s cable_diag_control
;
522 struct data_buffer_status_s data_buffer_status
;
524 struct request_policy_s request_policy
;
527 struct transaction_counter_s
{
528 u16 transaction_cnt_a
;
529 u16 transaction_cnt_b
;
532 struct management_status_s
{
533 struct mac_address_s mac_address
;
548 struct fw_interface_out
{
549 struct transaction_counter_s transaction_id
;
550 struct version_s version
;
551 struct link_status_s link_status
;
552 struct wol_status_s wol_status
;
555 struct mac_health_monitor_s mac_health_monitor
;
558 struct phy_health_monitor_s phy_health_monitor
;
561 struct cable_diag_status_s cable_diag_status
;
563 struct device_link_caps_s device_link_caps
;
565 struct sleep_proxy_caps_s sleep_proxy_caps
;
567 struct lkp_link_caps_s lkp_link_caps
;
569 struct core_dump_s core_dump
;
571 struct statistics_s stats
;
573 struct filter_caps_s filter_caps
;
574 struct device_caps_s device_caps
;
576 struct management_status_s management_status
;
578 struct trace_s trace
;
581 #define AQ_A2_FW_LINK_RATE_INVALID 0
582 #define AQ_A2_FW_LINK_RATE_10M 1
583 #define AQ_A2_FW_LINK_RATE_100M 2
584 #define AQ_A2_FW_LINK_RATE_1G 3
585 #define AQ_A2_FW_LINK_RATE_2G5 4
586 #define AQ_A2_FW_LINK_RATE_5G 5
587 #define AQ_A2_FW_LINK_RATE_10G 6
589 #define AQ_HOST_MODE_INVALID 0U
590 #define AQ_HOST_MODE_ACTIVE 1U
591 #define AQ_HOST_MODE_SLEEP_PROXY 2U
592 #define AQ_HOST_MODE_LOW_POWER 3U
593 #define AQ_HOST_MODE_SHUTDOWN 4U
595 int hw_atl2_utils_initfw(struct aq_hw_s
*self
, const struct aq_fw_ops
**fw_ops
);
597 int hw_atl2_utils_soft_reset(struct aq_hw_s
*self
);
599 u32
hw_atl2_utils_get_fw_version(struct aq_hw_s
*self
);
601 int hw_atl2_utils_get_action_resolve_table_caps(struct aq_hw_s
*self
,
602 u8
*base_index
, u8
*count
);
604 extern const struct aq_fw_ops aq_a2_fw_ops
;
606 #endif /* HW_ATL2_UTILS_H */