Archived
14
0
Fork 0
Commit graph

253291 commits

Author SHA1 Message Date
matt mooney
0a186be359 staging: usbip: stub_main.c: simplify busid_table initialization
Set the whole structure to zero instead of individually setting each
member, which simplifies the for loop.

This was suggested by walter harms <wharms@bfs.de>.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:29:16 -07:00
matt mooney
1109566469 staging: usbip: userspace: usbip_list.c: cleanup exported device functions
Rename functions and cleanup coding style.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:19 -07:00
matt mooney
35dd0c2da6 staging: usbip: userspace: rename usbip device and interface
Add prefix of usbip_ to internal usb device and interface to avoid
confusion with the kernel types. This also identifies the types as
being part of the usbip library.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:18 -07:00
matt mooney
74ce259c67 staging: usbip: userspace: usbip_list.c: refactor local USB device listing
Combines the different list display types for local devices into one
function. Removes dependence on utils.h, which only exists as a way to
circumvent libsysfs and will be removed. The devices are now sorted as
an added benefit of this refactor.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:17 -07:00
matt mooney
3e4fda9f95 staging: usbip: change the busid size
Change busid size to correspond with SYSFS_BUS_ID_SIZE, which was
already being used in most cases. This eliminates the need to define
BUS_ID_SIZE in the userspace code.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:17 -07:00
matt mooney
4cbab52d18 staging: usbip: userspace: move header includes out utils.h
The includes have been moved out of utils.h to their respective source
files where they are suppose to be. An include guard is also added to
utils.h

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:17 -07:00
matt mooney
950a4cd8fc staging: usbip: userspace: use memset instead of bzero
bzero is and has been deprecated since POSIX.1-2001.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:26:16 -07:00
Márton Németh
a6d81814a5 usbip: remove extra whitespace
Only one whitespace is enough after "return".

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:08:52 -07:00
Greg Kroah-Hartman
acf51ab8ce Staging: usbip: vhci.h: remove FSF address
Remove the FSF address from the comment header.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:08:52 -07:00
Greg Kroah-Hartman
69c685c7f5 staging: usbip: README: we need to document the protocol
Document the protocol.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 14:08:51 -07:00
matt mooney
1e35d87d63 staging: usbip: userspace: usbip_network: rename and cleanup function
Rename tcp_connection to usbip_net_tcp_connection, which alludes to a
usbip network library that will eventually follow. The implementation
of this function has also been cleaned up.

Headers had to be adjusted due to the elimination of the old usbip.h.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:13 -07:00
matt mooney
d2c15e2580 staging: usbip: userspace: usbipd.c: add header into source file
The old usbip.h header that was only used to masked what each source
file needed has been changed. So some headers this file needed had to
be added.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:12 -07:00
matt mooney
e9837bbb3e staging: usbip: userspace tools v1.0.0
The new and improved (well somewhat, with a ways to go) userspace utility.

    mfm:pts/8[~/tmp/userspace]
    May26 05:18:31 % ./src/usbip help
    usage: usbip [--debug] [version]
                 [help] <command> <args>

      attach     Attach a remote USB device
      detach     Detach a remote USB device
      list       List exported or local USB devices
      bind       Bind device to usbip-host.ko
      unbind     Unbind device from usbip-host.ko

This first commit of the userspace `usbip' utility uses to same
implementation as the old tools, `usbip' and  `usbip_bind_driver'.
Nothing significant has changed so compatibility with windows has
_not_ been broken. However, the tools remain broken in many ways
due to the old implementation.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:12 -07:00
matt mooney
58058422f8 staging: usbip: userspace: vhci_driver: parameterize path names
Define a macro for the bus type and use libsysfs for class path.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:12 -07:00
matt mooney
7e485ee7f5 staging: usbip: userspace: change struct class_device to usbip_class_device
Rename class_device struct to avoid confusion and change member names.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:11 -07:00
matt mooney
5a285cf523 staging: usbip: userspace: set kernel module names in one place
Move kernel module name setting to usbip_common.h so that macros can
be used instead of hard coding the names in multiple places.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:56:11 -07:00
Márton Németh
988e752081 usbip: remove check for negative values for an unsigned value
The parameter rhport is unsigned so there is no need checking for
negative values.

This will remove the following warning message when compiling with "make W=1 ...":
  drivers/staging/usbip/vhci_sysfs.c: In function ‘valid_args’:
  drivers/staging/usbip/vhci_sysfs.c:138: warning: comparison of unsigned expression < 0 is always false

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:54:19 -07:00
Márton Németh
9ba422b346 usbip: simplify lock handling in valid_request()
The function calls spin_lock() and spin_unlock() should be in pair. This patch makes
this pairing more clear for the reader of the code.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:53:24 -07:00
matt mooney
0392bbb6f6 staging: usbip: vhci_hcd.c: rename init and exit functions
Change the prefix of the __init and __exit functions to vhci_hcd_ to
correspond with the modules name. And change the suffix of the __exit
function to exit instead of cleanup.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:26 -07:00
matt mooney
3028d0ae6c staging: usbip: usbip_common.c: rename init and exit functions
Change the prefix of the __init and __exit functions to usbip_core_ to
correspond with the modules name.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:26 -07:00
matt mooney
4b93bb37bb staging: usbip: userspace: bind_driver.c: update kernel module name
Change kernel module name to usbip-host.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:26 -07:00
matt mooney
d012c2a5ac staging: usbip: stub_dev.c: move stub_driver definition and update driver name
Move the stub_driver definition to the end of file and, therefore,
remove foward declarations. Update driver name to usbip-host.

A few comments were slightly edited too.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:25 -07:00
matt mooney
b7d27eadf8 staging: usbip: usbip_common.h: reorganize and document request headers
Document the request header structures; move #defines out of the
structures; organize function declarations by source file; and move
inline functions to the end of file.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:25 -07:00
matt mooney
2282e1fb6b staging: usbip: usbip_common.c: fix misspelled function name
Change pakcet to packet in usbip_iso_packet_correct_endian().

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:25 -07:00
matt mooney
7d4de89f19 staging: usbip: stub_main.c: use KMEM_CACHE macro
Change kmem_cache_create() to the KMEM_CACHE() macro.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:24 -07:00
matt mooney
27ed5da0b6 staging: usbip: stub_main.c: rename init and exit functions
Change the prefix of the __init and __exit functions to usbip_host_ to
correspond with the modules name.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:23 -07:00
matt mooney
41e02f0116 staging: usbip: stub_main.c: code cleanup
Remove match_find() and replace with get_busid_idx(); change
get_busid_priv(), add_match_busid(), and del_match_busid() to use
get_busid_idx(); and cleanup code in the other functions.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:23 -07:00
matt mooney
efad25e9a3 staging: usbip: stub_main.c: reorder functions
Reorder functions so sysfs_ops, show() and store(), are adjacent, and
init_busid_table() is at the beginning of the file.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:22 -07:00
matt mooney
8735276017 staging: usbip: remove unnecessary lines and extra return statements
Also, fix a few alignment issues that were originally missed.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:51:22 -07:00
K. Y. Srinivasan
00d760b057 Staging: hv: vmbus: Change Cleanup to cleanup in channel.c
Change the jump label Cleanup to cleanup.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:08 -07:00
K. Y. Srinivasan
926ae52621 Staging: hv: vmbus: Cleanup some error values in channel.c
Cleanup some error values in channel.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:07 -07:00
K. Y. Srinivasan
3a7546d934 Staging: hv: vmbus: Cleanup error codes in connection.c
Cleanup error codes in connection.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:06 -07:00
K. Y. Srinivasan
39594abcd4 Staging: hv: vmbus: Cleanup error codes in hv.c
Cleanup error codes in hv.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:06 -07:00
K. Y. Srinivasan
d6c1c5de4e Staging: hv: vmbus: Cleanup error handling in vmbus_bus_init()
Cleanup error handling in vmbus_bus_init().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:05 -07:00
K. Y. Srinivasan
6de925b189 Staging: hv: vmbus: Cleanup some error codes in vmbus_drv.c
Cleanup some error codes in vmbus_drv.c

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:04 -07:00
K. Y. Srinivasan
f38cf9ccd6 Staging: hv: vmbus: Properly handle memory allocation failure in channel.c
Properly handle memory allocation failure in channel.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:04 -07:00
K. Y. Srinivasan
40961de335 Staging: hv: vmbus: Increase the timeout for some critical calls
Increase the timeout for some critical calls. In testing we discovered that the
current timeout of 1 second was insufficient under some conditions.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:03 -07:00
K. Y. Srinivasan
e8e2704774 Staging: hv: vmbus: Rename local variables in vmbus_drv.c
Rename local variables in vmbus_drv.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:03 -07:00
K. Y. Srinivasan
e826f1d505 Staging: hv: vmbus: Fix a memory barrier call in vmbus_drv.c
Use the correct memory barrier call in vmbus_drv.c

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:02 -07:00
K. Y. Srinivasan
3740652d98 Staging: hv: vmbus: Get rid of a dated comment in channel_mgmt.c
Staging: hv: vmbus: Get rid of a dated comment in channel_mgmt.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:01 -07:00
K. Y. Srinivasan
c0e2490fd4 Staging: hv: vmbus: Get rid of an unused function in connection.c
Get rid of an unused function in connection.c

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:01 -07:00
K. Y. Srinivasan
db545da77b Staging: hv: vmbus: Get rid of a dated comment in vmbus_drv.c
Get rid of a dated comment in vmbus_drv.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:00 -07:00
K. Y. Srinivasan
e9a27a9f9e Staging: hv: vmbus: Use the newly introduced state in closing the channel
Now, use the newly introduced state in closing the channel and eliminate a
potential failure condition (that currently was not being handled correctly).

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:46:00 -07:00
K. Y. Srinivasan
f9f1db832b Staging: hv: vmbus: Embed the state needed to close the channel
Now, embed the state needed to close the channel - so we would not have to
allocate memory in the channel close path.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:59 -07:00
K. Y. Srinivasan
7d7c75cd47 Staging: hv: vmbus: Move the definition of struct vmbus_channel
In preparation for embedding the state needed to close the channel, move
the definition of struct vmbus_channel.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:59 -07:00
K. Y. Srinivasan
f27df643d0 Staging: hv: vmbus: Correct some dated comments in channel.c
Correct some dated comments in channel.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:58 -07:00
K. Y. Srinivasan
bed9ba7654 Staging: hv: vmbus: Get rid of some dated comments in channel.c
Get rid of some dated comments in channel.c.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:57 -07:00
K. Y. Srinivasan
30fbee49b0 Staging: hv: vmbus: Get rid of the unused function vmbus_ontimer()
Now, get rid of the unused function vmbus_ontimer().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:57 -07:00
K. Y. Srinivasan
e690b5a9be Staging: hv: vmbus: Change the memory barrier in hv_ringbuffer_write()
Use the correct memory barrier interface in Change the memory barrier
in hv_ringbuffer_write().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:56 -07:00
K. Y. Srinivasan
df2a4a7114 Staging: hv: vmbus: Introduce read dependency in hv_get_ringbuffer_availbytes()
Introduce read dependency in hv_get_ringbuffer_availbytes().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 13:45:55 -07:00