21 #include <linux/pci.h>
23 #include <linux/mii.h>
38 value &= ~SPI_FLASH_CTRL_EN_VPD;
42 return ((value & 0xFF00) == 0x6C00) ? 0 : 1;
68 static int atl1e_get_permanent_address(
struct atl1e_hw *
hw)
79 addr[0] = addr[1] = 0;
92 if (i >= AT_TWSI_EEPROM_TIMEOUT)
102 if (is_valid_ether_addr(eth_addr)) {
127 for (i = 0; i < 10; i++) {
155 err = atl1e_get_permanent_address(hw);
174 for (i = 0; i < 32; i++)
175 value |= (((crc32 >> i) & 1) << (31 - i));
187 u32 hash_bit, hash_reg;
199 hash_reg = (hash_value >> 31) & 0x1;
200 hash_bit = (hash_value >> 26) & 0x1F;
204 mta |= (1 << hash_bit);
234 *phy_data = (
u16)val;
278 static void atl1e_init_pcie(
struct atl1e_hw *hw)
296 static int atl1e_phy_setup_autoneg_adv(
struct atl1e_hw *hw)
299 u16 mii_autoneg_adv_reg;
300 u16 mii_1000t_ctrl_reg;
402 for (i = 0; i < 25; i++) {
410 netdev_err(adapter->
netdev,
411 "pcie linkdown at least for 25ms\n");
415 netdev_err(adapter->
netdev,
"pcie linkup after %d ms\n", i);
486 netdev_err(adapter->
netdev,
487 "Error enable PHY linkChange Interrupt\n");
491 ret_val = atl1e_phy_setup_autoneg_adv(hw);
493 netdev_err(adapter->
netdev,
494 "Error Setting up Auto-Negotiation\n");
501 netdev_err(adapter->
netdev,
"Error resetting the phy\n");
520 u32 idle_status_data = 0;
521 u16 pci_cfg_cmd_word = 0;
548 if (idle_status_data == 0)
554 if (timeout >= AT_HW_MAX_IDLE_DELAY) {
555 netdev_err(adapter->
netdev,
556 "MAC state machine can't be idle since disabled for 10ms second\n");