Commit 84c3ea01 authored by Jochen Friedrich's avatar Jochen Friedrich Committed by Jeff Garzik

[netdrvr] Convert madgemc to new MCA API.

Now that all tms380 devices have a valid
struct device with dma_mask, remove dmalimit from tmsdev_init().

Kconfig: depend tms380tr and madgemc on MCA.
abyss.c, proteon.c, skisa.c, tmspci.c, tms380tr.h:
  remove dmalimit parameter from tmsdev_init().
tms380tr.c: use device->dma_mask instead of dmalimit.
madgemc.c: move to new MCA API using struct device.
Signed-off-by: default avatarJochen Friedrich <jochen@scram.de>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 9f7f0098
...@@ -84,7 +84,7 @@ config 3C359 ...@@ -84,7 +84,7 @@ config 3C359
config TMS380TR config TMS380TR
tristate "Generic TMS380 Token Ring ISA/PCI adapter support" tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
depends on TR && (PCI || ISA) depends on TR && (PCI || ISA || MCA)
select FW_LOADER select FW_LOADER
---help--- ---help---
This driver provides generic support for token ring adapters This driver provides generic support for token ring adapters
...@@ -158,7 +158,7 @@ config ABYSS ...@@ -158,7 +158,7 @@ config ABYSS
config MADGEMC config MADGEMC
tristate "Madge Smart 16/4 Ringnode MicroChannel" tristate "Madge Smart 16/4 Ringnode MicroChannel"
depends on TR && TMS380TR && MCA_LEGACY depends on TR && TMS380TR && MCA
help help
This tms380 module supports the Madge Smart 16/4 MC16 and MC32 This tms380 module supports the Madge Smart 16/4 MC16 and MC32
MicroChannel adapters. MicroChannel adapters.
......
...@@ -139,7 +139,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_ ...@@ -139,7 +139,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
*/ */
dev->base_addr += 0x10; dev->base_addr += 0x10;
ret = tmsdev_init(dev, PCI_MAX_ADDRESS, &pdev->dev); ret = tmsdev_init(dev, &pdev->dev);
if (ret) { if (ret) {
printk("%s: unable to get memory for dev->priv.\n", printk("%s: unable to get memory for dev->priv.\n",
dev->name); dev->name);
......
This diff is collapsed.
...@@ -145,7 +145,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev) ...@@ -145,7 +145,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
err = -EIO; err = -EIO;
pdev->dma_mask = &dma_mask; pdev->dma_mask = &dma_mask;
if (tmsdev_init(dev, ISA_MAX_ADDRESS, pdev)) if (tmsdev_init(dev, pdev))
goto out4; goto out4;
dev->base_addr &= ~3; dev->base_addr &= ~3;
......
...@@ -162,7 +162,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev) ...@@ -162,7 +162,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
err = -EIO; err = -EIO;
pdev->dma_mask = &dma_mask; pdev->dma_mask = &dma_mask;
if (tmsdev_init(dev, ISA_MAX_ADDRESS, pdev)) if (tmsdev_init(dev, pdev))
goto out4; goto out4;
dev->base_addr &= ~3; dev->base_addr &= ~3;
......
...@@ -2333,19 +2333,22 @@ void tmsdev_term(struct net_device *dev) ...@@ -2333,19 +2333,22 @@ void tmsdev_term(struct net_device *dev)
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
} }
int tmsdev_init(struct net_device *dev, unsigned long dmalimit, int tmsdev_init(struct net_device *dev, struct device *pdev)
struct device *pdev)
{ {
struct net_local *tms_local; struct net_local *tms_local;
memset(dev->priv, 0, sizeof(struct net_local)); memset(dev->priv, 0, sizeof(struct net_local));
tms_local = netdev_priv(dev); tms_local = netdev_priv(dev);
init_waitqueue_head(&tms_local->wait_for_tok_int); init_waitqueue_head(&tms_local->wait_for_tok_int);
tms_local->dmalimit = dmalimit; if (pdev->dma_mask)
tms_local->dmalimit = *pdev->dma_mask;
else
return -ENOMEM;
tms_local->pdev = pdev; tms_local->pdev = pdev;
tms_local->dmabuffer = dma_map_single(pdev, (void *)tms_local, tms_local->dmabuffer = dma_map_single(pdev, (void *)tms_local,
sizeof(struct net_local), DMA_BIDIRECTIONAL); sizeof(struct net_local), DMA_BIDIRECTIONAL);
if (tms_local->dmabuffer + sizeof(struct net_local) > dmalimit) if (tms_local->dmabuffer + sizeof(struct net_local) >
tms_local->dmalimit)
{ {
printk(KERN_INFO "%s: Memory not accessible for DMA\n", printk(KERN_INFO "%s: Memory not accessible for DMA\n",
dev->name); dev->name);
......
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
int tms380tr_open(struct net_device *dev); int tms380tr_open(struct net_device *dev);
int tms380tr_close(struct net_device *dev); int tms380tr_close(struct net_device *dev);
irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs); irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs);
int tmsdev_init(struct net_device *dev, unsigned long dmalimit, int tmsdev_init(struct net_device *dev, struct device *pdev);
struct device *pdev);
void tmsdev_term(struct net_device *dev); void tmsdev_term(struct net_device *dev);
void tms380tr_wait(unsigned long time); void tms380tr_wait(unsigned long time);
......
...@@ -143,7 +143,7 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic ...@@ -143,7 +143,7 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic
printk(":%2.2x", dev->dev_addr[i]); printk(":%2.2x", dev->dev_addr[i]);
printk("\n"); printk("\n");
ret = tmsdev_init(dev, PCI_MAX_ADDRESS, &pdev->dev); ret = tmsdev_init(dev, &pdev->dev);
if (ret) { if (ret) {
printk("%s: unable to get memory for dev->priv.\n", dev->name); printk("%s: unable to get memory for dev->priv.\n", dev->name);
goto err_out_irq; goto err_out_irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment