Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
sis190: failure to set the MAC address from EEPROM
Fix phy_read/write redefinition errors in ucc_geth_phy.c
Update ucc_geth.c for new workqueue structure
myri10ge: update driver version to 1.2.0
myri10ge: check that we can get an irq
myri10ge: make wc_fifo usage load-time tunable
8139cp: Don't blindly enable interrupts
[PATCH] bcm43xx: Fix failure to deliver PCI-E interrupts

+103 -86
+4 -3
drivers/net/8139cp.c
··· 765 struct cp_private *cp = netdev_priv(dev); 766 unsigned entry; 767 u32 eor, flags; 768 #if CP_VLAN_TAG_USED 769 u32 vlan_tag = 0; 770 #endif 771 int mss = 0; 772 773 - spin_lock_irq(&cp->lock); 774 775 /* This is a hard error, log it. */ 776 if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) { 777 netif_stop_queue(dev); 778 - spin_unlock_irq(&cp->lock); 779 printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", 780 dev->name); 781 return 1; ··· 909 if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1)) 910 netif_stop_queue(dev); 911 912 - spin_unlock_irq(&cp->lock); 913 914 cpw8(TxPoll, NormalTxPoll); 915 dev->trans_start = jiffies;
··· 765 struct cp_private *cp = netdev_priv(dev); 766 unsigned entry; 767 u32 eor, flags; 768 + unsigned long intr_flags; 769 #if CP_VLAN_TAG_USED 770 u32 vlan_tag = 0; 771 #endif 772 int mss = 0; 773 774 + spin_lock_irqsave(&cp->lock, intr_flags); 775 776 /* This is a hard error, log it. */ 777 if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) { 778 netif_stop_queue(dev); 779 + spin_unlock_irqrestore(&cp->lock, intr_flags); 780 printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", 781 dev->name); 782 return 1; ··· 908 if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1)) 909 netif_stop_queue(dev); 910 911 + spin_unlock_irqrestore(&cp->lock, intr_flags); 912 913 cpw8(TxPoll, NormalTxPoll); 914 dev->trans_start = jiffies;
+18 -5
drivers/net/myri10ge/myri10ge.c
··· 71 #include "myri10ge_mcp.h" 72 #include "myri10ge_mcp_gen_header.h" 73 74 - #define MYRI10GE_VERSION_STR "1.1.0" 75 76 MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 77 MODULE_AUTHOR("Maintainer: help@myri.com"); ··· 273 static int myri10ge_fill_thresh = 256; 274 module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR); 275 MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n"); 276 277 #define MYRI10GE_FW_OFFSET 1024*1024 278 #define MYRI10GE_HIGHPART_TO_U32(X) \ ··· 1718 goto abort_with_irq; 1719 } 1720 1721 - if (mgp->mtrr >= 0) { 1722 mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; 1723 mgp->rx_small.wc_fifo = 1724 (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; ··· 2882 netdev->hard_start_xmit = myri10ge_xmit; 2883 netdev->get_stats = myri10ge_get_stats; 2884 netdev->base_addr = mgp->iomem_base; 2885 - netdev->irq = pdev->irq; 2886 netdev->change_mtu = myri10ge_change_mtu; 2887 netdev->set_multicast_list = myri10ge_set_multicast_list; 2888 netdev->set_mac_address = myri10ge_set_mac_address; ··· 2890 netdev->features |= NETIF_F_HIGHDMA; 2891 netdev->poll = myri10ge_poll; 2892 netdev->weight = myri10ge_napi_weight; 2893 2894 /* Save configuration space to be restored if the 2895 * nic resets due to a parity error */ ··· 2915 dev_err(&pdev->dev, "register_netdev failed: %d\n", status); 2916 goto abort_with_state; 2917 } 2918 - dev_info(dev, "%d, tx bndry %d, fw %s, WC %s\n", 2919 - pdev->irq, mgp->tx.boundary, mgp->fw_name, 2920 (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); 2921 2922 return 0;
··· 71 #include "myri10ge_mcp.h" 72 #include "myri10ge_mcp_gen_header.h" 73 74 + #define MYRI10GE_VERSION_STR "1.2.0" 75 76 MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 77 MODULE_AUTHOR("Maintainer: help@myri.com"); ··· 273 static int myri10ge_fill_thresh = 256; 274 module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR); 275 MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n"); 276 + 277 + static int myri10ge_wcfifo = 1; 278 + module_param(myri10ge_wcfifo, int, S_IRUGO); 279 + MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled\n"); 280 281 #define MYRI10GE_FW_OFFSET 1024*1024 282 #define MYRI10GE_HIGHPART_TO_U32(X) \ ··· 1714 goto abort_with_irq; 1715 } 1716 1717 + if (myri10ge_wcfifo && mgp->mtrr >= 0) { 1718 mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; 1719 mgp->rx_small.wc_fifo = 1720 (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; ··· 2878 netdev->hard_start_xmit = myri10ge_xmit; 2879 netdev->get_stats = myri10ge_get_stats; 2880 netdev->base_addr = mgp->iomem_base; 2881 netdev->change_mtu = myri10ge_change_mtu; 2882 netdev->set_multicast_list = myri10ge_set_multicast_list; 2883 netdev->set_mac_address = myri10ge_set_mac_address; ··· 2887 netdev->features |= NETIF_F_HIGHDMA; 2888 netdev->poll = myri10ge_poll; 2889 netdev->weight = myri10ge_napi_weight; 2890 + 2891 + /* make sure we can get an irq, and that MSI can be 2892 + * setup (if available). Also ensure netdev->irq 2893 + * is set to correct value if MSI is enabled */ 2894 + status = myri10ge_request_irq(mgp); 2895 + if (status != 0) 2896 + goto abort_with_firmware; 2897 + netdev->irq = pdev->irq; 2898 + myri10ge_free_irq(mgp); 2899 2900 /* Save configuration space to be restored if the 2901 * nic resets due to a parity error */ ··· 2903 dev_err(&pdev->dev, "register_netdev failed: %d\n", status); 2904 goto abort_with_state; 2905 } 2906 + dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", 2907 + (mgp->msi_enabled ? "MSI" : "xPIC"), 2908 + netdev->irq, mgp->tx.boundary, mgp->fw_name, 2909 (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); 2910 2911 return 0;
+1 -1
drivers/net/sis190.c
··· 1562 for (i = 0; i < MAC_ADDR_LEN / 2; i++) { 1563 __le16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i); 1564 1565 - ((u16 *)dev->dev_addr)[0] = le16_to_cpu(w); 1566 } 1567 1568 sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo));
··· 1562 for (i = 0; i < MAC_ADDR_LEN / 2; i++) { 1563 __le16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i); 1564 1565 + ((u16 *)dev->dev_addr)[i] = le16_to_cpu(w); 1566 } 1567 1568 sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo));
+7 -5
drivers/net/ucc_geth.c
··· 29 #include <linux/fsl_devices.h> 30 #include <linux/ethtool.h> 31 #include <linux/mii.h> 32 33 #include <asm/of_platform.h> 34 #include <asm/uaccess.h> ··· 473 kfree(enet_addr_cont); 474 } 475 476 - static int set_mac_addr(__be16 __iomem *reg, u8 *mac) 477 { 478 out_be16(&reg[0], ((u16)mac[5] << 8) | mac[4]); 479 out_be16(&reg[1], ((u16)mac[3] << 8) | mac[2]); ··· 3921 } 3922 3923 /* Scheduled by the phy_interrupt/timer to handle PHY changes */ 3924 - static void ugeth_phy_change(void *data) 3925 { 3926 - struct net_device *dev = (struct net_device *)data; 3927 - struct ucc_geth_private *ugeth = netdev_priv(dev); 3928 struct ucc_geth *ug_regs; 3929 int result = 0; 3930 ··· 4082 #endif /* CONFIG_UGETH_NAPI */ 4083 4084 /* Set up the PHY change work queue */ 4085 - INIT_WORK(&ugeth->tq, ugeth_phy_change, dev); 4086 4087 init_timer(&ugeth->phy_info_timer); 4088 ugeth->phy_info_timer.function = &ugeth_phy_startup_timer;
··· 29 #include <linux/fsl_devices.h> 30 #include <linux/ethtool.h> 31 #include <linux/mii.h> 32 + #include <linux/workqueue.h> 33 34 #include <asm/of_platform.h> 35 #include <asm/uaccess.h> ··· 472 kfree(enet_addr_cont); 473 } 474 475 + static void set_mac_addr(__be16 __iomem *reg, u8 *mac) 476 { 477 out_be16(&reg[0], ((u16)mac[5] << 8) | mac[4]); 478 out_be16(&reg[1], ((u16)mac[3] << 8) | mac[2]); ··· 3920 } 3921 3922 /* Scheduled by the phy_interrupt/timer to handle PHY changes */ 3923 + static void ugeth_phy_change(struct work_struct *work) 3924 { 3925 + struct ucc_geth_private *ugeth = 3926 + container_of(work, struct ucc_geth_private, tq); 3927 + struct net_device *dev = ugeth->dev; 3928 struct ucc_geth *ug_regs; 3929 int result = 0; 3930 ··· 4080 #endif /* CONFIG_UGETH_NAPI */ 4081 4082 /* Set up the PHY change work queue */ 4083 + INIT_WORK(&ugeth->tq, ugeth_phy_change); 4084 4085 init_timer(&ugeth->phy_info_timer); 4086 ugeth->phy_info_timer.function = &ugeth_phy_startup_timer;
+66 -68
drivers/net/ucc_geth_phy.c
··· 68 static int genmii_config_aneg(struct ugeth_mii_info *mii_info); 69 static int genmii_update_link(struct ugeth_mii_info *mii_info); 70 static int genmii_read_status(struct ugeth_mii_info *mii_info); 71 - u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum); 72 - void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val); 73 74 /* Write value to the PHY for this device to the register at regnum, */ 75 /* waiting until the write is done before it returns. All PHY */ ··· 207 advertise = mii_info->advertising; 208 209 /* Setup standard advertisement */ 210 - adv = phy_read(mii_info, MII_ADVERTISE); 211 adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4); 212 if (advertise & ADVERTISED_10baseT_Half) 213 adv |= ADVERTISE_10HALF; ··· 217 adv |= ADVERTISE_100HALF; 218 if (advertise & ADVERTISED_100baseT_Full) 219 adv |= ADVERTISE_100FULL; 220 - phy_write(mii_info, MII_ADVERTISE, adv); 221 } 222 223 static void genmii_setup_forced(struct ugeth_mii_info *mii_info) ··· 227 228 ugphy_vdbg("%s: IN", __FUNCTION__); 229 230 - ctrl = phy_read(mii_info, MII_BMCR); 231 232 ctrl &= 233 ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE); ··· 257 break; 258 } 259 260 - phy_write(mii_info, MII_BMCR, ctrl); 261 } 262 263 /* Enable and Restart Autonegotiation */ ··· 267 268 ugphy_vdbg("%s: IN", __FUNCTION__); 269 270 - ctl = phy_read(mii_info, MII_BMCR); 271 ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); 272 - phy_write(mii_info, MII_BMCR, ctl); 273 } 274 275 static int gbit_config_aneg(struct ugeth_mii_info *mii_info) ··· 284 config_genmii_advert(mii_info); 285 advertise = mii_info->advertising; 286 287 - adv = phy_read(mii_info, MII_1000BASETCONTROL); 288 adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP | 289 MII_1000BASETCONTROL_HALFDUPLEXCAP); 290 if (advertise & SUPPORTED_1000baseT_Half) 291 adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP; 292 if (advertise & SUPPORTED_1000baseT_Full) 293 adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP; 294 - phy_write(mii_info, MII_1000BASETCONTROL, adv); 295 296 /* Start/Restart aneg */ 297 genmii_restart_aneg(mii_info); ··· 321 ugphy_vdbg("%s: IN", __FUNCTION__); 322 323 /* Do a fake read */ 324 - phy_read(mii_info, MII_BMSR); 325 326 /* Read link and autonegotiation status */ 327 - status = phy_read(mii_info, MII_BMSR); 328 if ((status & BMSR_LSTATUS) == 0) 329 mii_info->link = 0; 330 else ··· 352 return err; 353 354 if (mii_info->autoneg) { 355 - status = phy_read(mii_info, MII_LPA); 356 357 if (status & (LPA_10FULL | LPA_100FULL)) 358 mii_info->duplex = DUPLEX_FULL; ··· 375 { 376 ugphy_vdbg("%s: IN", __FUNCTION__); 377 378 - phy_write(mii_info, 0x14, 0x0cd2); 379 - phy_write(mii_info, MII_BMCR, 380 - phy_read(mii_info, MII_BMCR) | BMCR_RESET); 381 msleep(4000); 382 383 return 0; ··· 390 /* The Marvell PHY has an errata which requires 391 * that certain registers get written in order 392 * to restart autonegotiation */ 393 - phy_write(mii_info, MII_BMCR, BMCR_RESET); 394 395 - phy_write(mii_info, 0x1d, 0x1f); 396 - phy_write(mii_info, 0x1e, 0x200c); 397 - phy_write(mii_info, 0x1d, 0x5); 398 - phy_write(mii_info, 0x1e, 0); 399 - phy_write(mii_info, 0x1e, 0x100); 400 401 gbit_config_aneg(mii_info); 402 ··· 421 * are as set */ 422 if (mii_info->autoneg && mii_info->link) { 423 int speed; 424 - status = phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS); 425 426 /* Get the duplexity */ 427 if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX) ··· 453 ugphy_vdbg("%s: IN", __FUNCTION__); 454 455 /* Clear the interrupts by reading the reg */ 456 - phy_read(mii_info, MII_M1011_IEVENT); 457 458 return 0; 459 } ··· 463 ugphy_vdbg("%s: IN", __FUNCTION__); 464 465 if (mii_info->interrupts == MII_INTERRUPT_ENABLED) 466 - phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT); 467 else 468 - phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR); 469 470 return 0; 471 } ··· 474 { 475 ugphy_vdbg("%s: IN", __FUNCTION__); 476 477 - phy_write(mii_info, MII_CIS8201_AUX_CONSTAT, 478 MII_CIS8201_AUXCONSTAT_INIT); 479 - phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT); 480 481 return 0; 482 } ··· 500 if (mii_info->autoneg && mii_info->link) { 501 int speed; 502 503 - status = phy_read(mii_info, MII_CIS8201_AUX_CONSTAT); 504 if (status & MII_CIS8201_AUXCONSTAT_DUPLEX) 505 mii_info->duplex = DUPLEX_FULL; 506 else ··· 528 { 529 ugphy_vdbg("%s: IN", __FUNCTION__); 530 531 - phy_read(mii_info, MII_CIS8201_ISTAT); 532 533 return 0; 534 } ··· 538 ugphy_vdbg("%s: IN", __FUNCTION__); 539 540 if (mii_info->interrupts == MII_INTERRUPT_ENABLED) 541 - phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK); 542 else 543 - phy_write(mii_info, MII_CIS8201_IMASK, 0); 544 545 return 0; 546 } ··· 564 /* If we aren't autonegotiating, assume speeds 565 * are as set */ 566 if (mii_info->autoneg && mii_info->link) { 567 - status = phy_read(mii_info, MII_DM9161_SCSR); 568 if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H)) 569 mii_info->speed = SPEED_100; 570 else ··· 595 { 596 struct ugeth_mii_info *mii_info = (struct ugeth_mii_info *)data; 597 struct dm9161_private *priv = mii_info->priv; 598 - u16 status = phy_read(mii_info, MII_BMSR); 599 600 ugphy_vdbg("%s: IN", __FUNCTION__); 601 ··· 622 /* Reset is not done yet */ 623 priv->resetdone = 0; 624 625 - phy_write(mii_info, MII_BMCR, 626 - phy_read(mii_info, MII_BMCR) | BMCR_RESET); 627 628 - phy_write(mii_info, MII_BMCR, 629 - phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE); 630 631 config_genmii_advert(mii_info); 632 /* Start/Restart aneg */ ··· 657 ugphy_vdbg("%s: IN", __FUNCTION__); 658 659 /* Clear the interrupts by reading the reg */ 660 - phy_read(mii_info, MII_DM9161_INTR); 661 662 663 return 0; ··· 668 ugphy_vdbg("%s: IN", __FUNCTION__); 669 670 if (mii_info->interrupts == MII_INTERRUPT_ENABLED) 671 - phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT); 672 else 673 - phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP); 674 675 return 0; 676 } ··· 741 NULL 742 }; 743 744 - u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum) 745 - { 746 - u16 retval; 747 - unsigned long flags; 748 - 749 - ugphy_vdbg("%s: IN", __FUNCTION__); 750 - 751 - spin_lock_irqsave(&mii_info->mdio_lock, flags); 752 - retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id, regnum); 753 - spin_unlock_irqrestore(&mii_info->mdio_lock, flags); 754 - 755 - return retval; 756 - } 757 - 758 - void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val) 759 - { 760 - unsigned long flags; 761 - 762 - ugphy_vdbg("%s: IN", __FUNCTION__); 763 - 764 - spin_lock_irqsave(&mii_info->mdio_lock, flags); 765 - mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val); 766 - spin_unlock_irqrestore(&mii_info->mdio_lock, flags); 767 - } 768 - 769 /* Use the PHY ID registers to determine what type of PHY is attached 770 * to device dev. return a struct phy_info structure describing that PHY 771 */ ··· 755 ugphy_vdbg("%s: IN", __FUNCTION__); 756 757 /* Grab the bits from PHYIR1, and put them in the upper half */ 758 - phy_reg = phy_read(mii_info, MII_PHYSID1); 759 phy_ID = (phy_reg & 0xffff) << 16; 760 761 /* Grab the bits from PHYIR2, and put them in the lower half */ 762 - phy_reg = phy_read(mii_info, MII_PHYSID2); 763 phy_ID |= (phy_reg & 0xffff); 764 765 /* loop through all the known PHY types, and find one that */
··· 68 static int genmii_config_aneg(struct ugeth_mii_info *mii_info); 69 static int genmii_update_link(struct ugeth_mii_info *mii_info); 70 static int genmii_read_status(struct ugeth_mii_info *mii_info); 71 + 72 + static u16 ucc_geth_phy_read(struct ugeth_mii_info *mii_info, u16 regnum) 73 + { 74 + u16 retval; 75 + unsigned long flags; 76 + 77 + ugphy_vdbg("%s: IN", __FUNCTION__); 78 + 79 + spin_lock_irqsave(&mii_info->mdio_lock, flags); 80 + retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id, regnum); 81 + spin_unlock_irqrestore(&mii_info->mdio_lock, flags); 82 + 83 + return retval; 84 + } 85 + 86 + static void ucc_geth_phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val) 87 + { 88 + unsigned long flags; 89 + 90 + ugphy_vdbg("%s: IN", __FUNCTION__); 91 + 92 + spin_lock_irqsave(&mii_info->mdio_lock, flags); 93 + mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val); 94 + spin_unlock_irqrestore(&mii_info->mdio_lock, flags); 95 + } 96 97 /* Write value to the PHY for this device to the register at regnum, */ 98 /* waiting until the write is done before it returns. All PHY */ ··· 184 advertise = mii_info->advertising; 185 186 /* Setup standard advertisement */ 187 + adv = ucc_geth_phy_read(mii_info, MII_ADVERTISE); 188 adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4); 189 if (advertise & ADVERTISED_10baseT_Half) 190 adv |= ADVERTISE_10HALF; ··· 194 adv |= ADVERTISE_100HALF; 195 if (advertise & ADVERTISED_100baseT_Full) 196 adv |= ADVERTISE_100FULL; 197 + ucc_geth_phy_write(mii_info, MII_ADVERTISE, adv); 198 } 199 200 static void genmii_setup_forced(struct ugeth_mii_info *mii_info) ··· 204 205 ugphy_vdbg("%s: IN", __FUNCTION__); 206 207 + ctrl = ucc_geth_phy_read(mii_info, MII_BMCR); 208 209 ctrl &= 210 ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE); ··· 234 break; 235 } 236 237 + ucc_geth_phy_write(mii_info, MII_BMCR, ctrl); 238 } 239 240 /* Enable and Restart Autonegotiation */ ··· 244 245 ugphy_vdbg("%s: IN", __FUNCTION__); 246 247 + ctl = ucc_geth_phy_read(mii_info, MII_BMCR); 248 ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); 249 + ucc_geth_phy_write(mii_info, MII_BMCR, ctl); 250 } 251 252 static int gbit_config_aneg(struct ugeth_mii_info *mii_info) ··· 261 config_genmii_advert(mii_info); 262 advertise = mii_info->advertising; 263 264 + adv = ucc_geth_phy_read(mii_info, MII_1000BASETCONTROL); 265 adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP | 266 MII_1000BASETCONTROL_HALFDUPLEXCAP); 267 if (advertise & SUPPORTED_1000baseT_Half) 268 adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP; 269 if (advertise & SUPPORTED_1000baseT_Full) 270 adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP; 271 + ucc_geth_phy_write(mii_info, MII_1000BASETCONTROL, adv); 272 273 /* Start/Restart aneg */ 274 genmii_restart_aneg(mii_info); ··· 298 ugphy_vdbg("%s: IN", __FUNCTION__); 299 300 /* Do a fake read */ 301 + ucc_geth_phy_read(mii_info, MII_BMSR); 302 303 /* Read link and autonegotiation status */ 304 + status = ucc_geth_phy_read(mii_info, MII_BMSR); 305 if ((status & BMSR_LSTATUS) == 0) 306 mii_info->link = 0; 307 else ··· 329 return err; 330 331 if (mii_info->autoneg) { 332 + status = ucc_geth_phy_read(mii_info, MII_LPA); 333 334 if (status & (LPA_10FULL | LPA_100FULL)) 335 mii_info->duplex = DUPLEX_FULL; ··· 352 { 353 ugphy_vdbg("%s: IN", __FUNCTION__); 354 355 + ucc_geth_phy_write(mii_info, 0x14, 0x0cd2); 356 + ucc_geth_phy_write(mii_info, MII_BMCR, 357 + ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); 358 msleep(4000); 359 360 return 0; ··· 367 /* The Marvell PHY has an errata which requires 368 * that certain registers get written in order 369 * to restart autonegotiation */ 370 + ucc_geth_phy_write(mii_info, MII_BMCR, BMCR_RESET); 371 372 + ucc_geth_phy_write(mii_info, 0x1d, 0x1f); 373 + ucc_geth_phy_write(mii_info, 0x1e, 0x200c); 374 + ucc_geth_phy_write(mii_info, 0x1d, 0x5); 375 + ucc_geth_phy_write(mii_info, 0x1e, 0); 376 + ucc_geth_phy_write(mii_info, 0x1e, 0x100); 377 378 gbit_config_aneg(mii_info); 379 ··· 398 * are as set */ 399 if (mii_info->autoneg && mii_info->link) { 400 int speed; 401 + status = ucc_geth_phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS); 402 403 /* Get the duplexity */ 404 if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX) ··· 430 ugphy_vdbg("%s: IN", __FUNCTION__); 431 432 /* Clear the interrupts by reading the reg */ 433 + ucc_geth_phy_read(mii_info, MII_M1011_IEVENT); 434 435 return 0; 436 } ··· 440 ugphy_vdbg("%s: IN", __FUNCTION__); 441 442 if (mii_info->interrupts == MII_INTERRUPT_ENABLED) 443 + ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT); 444 else 445 + ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR); 446 447 return 0; 448 } ··· 451 { 452 ugphy_vdbg("%s: IN", __FUNCTION__); 453 454 + ucc_geth_phy_write(mii_info, MII_CIS8201_AUX_CONSTAT, 455 MII_CIS8201_AUXCONSTAT_INIT); 456 + ucc_geth_phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT); 457 458 return 0; 459 } ··· 477 if (mii_info->autoneg && mii_info->link) { 478 int speed; 479 480 + status = ucc_geth_phy_read(mii_info, MII_CIS8201_AUX_CONSTAT); 481 if (status & MII_CIS8201_AUXCONSTAT_DUPLEX) 482 mii_info->duplex = DUPLEX_FULL; 483 else ··· 505 { 506 ugphy_vdbg("%s: IN", __FUNCTION__); 507 508 + ucc_geth_phy_read(mii_info, MII_CIS8201_ISTAT); 509 510 return 0; 511 } ··· 515 ugphy_vdbg("%s: IN", __FUNCTION__); 516 517 if (mii_info->interrupts == MII_INTERRUPT_ENABLED) 518 + ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK); 519 else 520 + ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, 0); 521 522 return 0; 523 } ··· 541 /* If we aren't autonegotiating, assume speeds 542 * are as set */ 543 if (mii_info->autoneg && mii_info->link) { 544 + status = ucc_geth_phy_read(mii_info, MII_DM9161_SCSR); 545 if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H)) 546 mii_info->speed = SPEED_100; 547 else ··· 572 { 573 struct ugeth_mii_info *mii_info = (struct ugeth_mii_info *)data; 574 struct dm9161_private *priv = mii_info->priv; 575 + u16 status = ucc_geth_phy_read(mii_info, MII_BMSR); 576 577 ugphy_vdbg("%s: IN", __FUNCTION__); 578 ··· 599 /* Reset is not done yet */ 600 priv->resetdone = 0; 601 602 + ucc_geth_phy_write(mii_info, MII_BMCR, 603 + ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); 604 605 + ucc_geth_phy_write(mii_info, MII_BMCR, 606 + ucc_geth_phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE); 607 608 config_genmii_advert(mii_info); 609 /* Start/Restart aneg */ ··· 634 ugphy_vdbg("%s: IN", __FUNCTION__); 635 636 /* Clear the interrupts by reading the reg */ 637 + ucc_geth_phy_read(mii_info, MII_DM9161_INTR); 638 639 640 return 0; ··· 645 ugphy_vdbg("%s: IN", __FUNCTION__); 646 647 if (mii_info->interrupts == MII_INTERRUPT_ENABLED) 648 + ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT); 649 else 650 + ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP); 651 652 return 0; 653 } ··· 718 NULL 719 }; 720 721 /* Use the PHY ID registers to determine what type of PHY is attached 722 * to device dev. return a struct phy_info structure describing that PHY 723 */ ··· 757 ugphy_vdbg("%s: IN", __FUNCTION__); 758 759 /* Grab the bits from PHYIR1, and put them in the upper half */ 760 + phy_reg = ucc_geth_phy_read(mii_info, MII_PHYSID1); 761 phy_ID = (phy_reg & 0xffff) << 16; 762 763 /* Grab the bits from PHYIR2, and put them in the lower half */ 764 + phy_reg = ucc_geth_phy_read(mii_info, MII_PHYSID2); 765 phy_ID |= (phy_reg & 0xffff); 766 767 /* loop through all the known PHY types, and find one that */
+7 -4
drivers/net/wireless/bcm43xx/bcm43xx_main.c
··· 2701 sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); 2702 2703 /* extract core_id, core_rev, core_vendor */ 2704 - core_id = (sb_id_hi & 0xFFF0) >> 4; 2705 - core_rev = (sb_id_hi & 0xF); 2706 core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; 2707 2708 dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x\n", ··· 2873 sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); 2874 sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; 2875 sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; 2876 - sbimconfiglow |= 0x32; 2877 bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); 2878 } 2879 ··· 3080 if (err) 3081 goto out; 3082 3083 - if (bcm->current_core->rev < 6 || 3084 bcm->current_core->id == BCM43xx_COREID_PCI) { 3085 value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); 3086 value |= (1 << backplane_flag_nr);
··· 2701 sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); 2702 2703 /* extract core_id, core_rev, core_vendor */ 2704 + core_id = (sb_id_hi & 0x8FF0) >> 4; 2705 + core_rev = ((sb_id_hi & 0xF) | ((sb_id_hi & 0x7000) >> 8)); 2706 core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; 2707 2708 dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x\n", ··· 2873 sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); 2874 sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; 2875 sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; 2876 + if (bcm->bustype == BCM43xx_BUSTYPE_PCI) 2877 + sbimconfiglow |= 0x32; 2878 + else 2879 + sbimconfiglow |= 0x53; 2880 bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); 2881 } 2882 ··· 3077 if (err) 3078 goto out; 3079 3080 + if (bcm->current_core->rev < 6 && 3081 bcm->current_core->id == BCM43xx_COREID_PCI) { 3082 value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); 3083 value |= (1 << backplane_flag_nr);