Commit d993e14b authored by Nikita Danilov's avatar Nikita Danilov Committed by David S. Miller

net: atlantic: update firmware interface

Here we improve FW interface structures layout
and prepare these for the wake phy feature implementation.
Signed-off-by: default avatarNikita Danilov <ndanilov@marvell.com>
Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7b89c580
...@@ -858,22 +858,26 @@ static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac) ...@@ -858,22 +858,26 @@ static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac)
memset(prpc, 0, sizeof(*prpc)); memset(prpc, 0, sizeof(*prpc));
if (wol_enabled) { if (wol_enabled) {
rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_wol); rpc_size = offsetof(struct hw_atl_utils_fw_rpc, msg_wol_add) +
sizeof(prpc->msg_wol_add);
prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD; prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD;
prpc->msg_wol.priority = prpc->msg_wol_add.priority =
HAL_ATLANTIC_UTILS_FW_MSG_WOL_PRIOR; HAL_ATLANTIC_UTILS_FW_MSG_WOL_PRIOR;
prpc->msg_wol.pattern_id = prpc->msg_wol_add.pattern_id =
HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN; HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN;
prpc->msg_wol.wol_packet_type = prpc->msg_wol_add.packet_type =
HAL_ATLANTIC_UTILS_FW_MSG_WOL_MAG_PKT; HAL_ATLANTIC_UTILS_FW_MSG_WOL_MAG_PKT;
ether_addr_copy((u8 *)&prpc->msg_wol.wol_pattern, mac); ether_addr_copy((u8 *)&prpc->msg_wol_add.magic_packet_pattern,
mac);
} else { } else {
rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_del_id); rpc_size = sizeof(prpc->msg_wol_remove) +
offsetof(struct hw_atl_utils_fw_rpc, msg_wol_remove);
prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL; prpc->msg_id = HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL;
prpc->msg_wol.pattern_id = prpc->msg_wol_add.pattern_id =
HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN; HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN;
} }
......
...@@ -70,104 +70,41 @@ struct __packed hw_atl_stats_s { ...@@ -70,104 +70,41 @@ struct __packed hw_atl_stats_s {
u32 dpc; u32 dpc;
}; };
union __packed ip_addr { struct __packed drv_msg_enable_wakeup {
struct {
u8 addr[16];
} v6;
struct {
u8 padding[12];
u8 addr[4];
} v4;
};
struct __packed hw_atl_utils_fw_rpc {
u32 msg_id;
union { union {
struct { u32 pattern_mask;
u32 pong;
} msg_ping;
struct { struct {
u8 mac_addr[6]; u32 reason_arp_v4_pkt : 1;
u32 ip_addr_cnt; u32 reason_ipv4_ping_pkt : 1;
u32 reason_ipv6_ns_pkt : 1;
u32 reason_ipv6_ping_pkt : 1;
u32 reason_link_up : 1;
u32 reason_link_down : 1;
u32 reason_maximum : 1;
};
};
struct { union {
union ip_addr addr; u32 offload_mask;
union ip_addr mask; };
} ip[1]; };
} msg_arp;
struct { struct __packed magic_packet_pattern_s {
u32 len; u8 mac_addr[ETH_ALEN];
u8 packet[1514U]; };
} msg_inject;
struct { struct __packed drv_msg_wol_add {
u32 priority; u32 priority;
u32 wol_packet_type; u32 packet_type;
u32 pattern_id; u32 pattern_id;
u32 next_wol_pattern_offset; u32 next_pattern_offset;
union {
struct {
u32 flags;
u8 ipv4_source_address[4];
u8 ipv4_dest_address[4];
u16 tcp_source_port_number;
u16 tcp_dest_port_number;
} ipv4_tcp_syn_parameters;
struct {
u32 flags;
u8 ipv6_source_address[16];
u8 ipv6_dest_address[16];
u16 tcp_source_port_number;
u16 tcp_dest_port_number;
} ipv6_tcp_syn_parameters;
struct {
u32 flags;
} eapol_request_id_message_parameters;
struct {
u32 flags;
u32 mask_offset;
u32 mask_size;
u32 pattern_offset;
u32 pattern_size;
} wol_bit_map_pattern;
struct {
u8 mac_addr[ETH_ALEN];
} wol_magic_packet_patter;
} wol_pattern;
} msg_wol;
struct { struct magic_packet_pattern_s magic_packet_pattern;
union { };
u32 pattern_mask;
struct {
u32 reason_arp_v4_pkt : 1;
u32 reason_ipv4_ping_pkt : 1;
u32 reason_ipv6_ns_pkt : 1;
u32 reason_ipv6_ping_pkt : 1;
u32 reason_link_up : 1;
u32 reason_link_down : 1;
u32 reason_maximum : 1;
};
};
union {
u32 offload_mask;
};
} msg_enable_wakeup;
struct { struct __packed drv_msg_wol_remove {
u32 id; u32 id;
} msg_del_id;
};
}; };
struct __packed hw_atl_utils_mbox_header { struct __packed hw_atl_utils_mbox_header {
...@@ -189,6 +126,13 @@ struct __packed hw_aq_ptp_offset { ...@@ -189,6 +126,13 @@ struct __packed hw_aq_ptp_offset {
u16 egress_10000; u16 egress_10000;
}; };
struct __packed hw_atl_cable_diag {
u8 fault;
u8 distance;
u8 far_distance;
u8 reserved;
};
enum gpio_pin_function { enum gpio_pin_function {
GPIO_PIN_FUNCTION_NC, GPIO_PIN_FUNCTION_NC,
GPIO_PIN_FUNCTION_VAUX_ENABLE, GPIO_PIN_FUNCTION_VAUX_ENABLE,
...@@ -210,7 +154,7 @@ struct __packed hw_aq_info { ...@@ -210,7 +154,7 @@ struct __packed hw_aq_info {
u16 phy_temperature; u16 phy_temperature;
u8 cable_len; u8 cable_len;
u8 reserved1; u8 reserved1;
u32 cable_diag_data[4]; struct hw_atl_cable_diag cable_diag_data[4];
struct hw_aq_ptp_offset ptp_offset; struct hw_aq_ptp_offset ptp_offset;
u8 reserved2[12]; u8 reserved2[12];
u32 caps_lo; u32 caps_lo;
...@@ -236,25 +180,22 @@ struct __packed hw_atl_utils_mbox { ...@@ -236,25 +180,22 @@ struct __packed hw_atl_utils_mbox {
struct hw_aq_info info; struct hw_aq_info info;
}; };
/* fw2x */
typedef u32 fw_offset_t;
struct __packed offload_ip_info { struct __packed offload_ip_info {
u8 v4_local_addr_count; u8 v4_local_addr_count;
u8 v4_addr_count; u8 v4_addr_count;
u8 v6_local_addr_count; u8 v6_local_addr_count;
u8 v6_addr_count; u8 v6_addr_count;
fw_offset_t v4_addr; u32 v4_addr;
fw_offset_t v4_prefix; u32 v4_prefix;
fw_offset_t v6_addr; u32 v6_addr;
fw_offset_t v6_prefix; u32 v6_prefix;
}; };
struct __packed offload_port_info { struct __packed offload_port_info {
u16 udp_port_count; u16 udp_port_count;
u16 tcp_port_count; u16 tcp_port_count;
fw_offset_t udp_port; u32 udp_port;
fw_offset_t tcp_port; u32 tcp_port;
}; };
struct __packed offload_ka_info { struct __packed offload_ka_info {
...@@ -262,15 +203,15 @@ struct __packed offload_ka_info { ...@@ -262,15 +203,15 @@ struct __packed offload_ka_info {
u16 v6_ka_count; u16 v6_ka_count;
u32 retry_count; u32 retry_count;
u32 retry_interval; u32 retry_interval;
fw_offset_t v4_ka; u32 v4_ka;
fw_offset_t v6_ka; u32 v6_ka;
}; };
struct __packed offload_rr_info { struct __packed offload_rr_info {
u32 rr_count; u32 rr_count;
u32 rr_buf_len; u32 rr_buf_len;
fw_offset_t rr_id_x; u32 rr_id_x;
fw_offset_t rr_buf; u32 rr_buf;
}; };
struct __packed offload_info { struct __packed offload_info {
...@@ -287,6 +228,19 @@ struct __packed offload_info { ...@@ -287,6 +228,19 @@ struct __packed offload_info {
u8 buf[0]; u8 buf[0];
}; };
struct __packed hw_atl_utils_fw_rpc {
u32 msg_id;
union {
/* fw1x structures */
struct drv_msg_wol_add msg_wol_add;
struct drv_msg_wol_remove msg_wol_remove;
struct drv_msg_enable_wakeup msg_enable_wakeup;
/* fw2x structures */
struct offload_info fw2x_offloads;
};
};
/* Mailbox FW Request interface */ /* Mailbox FW Request interface */
struct __packed hw_fw_request_ptp_gpio_ctrl { struct __packed hw_fw_request_ptp_gpio_ctrl {
u32 index; u32 index;
...@@ -326,6 +280,9 @@ struct __packed hw_fw_request_iface { ...@@ -326,6 +280,9 @@ struct __packed hw_fw_request_iface {
enum hw_atl_rx_action_with_traffic { enum hw_atl_rx_action_with_traffic {
HW_ATL_RX_DISCARD, HW_ATL_RX_DISCARD,
HW_ATL_RX_HOST, HW_ATL_RX_HOST,
HW_ATL_RX_MNGMNT,
HW_ATL_RX_HOST_AND_MNGMNT,
HW_ATL_RX_WOL
}; };
struct aq_rx_filter_vlan { struct aq_rx_filter_vlan {
...@@ -407,20 +364,12 @@ enum hal_atl_utils_fw_state_e { ...@@ -407,20 +364,12 @@ enum hal_atl_utils_fw_state_e {
#define HAL_ATLANTIC_RATE_100M BIT(5) #define HAL_ATLANTIC_RATE_100M BIT(5)
#define HAL_ATLANTIC_RATE_INVALID BIT(6) #define HAL_ATLANTIC_RATE_INVALID BIT(6)
#define HAL_ATLANTIC_UTILS_FW_MSG_PING 0x1U
#define HAL_ATLANTIC_UTILS_FW_MSG_ARP 0x2U
#define HAL_ATLANTIC_UTILS_FW_MSG_INJECT 0x3U
#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD 0x4U #define HAL_ATLANTIC_UTILS_FW_MSG_WOL_ADD 0x4U
#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_PRIOR 0x10000000U #define HAL_ATLANTIC_UTILS_FW_MSG_WOL_PRIOR 0x10000000U
#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN 0x1U #define HAL_ATLANTIC_UTILS_FW_MSG_WOL_PATTERN 0x1U
#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_MAG_PKT 0x2U #define HAL_ATLANTIC_UTILS_FW_MSG_WOL_MAG_PKT 0x2U
#define HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL 0x5U #define HAL_ATLANTIC_UTILS_FW_MSG_WOL_DEL 0x5U
#define HAL_ATLANTIC_UTILS_FW_MSG_ENABLE_WAKEUP 0x6U #define HAL_ATLANTIC_UTILS_FW_MSG_ENABLE_WAKEUP 0x6U
#define HAL_ATLANTIC_UTILS_FW_MSG_MSM_PFC 0x7U
#define HAL_ATLANTIC_UTILS_FW_MSG_PROVISIONING 0x8U
#define HAL_ATLANTIC_UTILS_FW_MSG_OFFLOAD_ADD 0x9U
#define HAL_ATLANTIC_UTILS_FW_MSG_OFFLOAD_DEL 0xAU
#define HAL_ATLANTIC_UTILS_FW_MSG_CABLE_DIAG 0xDU
enum hw_atl_fw2x_rate { enum hw_atl_fw2x_rate {
FW2X_RATE_100M = 0x20, FW2X_RATE_100M = 0x20,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment