7 A Linux/Unix toolset and driver for Nokia mobile phones.
9 Released under the terms of the GNU GPL, see file COPYING for more details.
11 The development of RLP protocol is sponsored by SuSE CR, s.r.o. (Pavel use
12 the SIM card from SuSE for testing purposes).
14 Header file for RLP protocol.
18 #ifndef __data_rlp_common_h
19 #define __data_rlp_common_h
25 /* Global variables */
31 /* Typedef for frame type - they are the same for RLP version 0, 1 and 2. */
34 RLPFT_X, /* Unknown. */
35 RLPFT_U, /* Unnumbered frame. */
36 RLPFT_S, /* Supervisory frame. */
37 RLPFT_IS /* Information plus Supervisory (I+S) frame. */
40 /* Define the various Unnumbered frame types. Numbering is bit reversed
41 relative to ETSI GSM 04.22 for easy parsing. */
44 RLPU_SABM = 0x07, /* Set Asynchronous Balanced Mode. */
45 RLPU_UA = 0x0c, /* Unnumbered Acknowledge. */
46 RLPU_DISC = 0x08, /* Disconnect. */
47 RLPU_DM = 0x03, /* Disconnected Mode. */
48 RLPU_NULL = 0x0f, /* Null information. */
49 RLPU_UI = 0x00, /* Unnumbered Information. */
50 RLPU_XID = 0x17, /* Exchange Identification. */
51 RLPU_TEST = 0x1c, /* Test. */
52 RLPU_REMAP = 0x11 /* Remap. */
55 /* Define supervisory frame field. */
58 RLPS_RR = 0x00, /* Receive Ready. */
59 RLPS_REJ = 0x02, /* Reject. */
60 RLPS_RNR = 0x01, /* Receive Not Ready. */
61 RLPS_SREJ = 0x03 /* Selective Reject. */
64 /* Used for CurrentFrameType. */
87 /* Frame definition for TCH/F9.6 frame. */
95 /* Header data "split up" for TCH/F9.6 frame. */
98 u8 Ns; /* Send sequence number. */
99 u8 Nr; /* Receive sequence number. */
100 u8 M; /* Unumbered frame type. */
102 bool PF; /* Poll/Final. */
103 bool CR; /* Command/Response. */
104 RLP_FrameType Type; /* Frame type. */
108 /* RLP User requests */
116 } RLP_UserRequestStore;
131 Data, /* FIXME: This should really be called RLP_Data, otherwise it hogs name "Data"! */
136 /* RLP (main) states. See GSM specification 04.22 Annex A, Section A.1.1. */
139 RLP_S0, /* ADM and Detached */
140 RLP_S1, /* ADM and Attached */
141 RLP_S2, /* Pending Connect Request */
142 RLP_S3, /* Pending Connect Indication */
143 RLP_S4, /* ABM and Connection Established */
144 RLP_S5, /* Disconnect Initiated */
145 RLP_S6, /* Pending Reset Request */
146 RLP_S7, /* Pending Reset Indication */
150 /* RLP specification defines several states in which variables can be. */
167 RLP_StateVariable State;
172 /* Prototypes for functions. */
174 void RLP_DisplayF96Frame(RLP_F96Frame *frame);
175 void RLP_DecodeF96Header(RLP_F96Frame *frame, RLP_F96Header *header);
176 void RLP_DisplayXID(u8 *frame);
177 void RLP_Initialise(bool (*rlp_send_function)(RLP_F96Frame *frame, bool out_dtx), int (*rlp_passup)(RLP_UserInds ind, u8 *buffer, int length));
178 void RLP_Init_link_vars(void);
179 void RLP_SetUserRequest(RLP_UserRequests type, bool value);
180 void RLP_Send(char *buffer, int length);
182 #endif /* __data_rlp_common_h */