Lines Matching refs:part

338 static void calculate_response_part_pec(struct ssif_part_buffer *part)  in calculate_response_part_pec()  argument
340 u8 addr = part->address; in calculate_response_part_pec()
343 part->pec = i2c_smbus_pec(0, &addr, 1); in calculate_response_part_pec()
345 part->pec = i2c_smbus_pec(part->pec, &part->smbus_cmd, 1); in calculate_response_part_pec()
348 part->pec = i2c_smbus_pec(part->pec, &addr, 1); in calculate_response_part_pec()
349 part->pec = i2c_smbus_pec(part->pec, &part->length, 1); in calculate_response_part_pec()
350 if (part->length) in calculate_response_part_pec()
351 part->pec = i2c_smbus_pec(part->pec, part->payload, part->length); in calculate_response_part_pec()
356 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in set_singlepart_response_buffer() local
358 part->address = GET_8BIT_ADDR(ssif_bmc->client->addr); in set_singlepart_response_buffer()
359 part->length = (u8)ssif_bmc->response.len; in set_singlepart_response_buffer()
362 memset(part->payload + part->length, 0, MAX_PAYLOAD_PER_TRANSACTION - part->length); in set_singlepart_response_buffer()
363 memcpy(&part->payload[0], &ssif_bmc->response.payload[0], part->length); in set_singlepart_response_buffer()
368 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in set_multipart_response_buffer() local
371 part->address = GET_8BIT_ADDR(ssif_bmc->client->addr); in set_multipart_response_buffer()
372 switch (part->smbus_cmd) { in set_multipart_response_buffer()
381 part->length = MAX_PAYLOAD_PER_TRANSACTION; in set_multipart_response_buffer()
385 part->payload[0] = 0x00; /* Start Flag */ in set_multipart_response_buffer()
386 part->payload[1] = 0x01; /* Start Flag */ in set_multipart_response_buffer()
388 memcpy(&part->payload[2], &ssif_bmc->response.payload[0], part_len); in set_multipart_response_buffer()
405 memset(&part->payload[0], 0, MAX_PAYLOAD_PER_TRANSACTION); in set_multipart_response_buffer()
406 part->length = ssif_bmc->remain_len + 1; in set_multipart_response_buffer()
409 part->payload[0] = ssif_bmc->block_num; in set_multipart_response_buffer()
417 part->length = MAX_PAYLOAD_PER_TRANSACTION; in set_multipart_response_buffer()
419 part->payload[0] = ssif_bmc->block_num; in set_multipart_response_buffer()
424 memcpy(&part->payload[1], ssif_bmc->response.payload + ssif_bmc->nbytes_processed, in set_multipart_response_buffer()
431 __func__, part->smbus_cmd); in set_multipart_response_buffer()
462 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in handle_read_processed() local
465 if (part->index < part->length) in handle_read_processed()
466 *val = part->payload[part->index]; in handle_read_processed()
467 else if (part->index == part->length && ssif_bmc->pec_support) in handle_read_processed()
468 *val = part->pec; in handle_read_processed()
472 part->index++; in handle_read_processed()
497 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in validate_request_part() local
502 if (part->index == part->length) { in validate_request_part()
509 if (part->index != part->length + 1) { in validate_request_part()
516 part->pec = part->payload[part->length]; in validate_request_part()
519 cpec = i2c_smbus_pec(cpec, &part->smbus_cmd, 1); in validate_request_part()
520 cpec = i2c_smbus_pec(cpec, &part->length, 1); in validate_request_part()
530 if (part->length) in validate_request_part()
531 cpec = i2c_smbus_pec(cpec, part->payload, part->length); in validate_request_part()
533 if (cpec != part->pec) in validate_request_part()
542 struct ssif_part_buffer *part = &ssif_bmc->part_buf; in process_request_part() local
545 switch (part->smbus_cmd) { in process_request_part()
548 ssif_bmc->request.len = part->length; in process_request_part()
549 memcpy(ssif_bmc->request.payload, part->payload, part->length); in process_request_part()
558 len = ssif_bmc->request.len + part->length; in process_request_part()
567 part->payload, part->length); in process_request_part()
568 ssif_bmc->request.len += part->length; in process_request_part()
574 __func__, part->smbus_cmd); in process_request_part()