xref: /illumos-gate/usr/src/uts/common/sys/usb/hcd/uhci/uhcitgt.h (revision d321a33cdd896e6b211d113a33698dd76e89b861)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_USB_UHCITGT_H
27 #define	_SYS_USB_UHCITGT_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  *  Shared function declarations
37  */
38 queue_head_t	*uhci_alloc_queue_head(uhci_state_t *uhcip);
39 uhci_state_t	*uhci_obtain_state(dev_info_t *dip);
40 
41 int		uhci_insert_ctrl_td(uhci_state_t *uhcip,
42 			usba_pipe_handle_data_t	*pipe_handle,
43 			usb_ctrl_req_t	*req,
44 			usb_flags_t		flags);
45 int		uhci_insert_bulk_td(uhci_state_t *uhcip,
46 			usba_pipe_handle_data_t	*pipe_handle,
47 			usb_bulk_req_t		*req,
48 			usb_flags_t		flags);
49 int		uhci_insert_intr_td(uhci_state_t *uhcip,
50 			usba_pipe_handle_data_t	*pipe_handle,
51 			usb_intr_req_t		*req,
52 			usb_flags_t		flags);
53 int		uhci_insert_isoc_td(
54 			uhci_state_t		*uhcip,
55 			usba_pipe_handle_data_t	*ph,
56 			usb_isoc_req_t		*isoc_req,
57 			size_t			length,
58 			usb_flags_t		usb_flags);
59 
60 void		uhci_remove_qh(uhci_state_t *uhcip, uhci_pipe_private_t *pp);
61 void		uhci_insert_qh(uhci_state_t *uhcip,
62 			usba_pipe_handle_data_t	*pipe_handle);
63 void		uhci_modify_td_active_bits(
64 			uhci_state_t		*uhcip,
65 			uhci_pipe_private_t	*pp);
66 
67 int		uhci_allocate_bandwidth(uhci_state_t *uhcip,
68 		    usba_pipe_handle_data_t *pipe_handle, uint_t *node);
69 void		uhci_deallocate_bandwidth(uhci_state_t *uhcip,
70 		    usba_pipe_handle_data_t *pipe_handle);
71 void		uhci_remove_tds_tws(uhci_state_t *uhcip,
72 		    usba_pipe_handle_data_t *ph);
73 void		uhci_remove_isoc_tds_tws(uhci_state_t *uhcip,
74 		    uhci_pipe_private_t *ph);
75 int		uhci_start_isoc_receive_polling(
76 			uhci_state_t		*uhcip,
77 			usba_pipe_handle_data_t	*ph,
78 			usb_isoc_req_t		*req,
79 			usb_flags_t		usb_flags);
80 
81 
82 void		uhci_save_data_toggle(uhci_pipe_private_t *pp);
83 int		uhci_handle_root_hub_request(
84 			uhci_state_t		*uhcip,
85 			usba_pipe_handle_data_t  *pipe_handle,
86 			usb_ctrl_req_t	*req);
87 
88 void		uhci_remove_bulk_tds_tws(uhci_state_t *uhcip,
89 			uhci_pipe_private_t *pp,
90 			int what);
91 void		uhci_root_hub_reset_occurred(uhci_state_t *uhcip,
92 			usb_port_t port);
93 int		uhci_root_hub_allocate_intr_pipe_resource(
94 			uhci_state_t *uhcip,
95 			usb_flags_t flags);
96 void		uhci_root_hub_intr_pipe_cleanup(uhci_state_t *uhcip,
97 						usb_cr_t cr);
98 void		uhci_hcdi_callback(uhci_state_t *uhcip,
99 			uhci_pipe_private_t *pp,
100 			usba_pipe_handle_data_t *ph,
101 			uhci_trans_wrapper_t *tw,
102 			usb_cr_t cr);
103 int		uhci_allocate_periodic_in_resource(uhci_state_t *uhcip,
104 			uhci_pipe_private_t *pp,
105 			uhci_trans_wrapper_t *tw, usb_flags_t flags);
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* _SYS_USB_UHCITGT_H */
112