aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/csr/unifi_clients.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-19 19:15:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-19 19:37:01 -0400
commit635d2b00e5070378e7bf812acf47fb135c6ab928 (patch)
tree7048a0a511f3d221aa2dfe40aa3a401991f1b175 /drivers/staging/csr/unifi_clients.h
parent15a4bc17b7f4e85cb019e683f14e834078ec2208 (diff)
Staging: add CSR wifi module
This consists of two modules, the driver, and a "helper" module that is just a wrapper around common kernel functions. The wrapper module will be removed soon, but for now it's needed. These files were based on the csr-linux-wifi-5.0.3-oss.tar.gz package provided by CSR and Blue Giga, and is covered under the license specified in the LICENSE.txt file (basically dual BSD and GPLv2). The files were flattened out of the deep directory mess they were originally in, and a few EXPORT_SYMBOL_GPL() were added in order for everything to link properly with the helper module setup. Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/csr/unifi_clients.h')
-rw-r--r--drivers/staging/csr/unifi_clients.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/drivers/staging/csr/unifi_clients.h b/drivers/staging/csr/unifi_clients.h
new file mode 100644
index 00000000000..206b8cffd5b
--- /dev/null
+++ b/drivers/staging/csr/unifi_clients.h
@@ -0,0 +1,129 @@
1/*
2 *****************************************************************************
3 *
4 * FILE : unifi_clients.h
5 *
6 * PURPOSE : Private header file for unifi clients.
7 *
8 * UDI = UniFi Debug Interface
9 *
10 * Copyright (C) 2005-2008 by Cambridge Silicon Radio Ltd.
11 *
12 * Refer to LICENSE.txt included with this source code for details on
13 * the license terms.
14 *
15 *****************************************************************************
16 */
17#ifndef __LINUX_UNIFI_CLIENTS_H__
18#define __LINUX_UNIFI_CLIENTS_H__ 1
19
20#include <linux/kernel.h>
21
22#define MAX_UDI_CLIENTS 8
23
24/* The start of the range of process ids allocated for ul clients */
25#define UDI_SENDER_ID_BASE 0xC000
26#define UDI_SENDER_ID_SHIFT 8
27
28
29/* Structure to hold a UDI logged signal */
30typedef struct {
31
32 /* List link structure */
33 struct list_head q;
34
35 /* The message that will be passed to the user app */
36 udi_msg_t msg;
37
38 /* Signal body and data follow */
39
40} udi_log_t;
41
42
43
44typedef struct ul_client ul_client_t;
45
46typedef void (*udi_event_t)(ul_client_t *client,
47 const u8 *sigdata, int signal_len,
48 const bulk_data_param_t *bulkdata,
49 int dir);
50
51void logging_handler(void *ospriv,
52 CsrUint8 *sigdata, CsrUint32 signal_len,
53 const bulk_data_param_t *bulkdata,
54 enum udi_log_direction direction);
55
56
57/*
58 * Structure describing a bulk data slot.
59 * The length field is used to indicate empty/occupied state.
60 */
61typedef struct _bulk_data
62{
63 unsigned char ptr[2000];
64 unsigned int length;
65} bulk_data_t;
66
67
68struct ul_client {
69 /* Index of this client in the ul_clients array. */
70 int client_id;
71
72 /* Index of UniFi device to which this client is attached. */
73 int instance;
74
75 /* Flag to say whether this client has been enabled. */
76 int udi_enabled;
77
78 /* Value to use in signal->SenderProcessId */
79 int sender_id;
80
81 /* Configuration flags, e.g blocking, logging, etc. */
82 unsigned int configuration;
83
84 udi_event_t event_hook;
85
86 /* A list to hold signals received from UniFi for reading by read() */
87 struct list_head udi_log;
88
89 /* Semaphore to protect the udi_log list */
90 struct semaphore udi_sem;
91
92 /*
93 * Linux waitqueue to support blocking read and poll.
94 * Logging clients should wait on udi_log. while
95 * blocking clients should wait on wake_up_wq.
96 */
97 wait_queue_head_t udi_wq;
98 CSR_SIGNAL* reply_signal;
99 bulk_data_t* reply_bulkdata[UNIFI_MAX_DATA_REFERENCES];
100
101 CsrUint16 signal_filter[SIG_FILTER_SIZE];
102
103
104 /* ------------------------------------------------------------------- */
105 /* Code below here is used by the sme_native configuration only */
106
107 /* Flag to wake up blocking clients waiting on udi_wq. */
108 int wake_up_wq_id;
109
110 /*
111 * A 0x00 - 0x0F mask to apply in signal->SenderProcessId.
112 * Every time we do a blocking mlme request we increase this value.
113 * The mlme_wait_for_reply() will wait for this sequence number.
114 * Only the MLME blocking functions update this field.
115 */
116 unsigned char seq_no;
117
118 /*
119 * A 0x00 - 0x0F counter, containing the sequence number of
120 * the signal that this client has last received.
121 * Only the MLME blocking functions update this field.
122 */
123 unsigned char wake_seq_no;
124
125 unifiio_snap_filter_t snap_filter;
126}; /* struct ul_client */
127
128
129#endif /* __LINUX_UNIFI_CLIENTS_H__ */