summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/uwb/uwbai.h
blob: b9594d5cd6c1a4303c6a78f03414c2fce4810658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License (the "License").
 * You may not use this file except in compliance with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#ifndef _SYS_UWB_UWBAI_H
#define	_SYS_UWB_UWBAI_H


#ifdef	__cplusplus
extern "C" {
#endif

/*
 * This header file includes interfaces for UWB radio controller drivers.
 */

/*
 * A uwb device handle is returned by uwb_device_attach() on success. The
 * handle is opaque to the client uwba driver. The implimentation structure is
 * uwba_dev
 */
typedef	struct uwb_dev_handle	*uwb_dev_handle_t;


/*
 * UWBA function return values
 */
#define	UWB_SUCCESS		0	/* call success			  */
#define	UWB_FAILURE		-1	/* unspecified UWBA or HCD error  */
#define	UWB_NO_RESOURCES	-2	/* no resources available	  */
#define	UWB_NO_BANDWIDTH	-3	/* no bandwidth available	  */
#define	UWB_NOT_SUPPORTED	-4	/* function not supported by HCD  */
#define	UWB_PIPE_ERROR		-5	/* error occured on the pipe	  */
#define	UWB_INVALID_PIPE	-6	/* pipe handle passed is invalid  */
#define	UWB_NO_FRAME_NUMBER	-7	/* frame No or ASAP not specified */
#define	UWB_INVALID_START_FRAME	-8	/* starting UWB frame not valid	  */
#define	UWB_HC_HARDWARE_ERROR	-9	/* UWB host controller error	  */
#define	UWB_INVALID_REQUEST	-10	/* request had invalid values	  */
#define	UWB_INVALID_CONTEXT	-11	/* sleep flag in interrupt context */
#define	UWB_INVALID_VERSION	-12	/* invalid version specified	  */
#define	UWB_INVALID_ARGS	-13	/* invalid func args specified	  */
#define	UWB_INVALID_PERM	-14	/* privileged operation		  */
#define	UWB_BUSY		-15	/* busy condition		  */
#define	UWB_PARSE_ERROR		-18



/* Max wait time for each uwb cmd */
#define	UWB_CMD_TIMEOUT (ddi_get_lbolt() + drv_usectohz(10000000))


/*
 * Radio controller driver registion
 */
void	uwb_dev_attach(dev_info_t *, uwb_dev_handle_t *, uint_t,
    int (*)(uwb_dev_handle_t, mblk_t *, uint16_t));
void uwb_dev_detach(uwb_dev_handle_t);

/* UWB COMMON INTERFACES */
int	uwb_do_ioctl(uwb_dev_handle_t, int, intptr_t, int);
int	uwb_parse_evt_notif(uint8_t *, int, uwb_dev_handle_t);
int	uwb_scan_channel(uwb_dev_handle_t, uint8_t);
int	uwb_reset_dev(dev_info_t *);
int	uwb_init_phy(dev_info_t *);
int	uwb_stop_beacon(dev_info_t *);
int	uwb_start_beacon(dev_info_t *, uint8_t);
int	uwb_get_mac_addr(dev_info_t *, uint8_t *);
int	uwb_get_dev_addr(dev_info_t *, uint16_t *);
int	uwb_set_dev_addr(dev_info_t *, uint16_t);
uint8_t	uwb_allocate_channel(dev_info_t *);

int	uwb_dev_disconnect(dev_info_t *);
int	uwb_dev_reconnect(dev_info_t *);

int	uwb_dev_online(dev_info_t *);
int	uwb_dev_offline(dev_info_t *);

dev_info_t *uwb_get_dip(uwb_dev_handle_t);

#ifdef __cplusplus
}
#endif

#endif	/* _SYS_UWB_UWBAI_H */