airprime.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 "usb-serial.h"
  16. static struct usb_device_id id_table [] = {
  17. { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */
  18. { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
  19. { },
  20. };
  21. MODULE_DEVICE_TABLE(usb, id_table);
  22. static struct usb_driver airprime_driver = {
  23. .owner = THIS_MODULE,
  24. .name = "airprime",
  25. .probe = usb_serial_probe,
  26. .disconnect = usb_serial_disconnect,
  27. .id_table = id_table,
  28. };
  29. static struct usb_serial_device_type airprime_device = {
  30. .owner = THIS_MODULE,
  31. .name = "airprime",
  32. .id_table = id_table,
  33. .num_interrupt_in = NUM_DONT_CARE,
  34. .num_bulk_in = NUM_DONT_CARE,
  35. .num_bulk_out = NUM_DONT_CARE,
  36. .num_ports = 1,
  37. };
  38. static int __init airprime_init(void)
  39. {
  40. int retval;
  41. retval = usb_serial_register(&airprime_device);
  42. if (retval)
  43. return retval;
  44. retval = usb_register(&airprime_driver);
  45. if (retval)
  46. usb_serial_deregister(&airprime_device);
  47. return retval;
  48. }
  49. static void __exit airprime_exit(void)
  50. {
  51. usb_deregister(&airprime_driver);
  52. usb_serial_deregister(&airprime_device);
  53. }
  54. module_init(airprime_init);
  55. module_exit(airprime_exit);
  56. MODULE_LICENSE("GPL");