5801 nuke big file scanner (bfs)
[unleashed.git] / usr / src / uts / common / sys / usb / clients / hwarc / hwarc.h
blobb804822255e472cc33d5795c3d9fe4f2c6a2ba2b
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_USB_HWARC_H
27 #define _SYS_USB_HWARC_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 #include <sys/usb/usba/usbai_private.h>
34 #include <sys/uwb/uwbai.h>
36 /* Power Management support */
37 typedef struct hwarc_power {
39 void *hrc_state; /* Hwarc state */
40 uint8_t hrc_pwr_states; /* Hwarc power state */
41 int hrc_pm_busy; /* Hwarc busy counter */
43 uint8_t hrc_pm_capabilities; /* PM capabilities */
44 uint8_t hrc_current_power; /* Hwarc power value */
46 uint8_t hrc_wakeup_enabled; /* Remote Wakeup */
47 } hwarc_power_t;
49 /* Hwarc State structure */
50 typedef struct hwarc_state {
51 dev_info_t *hrc_dip; /* Dip of Hwarc */
53 usb_client_dev_data_t *hrc_reg; /* Usb dev data */
54 usb_if_data_t *hrc_if_descr; /* Interface descr */
56 usb_pipe_handle_t hrc_default_ph; /* Default pipe */
57 usb_ep_descr_t hrc_intr_ep_descr; /* Inter ep descr */
58 usb_pipe_handle_t hrc_intr_ph; /* Inter pipe hdl */
59 char *hrc_devinst; /* Device instance */
61 int hrc_dev_state; /* USB device state */
62 uint_t hrc_open_count;
64 kmutex_t hrc_mutex; /* Global hwarc mutex */
66 kcondvar_t hrc_serial_cv; /* Serial access cond */
67 boolean_t hrc_serial_inuse; /* Serial access flag */
70 boolean_t hrc_locks_initialized; /* Init status flag */
72 hwarc_power_t *hrc_pm; /* PM state of hwarc */
74 usb_log_handle_t hrc_log_hdl; /* Hwarc log handle */
75 uwb_dev_handle_t hrc_dev_hdl; /* Uwb dev handle */
76 } hwarc_state_t;
78 _NOTE(MUTEX_PROTECTS_DATA(hwarc_state_t::hrc_mutex, hwarc_state_t))
79 _NOTE(DATA_READABLE_WITHOUT_LOCK(hwarc_state_t::{
80 hrc_dev_hdl
81 hrc_dev_state
82 hrc_intr_ep_descr
83 hrc_default_ph
84 hrc_reg
85 hrc_intr_ph
86 hrc_log_hdl
87 hrc_dip
88 hrc_if_descr
90 }))
93 #define USB_DEV_DESCR_SIZE 18 /* Hwarc device descr size */
96 #define HWA_EXEC_RC_CMD 40 /* UWB Radio cmd request code */
98 #define HWARC_SER_NOSIG B_FALSE /* Hwarc serialization */
99 #define HWARC_SER_SIG B_TRUE
101 #define HWARC_SET_IF 0x21 /* Hwarc bmRequestType */
102 #define HWARC_GET_IF 0xA1
105 /* HWARC masks for debug printing */
106 #define PRINT_MASK_ATTA 0x00000001
107 #define PRINT_MASK_OPEN 0x00000002
108 #define PRINT_MASK_CLOSE 0x00000004
109 #define PRINT_MASK_READ 0x00000008
110 #define PRINT_MASK_IOCTL 0x00000010
111 #define PRINT_MASK_PM 0x00000020
112 #define PRINT_MASK_CB 0x00000040
113 #define PRINT_MASK_HOTPLUG 0x00000080
114 #define PRINT_MASK_DEVCTRL 0x00000100
115 #define PRINT_MASK_DEVMAP 0x00000200
116 #define PRINT_MASK_ALL 0xFFFFFFFF
118 #ifdef __cplusplus
120 #endif
122 #endif /* _SYS_USB_HWARC_H */