Lines Matching full:hp
423 struct compat_sg_io_hdr __user *hp = buf; in get_sg_io_pack_id() local
425 return get_user(*pack_id, &hp->pack_id); in get_sg_io_pack_id()
429 struct sg_io_hdr __user *hp = buf; in get_sg_io_pack_id() local
431 return get_user(*pack_id, &hp->pack_id); in get_sg_io_pack_id()
448 sg_io_hdr_t *hp; in sg_read() local
484 hp = &srp->header; in sg_read()
489 old_hdr->reply_len = (int) hp->timeout; in sg_read()
491 old_hdr->pack_id = hp->pack_id; in sg_read()
493 ((srp->data.cmd_opcode >= 0xc0) && (12 == hp->cmd_len)) ? 1 : 0; in sg_read()
494 old_hdr->target_status = hp->masked_status; in sg_read()
495 old_hdr->host_status = hp->host_status; in sg_read()
496 old_hdr->driver_status = hp->driver_status; in sg_read()
497 if ((CHECK_CONDITION & hp->masked_status) || in sg_read()
503 switch (hp->host_status) { in sg_read()
525 hp->masked_status == GOOD) ? 0 : EIO; in sg_read()
560 sg_io_hdr_t *hp = &srp->header; in sg_new_read() local
573 hp->sb_len_wr = 0; in sg_new_read()
574 if ((hp->mx_sb_len > 0) && hp->sbp) { in sg_new_read()
575 if ((CHECK_CONDITION & hp->masked_status) || in sg_new_read()
578 sb_len = (hp->mx_sb_len > sb_len) ? sb_len : hp->mx_sb_len; in sg_new_read()
581 if (copy_to_user(hp->sbp, srp->sense_b, len)) { in sg_new_read()
585 hp->driver_status = DRIVER_SENSE; in sg_new_read()
586 hp->sb_len_wr = len; in sg_new_read()
589 if (hp->masked_status || hp->host_status || hp->driver_status) in sg_new_read()
590 hp->info |= SG_INFO_CHECK; in sg_new_read()
591 err = put_sg_io_hdr(hp, buf); in sg_new_read()
608 sg_io_hdr_t *hp; in sg_write() local
667 hp = &srp->header; in sg_write()
668 hp->interface_id = '\0'; /* indicator of old interface tunnelled */ in sg_write()
669 hp->cmd_len = (unsigned char) cmd_size; in sg_write()
670 hp->iovec_count = 0; in sg_write()
671 hp->mx_sb_len = 0; in sg_write()
673 hp->dxfer_direction = (old_hdr.reply_len > SZ_SG_HEADER) ? in sg_write()
676 hp->dxfer_direction = (mxsize > 0) ? SG_DXFER_FROM_DEV : SG_DXFER_NONE; in sg_write()
677 hp->dxfer_len = mxsize; in sg_write()
678 if ((hp->dxfer_direction == SG_DXFER_TO_DEV) || in sg_write()
679 (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV)) in sg_write()
680 hp->dxferp = (char __user *)buf + cmd_size; in sg_write()
682 hp->dxferp = NULL; in sg_write()
683 hp->sbp = NULL; in sg_write()
684 hp->timeout = old_hdr.reply_len; /* structure abuse ... */ in sg_write()
685 hp->flags = input_size; /* structure abuse ... */ in sg_write()
686 hp->pack_id = old_hdr.pack_id; in sg_write()
687 hp->usr_ptr = NULL; in sg_write()
697 if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) { in sg_write()
718 sg_io_hdr_t *hp; in sg_new_write() local
733 hp = &srp->header; in sg_new_write()
734 if (get_sg_io_hdr(hp, buf)) { in sg_new_write()
738 if (hp->interface_id != 'S') { in sg_new_write()
742 if (hp->flags & SG_FLAG_MMAP_IO) { in sg_new_write()
743 if (hp->dxfer_len > sfp->reserve.bufflen) { in sg_new_write()
747 if (hp->flags & SG_FLAG_DIRECT_IO) { in sg_new_write()
758 if ((!hp->cmdp) || (hp->cmd_len < 6) || (hp->cmd_len > sizeof (cmnd))) { in sg_new_write()
762 if (copy_from_user(cmnd, hp->cmdp, hp->cmd_len)) { in sg_new_write()
784 sg_io_hdr_t *hp = &srp->header; in sg_common_write() local
787 hp->status = 0; in sg_common_write()
788 hp->masked_status = 0; in sg_common_write()
789 hp->msg_status = 0; in sg_common_write()
790 hp->info = 0; in sg_common_write()
791 hp->host_status = 0; in sg_common_write()
792 hp->driver_status = 0; in sg_common_write()
793 hp->resid = 0; in sg_common_write()
796 (int) cmnd[0], (int) hp->cmd_len)); in sg_common_write()
798 if (hp->dxfer_len >= SZ_256M) { in sg_common_write()
822 hp->duration = jiffies_to_msecs(jiffies); in sg_common_write()
823 if (hp->interface_id != '\0' && /* v3 (or later) interface */ in sg_common_write()
824 (SG_FLAG_Q_AT_TAIL & hp->flags)) in sg_common_write()
1721 sg_io_hdr_t *hp = &srp->header; in sg_start_req() local
1722 int dxfer_len = (int) hp->dxfer_len; in sg_start_req()
1723 int dxfer_dir = hp->dxfer_direction; in sg_start_req()
1724 unsigned int iov_count = hp->iovec_count; in sg_start_req()
1729 int rw = hp->dxfer_direction == SG_DXFER_TO_DEV ? WRITE : READ; in sg_start_req()
1747 rq = scsi_alloc_request(q, hp->dxfer_direction == SG_DXFER_TO_DEV ? in sg_start_req()
1753 if (hp->cmd_len > sizeof(scmd->cmnd)) { in sg_start_req()
1758 memcpy(scmd->cmnd, cmd, hp->cmd_len); in sg_start_req()
1759 scmd->cmd_len = hp->cmd_len; in sg_start_req()
1768 if (sg_allow_dio && hp->flags & SG_FLAG_DIRECT_IO && in sg_start_req()
1770 blk_rq_aligned(q, (unsigned long)hp->dxferp, dxfer_len)) in sg_start_req()
1781 } else if (hp->flags & SG_FLAG_MMAP_IO) { in sg_start_req()
1800 md->null_mapped = hp->dxferp ? 0 : 1; in sg_start_req()
1807 res = blk_rq_map_user_io(rq, md, hp->dxferp, hp->dxfer_len, in sg_start_req()
1814 hp->info |= SG_INFO_DIRECT_IO; in sg_start_req()
2521 const sg_io_hdr_t *hp; in sg_proc_debug_helper() local
2538 hp = &srp->header; in sg_proc_debug_helper()
2539 new_interface = (hp->interface_id == '\0') ? 0 : 1; in sg_proc_debug_helper()
2542 (SG_FLAG_MMAP_IO & hp->flags)) in sg_proc_debug_helper()
2547 if (SG_INFO_DIRECT_IO_MASK & hp->info) in sg_proc_debug_helper()
2561 seq_printf(s, " dur=%d", hp->duration); in sg_proc_debug_helper()
2565 (new_interface ? hp->timeout : in sg_proc_debug_helper()
2567 (ms > hp->duration ? ms - hp->duration : 0)); in sg_proc_debug_helper()