1usb_get_max_pkts_per_isoc_KreerqnueelstF(u9nFc)tionsufsobr_gDerti_vmearxs_pkts_per_isoc_request(9F)
2
3
4

NAME

6       usb_get_max_pkts_per_isoc_request  -  Get  maximum  number  of  packets
7       allowed per isochronous request
8

SYNOPSIS

10       #include <sys/usb/usba.h>
11
12
13
14       uint_t usb_get_max_pkts_per_isoc_request(dev_info_t *dip);
15
16

INTERFACE LEVEL

18       Solaris DDI specific (Solaris DDI)
19

PARAMETERS

21       dip    Pointer to the device's dev_info structure.
22
23

DESCRIPTION

25       The usb_get_max_pkts_per_isoc_request() function  returns  the  maximum
26       number  of isochronous packets per request that the host control driver
27       can support. This number can be used to determine the maximum amount of
28       data  which can be handled by a single isochronous request. That length
29       is found by:
30
31         max = usb_get_max_pkts_per_isoc_request(dip) * endpoint_max_packet_size;
32
33
34
35       where endpoint_max_packet_size  is  the  wMaxPacketSize  field  of  the
36       isochronous endpoint over which the transfer will take place.
37

RETURN VALUES

39       On  success,  the  usb_get_current_frame_number()  function returns the
40       maximum number of isochronous pkts per request. On failure  it  returns
41       0. The function fails if dip is NULL.
42

CONTEXT

44       May be called from user, kernel or interrupt context.
45

EXAMPLES

47         /*
48          * Set up to receive periodic isochronous data, requesting
49          * the maximum amount for each transfer.
50          */
51
52         int pkt;
53         /* Get max packet size from endpoint descriptor. */
54         uint_t ep_max_pkt_size = ep_descr.wMaxPacketSize;
55         uint_t isoc_pkts_count = usb_get_max_pkts_per_isoc_request(dip);
56
57         /*
58          * Allocate an isoc request, specifying the max number of packets
59          * and the greatest size transfer possible.
60          */
61         usb_isoc_req_t *isoc_req = usb_alloc_isoc_req(dip,
62             isoc_pkts_count,
63             isoc_pkts_count * ep_max_pkt_size,
64             USB_FLAGS_SLEEP);
65
66         /* Init each packet descriptor for maximum size. */
67         for (pkt = 0; pkt < isoc_pkts_count; pkt++) {
68             isoc_req->isoc_pkt_descr[pkt].isoc_pkt_length = ep_max_pkt_size;
69
70         }
71
72
73         /* Set the length of a packet in the request too. */
74         isoc_req->isoc_pkts_length = ep_max_pkt_size;
75
76         /* Other isoc request initialization. */
77         ...
78         ...
79
80         if (usb_pipe_isoc_xfer(pipe, isoc_req, USB_FLAGS_NOSLEEP) != USB_SUCCESS) {
81             ...
82         }
83
84

ATTRIBUTES

86       See attributes(5) for descriptions of the following attributes:
87
88
89
90
91       ┌─────────────────────────────┬─────────────────────────────┐
92       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
93       ├─────────────────────────────┼─────────────────────────────┤
94       │Architecture                 │PCI-based systems            │
95       ├─────────────────────────────┼─────────────────────────────┤
96       │Interface stability          │Committed                    │
97       ├─────────────────────────────┼─────────────────────────────┤
98       │Availability                 │SUNWusb                      │
99       └─────────────────────────────┴─────────────────────────────┘
100

SEE ALSO

102       attributes(5),      usb_pipe_isoc_xfer(9F),      usb_alloc_request(9F),
103       usb_get_current_frame_number(9F).                     usb_ep_descr(9S),
104       usb_isoc_request(9S)
105
106
107
108SunOS 5.11                        5 Jan 20u0s4b_get_max_pkts_per_isoc_request(9F)
Impressum