1 /* if_ether.h needed for definition of ETH_DATA_LEN and ETH_ALEN
3 #include "linux/if_ether.h"
5 /* frame layout based on par3.2 "LLC PDU format"
7 typedef union { /* pdu layout from pages 40 & 44 */
8 struct { /* general header, all pdu types */
9 unsigned dsap
: 8; /* dest service access point */
10 unsigned ssap
: 8; /* source service access point */
11 unsigned f1
: 1; /* I- U- or S- format id bits */
17 char dummy1
[2]; /* dsap + ssap */
20 } pdu_cntl
; /* unformatted control bytes */
21 struct { /* header of an Information pdu */
22 unsigned char dummy2
[2];
25 unsigned i_pflag
: 1; /* poll/final bit */
26 unsigned nr
: 7; /* N(R) */
27 unsigned char is_info
[ ETH_DATA_LEN
];
29 struct { /* header of a Supervisory pdu */
30 unsigned char dummy3
[2];
32 unsigned ss
: 2; /* supervisory function bits */
34 unsigned s_pflag
: 1; /* poll/final bit */
35 unsigned nr
: 7; /* N(R) */
38 /* when accessing the P/F bit or the N(R) field there's no need to distinguish
39 I pdus from S pdus i_pflag and s_pflag / i_nr and s_nr map to the same
42 struct { /* header of an Unnumbered pdu */
43 unsigned char dummy4
[2];
45 unsigned mm1
: 2; /* modifier function part1 */
46 unsigned u_pflag
: 1; /* P/F for U- pdus */
47 unsigned mm2
: 3; /* modifier function part2 */
48 unsigned char u_info
[ ETH_DATA_LEN
-1];
50 struct { /* mm field in an Unnumbered pdu */
51 unsigned char dummy5
[2];
53 unsigned mm
: 6; /* must be masked to get ridd of P/F ! */
56 } frame_type
, *frameptr
;
58 /* frame format test macros: */
60 #define IS_UFRAME( fr ) ( ( (fr)->pdu_hdr.f1) & ( (fr)->pdu_hdr.f2) )
62 #define IS_IFRAME( fr ) ( !( (fr)->pdu_hdr.f1) )
64 #define IS_SFRAME( fr ) ( ( (fr)->pdu_hdr.f1) & !( (fr)->pdu_hdr.f2) )
66 #define IS_RSP( fr ) ( fr->pdu_hdr.ssap & 0x01 )
69 /* The transition table, the _encode tables and some tests in the
70 source code depend on the numeric order of these values.
71 Think twice before changing.
74 /* frame names for TYPE 2 operation: */
89 /* junk frame name: */
93 /* frame names for TYPE 1 operation: */