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.
Shao Miller [Mon, 13 Dec 2010 16:43:16 +0000 (11:43 -0500)]
[driver,device] Remove driver__default_dispatch function
driver__dispatch_() will handle the STATUS_NOT_SUPPORTED case.
Shao Miller [Mon, 13 Dec 2010 16:35:09 +0000 (11:35 -0500)]
[project] Don't use mini IRP handling for IRP_MJ_SCSI
Use device::irp_mj.scsi(), instead.
Shao Miller [Mon, 13 Dec 2010 06:49:03 +0000 (01:49 -0500)]
[project] Don't use mini IRP handling for IRP_MJ_DEVICE_CONTROL
Use device::irp_mj.dev_ctl(), instead.
Shao Miller [Mon, 13 Dec 2010 05:43:06 +0000 (00:43 -0500)]
[project] Don't use mini IRP handling for IRP_MJ_SYSTEM_CONTROL
Use device::irp_mj.sys_ctl(), instead.
Shao Miller [Mon, 13 Dec 2010 05:26:17 +0000 (00:26 -0500)]
[project] Don't use mini IRP handling for IRP_MJ_CREATE/CLOSE
There weren't really special implementations for bus and disk.
Shao Miller [Mon, 13 Dec 2010 05:13:41 +0000 (00:13 -0500)]
[project] Don't use mini IRP handling for IRP_MJ_POWER
Instead of using the mini IRP handling logic, we will
handle IRP_MJ_POWER differently. This might be a trend...
Also introduced are:
driver__complete_irp() for common IRP completion logic.
device__dispatch_func typedef for IRP dispatch routines.
device::irp_mj is an pointer to an IRP handling table based
on major function code.
Shao Miller [Mon, 13 Dec 2010 02:50:51 +0000 (21:50 -0500)]
[bus] Minor cosmetic changes
Shao Miller [Mon, 13 Dec 2010 02:46:49 +0000 (21:46 -0500)]
[bus/pnp] Rename Bus_IoCompletionRoutine to bus_pnp__io_completion_
Shao Miller [Mon, 13 Dec 2010 02:42:41 +0000 (21:42 -0500)]
[bus] Rename power function to bus__power_
Shao Miller [Mon, 13 Dec 2010 01:40:25 +0000 (20:40 -0500)]
[aoe] Introduce AoE bus module
Currently not functional. It seems that we need a major
IRP handling revisit. *sigh*
Shao Miller [Mon, 13 Dec 2010 01:38:58 +0000 (20:38 -0500)]
[bus] Handle PnP ID queries
Shao Miller [Sun, 12 Dec 2010 03:18:06 +0000 (22:18 -0500)]
[disk,device] Move disk__type::DiskNumber to device__type::dev_num
We can number all devices on a bus, rather than just disks.
Shao Miller [Sun, 12 Dec 2010 02:43:37 +0000 (21:43 -0500)]
[bus/dev_ctl] Minor cosmetic changes
Shao Miller [Sun, 12 Dec 2010 02:23:15 +0000 (21:23 -0500)]
[aoe] Even more cosmetic changes
And that won't be the end of it.
Shao Miller [Sun, 12 Dec 2010 01:48:54 +0000 (20:48 -0500)]
[bus] Rename bus__type::first_child_ptr to first_child
Shao Miller [Sun, 12 Dec 2010 01:40:57 +0000 (20:40 -0500)]
[aoe] More cosmetic changes
Shao Miller [Sat, 11 Dec 2010 21:55:34 +0000 (16:55 -0500)]
[disk,device] Move PnP ID query handling into device module
We should really allow for PnP ID query handling beyond just
for disks, so we now handle such queries as a device operation.
Shao Miller [Sat, 11 Dec 2010 20:20:50 +0000 (15:20 -0500)]
[device] Rename make_dev_pdo to device__make_pdo_
Shao Miller [Sat, 11 Dec 2010 20:19:29 +0000 (15:19 -0500)]
[device] Rename free_dev to device__free_dev_
Shao Miller [Sat, 11 Dec 2010 20:17:49 +0000 (15:17 -0500)]
[device] Remove device__init module startup function
There's not really a need to track all devices in a linked
list. So now the module is purely library.
Shao Miller [Sat, 11 Dec 2010 20:05:07 +0000 (15:05 -0500)]
[device] Minor cosmetic changes.
Shao Miller [Sat, 11 Dec 2010 19:43:43 +0000 (14:43 -0500)]
[device] Don't use device__close_decl macro
Use a typedef, instead.
Shao Miller [Sat, 11 Dec 2010 19:32:42 +0000 (14:32 -0500)]
[device] Don't use winvblock__def_struct for device__type
Shao Miller [Sat, 11 Dec 2010 19:10:53 +0000 (14:10 -0500)]
[device,driver,protocol] Remove portable.h #include from header
For consistency with many other headers.
Shao Miller [Sat, 11 Dec 2010 19:08:12 +0000 (14:08 -0500)]
[device] Don't use winvblock__def_enum for device__state
And rename its values.
Shao Miller [Sat, 11 Dec 2010 17:50:34 +0000 (12:50 -0500)]
[bus,driver] Move attach_fdo into driver module
attach_fdo is really a _driver_ thing, rather than a
_bus_ thing, so we move it into the driver module as
driver__attach_fdo_().
This allows us to remove bus module initialization,
meaning the bus module should be purely library now.
Our driver's AddDevice routine (driver__attach_fdo_) is
hard-coded to only attach a maximum of one FDO, which
will be the main WinVBlock bus. This could change later.
Shao Miller [Sat, 11 Dec 2010 02:56:22 +0000 (21:56 -0500)]
[bus] Rename sys_ctl to bus__sys_ctl_
Shao Miller [Thu, 9 Dec 2010 21:58:40 +0000 (16:58 -0500)]
[bus] Make callers of bus__add_child responsible...
...for freeing their device if bus__add_child() fails.
This is better than bus__add_child() freeing it, for the sake
of consistency in the code. I accidentally re-freed not
once, but twice, while trying some things out.
Shao Miller [Thu, 9 Dec 2010 21:26:39 +0000 (16:26 -0500)]
[wv_stdlib] Use appropriate pool tags
For AoE:
"WinAoE" with tag 'EoAW'.
For WinVBlock:
"WinVBlock" with tag 'klBV'.
Shao Miller [Thu, 9 Dec 2010 20:56:47 +0000 (15:56 -0500)]
[bus,bus/pnp,disk/pnp] Don't use LowerDeviceObject if NULL
A bus might not be an FDO on top of some other PDO, so we should
only call a bus' "LowerDeviceObject" if it exists.
Shao Miller [Thu, 9 Dec 2010 16:58:09 +0000 (11:58 -0500)]
[bus] Add do-nothing bus__init_ function
In order to have a sub-bus as a node on a bus, we need to
implement a device__type::init function, since bus__add_child()
will call it on a child device.
Shao Miller [Thu, 9 Dec 2010 16:43:11 +0000 (11:43 -0500)]
[device] Remove device__init_decl macro
Use device__init_func typedef, instead.
Shao Miller [Thu, 9 Dec 2010 06:53:44 +0000 (01:53 -0500)]
[driver,bus] Move the "boot bus" into the driver module
It's now called driver__bus_fdo_ and is accessible via
driver__bus(). This involved some code shuffling.
Additionally, bus__create_pdo_() has been modified to
actually produce a vanilla bus PDO without hard-coding
the "boot bus" logic into it.
We also adjust bus__module_init() to move the "boot bus"
code out.
This effort is towards modules/drivers creating their
own bus.
Shao Miller [Thu, 9 Dec 2010 04:48:23 +0000 (23:48 -0500)]
[device] Use typedef for device__create_pdo_func
Instead of the device__create_pdo_decl() macro and
device__create_pdo_routine function pointer typedef.
Shao Miller [Wed, 8 Dec 2010 21:42:06 +0000 (16:42 -0500)]
[driver] Rename driver_dispatch to driver__dispatch_
Shao Miller [Wed, 8 Dec 2010 21:41:06 +0000 (16:41 -0500)]
[driver] Rename driver_dispatch_not_supported to driver__dispatch_not_supported_
Shao Miller [Wed, 8 Dec 2010 21:17:44 +0000 (16:17 -0500)]
[driver] Rename os_load_opts to driver__os_load_opts_
Shao Miller [Wed, 8 Dec 2010 21:13:15 +0000 (16:13 -0500)]
[driver] Rename Driver_Globals_Started to driver__started_
Shao Miller [Wed, 8 Dec 2010 21:12:16 +0000 (16:12 -0500)]
[driver] Rename Driver_Globals_StateHandle to driver__state_handle_
Shao Miller [Wed, 8 Dec 2010 21:11:01 +0000 (16:11 -0500)]
[driver] Rename Driver_Unload to driver__unload_
Shao Miller [Wed, 8 Dec 2010 21:06:44 +0000 (16:06 -0500)]
[device] Correct the return type for device__set
Shao Miller [Wed, 8 Dec 2010 21:04:23 +0000 (16:04 -0500)]
[driver] Minor style/cosmetic changes
Undoing all of the hard work that indent.sh did. *sigh*
Shao Miller [Wed, 8 Dec 2010 19:44:50 +0000 (14:44 -0500)]
[bus] Track boot__module_up_ as TRUE a bit earlier
We obviously have to track 'bus__module_up_' as 'TRUE'
_before_ the call to bus__create(). Oops.
Shao Miller [Wed, 8 Dec 2010 18:44:26 +0000 (13:44 -0500)]
[bus] Require module initialization for bus__create
Just like the previous commit regarding bus__add_child().
Shao Miller [Wed, 8 Dec 2010 18:23:06 +0000 (13:23 -0500)]
[bus] Track if the bus module has been initialized
Since bus__add_child() is a library function, we don't really
want a caller using it unless the WinVBlock driver is
actually running. We now track module initialization status.
Shao Miller [Wed, 8 Dec 2010 18:10:12 +0000 (13:10 -0500)]
[bus] Rename bus__finalize to bus__module_shutdown
Shao Miller [Wed, 8 Dec 2010 17:52:43 +0000 (12:52 -0500)]
[bus] Rename bus__init to bus__module_init
Because 'bus__init' seems more like something you'd
do to a particular bus instance.
Shao Miller [Wed, 8 Dec 2010 17:43:44 +0000 (12:43 -0500)]
[bus] Rename Bus_GetDeviceCapabilities to bus__get_dev_capabilities
Shao Miller [Wed, 8 Dec 2010 17:38:46 +0000 (12:38 -0500)]
[bus] Don't use winvblock__def_struct for bus__type
Shao Miller [Wed, 8 Dec 2010 17:17:59 +0000 (12:17 -0500)]
[bus] Rename create_pdo to bus__create_pdo_
Shao Miller [Wed, 8 Dec 2010 17:15:56 +0000 (12:15 -0500)]
[bus] Rename free_bus to bus__free_
Shao Miller [Wed, 8 Dec 2010 17:15:07 +0000 (12:15 -0500)]
[bus] Rename bus_list to bus__list_
Shao Miller [Wed, 8 Dec 2010 17:14:23 +0000 (12:14 -0500)]
[bus] Rename bus_list_lock to bus__list_lock_
Shao Miller [Wed, 8 Dec 2010 17:13:22 +0000 (12:13 -0500)]
[bus] Rename boot_bus_fdo to bus__boot_fdo_
Shao Miller [Wed, 8 Dec 2010 16:02:23 +0000 (11:02 -0500)]
[bus] Minor style/cosmetic changes
Undoing all of the hard work that indent.sh did. *sigh*
Shao Miller [Wed, 8 Dec 2010 14:52:33 +0000 (09:52 -0500)]
[device] Introduce device__set function
Use this new device__set() to set a 'device' pointer for
a 'DEVICE_OBJECT'.
Shao Miller [Wed, 8 Dec 2010 14:29:46 +0000 (09:29 -0500)]
[bus] Rename bus__get_ptr to bus__get
And use a function instead of a macro.
Shao Miller [Wed, 8 Dec 2010 07:06:43 +0000 (02:06 -0500)]
[device] Introduce device__get function
Use this new device__get() to get a 'device' pointer from
a 'PDEVICE_OBJECT' instead of the old casting. We still
need to change the casting used when _setting_ it, though.
Shao Miller [Wed, 8 Dec 2010 06:15:36 +0000 (01:15 -0500)]
[aoe] Rename get_aoe_disk_ptr to aoe__get_
Shao Miller [Wed, 8 Dec 2010 05:46:38 +0000 (00:46 -0500)]
[aoe] Rename aoe_disk_list to aoe__disk_list_
Shao Miller [Wed, 8 Dec 2010 05:45:55 +0000 (00:45 -0500)]
[aoe] Rename aoe_disk_list_lock to aoe__disk_list_lock_
Shao Miller [Wed, 8 Dec 2010 05:44:44 +0000 (00:44 -0500)]
[aoe] Rename AoE_Globals_Started to aoe__started_
Shao Miller [Wed, 8 Dec 2010 05:43:41 +0000 (00:43 -0500)]
[aoe] Rename AoE_Globals_ThreadHandle to aoe__thread_handle_
Shao Miller [Wed, 8 Dec 2010 05:42:47 +0000 (00:42 -0500)]
[aoe] Rename AoE_Globals_OutstandingTags to aoe__outstanding_tags_
Shao Miller [Wed, 8 Dec 2010 05:41:56 +0000 (00:41 -0500)]
[aoe] Rename AoE_Globals_DiskSearchList to aoe__disk_search_list_
Shao Miller [Wed, 8 Dec 2010 05:40:56 +0000 (00:40 -0500)]
[aoe] Rename AoE_Globals_ProbeTag to aoe__probe_tag_
Shao Miller [Wed, 8 Dec 2010 05:40:01 +0000 (00:40 -0500)]
[aoe] Rename AoE_Globals_TagList to aoe__tag_list_
Shao Miller [Wed, 8 Dec 2010 05:39:00 +0000 (00:39 -0500)]
[aoe] Rename AoE_Globals_TagListLast to aoe__tag_list_last_
Shao Miller [Wed, 8 Dec 2010 02:49:08 +0000 (21:49 -0500)]
[aoe] Rename AoE_Globals_ThreadSignalEvent to aoe__thread_sig_evt_
Shao Miller [Wed, 8 Dec 2010 02:47:31 +0000 (21:47 -0500)]
[aoe] Rename AoE_Globals_SpinLock to aoe__spinlock_
Shao Miller [Wed, 8 Dec 2010 02:46:23 +0000 (21:46 -0500)]
[aoe] Rename AoE_Globals_Stop to aoe__stop_
Shao Miller [Wed, 8 Dec 2010 02:45:10 +0000 (21:45 -0500)]
[aoe] Rename AoE_Globals_TargetList to aoe__target_list_
Shao Miller [Wed, 8 Dec 2010 02:43:12 +0000 (21:43 -0500)]
[aoe] Rename AoE_Globals_TargetListSpinLock to aoe__target_list_spinlock_