Lines Matching refs:index
382 int index = 0; in process_ff_sf() local
389 if (frame->data[index++] != rctx->rx_addr.ext_addr) { in process_ff_sf()
409 switch (frame->data[index] & ISOTP_PCI_TYPE_MASK) { in process_ff_sf()
432 sf_len = frame->data[index] & ISOTP_PCI_SF_DL_MASK; in process_ff_sf()
441 sf_len = frame->data[index + 1]; in process_ff_sf()
442 payload_len = index + 2 + sf_len; in process_ff_sf()
444 payload_len = index + 1 + sf_len; in process_ff_sf()
460 net_buf_add_mem(rctx->buf, &frame->data[index], payload_len - index); in process_ff_sf()
487 int index = 0; in process_cf() local
492 if (frame->data[index++] != rctx->rx_addr.ext_addr) { in process_cf()
497 if ((frame->data[index] & ISOTP_PCI_TYPE_MASK) != ISOTP_PCI_TYPE_CF) { in process_cf()
499 frame->data[index] >> ISOTP_PCI_TYPE_POS); in process_cf()
507 if ((frame->data[index++] & ISOTP_PCI_SN_MASK) != rctx->sn_expected++) { in process_cf()
526 if (can_dl != rctx->rx_addr.dl && rctx->length > can_dl - index) { in process_cf()
533 data_len = MIN(rctx->length, can_dl - index); in process_cf()
534 receive_add_mem(rctx, &frame->data[index], data_len); in process_cf()
899 int index = 0; in send_sf() local
909 frame.data[index++] = sctx->tx_addr.ext_addr; in send_sf()
913 len > ISOTP_4BIT_SF_MAX_CAN_DL - 1 - index) { in send_sf()
914 frame.data[index++] = ISOTP_PCI_TYPE_SF; in send_sf()
915 frame.data[index++] = len; in send_sf()
917 frame.data[index++] = ISOTP_PCI_TYPE_SF | len; in send_sf()
920 if (len > sctx->tx_addr.dl - index) { in send_sf()
925 memcpy(&frame.data[index], data, len); in send_sf()
929 len + index > ISOTP_PADDED_FRAME_DL_MIN)) { in send_sf()
934 MAX(ISOTP_PADDED_FRAME_DL_MIN, len + index)); in send_sf()
935 memset(&frame.data[index + len], ISOTP_PAD_BYTE, in send_sf()
936 can_dlc_to_bytes(frame.dlc) - len - index); in send_sf()
938 frame.dlc = can_bytes_to_dlc(len + index); in send_sf()
949 int index = 0; in send_ff() local
959 frame.data[index++] = sctx->tx_addr.ext_addr; in send_ff()
963 frame.data[index++] = ISOTP_PCI_TYPE_FF; in send_ff()
964 frame.data[index++] = 0; in send_ff()
965 frame.data[index++] = (len >> 3 * 8) & 0xFF; in send_ff()
966 frame.data[index++] = (len >> 2 * 8) & 0xFF; in send_ff()
967 frame.data[index++] = (len >> 8) & 0xFF; in send_ff()
968 frame.data[index++] = len & 0xFF; in send_ff()
970 frame.data[index++] = ISOTP_PCI_TYPE_FF | (len >> 8); in send_ff()
971 frame.data[index++] = len & 0xFF; in send_ff()
979 pull_send_ctx_data(sctx, sctx->tx_addr.dl - index); in send_ff()
980 memcpy(&frame.data[index], data, sctx->tx_addr.dl - index); in send_ff()
989 int index = 0; in send_cf() local
998 frame.data[index++] = sctx->tx_addr.ext_addr; in send_cf()
1002 frame.data[index++] = ISOTP_PCI_TYPE_CF | sctx->sn; in send_cf()
1005 len = MIN(rem_len, sctx->tx_addr.dl - index); in send_cf()
1008 memcpy(&frame.data[index], data, len); in send_cf()
1012 len + index > ISOTP_PADDED_FRAME_DL_MIN)) { in send_cf()
1017 MAX(ISOTP_PADDED_FRAME_DL_MIN, len + index)); in send_cf()
1018 memset(&frame.data[index + len], ISOTP_PAD_BYTE, in send_cf()
1019 can_dlc_to_bytes(frame.dlc) - len - index); in send_cf()
1021 frame.dlc = can_bytes_to_dlc(len + index); in send_cf()