atmel_pci.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*** -*- linux-c -*- **********************************************************
  3. Driver for Atmel at76c502 at76c504 and at76c506 wireless cards.
  4. Copyright 2004 Simon Kelley.
  5. ******************************************************************************/
  6. #include <linux/pci.h>
  7. #include <linux/kernel.h>
  8. #include <linux/module.h>
  9. #include <linux/netdevice.h>
  10. #include "atmel.h"
  11. MODULE_AUTHOR("Simon Kelley");
  12. MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
  13. MODULE_LICENSE("GPL");
  14. static const struct pci_device_id card_ids[] = {
  15. { 0x1114, 0x0506, PCI_ANY_ID, PCI_ANY_ID },
  16. { 0, }
  17. };
  18. MODULE_DEVICE_TABLE(pci, card_ids);
  19. static int atmel_pci_probe(struct pci_dev *, const struct pci_device_id *);
  20. static void atmel_pci_remove(struct pci_dev *);
  21. static struct pci_driver atmel_driver = {
  22. .name = "atmel",
  23. .id_table = card_ids,
  24. .probe = atmel_pci_probe,
  25. .remove = atmel_pci_remove,
  26. };
  27. static int atmel_pci_probe(struct pci_dev *pdev,
  28. const struct pci_device_id *pent)
  29. {
  30. struct net_device *dev;
  31. if (pci_enable_device(pdev))
  32. return -ENODEV;
  33. pci_set_master(pdev);
  34. dev = init_atmel_card(pdev->irq, pdev->resource[1].start,
  35. ATMEL_FW_TYPE_506,
  36. &pdev->dev, NULL, NULL);
  37. if (!dev) {
  38. pci_disable_device(pdev);
  39. return -ENODEV;
  40. }
  41. pci_set_drvdata(pdev, dev);
  42. return 0;
  43. }
  44. static void atmel_pci_remove(struct pci_dev *pdev)
  45. {
  46. stop_atmel_card(pci_get_drvdata(pdev));
  47. }
  48. module_pci_driver(atmel_driver);