diff options
Diffstat (limited to 'drivers/net/smc91111.c')
-rw-r--r-- | drivers/net/smc91111.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c index d503535c25..4bbb2a3dee 100644 --- a/drivers/net/smc91111.c +++ b/drivers/net/smc91111.c @@ -440,12 +440,12 @@ struct smc91c111_priv { struct mii_bus miibus; struct accessors a; void __iomem *base; - int qemu_fixup; unsigned shift; int version; int revision; unsigned int control_setup; unsigned int config_setup; + void *rx_buf; }; #if (SMC_DEBUG > 2 ) @@ -1047,7 +1047,8 @@ static int smc91c111_eth_open(struct eth_device *edev) if (ret) return ret; - if (priv->qemu_fixup && edev->phydev->phy_id == 0x00000000) { + if (of_machine_is_compatible("arm,versatile-pb") || + of_machine_is_compatible("arm,versatile-ab")) { struct phy_device *dev = edev->phydev; dev->speed = SPEED_100; @@ -1302,14 +1303,14 @@ static int smc91c111_eth_rx(struct eth_device *edev) to send the DWORDs or the bytes first, or some mixture. A mixture might improve already slow PIO performance */ - SMC_insl(priv, SMC91111_DATA_REG , NetRxPackets[0], + SMC_insl(priv, SMC91111_DATA_REG , priv->rx_buf, packet_length >> 2); /* read the left over bytes */ if (packet_length & 3) { int i; unsigned char *tail = - (unsigned char *)(NetRxPackets[0] + + (unsigned char *)(priv->rx_buf + (packet_length & ~3)); unsigned long leftover = SMC_inl(priv, SMC91111_DATA_REG); @@ -1320,7 +1321,7 @@ static int smc91c111_eth_rx(struct eth_device *edev) #if SMC_DEBUG > 2 printf("Receiving Packet\n"); - print_packet( NetRxPackets[0], packet_length ); + print_packet(priv->rx_buf, packet_length ); #endif } else { /* error ... */ @@ -1343,7 +1344,7 @@ static int smc91c111_eth_rx(struct eth_device *edev) if (!is_error) { /* Pass the packet up to the protocol layers. */ - net_receive(edev, NetRxPackets[0], packet_length); + net_receive(edev, priv->rx_buf, packet_length); return 0; } @@ -1433,7 +1434,7 @@ static int smc91c111_init_dev(struct eth_device *edev) return 0; } -static int smc91c111_probe(struct device_d *dev) +static int smc91c111_probe(struct device *dev) { struct resource *iores; struct eth_device *edev; @@ -1445,11 +1446,11 @@ static int smc91c111_probe(struct device_d *dev) priv = edev->priv; priv->a = access_via_32bit; + priv->rx_buf = xmalloc(PKTSIZE); if (dev->platform_data) { struct smc91c111_pdata *pdata = dev->platform_data; - priv->qemu_fixup = pdata->qemu_fixup; priv->shift = pdata->addr_shift; if (pdata->bus_width == 16) priv->a = access_via_16bit; @@ -1487,8 +1488,18 @@ static int smc91c111_probe(struct device_d *dev) return 0; } -static struct driver_d smc91c111_driver = { - .name = "smc91c111", - .probe = smc91c111_probe, +static __maybe_unused struct of_device_id smc91c111_dt_ids[] = { + { + .compatible = "smsc,lan91c111", + }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, smc91c111_dt_ids); +MODULE_DEVICE_TABLE(of, smc91c111_dt_ids); + +static struct driver smc91c111_driver = { + .of_compatible = DRV_OF_COMPAT(smc91c111_dt_ids), + .name = "smc91c111", + .probe = smc91c111_probe, }; device_platform_driver(smc91c111_driver); |