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 * A bus thread routine.
33 * @v bus The bus to be used in the thread routine.
35 * If you implement your own bus thread routine, you should call
36 * bus__process_work_items() within its loop.
38 typedef void STDCALL bus__thread_func(IN struct bus__type *);
42 struct device__type * device;
43 PDEVICE_OBJECT LowerDeviceObject;
44 PDEVICE_OBJECT PhysicalDeviceObject;
45 winvblock__uint32 Children;
46 struct device__type * first_child;
49 winvblock__any_ptr ext;
50 device__free_func * prev_free;
51 UNICODE_STRING dev_name;
52 UNICODE_STRING dos_dev_name;
53 winvblock__bool named;
54 LIST_ENTRY work_items;
55 KSPIN_LOCK work_items_lock;
57 bus__thread_func * thread;
65 /* A child PDO node on a bus. Treat this as an opaque type. */
66 typedef struct WV_BUS_NODE {
70 struct bus__type * Bus;
72 } WV_S_BUS_NODE, * WV_SP_BUS_NODE;
75 extern NTSTATUS STDCALL bus__get_dev_capabilities(
77 IN PDEVICE_CAPABILITIES
79 extern NTSTATUS bus__module_init(void);
80 extern void bus__module_shutdown(void);
81 extern winvblock__lib_func void bus__init(struct bus__type *);
82 extern winvblock__lib_func struct bus__type * bus__create(void);
83 extern winvblock__lib_func winvblock__bool STDCALL bus__add_child(
84 IN OUT struct bus__type *,
85 IN struct device__type *
87 extern winvblock__lib_func struct bus__type * bus__get(struct device__type *);
88 extern winvblock__lib_func void bus__process_work_items(struct bus__type *);
89 extern winvblock__lib_func NTSTATUS bus__start_thread(struct bus__type *);
90 extern winvblock__lib_func winvblock__bool STDCALL WvBusInitNode(
94 extern winvblock__lib_func NTSTATUS STDCALL WvBusAddNode(
98 extern winvblock__lib_func NTSTATUS STDCALL WvBusRemoveNode(WV_SP_BUS_NODE);
100 #endif /* WV_M_BUS_H_ */