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 * WvBusProcessWorkItems() within its loop.
38 typedef void STDCALL WV_F_BUS_THREAD(IN WV_SP_BUS_T);
39 typedef WV_F_BUS_THREAD * WV_FP_BUS_THREAD;
42 typedef struct WV_BUS_T {
43 struct device__type * Dev;
44 PDEVICE_OBJECT LowerDeviceObject;
45 PDEVICE_OBJECT PhysicalDeviceObject;
46 winvblock__uint32 Children;
47 struct device__type * first_child;
49 WV_FP_BUS_THREAD Thread;
55 device__free_func * PrevFree;
57 KSPIN_LOCK WorkItemsLock;
59 } WV_S_BUS_T, * WV_SP_BUS_T;
61 /* A child PDO node on a bus. Treat this as an opaque type. */
62 typedef struct WV_BUS_NODE {
68 } WV_S_BUS_NODE, * WV_SP_BUS_NODE;
71 extern NTSTATUS STDCALL WvBusGetDevCapabilities(
73 IN PDEVICE_CAPABILITIES
75 extern winvblock__lib_func void WvBusInit(WV_SP_BUS_T);
76 extern winvblock__lib_func WV_SP_BUS_T WvBusCreate(void);
77 extern winvblock__lib_func winvblock__bool STDCALL WvBusAddChild(
79 IN struct device__type *
81 extern winvblock__lib_func WV_SP_BUS_T WvBusFromDev(struct device__type *);
82 extern winvblock__lib_func void WvBusProcessWorkItems(WV_SP_BUS_T);
83 extern winvblock__lib_func void WvBusCancelWorkItems(WV_SP_BUS_T);
84 extern winvblock__lib_func NTSTATUS WvBusStartThread(WV_SP_BUS_T);
85 extern winvblock__lib_func winvblock__bool STDCALL WvBusInitNode(
89 extern winvblock__lib_func NTSTATUS STDCALL WvBusAddNode(
93 extern winvblock__lib_func NTSTATUS STDCALL WvBusRemoveNode(WV_SP_BUS_NODE);
95 #endif /* WV_M_BUS_H_ */