apne.c (c13aca79ff3c4af5fd31a5b2743a90eba6e36a26) | apne.c (e179d78ee11a70e2675bc572f9f4e33d97233b23) |
---|---|
1/* 2 * Amiga Linux/68k 8390 based PCMCIA Ethernet Driver for the Amiga 1200 3 * 4 * (C) Copyright 1997 Alain Malek 5 * (Alain.Malek@cryogen.com) 6 * 7 * ---------------------------------------------------------------------------- 8 * --- 61 unchanged lines hidden (view full) --- 70#define NE_EN0_IMR 0x0f 71 72#define NE1SM_START_PG 0x20 /* First page of TX buffer */ 73#define NE1SM_STOP_PG 0x40 /* Last page +1 of RX ring */ 74#define NESM_START_PG 0x40 /* First page of TX buffer */ 75#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */ 76 77 | 1/* 2 * Amiga Linux/68k 8390 based PCMCIA Ethernet Driver for the Amiga 1200 3 * 4 * (C) Copyright 1997 Alain Malek 5 * (Alain.Malek@cryogen.com) 6 * 7 * ---------------------------------------------------------------------------- 8 * --- 61 unchanged lines hidden (view full) --- 70#define NE_EN0_IMR 0x0f 71 72#define NE1SM_START_PG 0x20 /* First page of TX buffer */ 73#define NE1SM_STOP_PG 0x40 /* Last page +1 of RX ring */ 74#define NESM_START_PG 0x40 /* First page of TX buffer */ 75#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */ 76 77 |
78struct net_device * __init apne_probe(int unit); | |
79static int apne_probe1(struct net_device *dev, int ioaddr); 80 81static void apne_reset_8390(struct net_device *dev); 82static void apne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, 83 int ring_page); 84static void apne_block_input(struct net_device *dev, int count, 85 struct sk_buff *skb, int ring_offset); 86static void apne_block_output(struct net_device *dev, const int count, --- 28 unchanged lines hidden (view full) --- 115 "apne.c:v1.1 7/10/98 Alain Malek (Alain.Malek@cryogen.ch)\n"; 116 117static int apne_owned; /* signal if card already owned */ 118 119static u32 apne_msg_enable; 120module_param_named(msg_enable, apne_msg_enable, uint, 0444); 121MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)"); 122 | 78static int apne_probe1(struct net_device *dev, int ioaddr); 79 80static void apne_reset_8390(struct net_device *dev); 81static void apne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, 82 int ring_page); 83static void apne_block_input(struct net_device *dev, int count, 84 struct sk_buff *skb, int ring_offset); 85static void apne_block_output(struct net_device *dev, const int count, --- 28 unchanged lines hidden (view full) --- 114 "apne.c:v1.1 7/10/98 Alain Malek (Alain.Malek@cryogen.ch)\n"; 115 116static int apne_owned; /* signal if card already owned */ 117 118static u32 apne_msg_enable; 119module_param_named(msg_enable, apne_msg_enable, uint, 0444); 120MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)"); 121 |
123struct net_device * __init apne_probe(int unit) | 122static struct net_device * __init apne_probe(void) |
124{ 125 struct net_device *dev; 126 struct ei_device *ei_local; 127 128#ifndef MANUAL_CONFIG 129 char tuple[8]; 130#endif 131 int err; --- 13 unchanged lines hidden (view full) --- 145 if (!(PCMCIA_INSERTED)) { 146 pr_cont("NO PCMCIA card inserted\n"); 147 return ERR_PTR(-ENODEV); 148 } 149 150 dev = alloc_ei_netdev(); 151 if (!dev) 152 return ERR_PTR(-ENOMEM); | 123{ 124 struct net_device *dev; 125 struct ei_device *ei_local; 126 127#ifndef MANUAL_CONFIG 128 char tuple[8]; 129#endif 130 int err; --- 13 unchanged lines hidden (view full) --- 144 if (!(PCMCIA_INSERTED)) { 145 pr_cont("NO PCMCIA card inserted\n"); 146 return ERR_PTR(-ENODEV); 147 } 148 149 dev = alloc_ei_netdev(); 150 if (!dev) 151 return ERR_PTR(-ENOMEM); |
153 if (unit >= 0) { 154 sprintf(dev->name, "eth%d", unit); 155 netdev_boot_setup_check(dev); 156 } | |
157 ei_local = netdev_priv(dev); 158 ei_local->msg_enable = apne_msg_enable; 159 160 /* disable pcmcia irq for readtuple */ 161 pcmcia_disable_irq(); 162 163#ifndef MANUAL_CONFIG 164 if ((pcmcia_copy_tuple(CISTPL_FUNCID, tuple, 8) < 3) || --- 384 unchanged lines hidden (view full) --- 549 pr_debug("pcmcia intreq = %x\n", pcmcia_intreq); 550 pcmcia_disable_irq(); /* to get rid of the sti() within ei_interrupt */ 551 ei_interrupt(irq, dev_id); 552 pcmcia_ack_int(pcmcia_get_intreq()); 553 pcmcia_enable_irq(); 554 return IRQ_HANDLED; 555} 556 | 152 ei_local = netdev_priv(dev); 153 ei_local->msg_enable = apne_msg_enable; 154 155 /* disable pcmcia irq for readtuple */ 156 pcmcia_disable_irq(); 157 158#ifndef MANUAL_CONFIG 159 if ((pcmcia_copy_tuple(CISTPL_FUNCID, tuple, 8) < 3) || --- 384 unchanged lines hidden (view full) --- 544 pr_debug("pcmcia intreq = %x\n", pcmcia_intreq); 545 pcmcia_disable_irq(); /* to get rid of the sti() within ei_interrupt */ 546 ei_interrupt(irq, dev_id); 547 pcmcia_ack_int(pcmcia_get_intreq()); 548 pcmcia_enable_irq(); 549 return IRQ_HANDLED; 550} 551 |
557#ifdef MODULE | |
558static struct net_device *apne_dev; 559 560static int __init apne_module_init(void) 561{ | 552static struct net_device *apne_dev; 553 554static int __init apne_module_init(void) 555{ |
562 apne_dev = apne_probe(-1); | 556 apne_dev = apne_probe(); |
563 return PTR_ERR_OR_ZERO(apne_dev); 564} 565 566static void __exit apne_module_exit(void) 567{ 568 unregister_netdev(apne_dev); 569 570 pcmcia_disable_irq(); 571 572 free_irq(IRQ_AMIGA_PORTS, apne_dev); 573 574 pcmcia_reset(); 575 576 release_region(IOBASE, 0x20); 577 578 free_netdev(apne_dev); 579} 580module_init(apne_module_init); 581module_exit(apne_module_exit); | 557 return PTR_ERR_OR_ZERO(apne_dev); 558} 559 560static void __exit apne_module_exit(void) 561{ 562 unregister_netdev(apne_dev); 563 564 pcmcia_disable_irq(); 565 566 free_irq(IRQ_AMIGA_PORTS, apne_dev); 567 568 pcmcia_reset(); 569 570 release_region(IOBASE, 0x20); 571 572 free_netdev(apne_dev); 573} 574module_init(apne_module_init); 575module_exit(apne_module_exit); |
582#endif | |
583 584static int init_pcmcia(void) 585{ 586 u_char config; 587#ifndef MANUAL_CONFIG 588 u_char tuple[32]; 589 int offset_len; 590#endif --- 36 unchanged lines hidden --- | 576 577static int init_pcmcia(void) 578{ 579 u_char config; 580#ifndef MANUAL_CONFIG 581 u_char tuple[32]; 582 int offset_len; 583#endif --- 36 unchanged lines hidden --- |