#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 */
static hw_info_t *get_prom(dev_link_t *link)
{
struct net_device *dev = link->priv;
- ioaddr_t ioaddr = dev->base_addr;
+ kio_addr_t ioaddr = dev->base_addr;
u_char prom[32];
int i, j;
static hw_info_t *get_ax88190(dev_link_t *link)
{
struct net_device *dev = link->priv;
- ioaddr_t ioaddr = dev->base_addr;
+ kio_addr_t ioaddr = dev->base_addr;
int i, j;
/* Not much of a test, but the alternatives are messy */
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;
#define MDIO_DATA_READ 0x10
#define MDIO_MASK 0x0f
-static void mdio_sync(ioaddr_t addr)
+static void mdio_sync(kio_addr_t addr)
{
int bits, mask = inb(addr) & MDIO_MASK;
for (bits = 0; bits < 32; bits++) {
}
}
-static int mdio_read(ioaddr_t addr, int phy_id, int loc)
+static int mdio_read(kio_addr_t addr, int phy_id, int loc)
{
u_int cmd = (0x06<<10)|(phy_id<<5)|loc;
int i, retval = 0, mask = inb(addr) & MDIO_MASK;
return (retval>>1) & 0xffff;
}
-static void mdio_write(ioaddr_t addr, int phy_id, int loc, int value)
+static void mdio_write(kio_addr_t addr, int phy_id, int loc, int value)
{
u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value;
int i, mask = inb(addr) & MDIO_MASK;
}
}
-static void mdio_reset(ioaddr_t addr, int phy_id)
+static void mdio_reset(kio_addr_t addr, int phy_id)
{
outb_p(0x08, addr);
outb_p(0x0c, addr);
#define DL19FDUPLX 0x0400 /* DL10019 Full duplex mode */
-static int read_eeprom(ioaddr_t ioaddr, int location)
+static int read_eeprom(kio_addr_t ioaddr, int location)
{
int i, retval = 0;
- ioaddr_t ee_addr = ioaddr + DLINK_EEPROM;
+ kio_addr_t ee_addr = ioaddr + DLINK_EEPROM;
int read_cmd = location | (EE_READ_CMD << 8);
outb(0, ee_addr);
In ASIC mode, EE_ADOT is used to output the data to the ASIC.
*/
-static void write_asic(ioaddr_t ioaddr, int location, short asic_data)
+static void write_asic(kio_addr_t ioaddr, int location, short asic_data)
{
int i;
- ioaddr_t ee_addr = ioaddr + DLINK_EEPROM;
+ kio_addr_t ee_addr = ioaddr + DLINK_EEPROM;
short dataval;
int read_cmd = location | (EE_READ_CMD << 8);
static void set_misc_reg(struct net_device *dev)
{
- ioaddr_t nic_base = dev->base_addr;
+ kio_addr_t nic_base = dev->base_addr;
pcnet_dev_t *info = PRIV(dev);
u_char tmp;
static void mii_phy_probe(struct net_device *dev)
{
pcnet_dev_t *info = PRIV(dev);
- ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
+ kio_addr_t mii_addr = dev->base_addr + DLINK_GPIO;
int i;
u_int tmp, phyid;
static void pcnet_reset_8390(struct net_device *dev)
{
- ioaddr_t nic_base = dev->base_addr;
+ kio_addr_t nic_base = dev->base_addr;
int i;
ei_status.txing = ei_status.dmaing = 0;
{
struct net_device *dev = (struct net_device *)arg;
pcnet_dev_t *info = PRIV(dev);
- ioaddr_t nic_base = dev->base_addr;
- ioaddr_t mii_addr = nic_base + DLINK_GPIO;
+ kio_addr_t nic_base = dev->base_addr;
+ kio_addr_t mii_addr = nic_base + DLINK_GPIO;
u_short link;
if (!netif_device_present(dev)) goto reschedule;
{
pcnet_dev_t *info = PRIV(dev);
u16 *data = (u16 *)&rq->ifr_ifru;
- ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
+ kio_addr_t mii_addr = dev->base_addr + DLINK_GPIO;
switch (cmd) {
case SIOCGMIIPHY:
data[0] = info->phy_id;
struct e8390_pkt_hdr *hdr,
int ring_page)
{
- ioaddr_t nic_base = dev->base_addr;
+ kio_addr_t nic_base = dev->base_addr;
if (ei_status.dmaing) {
printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input."
static void dma_block_input(struct net_device *dev, int count,
struct sk_buff *skb, int ring_offset)
{
- ioaddr_t nic_base = dev->base_addr;
+ kio_addr_t nic_base = dev->base_addr;
int xfer_count = count;
char *buf = skb->data;
static void dma_block_output(struct net_device *dev, int count,
const u_char *buf, const int start_page)
{
- ioaddr_t nic_base = dev->base_addr;
+ kio_addr_t nic_base = dev->base_addr;
pcnet_dev_t *info = PRIV(dev);
#ifdef PCMCIA_DEBUG
int retries = 0;
/*====================================================================*/
-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);