Merge "atlantic forwarding driver v1.1.18"

This commit is contained in:
qctecmdr 2021-03-16 00:31:53 -07:00 • committed by Gerrit - the friendly Code Review server
commit a58483c01c
6 changed files with 51 additions and 12 deletions

View file

@ -19,11 +19,21 @@
#define ATL2_FW_READ_TRY_MAX 1000
#define atl2_shared_buffer_write(HW, ITEM, VARIABLE) \
BUILD_BUG_ON_MSG((offsetof(struct fw_interface_in, ITEM) % \
sizeof(u32)) != 0,\
"Unaligned write " # ITEM);\
BUILD_BUG_ON_MSG((sizeof(VARIABLE) % sizeof(u32)) != 0,\
"Unaligned write length " # ITEM);\
atl2_mif_shared_buf_write(HW,\
(offsetof(struct fw_interface_in, ITEM) / sizeof(u32)),\
(u32 *)&VARIABLE, sizeof(VARIABLE) / sizeof(u32))
#define atl2_shared_buffer_get(HW, ITEM, VARIABLE) \
BUILD_BUG_ON_MSG((offsetof(struct fw_interface_in, ITEM) % \
sizeof(u32)) != 0,\
"Unaligned get " # ITEM);\
BUILD_BUG_ON_MSG((sizeof(VARIABLE) % sizeof(u32)) != 0,\
"Unaligned get length " # ITEM);\
atl2_mif_shared_buf_get(HW, \
(offsetof(struct fw_interface_in, ITEM) / sizeof(u32)),\
(u32 *)&VARIABLE, \
@ -36,7 +46,9 @@
{\
BUILD_BUG_ON_MSG((offsetof(struct fw_interface_out, ITEM) % \
sizeof(u32)) != 0,\
"Non aligned read " # ITEM);\
"Unaligned read " # ITEM);\
BUILD_BUG_ON_MSG((sizeof(VARIABLE) % sizeof(u32)) != 0,\
"Unaligned read length " # ITEM);\
BUILD_BUG_ON_MSG(sizeof(VARIABLE) > sizeof(u32),\
"Non atomic read " # ITEM);\
atl2_mif_shared_buf_read(HW, \
@ -666,12 +678,12 @@ static int atl2_fw_get_phy_temperature(struct atl_hw *hw, int *temp)
static int atl2_fw_get_mac_addr(struct atl_hw *hw, uint8_t *mac)
{
struct mac_address_s mac_address;
struct mac_address_aligned_s mac_address;
int err = 0;
atl2_shared_buffer_get(hw, mac_address, mac_address);
ether_addr_copy(mac, (u8 *)mac_address.mac_address);
ether_addr_copy(mac, (u8 *)mac_address.aligned.mac_address);
return err;
}
@ -735,7 +747,7 @@ static int atl2_fw_enable_wol(struct atl_hw *hw, unsigned int wol_mode)
struct link_options_s link_options;
struct link_control_s link_control;
struct wake_on_lan_s wake_on_lan;
struct mac_address_s mac_address;
struct mac_address_aligned_s mac_address;
int ret = 0;
atl_lock_fw(hw);
@ -758,7 +770,7 @@ static int atl2_fw_enable_wol(struct atl_hw *hw, unsigned int wol_mode)
wake_on_lan.restore_link_before_wake = 1;
}
ether_addr_copy(mac_address.mac_address, hw->mac_addr);
ether_addr_copy(mac_address.aligned.mac_address, hw->mac_addr);
atl2_shared_buffer_write(hw, mac_address, mac_address);
atl2_shared_buffer_write(hw, sleep_proxy, wake_on_lan);

View file

@ -82,6 +82,11 @@ struct mac_address_s {
uint8_t mac_address[6];
};
struct mac_address_aligned_s {
struct mac_address_s aligned;
u16 rsvd;
};
struct sleep_proxy_s {
struct wake_on_lan_s {
uint32_t wake_on_magic_packet:1;
@ -555,8 +560,7 @@ struct request_policy_s {
struct fw_interface_in {
uint32_t mtu;
uint32_t rsvd1:32;
struct mac_address_s mac_address;
uint16_t rsvd;
struct mac_address_aligned_s mac_address;
struct link_control_s link_control;
uint32_t rsvd2:32;
struct link_options_s link_options;

View file

@ -20,7 +20,7 @@
#include <linux/netdevice.h>
#include <linux/moduleparam.h>
#define ATL_VERSION "1.1.15"
#define ATL_VERSION "1.1.18"
struct atl_nic;

View file

@ -236,6 +236,7 @@ static int atl2_hw_reset(struct atl_hw *hw)
u32 rbl_status = 0;
u32 rbl_request;
int err = 0;
int boot_time;
atl_lock_fw(hw);
@ -260,15 +261,18 @@ static int atl2_hw_reset(struct atl_hw *hw)
atl_write(hw, ATL2_MIF_BOOT_REG_ADR, rbl_request);
/* Wait for RBL boot */
busy_wait(200, mdelay(1), rbl_status,
atl_read(hw, ATL2_MIF_BOOT_REG_ADR),
((rbl_status & ATL2_BOOT_STARTED) == 0) ||
(rbl_status == 0xffffffff));
boot_time = busy_wait(2000, mdelay(1), rbl_status,
atl_read(hw, ATL2_MIF_BOOT_REG_ADR),
((rbl_status & ATL2_BOOT_STARTED) == 0) ||
(rbl_status == 0xffffffff));
if (!(rbl_status & ATL2_BOOT_STARTED)) {
err = -ETIME;
atl_dev_err("Boot code hung, rbl_status %#x", rbl_status);
goto unlock;
}
if (boot_time > 200)
atl_dev_err("Boot code took %dms. Thats unexpected and more than 200ms. Will continue.\n",
boot_time);
next_turn:
busy_wait(1000, mdelay(1), rbl_complete, atl2_mcp_boot_complete(hw),

View file

@ -389,6 +389,9 @@ int atl_init_macsec(struct atl_hw *hw)
int index = 0, tbl_idx;
int ret;
if (hw->chip_id == ATL_ANTIGUA)
return 0;
rtnl_lock();
memset(&msg, 0, sizeof(msg));
memset(&resp, 0, sizeof(resp));

View file

@ -1,3 +1,19 @@
Version 1.1.18
Date 21/02/2021
==============
- Hotfix to increase reset tmo on A2 to 2secs
Version 1.1.17
Date 19/02/2021
==============
- Hotfix to disable macsec load on A2
Version 1.1.16
Date 13/02/2021
==============
- Fixes for compilation without PTP
[ATLDRV-1649]: WOL was not functional. MAC address was invalid.
Version 1.1.15
==============
[ATLDRV-1613] - Atlantic_fwd driver hitting NULL pointer dereference at 0000000000000678 while requesting rx rings