1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/pci.h>
23#include <linux/kernel.h>
24#include <linux/module.h>
25#include <linux/netdevice.h>
26#include "atmel.h"
27
28MODULE_AUTHOR("Simon Kelley");
29MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
30MODULE_LICENSE("GPL");
31MODULE_SUPPORTED_DEVICE("Atmel at76c506 PCI wireless cards");
32
33static const struct pci_device_id card_ids[] = {
34 { 0x1114, 0x0506, PCI_ANY_ID, PCI_ANY_ID },
35 { 0, }
36};
37
38MODULE_DEVICE_TABLE(pci, card_ids);
39
40static int atmel_pci_probe(struct pci_dev *, const struct pci_device_id *);
41static void atmel_pci_remove(struct pci_dev *);
42
43static struct pci_driver atmel_driver = {
44 .name = "atmel",
45 .id_table = card_ids,
46 .probe = atmel_pci_probe,
47 .remove = atmel_pci_remove,
48};
49
50
51static int atmel_pci_probe(struct pci_dev *pdev,
52 const struct pci_device_id *pent)
53{
54 struct net_device *dev;
55
56 if (pci_enable_device(pdev))
57 return -ENODEV;
58
59 pci_set_master(pdev);
60
61 dev = init_atmel_card(pdev->irq, pdev->resource[1].start,
62 ATMEL_FW_TYPE_506,
63 &pdev->dev, NULL, NULL);
64 if (!dev)
65 return -ENODEV;
66
67 pci_set_drvdata(pdev, dev);
68 return 0;
69}
70
71static void atmel_pci_remove(struct pci_dev *pdev)
72{
73 stop_atmel_card(pci_get_drvdata(pdev));
74}
75
76module_pci_driver(atmel_driver);
77