forked from Minki/linux
Merge branch 'net.b0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/bird
This commit is contained in:
commit
2746b8623a
@ -29,7 +29,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/irq.h>
|
||||
#include <asm/irq.h>
|
||||
/* Used for the temporal inet entries and routing */
|
||||
#include <linux/socket.h>
|
||||
#include <linux/bitops.h>
|
||||
|
@ -614,7 +614,7 @@ static void rebuild_rx_bufs(struct net_device *dev)
|
||||
static int init_i596_mem(struct net_device *dev)
|
||||
{
|
||||
struct i596_private *lp = dev->priv;
|
||||
#if !defined(ENABLE_MVME16x_NET) && !defined(ENABLE_BVME6000_NET)
|
||||
#if !defined(ENABLE_MVME16x_NET) && !defined(ENABLE_BVME6000_NET) || defined(ENABLE_APRICOT)
|
||||
short ioaddr = dev->base_addr;
|
||||
#endif
|
||||
unsigned long flags;
|
||||
|
@ -51,7 +51,7 @@
|
||||
struct ltfirmware
|
||||
{
|
||||
unsigned int length;
|
||||
unsigned char * data;
|
||||
const unsigned char * data;
|
||||
};
|
||||
|
||||
#define DAYNA 1
|
||||
|
@ -97,25 +97,44 @@ static int __init arcrimi_probe(struct net_device *dev)
|
||||
"must specify the shmem and irq!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
if (dev->dev_addr[0] == 0) {
|
||||
BUGMSG(D_NORMAL, "You need to specify your card's station "
|
||||
"ID!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
/*
|
||||
* Grab the memory region at mem_start for BUFFER_SIZE bytes.
|
||||
* Grab the memory region at mem_start for MIRROR_SIZE bytes.
|
||||
* Later in arcrimi_found() the real size will be determined
|
||||
* and this reserve will be released and the correct size
|
||||
* will be taken.
|
||||
*/
|
||||
if (!request_mem_region(dev->mem_start, BUFFER_SIZE, "arcnet (90xx)")) {
|
||||
if (!request_mem_region(dev->mem_start, MIRROR_SIZE, "arcnet (90xx)")) {
|
||||
BUGMSG(D_NORMAL, "Card memory already allocated\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
if (dev->dev_addr[0] == 0) {
|
||||
release_mem_region(dev->mem_start, BUFFER_SIZE);
|
||||
BUGMSG(D_NORMAL, "You need to specify your card's station "
|
||||
"ID!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
return arcrimi_found(dev);
|
||||
}
|
||||
|
||||
static int check_mirror(unsigned long addr, size_t size)
|
||||
{
|
||||
void __iomem *p;
|
||||
int res = -1;
|
||||
|
||||
if (!request_mem_region(addr, size, "arcnet (90xx)"))
|
||||
return -1;
|
||||
|
||||
p = ioremap(addr, size);
|
||||
if (p) {
|
||||
if (readb(p) == TESTvalue)
|
||||
res = 1;
|
||||
else
|
||||
res = 0;
|
||||
iounmap(p);
|
||||
}
|
||||
|
||||
release_mem_region(addr, size);
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up the struct net_device associated with this card. Called after
|
||||
@ -125,19 +144,28 @@ static int __init arcrimi_found(struct net_device *dev)
|
||||
{
|
||||
struct arcnet_local *lp;
|
||||
unsigned long first_mirror, last_mirror, shmem;
|
||||
void __iomem *p;
|
||||
int mirror_size;
|
||||
int err;
|
||||
|
||||
p = ioremap(dev->mem_start, MIRROR_SIZE);
|
||||
if (!p) {
|
||||
release_mem_region(dev->mem_start, MIRROR_SIZE);
|
||||
BUGMSG(D_NORMAL, "Can't ioremap\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* reserve the irq */
|
||||
if (request_irq(dev->irq, &arcnet_interrupt, 0, "arcnet (RIM I)", dev)) {
|
||||
release_mem_region(dev->mem_start, BUFFER_SIZE);
|
||||
iounmap(p);
|
||||
release_mem_region(dev->mem_start, MIRROR_SIZE);
|
||||
BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
shmem = dev->mem_start;
|
||||
isa_writeb(TESTvalue, shmem);
|
||||
isa_writeb(dev->dev_addr[0], shmem + 1); /* actually the node ID */
|
||||
writeb(TESTvalue, p);
|
||||
writeb(dev->dev_addr[0], p + 1); /* actually the node ID */
|
||||
|
||||
/* find the real shared memory start/end points, including mirrors */
|
||||
|
||||
@ -146,17 +174,18 @@ static int __init arcrimi_found(struct net_device *dev)
|
||||
* 2k (or there are no mirrors at all) but on some, it's 4k.
|
||||
*/
|
||||
mirror_size = MIRROR_SIZE;
|
||||
if (isa_readb(shmem) == TESTvalue
|
||||
&& isa_readb(shmem - mirror_size) != TESTvalue
|
||||
&& isa_readb(shmem - 2 * mirror_size) == TESTvalue)
|
||||
mirror_size *= 2;
|
||||
if (readb(p) == TESTvalue
|
||||
&& check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0
|
||||
&& check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1)
|
||||
mirror_size = 2 * MIRROR_SIZE;
|
||||
|
||||
first_mirror = last_mirror = shmem;
|
||||
while (isa_readb(first_mirror) == TESTvalue)
|
||||
first_mirror = shmem - mirror_size;
|
||||
while (check_mirror(first_mirror, mirror_size) == 1)
|
||||
first_mirror -= mirror_size;
|
||||
first_mirror += mirror_size;
|
||||
|
||||
while (isa_readb(last_mirror) == TESTvalue)
|
||||
last_mirror = shmem + mirror_size;
|
||||
while (check_mirror(last_mirror, mirror_size) == 1)
|
||||
last_mirror += mirror_size;
|
||||
last_mirror -= mirror_size;
|
||||
|
||||
@ -181,7 +210,8 @@ static int __init arcrimi_found(struct net_device *dev)
|
||||
* with the correct size. There is a VERY slim chance this could
|
||||
* fail.
|
||||
*/
|
||||
release_mem_region(shmem, BUFFER_SIZE);
|
||||
iounmap(p);
|
||||
release_mem_region(shmem, MIRROR_SIZE);
|
||||
if (!request_mem_region(dev->mem_start,
|
||||
dev->mem_end - dev->mem_start + 1,
|
||||
"arcnet (90xx)")) {
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
/* Internal function declarations */
|
||||
static int com90xx_found(int ioaddr, int airq, u_long shmem);
|
||||
static int com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem *);
|
||||
static void com90xx_command(struct net_device *dev, int command);
|
||||
static int com90xx_status(struct net_device *dev);
|
||||
static void com90xx_setmask(struct net_device *dev, int mask);
|
||||
@ -116,14 +116,26 @@ static void __init com90xx_probe(void)
|
||||
unsigned long airqmask;
|
||||
int ports[(0x3f0 - 0x200) / 16 + 1] =
|
||||
{0};
|
||||
u_long shmems[(0xFF800 - 0xA0000) / 2048 + 1] =
|
||||
{0};
|
||||
unsigned long *shmems;
|
||||
void __iomem **iomem;
|
||||
int numports, numshmems, *port;
|
||||
u_long *p;
|
||||
int index;
|
||||
|
||||
if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
|
||||
return;
|
||||
|
||||
shmems = kzalloc(((0x10000-0xa0000) / 0x800) * sizeof(unsigned long),
|
||||
GFP_KERNEL);
|
||||
if (!shmems)
|
||||
return;
|
||||
iomem = kzalloc(((0x10000-0xa0000) / 0x800) * sizeof(void __iomem *),
|
||||
GFP_KERNEL);
|
||||
if (!iomem) {
|
||||
kfree(shmems);
|
||||
return;
|
||||
}
|
||||
|
||||
BUGLVL(D_NORMAL) printk(VERSION);
|
||||
|
||||
/* set up the arrays where we'll store the possible probe addresses */
|
||||
@ -179,6 +191,8 @@ static void __init com90xx_probe(void)
|
||||
|
||||
if (!numports) {
|
||||
BUGMSG2(D_NORMAL, "S1: No ARCnet cards found.\n");
|
||||
kfree(shmems);
|
||||
kfree(iomem);
|
||||
return;
|
||||
}
|
||||
/* Stage 2: we have now reset any possible ARCnet cards, so we can't
|
||||
@ -202,8 +216,8 @@ static void __init com90xx_probe(void)
|
||||
* 0xD1 byte in the right place, or are read-only.
|
||||
*/
|
||||
numprint = -1;
|
||||
for (p = &shmems[0]; p < shmems + numshmems; p++) {
|
||||
u_long ptr = *p;
|
||||
for (index = 0, p = &shmems[0]; index < numshmems; p++, index++) {
|
||||
void __iomem *base;
|
||||
|
||||
numprint++;
|
||||
numprint %= 8;
|
||||
@ -213,38 +227,49 @@ static void __init com90xx_probe(void)
|
||||
}
|
||||
BUGMSG2(D_INIT, "%lXh ", *p);
|
||||
|
||||
if (!request_mem_region(*p, BUFFER_SIZE, "arcnet (90xx)")) {
|
||||
if (!request_mem_region(*p, MIRROR_SIZE, "arcnet (90xx)")) {
|
||||
BUGMSG2(D_INIT_REASONS, "(request_mem_region)\n");
|
||||
BUGMSG2(D_INIT_REASONS, "Stage 3: ");
|
||||
BUGLVL(D_INIT_REASONS) numprint = 0;
|
||||
*p-- = shmems[--numshmems];
|
||||
continue;
|
||||
goto out;
|
||||
}
|
||||
if (isa_readb(ptr) != TESTvalue) {
|
||||
base = ioremap(*p, MIRROR_SIZE);
|
||||
if (!base) {
|
||||
BUGMSG2(D_INIT_REASONS, "(ioremap)\n");
|
||||
BUGMSG2(D_INIT_REASONS, "Stage 3: ");
|
||||
BUGLVL(D_INIT_REASONS) numprint = 0;
|
||||
goto out1;
|
||||
}
|
||||
if (readb(base) != TESTvalue) {
|
||||
BUGMSG2(D_INIT_REASONS, "(%02Xh != %02Xh)\n",
|
||||
isa_readb(ptr), TESTvalue);
|
||||
readb(base), TESTvalue);
|
||||
BUGMSG2(D_INIT_REASONS, "S3: ");
|
||||
BUGLVL(D_INIT_REASONS) numprint = 0;
|
||||
release_mem_region(*p, BUFFER_SIZE);
|
||||
*p-- = shmems[--numshmems];
|
||||
continue;
|
||||
goto out2;
|
||||
}
|
||||
/* By writing 0x42 to the TESTvalue location, we also make
|
||||
* sure no "mirror" shmem areas show up - if they occur
|
||||
* in another pass through this loop, they will be discarded
|
||||
* because *cptr != TESTvalue.
|
||||
*/
|
||||
isa_writeb(0x42, ptr);
|
||||
if (isa_readb(ptr) != 0x42) {
|
||||
writeb(0x42, base);
|
||||
if (readb(base) != 0x42) {
|
||||
BUGMSG2(D_INIT_REASONS, "(read only)\n");
|
||||
BUGMSG2(D_INIT_REASONS, "S3: ");
|
||||
release_mem_region(*p, BUFFER_SIZE);
|
||||
*p-- = shmems[--numshmems];
|
||||
continue;
|
||||
goto out2;
|
||||
}
|
||||
BUGMSG2(D_INIT_REASONS, "\n");
|
||||
BUGMSG2(D_INIT_REASONS, "S3: ");
|
||||
BUGLVL(D_INIT_REASONS) numprint = 0;
|
||||
iomem[index] = base;
|
||||
continue;
|
||||
out2:
|
||||
iounmap(base);
|
||||
out1:
|
||||
release_mem_region(*p, MIRROR_SIZE);
|
||||
out:
|
||||
*p-- = shmems[--numshmems];
|
||||
index--;
|
||||
}
|
||||
BUGMSG2(D_INIT, "\n");
|
||||
|
||||
@ -252,6 +277,8 @@ static void __init com90xx_probe(void)
|
||||
BUGMSG2(D_NORMAL, "S3: No ARCnet cards found.\n");
|
||||
for (port = &ports[0]; port < ports + numports; port++)
|
||||
release_region(*port, ARCNET_TOTAL_SIZE);
|
||||
kfree(shmems);
|
||||
kfree(iomem);
|
||||
return;
|
||||
}
|
||||
/* Stage 4: something of a dummy, to report the shmems that are
|
||||
@ -351,30 +378,32 @@ static void __init com90xx_probe(void)
|
||||
mdelay(RESETtime);
|
||||
} else {
|
||||
/* just one shmem and port, assume they match */
|
||||
isa_writeb(TESTvalue, shmems[0]);
|
||||
writeb(TESTvalue, iomem[0]);
|
||||
}
|
||||
#else
|
||||
inb(_RESET);
|
||||
mdelay(RESETtime);
|
||||
#endif
|
||||
|
||||
for (p = &shmems[0]; p < shmems + numshmems; p++) {
|
||||
u_long ptr = *p;
|
||||
for (index = 0; index < numshmems; index++) {
|
||||
u_long ptr = shmems[index];
|
||||
void __iomem *base = iomem[index];
|
||||
|
||||
if (isa_readb(ptr) == TESTvalue) { /* found one */
|
||||
if (readb(base) == TESTvalue) { /* found one */
|
||||
BUGMSG2(D_INIT, "%lXh)\n", *p);
|
||||
openparen = 0;
|
||||
|
||||
/* register the card */
|
||||
if (com90xx_found(*port, airq, *p) == 0)
|
||||
if (com90xx_found(*port, airq, ptr, base) == 0)
|
||||
found = 1;
|
||||
numprint = -1;
|
||||
|
||||
/* remove shmem from the list */
|
||||
*p = shmems[--numshmems];
|
||||
shmems[index] = shmems[--numshmems];
|
||||
iomem[index] = iomem[numshmems];
|
||||
break; /* go to the next I/O port */
|
||||
} else {
|
||||
BUGMSG2(D_INIT_REASONS, "%Xh-", isa_readb(ptr));
|
||||
BUGMSG2(D_INIT_REASONS, "%Xh-", readb(base));
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,17 +420,40 @@ static void __init com90xx_probe(void)
|
||||
BUGLVL(D_INIT_REASONS) printk("\n");
|
||||
|
||||
/* Now put back TESTvalue on all leftover shmems. */
|
||||
for (p = &shmems[0]; p < shmems + numshmems; p++) {
|
||||
isa_writeb(TESTvalue, *p);
|
||||
release_mem_region(*p, BUFFER_SIZE);
|
||||
for (index = 0; index < numshmems; index++) {
|
||||
writeb(TESTvalue, iomem[index]);
|
||||
iounmap(iomem[index]);
|
||||
release_mem_region(shmems[index], MIRROR_SIZE);
|
||||
}
|
||||
kfree(shmems);
|
||||
kfree(iomem);
|
||||
}
|
||||
|
||||
static int check_mirror(unsigned long addr, size_t size)
|
||||
{
|
||||
void __iomem *p;
|
||||
int res = -1;
|
||||
|
||||
if (!request_mem_region(addr, size, "arcnet (90xx)"))
|
||||
return -1;
|
||||
|
||||
p = ioremap(addr, size);
|
||||
if (p) {
|
||||
if (readb(p) == TESTvalue)
|
||||
res = 1;
|
||||
else
|
||||
res = 0;
|
||||
iounmap(p);
|
||||
}
|
||||
|
||||
release_mem_region(addr, size);
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Set up the struct net_device associated with this card. Called after
|
||||
* probing succeeds.
|
||||
*/
|
||||
static int __init com90xx_found(int ioaddr, int airq, u_long shmem)
|
||||
static int __init com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem *p)
|
||||
{
|
||||
struct net_device *dev = NULL;
|
||||
struct arcnet_local *lp;
|
||||
@ -412,7 +464,8 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem)
|
||||
dev = alloc_arcdev(device);
|
||||
if (!dev) {
|
||||
BUGMSG2(D_NORMAL, "com90xx: Can't allocate device!\n");
|
||||
release_mem_region(shmem, BUFFER_SIZE);
|
||||
iounmap(p);
|
||||
release_mem_region(shmem, MIRROR_SIZE);
|
||||
return -ENOMEM;
|
||||
}
|
||||
lp = dev->priv;
|
||||
@ -423,24 +476,27 @@ static int __init com90xx_found(int ioaddr, int airq, u_long shmem)
|
||||
* 2k (or there are no mirrors at all) but on some, it's 4k.
|
||||
*/
|
||||
mirror_size = MIRROR_SIZE;
|
||||
if (isa_readb(shmem) == TESTvalue
|
||||
&& isa_readb(shmem - mirror_size) != TESTvalue
|
||||
&& isa_readb(shmem - 2 * mirror_size) == TESTvalue)
|
||||
mirror_size *= 2;
|
||||
if (readb(p) == TESTvalue &&
|
||||
check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0 &&
|
||||
check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1)
|
||||
mirror_size = 2 * MIRROR_SIZE;
|
||||
|
||||
first_mirror = last_mirror = shmem;
|
||||
while (isa_readb(first_mirror) == TESTvalue)
|
||||
first_mirror = shmem - mirror_size;
|
||||
while (check_mirror(first_mirror, mirror_size) == 1)
|
||||
first_mirror -= mirror_size;
|
||||
first_mirror += mirror_size;
|
||||
|
||||
while (isa_readb(last_mirror) == TESTvalue)
|
||||
last_mirror = shmem + mirror_size;
|
||||
while (check_mirror(last_mirror, mirror_size) == 1)
|
||||
last_mirror += mirror_size;
|
||||
last_mirror -= mirror_size;
|
||||
|
||||
dev->mem_start = first_mirror;
|
||||
dev->mem_end = last_mirror + MIRROR_SIZE - 1;
|
||||
|
||||
release_mem_region(shmem, BUFFER_SIZE);
|
||||
iounmap(p);
|
||||
release_mem_region(shmem, MIRROR_SIZE);
|
||||
|
||||
if (!request_mem_region(dev->mem_start, dev->mem_end - dev->mem_start + 1, "arcnet (90xx)"))
|
||||
goto err_free_dev;
|
||||
|
||||
|
@ -1718,17 +1718,10 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
hp100_outw(i, FRAGMENT_LEN); /* and first/only fragment length */
|
||||
|
||||
if (lp->mode == 2) { /* memory mapped */
|
||||
if (lp->mem_ptr_virt) { /* high pci memory was remapped */
|
||||
/* Note: The J2585B needs alignment to 32bits here! */
|
||||
memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3);
|
||||
if (!ok_flag)
|
||||
memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len);
|
||||
} else {
|
||||
/* Note: The J2585B needs alignment to 32bits here! */
|
||||
isa_memcpy_toio(lp->mem_ptr_phys, skb->data, (skb->len + 3) & ~3);
|
||||
if (!ok_flag)
|
||||
isa_memset_io(lp->mem_ptr_phys, 0, HP100_MIN_PACKET_SIZE - skb->len);
|
||||
}
|
||||
/* Note: The J2585B needs alignment to 32bits here! */
|
||||
memcpy_toio(lp->mem_ptr_virt, skb->data, (skb->len + 3) & ~3);
|
||||
if (!ok_flag)
|
||||
memset_io(lp->mem_ptr_virt, 0, HP100_MIN_PACKET_SIZE - skb->len);
|
||||
} else { /* programmed i/o */
|
||||
outsl(ioaddr + HP100_REG_DATA32, skb->data,
|
||||
(skb->len + 3) >> 2);
|
||||
@ -1798,10 +1791,7 @@ static void hp100_rx(struct net_device *dev)
|
||||
/* First we get the header, which contains information about the */
|
||||
/* actual length of the received packet. */
|
||||
if (lp->mode == 2) { /* memory mapped mode */
|
||||
if (lp->mem_ptr_virt) /* if memory was remapped */
|
||||
header = readl(lp->mem_ptr_virt);
|
||||
else
|
||||
header = isa_readl(lp->mem_ptr_phys);
|
||||
header = readl(lp->mem_ptr_virt);
|
||||
} else /* programmed i/o */
|
||||
header = hp100_inl(DATA32);
|
||||
|
||||
@ -1833,13 +1823,9 @@ static void hp100_rx(struct net_device *dev)
|
||||
ptr = skb->data;
|
||||
|
||||
/* Now transfer the data from the card into that area */
|
||||
if (lp->mode == 2) {
|
||||
if (lp->mem_ptr_virt)
|
||||
memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len);
|
||||
/* Note alignment to 32bit transfers */
|
||||
else
|
||||
isa_memcpy_fromio(ptr, lp->mem_ptr_phys, pkt_len);
|
||||
} else /* io mapped */
|
||||
if (lp->mode == 2)
|
||||
memcpy_fromio(ptr, lp->mem_ptr_virt,pkt_len);
|
||||
else /* io mapped */
|
||||
insl(ioaddr + HP100_REG_DATA32, ptr, pkt_len >> 2);
|
||||
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
|
@ -204,7 +204,7 @@ static inline int emac_phy_gpcs(int phy_mode)
|
||||
|
||||
static inline void emac_tx_enable(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
unsigned long flags;
|
||||
u32 r;
|
||||
|
||||
@ -220,7 +220,7 @@ static inline void emac_tx_enable(struct ocp_enet_private *dev)
|
||||
|
||||
static void emac_tx_disable(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
unsigned long flags;
|
||||
u32 r;
|
||||
|
||||
@ -244,7 +244,7 @@ static void emac_tx_disable(struct ocp_enet_private *dev)
|
||||
|
||||
static void emac_rx_enable(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
unsigned long flags;
|
||||
u32 r;
|
||||
|
||||
@ -275,7 +275,7 @@ static void emac_rx_enable(struct ocp_enet_private *dev)
|
||||
|
||||
static void emac_rx_disable(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
unsigned long flags;
|
||||
u32 r;
|
||||
|
||||
@ -299,7 +299,7 @@ static void emac_rx_disable(struct ocp_enet_private *dev)
|
||||
|
||||
static inline void emac_rx_disable_async(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
unsigned long flags;
|
||||
u32 r;
|
||||
|
||||
@ -315,7 +315,7 @@ static inline void emac_rx_disable_async(struct ocp_enet_private *dev)
|
||||
|
||||
static int emac_reset(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
unsigned long flags;
|
||||
int n = 20;
|
||||
|
||||
@ -348,7 +348,7 @@ static int emac_reset(struct ocp_enet_private *dev)
|
||||
|
||||
static void emac_hash_mc(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
u16 gaht[4] = { 0 };
|
||||
struct dev_mc_list *dmi;
|
||||
|
||||
@ -393,7 +393,7 @@ static inline int emac_opb_mhz(void)
|
||||
/* BHs disabled */
|
||||
static int emac_configure(struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
struct net_device *ndev = dev->ndev;
|
||||
int gige;
|
||||
u32 r;
|
||||
@ -555,7 +555,7 @@ static void emac_full_tx_reset(struct net_device *ndev)
|
||||
|
||||
static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
u32 r;
|
||||
int n;
|
||||
|
||||
@ -604,7 +604,7 @@ static int __emac_mdio_read(struct ocp_enet_private *dev, u8 id, u8 reg)
|
||||
static void __emac_mdio_write(struct ocp_enet_private *dev, u8 id, u8 reg,
|
||||
u16 val)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
int n;
|
||||
|
||||
DBG2("%d: mdio_write(%02x,%02x,%04x)" NL, dev->def->index, id, reg,
|
||||
@ -666,7 +666,7 @@ static void emac_mdio_write(struct net_device *ndev, int id, int reg, int val)
|
||||
static void emac_set_multicast_list(struct net_device *ndev)
|
||||
{
|
||||
struct ocp_enet_private *dev = ndev->priv;
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
u32 rmr = emac_iff2rmr(ndev);
|
||||
|
||||
DBG("%d: multicast %08x" NL, dev->def->index, rmr);
|
||||
@ -825,7 +825,7 @@ static void emac_clean_rx_ring(struct ocp_enet_private *dev)
|
||||
}
|
||||
|
||||
static inline int emac_alloc_rx_skb(struct ocp_enet_private *dev, int slot,
|
||||
int flags)
|
||||
gfp_t flags)
|
||||
{
|
||||
struct sk_buff *skb = alloc_skb(dev->rx_skb_size, flags);
|
||||
if (unlikely(!skb))
|
||||
@ -1047,7 +1047,7 @@ static inline u16 emac_tx_csum(struct ocp_enet_private *dev,
|
||||
|
||||
static inline int emac_xmit_finish(struct ocp_enet_private *dev, int len)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
struct net_device *ndev = dev->ndev;
|
||||
|
||||
/* Send the packet out */
|
||||
@ -1519,7 +1519,7 @@ static void emac_rxde(void *param)
|
||||
static irqreturn_t emac_irq(int irq, void *dev_instance, struct pt_regs *regs)
|
||||
{
|
||||
struct ocp_enet_private *dev = dev_instance;
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
struct ibm_emac_error_stats *st = &dev->estats;
|
||||
|
||||
u32 isr = in_be32(&p->isr);
|
||||
@ -1619,17 +1619,17 @@ static void emac_remove(struct ocp_device *ocpdev)
|
||||
|
||||
DBG("%d: remove" NL, dev->def->index);
|
||||
|
||||
ocp_set_drvdata(ocpdev, 0);
|
||||
ocp_set_drvdata(ocpdev, NULL);
|
||||
unregister_netdev(dev->ndev);
|
||||
|
||||
tah_fini(dev->tah_dev);
|
||||
rgmii_fini(dev->rgmii_dev, dev->rgmii_input);
|
||||
zmii_fini(dev->zmii_dev, dev->zmii_input);
|
||||
|
||||
emac_dbg_register(dev->def->index, 0);
|
||||
emac_dbg_register(dev->def->index, NULL);
|
||||
|
||||
mal_unregister_commac(dev->mal, &dev->commac);
|
||||
iounmap((void *)dev->emacp);
|
||||
iounmap(dev->emacp);
|
||||
kfree(dev->ndev);
|
||||
}
|
||||
|
||||
@ -2048,9 +2048,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
|
||||
goto out4;
|
||||
|
||||
/* Map EMAC regs */
|
||||
dev->emacp =
|
||||
(struct emac_regs *)ioremap(dev->def->paddr,
|
||||
sizeof(struct emac_regs));
|
||||
dev->emacp = ioremap(dev->def->paddr, sizeof(struct emac_regs));
|
||||
if (!dev->emacp) {
|
||||
printk(KERN_ERR "emac%d: could not ioremap device registers!\n",
|
||||
dev->def->index);
|
||||
@ -2210,7 +2208,7 @@ static int __init emac_probe(struct ocp_device *ocpdev)
|
||||
|
||||
return 0;
|
||||
out6:
|
||||
iounmap((void *)dev->emacp);
|
||||
iounmap(dev->emacp);
|
||||
out5:
|
||||
tah_fini(dev->tah_dev);
|
||||
out4:
|
||||
|
@ -155,7 +155,7 @@ struct ibm_emac_error_stats {
|
||||
|
||||
struct ocp_enet_private {
|
||||
struct net_device *ndev; /* 0 */
|
||||
struct emac_regs *emacp;
|
||||
struct emac_regs __iomem *emacp;
|
||||
|
||||
struct mal_descriptor *tx_desc;
|
||||
int tx_cnt;
|
||||
|
@ -58,7 +58,7 @@ static void emac_desc_dump(int idx, struct ocp_enet_private *p)
|
||||
|
||||
static void emac_mac_dump(int idx, struct ocp_enet_private *dev)
|
||||
{
|
||||
struct emac_regs *p = dev->emacp;
|
||||
struct emac_regs __iomem *p = dev->emacp;
|
||||
|
||||
printk("** EMAC%d registers **\n"
|
||||
"MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n"
|
||||
|
@ -31,7 +31,7 @@ struct rgmii_regs {
|
||||
|
||||
/* RGMII device */
|
||||
struct ibm_ocp_rgmii {
|
||||
struct rgmii_regs *base;
|
||||
struct rgmii_regs __iomem *base;
|
||||
int users; /* number of EMACs using this RGMII bridge */
|
||||
};
|
||||
|
||||
|
@ -80,7 +80,7 @@ static inline u32 zmii_mode_mask(int mode, int input)
|
||||
static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode)
|
||||
{
|
||||
struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev);
|
||||
struct zmii_regs *p;
|
||||
struct zmii_regs __iomem *p;
|
||||
|
||||
ZMII_DBG("%d: init(%d, %d)" NL, ocpdev->def->index, input, *mode);
|
||||
|
||||
@ -94,8 +94,7 @@ static int __init zmii_init(struct ocp_device *ocpdev, int input, int *mode)
|
||||
}
|
||||
dev->mode = PHY_MODE_NA;
|
||||
|
||||
p = (struct zmii_regs *)ioremap(ocpdev->def->paddr,
|
||||
sizeof(struct zmii_regs));
|
||||
p = ioremap(ocpdev->def->paddr, sizeof(struct zmii_regs));
|
||||
if (!p) {
|
||||
printk(KERN_ERR
|
||||
"zmii%d: could not ioremap device registers!\n",
|
||||
@ -231,7 +230,7 @@ void __exit __zmii_fini(struct ocp_device *ocpdev, int input)
|
||||
if (!--dev->users) {
|
||||
/* Free everything if this is the last user */
|
||||
ocp_set_drvdata(ocpdev, NULL);
|
||||
iounmap((void *)dev->base);
|
||||
iounmap(dev->base);
|
||||
kfree(dev);
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ struct zmii_regs {
|
||||
|
||||
/* ZMII device */
|
||||
struct ibm_ocp_zmii {
|
||||
struct zmii_regs *base;
|
||||
struct zmii_regs __iomem *base;
|
||||
int mode; /* subset of PHY_MODE_XXXX */
|
||||
int users; /* number of EMACs using this ZMII bridge */
|
||||
u32 fer_save; /* FER value left by firmware */
|
||||
|
@ -622,7 +622,7 @@ static int __init mac_sonic_init_module(void)
|
||||
return 0;
|
||||
|
||||
out_unregister:
|
||||
driver_unregister(&mac_sonic_driver);
|
||||
platform_driver_unregister(&mac_sonic_driver);
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@ -32,6 +32,9 @@
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/io.h>
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
#include <asm/irq.h>
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
#define enter(x) printk("Enter: %s, %s line %i\n",x,__FILE__,__LINE__)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <linux/ioport.h>
|
||||
#include <net/arp.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <net/arp.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/dma.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
Loading…
Reference in New Issue
Block a user