Lines Matching defs:hp

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