Commit Graph

27 Commits

Author SHA1 Message Date
Haiyang Zhang f916a34dc0 Staging: hv: Rename struct device_context and re-arrange the fields inside
Rename struct device_context and re-arrange the fields inside.

Rename struct device_context to struct vm_device, and move struct device
field to the end according to Document/driver-model standard.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:37 -08:00
Hank Janssen 26c14cc119 Staging: hv: Add proper versioning to HV drivers
Provide proper versioning information for all HV drivers.

With removal of build time/date/and Minor number as requested by Greg KH

Signed-off-by: Hank Janssen    <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang   <haiyang@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:37 -08:00
Greg Kroah-Hartman 354b0a643e Staging: hv: remove unneeded OnHostReset callback
This callback only calls one function, so just call the function
instead, no need for indirection at all.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:36 -08:00
Greg Kroah-Hartman 99358ca725 Staging: hv: storvsc_drv: move unused functions
Now that the callback pointer was removed, we can remove
the code itself, as it is never used.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:36 -08:00
Greg Kroah-Hartman 65e65a3e73 Staging: hv: remove unneeded OnHostRescan callback
This callback was never called, so delete the thing.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:36 -08:00
Greg Kroah-Hartman 21707bed7e Staging: hv: remove function pointer typedefs from vmbus.h
It's amazing the hoops that people go through to make code work
when they don't opensource the whole thing.  Passing these types
of function pointers around for no good reason is a mess, this needs
to be unwound as everything is now in the open.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:03 -07:00
Greg Kroah-Hartman ff568d3a1a Staging: hv: coding style cleanup for storvsc_drv.c
Where's the hazard pay for cleaning up this mess...

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:03 -07:00
Greg Kroah-Hartman 731a7884f6 Staging: hv: move StorVscApi.h
Move it out of the include subdirectory.

No code changes here, just file movements.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:00 -07:00
Greg Kroah-Hartman 645954c542 Staging: hv: move logging.h
Move it out of the include subdirectory.

No code changes here, just file movements.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:00 -07:00
Greg Kroah-Hartman 9f0c7d2cc3 Staging: hv: fix typedefs in StorVscApi.h
It's all clean now.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:02:00 -07:00
Greg Kroah-Hartman 870cde8086 Staging: hv: move vmbus.h
This moves vmbus.h from the include/ subdirectory.  It doesn't
belong there.

No code changes happened here.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:57 -07:00
Greg Kroah-Hartman caf26a31b5 Staging: hv: osd.h: remove GUID typedef
GUID should not be a typedef.  As proof of the problem of typedefs,
look, we are passing 2 of these as a value in functions!  Bah...

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:56 -07:00
Greg Kroah-Hartman 4983b39a06 Staging: hv: move osd.h
This moves osd.h out of the include/ subdirectory.

No code changes are made here.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:56 -07:00
Greg Kroah-Hartman bd1de70916 Staging: hv: fix sparse static warnings
This fixes up all of the sparse warnings about static functions.

Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:52 -07:00
Nicolas Palix 0b3f683488 Staging: hv: Remove typedef STORVSC_REQUEST and PSTORVSC_REQUEST
typedef STORVSC_REQUEST and PSTORVSC_REQUEST are removed and their
usages are replace by the use of struct hv_storvsc_request and
struct hv_storvsc_request * respectively.

