Lines Matching refs:part

336 static void calculate_response_part_pec(struct ssif_part_buffer *part)  in calculate_response_part_pec()  argument
338 u8 addr = part->address; in calculate_response_part_pec()
341 part->pec = i2c_smbus_pec(0, &addr, 1); in calculate_response_part_pec()
343 part->pec = i2c_smbus_pec(part->pec, &part->smbus_cmd, 1); in calculate_response_part_pec()
346 part->pec = i2c_smbus_pec(part->pec, &addr, 1); in calculate_response_part_pec()
347 part->pec = i2c_smbus_pec(part->pec, &part->length, 1); in calculate_response_part_pec()
348 if (part->length) in calculate_response_part_pec()
349 part->pec = i2c_smbus_pec(part->pec, part->payload, part->length); in calculate_response_part_pec()
354 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in set_singlepart_response_buffer() local
356 part->address = GET_8BIT_ADDR(ssif_bmc->client->addr); in set_singlepart_response_buffer()
357 part->length = (u8)ssif_bmc->response.len; in set_singlepart_response_buffer()
360 memset(part->payload + part->length, 0, MAX_PAYLOAD_PER_TRANSACTION - part->length); in set_singlepart_response_buffer()
361 memcpy(&part->payload[0], &ssif_bmc->response.payload[0], part->length); in set_singlepart_response_buffer()
366 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in set_multipart_response_buffer() local
369 part->address = GET_8BIT_ADDR(ssif_bmc->client->addr); in set_multipart_response_buffer()
370 switch (part->smbus_cmd) { in set_multipart_response_buffer()
379 part->length = MAX_PAYLOAD_PER_TRANSACTION; in set_multipart_response_buffer()
383 part->payload[0] = 0x00; /* Start Flag */ in set_multipart_response_buffer()
384 part->payload[1] = 0x01; /* Start Flag */ in set_multipart_response_buffer()
386 memcpy(&part->payload[2], &ssif_bmc->response.payload[0], part_len); in set_multipart_response_buffer()
403 memset(&part->payload[0], 0, MAX_PAYLOAD_PER_TRANSACTION); in set_multipart_response_buffer()
404 part->length = ssif_bmc->remain_len + 1; in set_multipart_response_buffer()
407 part->payload[0] = ssif_bmc->block_num; in set_multipart_response_buffer()
415 part->length = MAX_PAYLOAD_PER_TRANSACTION; in set_multipart_response_buffer()
417 part->payload[0] = ssif_bmc->block_num; in set_multipart_response_buffer()
422 memcpy(&part->payload[1], ssif_bmc->response.payload + ssif_bmc->nbytes_processed, in set_multipart_response_buffer()
429 __func__, part->smbus_cmd); in set_multipart_response_buffer()
460 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in handle_read_processed() local
463 if (part->index < part->length) in handle_read_processed()
464 *val = part->payload[part->index]; in handle_read_processed()
465 else if (part->index == part->length && ssif_bmc->pec_support) in handle_read_processed()
466 *val = part->pec; in handle_read_processed()
470 part->index++; in handle_read_processed()
495 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in validate_request_part() local
500 if (part->index == part->length) { in validate_request_part()
507 if (part->index != part->length + 1) { in validate_request_part()
514 part->pec = part->payload[part->length]; in validate_request_part()
517 cpec = i2c_smbus_pec(cpec, &part->smbus_cmd, 1); in validate_request_part()
518 cpec = i2c_smbus_pec(cpec, &part->length, 1); in validate_request_part()
528 if (part->length) in validate_request_part()
529 cpec = i2c_smbus_pec(cpec, part->payload, part->length); in validate_request_part()
531 if (cpec != part->pec) in validate_request_part()
540 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in process_request_part() local
543 switch (part->smbus_cmd) { in process_request_part()
546 ssif_bmc->request.len = part->length; in process_request_part()
547 memcpy(ssif_bmc->request.payload, part->payload, part->length); in process_request_part()
556 len = ssif_bmc->request.len + part->length; in process_request_part()
565 part->payload, part->length); in process_request_part()
566 ssif_bmc->request.len += part->length; in process_request_part()
572 __func__, part->smbus_cmd); in process_request_part()