2 *****************************************************************************
4 * FILE : unifi_clients.h
6 * PURPOSE : Private header file for unifi clients.
8 * UDI = UniFi Debug Interface
10 * Copyright (C) 2005-2008 by Cambridge Silicon Radio Ltd.
12 * Refer to LICENSE.txt included with this source code for details on
15 *****************************************************************************
17 #ifndef __LINUX_UNIFI_CLIENTS_H__
18 #define __LINUX_UNIFI_CLIENTS_H__ 1
20 #include <linux/kernel.h>
22 #define MAX_UDI_CLIENTS 8
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
29 /* Structure to hold a UDI logged signal */
32 /* List link structure */
35 /* The message that will be passed to the user app */
38 /* Signal body and data follow */
44 typedef struct ul_client ul_client_t
;
46 typedef void (*udi_event_t
)(ul_client_t
*client
,
47 const u8
*sigdata
, int signal_len
,
48 const bulk_data_param_t
*bulkdata
,
51 void logging_handler(void *ospriv
,
52 u8
*sigdata
, u32 signal_len
,
53 const bulk_data_param_t
*bulkdata
,
54 enum udi_log_direction direction
);
58 * Structure describing a bulk data slot.
59 * The length field is used to indicate empty/occupied state.
61 typedef struct _bulk_data
63 unsigned char ptr
[2000];
69 /* Index of this client in the ul_clients array. */
72 /* Index of UniFi device to which this client is attached. */
75 /* Flag to say whether this client has been enabled. */
78 /* Value to use in signal->SenderProcessId */
81 /* Configuration flags, e.g blocking, logging, etc. */
82 unsigned int configuration
;
84 udi_event_t event_hook
;
86 /* A list to hold signals received from UniFi for reading by read() */
87 struct list_head udi_log
;
89 /* Semaphore to protect the udi_log list */
90 struct semaphore udi_sem
;
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.
97 wait_queue_head_t udi_wq
;
98 CSR_SIGNAL
* reply_signal
;
99 bulk_data_t
* reply_bulkdata
[UNIFI_MAX_DATA_REFERENCES
];
101 u16 signal_filter
[SIG_FILTER_SIZE
];
104 /* ------------------------------------------------------------------- */
105 /* Code below here is used by the sme_native configuration only */
107 /* Flag to wake up blocking clients waiting on udi_wq. */
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.
116 unsigned char seq_no
;
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.
123 unsigned char wake_seq_no
;
125 unifiio_snap_filter_t snap_filter
;
126 }; /* struct ul_client */
129 #endif /* __LINUX_UNIFI_CLIENTS_H__ */