函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\sed-opal.c Create Date:2022-07-27 19:47:26
Last Modify:2020-03-17 23:36:33 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:read_table_data

函数原型:static int read_table_data(struct opal_dev *dev, void *data)

返回类型:int

参数:

类型参数名称
struct opal_dev *dev
void *data
2006  read_tbl等于data
2008  off等于0, max_read_size等于IO_BUFFER_LENGTH = 2048* sizeof(header) = 56* No. of Token Bytes in the Response = 11* MAX size of data that can be carried in response buffer* at a time is : 2048 - (56 + 11) = 1981 = 0x7BD.
2010  offset等于offset, read_size等于size减1
2011  __userdst
2013  err等于see TCG SAS 5.3.2.3 for a description of the available columns* the result is provided in dev->resp->tok[4]
2014  如果err
2015  pr_debug("Couldn't get the table size\n")
2016  返回:err
2019  table_len等于response_get_u64( & parsed, 4)
2022  如果read_size大于table_lenoffset大于table_lenread_size
2023  pr_debug("Read size exceeds the Table size limits (%llu vs. %llu)\n", offset + read_size, table_len)
2025  返回:负EINVAL
2028 off小于read_size循环
2029  err等于cmd_start(dev, table_uid, TCG Storage SSC Methods.* Derived from: TCG_Storage_Architecture_Core_Spec_v2.01_r1.00* Section: 6.3 Assigned UIDs[OPAL_GET])
2031  add_token_u8( & err, dev, OPAL_STARTLIST)
2032  add_token_u8( & err, dev, OPAL_STARTNAME)
2033  add_token_u8( & err, dev, OPAL_STARTROW)
2034  add_token_u64( & err, dev, offset + off)
2035  add_token_u8( & err, dev, OPAL_ENDNAME)
2037  add_token_u8( & err, dev, OPAL_STARTNAME)
2038  add_token_u8( & err, dev, OPAL_ENDROW)
2040  len等于两数取小(max_read_size, (size_t)(read_size - off))
2042  add_token_u64( & err, dev, offset + off + len)
2043  add_token_u8( & err, dev, OPAL_ENDNAME)
2044  add_token_u8( & err, dev, OPAL_ENDLIST)
2046  如果err
2047  pr_debug("Error building read table data command.\n")
2048  退出
2051  err等于finalize_and_send(dev, read_table_data_cont)
2052  如果err退出
2056  如果prev_d_len大于len加1则
2057  err等于负EOVERFLOW
2058  退出
2061  dst等于data
2062  如果copy_to_user(dst + off, prev_data, prev_d_len)则
2063  pr_debug("Error copying data to userspace\n")
2064  err等于负EFAULT
2065  退出
2067  prev_data = NULL
2069  off加等于len
2072  返回:err