Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\sed-opal.c Create Date:2022-07-28 18:10:47
Last Modify:2020-03-17 23:36:33 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:response_parse

Proto:static int response_parse(const u8 *buf, size_t length, struct parsed_resp *resp)

Type:int

Parameter:

TypeParameterName
const u8 *buf
size_tlength
struct parsed_resp *resp
853  num_entries = 0
859  If Not buf Then Return -EFAULT
862  If Not resp Then Return -EFAULT
865  hdr = buf
866  pos = buf
867  pos += size of hdr
869  clen = be32_to_cpu(length)
870  plen = be32_to_cpu(length)
871  slen = be32_to_cpu(length)
872  pr_debug("Response size: cp: %u, pkt: %u, subpkt: %u\n", clen, plen, slen)
875  If clen == 0 || plen == 0 || slen == 0 || slen > IO_BUFFER_LENGTH - size of hdr Then
877  pr_debug("Bad header length. cp: %u, pkt: %u, subpkt: %u\n", clen, plen, slen)
879  print_buffer(pos, size of hdr )
880  Return -EINVAL
883  If pos > buf + length Then Return -EFAULT
886  iter = toks
887  total = slen
888  print_buffer(pos, total)
889  When total > 0 cycle
890  If pos[0] <= Derived from TCG Core spec 2.01 Section:* 3.2.2.1* Data Type Then token_length = response_parse_tiny(iter, pos)
892  Else if pos[0] <= SHORT_ATOM_BYTE Then token_length = response_parse_short(iter, pos)
894  Else if pos[0] <= MEDIUM_ATOM_BYTE Then token_length = response_parse_medium(iter, pos)
896  Else if pos[0] <= LONG_ATOM_BYTE Then token_length = response_parse_long(iter, pos)
898  Else token_length = response_parse_token(iter, pos)
901  If token_length < 0 Then Return token_length
904  pos += token_length
905  total -= token_length
906  iter++
907  num_entries++
910  num = num_entries
912  Return 0
Caller
NameDescribe
parse_and_check_statusParses and checks for errors