setup_protocol.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * IPWireless 3G PCMCIA Network Driver
  3. *
  4. * Original code
  5. * by Stephen Blackheath <stephen@blacksapphire.com>,
  6. * Ben Martel <benm@symmetric.co.nz>
  7. *
  8. * Copyrighted as follows:
  9. * Copyright (C) 2004 by Symmetric Systems Ltd (NZ)
  10. *
  11. * Various driver changes and rewrites, port to new kernels
  12. * Copyright (C) 2006-2007 Jiri Kosina
  13. *
  14. * Misc code cleanups and updates
  15. * Copyright (C) 2007 David Sterba
  16. */
  17. #ifndef _IPWIRELESS_CS_SETUP_PROTOCOL_H_
  18. #define _IPWIRELESS_CS_SETUP_PROTOCOL_H_
  19. /* Version of the setup protocol and transport protocols */
  20. #define TL_SETUP_VERSION 1
  21. #define TL_SETUP_VERSION_QRY_TMO 1000
  22. #define TL_SETUP_MAX_VERSION_QRY 30
  23. /* Message numbers 0-9 are obsoleted and must not be reused! */
  24. #define TL_SETUP_SIGNO_GET_VERSION_QRY 10
  25. #define TL_SETUP_SIGNO_GET_VERSION_RSP 11
  26. #define TL_SETUP_SIGNO_CONFIG_MSG 12
  27. #define TL_SETUP_SIGNO_CONFIG_DONE_MSG 13
  28. #define TL_SETUP_SIGNO_OPEN_MSG 14
  29. #define TL_SETUP_SIGNO_CLOSE_MSG 15
  30. #define TL_SETUP_SIGNO_INFO_MSG 20
  31. #define TL_SETUP_SIGNO_INFO_MSG_ACK 21
  32. #define TL_SETUP_SIGNO_REBOOT_MSG 22
  33. #define TL_SETUP_SIGNO_REBOOT_MSG_ACK 23
  34. /* Synchronous start-messages */
  35. struct tl_setup_get_version_qry {
  36. unsigned char sig_no; /* TL_SETUP_SIGNO_GET_VERSION_QRY */
  37. } __attribute__ ((__packed__));
  38. struct tl_setup_get_version_rsp {
  39. unsigned char sig_no; /* TL_SETUP_SIGNO_GET_VERSION_RSP */
  40. unsigned char version; /* TL_SETUP_VERSION */
  41. } __attribute__ ((__packed__));
  42. struct tl_setup_config_msg {
  43. unsigned char sig_no; /* TL_SETUP_SIGNO_CONFIG_MSG */
  44. unsigned char port_no;
  45. unsigned char prio_data;
  46. unsigned char prio_ctrl;
  47. } __attribute__ ((__packed__));
  48. struct tl_setup_config_done_msg {
  49. unsigned char sig_no; /* TL_SETUP_SIGNO_CONFIG_DONE_MSG */
  50. } __attribute__ ((__packed__));
  51. /* Asynchronous messages */
  52. struct tl_setup_open_msg {
  53. unsigned char sig_no; /* TL_SETUP_SIGNO_OPEN_MSG */
  54. unsigned char port_no;
  55. } __attribute__ ((__packed__));
  56. struct tl_setup_close_msg {
  57. unsigned char sig_no; /* TL_SETUP_SIGNO_CLOSE_MSG */
  58. unsigned char port_no;
  59. } __attribute__ ((__packed__));
  60. /* Driver type - for use in tl_setup_info_msg.driver_type */
  61. #define COMM_DRIVER 0
  62. #define NDISWAN_DRIVER 1
  63. #define NDISWAN_DRIVER_MAJOR_VERSION 2
  64. #define NDISWAN_DRIVER_MINOR_VERSION 0
  65. /*
  66. * It should not matter when this message comes over as we just store the
  67. * results and send the ACK.
  68. */
  69. struct tl_setup_info_msg {
  70. unsigned char sig_no; /* TL_SETUP_SIGNO_INFO_MSG */
  71. unsigned char driver_type;
  72. unsigned char major_version;
  73. unsigned char minor_version;
  74. } __attribute__ ((__packed__));
  75. struct tl_setup_info_msgAck {
  76. unsigned char sig_no; /* TL_SETUP_SIGNO_INFO_MSG_ACK */
  77. } __attribute__ ((__packed__));
  78. struct TlSetupRebootMsgAck {
  79. unsigned char sig_no; /* TL_SETUP_SIGNO_REBOOT_MSG_ACK */
  80. } __attribute__ ((__packed__));
  81. /* Define a union of all the msgs that the driver can receive from the card.*/
  82. union ipw_setup_rx_msg {
  83. unsigned char sig_no;
  84. struct tl_setup_get_version_rsp version_rsp_msg;
  85. struct tl_setup_open_msg open_msg;
  86. struct tl_setup_close_msg close_msg;
  87. struct tl_setup_info_msg InfoMsg;
  88. struct tl_setup_info_msgAck info_msg_ack;
  89. } __attribute__ ((__packed__));
  90. #endif /* _IPWIRELESS_CS_SETUP_PROTOCOL_H_ */