#define TX_DMA_ERR 0x80
struct mace_data {
- volatile struct mace *mace;
- volatile struct dbdma_regs *tx_dma;
+ volatile struct mace __iomem *mace;
+ volatile struct dbdma_regs __iomem *tx_dma;
int tx_dma_intr;
- volatile struct dbdma_regs *rx_dma;
+ volatile struct dbdma_regs __iomem *rx_dma;
int rx_dma_intr;
volatile struct dbdma_cmd *tx_cmds; /* xmit dma command list */
volatile struct dbdma_cmd *rx_cmds; /* recv dma command list */
static irqreturn_t mace_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs);
static void mace_set_timeout(struct net_device *dev);
static void mace_tx_timeout(unsigned long data);
-static inline void dbdma_reset(volatile struct dbdma_regs *dma);
+static inline void dbdma_reset(volatile struct dbdma_regs __iomem *dma);
static inline void mace_clean_rings(struct mace_data *mp);
static void __mace_set_address(struct net_device *dev, void *addr);
}
-static int __devinit mace_probe(struct macio_dev *mdev, const struct of_match *match)
+static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
{
struct device_node *mace = macio_get_of_node(mdev);
struct net_device *dev;
macio_set_drvdata(mdev, dev);
dev->base_addr = macio_resource_start(mdev, 0);
- mp->mace = (volatile struct mace *)ioremap(dev->base_addr, 0x1000);
+ mp->mace = ioremap(dev->base_addr, 0x1000);
if (mp->mace == NULL) {
printk(KERN_ERR "MACE: can't map IO resources !\n");
rc = -ENOMEM;
mp = (struct mace_data *) dev->priv;
mp->maccc = ENXMT | ENRCV;
- mp->tx_dma = (volatile struct dbdma_regs *)
- ioremap(macio_resource_start(mdev, 1), 0x1000);
+ mp->tx_dma = ioremap(macio_resource_start(mdev, 1), 0x1000);
if (mp->tx_dma == NULL) {
printk(KERN_ERR "MACE: can't map TX DMA resources !\n");
rc = -ENOMEM;
}
mp->tx_dma_intr = macio_irq(mdev, 1);
- mp->rx_dma = (volatile struct dbdma_regs *)
- ioremap(macio_resource_start(mdev, 2), 0x1000);
+ mp->rx_dma = ioremap(macio_resource_start(mdev, 2), 0x1000);
if (mp->rx_dma == NULL) {
printk(KERN_ERR "MACE: can't map RX DMA resources !\n");
rc = -ENOMEM;
err_free_irq:
free_irq(macio_irq(mdev, 0), dev);
err_unmap_rx_dma:
- iounmap((void*)mp->rx_dma);
+ iounmap(mp->rx_dma);
err_unmap_tx_dma:
- iounmap((void*)mp->tx_dma);
+ iounmap(mp->tx_dma);
err_unmap_io:
- iounmap((void*)mp->mace);
+ iounmap(mp->mace);
err_free:
free_netdev(dev);
err_release:
free_irq(mp->tx_dma_intr, dev);
free_irq(mp->rx_dma_intr, dev);
- iounmap((void*)mp->rx_dma);
- iounmap((void*)mp->tx_dma);
- iounmap((void*)mp->mace);
+ iounmap(mp->rx_dma);
+ iounmap(mp->tx_dma);
+ iounmap(mp->mace);
free_netdev(dev);
return 0;
}
-static void dbdma_reset(volatile struct dbdma_regs *dma)
+static void dbdma_reset(volatile struct dbdma_regs __iomem *dma)
{
int i;
static void mace_reset(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
+ volatile struct mace __iomem *mb = mp->mace;
int i;
/* soft-reset the chip */
static void __mace_set_address(struct net_device *dev, void *addr)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
+ volatile struct mace __iomem *mb = mp->mace;
unsigned char *p = addr;
int i;
static int mace_set_address(struct net_device *dev, void *addr)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
+ volatile struct mace __iomem *mb = mp->mace;
unsigned long flags;
spin_lock_irqsave(&mp->lock, flags);
static int mace_open(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
- volatile struct dbdma_regs *rd = mp->rx_dma;
- volatile struct dbdma_regs *td = mp->tx_dma;
+ volatile struct mace __iomem *mb = mp->mace;
+ volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
+ volatile struct dbdma_regs __iomem *td = mp->tx_dma;
volatile struct dbdma_cmd *cp;
int i;
struct sk_buff *skb;
static int mace_close(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
- volatile struct dbdma_regs *rd = mp->rx_dma;
- volatile struct dbdma_regs *td = mp->tx_dma;
+ volatile struct mace __iomem *mb = mp->mace;
+ volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
+ volatile struct dbdma_regs __iomem *td = mp->tx_dma;
/* disable rx and tx */
out_8(&mb->maccc, 0);
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct dbdma_regs *td = mp->tx_dma;
+ volatile struct dbdma_regs __iomem *td = mp->tx_dma;
volatile struct dbdma_cmd *cp, *np;
unsigned long flags;
int fill, next, len;
static void mace_set_multicast(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
+ volatile struct mace __iomem *mb = mp->mace;
int i, j;
u32 crc;
unsigned long flags;
static void mace_handle_misc_intrs(struct mace_data *mp, int intr)
{
- volatile struct mace *mb = mp->mace;
+ volatile struct mace __iomem *mb = mp->mace;
static int mace_babbles, mace_jabbers;
if (intr & MPCO)
{
struct net_device *dev = (struct net_device *) dev_id;
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
- volatile struct dbdma_regs *td = mp->tx_dma;
+ volatile struct mace __iomem *mb = mp->mace;
+ volatile struct dbdma_regs __iomem *td = mp->tx_dma;
volatile struct dbdma_cmd *cp;
int intr, fs, i, stat, x;
int xcount, dstat;
{
struct net_device *dev = (struct net_device *) data;
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct mace *mb = mp->mace;
- volatile struct dbdma_regs *td = mp->tx_dma;
- volatile struct dbdma_regs *rd = mp->rx_dma;
+ volatile struct mace __iomem *mb = mp->mace;
+ volatile struct dbdma_regs __iomem *td = mp->tx_dma;
+ volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
volatile struct dbdma_cmd *cp;
unsigned long flags;
int i;
{
struct net_device *dev = (struct net_device *) dev_id;
struct mace_data *mp = (struct mace_data *) dev->priv;
- volatile struct dbdma_regs *rd = mp->rx_dma;
+ volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
volatile struct dbdma_cmd *cp, *np;
int i, nb, stat, next;
struct sk_buff *skb;
return IRQ_HANDLED;
}
-static struct of_match mace_match[] =
+static struct of_device_id mace_match[] =
{
{
.name = "mace",
- .type = OF_ANY_MATCH,
- .compatible = OF_ANY_MATCH
},
{},
};
+MODULE_DEVICE_TABLE (of, mace_match);
static struct macio_driver mace_driver =
{
{
macio_unregister_driver(&mace_driver);
- if (dummy_buf) {
- kfree(dummy_buf);
- dummy_buf = NULL;
- }
+ kfree(dummy_buf);
+ dummy_buf = NULL;
}
MODULE_AUTHOR("Paul Mackerras");