Lines Matching refs:cmdinfo
88 struct uas_cmd_info *cmdinfo; in uas_do_work() local
103 cmdinfo = (void *)&cmnd->SCp; in uas_do_work()
105 if (!(cmdinfo->state & IS_IN_WORK_LIST)) in uas_do_work()
110 cmdinfo->state &= ~IS_IN_WORK_LIST; in uas_do_work()
118 static void uas_add_work(struct uas_cmd_info *cmdinfo) in uas_add_work() argument
120 struct scsi_pointer *scp = (void *)cmdinfo; in uas_add_work()
125 cmdinfo->state |= IS_IN_WORK_LIST; in uas_add_work()
131 struct uas_cmd_info *cmdinfo; in uas_zap_pending() local
142 cmdinfo = (void *)&cmnd->SCp; in uas_zap_pending()
145 cmdinfo->state &= ~COMMAND_INFLIGHT; in uas_zap_pending()
217 struct uas_cmd_info *cmdinfo; in uas_free_unsubmitted_urbs() local
222 cmdinfo = (void *)&cmnd->SCp; in uas_free_unsubmitted_urbs()
224 if (cmdinfo->state & SUBMIT_CMD_URB) in uas_free_unsubmitted_urbs()
225 usb_free_urb(cmdinfo->cmd_urb); in uas_free_unsubmitted_urbs()
228 if (!(cmdinfo->state & DATA_IN_URB_INFLIGHT)) in uas_free_unsubmitted_urbs()
229 usb_free_urb(cmdinfo->data_in_urb); in uas_free_unsubmitted_urbs()
230 if (!(cmdinfo->state & DATA_OUT_URB_INFLIGHT)) in uas_free_unsubmitted_urbs()
231 usb_free_urb(cmdinfo->data_out_urb); in uas_free_unsubmitted_urbs()
236 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in uas_try_complete() local
240 if (cmdinfo->state & (COMMAND_INFLIGHT | in uas_try_complete()
254 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in uas_xfer_data() local
257 cmdinfo->state |= direction | SUBMIT_STATUS_URB; in uas_xfer_data()
260 uas_add_work(cmdinfo); in uas_xfer_data()
272 struct uas_cmd_info *cmdinfo; in uas_stat_cmplt() local
297 cmdinfo = (void *)&cmnd->SCp; in uas_stat_cmplt()
299 if (!(cmdinfo->state & COMMAND_INFLIGHT)) { in uas_stat_cmplt()
309 data_in_urb = usb_get_urb(cmdinfo->data_in_urb); in uas_stat_cmplt()
310 data_out_urb = usb_get_urb(cmdinfo->data_out_urb); in uas_stat_cmplt()
312 cmdinfo->state &= ~COMMAND_INFLIGHT; in uas_stat_cmplt()
316 if (!cmdinfo->data_in_urb || in uas_stat_cmplt()
317 (cmdinfo->state & DATA_IN_URB_INFLIGHT)) { in uas_stat_cmplt()
324 if (!cmdinfo->data_out_urb || in uas_stat_cmplt()
325 (cmdinfo->state & DATA_OUT_URB_INFLIGHT)) { in uas_stat_cmplt()
335 data_in_urb = usb_get_urb(cmdinfo->data_in_urb); in uas_stat_cmplt()
336 data_out_urb = usb_get_urb(cmdinfo->data_out_urb); in uas_stat_cmplt()
337 cmdinfo->state &= ~COMMAND_INFLIGHT; in uas_stat_cmplt()
362 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in uas_data_cmplt() local
369 if (cmdinfo->data_in_urb == urb) { in uas_data_cmplt()
371 cmdinfo->state &= ~DATA_IN_URB_INFLIGHT; in uas_data_cmplt()
372 cmdinfo->data_in_urb = NULL; in uas_data_cmplt()
373 } else if (cmdinfo->data_out_urb == urb) { in uas_data_cmplt()
375 cmdinfo->state &= ~DATA_OUT_URB_INFLIGHT; in uas_data_cmplt()
376 cmdinfo->data_out_urb = NULL; in uas_data_cmplt()
387 if (cmdinfo->state & SUBMIT_CMD_URB) { in uas_data_cmplt()
419 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in uas_alloc_data_urb() local
430 urb->stream_id = cmdinfo->stream; in uas_alloc_data_urb()
441 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in uas_alloc_sense_urb() local
454 urb->stream_id = cmdinfo->stream; in uas_alloc_sense_urb()
529 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in uas_submit_urbs() local
534 if (cmdinfo->state & SUBMIT_STATUS_URB) { in uas_submit_urbs()
538 cmdinfo->state &= ~SUBMIT_STATUS_URB; in uas_submit_urbs()
541 if (cmdinfo->state & ALLOC_DATA_IN_URB) { in uas_submit_urbs()
542 cmdinfo->data_in_urb = uas_alloc_data_urb(devinfo, gfp, in uas_submit_urbs()
544 if (!cmdinfo->data_in_urb) in uas_submit_urbs()
546 cmdinfo->state &= ~ALLOC_DATA_IN_URB; in uas_submit_urbs()
549 if (cmdinfo->state & SUBMIT_DATA_IN_URB) { in uas_submit_urbs()
550 usb_anchor_urb(cmdinfo->data_in_urb, &devinfo->data_urbs); in uas_submit_urbs()
551 err = usb_submit_urb(cmdinfo->data_in_urb, gfp); in uas_submit_urbs()
553 usb_unanchor_urb(cmdinfo->data_in_urb); in uas_submit_urbs()
557 cmdinfo->state &= ~SUBMIT_DATA_IN_URB; in uas_submit_urbs()
558 cmdinfo->state |= DATA_IN_URB_INFLIGHT; in uas_submit_urbs()
561 if (cmdinfo->state & ALLOC_DATA_OUT_URB) { in uas_submit_urbs()
562 cmdinfo->data_out_urb = uas_alloc_data_urb(devinfo, gfp, in uas_submit_urbs()
564 if (!cmdinfo->data_out_urb) in uas_submit_urbs()
566 cmdinfo->state &= ~ALLOC_DATA_OUT_URB; in uas_submit_urbs()
569 if (cmdinfo->state & SUBMIT_DATA_OUT_URB) { in uas_submit_urbs()
570 usb_anchor_urb(cmdinfo->data_out_urb, &devinfo->data_urbs); in uas_submit_urbs()
571 err = usb_submit_urb(cmdinfo->data_out_urb, gfp); in uas_submit_urbs()
573 usb_unanchor_urb(cmdinfo->data_out_urb); in uas_submit_urbs()
577 cmdinfo->state &= ~SUBMIT_DATA_OUT_URB; in uas_submit_urbs()
578 cmdinfo->state |= DATA_OUT_URB_INFLIGHT; in uas_submit_urbs()
581 if (cmdinfo->state & ALLOC_CMD_URB) { in uas_submit_urbs()
582 cmdinfo->cmd_urb = uas_alloc_cmd_urb(devinfo, gfp, cmnd); in uas_submit_urbs()
583 if (!cmdinfo->cmd_urb) in uas_submit_urbs()
585 cmdinfo->state &= ~ALLOC_CMD_URB; in uas_submit_urbs()
588 if (cmdinfo->state & SUBMIT_CMD_URB) { in uas_submit_urbs()
589 usb_anchor_urb(cmdinfo->cmd_urb, &devinfo->cmd_urbs); in uas_submit_urbs()
590 err = usb_submit_urb(cmdinfo->cmd_urb, gfp); in uas_submit_urbs()
592 usb_unanchor_urb(cmdinfo->cmd_urb); in uas_submit_urbs()
596 cmdinfo->cmd_urb = NULL; in uas_submit_urbs()
597 cmdinfo->state &= ~SUBMIT_CMD_URB; in uas_submit_urbs()
598 cmdinfo->state |= COMMAND_INFLIGHT; in uas_submit_urbs()
609 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in uas_queuecommand_lck() local
646 memset(cmdinfo, 0, sizeof(*cmdinfo)); in uas_queuecommand_lck()
647 cmdinfo->stream = stream; in uas_queuecommand_lck()
648 cmdinfo->state = SUBMIT_STATUS_URB | ALLOC_CMD_URB | SUBMIT_CMD_URB; in uas_queuecommand_lck()
652 cmdinfo->state |= ALLOC_DATA_IN_URB | SUBMIT_DATA_IN_URB; in uas_queuecommand_lck()
655 cmdinfo->state |= ALLOC_DATA_IN_URB | SUBMIT_DATA_IN_URB; in uas_queuecommand_lck()
657 cmdinfo->state |= ALLOC_DATA_OUT_URB | SUBMIT_DATA_OUT_URB; in uas_queuecommand_lck()
663 cmdinfo->state &= ~(SUBMIT_DATA_IN_URB | SUBMIT_DATA_OUT_URB); in uas_queuecommand_lck()
664 cmdinfo->stream = 0; in uas_queuecommand_lck()
670 if (cmdinfo->state & SUBMIT_STATUS_URB) { in uas_queuecommand_lck()
674 uas_add_work(cmdinfo); in uas_queuecommand_lck()
691 struct uas_cmd_info *cmdinfo = (void *)&cmnd->SCp; in DEF_SCSI_QCMD() local
702 cmdinfo->state |= COMMAND_ABORTED; in DEF_SCSI_QCMD()
706 if (cmdinfo->state & DATA_IN_URB_INFLIGHT) in DEF_SCSI_QCMD()
707 data_in_urb = usb_get_urb(cmdinfo->data_in_urb); in DEF_SCSI_QCMD()
708 if (cmdinfo->state & DATA_OUT_URB_INFLIGHT) in DEF_SCSI_QCMD()
709 data_out_urb = usb_get_urb(cmdinfo->data_out_urb); in DEF_SCSI_QCMD()