aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ozwpan
diff options
context:
space:
mode:
authorChris Kelly <ckelly@ozmodevices.com>2012-02-20 16:11:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 12:26:50 -0500
commit62450bca861f206b09b44492b829b419222c4968 (patch)
tree8f3d8c442cbd39f1d04c0d60ad5c8c827bbdfd1b /drivers/staging/ozwpan
parent3e809144efc37f950606c827f992b653286f5533 (diff)
staging: ozwpan: Added driver entry code
This series of patches adds the Ozmo USB over WiFi driver to the driver staging directory. This is a driver for a virtual USB HCD and uses an L2 network protocol to talk to the device. This patch adds the driver entry code and a README file with more details. Signed-off-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan')
-rw-r--r--drivers/staging/ozwpan/README25
-rw-r--r--drivers/staging/ozwpan/ozconfig.h28
-rw-r--r--drivers/staging/ozwpan/ozmain.c60
3 files changed, 113 insertions, 0 deletions
diff --git a/drivers/staging/ozwpan/README b/drivers/staging/ozwpan/README
new file mode 100644
index 00000000000..bb1a69b9454
--- /dev/null
+++ b/drivers/staging/ozwpan/README
@@ -0,0 +1,25 @@
1OZWPAN USB Host Controller Driver
2---------------------------------
3This driver is a USB HCD driver that does not have an associated a physical
4device but instead uses Wi-Fi to communicate with the wireless peripheral.
5The USB requests are converted into a layer 2 network protocol and transmitted
6on the network using an ethertype (0x892e) regestered to Ozmo Device Inc.
7This driver is compatible with existing wireless devices that use Ozmo Devices
8technology.
9
10To operate the driver must be bound to a suitable network interface. This can
11be done when the module is loaded (specifying the name of the network interface
12as a paramter - e.g. 'insmod ozwpan g_net_dev=go0') or can be bound after
13loading using an ioctl call. See the ozappif.h file and the ioctls
14OZ_IOCTL_ADD_BINDING and OZ_IOCTL_REMOVE_BINDING.
15
16The devices connect to the host use Wi-Fi Direct so a network card that supports
17Wi-Fi direct is required. A recent version (0.8.x or later) version of the
18wpa_supplicant can be used to setup the network interface to create a persistent
19autonomous group (for older pre-WFD peripherals) or put in a listen state to
20allow group negotiation to occur for more recent devices that support WFD.
21
22The protocol used over the network does not directly mimic the USB bus
23transactions as this would be rather busy and inefficient. Instead the chapter 9
24requests are converted into a request/response pair of messages. (See
25ozprotocol.h for data structures used in the protocol).
diff --git a/drivers/staging/ozwpan/ozconfig.h b/drivers/staging/ozwpan/ozconfig.h
new file mode 100644
index 00000000000..a8c97265c5f
--- /dev/null
+++ b/drivers/staging/ozwpan/ozconfig.h
@@ -0,0 +1,28 @@
1/* -----------------------------------------------------------------------------
2 * Copyright (c) 2011 Ozmo Inc
3 * Released under the GNU General Public License Version 2 (GPLv2).
4 * ---------------------------------------------------------------------------*/
5#ifndef _OZCONFIG_H
6#define _OZCONFIG_H
7
8/* #define WANT_DEBUG_KMALLOC */
9/* #define WANT_TRACE */
10#ifdef WANT_TRACE
11#define WANT_VERBOSE_TRACE
12#endif /* #ifdef WANT_TRACE */
13/* #define WANT_URB_PARANOIA */
14
15/* #define WANT_PRE_2_6_39 */
16#define WANT_EVENT_TRACE
17
18/* These defines determine what verbose trace is displayed. */
19#ifdef WANT_VERBOSE_TRACE
20/* #define WANT_TRACE_STREAM */
21/* #define WANT_TRACE_URB */
22/* #define WANT_TRACE_CTRL_DETAIL */
23#define WANT_TRACE_HUB
24/* #define WANT_TRACE_RX_FRAMES */
25/* #define WANT_TRACE_TX_FRAMES */
26#endif /* WANT_VERBOSE_TRACE */
27
28#endif /* _OZCONFIG_H */
diff --git a/drivers/staging/ozwpan/ozmain.c b/drivers/staging/ozwpan/ozmain.c
new file mode 100644
index 00000000000..d34242b6e9e
--- /dev/null
+++ b/drivers/staging/ozwpan/ozmain.c
@@ -0,0 +1,60 @@
1/* -----------------------------------------------------------------------------
2 * Copyright (c) 2011 Ozmo Inc
3 * Released under the GNU General Public License Version 2 (GPLv2).
4 * -----------------------------------------------------------------------------
5 */
6#include <linux/init.h>
7#include <linux/module.h>
8#include <linux/timer.h>
9#include <linux/sched.h>
10#include <linux/netdevice.h>
11#include <linux/errno.h>
12#include <linux/ieee80211.h>
13#include "ozconfig.h"
14#include "ozpd.h"
15#include "ozproto.h"
16#include "ozcdev.h"
17#include "ozalloc.h"
18#include "oztrace.h"
19#include "ozevent.h"
20/*------------------------------------------------------------------------------
21 * The name of the 802.11 mac device. Empty string is the default value but a
22 * value can be supplied as a parameter to the module. An empty string means
23 * bind to nothing. '*' means bind to all netcards - this includes non-802.11
24 * netcards. Bindings can be added later using an IOCTL.
25 */
26char *g_net_dev = "";
27/*------------------------------------------------------------------------------
28 * Context: process
29 */
30static int __init ozwpan_init(void)
31{
32 oz_event_init();
33 oz_cdev_register();
34 oz_protocol_init(g_net_dev);
35 oz_app_enable(OZ_APPID_USB, 1);
36 oz_apps_init();
37 return 0;
38}
39/*------------------------------------------------------------------------------
40 * Context: process
41 */
42static void __exit ozwpan_exit(void)
43{
44 oz_protocol_term();
45 oz_apps_term();
46 oz_cdev_deregister();
47 oz_trace_leaks();
48 oz_event_term();
49}
50/*------------------------------------------------------------------------------
51 */
52module_param(g_net_dev, charp, S_IRUGO);
53module_init(ozwpan_init);
54module_exit(ozwpan_exit);
55
56MODULE_AUTHOR("Chris Kelly");
57MODULE_DESCRIPTION("Ozmo Devices USB over WiFi hcd driver");
58MODULE_VERSION("1.0.8");
59MODULE_LICENSE("GPL");
60