]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /*** -*- linux-c -*- ********************************************************** |
2 | ||
3 | Driver for Atmel at76c502 at76c504 and at76c506 wireless cards. | |
4 | ||
5 | Copyright 2004 Simon Kelley. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This software is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with Atmel wireless lan drivers; if not, write to the Free Software | |
19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 | ||
21 | ******************************************************************************/ | |
1da177e4 LT |
22 | #include <linux/pci.h> |
23 | #include <linux/kernel.h> | |
24 | #include <linux/module.h> | |
25 | #include <linux/init.h> | |
26 | #include <linux/netdevice.h> | |
27 | #include "atmel.h" | |
28 | ||
29 | MODULE_AUTHOR("Simon Kelley"); | |
30 | MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); | |
31 | MODULE_LICENSE("GPL"); | |
32 | MODULE_SUPPORTED_DEVICE("Atmel at76c506 PCI wireless cards"); | |
33 | ||
34 | static struct pci_device_id card_ids[] = { | |
35 | { 0x1114, 0x0506, PCI_ANY_ID, PCI_ANY_ID }, | |
36 | { 0, } | |
37 | }; | |
38 | ||
39 | MODULE_DEVICE_TABLE(pci, card_ids); | |
40 | ||
41 | static int atmel_pci_probe(struct pci_dev *, const struct pci_device_id *); | |
42 | static void atmel_pci_remove(struct pci_dev *); | |
43 | ||
44 | static struct pci_driver atmel_driver = { | |
45 | .name = "atmel", | |
46 | .id_table = card_ids, | |
47 | .probe = atmel_pci_probe, | |
48 | .remove = __devexit_p(atmel_pci_remove), | |
49 | }; | |
50 | ||
51 | ||
52 | static int __devinit atmel_pci_probe(struct pci_dev *pdev, | |
53 | const struct pci_device_id *pent) | |
54 | { | |
55 | struct net_device *dev; | |
5c877fe5 | 56 | |
1da177e4 LT |
57 | if (pci_enable_device(pdev)) |
58 | return -ENODEV; | |
5c877fe5 | 59 | |
1da177e4 | 60 | pci_set_master(pdev); |
5c877fe5 DT |
61 | |
62 | dev = init_atmel_card(pdev->irq, pdev->resource[1].start, | |
1da177e4 LT |
63 | ATMEL_FW_TYPE_506, |
64 | &pdev->dev, NULL, NULL); | |
65 | if (!dev) | |
66 | return -ENODEV; | |
5c877fe5 | 67 | |
1da177e4 LT |
68 | pci_set_drvdata(pdev, dev); |
69 | return 0; | |
70 | } | |
71 | ||
72 | static void __devexit atmel_pci_remove(struct pci_dev *pdev) | |
73 | { | |
b16a228d | 74 | stop_atmel_card(pci_get_drvdata(pdev)); |
1da177e4 LT |
75 | } |
76 | ||
77 | static int __init atmel_init_module(void) | |
78 | { | |
29917620 | 79 | return pci_register_driver(&atmel_driver); |
1da177e4 LT |
80 | } |
81 | ||
82 | static void __exit atmel_cleanup_module(void) | |
83 | { | |
84 | pci_unregister_driver(&atmel_driver); | |
85 | } | |
86 | ||
87 | module_init(atmel_init_module); | |
88 | module_exit(atmel_cleanup_module); |