diff options
Diffstat (limited to 'drivers/net/ks8851_mll.c')
-rw-r--r-- | drivers/net/ks8851_mll.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c index b037e19633..2120657bd9 100644 --- a/drivers/net/ks8851_mll.c +++ b/drivers/net/ks8851_mll.c @@ -353,7 +353,6 @@ * struct ks_net - KS8851 driver private data * @hw_addr : start address of data register. * @hw_addr_cmd : start address of command register. - * @pdev : Pointer to platform device. * @bus_width : i/o bus width. * @extra_byte : number of extra byte prepended rx pkt. * @@ -364,8 +363,8 @@ struct ks_net { struct mii_bus miibus; void __iomem *hw_addr; void __iomem *hw_addr_cmd; - struct platform_device *pdev; int bus_width; + void *rx_buf; }; #define BE3 0x8000 /* Byte Enable 3 */ @@ -592,7 +591,7 @@ static void ks_soft_reset(struct ks_net *ks, unsigned op) */ static int ks_read_selftest(struct ks_net *ks) { - struct device_d *dev = &ks->edev.dev; + struct device *dev = &ks->edev.dev; unsigned both_done = MBIR_TXMBF | MBIR_RXMBF; int ret = 0; unsigned rd; @@ -658,8 +657,7 @@ static void ks_setup(struct ks_net *ks) static int ks8851_rx_frame(struct ks_net *ks) { - struct device_d *dev = &ks->edev.dev; - u16 *rdptr = (u16 *) NetRxPackets[0]; + struct device *dev = &ks->edev.dev; u16 RxStatus, RxLen = 0; u16 tmp_rxqcr; @@ -679,14 +677,14 @@ static int ks8851_rx_frame(struct ks_net *ks) tmp_rxqcr = ks_rdreg16(ks, KS_RXQCR); ks_wrreg16(ks, KS_RXQCR, tmp_rxqcr | RXQCR_SDA); /* read 2 bytes for dummy, 2 for status, 2 for len*/ - ks_inblk(ks, rdptr, 2 + 2 + 2); - ks_inblk(ks, rdptr, ALIGN(RxLen, 4)); + ks_inblk(ks, ks->rx_buf, 2 + 2 + 2); + ks_inblk(ks, ks->rx_buf, ALIGN(RxLen, 4)); ks_wrreg16(ks, KS_RXQCR, tmp_rxqcr); if (RxStatus & RXFSHR_RXFV) { /* Pass to upper layer */ dev_dbg(dev, "passing packet to upper layer\n\n"); - net_receive(&ks->edev, NetRxPackets[0], RxLen); + net_receive(&ks->edev, ks->rx_buf, RxLen); return RxLen; } else if (RxStatus & RXFSHR_ERR) { dev_err(dev, "RxStatus error 0x%04x\n", RxStatus & RXFSHR_ERR); @@ -712,7 +710,7 @@ static int ks8851_rx_frame(struct ks_net *ks) static int ks8851_eth_rx(struct eth_device *edev) { struct ks_net *ks = (struct ks_net *)edev->priv; - struct device_d *dev = &edev->dev; + struct device *dev = &edev->dev; u16 frame_cnt; if (!(ks_rdreg16(ks, KS_ISR) & IRQ_RXI)) @@ -733,7 +731,7 @@ static int ks8851_eth_send(struct eth_device *edev, void *packet, int length) { struct ks_net *ks = (struct ks_net *)edev->priv; - struct device_d *dev = &edev->dev; + struct device *dev = &edev->dev; uint64_t tmo; u16 tmp_rxqcr; @@ -769,7 +767,7 @@ static int ks8851_eth_send(struct eth_device *edev, static int ks8851_eth_open(struct eth_device *edev) { struct ks_net *priv = (struct ks_net *)edev->priv; - struct device_d *dev = &edev->dev; + struct device *dev = &edev->dev; int ret; ks_enable_qmu(priv); @@ -792,14 +790,14 @@ static int ks8851_init_dev(struct eth_device *edev) static void ks8851_eth_halt(struct eth_device *edev) { struct ks_net *priv = (struct ks_net *)edev->priv; - struct device_d *dev = &edev->dev; + struct device *dev = &edev->dev; ks_disable_qmu(priv); dev_dbg(dev, "eth_halt\n"); } -static int ks8851_probe(struct device_d *dev) +static int ks8851_probe(struct device *dev) { struct resource *iores; struct eth_device *edev; @@ -827,6 +825,7 @@ static int ks8851_probe(struct device_d *dev) ks->hw_addr_cmd = IOMEM(iores->start); ks->bus_width = dev->resource[0].flags & IORESOURCE_MEM_TYPE_MASK; + ks->rx_buf = xmalloc(PKTSIZE); edev->init = ks8851_init_dev; edev->open = ks8851_eth_open; @@ -871,7 +870,7 @@ static int ks8851_probe(struct device_d *dev) return 0; } -static struct driver_d ks8851_driver = { +static struct driver ks8851_driver = { .name = "ks8851_mll", .probe = ks8851_probe, }; |