函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\scsi_ioctl.c Create Date:2022-07-27 19:12:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:scsi_cmd_ioctl

函数原型:int scsi_cmd_ioctl(struct request_queue *q, struct gendisk *bd_disk, fmode_t mode, unsigned int cmd, void __user *arg)

返回类型:int

参数:

类型参数名称
struct request_queue *q
struct gendisk *bd_disk
fmode_tmode
unsigned intcmd
void __user *arg
647  如果非q则返回:负ENXIO
654  :cmd恒等于Example: version 2.1.34 yields 20134
655  err等于sg_get_version(arg)
656  退出
657  :cmd恒等于Used to obtain PUN and LUN info. Conflicts with CDROMAUDIOBUFSIZ
658  err等于scsi_get_idlun(q, arg)
659  退出
660  :cmd恒等于Used to obtain the bus number for a device
661  err等于scsi_get_bus(q, arg)
662  退出
663  :cmd恒等于unit: jiffies (10ms on i386)
664  err等于sg_set_timeout(q, arg)
665  退出
666  :cmd恒等于yield timeout as _return_ value
667  err等于sg_get_timeout(q)
668  退出
669  :cmd恒等于actual size of reserved buffer
670  err等于sg_get_reserved_size(q, arg)
671  退出
672  :cmd恒等于quest a new reserved buffer size
673  err等于sg_set_reserved_size(q, arg)
674  退出
675  :cmd恒等于rue for emulated host adapter (ATAPI)
676  err等于will always return that we are ATAPI even for a real SCSI drive, I'm not* so sure this is worth doing anything about (why would you care??)
677  退出
678  :cmd恒等于similar effect as write() followed by read()
681  err等于get_sg_io_hdr( & hdr, arg)
682  如果err退出
684  err等于sg_io(q, bd_disk, & hdr, mode)
685  如果err恒等于负EFAULT退出
688  如果put_sg_io_hdr( & hdr, arg)则err等于负EFAULT
690  退出
692  :cmd恒等于send a packet to the drive
696  err等于负EFAULT
697  如果copy_from_user( & cgc, arg, cgc的长度)则退出
699  timeout等于clock_t_to_jiffies(timeout)
700  memset( & hdr, 0, hdr的长度)
701  [i] 'S' for SCSI generic (required) 等于'S'
702  [i] SCSI command length 等于cmd的长度
703  [i] byte count of data transfer 等于buflen
704  err等于0
708  退出
711  退出
714  退出
717  退出
718  默认
719  err等于负EINVAL
721  如果err退出
724  [i], [*io] points to data transfer memory or scatter gather list 等于buffer
725  [i], [*o] points to sense_buffer memory 等于sense
726  如果 [i], [*o] points to sense_buffer memory [i] max length to write to sbp 等于sizeof(structrequest_sense)
728  [i] MAX_UINT->no timeout (unit: millisec) 等于Convert jiffies to milliseconds and back.* Avoid unnecessary multiplications/divisions in the* two most common HZ cases:
729  [i], [*i] points to command to perform 等于cmd
730  [i] SCSI command length 等于cmd的长度
732  err等于sg_io(q, bd_disk, & hdr, mode)
733  如果err恒等于负EFAULT退出
736  如果 [o] scsi status err等于负EIO
739  stat等于err
740  buflen等于 [o] dxfer_len - actual_transferred
741  如果copy_to_user(arg, & cgc, cgc的长度)则err等于负EFAULT
744  退出
750  :cmd恒等于SCSI_IOCTL_SEND_COMMAND
751  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
752  err等于负EINVAL
753  如果非arg退出
756  err等于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
757  退出
758  :cmd恒等于pendant of CDROMEJECT
759  err等于blk_send_start_stop(q, bd_disk, 0x03)
760  退出
761  :cmd恒等于Ejects the cdrom media
762  err等于blk_send_start_stop(q, bd_disk, 0x02)
763  退出
764  默认
765  err等于负ENOTTY
768  返回:err
调用者
名称描述
scsi_cmd_blk_ioctl
bsg_ioctl