belkin_sa.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Definitions for Belkin USB Serial Adapter Driver
  4. *
  5. * Copyright (C) 2000
  6. * William Greathouse (wgreathouse@smva.com)
  7. *
  8. * This program is largely derived from work by the linux-usb group
  9. * and associated source files. Please see the usb/serial files for
  10. * individual credits and copyrights.
  11. *
  12. * See Documentation/usb/usb-serial.rst for more information on using this
  13. * driver
  14. *
  15. * 12-Mar-2001 gkh
  16. * Added GoHubs GO-COM232 device id.
  17. *
  18. * 06-Nov-2000 gkh
  19. * Added old Belkin and Peracom device ids, which this driver supports
  20. *
  21. * 12-Oct-2000 William Greathouse
  22. * First cut at supporting Belkin USB Serial Adapter F5U103
  23. * I did not have a copy of the original work to support this
  24. * adapter, so pardon any stupid mistakes. All of the information
  25. * I am using to write this driver was acquired by using a modified
  26. * UsbSnoop on Windows2000.
  27. *
  28. */
  29. #ifndef __LINUX_USB_SERIAL_BSA_H
  30. #define __LINUX_USB_SERIAL_BSA_H
  31. #define BELKIN_DOCKSTATION_VID 0x050d /* Vendor Id */
  32. #define BELKIN_DOCKSTATION_PID 0x1203 /* Product Id */
  33. #define BELKIN_SA_VID 0x050d /* Vendor Id */
  34. #define BELKIN_SA_PID 0x0103 /* Product Id */
  35. #define BELKIN_OLD_VID 0x056c /* Belkin's "old" vendor id */
  36. #define BELKIN_OLD_PID 0x8007 /* Belkin's "old" single port serial converter's id */
  37. #define PERACOM_VID 0x0565 /* Peracom's vendor id */
  38. #define PERACOM_PID 0x0001 /* Peracom's single port serial converter's id */
  39. #define GOHUBS_VID 0x0921 /* GoHubs vendor id */
  40. #define GOHUBS_PID 0x1000 /* GoHubs single port serial converter's id (identical to the Peracom device) */
  41. #define HANDYLINK_PID 0x1200 /* HandyLink USB's id (identical to the Peracom device) */
  42. /* Vendor Request Interface */
  43. #define BELKIN_SA_SET_BAUDRATE_REQUEST 0 /* Set baud rate */
  44. #define BELKIN_SA_SET_STOP_BITS_REQUEST 1 /* Set stop bits (1,2) */
  45. #define BELKIN_SA_SET_DATA_BITS_REQUEST 2 /* Set data bits (5,6,7,8) */
  46. #define BELKIN_SA_SET_PARITY_REQUEST 3 /* Set parity (None, Even, Odd) */
  47. #define BELKIN_SA_SET_DTR_REQUEST 10 /* Set DTR state */
  48. #define BELKIN_SA_SET_RTS_REQUEST 11 /* Set RTS state */
  49. #define BELKIN_SA_SET_BREAK_REQUEST 12 /* Set BREAK state */
  50. #define BELKIN_SA_SET_FLOW_CTRL_REQUEST 16 /* Set flow control mode */
  51. #ifdef WHEN_I_LEARN_THIS
  52. #define BELKIN_SA_SET_MAGIC_REQUEST 17 /* I don't know, possibly flush */
  53. /* (always in Wininit sequence before flow control) */
  54. #define BELKIN_SA_RESET xx /* Reset the port */
  55. #define BELKIN_SA_GET_MODEM_STATUS xx /* Force return of modem status register */
  56. #endif
  57. #define BELKIN_SA_SET_REQUEST_TYPE 0x40
  58. #define BELKIN_SA_BAUD(b) (230400/b)
  59. #define BELKIN_SA_STOP_BITS(b) (b-1)
  60. #define BELKIN_SA_DATA_BITS(b) (b-5)
  61. #define BELKIN_SA_PARITY_NONE 0
  62. #define BELKIN_SA_PARITY_EVEN 1
  63. #define BELKIN_SA_PARITY_ODD 2
  64. #define BELKIN_SA_PARITY_MARK 3
  65. #define BELKIN_SA_PARITY_SPACE 4
  66. #define BELKIN_SA_FLOW_NONE 0x0000 /* No flow control */
  67. #define BELKIN_SA_FLOW_OCTS 0x0001 /* use CTS input to throttle output */
  68. #define BELKIN_SA_FLOW_ODSR 0x0002 /* use DSR input to throttle output */
  69. #define BELKIN_SA_FLOW_IDSR 0x0004 /* use DSR input to enable receive */
  70. #define BELKIN_SA_FLOW_IDTR 0x0008 /* use DTR output for input flow control */
  71. #define BELKIN_SA_FLOW_IRTS 0x0010 /* use RTS output for input flow control */
  72. #define BELKIN_SA_FLOW_ORTS 0x0020 /* use RTS to indicate data available to send */
  73. #define BELKIN_SA_FLOW_ERRSUB 0x0040 /* ???? guess ???? substitute inline errors */
  74. #define BELKIN_SA_FLOW_OXON 0x0080 /* use XON/XOFF for output flow control */
  75. #define BELKIN_SA_FLOW_IXON 0x0100 /* use XON/XOFF for input flow control */
  76. /*
  77. * It seems that the interrupt pipe is closely modelled after the
  78. * 16550 register layout. This is probably because the adapter can
  79. * be used in a "DOS" environment to simulate a standard hardware port.
  80. */
  81. #define BELKIN_SA_LSR_INDEX 2 /* Line Status Register */
  82. #define BELKIN_SA_LSR_RDR 0x01 /* receive data ready */
  83. #define BELKIN_SA_LSR_OE 0x02 /* overrun error */
  84. #define BELKIN_SA_LSR_PE 0x04 /* parity error */
  85. #define BELKIN_SA_LSR_FE 0x08 /* framing error */
  86. #define BELKIN_SA_LSR_BI 0x10 /* break indicator */
  87. #define BELKIN_SA_LSR_THE 0x20 /* tx holding register empty */
  88. #define BELKIN_SA_LSR_TE 0x40 /* transmit register empty */
  89. #define BELKIN_SA_LSR_ERR 0x80 /* OE | PE | FE | BI */
  90. #define BELKIN_SA_MSR_INDEX 3 /* Modem Status Register */
  91. #define BELKIN_SA_MSR_DCTS 0x01 /* Delta CTS */
  92. #define BELKIN_SA_MSR_DDSR 0x02 /* Delta DSR */
  93. #define BELKIN_SA_MSR_DRI 0x04 /* Delta RI */
  94. #define BELKIN_SA_MSR_DCD 0x08 /* Delta CD */
  95. #define BELKIN_SA_MSR_CTS 0x10 /* Current CTS */
  96. #define BELKIN_SA_MSR_DSR 0x20 /* Current DSR */
  97. #define BELKIN_SA_MSR_RI 0x40 /* Current RI */
  98. #define BELKIN_SA_MSR_CD 0x80 /* Current CD */
  99. #endif /* __LINUX_USB_SERIAL_BSA_H */