diff options
Diffstat (limited to 'target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx')
4 files changed, 40 insertions, 16 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c index 49f077520..9a51f786f 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c @@ -209,6 +209,7 @@ #define AR934X_REG_OPER_MODE1_PHY4_MII_EN BIT(28) #define AR934X_REG_FLOOD_MASK 0x2c +#define AR934X_FLOOD_MASK_MC_DP(_p) BIT(16 + (_p)) #define AR934X_FLOOD_MASK_BC_DP(_p) BIT(25 + (_p)) #define AR934X_REG_QM_CTRL 0x3c @@ -580,9 +581,10 @@ static void ar7240sw_setup(struct ar7240sw *as) /* Enable ARP frame acknowledge */ ar7240sw_reg_set(mii, AR934X_REG_QM_CTRL, AR934X_QM_CTRL_ARP_EN); - /* Enable Broadcast frames transmitted to the CPU */ + /* Enable Broadcast/Multicast frames transmitted to the CPU */ ar7240sw_reg_set(mii, AR934X_REG_FLOOD_MASK, - AR934X_FLOOD_MASK_BC_DP(0)); + AR934X_FLOOD_MASK_BC_DP(0) | + AR934X_FLOOD_MASK_MC_DP(0)); /* Enable MIB counters */ ar7240sw_reg_set(mii, AR7240_REG_MIB_FUNCTION0, @@ -1163,7 +1165,7 @@ void ag71xx_ar7240_stop(struct ag71xx *ag) cancel_delayed_work_sync(&ag->link_work); } -int __devinit ag71xx_ar7240_init(struct ag71xx *ag) +int ag71xx_ar7240_init(struct ag71xx *ag) { struct ar7240sw *as; diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index fb99d2728..50029ffaf 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -891,7 +891,7 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit) dev->stats.rx_packets++; dev->stats.rx_bytes += pktlen; - skb = build_skb(ring->buf[i].rx_buf); + skb = build_skb(ring->buf[i].rx_buf, 0); if (!skb) { kfree(ring->buf[i].rx_buf); goto next; @@ -1056,7 +1056,28 @@ static const struct net_device_ops ag71xx_netdev_ops = { #endif }; -static int __devinit ag71xx_probe(struct platform_device *pdev) +static const char *ag71xx_get_phy_if_mode_name(phy_interface_t mode) +{ + switch (mode) { + case PHY_INTERFACE_MODE_MII: + return "MII"; + case PHY_INTERFACE_MODE_GMII: + return "GMII"; + case PHY_INTERFACE_MODE_RMII: + return "RMII"; + case PHY_INTERFACE_MODE_RGMII: + return "RGMII"; + case PHY_INTERFACE_MODE_SGMII: + return "SGMII"; + default: + break; + } + + return "unknown"; +} + + +static int ag71xx_probe(struct platform_device *pdev) { struct net_device *dev; struct resource *res; @@ -1071,7 +1092,7 @@ static int __devinit ag71xx_probe(struct platform_device *pdev) goto err_out; } - if (pdata->mii_bus_dev == NULL) { + if (pdata->mii_bus_dev == NULL && pdata->phy_mask) { dev_err(&pdev->dev, "no MII bus device specified\n"); err = -EINVAL; goto err_out; @@ -1149,8 +1170,9 @@ static int __devinit ag71xx_probe(struct platform_device *pdev) goto err_free_desc; } - pr_info("%s: Atheros AG71xx at 0x%08lx, irq %d\n", - dev->name, dev->base_addr, dev->irq); + pr_info("%s: Atheros AG71xx at 0x%08lx, irq %d, mode:%s\n", + dev->name, dev->base_addr, dev->irq, + ag71xx_get_phy_if_mode_name(pdata->phy_if_mode)); ag71xx_dump_regs(ag); @@ -1188,7 +1210,7 @@ err_out: return err; } -static int __devexit ag71xx_remove(struct platform_device *pdev) +static int ag71xx_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); @@ -1209,7 +1231,7 @@ static int __devexit ag71xx_remove(struct platform_device *pdev) static struct platform_driver ag71xx_driver = { .probe = ag71xx_probe, - .remove = __exit_p(ag71xx_remove), + .remove = ag71xx_remove, .driver = { .name = AG71XX_DRV_NAME, } diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c index e123505c7..ec8823341 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c @@ -205,7 +205,7 @@ static int ag71xx_mdio_write(struct mii_bus *bus, int addr, int reg, u16 val) return 0; } -static int __devinit ag71xx_mdio_probe(struct platform_device *pdev) +static int ag71xx_mdio_probe(struct platform_device *pdev) { struct ag71xx_mdio_platform_data *pdata; struct ag71xx_mdio *am; @@ -281,7 +281,7 @@ err_out: return err; } -static int __devexit ag71xx_mdio_remove(struct platform_device *pdev) +static int ag71xx_mdio_remove(struct platform_device *pdev) { struct ag71xx_mdio *am = platform_get_drvdata(pdev); @@ -298,7 +298,7 @@ static int __devexit ag71xx_mdio_remove(struct platform_device *pdev) static struct platform_driver ag71xx_mdio_driver = { .probe = ag71xx_mdio_probe, - .remove = __exit_p(ag71xx_mdio_remove), + .remove = ag71xx_mdio_remove, .driver = { .name = "ag71xx-mdio", } diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c index ebdbc5b9a..71f0b1d3c 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c @@ -48,7 +48,7 @@ void ag71xx_phy_start(struct ag71xx *ag) if (ag->phy_dev) { phy_start(ag->phy_dev); - } else if (pdata->switch_data) { + } else if (pdata->mii_bus_dev && pdata->switch_data) { ag71xx_ar7240_start(ag); } else { ag->link = 1; @@ -63,7 +63,7 @@ void ag71xx_phy_stop(struct ag71xx *ag) if (ag->phy_dev) phy_stop(ag->phy_dev); - else if (pdata->switch_data) + else if (pdata->mii_bus_dev && pdata->switch_data) ag71xx_ar7240_stop(ag); spin_lock_irqsave(&ag->lock, flags); @@ -193,7 +193,7 @@ static struct mii_bus *dev_to_mii_bus(struct device *dev) return NULL; } -int __devinit ag71xx_phy_connect(struct ag71xx *ag) +int ag71xx_phy_connect(struct ag71xx *ag) { struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag); |