2 * Aironet 4500 PCI-ISA-i365 driver
4 * Elmer Joandi, Januar 1999
8 * Revision 0.1 ,started 30.12.1998
10 * Revision 0.2, Feb 27, 2000
11 * Jeff Garzik - softnet, cleanups
15 static const char *awc_version
=
16 "aironet4500_cards.c v0.2 Feb 27, 2000 Elmer Joandi, elmer@ylenurme.ee.\n";
19 #include <linux/version.h>
20 #include <linux/config.h>
21 #include <linux/module.h>
23 #include <linux/kernel.h>
24 #include <linux/sched.h>
25 #include <linux/ptrace.h>
26 #include <linux/malloc.h>
27 #include <linux/string.h>
28 #include <linux/timer.h>
29 #include <linux/interrupt.h>
32 #include <asm/system.h>
33 #include <asm/bitops.h>
35 #include <linux/netdevice.h>
36 #include <linux/etherdevice.h>
37 #include <linux/skbuff.h>
38 #include <linux/if_arp.h>
39 #include <linux/ioport.h>
40 #include <linux/delay.h>
42 #include "aironet4500.h"
44 #define PCI_VENDOR_ID_AIRONET 0x14b9
45 #define PCI_DEVICE_AIRONET_4800_1 0x1
46 #define PCI_DEVICE_AIRONET_4800 0x4500
47 #define PCI_DEVICE_AIRONET_4500 0x4800
48 #define AIRONET4X00_IO_SIZE 0x40
49 #define AIRONET4X00_CIS_SIZE 0x300
50 #define AIRONET4X00_MEM_SIZE 0x300
52 #define AIRONET4500_PCI 1
53 #define AIRONET4500_PNP 2
54 #define AIRONET4500_ISA 3
55 #define AIRONET4500_365 4
58 #ifdef CONFIG_AIRONET4500_PCI
60 #include <linux/pci.h>
63 static int reverse_probe
=0 ;
66 static int awc_pci_init(struct net_device
* dev
, struct pci_dev
*pdev
,
67 int ioaddr
, int cis_addr
, int mem_addr
,u8 pci_irq_line
) ;
70 int awc4500_pci_probe(struct net_device
*dev
)
73 static int pci_index
= 0; /* Static, for multiple probe calls. */
77 unsigned char awc_pci_dev
, awc_pci_bus
;
82 for (;pci_index
< 0xff; pci_index
++) {
83 u16 vendor
, device
, pci_command
, new_command
;
89 if (pcibios_find_class (PCI_CLASS_NETWORK_OTHER
<< 8,
90 reverse_probe
? 0xfe - pci_index
: pci_index
,
91 &awc_pci_bus
, &awc_pci_dev
) != PCIBIOS_SUCCESSFUL
){
98 pdev
= pci_find_slot(awc_pci_bus
, awc_pci_dev
);
101 if (pci_enable_device(pdev
))
103 vendor
= pdev
->vendor
;
104 device
= pdev
->device
;
105 pci_irq_line
= pdev
->irq
;
106 pci_memaddr
= pci_resource_start (pdev
, 0);
107 pci_cisaddr
= pci_resource_start (pdev
, 1);
108 pci_ioaddr
= pci_resource_start (pdev
, 2);
110 // printk("\n pci capabilities %x and ptr %x \n",pci_caps,pci_caps_ptr);
111 /* Remove I/O space marker in bit 0. */
113 if (vendor
!= PCI_VENDOR_ID_AIRONET
)
115 if (device
!= PCI_DEVICE_AIRONET_4800_1
&&
116 device
!= PCI_DEVICE_AIRONET_4800
&&
117 device
!= PCI_DEVICE_AIRONET_4500
)
120 // if (check_region(pci_ioaddr, AIRONET4X00_IO_SIZE) ||
121 // check_region(pci_cisaddr, AIRONET4X00_CIS_SIZE) ||
122 // check_region(pci_memaddr, AIRONET4X00_MEM_SIZE)) {
123 // printk(KERN_ERR "aironet4X00 mem addrs not available for maping \n");
126 if (!request_region(pci_ioaddr
, AIRONET4X00_IO_SIZE
, "aironet4x00 ioaddr"))
128 // request_region(pci_cisaddr, AIRONET4X00_CIS_SIZE, "aironet4x00 cis");
129 // request_region(pci_memaddr, AIRONET4X00_MEM_SIZE, "aironet4x00 mem");
131 // pci_write_config_word(pdev, PCI_COMMAND, 0);
134 pci_read_config_word(pdev
, PCI_COMMAND
, &pci_command
);
135 new_command
= pci_command
|0x100 | PCI_COMMAND_MEMORY
|PCI_COMMAND_IO
;
136 if (pci_command
!= new_command
) {
137 printk(KERN_INFO
" The PCI BIOS has not enabled this"
138 " device! Updating PCI command %4.4x->%4.4x.\n",
139 pci_command
, new_command
);
140 pci_write_config_word(pdev
, PCI_COMMAND
, new_command
);
144 /* if (device == PCI_DEVICE_AIRONET_4800)
145 pci_write_config_dword(pdev, 0x40, 0x00000000);
149 if (device
== PCI_DEVICE_AIRONET_4800
)
150 pci_write_config_dword(pdev
, 0x40, 0x40000000);
152 if (awc_pci_init(dev
, pdev
, pci_ioaddr
,pci_cisaddr
,pci_memaddr
,pci_irq_line
)){
153 printk(KERN_ERR
"awc4800 pci init failed \n");
160 return cards_found
? 0 : -ENODEV
;
164 static int awc_pci_init(struct net_device
* dev
, struct pci_dev
*pdev
,
165 int ioaddr
, int cis_addr
, int mem_addr
, u8 pci_irq_line
) {
170 dev
= init_etherdev(dev
, 0 );
172 dev
->priv
= kmalloc(sizeof(struct awc_private
),GFP_KERNEL
);
173 memset(dev
->priv
,0,sizeof(struct awc_private
));
175 printk(KERN_CRIT
"aironet4x00: could not allocate device private, some unstability may follow\n");
181 // dev->tx_queue_len = tx_queue_len;
183 dev
->hard_start_xmit
= &awc_start_xmit
;
184 // dev->set_config = &awc_config_misiganes,aga mitte awc_config;
185 dev
->get_stats
= &awc_get_stats
;
186 // dev->set_multicast_list = &awc_set_multicast_list;
187 dev
->change_mtu
= awc_change_mtu
;
188 dev
->init
= &awc_init
;
189 dev
->open
= &awc_open
;
190 dev
->stop
= &awc_close
;
191 dev
->base_addr
= ioaddr
;
192 dev
->irq
= pci_irq_line
;
193 dev
->tx_timeout
= &awc_tx_timeout
;
194 dev
->watchdog_timeo
= AWC_TX_TIMEOUT
;
197 request_irq(dev
->irq
,awc_interrupt
, SA_SHIRQ
| SA_INTERRUPT
,"Aironet 4X00",dev
);
199 awc_private_init( dev
);
203 while (aironet4500_devices
[i
] && i
< MAX_AWCS
-1) i
++;
204 if (!aironet4500_devices
[i
]){
205 aironet4500_devices
[i
]=dev
;
206 ((struct awc_private
*)
207 aironet4500_devices
[i
]->priv
)->card_type
= AIRONET4500_PCI
;
209 if (awc_proc_set_fun
)
213 // if (register_netdev(dev) != 0) {
214 // printk(KERN_NOTICE "awc_cs: register_netdev() failed\n");
225 static void awc_pci_release(void) {
230 DEBUG(0, "awc_detach \n");
233 while ( i
< MAX_AWCS
) {
234 if (!aironet4500_devices
[i
])
236 if (((struct awc_private
*)aironet4500_devices
[i
]->priv
)->card_type
!= AIRONET4500_PCI
)
239 if (awc_proc_unset_fun
)
240 awc_proc_unset_fun(i
);
241 release_region(aironet4500_devices
[i
]->base_addr
, AIRONET4X00_IO_SIZE
);
242 // release_region(pci_cisaddr, AIRONET4X00_CIS_SIZE, "aironet4x00 cis");
243 // release_region(pci_memaddr, AIRONET4X00_MEM_SIZE, "aironet4x00 mem");
245 unregister_netdev(aironet4500_devices
[i
]);
246 free_irq(aironet4500_devices
[i
]->irq
,aironet4500_devices
[i
]);
247 kfree(aironet4500_devices
[i
]->priv
);
248 kfree(aironet4500_devices
[i
]);
250 aironet4500_devices
[i
]=0;
263 #endif /* CONFIG_AIRONET4500_PCI */
265 #ifdef CONFIG_AIRONET4500_PNP
267 #include <linux/isapnp.h>
268 #define AIRONET4X00_IO_SIZE 0x40
270 #define isapnp_logdev pci_dev
271 #define isapnp_dev pci_bus
272 #define isapnp_find_device isapnp_find_card
273 #define isapnp_find_logdev isapnp_find_dev
275 #define PNP_BUS_NUMBER number
276 #define PNP_DEV_NUMBER devfn
279 int awc4500_pnp_hw_reset(struct net_device
*dev
){
280 struct isapnp_logdev
*logdev
;
282 DEBUG(0, "awc_pnp_reset \n");
285 printk("awc4500 no dev->priv in hw_reset\n");
289 logdev
= ((struct isapnp_logdev
*) ((struct awc_private
*)dev
->priv
)->bus
);
292 printk("awc4500 no pnp logdev in hw_reset\n");
296 if (isapnp_cfg_begin(logdev
->PNP_BUS
->PNP_BUS_NUMBER
, logdev
->PNP_DEV_NUMBER
)<0)
297 printk("isapnp cfg failed at release \n");
298 isapnp_deactivate(logdev
->PNP_DEV_NUMBER
);
304 if (isapnp_cfg_begin(logdev
->PNP_BUS
->PNP_BUS_NUMBER
, logdev
->PNP_DEV_NUMBER
) < 0) {
305 printk("%s cfg begin failed in hw_reset for csn %x devnum %x \n",
306 dev
->name
, logdev
->PNP_BUS
->PNP_BUS_NUMBER
, logdev
->PNP_DEV_NUMBER
);
310 isapnp_activate(logdev
->PNP_DEV_NUMBER
); /* activate device */
316 int awc4500_pnp_probe(struct net_device
*dev
)
319 int isa_irq_line
= 0;
323 struct isapnp_dev
* pnp_dev
;
324 struct isapnp_logdev
*logdev
;
328 pnp_dev
= isapnp_find_device(
329 ISAPNP_VENDOR('A','W','L'),
337 logdev
= isapnp_find_logdev(pnp_dev
, ISAPNP_VENDOR('A','W','L'),
341 printk("No logical device found on Aironet board \n");
344 if (isapnp_cfg_begin(logdev
->PNP_BUS
->PNP_BUS_NUMBER
, logdev
->PNP_DEV_NUMBER
) < 0) {
345 printk("cfg begin failed for csn %x devnum %x \n",
346 logdev
->PNP_BUS
->PNP_BUS_NUMBER
, logdev
->PNP_DEV_NUMBER
);
349 isapnp_activate(logdev
->PNP_DEV_NUMBER
); /* activate device */
352 isa_irq_line
= logdev
->irq
;
353 isa_ioaddr
= logdev
->resource
[0].start
;
354 request_region(isa_ioaddr
, AIRONET4X00_IO_SIZE
, "aironet4x00 ioaddr");
357 dev
= init_etherdev(dev
, 0 );
359 dev
->priv
= kmalloc(sizeof(struct awc_private
),GFP_KERNEL
);
360 memset(dev
->priv
,0,sizeof(struct awc_private
));
362 printk(KERN_CRIT
"aironet4x00: could not allocate device private, some unstability may follow\n");
365 ((struct awc_private
*)dev
->priv
)->bus
= logdev
;
369 // dev->tx_queue_len = tx_queue_len;
371 dev
->hard_start_xmit
= &awc_start_xmit
;
372 // dev->set_config = &awc_config_misiganes,aga mitte awc_config;
373 dev
->get_stats
= &awc_get_stats
;
374 // dev->set_multicast_list = &awc_set_multicast_list;
375 dev
->change_mtu
= awc_change_mtu
;
376 dev
->init
= &awc_init
;
377 dev
->open
= &awc_open
;
378 dev
->stop
= &awc_close
;
379 dev
->base_addr
= isa_ioaddr
;
380 dev
->irq
= isa_irq_line
;
381 dev
->tx_timeout
= &awc_tx_timeout
;
382 dev
->watchdog_timeo
= AWC_TX_TIMEOUT
;
384 netif_start_queue (dev
);
386 request_irq(dev
->irq
,awc_interrupt
, SA_SHIRQ
| SA_INTERRUPT
,"Aironet 4X00",dev
);
388 awc_private_init( dev
);
390 ((struct awc_private
*)dev
->priv
)->bus
= logdev
;
393 if ( awc_init(dev
) ){
394 printk("card not found at irq %x io %lx\n",dev
->irq
, dev
->base_addr
);
405 while (aironet4500_devices
[i
] && i
< MAX_AWCS
-1) i
++;
406 if (!aironet4500_devices
[i
] && i
< MAX_AWCS
-1 ){
407 aironet4500_devices
[i
]=dev
;
409 ((struct awc_private
*)
410 aironet4500_devices
[i
]->priv
)->card_type
= AIRONET4500_PNP
;
412 if (awc_proc_set_fun
)
415 printk(KERN_CRIT
"Out of resources (MAX_AWCS) \n");
422 if (card
== 0) return -ENODEV
;
427 static void awc_pnp_release(void) {
431 struct isapnp_logdev
*logdev
;
433 DEBUG(0, "awc_detach \n");
436 while ( i
< MAX_AWCS
) {
437 if (!aironet4500_devices
[i
])
439 if (((struct awc_private
*)aironet4500_devices
[i
]->priv
)->card_type
!= AIRONET4500_PNP
)
442 logdev
= ((struct isapnp_logdev
*) ((struct awc_private
*)aironet4500_devices
[i
]->priv
)->bus
);
445 printk("awc4500 no pnp logdev in pnp_release\n");
447 if (awc_proc_unset_fun
)
448 awc_proc_unset_fun(i
);
449 if (isapnp_cfg_begin(logdev
->PNP_BUS
->PNP_BUS_NUMBER
, logdev
->PNP_DEV_NUMBER
)<0)
450 printk("isapnp cfg failed at release \n");
451 isapnp_deactivate(logdev
->PNP_DEV_NUMBER
);
454 release_region(aironet4500_devices
[i
]->base_addr
, AIRONET4X00_IO_SIZE
);
455 // release_region(isa_cisaddr, AIRONET4X00_CIS_SIZE, "aironet4x00 cis");
456 // release_region(isa_memaddr, AIRONET4X00_MEM_SIZE, "aironet4x00 mem");
458 unregister_netdev(aironet4500_devices
[i
]);
459 free_irq(aironet4500_devices
[i
]->irq
,aironet4500_devices
[i
]);
460 kfree(aironet4500_devices
[i
]->priv
);
461 kfree(aironet4500_devices
[i
]);
463 aironet4500_devices
[i
]=0;
473 #endif /* CONFIG_AIRONET4500_PNP */
475 #ifdef CONFIG_AIRONET4500_ISA
477 static int irq
[] = {0,0,0,0,0};
478 static int io
[] = {0,0,0,0,0};
484 MODULE_PARM(irq
,"i");
485 MODULE_PARM_DESC(irq
,"Aironet 4x00 ISA non-PNP irqs,required");
487 MODULE_PARM_DESC(io
,"Aironet 4x00 ISA non-PNP ioports,required");
491 int awc4500_isa_probe(struct net_device
*dev
)
493 // int cards_found = 0;
494 // static int isa_index = 0; /* Static, for multiple probe calls. */
495 int isa_irq_line
= 0;
501 if (! io
[0] || ! irq
[0]){
503 // printk(" Both irq and io params must be supplied for ISA mode !!!\n");
507 printk(KERN_WARNING
" Aironet ISA Card in non-PNP(ISA) mode sometimes feels bad on interrupt \n");
508 printk(KERN_WARNING
" Use aironet4500_pnp if any problems(i.e. card malfunctioning). \n");
509 printk(KERN_WARNING
" Note that this isa probe is not friendly... must give exact parameters \n");
511 while (irq
[card
] !=0){
513 isa_ioaddr
= io
[card
];
514 isa_irq_line
= irq
[card
];
516 request_region(isa_ioaddr
, AIRONET4X00_IO_SIZE
, "aironet4x00 ioaddr");
519 dev
= init_etherdev(dev
, 0 );
521 dev
->priv
= kmalloc(sizeof(struct awc_private
),GFP_KERNEL
);
522 memset(dev
->priv
,0,sizeof(struct awc_private
));
524 printk(KERN_CRIT
"aironet4x00: could not allocate device private, some unstability may follow\n");
530 // dev->tx_queue_len = tx_queue_len;
532 dev
->hard_start_xmit
= &awc_start_xmit
;
533 // dev->set_config = &awc_config_misiganes,aga mitte awc_config;
534 dev
->get_stats
= &awc_get_stats
;
535 // dev->set_multicast_list = &awc_set_multicast_list;
536 dev
->change_mtu
= awc_change_mtu
;
537 dev
->init
= &awc_init
;
538 dev
->open
= &awc_open
;
539 dev
->stop
= &awc_close
;
540 dev
->base_addr
= isa_ioaddr
;
541 dev
->irq
= isa_irq_line
;
542 dev
->tx_timeout
= &awc_tx_timeout
;
543 dev
->watchdog_timeo
= AWC_TX_TIMEOUT
;
545 request_irq(dev
->irq
,awc_interrupt
,SA_INTERRUPT
,"Aironet 4X00",dev
);
547 awc_private_init( dev
);
548 if ( awc_init(dev
) ){
549 printk("card not found at irq %x mem %x\n",irq
[card
],io
[card
]);
556 while (aironet4500_devices
[i
] && i
< MAX_AWCS
-1) i
++;
557 if (!aironet4500_devices
[i
]){
558 aironet4500_devices
[i
]=dev
;
559 ((struct awc_private
*)
560 aironet4500_devices
[i
]->priv
)->card_type
= AIRONET4500_ISA
;
562 if (awc_proc_set_fun
)
575 static void awc_isa_release(void) {
580 DEBUG(0, "awc_detach \n");
583 while ( i
< MAX_AWCS
) {
585 if (!aironet4500_devices
[i
])
587 if (((struct awc_private
*)aironet4500_devices
[i
]->priv
)->card_type
!= AIRONET4500_ISA
)
590 if (awc_proc_unset_fun
)
591 awc_proc_unset_fun(i
);
592 release_region(aironet4500_devices
[i
]->base_addr
, AIRONET4X00_IO_SIZE
);
593 // release_region(isa_cisaddr, AIRONET4X00_CIS_SIZE, "aironet4x00 cis");
594 // release_region(isa_memaddr, AIRONET4X00_MEM_SIZE, "aironet4x00 mem");
596 unregister_netdev(aironet4500_devices
[i
]);
597 free_irq(aironet4500_devices
[i
]->irq
,aironet4500_devices
[i
]);
598 kfree(aironet4500_devices
[i
]->priv
);
599 kfree(aironet4500_devices
[i
]);
601 aironet4500_devices
[i
]=0;
612 #endif /* CONFIG_AIRONET4500_ISA */
614 #ifdef CONFIG_AIRONET4500_365
616 #define port_range 0x40
618 int awc_i365_offset_ports
[] = {0x3e0,0x3e0,0x3e2,0x3e2};
619 int awc_i365_data_ports
[] = {0x3e1,0x3e1,0x3e3,0x3e3};
620 int awc_i365_irq
[] = {5,5,11,12};
621 int awc_i365_io
[] = {0x140,0x100,0x400,0x440};
622 int awc_i365_sockets
= 0;
634 inline u8
i365_in (struct i365_socket
* s
, int offset
) {
635 outb(offset
+ (s
->socket
% 2)* 0x40, s
->offset_port
);
636 return inb(s
->data_port
);
639 inline void i365_out (struct i365_socket
* s
, int offset
,int data
){
640 outb(offset
+ (s
->socket
% 2)* 0x40 ,s
->offset_port
);
641 outb((data
& 0xff),s
->data_port
) ;
645 void awc_i365_card_release(struct i365_socket
* s
){
647 i365_out(s
, 0x5, 0); // clearing ints
648 i365_out(s
, 0x6, 0x20); // mem 16 bits
649 i365_out(s
, 0x7, 0); // clear IO
650 i365_out(s
, 0x3, 0); // gen ctrl reset + mem mode
651 i365_out(s
, 0x2, 0); // reset power
652 i365_out(s
, 0x2, i365_in(s
, 0x2) & 0x7f ); // cardenable off
653 i365_out(s
, 0x2, 0); // remove power
657 int awc_i365_probe_once(struct i365_socket
* s
){
660 int caps
=i365_in(s
, 0);
663 // short rev = 0x3000;
664 unsigned char cis
[0x3e3];
665 unsigned char * mem
= phys_to_virt(0xd000);
669 DEBUG(1," i365 control ID %x \n", caps
);
675 ret
= i365_in(s
, 0x1);
677 if ((ret
& 0xC0) != 0xC0){
678 printk("card in socket %d port %x not in known state, %x \n",
679 s
->socket
, s
->offset_port
, ret
);
684 awc_i365_card_release(s
);
689 i365_out(s
, 0x2, 0x10 ); // power enable
692 i365_out(s
, 0x2, 0x10 | 0x01 | 0x04 | 0x80); //power enable
699 i365_out(s
, 0x3, 0x40 | 0x20 | s
->irq
);
703 while (jiffies
-jiff
< HZ
)
704 if (i365_in(s
,0x1) & 0x20)
707 if (! (i365_in(s
,0x1) & 0x20) ){
708 printk("irq enable timeout on socket %x \n", s
->socket
);
712 i365_out(s
,0x10,0xd0);
713 i365_out(s
,0x11,0x0);
714 i365_out(s
,0x12,0xd0);
715 i365_out(s
,0x13,0x0);
716 i365_out(s
,0x14,0x30 );
717 i365_out(s
,0x15,0x3f | 0x40); // enab mem reg bit
718 i365_out(s
,0x06,0x01); // enab mem
724 // memcpy_toio( 0xd3e0, &(cis[0]),0x1);
733 memcpy_fromio(cis
,0xD000, 0x3e0);
735 for (i
= 0; i
<= 0x3e2; i
++)
736 printk("%02x", mem
[i
]);
737 for (i
= 0; i
<= 0x3e2; i
++)
738 printk("%c", mem
[i
]);
744 if (cis
[i
] != 0x20 ){
745 i
= i
+ 2 + cis
[i
+1];
748 s
->manufacturer
= cis
[i
+2] | (cis
[i
+3]<<8);
749 s
->product
= cis
[i
+4] | (cis
[i
+5]<<8);
755 DEBUG(1,"socket %x manufacturer %x product %x \n",
756 s
->socket
, s
->manufacturer
,s
->product
);
758 i365_out(s
,0x07, 0x1 | 0x2); // enable io 16bit
761 i365_out(s
,0x08, port
& 0xff);
762 i365_out(s
,0x09, (port
& 0xff00)/ 0x100);
763 i365_out(s
,0x0A, (port
+port_range
) & 0xff);
764 i365_out(s
,0x0B, ((port
+port_range
) & 0xff00) /0x100);
766 i365_out(s
,0x06, 0x40); // enable io window
770 i365_out(s
,0x3e0,0x45);
775 while (!(inw(s
->io
+ 0x30) & 0x10)){
777 if (jiffies
- jiff
> HZ
){
779 printk("timed out waitin for command ack \n");
785 outw(0x10, s
->io
+ 0x34);
796 static int awc_i365_init(struct i365_socket
* s
) {
798 struct net_device
* dev
;
802 dev
= init_etherdev(0, sizeof(struct awc_private
) );
804 // dev->tx_queue_len = tx_queue_len;
807 dev
->hard_start_xmit
= &awc_start_xmit
;
808 // dev->set_config = &awc_config_misiganes,aga mitte awc_config;
809 dev
->get_stats
= &awc_get_stats
;
810 dev
->set_multicast_list
= &awc_set_multicast_list
;
812 dev
->init
= &awc_init
;
813 dev
->open
= &awc_open
;
814 dev
->stop
= &awc_close
;
816 dev
->base_addr
= s
->io
;
817 dev
->tx_timeout
= &awc_tx_timeout
;
818 dev
->watchdog_timeo
= AWC_TX_TIMEOUT
;
821 awc_private_init( dev
);
824 while (aironet4500_devices
[i
] && i
< MAX_AWCS
-1) i
++;
825 if (!aironet4500_devices
[i
]){
826 aironet4500_devices
[i
]=dev
;
828 ((struct awc_private
*)
829 aironet4500_devices
[i
]->priv
)->card_type
= AIRONET4500_365
;
831 if (awc_proc_set_fun
)
835 if (register_netdev(dev
) != 0) {
836 printk(KERN_NOTICE
"awc_cs: register_netdev() failed\n");
847 static void awc_i365_release(void) {
852 DEBUG(0, "awc_detach \n");
855 while ( i
< MAX_AWCS
) {
857 if (!aironet4500_devices
[i
])
860 if (((struct awc_private
*)aironet4500_devices
[i
]->priv
)->card_type
!= AIRONET4500_365
)
863 if (awc_proc_unset_fun
)
864 awc_proc_unset_fun(i
);
866 unregister_netdev(aironet4500_devices
[i
]);
868 //kfree(aironet4500_devices[i]->priv);
869 kfree(aironet4500_devices
[i
]);
871 aironet4500_devices
[i
]=0;
886 int awc_i365_probe(void) {
893 struct i365_socket s
;
894 /* Always emit the version, before any failure. */
896 if (!awc_i365_sockets
) {
897 printk(" awc i82635 4x00: use bitfiel opts awc_i365_sockets=0x3 <- (1|2) to probe sockets 0 and 1\n");
902 if (i
& awc_i365_sockets
){
904 s
.offset_port
= awc_i365_offset_ports
[k
];
905 s
.data_port
= awc_i365_data_ports
[k
];
909 s
.irq
= awc_i365_irq
[k
];
910 s
.io
= awc_i365_io
[k
];
912 ret
= awc_i365_probe_once(&s
);
914 if (awc_i365_init(&s
))
917 } else if (ret
== -1)
925 printk("no aironet 4x00 cards found\n");
937 #endif /* CONFIG_AIRONET4500_365 */
940 int init_module(void)
944 printk("%s\n ", awc_version
);
946 #ifdef CONFIG_AIRONET4500_PCI
947 if (awc4500_pci_probe(NULL
) == -ENODEV
){
948 // printk("PCI 4X00 aironet cards not found\n");
951 // printk("PCI 4X00 found some cards \n");
954 #ifdef CONFIG_AIRONET4500_PNP
955 if (awc4500_pnp_probe(NULL
) == -ENODEV
){
956 // printk("PNP 4X00 aironet cards not found\n");
959 // printk("PNP 4X00 found some cards \n");
962 #ifdef CONFIG_AIRONET4500_365
963 if ( awc_i365_probe() == -1) {
964 // printk("PCMCIA 4X00 aironet cards not found for i365(without card services) initialization\n");
967 // printk("PCMCIA 4X00 found some cards, take care, this code is not supposed to work yet \n");
970 #ifdef CONFIG_AIRONET4500_ISA
971 if (awc4500_isa_probe(NULL
) == -ENODEV
){
972 // printk("ISA 4X00 aironet ISA-bus non-PNP-mode cards not found\n");
975 // printk("ISA 4X00 found some cards \n");
979 printk(KERN_ERR
"No Aironet 4X00 cards were found. Note that for ISA \n cards you should use either automatic PNP mode or \n ISA mode with both io and irq param \n Aironet is also afraid of: being second PNP controller(by slot), having anything(brandname bios weirdnesses) in range 0x100-0x180 and maybe around 0xd0000\n If you PNP type card does not get found, try non-PNP switch before complainig. \n");
987 void cleanup_module(void)
989 DEBUG(0, "awc_cs: unloading %c ",'\n');
990 #ifdef CONFIG_AIRONET4500_PCI
993 #ifdef CONFIG_AIRONET4500_PNP
996 #ifdef CONFIG_AIRONET4500_365
999 #ifdef CONFIG_AIRONET4500_ISA