Lines Matching refs:hdlcrx

119 	while (s->hdlcrx.rx_state && num >= 8) {  in hdlc_rx_add_bytes()
120 if (s->hdlcrx.len >= sizeof(s->hdlcrx.buffer)) { in hdlc_rx_add_bytes()
121 s->hdlcrx.rx_state = 0; in hdlc_rx_add_bytes()
124 *s->hdlcrx.bp++ = bits >> (32-num); in hdlc_rx_add_bytes()
125 s->hdlcrx.len++; in hdlc_rx_add_bytes()
138 if (s->hdlcrx.len < 4) in hdlc_rx_flag()
140 if (!check_crc_ccitt(s->hdlcrx.buffer, s->hdlcrx.len)) in hdlc_rx_flag()
142 pkt_len = s->hdlcrx.len - 2 + 1; /* KISS kludge */ in hdlc_rx_flag()
150 memcpy(cp, s->hdlcrx.buffer, pkt_len - 1); in hdlc_rx_flag()
163 if (test_and_set_bit(0, &s->hdlcrx.in_hdlc_rx)) in hdlcdrv_receiver()
166 while (!hdlcdrv_hbuf_empty(&s->hdlcrx.hbuf)) { in hdlcdrv_receiver()
167 word = hdlcdrv_hbuf_get(&s->hdlcrx.hbuf); in hdlcdrv_receiver()
172 s->hdlcrx.bitstream >>= 16; in hdlcdrv_receiver()
173 s->hdlcrx.bitstream |= word << 16; in hdlcdrv_receiver()
174 s->hdlcrx.bitbuf >>= 16; in hdlcdrv_receiver()
175 s->hdlcrx.bitbuf |= word << 16; in hdlcdrv_receiver()
176 s->hdlcrx.numbits += 16; in hdlcdrv_receiver()
182 if ((s->hdlcrx.bitstream & mask1) == mask1) in hdlcdrv_receiver()
183 s->hdlcrx.rx_state = 0; /* abort received */ in hdlcdrv_receiver()
184 else if ((s->hdlcrx.bitstream & mask2) == mask3) { in hdlcdrv_receiver()
186 if (s->hdlcrx.rx_state) { in hdlcdrv_receiver()
187 hdlc_rx_add_bytes(s, s->hdlcrx.bitbuf in hdlcdrv_receiver()
189 s->hdlcrx.numbits in hdlcdrv_receiver()
193 s->hdlcrx.len = 0; in hdlcdrv_receiver()
194 s->hdlcrx.bp = s->hdlcrx.buffer; in hdlcdrv_receiver()
195 s->hdlcrx.rx_state = 1; in hdlcdrv_receiver()
196 s->hdlcrx.numbits = i; in hdlcdrv_receiver()
197 } else if ((s->hdlcrx.bitstream & mask4) == mask5) { in hdlcdrv_receiver()
199 s->hdlcrx.numbits--; in hdlcdrv_receiver()
200 s->hdlcrx.bitbuf = (s->hdlcrx.bitbuf & (~mask6)) | in hdlcdrv_receiver()
201 ((s->hdlcrx.bitbuf & mask6) << 1); in hdlcdrv_receiver()
204 s->hdlcrx.numbits -= hdlc_rx_add_bytes(s, s->hdlcrx.bitbuf, in hdlcdrv_receiver()
205 s->hdlcrx.numbits); in hdlcdrv_receiver()
207 clear_bit(0, &s->hdlcrx.in_hdlc_rx); in hdlcdrv_receiver()
373 if (s->hdlcrx.dcd) { in hdlcdrv_arbitrate()
445 s->hdlcrx.hbuf.rd = s->hdlcrx.hbuf.wr = 0; in hdlcdrv_open()
446 s->hdlcrx.in_hdlc_rx = 0; in hdlcdrv_open()
447 s->hdlcrx.rx_state = 0; in hdlcdrv_open()
551 bi.data.cs.dcd = s->hdlcrx.dcd; in hdlcdrv_siocdevprivate()
561 bi.data.ocs.dcd = s->hdlcrx.dcd; in hdlcdrv_siocdevprivate()
643 spin_lock_init(&s->hdlcrx.hbuf.lock); in hdlcdrv_setup()
644 s->hdlcrx.hbuf.rd = s->hdlcrx.hbuf.wr = 0; in hdlcdrv_setup()
645 s->hdlcrx.in_hdlc_rx = 0; in hdlcdrv_setup()
646 s->hdlcrx.rx_state = 0; in hdlcdrv_setup()