Print this page
3419 usbftdi needs to support the BeagleBone
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/usb/clients/usbser/usbftdi/uftdi_var.h
+++ new/usr/src/uts/common/sys/usb/clients/usbser/usbftdi/uftdi_var.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 +/*
26 + * Copyright 2012 Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
27 + */
25 28
26 29 #ifndef _USBSER_USBFTDI_UFTDI_VAR_H
27 30 #define _USBSER_USBFTDI_UFTDI_VAR_H
28 31
29 32 /*
30 33 * USB UFTDI definitions
31 34 */
32 35
33 36 #include <sys/types.h>
34 37 #include <sys/dditypes.h>
35 38 #include <sys/note.h>
36 39
37 40 #include <sys/usb/clients/usbser/usbser_dsdi.h>
38 41
39 42 #ifdef __cplusplus
40 43 extern "C" {
41 44 #endif
42 45
43 46 /*
44 47 * PM support
45 48 */
46 49 typedef struct uftdi_pm {
47 50 uint8_t pm_wakeup_enabled; /* remote wakeup enabled */
48 51 uint8_t pm_pwr_states; /* bit mask of power states */
49 52 boolean_t pm_raise_power; /* driver is about to raise power */
50 53 uint8_t pm_cur_power; /* current power level */
51 54 uint_t pm_busy_cnt; /* number of set_busy requests */
52 55 } uftdi_pm_t;
53 56
54 57 typedef struct uftdi_regs {
55 58 uint16_t ur_baud;
56 59 uint16_t ur_data;
57 60 uint16_t ur_flowval;
58 61 uint16_t ur_flowidx;
59 62 } uftdi_regs_t;
60 63
61 64 _NOTE(SCHEME_PROTECTS_DATA("uftdi_regs", uftdi_regs))
62 65
63 66 /*
64 67 * per device state structure
65 68 */
66 69 typedef struct uftdi_state {
67 70 kmutex_t uf_lock; /* structure lock */
68 71 dev_info_t *uf_dip; /* device info */
69 72 int uf_dev_flags; /* device flags */
70 73 int uf_hwport; /* hw port number */
71 74 int uf_port_state; /* port state */
72 75 int uf_port_flags; /* port flags */
73 76 ds_cb_t uf_cb; /* DSD callbacks */
74 77
75 78 /*
76 79 * USBA
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
77 80 */
78 81 usb_client_dev_data_t *uf_dev_data; /* registration data */
79 82 usb_event_t *uf_usb_events; /* usb events */
80 83 usb_pipe_handle_t uf_def_ph; /* default pipe hdl */
81 84 usb_pipe_handle_t uf_bulkin_ph; /* in pipe hdl */
82 85 int uf_bulkin_state; /* in pipe state */
83 86 usb_pipe_handle_t uf_bulkout_ph; /* in pipe hdl */
84 87 int uf_bulkout_state; /* out pipe state */
85 88 usb_log_handle_t uf_lh; /* USBA log handle */
86 89 int uf_dev_state; /* USB device state */
87 - size_t uf_xfer_sz; /* HCI bulk xfer size */
90 + size_t uf_ibuf_sz; /* input buffer size */
91 + size_t uf_obuf_sz; /* output buffer size */
88 92
89 93 uftdi_pm_t *uf_pm; /* PM support */
90 94
91 95 /*
92 96 * data receive and transmit
93 97 */
94 98 mblk_t *uf_rx_mp; /* rx data */
95 99 mblk_t *uf_tx_mp; /* tx data */
96 100 kcondvar_t uf_tx_cv; /* tx completion */
97 101
98 102 /*
99 103 * soft registers
100 104 */
101 105 uftdi_regs_t uf_softr; /* config registers */
102 106 uint16_t uf_mctl; /* modem control */
103 107 uint8_t uf_msr; /* modem status */
104 108 uint8_t uf_lsr; /* line status register */
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
105 109
106 110 } uftdi_state_t;
107 111
108 112 _NOTE(MUTEX_PROTECTS_DATA(uftdi_state::uf_lock, uftdi_state))
109 113 _NOTE(DATA_READABLE_WITHOUT_LOCK(uftdi_state::{
110 114 uf_dip
111 115 uf_dev_data
112 116 uf_usb_events
113 117 uf_def_ph
114 118 uf_lh
115 - uf_xfer_sz
119 + uf_ibuf_sz
120 + uf_obuf_sz
116 121 uf_pm
117 122 uf_port_state
118 123 uf_cb
119 124 uf_bulkin_ph
120 125 uf_bulkout_ph
121 126 uf_hwport
122 127 }))
123 128
124 129 /* port state */
125 130 enum {
126 131 UFTDI_PORT_CLOSED, /* port is closed */
127 132 UFTDI_PORT_OPEN, /* port is open */
128 133 UFTDI_PORT_CLOSING
129 134 };
130 135
131 136 /* port flags */
132 137 enum {
133 138 UFTDI_PORT_TX_STOPPED = 0x0001 /* transmit not allowed */
134 139 };
135 140
136 141 /* pipe state */
137 142 enum {
138 143 UFTDI_PIPE_CLOSED, /* pipe is closed */
139 144 UFTDI_PIPE_IDLE, /* open but no requests */
140 145 UFTDI_PIPE_BUSY /* servicing request */
141 146 };
142 147
143 148 /* various numbers */
144 149 enum {
145 150 UFTDI_BULKOUT_TIMEOUT = 15, /* bulkout timeout */
146 151 UFTDI_BULKIN_TIMEOUT = 15, /* bulkin timeout */
147 152 UFTDI_XFER_SZ_MAX = 64, /* max xfer size */
148 153 UFTDI_CLEANUP_LEVEL_MAX = 6 /* cleanup level */
149 154 };
150 155
151 156
152 157 /*
153 158 * debug printing masks
154 159 */
155 160 #define DPRINT_ATTACH 0x00000001
156 161 #define DPRINT_OPEN 0x00000002
157 162 #define DPRINT_CLOSE 0x00000004
158 163 #define DPRINT_DEF_PIPE 0x00000010
159 164 #define DPRINT_IN_PIPE 0x00000020
160 165 #define DPRINT_OUT_PIPE 0x00000040
161 166 #define DPRINT_IN_DATA 0x00000400
162 167 #define DPRINT_OUT_DATA 0x00000800
163 168 #define DPRINT_CTLOP 0x00001000
164 169 #define DPRINT_HOTPLUG 0x00002000
165 170 #define DPRINT_PM 0x00004000
166 171 #define DPRINT_MASK_ALL 0xFFFFFFFF
167 172
168 173 #ifdef __cplusplus
169 174 }
170 175 #endif
171 176
172 177 #endif /* _USBSER_USBFTDI_UFTDI_VAR_H */
↓ open down ↓ |
47 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX