| 函数逻辑报告 | 
| Source Code: block\scsi_ioctl.c | Create Date:2022-07-27 19:12:00 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:sg_scsi_ioctl -- handle deprecated SCSI_IOCTL_SEND_COMMAND ioctl*@q: request queue to send scsi commands down*@disk: gendisk to operate on (option)*@mode: mode used to open the file through which the ioctl has been* submitted*@sic: userspace structure
函数原型:int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, struct scsi_ioctl_command __user *sic)
返回类型:int
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| struct request_queue * | q | |
| struct gendisk * | disk | |
| fmode_t | mode | |
| struct scsi_ioctl_command __user * | sic | 
| 416 | enum{OMAX_SB_LEN = 16} | 
| 421 | char * buffer = NULL | 
| 429 | 如果Careful: we have to cast the result to the type of the pointer* for sign reasons(in_len, & inlen)则返回:负EFAULT | 
| 431 | 如果Careful: we have to cast the result to the type of the pointer* for sign reasons(out_len, & outlen)则返回:负EFAULT | 
| 435 | 如果Careful: we have to cast the result to the type of the pointer* for sign reasons(opcode, data)则返回:负EFAULT | 
| 439 | 如果bytes则 | 
| 446 | rq等于lk_get_request - allocate a request*@q: request queue to allocate a request for*@op: operation (REQ_OP_*) and REQ_* flags, e.g. REQ_SYNC.*@flags: BLK_MQ_REQ_* flags, e.g. BLK_MQ_REQ_NOWAIT. | 
| 447 | 如果是错误则 | 
| 449 | 转到:error_free_buffer | 
| 453 | cmdlen等于COMMAND_SIZE(opcode) | 
| 460 | 如果copy_from_user(cmd, data, cmdlen)则转到:error | 
| 466 | err等于blk_verify_command(cmd, mode) | 
| 471 | retries等于5 | 
| 474 | 当:opcode恒等于SEND_DIAGNOSTIC | 
| 475 | 当:opcode恒等于FORMAT_UNIT | 
| 479 | 当:opcode恒等于START_STOP | 
| 481 | 退出 | 
| 482 | 当:opcode恒等于MOVE_MEDIUM | 
| 484 | 退出 | 
| 485 | 当:opcode恒等于READ_ELEMENT_STATUS | 
| 487 | 退出 | 
| 488 | 当:opcode恒等于READ_DEFECT_DATA | 
| 492 | 默认 | 
| 498 | err等于DRIVER_ERROR左移24位 | 
| 499 | 转到:error | 
| 502 | 将请求插入队列执行 | 
| 505 | 如果err则 | 
| 507 | bytes等于如果OMAX_SB_LEN大于sense_len则sense_len否则OMAX_SB_LEN | 
| 512 | 否则 | 
| 517 | error : | 
| 518 | blk_put_request(rq) | 
| 520 | error_free_buffer : | 
| 521 | 释放内存 | 
| 523 | 返回:err | 
| 名称 | 描述 | 
|---|---|
| scsi_cmd_ioctl | 
| 源代码转换工具 开放的插件接口 | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |