Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.c +17 −5 Original line number Diff line number Diff line Loading @@ -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, \ Loading @@ -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, \ Loading Loading @@ -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; } Loading Loading @@ -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); Loading @@ -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); Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.h +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_hw.c +8 −4 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -260,7 +261,7 @@ 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, 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)); Loading @@ -269,6 +270,9 @@ static int atl2_hw_reset(struct atl_hw *hw) 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), Loading drivers/net/ethernet/aquantia/atlantic-fwd/atl_macsec.c +3 −0 Original line number Diff line number Diff line Loading @@ -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)); Loading Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.c +17 −5 Original line number Diff line number Diff line Loading @@ -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, \ Loading @@ -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, \ Loading Loading @@ -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; } Loading Loading @@ -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); Loading @@ -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); Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl2_fw.h +6 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_common.h +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_hw.c +8 −4 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -260,7 +261,7 @@ 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, 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)); Loading @@ -269,6 +270,9 @@ static int atl2_hw_reset(struct atl_hw *hw) 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), Loading
drivers/net/ethernet/aquantia/atlantic-fwd/atl_macsec.c +3 −0 Original line number Diff line number Diff line Loading @@ -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)); Loading