本文整理汇总了C++中elmc_id_reset586函数的典型用法代码示例。如果您正苦于以下问题:C++ elmc_id_reset586函数的具体用法?C++ elmc_id_reset586怎么用?C++ elmc_id_reset586使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elmc_id_reset586函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: alloc586
void alloc586(struct net_device *dev)
{
struct priv *p = (struct priv *) dev->priv;
elmc_id_reset586();
DELAY(2);
p->scp = (struct scp_struct *) (p->base + SCP_DEFAULT_ADDRESS);
p->scb = (struct scb_struct *) bus_to_virt(dev->mem_start);
p->iscp = (struct iscp_struct *) ((char *) p->scp - sizeof(struct iscp_struct));
memset((char *) p->iscp, 0, sizeof(struct iscp_struct));
memset((char *) p->scp, 0, sizeof(struct scp_struct));
p->scp->iscp = make24(p->iscp);
p->scp->sysbus = SYSBUSVAL;
p->iscp->scb_offset = make16(p->scb);
p->iscp->busy = 1;
elmc_id_reset586();
elmc_id_attn586();
DELAY(2);
if (p->iscp->busy) {
printk(KERN_ERR "%s: Init-Problems (alloc).\n", dev->name);
}
memset((char *) p->scb, 0, sizeof(struct scb_struct));
}
示例2: elmc_close
static int elmc_close(struct net_device *dev)
{
netif_stop_queue(dev);
elmc_id_reset586(); /* the hard way to stop the receiver */
free_irq(dev->irq, dev);
return 0;
}
示例3: cleanup_module
void cleanup_module(void)
{
int this_dev;
for(this_dev=0; this_dev<MAX_3C523_CARDS; this_dev++) {
struct net_device *dev = &dev_elmc[this_dev];
if(dev->priv) {
/* shutdown interrupts on the card */
elmc_id_reset586();
if (dev->irq != 0) {
/* this should be done by close, but if we failed to
initialize properly something may have gotten hosed. */
free_irq(dev->irq, dev);
dev->irq = 0;
}
if (dev->base_addr != 0) {
release_region(dev->base_addr, ELMC_IO_EXTENT);
dev->base_addr = 0;
}
irq[this_dev] = 0;
io[this_dev] = 0;
unregister_netdev(dev);
mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot,
NULL, NULL);
kfree(dev->priv);
dev->priv = NULL;
}
}
}
示例4: elmc_open
static int elmc_open(struct net_device *dev)
{
int ret;
elmc_id_attn586(); /* disable interrupts */
ret = request_irq(dev->irq, &elmc_interrupt, SA_SHIRQ | SA_SAMPLE_RANDOM,
dev->name, dev);
if (ret) {
printk(KERN_ERR "%s: couldn't get irq %d\n", dev->name, dev->irq);
elmc_id_reset586();
return ret;
}
alloc586(dev);
init586(dev);
startrecv586(dev);
netif_start_queue(dev);
return 0; /* most done by init */
}
示例5: elmc_open
static int elmc_open(struct net_device *dev)
{
int ret;
elmc_id_attn586(); /* disable interrupts */
ret = request_irq(dev->irq, elmc_interrupt, IRQF_SHARED,
dev->name, dev);
if (ret) {
pr_err("%s: couldn't get irq %d\n", dev->name, dev->irq);
elmc_id_reset586();
return ret;
}
alloc586(dev);
init586(dev);
startrecv586(dev);
netif_start_queue(dev);
return 0; /* most done by init */
}
示例6: check586
static int __init check586(struct net_device *dev, unsigned long where, unsigned size)
{
struct priv *p = (struct priv *) dev->priv;
char *iscp_addrs[2];
int i = 0;
p->base = (unsigned long) bus_to_virt((unsigned long)where) + size - 0x01000000;
p->memtop = bus_to_virt((unsigned long)where) + size;
p->scp = (struct scp_struct *)(p->base + SCP_DEFAULT_ADDRESS);
memset((char *) p->scp, 0, sizeof(struct scp_struct));
p->scp->sysbus = SYSBUSVAL; /* 1 = 8Bit-Bus, 0 = 16 Bit */
iscp_addrs[0] = bus_to_virt((unsigned long)where);
iscp_addrs[1] = (char *) p->scp - sizeof(struct iscp_struct);
for (i = 0; i < 2; i++) {
p->iscp = (struct iscp_struct *) iscp_addrs[i];
memset((char *) p->iscp, 0, sizeof(struct iscp_struct));
p->scp->iscp = make24(p->iscp);
p->iscp->busy = 1;
elmc_id_reset586();
/* reset586 does an implicit CA */
/* apparently, you sometimes have to kick the 82586 twice... */
elmc_id_attn586();
DELAY(1);
if (p->iscp->busy) { /* i82586 clears 'busy' after successful init */
return 0;
}
}
return 1;
}
示例7: elmc_probe
//.........这里部分代码省略.........
break;
case 9:
mca_write_pos(slot, 3, 0x08);
break;
case 12:
mca_write_pos(slot, 3, 0x01);
break;
}
pr = dev->priv = kmalloc(sizeof(struct priv), GFP_KERNEL);
if (dev->priv == NULL) {
retval = -ENOMEM;
goto err_out;
}
memset(pr, 0, sizeof(struct priv));
pr->slot = slot;
printk(KERN_INFO "%s: 3Com 3c523 Rev 0x%x at %#lx\n", dev->name, (int) revision,
dev->base_addr);
/* Determine if we're using the on-board transceiver (i.e. coax) or
an external one. The information is pretty much useless, but I
guess it's worth brownie points. */
dev->if_port = (status & ELMC_STATUS_DISABLE_THIN);
/* The 3c523 has a 24K chunk of memory. The first 16K is the
shared memory, while the last 8K is for the EtherStart BIOS ROM.
Which we don't care much about here. We'll just tell Linux that
we're using 16K. MCA won't permit address space conflicts caused
by not mapping the other 8K. */
dev->mem_start = shm_table[(status & ELMC_STATUS_MEMORY_SELECT) >> 3];
/* We're using MCA, so it's a given that the information about memory
size is correct. The Crynwr drivers do something like this. */
elmc_id_reset586(); /* seems like a good idea before checking it... */
size = 0x4000; /* check for 16K mem */
if (!check586(dev, dev->mem_start, size)) {
printk(KERN_ERR "%s: memprobe, Can't find memory at 0x%lx!\n", dev->name,
dev->mem_start);
kfree(dev->priv);
dev->priv = NULL;
retval = -ENODEV;
goto err_out;
}
dev->mem_end = dev->mem_start + size; /* set mem_end showed by 'ifconfig' */
pr->memtop = bus_to_virt(dev->mem_start) + size;
pr->base = (unsigned long) bus_to_virt(dev->mem_start) + size - 0x01000000;
alloc586(dev);
elmc_id_reset586(); /* make sure it doesn't generate spurious ints */
/* set number of receive-buffs according to memsize */
pr->num_recv_buffs = NUM_RECV_BUFFS_16;
/* dump all the assorted information */
printk(KERN_INFO "%s: IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->name,
dev->irq, dev->if_port ? "ex" : "in",
dev->mem_start, dev->mem_end - 1);
/* The hardware address for the 3c523 is stored in the first six
bytes of the IO address. */
printk(KERN_INFO "%s: hardware address ", dev->name);
for (i = 0; i < 6; i++) {
dev->dev_addr[i] = inb(dev->base_addr + i);
printk(" %02x", dev->dev_addr[i]);
}
printk("\n");
dev->open = &elmc_open;
dev->stop = &elmc_close;
dev->get_stats = &elmc_get_stats;
dev->hard_start_xmit = &elmc_send_packet;
dev->tx_timeout = &elmc_timeout;
dev->watchdog_timeo = HZ;
#ifdef ELMC_MULTICAST
dev->set_multicast_list = &set_multicast_list;
#else
dev->set_multicast_list = NULL;
#endif
dev->ethtool_ops = &netdev_ethtool_ops;
ether_setup(dev);
/* note that we haven't actually requested the IRQ from the kernel.
That gets done in elmc_open(). I'm not sure that's such a good idea,
but it works, so I'll go with it. */
#ifndef ELMC_MULTICAST
dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */
#endif
return 0;
err_out:
release_region(dev->base_addr, ELMC_IO_EXTENT);
return retval;
}