iocommand 6342 drivers/scsi/hpsa.c IOCTL_Command_struct iocommand; iocommand 6352 drivers/scsi/hpsa.c if (copy_from_user(&iocommand, argp, sizeof(iocommand))) iocommand 6354 drivers/scsi/hpsa.c if ((iocommand.buf_size < 1) && iocommand 6355 drivers/scsi/hpsa.c (iocommand.Request.Type.Direction != XFER_NONE)) { iocommand 6358 drivers/scsi/hpsa.c if (iocommand.buf_size > 0) { iocommand 6359 drivers/scsi/hpsa.c buff = kmalloc(iocommand.buf_size, GFP_KERNEL); iocommand 6362 drivers/scsi/hpsa.c if (iocommand.Request.Type.Direction & XFER_WRITE) { iocommand 6364 drivers/scsi/hpsa.c if (copy_from_user(buff, iocommand.buf, iocommand 6365 drivers/scsi/hpsa.c iocommand.buf_size)) { iocommand 6370 drivers/scsi/hpsa.c memset(buff, 0, iocommand.buf_size); iocommand 6380 drivers/scsi/hpsa.c if (iocommand.buf_size > 0) { /* buffer to fill */ iocommand 6387 drivers/scsi/hpsa.c memcpy(&c->Header.LUN, &iocommand.LUN_info, sizeof(c->Header.LUN)); iocommand 6390 drivers/scsi/hpsa.c memcpy(&c->Request, &iocommand.Request, iocommand 6394 drivers/scsi/hpsa.c if (iocommand.buf_size > 0) { iocommand 6396 drivers/scsi/hpsa.c iocommand.buf_size, DMA_BIDIRECTIONAL); iocommand 6404 drivers/scsi/hpsa.c c->SG[0].Len = cpu_to_le32(iocommand.buf_size); iocommand 6409 drivers/scsi/hpsa.c if (iocommand.buf_size > 0) iocommand 6418 drivers/scsi/hpsa.c memcpy(&iocommand.error_info, c->err_info, iocommand 6419 drivers/scsi/hpsa.c sizeof(iocommand.error_info)); iocommand 6420 drivers/scsi/hpsa.c if (copy_to_user(argp, &iocommand, sizeof(iocommand))) { iocommand 6424 drivers/scsi/hpsa.c if ((iocommand.Request.Type.Direction & XFER_READ) && iocommand 6425 drivers/scsi/hpsa.c iocommand.buf_size > 0) { iocommand 6427 drivers/scsi/hpsa.c if (copy_to_user(iocommand.buf, buff, iocommand.buf_size)) { iocommand 5936 drivers/scsi/smartpqi/smartpqi_init.c IOCTL_Command_struct iocommand; iocommand 5947 drivers/scsi/smartpqi/smartpqi_init.c if (copy_from_user(&iocommand, arg, sizeof(iocommand))) iocommand 5949 drivers/scsi/smartpqi/smartpqi_init.c if (iocommand.buf_size < 1 && iocommand 5950 drivers/scsi/smartpqi/smartpqi_init.c iocommand.Request.Type.Direction != XFER_NONE) iocommand 5952 drivers/scsi/smartpqi/smartpqi_init.c if (iocommand.Request.CDBLen > sizeof(request.cdb)) iocommand 5954 drivers/scsi/smartpqi/smartpqi_init.c if (iocommand.Request.Type.Type != TYPE_CMD) iocommand 5957 drivers/scsi/smartpqi/smartpqi_init.c switch (iocommand.Request.Type.Direction) { iocommand 5967 drivers/scsi/smartpqi/smartpqi_init.c if (iocommand.buf_size > 0) { iocommand 5968 drivers/scsi/smartpqi/smartpqi_init.c kernel_buffer = kmalloc(iocommand.buf_size, GFP_KERNEL); iocommand 5971 drivers/scsi/smartpqi/smartpqi_init.c if (iocommand.Request.Type.Direction & XFER_WRITE) { iocommand 5972 drivers/scsi/smartpqi/smartpqi_init.c if (copy_from_user(kernel_buffer, iocommand.buf, iocommand 5973 drivers/scsi/smartpqi/smartpqi_init.c iocommand.buf_size)) { iocommand 5978 drivers/scsi/smartpqi/smartpqi_init.c memset(kernel_buffer, 0, iocommand.buf_size); iocommand 5987 drivers/scsi/smartpqi/smartpqi_init.c memcpy(request.lun_number, iocommand.LUN_info.LunAddrBytes, iocommand 5989 drivers/scsi/smartpqi/smartpqi_init.c memcpy(request.cdb, iocommand.Request.CDB, iocommand.Request.CDBLen); iocommand 5992 drivers/scsi/smartpqi/smartpqi_init.c switch (iocommand.Request.Type.Direction) { iocommand 6009 drivers/scsi/smartpqi/smartpqi_init.c if (iocommand.buf_size > 0) { iocommand 6010 drivers/scsi/smartpqi/smartpqi_init.c put_unaligned_le32(iocommand.buf_size, &request.buffer_length); iocommand 6014 drivers/scsi/smartpqi/smartpqi_init.c iocommand.buf_size, DMA_BIDIRECTIONAL); iocommand 6026 drivers/scsi/smartpqi/smartpqi_init.c if (iocommand.buf_size > 0) iocommand 6030 drivers/scsi/smartpqi/smartpqi_init.c memset(&iocommand.error_info, 0, sizeof(iocommand.error_info)); iocommand 6034 drivers/scsi/smartpqi/smartpqi_init.c iocommand.error_info.ScsiStatus = ciss_error_info.scsi_status; iocommand 6035 drivers/scsi/smartpqi/smartpqi_init.c iocommand.error_info.CommandStatus = iocommand 6040 drivers/scsi/smartpqi/smartpqi_init.c sizeof(iocommand.error_info.SenseInfo)) iocommand 6042 drivers/scsi/smartpqi/smartpqi_init.c sizeof(iocommand.error_info.SenseInfo); iocommand 6043 drivers/scsi/smartpqi/smartpqi_init.c memcpy(iocommand.error_info.SenseInfo, iocommand 6045 drivers/scsi/smartpqi/smartpqi_init.c iocommand.error_info.SenseLen = sense_data_length; iocommand 6049 drivers/scsi/smartpqi/smartpqi_init.c if (copy_to_user(arg, &iocommand, sizeof(iocommand))) { iocommand 6054 drivers/scsi/smartpqi/smartpqi_init.c if (rc == 0 && iocommand.buf_size > 0 && iocommand 6055 drivers/scsi/smartpqi/smartpqi_init.c (iocommand.Request.Type.Direction & XFER_READ)) { iocommand 6056 drivers/scsi/smartpqi/smartpqi_init.c if (copy_to_user(iocommand.buf, kernel_buffer, iocommand 6057 drivers/scsi/smartpqi/smartpqi_init.c iocommand.buf_size)) {