Lines Matching full:fcs
221 u8 fcs; member
369 * gsm_fcs_add - update FCS
370 * @fcs: Current FCS
373 * Update the FCS to include c. Uses the algorithm in the specification
377 static inline u8 gsm_fcs_add(u8 fcs, u8 c) in gsm_fcs_add() argument
379 return gsm_fcs8[fcs ^ c]; in gsm_fcs_add()
383 * gsm_fcs_add_block - update FCS for a block
384 * @fcs: Current FCS
388 * Update the FCS to include c. Uses the algorithm in the specification
392 static inline u8 gsm_fcs_add_block(u8 fcs, u8 *c, int len) in gsm_fcs_add_block() argument
395 fcs = gsm_fcs8[fcs ^ *c++]; in gsm_fcs_add_block()
396 return fcs; in gsm_fcs_add_block()
623 #define HDR_LEN 6 /* ADDR CTRL [LEN.2] DATA FCS */
629 * @len: length excluding header and FCS
644 m->data = m->buffer + HDR_LEN - 1; /* Allow for FCS */ in gsm_data_alloc()
724 u8 *fcs = dp + msg->len; in __gsm_data_queue() local
741 *fcs = gsm_fcs_add_block(INIT_FCS, dp , msg->data - dp); in __gsm_data_queue()
744 *fcs = gsm_fcs_add_block(*fcs, msg->data, msg->len); in __gsm_data_queue()
745 *fcs = 0xFF - *fcs; in __gsm_data_queue()
750 /* Move the header back and adjust the length, also allow for the FCS in __gsm_data_queue()
1743 * The fcs holds the header FCS but any data FCS must be added here.
1751 /* We have to sneak a look at the packet body to do the FCS. in gsm_queue()
1755 gsm->fcs = gsm_fcs_add_block(gsm->fcs, gsm->buf, gsm->len); in gsm_queue()
1761 gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->received_fcs); in gsm_queue()
1763 if (gsm->fcs != GOOD_FCS) { in gsm_queue()
1766 pr_debug("BAD FCS %02x\n", gsm->fcs); in gsm_queue()
1873 gsm->fcs = INIT_FCS; in gsm0_receive()
1877 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
1882 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
1887 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
1904 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm0_receive()
1923 case GSM_FCS: /* FCS follows the packet */ in gsm0_receive()
1952 and received at least one byte (the FCS) */ in gsm1_receive()
1954 /* Extract the FCS */ in gsm1_receive()
1956 gsm->fcs = gsm_fcs_add(gsm->fcs, gsm->buf[gsm->count]); in gsm1_receive()
1989 gsm->fcs = INIT_FCS; in gsm1_receive()
1992 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm1_receive()
1997 gsm->fcs = gsm_fcs_add(gsm->fcs, c); in gsm1_receive()
2003 if (gsm->count > gsm->mru) { /* Allow one for the FCS */ in gsm1_receive()