21 #include <linux/pci.h>
23 #include <linux/mii.h>
54 value = mac_addr[2] << 24 |
60 value = mac_addr[0] << 8 |
73 *(
u32 *) ð_addr[2] =
htonl(addr[0]);
76 return is_valid_ether_addr(eth_addr);
83 static int atl1c_get_permanent_address(
struct atl1c_hw *hw)
89 bool raise_vol =
false;
128 if (i >= AT_TWSI_EEPROM_TIMEOUT)
167 (otp_ctrl_data | OTP_CTRL_CLK_EN));
173 for (i = 0; i < 10; i++) {
182 data = data & 0xFFFF;
183 *p_value =
swab32((data << 16) | (*p_value >> 16));
186 if (!(otp_ctrl_data & OTP_CTRL_CLK_EN))
200 err = atl1c_get_permanent_address(hw);
223 for (i = 0; i < 32; i++)
224 value |= (((crc32 >> i) & 1) << (31 - i));
236 u32 hash_bit, hash_reg;
248 hash_reg = (hash_value >> 31) & 0x1;
249 hash_bit = (hash_value >> 26) & 0x1F;
253 mta |= (1 << hash_bit);
295 FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
296 FIELDX(MDIO_CTRL_REG, 1) |
330 val =
FIELDX(MDIO_EXTN_DEVAD, dev) |
FIELDX(MDIO_EXTN_REG, reg);
333 FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
339 FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
340 FIELDX(MDIO_CTRL_REG, reg) |
379 val =
FIELDX(MDIO_EXTN_DEVAD, dev) |
FIELDX(MDIO_EXTN_REG, reg);
382 FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
383 FIELDX(MDIO_CTRL_DATA, phy_data) |
388 FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
389 FIELDX(MDIO_CTRL_DATA, phy_data) |
390 FIELDX(MDIO_CTRL_REG, reg) |
469 static int atl1c_phy_setup_adv(
struct atl1c_hw *hw)
515 u32 phy_ctrl_data, lpi_ctrl;
597 "Error enable PHY linkChange Interrupt\n");
617 ret_val = atl1c_phy_setup_adv(hw);
621 "Error Setting up Auto-Negotiation\n");
703 u16 save_autoneg_advertised;
737 if (phy_data & BMSR_LSTATUS) {
741 "get speed and duplex failed\n");
761 err = atl1c_phy_setup_adv(hw);
773 u32 master_ctrl, mac_ctrl, phy_ctrl;
786 mac_ctrl =
FIELD_SETX(mac_ctrl, MAC_CTRL_SPEED, speed);
813 dev_dbg(&pdev->
dev,
"%s: write phy MII_IER faild.\n",
820 dev_dbg(&pdev->
dev,
"%s: suspend MAC=%x,MASTER=%x,PHY=0x%x,WOL=%x\n",
835 bool adj_thresh =
false;
846 phy_val =
FIELD_GETX(phy_val, CLDCTRL6_CAB_LEN);