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
config TMS380TR
tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
depends on TR && (PCI || ISA)
depends on TR && (PCI || ISA || MCA)
select FW_LOADER
---help---
This driver provides generic support for token ring adapters
......@@ -158,7 +158,7 @@ config ABYSS
config MADGEMC
tristate "Madge Smart 16/4 Ringnode MicroChannel"
depends on TR && TMS380TR && MCA_LEGACY
depends on TR && TMS380TR && MCA
help
This tms380 module supports the Madge Smart 16/4 MC16 and MC32
MicroChannel adapters.
......
......@@ -139,7 +139,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
*/
dev->base_addr += 0x10;
ret = tmsdev_init(dev, PCI_MAX_ADDRESS, &pdev->dev);
ret = tmsdev_init(dev, &pdev->dev);
if (ret) {
printk("%s: unable to get memory for dev->priv.\n",
dev->name);
......
This diff is collapsed.
......@@ -145,7 +145,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
err = -EIO;
pdev->dma_mask = &dma_mask;
if (tmsdev_init(dev, ISA_MAX_ADDRESS, pdev))
if (tmsdev_init(dev, pdev))
goto out4;
dev->base_addr &= ~3;
......
......@@ -162,7 +162,7 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
err = -EIO;
pdev->dma_mask = &dma_mask;
if (tmsdev_init(dev, ISA_MAX_ADDRESS, pdev))
if (tmsdev_init(dev, pdev))
goto out4;
dev->base_addr &= ~3;
......
......@@ -2333,19 +2333,22 @@ void tmsdev_term(struct net_device *dev)
DMA_BIDIRECTIONAL);
}
int tmsdev_init(struct net_device *dev, unsigned long dmalimit,
struct device *pdev)
int tmsdev_init(struct net_device *dev, struct device *pdev)
{
struct net_local *tms_local;
memset(dev->priv, 0, sizeof(struct net_local));
tms_local = netdev_priv(dev);
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->dmabuffer = dma_map_single(pdev, (void *)tms_local,
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",
dev->name);
......
......@@ -17,8 +17,7 @@
int tms380tr_open(struct net_device *dev);
int tms380tr_close(struct net_device *dev);
irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs);
int tmsdev_init(struct net_device *dev, unsigned long dmalimit,
struct device *pdev);
int tmsdev_init(struct net_device *dev, struct device *pdev);
void tmsdev_term(struct net_device *dev);
void tms380tr_wait(unsigned long time);
......
......@@ -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("\n");
ret = tmsdev_init(dev, PCI_MAX_ADDRESS, &pdev->dev);
ret = tmsdev_init(dev, &pdev->dev);
if (ret) {
printk("%s: unable to get memory for dev->priv.\n", dev->name);
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