1*672fc84aSRobert Mustacchi /* 2*672fc84aSRobert Mustacchi * This file and its contents are supplied under the terms of the 3*672fc84aSRobert Mustacchi * Common Development and Distribution License ("CDDL"), version 1.0. 4*672fc84aSRobert Mustacchi * You may only use this file in accordance with the terms of version 5*672fc84aSRobert Mustacchi * 1.0 of the CDDL. 6*672fc84aSRobert Mustacchi * 7*672fc84aSRobert Mustacchi * A full copy of the text of the CDDL should have accompanied this 8*672fc84aSRobert Mustacchi * source. A copy of the CDDL is also available via the Internet at 9*672fc84aSRobert Mustacchi * http://www.illumos.org/license/CDDL. 10*672fc84aSRobert Mustacchi */ 11*672fc84aSRobert Mustacchi 12*672fc84aSRobert Mustacchi /* 13*672fc84aSRobert Mustacchi * Copyright (c) 2018, Joyent, Inc. 14*672fc84aSRobert Mustacchi */ 15*672fc84aSRobert Mustacchi 16*672fc84aSRobert Mustacchi #ifndef _TOPO_USB_INT_H 17*672fc84aSRobert Mustacchi #define _TOPO_USB_INT_H 18*672fc84aSRobert Mustacchi 19*672fc84aSRobert Mustacchi #include <stdint.h> 20*672fc84aSRobert Mustacchi #include <sys/types.h> 21*672fc84aSRobert Mustacchi #include <fm/topo_list.h> 22*672fc84aSRobert Mustacchi #include <fm/topo_mod.h> 23*672fc84aSRobert Mustacchi #include <sys/fm/protocol.h> 24*672fc84aSRobert Mustacchi 25*672fc84aSRobert Mustacchi #include "acpi.h" 26*672fc84aSRobert Mustacchi #include "accommon.h" 27*672fc84aSRobert Mustacchi #include "acbuffer.h" 28*672fc84aSRobert Mustacchi 29*672fc84aSRobert Mustacchi #ifdef __cplusplus 30*672fc84aSRobert Mustacchi extern "C" { 31*672fc84aSRobert Mustacchi #endif 32*672fc84aSRobert Mustacchi 33*672fc84aSRobert Mustacchi typedef enum topo_usb_path_type { 34*672fc84aSRobert Mustacchi TOPO_USB_T_ACPI 35*672fc84aSRobert Mustacchi } topo_usb_path_type_t; 36*672fc84aSRobert Mustacchi 37*672fc84aSRobert Mustacchi typedef struct topo_usb_meta_port_path { 38*672fc84aSRobert Mustacchi topo_list_t tmpp_link; 39*672fc84aSRobert Mustacchi topo_usb_path_type_t tmpp_type; 40*672fc84aSRobert Mustacchi char *tmpp_path; 41*672fc84aSRobert Mustacchi } topo_usb_meta_port_path_t; 42*672fc84aSRobert Mustacchi 43*672fc84aSRobert Mustacchi typedef enum topo_usb_meta_port_flags { 44*672fc84aSRobert Mustacchi TOPO_USB_F_INTERNAL = 1 << 0, 45*672fc84aSRobert Mustacchi TOPO_USB_F_EXTERNAL = 1 << 1, 46*672fc84aSRobert Mustacchi TOPO_USB_F_CHASSIS = 1 << 2, 47*672fc84aSRobert Mustacchi } topo_usb_meta_port_flags_t; 48*672fc84aSRobert Mustacchi 49*672fc84aSRobert Mustacchi typedef struct topo_usb_meta_port { 50*672fc84aSRobert Mustacchi topo_list_t tmp_link; 51*672fc84aSRobert Mustacchi topo_usb_meta_port_flags_t tmp_flags; 52*672fc84aSRobert Mustacchi uint_t tmp_port_type; 53*672fc84aSRobert Mustacchi char *tmp_label; 54*672fc84aSRobert Mustacchi topo_list_t tmp_paths; 55*672fc84aSRobert Mustacchi } topo_usb_meta_port_t; 56*672fc84aSRobert Mustacchi 57*672fc84aSRobert Mustacchi typedef enum topo_usb_meta_flags { 58*672fc84aSRobert Mustacchi TOPO_USB_M_ACPI_MATCH = 1 << 0, 59*672fc84aSRobert Mustacchi TOPO_USB_M_NO_ACPI = 1 << 1, 60*672fc84aSRobert Mustacchi TOPO_USB_M_METADATA_MATCH = 1 << 2 61*672fc84aSRobert Mustacchi } topo_usb_meta_flags_t; 62*672fc84aSRobert Mustacchi 63*672fc84aSRobert Mustacchi extern int topo_usb_load_metadata(topo_mod_t *, tnode_t *, topo_list_t *, 64*672fc84aSRobert Mustacchi topo_usb_meta_flags_t *); 65*672fc84aSRobert Mustacchi extern void topo_usb_free_metadata(topo_mod_t *, topo_list_t *); 66*672fc84aSRobert Mustacchi 67*672fc84aSRobert Mustacchi typedef ACPI_PLD_INFO acpi_pld_info_t; 68*672fc84aSRobert Mustacchi extern boolean_t usbtopo_decode_pld(uint8_t *, size_t, acpi_pld_info_t *); 69*672fc84aSRobert Mustacchi 70*672fc84aSRobert Mustacchi #ifdef __cplusplus 71*672fc84aSRobert Mustacchi } 72*672fc84aSRobert Mustacchi #endif 73*672fc84aSRobert Mustacchi 74*672fc84aSRobert Mustacchi #endif /* _TOPO_USB_INT_H */ 75