summaryrefslogtreecommitdiffstats
path: root/drivers/net/cs8900.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cs8900.c')
-rw-r--r--drivers/net/cs8900.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
index 75bbbd79e1..0dfd3f1303 100644
--- a/drivers/net/cs8900.c
+++ b/drivers/net/cs8900.c
@@ -180,6 +180,7 @@ struct cs8900_priv {
void *regs;
struct cs89x0_product *product;
struct cs89x0_chip *chip;
+ void *rx_buf;
};
/* Read a 16-bit value from PacketPage Memory using I/O Space operation */
@@ -294,13 +295,13 @@ static int cs8900_recv(struct eth_device *dev)
status = readw(priv->regs + CS8900_RTDATA0);
len = readw(priv->regs + CS8900_RTDATA0);
- for (addr = (u16 *) NetRxPackets[0], i = len >> 1; i > 0; i--) {
+ for (addr = (u16 *)priv->rx_buf, i = len >> 1; i > 0; i--) {
*addr++ = readw(priv->regs + CS8900_RTDATA0);
}
if (len & 1) {
*addr++ = readw(priv->regs + CS8900_RTDATA0);
}
- net_receive(dev, NetRxPackets[0], len);
+ net_receive(dev, priv->rx_buf, len);
return len;
}
@@ -349,7 +350,7 @@ static const char *yesno_str(int v)
return v ? "yes" : "no";
}
-static void cs8900_info(struct device_d *dev)
+static void cs8900_info(struct device *dev)
{
struct eth_device *edev = dev_to_edev(dev);
struct cs8900_priv *priv = (struct cs8900_priv *)edev->priv;
@@ -424,7 +425,7 @@ static int cs8900_check_id(struct cs8900_priv *priv)
return result;
}
-static int cs8900_probe(struct device_d *dev)
+static int cs8900_probe(struct device *dev)
{
struct resource *iores;
struct eth_device *edev;
@@ -442,6 +443,8 @@ static int cs8900_probe(struct device_d *dev)
return -1;
}
+ priv->rx_buf = xmalloc(PKTSIZE);
+
edev = (struct eth_device *)xmalloc(sizeof(struct eth_device));
edev->priv = priv;
@@ -460,7 +463,7 @@ static int cs8900_probe(struct device_d *dev)
return 0;
}
-static struct driver_d cs8900_driver = {
+static struct driver cs8900_driver = {
.name = "cs8900",
.probe = cs8900_probe,
};