Lines Matching full:fcs

75 /* SOF, ADDR, CTRL, LEN1, LEN2, ..., FCS, EOF */
222 u8 fcs; member
372 * gsm_fcs_add - update FCS
373 * @fcs: Current FCS
376 * Update the FCS to include c. Uses the algorithm in the specification
380 static inline u8 gsm_fcs_add(u8 fcs, u8 c) in gsm_fcs_add() argument
382 return gsm_fcs8[fcs ^ c]; in gsm_fcs_add()
386 * gsm_fcs_add_block - update FCS for a block
387 * @fcs: Current FCS
391 * Update the FCS to include c. Uses the algorithm in the specification
395 static inline u8 gsm_fcs_add_block(u8 fcs, u8 *c, int len) in gsm_fcs_add_block() argument
398 fcs = gsm_fcs8[fcs ^ *c++]; in gsm_fcs_add_block()
399 return fcs; in gsm_fcs_add_block()
648 #define HDR_LEN 6 /* ADDR CTRL [LEN.2] DATA FCS */
654 * @len: length excluding header and FCS
669 m->data = m->buffer + HDR_LEN - 1; /* Allow for FCS */ in gsm_data_alloc()
779 u8 *fcs = dp + msg->len; in __gsm_data_queue() local
796 *fcs = gsm_fcs_add_block(INIT_FCS, dp , msg->data - dp); in __gsm_data_queue()
799 *fcs = gsm_fcs_add_block(*fcs, msg->data, msg->len); in __gsm_data_queue()
800 *fcs = 0xFF - *fcs; in __gsm_data_queue()
805 /* Move the header back and adjust the length, also allow for the FCS in __gsm_data_queue()
1845 * The fcs holds the header FCS but any data FCS must be added here.
1853 /* We have to sneak a look at the packet body to do the FCS. in gsm_queue()
1857 gsm->fcs = gsm_fcs_add_block(gsm->fcs, gsm->buf, gsm->len); in gsm_queue()
1863 gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs); in gsm_queue()
1865 if (gsm->fcs != GOOD_FCS) { in gsm_queue()
1868 pr_debug("BAD FCS %02x\n", gsm->fcs); in gsm_queue()
1974 gsm->fcs = INIT_FCS; in gsm0_receive()
1978 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
1983 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
1988 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
2005 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
2024 case GSM_FCS: /* FCS follows the packet */ in gsm0_receive()
2063 and received at least one byte (the FCS) */ in gsm1_receive()
2065 /* Extract the FCS */ in gsm1_receive()
2067 gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->buf[gsm->count]); in gsm1_receive()
2101 gsm->fcs = INIT_FCS; in gsm1_receive()
2104 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm1_receive()
2109 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm1_receive()
2115 if (gsm->count > gsm->mru) { /* Allow one for the FCS */ in gsm1_receive()