Lines Matching +full:frame +full:- +full:number

2  * llc_pdu.c - access to PDU internals
5 * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
23 llc_pdu_un_hdr(skb)->ssap |= pdu_type; in llc_pdu_set_cmd_rsp()
27 * llc_pdu_set_pf_bit - sets poll/final bit in LLC header
28 * @skb: Frame to set bit in
46 pdu->ctrl_2 = (pdu->ctrl_2 & 0xFE) | bit_value; in llc_pdu_set_pf_bit()
49 pdu->ctrl_1 |= (pdu->ctrl_1 & 0xEF) | (bit_value << 4); in llc_pdu_set_pf_bit()
55 * llc_pdu_decode_pf_bit - extracs poll/final bit from LLC header
74 *pf_bit = pdu->ctrl_2 & LLC_S_PF_BIT_MASK; in llc_pdu_decode_pf_bit()
77 *pf_bit = (pdu->ctrl_1 & LLC_U_PF_BIT_MASK) >> 4; in llc_pdu_decode_pf_bit()
83 * llc_pdu_init_as_disc_cmd - Builds DISC PDU
87 * Builds a pdu frame as a DISC command.
93 pdu->ctrl_1 = LLC_PDU_TYPE_U; in llc_pdu_init_as_disc_cmd()
94 pdu->ctrl_1 |= LLC_2_PDU_CMD_DISC; in llc_pdu_init_as_disc_cmd()
95 pdu->ctrl_1 |= ((p_bit & 1) << 4) & LLC_U_PF_BIT_MASK; in llc_pdu_init_as_disc_cmd()
99 * llc_pdu_init_as_i_cmd - builds I pdu
102 * @ns: The sequence number of the data PDU
103 * @nr: The seq. number of the expected I PDU from the remote
105 * Builds a pdu frame as an I command.
111 pdu->ctrl_1 = LLC_PDU_TYPE_I; in llc_pdu_init_as_i_cmd()
112 pdu->ctrl_2 = 0; in llc_pdu_init_as_i_cmd()
113 pdu->ctrl_2 |= (p_bit & LLC_I_PF_BIT_MASK); /* p/f bit */ in llc_pdu_init_as_i_cmd()
114 pdu->ctrl_1 |= (ns << 1) & 0xFE; /* set N(S) in bits 2..8 */ in llc_pdu_init_as_i_cmd()
115 pdu->ctrl_2 |= (nr << 1) & 0xFE; /* set N(R) in bits 10..16 */ in llc_pdu_init_as_i_cmd()
119 * llc_pdu_init_as_rej_cmd - builds REJ PDU
122 * @nr: The seq. number of the expected I PDU from the remote
124 * Builds a pdu frame as a REJ command.
130 pdu->ctrl_1 = LLC_PDU_TYPE_S; in llc_pdu_init_as_rej_cmd()
131 pdu->ctrl_1 |= LLC_2_PDU_CMD_REJ; in llc_pdu_init_as_rej_cmd()
132 pdu->ctrl_2 = 0; in llc_pdu_init_as_rej_cmd()
133 pdu->ctrl_2 |= p_bit & LLC_S_PF_BIT_MASK; in llc_pdu_init_as_rej_cmd()
134 pdu->ctrl_1 &= 0x0F; /* setting bits 5..8 to zero(reserved) */ in llc_pdu_init_as_rej_cmd()
135 pdu->ctrl_2 |= (nr << 1) & 0xFE; /* set N(R) in bits 10..16 */ in llc_pdu_init_as_rej_cmd()
139 * llc_pdu_init_as_rnr_cmd - builds RNR pdu
142 * @nr: The seq. number of the expected I PDU from the remote
144 * Builds a pdu frame as an RNR command.
150 pdu->ctrl_1 = LLC_PDU_TYPE_S; in llc_pdu_init_as_rnr_cmd()
151 pdu->ctrl_1 |= LLC_2_PDU_CMD_RNR; in llc_pdu_init_as_rnr_cmd()
152 pdu->ctrl_2 = 0; in llc_pdu_init_as_rnr_cmd()
153 pdu->ctrl_2 |= p_bit & LLC_S_PF_BIT_MASK; in llc_pdu_init_as_rnr_cmd()
154 pdu->ctrl_1 &= 0x0F; /* setting bits 5..8 to zero(reserved) */ in llc_pdu_init_as_rnr_cmd()
155 pdu->ctrl_2 |= (nr << 1) & 0xFE; /* set N(R) in bits 10..16 */ in llc_pdu_init_as_rnr_cmd()
159 * llc_pdu_init_as_rr_cmd - Builds RR pdu
162 * @nr: The seq. number of the expected I PDU from the remote
164 * Builds a pdu frame as an RR command.
170 pdu->ctrl_1 = LLC_PDU_TYPE_S; in llc_pdu_init_as_rr_cmd()
171 pdu->ctrl_1 |= LLC_2_PDU_CMD_RR; in llc_pdu_init_as_rr_cmd()
172 pdu->ctrl_2 = p_bit & LLC_S_PF_BIT_MASK; in llc_pdu_init_as_rr_cmd()
173 pdu->ctrl_1 &= 0x0F; /* setting bits 5..8 to zero(reserved) */ in llc_pdu_init_as_rr_cmd()
174 pdu->ctrl_2 |= (nr << 1) & 0xFE; /* set N(R) in bits 10..16 */ in llc_pdu_init_as_rr_cmd()
178 * llc_pdu_init_as_sabme_cmd - builds SABME pdu
182 * Builds a pdu frame as an SABME command.
188 pdu->ctrl_1 = LLC_PDU_TYPE_U; in llc_pdu_init_as_sabme_cmd()
189 pdu->ctrl_1 |= LLC_2_PDU_CMD_SABME; in llc_pdu_init_as_sabme_cmd()
190 pdu->ctrl_1 |= ((p_bit & 1) << 4) & LLC_U_PF_BIT_MASK; in llc_pdu_init_as_sabme_cmd()
194 * llc_pdu_init_as_dm_rsp - builds DM response pdu
198 * Builds a pdu frame as a DM response.
204 pdu->ctrl_1 = LLC_PDU_TYPE_U; in llc_pdu_init_as_dm_rsp()
205 pdu->ctrl_1 |= LLC_2_PDU_RSP_DM; in llc_pdu_init_as_dm_rsp()
206 pdu->ctrl_1 |= ((f_bit & 1) << 4) & LLC_U_PF_BIT_MASK; in llc_pdu_init_as_dm_rsp()
210 * llc_pdu_init_as_frmr_rsp - builds FRMR response PDU
211 * @skb: Address of the frame to build
212 * @prev_pdu: The rejected PDU frame
218 * Builds a pdu frame as a FRMR response.
228 pdu->ctrl_1 = LLC_PDU_TYPE_U; in llc_pdu_init_as_frmr_rsp()
229 pdu->ctrl_1 |= LLC_2_PDU_RSP_FRMR; in llc_pdu_init_as_frmr_rsp()
230 pdu->ctrl_1 |= ((f_bit & 1) << 4) & LLC_U_PF_BIT_MASK; in llc_pdu_init_as_frmr_rsp()
232 frmr_info = (struct llc_frmr_info *)&pdu->ctrl_2; in llc_pdu_init_as_frmr_rsp()
233 ctrl = (u8 *)&prev_pdu->ctrl_1; in llc_pdu_init_as_frmr_rsp()
248 * llc_pdu_init_as_rr_rsp - builds RR response pdu
251 * @nr: The seq. number of the expected data PDU from the remote
253 * Builds a pdu frame as an RR response.
259 pdu->ctrl_1 = LLC_PDU_TYPE_S; in llc_pdu_init_as_rr_rsp()
260 pdu->ctrl_1 |= LLC_2_PDU_RSP_RR; in llc_pdu_init_as_rr_rsp()
261 pdu->ctrl_2 = 0; in llc_pdu_init_as_rr_rsp()
262 pdu->ctrl_2 |= f_bit & LLC_S_PF_BIT_MASK; in llc_pdu_init_as_rr_rsp()
263 pdu->ctrl_1 &= 0x0F; /* setting bits 5..8 to zero(reserved) */ in llc_pdu_init_as_rr_rsp()
264 pdu->ctrl_2 |= (nr << 1) & 0xFE; /* set N(R) in bits 10..16 */ in llc_pdu_init_as_rr_rsp()
268 * llc_pdu_init_as_rej_rsp - builds REJ response pdu
271 * @nr: The seq. number of the expected data PDU from the remote
273 * Builds a pdu frame as a REJ response.
279 pdu->ctrl_1 = LLC_PDU_TYPE_S; in llc_pdu_init_as_rej_rsp()
280 pdu->ctrl_1 |= LLC_2_PDU_RSP_REJ; in llc_pdu_init_as_rej_rsp()
281 pdu->ctrl_2 = 0; in llc_pdu_init_as_rej_rsp()
282 pdu->ctrl_2 |= f_bit & LLC_S_PF_BIT_MASK; in llc_pdu_init_as_rej_rsp()
283 pdu->ctrl_1 &= 0x0F; /* setting bits 5..8 to zero(reserved) */ in llc_pdu_init_as_rej_rsp()
284 pdu->ctrl_2 |= (nr << 1) & 0xFE; /* set N(R) in bits 10..16 */ in llc_pdu_init_as_rej_rsp()
288 * llc_pdu_init_as_rnr_rsp - builds RNR response pdu
289 * @skb: Address of the frame to build
291 * @nr: The seq. number of the expected data PDU from the remote
293 * Builds a pdu frame as an RNR response.
299 pdu->ctrl_1 = LLC_PDU_TYPE_S; in llc_pdu_init_as_rnr_rsp()
300 pdu->ctrl_1 |= LLC_2_PDU_RSP_RNR; in llc_pdu_init_as_rnr_rsp()
301 pdu->ctrl_2 = 0; in llc_pdu_init_as_rnr_rsp()
302 pdu->ctrl_2 |= f_bit & LLC_S_PF_BIT_MASK; in llc_pdu_init_as_rnr_rsp()
303 pdu->ctrl_1 &= 0x0F; /* setting bits 5..8 to zero(reserved) */ in llc_pdu_init_as_rnr_rsp()
304 pdu->ctrl_2 |= (nr << 1) & 0xFE; /* set N(R) in bits 10..16 */ in llc_pdu_init_as_rnr_rsp()
308 * llc_pdu_init_as_ua_rsp - builds UA response pdu
309 * @skb: Address of the frame to build
312 * Builds a pdu frame as a UA response.
318 pdu->ctrl_1 = LLC_PDU_TYPE_U; in llc_pdu_init_as_ua_rsp()
319 pdu->ctrl_1 |= LLC_2_PDU_RSP_UA; in llc_pdu_init_as_ua_rsp()
320 pdu->ctrl_1 |= ((f_bit & 1) << 4) & LLC_U_PF_BIT_MASK; in llc_pdu_init_as_ua_rsp()
324 * llc_pdu_decode_pdu_type - designates PDU type
334 if (pdu->ctrl_1 & 1) { in llc_pdu_decode_pdu_type()
335 if ((pdu->ctrl_1 & LLC_PDU_TYPE_U) == LLC_PDU_TYPE_U) in llc_pdu_decode_pdu_type()
344 * llc_pdu_get_pf_bit - extracts p/f bit of input PDU
355 if (pdu->ctrl_1 & 1) { in llc_pdu_get_pf_bit()
356 if ((pdu->ctrl_1 & LLC_PDU_TYPE_U) == LLC_PDU_TYPE_U) in llc_pdu_get_pf_bit()
365 pf_bit = pdu->ctrl_2 & LLC_S_PF_BIT_MASK; in llc_pdu_get_pf_bit()
368 pf_bit = (pdu->ctrl_1 & LLC_U_PF_BIT_MASK) >> 4; in llc_pdu_get_pf_bit()