00001 /* clib/include/able/bus/bus.h 00002 * 00003 * ABLE bus access macros 00004 * 00005 * Copyright 2003 Simtec Electronics 00006 * 00007 * Permission is hereby granted, free of charge, to any person 00008 * obtaining a copy of this software and associated documentation 00009 * files (the "Software"), to deal in the Software without 00010 * restriction, including without limitation the rights to use, copy, 00011 * modify, merge, publish, distribute, sublicense, and/or sell copies 00012 * of the Software, and to permit persons to whom the Software is 00013 * furnished to do so, subject to the following conditions: 00014 * 00015 * The above copyright notice and this permission notice shall be 00016 * included in all copies or substantial portions of the Software. 00017 * 00018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00019 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00020 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00021 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00022 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00023 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00024 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00025 * SOFTWARE. 00026 * 00027 */ 00028 00029 #ifndef _ABLE_CLIB_BUS_BUS_H 00030 #define _ABLE_CLIB_BUS_BUS_H 1 00031 00032 /* bus_vendid_t: 00033 * bus_prodid_t; 00034 * 00035 * these two types make the tuples to identify devices to the system. 00036 */ 00037 00038 typedef __u32 bus_vendid_t; /* bus vendor id t */ 00039 typedef __u32 bus_prodid_t; /* bus product id t */ 00040 00041 /* bus_class_t 00042 * bus_subclass_t 00043 * bus_interface_t 00044 * 00045 * these are the definitions for what sort of thing the device is 00046 */ 00047 00048 typedef __u16 bus_class_t; /* bus class type */ 00049 typedef __u16 bus_subclass_t; /* bus sub-class type */ 00050 typedef __u16 bus_interface_t; /* bus interface type */ 00051 00052 00053 typedef enum bus_type { 00054 BUSTYPE_ISA, 00055 BUSTYPE_PCI, 00056 BUSTYPE_RS, 00057 BUSTYPE_ARMv3, 00058 BUSTYPE_ARMv4, 00059 BUSTYPE_IIC, 00060 BUSTYPE_USB, 00061 BUSTYPE_GENERIC, 00062 } bus_type_t; 00063 00064 typedef struct bus bus_t; 00065 00066 #define BUSTYPE_ANY (-1) /* any bus */ 00067 00068 typedef void (*bus_enum_fn_t)(struct bus *bus, void *arg); 00069 00070 extern int bus_enum(int bustype, bus_enum_fn_t fn, void *args); 00071 00072 #endif /* _ABLE_CLIB_BUS_BUS_H */