airprime.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * AirPrime CDMA Wireless Serial USB driver
  3. *
  4. * Copyright (C) 2005 Greg Kroah-Hartman <gregkh@suse.de>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License version
  8. * 2 as published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/init.h>
  12. #include <linux/tty.h>
  13. #include <linux/module.h>
  14. #include <linux/usb.h>
  15. #include <linux/usb/serial.h>
  16. static struct usb_device_id id_table [] = {
  17. { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
  18. { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */
  19. { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
  20. { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless Aircard 580 */
  21. { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
  22. { },
  23. };
  24. MODULE_DEVICE_TABLE(usb, id_table);
  25. static struct usb_driver airprime_driver = {
  26. .name = "airprime",
  27. .probe = usb_serial_probe,
  28. .disconnect = usb_serial_disconnect,
  29. .id_table = id_table,
  30. .no_dynamic_id = 1,
  31. };
  32. static struct usb_serial_driver airprime_device = {
  33. .driver = {
  34. .owner = THIS_MODULE,
  35. .name = "airprime",
  36. },
  37. .id_table = id_table,
  38. .num_interrupt_in = NUM_DONT_CARE,
  39. .num_bulk_in = NUM_DONT_CARE,
  40. .num_bulk_out = NUM_DONT_CARE,
  41. .num_ports = 1,
  42. };
  43. static int __init airprime_init(void)
  44. {
  45. int retval;
  46. retval = usb_serial_register(&airprime_device);
  47. if (retval)
  48. return retval;
  49. retval = usb_register(&airprime_driver);
  50. if (retval)
  51. usb_serial_deregister(&airprime_device);
  52. return retval;
  53. }
  54. static void __exit airprime_exit(void)
  55. {
  56. usb_deregister(&airprime_driver);
  57. usb_serial_deregister(&airprime_device);
  58. }
  59. module_init(airprime_init);
  60. module_exit(airprime_exit);
  61. MODULE_LICENSE("GPL");