Shao Miller [Thu, 23 Dec 2010 14:38:31 +0000 (09:38 -0500)]
[driver] Rename driver__obj_ptr to WvDriverObj
Shao Miller [Thu, 23 Dec 2010 14:19:34 +0000 (09:19 -0500)]
[driver] Set IsBus flag on the main bus FDO
Shao Miller [Thu, 23 Dec 2010 13:56:12 +0000 (08:56 -0500)]
[bus] Add child PDO node unit number logic
The same kind of effort as we see in WvBusAddChild().
The point is for a move away from WV_S_DEV_T and towards
a bus library that can be used by any driver, so some
things will go in WV_S_BUS_NODE, instead.
Shao Miller [Tue, 21 Dec 2010 21:44:49 +0000 (16:44 -0500)]
[bus] Add FDO member to bus structure
In a possibly eventual effort to move away from WV_S_DEV_T
Shao Miller [Tue, 21 Dec 2010 20:55:44 +0000 (15:55 -0500)]
[project,bus] Two commits: #inclusion and bus freeing
Unfortunately, this is two commits as one.
A bus thread will not attempt to free the bus, making a
caller or another thread responsible.
Make header #include guards consistently named.
Shao Miller [Tue, 21 Dec 2010 15:21:34 +0000 (10:21 -0500)]
[bus] Put the device right in the bus
Instead of a pointer and a separate allocation, put
the device structure right inside the bus structure.
Now when we free, we simply free the bus structure.
Shao Miller [Tue, 21 Dec 2010 15:03:31 +0000 (10:03 -0500)]
[aoe] Move registry setup into new registry TU
Introduce registry.c translation unit and move setup_reg()
into it as AoeRegSetup().
Shao Miller [Tue, 21 Dec 2010 14:53:14 +0000 (09:53 -0500)]
[aoe] Rename aoe__get_ to AoeDiskFromDev_
Shao Miller [Tue, 21 Dec 2010 14:48:56 +0000 (09:48 -0500)]
[aoe] Rename globals
Shao Miller [Tue, 21 Dec 2010 14:26:05 +0000 (09:26 -0500)]
[aoe] Rename aoe__target_list_ to AOE_S_TARGET_LIST_
Shao Miller [Tue, 21 Dec 2010 14:21:41 +0000 (09:21 -0500)]
[aoe] Rename aoe__search_state_ to AOE_E_SEARCH_STATE_
Along with the value identifiers.
Shao Miller [Tue, 21 Dec 2010 14:15:29 +0000 (09:15 -0500)]
[aoe] Rename aoe__disk_search_ to AOE_S_DISK_SEARCH_
Shao Miller [Tue, 21 Dec 2010 14:08:30 +0000 (09:08 -0500)]
[aoe] Rename aoe__work_tag_ to AOE_S_WORK_TAG_
Shao Miller [Tue, 21 Dec 2010 14:04:16 +0000 (09:04 -0500)]
[aoe] Rename aoe__io_req_ to AOE_S_IO_REQ_
Shao Miller [Tue, 21 Dec 2010 14:01:15 +0000 (09:01 -0500)]
[aoe] Rename aoe__packet_ to AOE_S_PACKET_
Shao Miller [Tue, 21 Dec 2010 13:57:44 +0000 (08:57 -0500)]
[aoe] Rename aoe__tag_type_ to AOE_E_TAG_TYPE_
Shao Miller [Tue, 21 Dec 2010 13:54:01 +0000 (08:54 -0500)]
[aoe] Rename close to AoeDiskClose_
Shao Miller [Tue, 21 Dec 2010 13:53:09 +0000 (08:53 -0500)]
[aoe] Rename init to AoeDiskInit_
Shao Miller [Tue, 21 Dec 2010 13:52:12 +0000 (08:52 -0500)]
[aoe] Rename max_xfer_len to AoeDiskMaxXferLen_
Shao Miller [Tue, 21 Dec 2010 13:50:58 +0000 (08:50 -0500)]
[aoe] Rename io to AoeDiskIo_
Shao Miller [Tue, 21 Dec 2010 13:44:52 +0000 (08:44 -0500)]
[aoe] Rename aoe__create_disk_ to AoeDiskCreate_
As well as aoe__free_disk_ to AoeDiskFree_
Shao Miller [Tue, 21 Dec 2010 13:44:01 +0000 (08:44 -0500)]
[aoe] Rename aoe__unload_ to AoeUnload_
Shao Miller [Tue, 21 Dec 2010 13:43:13 +0000 (08:43 -0500)]
[aoe] Rename aoe__process_abft_ to AoeProcessAbft_
Shao Miller [Tue, 21 Dec 2010 13:41:38 +0000 (08:41 -0500)]
[aoe] Rename aoe__thread_ to AoeThread_
Shao Miller [Tue, 21 Dec 2010 13:38:16 +0000 (08:38 -0500)]
[aoe] Rename aoe__disk_type_ to AOE_S_DISK_
Shao Miller [Tue, 21 Dec 2010 13:27:41 +0000 (08:27 -0500)]
[aoe/bus] Rename functions and other identifiers
Shao Miller [Tue, 21 Dec 2010 13:24:35 +0000 (08:24 -0500)]
[aoe] Rename aoe_bus to AoeBusMain
Shao Miller [Tue, 21 Dec 2010 04:50:38 +0000 (23:50 -0500)]
[disk] Minor, cosmetic touch-ups
Shao Miller [Mon, 20 Dec 2010 23:32:09 +0000 (18:32 -0500)]
[disk] Rename device member to Dev
Shao Miller [Mon, 20 Dec 2010 23:01:58 +0000 (18:01 -0500)]
[disk] Rename disk__ops to WV_S_DISK_OPS
As well as renaming its members.
Shao Miller [Mon, 20 Dec 2010 22:54:41 +0000 (17:54 -0500)]
[disk] Use typedef instead of macro for disk close func.
Instead of disk__close_decl(), use WV_F_DISK_CLOSE
Shao Miller [Mon, 20 Dec 2010 22:45:03 +0000 (17:45 -0500)]
[disk] Use typedef instead of macro for disk init. func.
Instead of disk__init_decl(), use WV_F_DISK_INIT
Shao Miller [Mon, 20 Dec 2010 22:32:19 +0000 (17:32 -0500)]
[disk] Use typedef instead of macro for disk max. xfer. len. func.
Instead of disk__max_xfer_len_decl(), use WV_F_DISK_MAX_XFER_LEN
Shao Miller [Mon, 20 Dec 2010 22:19:43 +0000 (17:19 -0500)]
[disk] Use typedef instead of macro for disk I/O functions
Instead of disk__io_decl(), use WV_F_DISK_IO
Shao Miller [Mon, 20 Dec 2010 22:06:19 +0000 (17:06 -0500)]
[disk] Rename disk__type to WV_S_DISK_T
Shao Miller [Mon, 20 Dec 2010 21:47:52 +0000 (16:47 -0500)]
[disk] Minor, cosmetic touch-ups
Shao Miller [Mon, 20 Dec 2010 21:23:39 +0000 (16:23 -0500)]
[disk] Rename disk__io_mode to WV_E_DISK_IO_MODE
Shao Miller [Mon, 20 Dec 2010 21:16:15 +0000 (16:16 -0500)]
[disk] Rename disk__boot_sect_ptr to WV_AP_DISK_BOOT_SECT
Shao Miller [Mon, 20 Dec 2010 21:07:15 +0000 (16:07 -0500)]
[disk] Rename disk__compat_ids to WvDiskCompatIds
Shao Miller [Mon, 20 Dec 2010 21:05:25 +0000 (16:05 -0500)]
[disk] Rename disk__removable to WvDiskIsRemovable
Shao Miller [Mon, 20 Dec 2010 21:01:16 +0000 (16:01 -0500)]
[disk] Rename disk__media to WV_E_DISK_MEDIA_TYPE
Shao Miller [Mon, 20 Dec 2010 20:51:47 +0000 (15:51 -0500)]
[disk] Change macro for header inclusion
Shao Miller [Mon, 20 Dec 2010 20:45:49 +0000 (15:45 -0500)]
[device] Rename two functions
device__free_dev_ to WvDevFreeDev_ and
device__make_pdo_ to WvDevMakePdo_
Shao Miller [Mon, 20 Dec 2010 20:33:06 +0000 (15:33 -0500)]
[device] Many more cosmetic changes
Even more to come.
Shao Miller [Mon, 20 Dec 2010 19:35:39 +0000 (14:35 -0500)]
[device] Many cosmetic changes
More to come.
Shao Miller [Mon, 20 Dec 2010 16:18:03 +0000 (11:18 -0500)]
[probe] Minor, cosmetic touch-ups
Rename some functions and local identifiers, etc.
Shao Miller [Mon, 20 Dec 2010 16:08:12 +0000 (11:08 -0500)]
[bus/pnp,dev_ctl] Rename functions
Shao Miller [Mon, 20 Dec 2010 05:42:54 +0000 (00:42 -0500)]
[bus/pnp] Enqueue IRP_MN_QUERY_DEVICE_RELATIONS IRP
Shao Miller [Mon, 20 Dec 2010 05:32:16 +0000 (00:32 -0500)]
[bus] Fix the thread stop condition
Oops.
Shao Miller [Mon, 20 Dec 2010 05:12:39 +0000 (00:12 -0500)]
[bus] Introduce WvBusEnqueueIrp function
For a threaded bus, it is handy to keep all operations
that walk the list of child devices or use their count
in the thread to avoid race conditions and holding locks.
A IRP such as IRP_MN_QUERY_DEVICE_RELATIONS needs to
allocate a response whose size depends on the count of
child devices, for instance. Such an IRP would be nice
to enqueue for the thread.
Shao Miller [Sun, 19 Dec 2010 17:00:52 +0000 (12:00 -0500)]
[bus] Minor cosmetic touch-ups
Shao Miller [Sun, 19 Dec 2010 16:36:40 +0000 (11:36 -0500)]
[bus] Rename bus__thread_ to WvBusThread_
Shao Miller [Sun, 19 Dec 2010 16:34:26 +0000 (11:34 -0500)]
[bus] Rename bus__thread_free_ to WvBusThreadFree_
Shao Miller [Sun, 19 Dec 2010 16:32:44 +0000 (11:32 -0500)]
[bus] Rename bus__init_ to WvBusDevInit_
Shao Miller [Sun, 19 Dec 2010 16:31:06 +0000 (11:31 -0500)]
[bus] Rename bus__irp_mj to WvBusIrpMj_
Shao Miller [Sun, 19 Dec 2010 16:29:43 +0000 (11:29 -0500)]
[bus] Rename bus__get_work_item_ to WvBusGetWorkItem_
Shao Miller [Sun, 19 Dec 2010 16:28:36 +0000 (11:28 -0500)]
[bus] Rename bus__add_work_item_ to WvBusAddWorkItem_
Shao Miller [Sun, 19 Dec 2010 16:27:16 +0000 (11:27 -0500)]
[bus] Rename bus__default_thread_ to WvBusDefaultThread_
Shao Miller [Sun, 19 Dec 2010 16:26:12 +0000 (11:26 -0500)]
[bus] Remove undefined function declaration
Shao Miller [Sun, 19 Dec 2010 16:24:26 +0000 (11:24 -0500)]
[bus] Rename bus__sys_ctl_ to WvBusSysCtl_
Shao Miller [Sun, 19 Dec 2010 16:23:25 +0000 (11:23 -0500)]
[bus] Rename bus__power_ to WvBusPower_
Shao Miller [Sun, 19 Dec 2010 16:22:28 +0000 (11:22 -0500)]
[bus] Rename bus__create_pdo_ to WvBusCreatePdo_
Shao Miller [Sun, 19 Dec 2010 16:21:31 +0000 (11:21 -0500)]
[bus] Rename bus__free_ to WvBusFree_
Shao Miller [Sun, 19 Dec 2010 16:06:23 +0000 (11:06 -0500)]
[bus] Rename bus_pnp__dispatch to WvBusPnpDispatch
Shao Miller [Sun, 19 Dec 2010 16:03:11 +0000 (11:03 -0500)]
[bus] Rename bus_dev_ctl__dispatch to WvBusDevCtlDispatch
Shao Miller [Sun, 19 Dec 2010 15:56:46 +0000 (10:56 -0500)]
[bus] Remove unused member SpinLock
Shao Miller [Sun, 19 Dec 2010 15:49:05 +0000 (10:49 -0500)]
[bus] Introduce WvBusCancelWorkItems
A bus thread routine or whichever thread calls
WvBusProcessWorkItems() should call this new function
if the bus is to be stopped. It frees the memory
allocated for each pending work item.
Also fix the comments for WvBusStartThread().
Shao Miller [Sun, 19 Dec 2010 15:25:15 +0000 (10:25 -0500)]
[bus] Use Stop member instead of Thread for thread shutdown
Shao Miller [Sun, 19 Dec 2010 15:20:44 +0000 (10:20 -0500)]
[bus] Rename member thread to Thread
Yippee.
Shao Miller [Sun, 19 Dec 2010 15:18:25 +0000 (10:18 -0500)]
[bus] Move work_items and work_items_lock as private
Move these members into the "private" section of the bus
structure. They're renamed, as well.
Also, rename work_signal to ThreadSignal. It should
remain "public," since one can override a bus' thread
routine (so one should be able to use that signal).
Shao Miller [Sun, 19 Dec 2010 15:07:20 +0000 (10:07 -0500)]
[bus] Remove members dev_name and dos_dev_name
Move responsibility for bus device naming out of the bus
module and into the caller.
The AoE module is a bit mixed-up just now and doesn't
work. It's currently going to try to create a symlink
but the PDO for the AoE bus is not going to have been
named by the bus module. What we really want is for the
AoE bus' _FDO_ to be the named device... I think.
Shao Miller [Sun, 19 Dec 2010 07:42:32 +0000 (02:42 -0500)]
[bus] Move member prev_free to BusPrivate_.PrevFree
Only the bus module should really manipulate this member.
Shao Miller [Sun, 19 Dec 2010 07:38:48 +0000 (02:38 -0500)]
[bus] Remove unused member tracking
Shao Miller [Sun, 19 Dec 2010 07:37:53 +0000 (02:37 -0500)]
[bus] Remove unused member ext
Shao Miller [Sun, 19 Dec 2010 07:36:39 +0000 (02:36 -0500)]
[bus] Rename device member to Dev
Shao Miller [Sun, 19 Dec 2010 07:29:54 +0000 (02:29 -0500)]
[bus] Rename bus__start_thread to WvBusStartThread
Shao Miller [Sun, 19 Dec 2010 07:27:58 +0000 (02:27 -0500)]
[bus] Rename bus__process_work_items to WvBusProcessWorkItems
Shao Miller [Sun, 19 Dec 2010 07:25:30 +0000 (02:25 -0500)]
[bus] Rename bus__get to WvBusFromDev
Shao Miller [Fri, 17 Dec 2010 23:13:17 +0000 (18:13 -0500)]
[bus] Rename bus__add_child to WvBusAddChild
Shao Miller [Fri, 17 Dec 2010 23:12:08 +0000 (18:12 -0500)]
[bus] Rename bus__create to WvBusCreate
Shao Miller [Fri, 17 Dec 2010 23:06:14 +0000 (18:06 -0500)]
[bus] Rename bus__init to WvBusInit
Shao Miller [Fri, 17 Dec 2010 23:02:54 +0000 (18:02 -0500)]
[bus] Remove unused module init/shutdown declarations
They should have been removed in a previous commit.
Shao Miller [Fri, 17 Dec 2010 23:00:12 +0000 (18:00 -0500)]
[bus] Rename bus__get_dev_capabilities to WvBusGetDevCapabilities
Shao Miller [Fri, 17 Dec 2010 22:53:13 +0000 (17:53 -0500)]
[bus] Rename bus__thread_func to WV_F_BUS_THREAD
Using the naming convention briefly detailed in
commit
6a99f82ba3.
Shao Miller [Fri, 17 Dec 2010 22:48:30 +0000 (17:48 -0500)]
[bus] Rename bus__type to WV_S_BUS_T
Using the naming convention briefly detailed in
commit
6a99f82ba3.
Shao Miller [Fri, 17 Dec 2010 22:36:53 +0000 (17:36 -0500)]
[bus] Cosmetic change for header inclusion macro
Shao Miller [Fri, 17 Dec 2010 22:34:39 +0000 (17:34 -0500)]
[device,bus] Fix sizeof use in initialization
Oops!
Shao Miller [Fri, 17 Dec 2010 22:33:07 +0000 (17:33 -0500)]
[bus] Introduce PDO node addition/removal functions
WV_S_BUS_NODE is an opaque type representing a child
PDO node on a bus.
WvBusInitNode() will initialize such a node and associate
it with the DEVICE_OBJECT that is its physical device
object.
WvBusAddNode() will schedule the addition of a node to a
bus. When bus__process_work_items() is called for the
bus, the addition will take place.
WvBusRemoveNode() will schedule the removal of a node
from a bus. When bus__process_work_items() is called
for the bus, the removal will take place.
bus__process_work_items() should be called by the bus'
thread routine, because it expects to have sole control
over the linked list of bus nodes (no race conditions,
please).
And of course, you might notice the i'th coding style
change. This one is more of a "when in Rome..." change.
WV_ttt_mmm_nnn
WV : "WinVBlock"
ttt : type; can be a combination of
E : enum
S : struct
U : union
A : array
F : function
P : pointer
I : integer
M : #defined macro
mmm : module
nnn : type name
Shao Miller [Thu, 16 Dec 2010 03:51:43 +0000 (22:51 -0500)]
[bus] Add bus__init for initializing to defaults
Now you know why a previous commit renamed the older
bus__init() function. :)
Shao Miller [Thu, 16 Dec 2010 03:35:30 +0000 (22:35 -0500)]
[device] Add device__init for initializing to defaults
Now you know why a previous commit renamed the older
device__init() function. :)
Shao Miller [Thu, 16 Dec 2010 03:08:08 +0000 (22:08 -0500)]
[ramdisk] Rename ramdisk__init to ramdisk__module_init
Shao Miller [Thu, 16 Dec 2010 03:05:46 +0000 (22:05 -0500)]
[filedisk] Rename filedisk__init to filedisk__module_init
Shao Miller [Thu, 16 Dec 2010 03:03:13 +0000 (22:03 -0500)]
[disk] Rename disk__init to disk__module_init
Shao Miller [Wed, 15 Dec 2010 15:20:52 +0000 (10:20 -0500)]
[bus,device] Allow for threaded PDO creation on a bus
bus__add_child() will add a PDO creation request to the
work item queue for a threaded bus, then wait for it to
complete. We do this so that the PDO is created in the
bus' thread context. For example, if the AoE driver were
to request a PDO, we want that PDO created by the WinVBlock
driver (the main bus' thread should be that context).
We add a completion signal pointer to work items, initialize
the signal upon adding a work item to a bus' queue, and
signal completion when a work item has been completed.
Shao Miller [Wed, 15 Dec 2010 03:13:43 +0000 (22:13 -0500)]
[bus] Let a threaded bus free itself
Hook device__type::ops.free() so that when called, it
schedules a freeing action but doesn't actually free.
Shao Miller [Wed, 15 Dec 2010 02:55:55 +0000 (21:55 -0500)]
[bus,driver] Introduce bus threading
The driver now calls bus__start_thread() on the main bus.
One can implement their own bus__thread_func routine and
assign it to the bus::thread member. If one does so, one
should call bus__process_work_items() within the thread's
loop, and one should be responsible for freeing their bus.
Shao Miller [Wed, 15 Dec 2010 01:33:17 +0000 (20:33 -0500)]
[bus] Introduce work item queue and processing
bus__add_work_item_() will add a work item.
bus__get_work_item_() will get and dequeue a work item.
bus__process_work_items() will walk the work item queue
and process each work item.
Shao Miller [Tue, 14 Dec 2010 05:19:48 +0000 (00:19 -0500)]
[bus/pnp,disk/pnp,aoe] Get AoE sub-bus to work
Added some debugging messages to bus/pnp.c and disk/pnp.c.
Added a few PnP routines to bus/pnp.c.
Fixed a bug in aoe/bus.c where a hardware ID string was not
properly terminated.
Changed the IDs reported in aoe/bus.c.
A little note: The main WinVBlock bus might be better off
creating/deleting PDOs in its own thread context.
Shao Miller [Mon, 13 Dec 2010 23:37:40 +0000 (18:37 -0500)]
[irp,aoe] Remove mini IRP handling scheme
Goodbye, mini IRP handling scheme.
Since AoE still had remnants but doesn't yet work as a
sub-bus anyway, some fair changes were made to the AoE
module, such as renaming functions and changing the
IRP_MJ_DEVICE_CONTROL; aoe_bus__dev_ctl_dispatch_().
Shao Miller [Mon, 13 Dec 2010 21:50:08 +0000 (16:50 -0500)]
[project] Don't use mini IRP handling for IRP_MJ_PNP
Use device::irp_mj.pnp(), instead.
This is the last of the IRP_MJ_* major functions that were
previously handled with the mini IRP handling scheme.