1*9430SRaymond.Chen@Sun.COM /* 2*9430SRaymond.Chen@Sun.COM * CDDL HEADER START 3*9430SRaymond.Chen@Sun.COM * 4*9430SRaymond.Chen@Sun.COM * The contents of this file are subject to the terms of the 5*9430SRaymond.Chen@Sun.COM * Common Development and Distribution License (the "License"). 6*9430SRaymond.Chen@Sun.COM * You may not use this file except in compliance with the License. 7*9430SRaymond.Chen@Sun.COM * 8*9430SRaymond.Chen@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*9430SRaymond.Chen@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*9430SRaymond.Chen@Sun.COM * See the License for the specific language governing permissions 11*9430SRaymond.Chen@Sun.COM * and limitations under the License. 12*9430SRaymond.Chen@Sun.COM * 13*9430SRaymond.Chen@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*9430SRaymond.Chen@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*9430SRaymond.Chen@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*9430SRaymond.Chen@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*9430SRaymond.Chen@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*9430SRaymond.Chen@Sun.COM * 19*9430SRaymond.Chen@Sun.COM * CDDL HEADER END 20*9430SRaymond.Chen@Sun.COM */ 21*9430SRaymond.Chen@Sun.COM /* 22*9430SRaymond.Chen@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23*9430SRaymond.Chen@Sun.COM * Use is subject to license terms. 24*9430SRaymond.Chen@Sun.COM */ 25*9430SRaymond.Chen@Sun.COM 26*9430SRaymond.Chen@Sun.COM #ifndef _SYS_UWB_UWBAI_H 27*9430SRaymond.Chen@Sun.COM #define _SYS_UWB_UWBAI_H 28*9430SRaymond.Chen@Sun.COM 29*9430SRaymond.Chen@Sun.COM 30*9430SRaymond.Chen@Sun.COM #ifdef __cplusplus 31*9430SRaymond.Chen@Sun.COM extern "C" { 32*9430SRaymond.Chen@Sun.COM #endif 33*9430SRaymond.Chen@Sun.COM 34*9430SRaymond.Chen@Sun.COM /* 35*9430SRaymond.Chen@Sun.COM * This header file includes interfaces for UWB radio controller drivers. 36*9430SRaymond.Chen@Sun.COM */ 37*9430SRaymond.Chen@Sun.COM 38*9430SRaymond.Chen@Sun.COM /* 39*9430SRaymond.Chen@Sun.COM * A uwb device handle is returned by uwb_device_attach() on success. The 40*9430SRaymond.Chen@Sun.COM * handle is opaque to the client uwba driver. The implimentation structure is 41*9430SRaymond.Chen@Sun.COM * uwba_dev 42*9430SRaymond.Chen@Sun.COM */ 43*9430SRaymond.Chen@Sun.COM typedef struct uwb_dev_handle *uwb_dev_handle_t; 44*9430SRaymond.Chen@Sun.COM 45*9430SRaymond.Chen@Sun.COM 46*9430SRaymond.Chen@Sun.COM /* 47*9430SRaymond.Chen@Sun.COM * UWBA function return values 48*9430SRaymond.Chen@Sun.COM */ 49*9430SRaymond.Chen@Sun.COM #define UWB_SUCCESS 0 /* call success */ 50*9430SRaymond.Chen@Sun.COM #define UWB_FAILURE -1 /* unspecified UWBA or HCD error */ 51*9430SRaymond.Chen@Sun.COM #define UWB_NO_RESOURCES -2 /* no resources available */ 52*9430SRaymond.Chen@Sun.COM #define UWB_NO_BANDWIDTH -3 /* no bandwidth available */ 53*9430SRaymond.Chen@Sun.COM #define UWB_NOT_SUPPORTED -4 /* function not supported by HCD */ 54*9430SRaymond.Chen@Sun.COM #define UWB_PIPE_ERROR -5 /* error occured on the pipe */ 55*9430SRaymond.Chen@Sun.COM #define UWB_INVALID_PIPE -6 /* pipe handle passed is invalid */ 56*9430SRaymond.Chen@Sun.COM #define UWB_NO_FRAME_NUMBER -7 /* frame No or ASAP not specified */ 57*9430SRaymond.Chen@Sun.COM #define UWB_INVALID_START_FRAME -8 /* starting UWB frame not valid */ 58*9430SRaymond.Chen@Sun.COM #define UWB_HC_HARDWARE_ERROR -9 /* UWB host controller error */ 59*9430SRaymond.Chen@Sun.COM #define UWB_INVALID_REQUEST -10 /* request had invalid values */ 60*9430SRaymond.Chen@Sun.COM #define UWB_INVALID_CONTEXT -11 /* sleep flag in interrupt context */ 61*9430SRaymond.Chen@Sun.COM #define UWB_INVALID_VERSION -12 /* invalid version specified */ 62*9430SRaymond.Chen@Sun.COM #define UWB_INVALID_ARGS -13 /* invalid func args specified */ 63*9430SRaymond.Chen@Sun.COM #define UWB_INVALID_PERM -14 /* privileged operation */ 64*9430SRaymond.Chen@Sun.COM #define UWB_BUSY -15 /* busy condition */ 65*9430SRaymond.Chen@Sun.COM #define UWB_PARSE_ERROR -18 66*9430SRaymond.Chen@Sun.COM 67*9430SRaymond.Chen@Sun.COM 68*9430SRaymond.Chen@Sun.COM 69*9430SRaymond.Chen@Sun.COM /* Max wait time for each uwb cmd */ 70*9430SRaymond.Chen@Sun.COM #define UWB_CMD_TIMEOUT (ddi_get_lbolt() + drv_usectohz(10000000)) 71*9430SRaymond.Chen@Sun.COM 72*9430SRaymond.Chen@Sun.COM 73*9430SRaymond.Chen@Sun.COM /* 74*9430SRaymond.Chen@Sun.COM * Radio controller driver registion 75*9430SRaymond.Chen@Sun.COM */ 76*9430SRaymond.Chen@Sun.COM void uwb_dev_attach(dev_info_t *, uwb_dev_handle_t *, uint_t, 77*9430SRaymond.Chen@Sun.COM int (*)(uwb_dev_handle_t, mblk_t *, uint16_t)); 78*9430SRaymond.Chen@Sun.COM void uwb_dev_detach(uwb_dev_handle_t); 79*9430SRaymond.Chen@Sun.COM 80*9430SRaymond.Chen@Sun.COM /* UWB COMMON INTERFACES */ 81*9430SRaymond.Chen@Sun.COM int uwb_do_ioctl(uwb_dev_handle_t, int, intptr_t, int); 82*9430SRaymond.Chen@Sun.COM int uwb_parse_evt_notif(uint8_t *, int, uwb_dev_handle_t); 83*9430SRaymond.Chen@Sun.COM int uwb_scan_channel(uwb_dev_handle_t, uint8_t); 84*9430SRaymond.Chen@Sun.COM int uwb_reset_dev(dev_info_t *); 85*9430SRaymond.Chen@Sun.COM int uwb_init_phy(dev_info_t *); 86*9430SRaymond.Chen@Sun.COM int uwb_stop_beacon(dev_info_t *); 87*9430SRaymond.Chen@Sun.COM int uwb_start_beacon(dev_info_t *, uint8_t); 88*9430SRaymond.Chen@Sun.COM int uwb_get_mac_addr(dev_info_t *, uint8_t *); 89*9430SRaymond.Chen@Sun.COM int uwb_get_dev_addr(dev_info_t *, uint16_t *); 90*9430SRaymond.Chen@Sun.COM int uwb_set_dev_addr(dev_info_t *, uint16_t); 91*9430SRaymond.Chen@Sun.COM uint8_t uwb_allocate_channel(dev_info_t *); 92*9430SRaymond.Chen@Sun.COM 93*9430SRaymond.Chen@Sun.COM int uwb_dev_disconnect(dev_info_t *); 94*9430SRaymond.Chen@Sun.COM int uwb_dev_reconnect(dev_info_t *); 95*9430SRaymond.Chen@Sun.COM 96*9430SRaymond.Chen@Sun.COM int uwb_dev_online(dev_info_t *); 97*9430SRaymond.Chen@Sun.COM int uwb_dev_offline(dev_info_t *); 98*9430SRaymond.Chen@Sun.COM 99*9430SRaymond.Chen@Sun.COM dev_info_t *uwb_get_dip(uwb_dev_handle_t); 100*9430SRaymond.Chen@Sun.COM 101*9430SRaymond.Chen@Sun.COM #ifdef __cplusplus 102*9430SRaymond.Chen@Sun.COM } 103*9430SRaymond.Chen@Sun.COM #endif 104*9430SRaymond.Chen@Sun.COM 105*9430SRaymond.Chen@Sun.COM #endif /* _SYS_UWB_UWBAI_H */ 106