Here is the semantic patch generated to perform this transformation:
(http://coccinelle.lip6.fr/)

//<smpl>
@rm_STORVSC_REQUEST@
@@
-typedef struct _STORVSC_REQUEST
+struct hv_storvsc_request
{...}
-STORVSC_REQUEST
;

@rm_PSTORVSC_REQUEST@
@@
-typedef struct _STORVSC_REQUEST *PSTORVSC_REQUEST;
+struct hv_storvsc_request;

@fixtypedef_STORVSC_REQUEST@
typedef STORVSC_REQUEST;
@@
-STORVSC_REQUEST
+struct hv_storvsc_request

@fixstruct__STORVSC_REQUEST@
@@
struct
-_STORVSC_REQUEST
+hv_storvsc_request

@fixtypedef_PSTORVSC_REQUEST@
typedef PSTORVSC_REQUEST;
@@
-PSTORVSC_REQUEST
+struct hv_storvsc_request*
//</smpl>

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:52 -07:00
Bill Pemberton 2295ba2e7c Staging: hv: check return value of driver_for_each_device()
The return value of driver_for_each_device() is now checked.  A
non-zero value simply generates a warning message, but it's better
than not checking at all.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:52 -07:00
Nicolas Palix 3d3b5518a3 Staging: hv: Transform PDEVICE_OBJECT and DEVICE_OBJECT typedefs into their corresponding structs
Remove typedef DEVICE_OBJECT and use a struct named hv_device instead.
Remove typedef PDEVICE_OBJECT which aliases a pointer and use
struct hv_device * instead.

Here is the semantic patch to perform this transformation:
(http://coccinelle.lip6.fr/)

//<smpl>
@rm_PDEVICE_OBJECT@
@@
-typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;

@rm_DEVICE_OBJECT@
@@
-typedef struct _DEVICE_OBJECT
+struct hv_device
{...}
-DEVICE_OBJECT
;

@fixtypedef_PDEVICE_OBJECT@
typedef PDEVICE_OBJECT;
@@
-PDEVICE_OBJECT
+struct hv_device*

@fixtypedef_DEVICE_OBJECT@
typedef DEVICE_OBJECT;
@@
-DEVICE_OBJECT
+struct hv_device

@fixstruct__DEVICE_OBJECT@
@@
struct
-_DEVICE_OBJECT
+hv_device
//</smpl>

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:51 -07:00
Bill Pemberton 5d48a1c202 Staging: hv: check return value of device_register()
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:51 -07:00
Bill Pemberton 7f6f27d65c Staging: hv: storvsc_drv.c: fix print formatting
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:50 -07:00
Bill Pemberton 454f18a963 Staging: hv: Remove C99 comments
Remove C99 // comments with traditional /* */ comments

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:50 -07:00
Nicolas Palix 06da0bc865 Staging: hv: Transform some kzalloc calls to kcalloc
Here is a short excerpt of the semantic patch performing
this transformation:
(http://www.emn.fr/x-info/coccinelle/)

//<smpl>
@@
expression E1,E2,E3;
@@
- kzalloc(E1*sizeof(E2),E3)
+ kcalloc(E1,sizeof(E2),E3)

@@
expression E1,E3;
type T;
@@
- kzalloc(E1*sizeof(T),E3)
+ kcalloc(E1,sizeof(T),E3)
//</smpl>

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:49 -07:00
Moritz Muehlenhoff c18b5aed9d Staging: hv: Remove compatibility ifdefry
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:49 -07:00
Greg Kroah-Hartman 2701f686d7 Staging: hv: fix up printk warnings
After LogMsg was converted to printk, lots of build warnings showed up
as no one was checking the arguments to LogMsg.  This patch fixes them
all.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:49 -07:00
Greg Kroah-Hartman fc6a4b2609 Staging: hv: remove MIN and MAX usages
The kernel has the "correct" min() and max() functions, so use those.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:47 -07:00
Greg Kroah-Hartman 0883c52bb2 Staging: hv: storvsc: fix up driver_data usage
driver_data is gone now from struct device, so use the proper functions
to access it instead.

Thanks to Bill Pemberton for pointing out this build error.

Cc: Bill Pemberton <wfp5p@viridian.itc.Virginia.EDU>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:45 -07:00
Greg Kroah-Hartman 97f4ee3d93 Staging: hv: make the Hyper-V virtual storage driver build
The #define KERNEL_2_6_27 needs to be set, and I adjusted the include
directories a bit to get things to build properly.

I also fixed up the direct access of bus_id, as that field is now gone.
Some minor scsi api changes were needed as well.

The hv_storvsc code should now build properly, with no errors.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:44 -07:00
Hank Janssen bef4a34a28 Staging: hv: add the Hyper-V virtual storage driver
This is the virtual storage driver when running Linux on top of Hyper-V.

Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15 12:01:43 -07:00