2 * Copyright (C) 2009-2010, Shao Miller <shao.miller@yrdsb.edu.on.ca>.
3 * Copyright 2006-2008, V.
4 * For WinAoE contact information, see http://winaoe.org/
6 * This file is part of WinVBlock, derived from WinAoE.
8 * WinVBlock is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * WinVBlock is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with WinVBlock. If not, see <http://www.gnu.org/licenses/>.
31 device__type_ptr device;
32 PDEVICE_OBJECT LowerDeviceObject;
33 PDEVICE_OBJECT PhysicalDeviceObject;
34 winvblock__uint32 Children;
35 device__type_ptr first_child_ptr;
38 winvblock__any_ptr ext;
39 device__free_func * prev_free;
40 UNICODE_STRING dev_name;
41 UNICODE_STRING dos_dev_name;
42 winvblock__bool named;
45 extern NTSTATUS STDCALL bus__get_dev_capabilities(
47 IN PDEVICE_CAPABILITIES
50 extern NTSTATUS bus__module_init(void);
53 * Tear down the global, bus-common environment.
55 extern void bus__finalize(void);
60 * @ret bus_ptr The address of a new bus, or NULL for failure.
62 * This function should not be confused with a PDO creation routine, which is
63 * actually implemented for each device type. This routine will allocate a
64 * bus__type, track it in a global list, as well as populate the bus
65 * with default values.
67 extern winvblock__lib_func struct bus__type * bus__create(void);
70 * Add a child node to the bus.
72 * @v bus_ptr Points to the bus receiving the child.
73 * @v dev_ptr Points to the child device to add.
75 * Returns TRUE for success, FALSE for failure.
77 extern winvblock__lib_func winvblock__bool STDCALL bus__add_child(
78 IN OUT struct bus__type * bus_ptr,
79 IN device__type_ptr dev_ptr
83 * Get a pointer to the bus device's extension space.
85 * @ret A pointer to the bus device's extension space, or NULL.
87 extern winvblock__lib_func struct bus__type * bus__boot(void);
89 extern winvblock__lib_func struct bus__type * bus__get(device__type_ptr dev);