xref: /illumos-gate/usr/src/uts/common/sys/usb/hcd/uhci/uhcitgt.h (revision 2983dda76a6d296fdb560c88114fe41caad1b84f)
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 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  *  Shared function declarations
36  */
37 queue_head_t	*uhci_alloc_queue_head(uhci_state_t *uhcip);
38 uhci_state_t	*uhci_obtain_state(dev_info_t *dip);
39 
40 int		uhci_insert_ctrl_td(uhci_state_t *uhcip,
41 			usba_pipe_handle_data_t	*pipe_handle,
42 			usb_ctrl_req_t	*req,
43 			usb_flags_t		flags);
44 int		uhci_insert_bulk_td(uhci_state_t *uhcip,
45 			usba_pipe_handle_data_t	*pipe_handle,
46 			usb_bulk_req_t		*req,
47 			usb_flags_t		flags);
48 int		uhci_insert_intr_td(uhci_state_t *uhcip,
49 			usba_pipe_handle_data_t	*pipe_handle,
50 			usb_intr_req_t		*req,
51 			usb_flags_t		flags);
52 int		uhci_insert_isoc_td(
53 			uhci_state_t		*uhcip,
54 			usba_pipe_handle_data_t	*ph,
55 			usb_isoc_req_t		*isoc_req,
56 			size_t			length,
57 			usb_flags_t		usb_flags);
58 
59 void		uhci_remove_qh(uhci_state_t *uhcip, uhci_pipe_private_t *pp);
60 void		uhci_insert_qh(uhci_state_t *uhcip,
61 			usba_pipe_handle_data_t	*pipe_handle);
62 void		uhci_modify_td_active_bits(
63 			uhci_state_t		*uhcip,
64 			uhci_pipe_private_t	*pp);
65 
66 int		uhci_allocate_bandwidth(uhci_state_t *uhcip,
67 		    usba_pipe_handle_data_t *pipe_handle, uint_t *node);
68 void		uhci_deallocate_bandwidth(uhci_state_t *uhcip,
69 		    usba_pipe_handle_data_t *pipe_handle);
70 void		uhci_remove_tds_tws(uhci_state_t *uhcip,
71 		    usba_pipe_handle_data_t *ph);
72 void		uhci_remove_isoc_tds_tws(uhci_state_t *uhcip,
73 		    uhci_pipe_private_t *ph);
74 int		uhci_start_isoc_receive_polling(
75 			uhci_state_t		*uhcip,
76 			usba_pipe_handle_data_t	*ph,
77 			usb_isoc_req_t		*req,
78 			usb_flags_t		usb_flags);
79 
80 
81 void		uhci_save_data_toggle(uhci_pipe_private_t *pp);
82 int		uhci_handle_root_hub_request(
83 			uhci_state_t		*uhcip,
84 			usba_pipe_handle_data_t  *pipe_handle,
85 			usb_ctrl_req_t	*req);
86 
87 void		uhci_remove_bulk_tds_tws(uhci_state_t *uhcip,
88 			uhci_pipe_private_t *pp,
89 			int what);
90 void		uhci_root_hub_reset_occurred(uhci_state_t *uhcip,
91 			usb_port_t port);
92 int		uhci_root_hub_allocate_intr_pipe_resource(
93 			uhci_state_t *uhcip,
94 			usb_flags_t flags);
95 void		uhci_root_hub_intr_pipe_cleanup(uhci_state_t *uhcip,
96 						usb_cr_t cr);
97 void		uhci_hcdi_callback(uhci_state_t *uhcip,
98 			uhci_pipe_private_t *pp,
99 			usba_pipe_handle_data_t *ph,
100 			uhci_trans_wrapper_t *tw,
101 			usb_cr_t cr);
102 int		uhci_allocate_periodic_in_resource(uhci_state_t *uhcip,
103 			uhci_pipe_private_t *pp,
104 			uhci_trans_wrapper_t *tw, usb_flags_t flags);
105 
106 #ifdef __cplusplus
107 }
108 #endif
109 
110 #endif /* _SYS_USB_UHCITGT_H */
111