Lines Matching full:hp

426 			struct compat_sg_io_hdr __user *hp = buf;  in get_sg_io_pack_id()  local
428 return get_user(*pack_id, &hp->pack_id); in get_sg_io_pack_id()
432 struct sg_io_hdr __user *hp = buf; in get_sg_io_pack_id() local
434 return get_user(*pack_id, &hp->pack_id); in get_sg_io_pack_id()
451 sg_io_hdr_t *hp; in sg_read() local
487 hp = &srp->header; in sg_read()
492 old_hdr->reply_len = (int) hp->timeout; in sg_read()
494 old_hdr->pack_id = hp->pack_id; in sg_read()
496 ((srp->data.cmd_opcode >= 0xc0) && (12 == hp->cmd_len)) ? 1 : 0; in sg_read()
497 old_hdr->target_status = hp->masked_status; in sg_read()
498 old_hdr->host_status = hp->host_status; in sg_read()
499 old_hdr->driver_status = hp->driver_status; in sg_read()
500 if ((CHECK_CONDITION & hp->masked_status) || in sg_read()
506 switch (hp->host_status) { in sg_read()
528 hp->masked_status == GOOD) ? 0 : EIO; in sg_read()
563 sg_io_hdr_t *hp = &srp->header; in sg_new_read() local
576 hp->sb_len_wr = 0; in sg_new_read()
577 if ((hp->mx_sb_len > 0) && hp->sbp) { in sg_new_read()
578 if ((CHECK_CONDITION & hp->masked_status) || in sg_new_read()
581 sb_len = (hp->mx_sb_len > sb_len) ? sb_len : hp->mx_sb_len; in sg_new_read()
584 if (copy_to_user(hp->sbp, srp->sense_b, len)) { in sg_new_read()
588 hp->driver_status = DRIVER_SENSE; in sg_new_read()
589 hp->sb_len_wr = len; in sg_new_read()
592 if (hp->masked_status || hp->host_status || hp->driver_status) in sg_new_read()
593 hp->info |= SG_INFO_CHECK; in sg_new_read()
594 err = put_sg_io_hdr(hp, buf); in sg_new_read()
611 sg_io_hdr_t *hp; in sg_write() local
670 hp = &srp->header; in sg_write()
671 hp->interface_id = '\0'; /* indicator of old interface tunnelled */ in sg_write()
672 hp->cmd_len = (unsigned char) cmd_size; in sg_write()
673 hp->iovec_count = 0; in sg_write()
674 hp->mx_sb_len = 0; in sg_write()
676 hp->dxfer_direction = (old_hdr.reply_len > SZ_SG_HEADER) ? in sg_write()
679 hp->dxfer_direction = (mxsize > 0) ? SG_DXFER_FROM_DEV : SG_DXFER_NONE; in sg_write()
680 hp->dxfer_len = mxsize; in sg_write()
681 if ((hp->dxfer_direction == SG_DXFER_TO_DEV) || in sg_write()
682 (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV)) in sg_write()
683 hp->dxferp = (char __user *)buf + cmd_size; in sg_write()
685 hp->dxferp = NULL; in sg_write()
686 hp->sbp = NULL; in sg_write()
687 hp->timeout = old_hdr.reply_len; /* structure abuse ... */ in sg_write()
688 hp->flags = input_size; /* structure abuse ... */ in sg_write()
689 hp->pack_id = old_hdr.pack_id; in sg_write()
690 hp->usr_ptr = NULL; in sg_write()
700 if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) { in sg_write()
721 sg_io_hdr_t *hp; in sg_new_write() local
736 hp = &srp->header; in sg_new_write()
737 if (get_sg_io_hdr(hp, buf)) { in sg_new_write()
741 if (hp->interface_id != 'S') { in sg_new_write()
745 if (hp->flags & SG_FLAG_MMAP_IO) { in sg_new_write()
746 if (hp->dxfer_len > sfp->reserve.bufflen) { in sg_new_write()
750 if (hp->flags & SG_FLAG_DIRECT_IO) { in sg_new_write()
761 if ((!hp->cmdp) || (hp->cmd_len < 6) || (hp->cmd_len > sizeof (cmnd))) { in sg_new_write()
765 if (copy_from_user(cmnd, hp->cmdp, hp->cmd_len)) { in sg_new_write()
787 sg_io_hdr_t *hp = &srp->header; in sg_common_write() local
790 hp->status = 0; in sg_common_write()
791 hp->masked_status = 0; in sg_common_write()
792 hp->msg_status = 0; in sg_common_write()
793 hp->info = 0; in sg_common_write()
794 hp->host_status = 0; in sg_common_write()
795 hp->driver_status = 0; in sg_common_write()
796 hp->resid = 0; in sg_common_write()
799 (int) cmnd[0], (int) hp->cmd_len)); in sg_common_write()
801 if (hp->dxfer_len >= SZ_256M) { in sg_common_write()
825 hp->duration = jiffies_to_msecs(jiffies); in sg_common_write()
826 if (hp->interface_id != '\0' && /* v3 (or later) interface */ in sg_common_write()
827 (SG_FLAG_Q_AT_TAIL & hp->flags)) in sg_common_write()
1733 sg_io_hdr_t *hp = &srp->header; in sg_start_req() local
1734 int dxfer_len = (int) hp->dxfer_len; in sg_start_req()
1735 int dxfer_dir = hp->dxfer_direction; in sg_start_req()
1736 unsigned int iov_count = hp->iovec_count; in sg_start_req()
1741 int rw = hp->dxfer_direction == SG_DXFER_TO_DEV ? ITER_SOURCE : ITER_DEST; in sg_start_req()
1759 rq = scsi_alloc_request(q, hp->dxfer_direction == SG_DXFER_TO_DEV ? in sg_start_req()
1765 if (hp->cmd_len > sizeof(scmd->cmnd)) { in sg_start_req()
1770 memcpy(scmd->cmnd, cmd, hp->cmd_len); in sg_start_req()
1771 scmd->cmd_len = hp->cmd_len; in sg_start_req()
1780 if (sg_allow_dio && hp->flags & SG_FLAG_DIRECT_IO && in sg_start_req()
1782 blk_rq_aligned(q, (unsigned long)hp->dxferp, dxfer_len)) in sg_start_req()
1793 } else if (hp->flags & SG_FLAG_MMAP_IO) { in sg_start_req()
1812 md->null_mapped = hp->dxferp ? 0 : 1; in sg_start_req()
1819 res = blk_rq_map_user_io(rq, md, hp->dxferp, hp->dxfer_len, in sg_start_req()
1826 hp->info |= SG_INFO_DIRECT_IO; in sg_start_req()
2534 const sg_io_hdr_t *hp; in sg_proc_debug_helper() local
2551 hp = &srp->header; in sg_proc_debug_helper()
2552 new_interface = (hp->interface_id == '\0') ? 0 : 1; in sg_proc_debug_helper()
2555 (SG_FLAG_MMAP_IO & hp->flags)) in sg_proc_debug_helper()
2560 if (SG_INFO_DIRECT_IO_MASK & hp->info) in sg_proc_debug_helper()
2574 seq_printf(s, " dur=%d", hp->duration); in sg_proc_debug_helper()
2578 (new_interface ? hp->timeout : in sg_proc_debug_helper()
2580 (ms > hp->duration ? ms - hp->duration : 0)); in sg_proc_debug_helper()