#ifdef PCMCIA_DEBUG
static int pc_debug = PCMCIA_DEBUG;
-MODULE_PARM(pc_debug, "i");
+module_param(pc_debug, int, 0);
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
static char *version =
"pcnet_cs.c 1.153 2003/11/09 18:53:09 (David Hinds)";
MODULE_DESCRIPTION("NE2000 compatible PCMCIA ethernet driver");
MODULE_LICENSE("GPL");
-#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
-
-/* Bit map of interrupts to choose from */
-INT_MODULE_PARM(irq_mask, 0xdeb8);
-static int irq_list[4] = { -1 };
-MODULE_PARM(irq_list, "1-4i");
+#define INT_MODULE_PARM(n, v) static int n = v; module_param(n, int, 0)
INT_MODULE_PARM(if_port, 1); /* Transceiver type */
INT_MODULE_PARM(use_big_buf, 1); /* use 64K packet buffer? */
/* Ugh! Let the user hardwire the hardware address for queer cards */
static int hw_addr[6] = { 0, /* ... */ };
-MODULE_PARM(hw_addr, "6i");
+module_param_array(hw_addr, int, NULL, 0);
/*====================================================================*/
dev_link_t link;
dev_node_t node;
u_int flags;
- caddr_t base;
+ void __iomem *base;
struct timer_list watchdog;
int stale, fast_poll;
u_char phy_id;
dev_link_t *link;
struct net_device *dev;
client_reg_t client_reg;
- int i, ret;
+ int ret;
DEBUG(0, "pcnet_attach()\n");
link->priv = dev;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
- link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
- if (irq_list[0] == -1)
- link->irq.IRQInfo2 = irq_mask;
- else
- for (i = 0; i < 4; i++)
- link->irq.IRQInfo2 |= 1 << irq_list[i];
+ link->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
link->next = dev_list;
dev_list = link;
client_reg.dev_info = &dev_info;
- client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
client_reg.EventMask =
CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
struct net_device *dev = link->priv;
win_req_t req;
memreq_t mem;
- u_char *base, *virt;
+ u_char __iomem *base, *virt;
int i, j;
/* Allocate a small memory window */
link->dev = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
+ SET_NETDEV_DEV(dev, &handle_to_dev(handle));
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = ei_poll;
/*====================================================================*/
-static void copyin(u_char *dest, u_char *src, int c)
+static void copyin(void *dest, void __iomem *src, int c)
{
- u_short *d = (u_short *)dest, *s = (u_short *)src;
+ u_short *d = dest;
+ u_short __iomem *s = src;
int odd;
if (c <= 0)
*((u_char *)d) = readw(s) & 0xff;
}
-static void copyout(u_char *dest, const u_char *src, int c)
+static void copyout(void __iomem *dest, const void *src, int c)
{
- u_short *d = (u_short *)dest, *s = (u_short *)src;
+ u_short __iomem *d = dest;
+ const u_short *s = src;
int odd;
if (c <= 0)
struct e8390_pkt_hdr *hdr,
int ring_page)
{
- void *xfer_start = (void *)(ei_status.rmem_start + (ring_page << 8)
- - (ei_status.rx_start_page << 8));
+ void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8)
+ + (ring_page << 8)
+ - (ei_status.rx_start_page << 8);
- copyin((void *)hdr, xfer_start, sizeof(struct e8390_pkt_hdr));
+ copyin(hdr, xfer_start, sizeof(struct e8390_pkt_hdr));
/* Fix for big endian systems */
hdr->count = le16_to_cpu(hdr->count);
}
static void shmem_block_input(struct net_device *dev, int count,
struct sk_buff *skb, int ring_offset)
{
- void *xfer_start = (void *)(ei_status.rmem_start + ring_offset
- - (ei_status.rx_start_page << 8));
+ void __iomem *xfer_start = ei_status.mem + (TX_PAGES<<8)
+ + ring_offset
+ - (ei_status.rx_start_page << 8);
char *buf = skb->data;
- if (xfer_start + count > (void *)ei_status.rmem_end) {
+ if (xfer_start + count > (void __iomem *)ei_status.rmem_end) {
/* We must wrap the input move. */
- int semi_count = (void*)ei_status.rmem_end - xfer_start;
+ int semi_count = (void __iomem *)ei_status.rmem_end - xfer_start;
copyin(buf, xfer_start, semi_count);
buf += semi_count;
- ring_offset = ei_status.rx_start_page << 8;
- xfer_start = (void *)ei_status.rmem_start;
+ xfer_start = ei_status.mem + (TX_PAGES<<8);
count -= semi_count;
}
copyin(buf, xfer_start, count);
static void shmem_block_output(struct net_device *dev, int count,
const u_char *buf, const int start_page)
{
- void *shmem = (void *)dev->mem_start + (start_page << 8);
+ void __iomem *shmem = ei_status.mem + (start_page << 8);
shmem -= ei_status.tx_start_page << 8;
copyout(shmem, buf, count);
}
goto failed;
}
- dev->mem_start = (u_long)info->base + offset;
- ei_status.rmem_start = dev->mem_start + (TX_PAGES<<8);
+ ei_status.mem = info->base + offset;
+ dev->mem_start = (u_long)ei_status.mem;
dev->mem_end = ei_status.rmem_end = (u_long)info->base + req.Size;
ei_status.tx_start_page = start_pg;
{
DEBUG(0, "pcnet_cs: unloading\n");
pcmcia_unregister_driver(&pcnet_driver);
- while (dev_list != NULL)
- pcnet_detach(dev_list);
+ BUG_ON(dev_list != NULL);
}
module_init(init_pcnet_cs);