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 2009 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26#ifndef _SYS_UWB_UWBAI_H 27#define _SYS_UWB_UWBAI_H 28 29 30#ifdef __cplusplus 31extern "C" { 32#endif 33 34/* 35 * This header file includes interfaces for UWB radio controller drivers. 36 */ 37 38/* 39 * A uwb device handle is returned by uwb_device_attach() on success. The 40 * handle is opaque to the client uwba driver. The implimentation structure is 41 * uwba_dev 42 */ 43typedef struct uwb_dev_handle *uwb_dev_handle_t; 44 45 46/* 47 * UWBA function return values 48 */ 49#define UWB_SUCCESS 0 /* call success */ 50#define UWB_FAILURE -1 /* unspecified UWBA or HCD error */ 51#define UWB_NO_RESOURCES -2 /* no resources available */ 52#define UWB_NO_BANDWIDTH -3 /* no bandwidth available */ 53#define UWB_NOT_SUPPORTED -4 /* function not supported by HCD */ 54#define UWB_PIPE_ERROR -5 /* error occured on the pipe */ 55#define UWB_INVALID_PIPE -6 /* pipe handle passed is invalid */ 56#define UWB_NO_FRAME_NUMBER -7 /* frame No or ASAP not specified */ 57#define UWB_INVALID_START_FRAME -8 /* starting UWB frame not valid */ 58#define UWB_HC_HARDWARE_ERROR -9 /* UWB host controller error */ 59#define UWB_INVALID_REQUEST -10 /* request had invalid values */ 60#define UWB_INVALID_CONTEXT -11 /* sleep flag in interrupt context */ 61#define UWB_INVALID_VERSION -12 /* invalid version specified */ 62#define UWB_INVALID_ARGS -13 /* invalid func args specified */ 63#define UWB_INVALID_PERM -14 /* privileged operation */ 64#define UWB_BUSY -15 /* busy condition */ 65#define UWB_PARSE_ERROR -18 66 67 68 69/* Max wait time for each uwb cmd */ 70#define UWB_CMD_TIMEOUT (ddi_get_lbolt() + drv_usectohz(10000000)) 71 72 73/* 74 * Radio controller driver registion 75 */ 76void uwb_dev_attach(dev_info_t *, uwb_dev_handle_t *, uint_t, 77 int (*)(uwb_dev_handle_t, mblk_t *, uint16_t)); 78void uwb_dev_detach(uwb_dev_handle_t); 79 80/* UWB COMMON INTERFACES */ 81int uwb_do_ioctl(uwb_dev_handle_t, int, intptr_t, int); 82int uwb_parse_evt_notif(uint8_t *, int, uwb_dev_handle_t); 83int uwb_scan_channel(uwb_dev_handle_t, uint8_t); 84int uwb_reset_dev(dev_info_t *); 85int uwb_init_phy(dev_info_t *); 86int uwb_stop_beacon(dev_info_t *); 87int uwb_start_beacon(dev_info_t *, uint8_t); 88int uwb_get_mac_addr(dev_info_t *, uint8_t *); 89int uwb_get_dev_addr(dev_info_t *, uint16_t *); 90int uwb_set_dev_addr(dev_info_t *, uint16_t); 91uint8_t uwb_allocate_channel(dev_info_t *); 92 93int uwb_dev_disconnect(dev_info_t *); 94int uwb_dev_reconnect(dev_info_t *); 95 96int uwb_dev_online(dev_info_t *); 97int uwb_dev_offline(dev_info_t *); 98 99dev_info_t *uwb_get_dip(uwb_dev_handle_t); 100 101#ifdef __cplusplus 102} 103#endif 104 105#endif /* _SYS_UWB_UWBAI_H */ 106