Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90379
b: refs/heads/master
c: 7f8cfd5
h: refs/heads/master
i:
  90377: 87b945b
  90375: f3fa286
v: v3
  • Loading branch information
Al Viro authored and Jeff Garzik committed Mar 26, 2008
1 parent 28fb361 commit 71093be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e06ee2bb03f936c57265e447bc05e8324db61207
refs/heads/master: 7f8cfd560875fd643024c02ea25d4f3b8f1fd31c
21 changes: 7 additions & 14 deletions trunk/drivers/net/ni52.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ static int ni52_open(struct net_device *dev)
static int check586(struct net_device *dev, unsigned size)
{
unsigned long where = dev->mem_start;
struct priv pb;
struct priv *p = /* (struct priv *) dev->priv*/ &pb;
struct priv *p = dev->priv;
char __iomem *iscp_addrs[2];
int i;

p->mapped = (char __iomem *)isa_bus_to_virt(where);
p->base = p->mapped + size - 0x01000000;
p->memtop = p->mapped + size;
p->scp = (struct scp_struct __iomem *)(p->base + SCP_DEFAULT_ADDRESS);
p->scb = (struct scb_struct __iomem *) p->mapped;
memset_io(p->scp, 0, sizeof(struct scp_struct));
for (i = 0; i < sizeof(struct scp_struct); i++)
/* memory was writeable? */
Expand All @@ -335,6 +335,9 @@ static int check586(struct net_device *dev, unsigned size)
if (readb(&p->iscp->busy))
return 0;
}

p->iscp = (struct iscp_struct __iomem *)
((char __iomem *)p->scp - sizeof(struct iscp_struct));
return 1;
}

Expand All @@ -348,13 +351,6 @@ static void alloc586(struct net_device *dev)
ni_reset586();
mdelay(32);

spin_lock_init(&p->spinlock);

p->scp = (struct scp_struct __iomem *) (p->base + SCP_DEFAULT_ADDRESS);
p->scb = (struct scb_struct __iomem *) isa_bus_to_virt(dev->mem_start);
p->iscp = (struct iscp_struct __iomem *)
((char __iomem *)p->scp - sizeof(struct iscp_struct));

memset_io(p->iscp, 0, sizeof(struct iscp_struct));
memset_io(p->scp , 0, sizeof(struct scp_struct));

Expand Down Expand Up @@ -445,6 +441,8 @@ static int __init ni52_probe1(struct net_device *dev, int ioaddr)
dev->mem_start = memstart;
dev->mem_end = memend;

spin_lock_init(&priv->spinlock);

if (!request_region(ioaddr, NI52_TOTAL_SIZE, DRV_NAME))
return -EBUSY;

Expand Down Expand Up @@ -520,11 +518,6 @@ static int __init ni52_probe1(struct net_device *dev, int ioaddr)
dev->mem_end = dev->mem_start + size;
#endif

memset(priv, 0, sizeof(struct priv));

priv->mapped = (char __iomem *)isa_bus_to_virt(dev->mem_start);
priv->memtop = priv->mapped + size;
priv->base = priv->mapped + size - 0x01000000;
alloc586(dev);

/* set number of receive-buffs according to memsize */
Expand Down

0 comments on commit 71093be

Please sign in to comment.