Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |
Jeff Kirsher | 3676915 | 2013-12-06 03:32:13 -0800 | [diff] [blame] | 18 | along with Atmel wireless lan drivers; if not, see |
| 19 | <http://www.gnu.org/licenses/>. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
| 21 | ******************************************************************************/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | #include <linux/pci.h> |
| 23 | #include <linux/kernel.h> |
| 24 | #include <linux/module.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <linux/netdevice.h> |
| 26 | #include "atmel.h" |
| 27 | |
| 28 | MODULE_AUTHOR("Simon Kelley"); |
| 29 | MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); |
| 30 | MODULE_LICENSE("GPL"); |
| 31 | MODULE_SUPPORTED_DEVICE("Atmel at76c506 PCI wireless cards"); |
| 32 | |
Benoit Taine | 9baa3c3 | 2014-08-08 15:56:03 +0200 | [diff] [blame] | 33 | static const struct pci_device_id card_ids[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | { 0x1114, 0x0506, PCI_ANY_ID, PCI_ANY_ID }, |
| 35 | { 0, } |
| 36 | }; |
| 37 | |
| 38 | MODULE_DEVICE_TABLE(pci, card_ids); |
| 39 | |
| 40 | static int atmel_pci_probe(struct pci_dev *, const struct pci_device_id *); |
| 41 | static void atmel_pci_remove(struct pci_dev *); |
| 42 | |
| 43 | static struct pci_driver atmel_driver = { |
| 44 | .name = "atmel", |
| 45 | .id_table = card_ids, |
| 46 | .probe = atmel_pci_probe, |
Bill Pemberton | 991683c | 2012-12-03 09:56:29 -0500 | [diff] [blame] | 47 | .remove = atmel_pci_remove, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | |
Bill Pemberton | 991683c | 2012-12-03 09:56:29 -0500 | [diff] [blame] | 51 | static int atmel_pci_probe(struct pci_dev *pdev, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | const struct pci_device_id *pent) |
| 53 | { |
| 54 | struct net_device *dev; |
Dmitry Torokhov | 5c877fe | 2006-10-08 00:14:30 -0400 | [diff] [blame] | 55 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | if (pci_enable_device(pdev)) |
| 57 | return -ENODEV; |
Dmitry Torokhov | 5c877fe | 2006-10-08 00:14:30 -0400 | [diff] [blame] | 58 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | pci_set_master(pdev); |
Dmitry Torokhov | 5c877fe | 2006-10-08 00:14:30 -0400 | [diff] [blame] | 60 | |
| 61 | dev = init_atmel_card(pdev->irq, pdev->resource[1].start, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | ATMEL_FW_TYPE_506, |
| 63 | &pdev->dev, NULL, NULL); |
| 64 | if (!dev) |
| 65 | return -ENODEV; |
Dmitry Torokhov | 5c877fe | 2006-10-08 00:14:30 -0400 | [diff] [blame] | 66 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | pci_set_drvdata(pdev, dev); |
| 68 | return 0; |
| 69 | } |
| 70 | |
Bill Pemberton | 991683c | 2012-12-03 09:56:29 -0500 | [diff] [blame] | 71 | static void atmel_pci_remove(struct pci_dev *pdev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | { |
simon@thekelleys.org.uk | b16a228 | 2005-10-30 15:50:15 +0000 | [diff] [blame] | 73 | stop_atmel_card(pci_get_drvdata(pdev)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | } |
| 75 | |
Axel Lin | 5b0a3b7 | 2012-04-14 10:38:36 +0800 | [diff] [blame] | 76 | module_pci_driver(atmel_driver); |