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