07.06.2013 Views

Scsi - Index of

Scsi - Index of

Scsi - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

759 * Completion Callbacks:<br />

760 *<br />

761 * The completion callback is made in_interrupt(), and one <strong>of</strong> the first<br />

762 * things that a completion handler should do is check the status field.<br />

763 * The status field is provided for all URBs. It is used to report<br />

764 * unlinked URBs, and status for all non-ISO transfers. It should not<br />

765 * be examined before the URB is returned to the completion handler.<br />

766 *<br />

767 * The context field is normally used to link URBs back to the relevant<br />

768 * driver or request state.<br />

769 *<br />

770 * When the completion callback is invoked for non-isochronous URBs, the<br />

771 * actual_length field tells how many bytes were transferred. This field<br />

772 * is updated even when the URB terminated with an error or was unlinked.<br />

773 *<br />

774 * ISO transfer status is reported in the status and actual_length fields<br />

775 * <strong>of</strong> the iso_frame_desc array, and the number <strong>of</strong> errors is reported in<br />

776 * error_count. Completion callbacks for ISO transfers will normally<br />

777 * (re)submit URBs to ensure a constant transfer rate.<br />

778 */<br />

779 struct urb<br />

780 {<br />

781 /* private, usb core and host controller only fields in the urb */<br />

782 struct kref kref; /* reference count <strong>of</strong> the URB */<br />

783 spinlock_t lock; /* lock for the URB */<br />

784 void *hcpriv; /* private data for host controller */<br />

785 struct list_head urb_list; /* list pointer to all active urbs */<br />

786 int bandwidth; /* bandwidth for INT/ISO request */<br />

787 atomic_t use_count; /* concurrent submissions counter */<br />

788 u8 reject; /* submissions will fail */<br />

789<br />

68<br />

790 /* public, documented fields in the urb that can be used by drivers */<br />

791 struct usb_device *dev; /* (in) pointer to associated device */<br />

792 unsigned int pipe; /* (in) pipe information */<br />

793 int status; /* (return) non-ISO status */<br />

794 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/<br />

795 void *transfer_buffer; /* (in) associated data buffer */<br />

796 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */<br />

797 int transfer_buffer_length; /* (in) data buffer length */<br />

798 int actual_length; /* (return) actual transfer length */<br />

799 unsigned char *setup_packet; /* (in) setup packet (control only) */<br />

800 dma_addr_t setup_dma; /* (in) dma addr for setup_packet */<br />

801 int start_frame; /* (modify) start frame (ISO) */

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!