Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
[pandora-kernel.git] / drivers / staging / brcm80211 / include / hndrte_cons.h
1 /*
2  * Copyright (c) 2010 Broadcom Corporation
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16
17 #define CBUF_LEN        (128)
18
19 #define LOG_BUF_LEN     1024
20
21 typedef struct {
22         u32 buf;                /* Can't be pointer on (64-bit) hosts */
23         uint buf_size;
24         uint idx;
25         char *_buf_compat;      /* Redundant pointer for backward compat. */
26 } hndrte_log_t;
27
28 typedef struct {
29         /* Virtual UART
30          * When there is no UART (e.g. Quickturn),
31          * the host should write a complete
32          * input line directly into cbuf and then write
33          * the length into vcons_in.
34          * This may also be used when there is a real UART
35          * (at risk of conflicting with
36          * the real UART).  vcons_out is currently unused.
37          */
38         volatile uint vcons_in;
39         volatile uint vcons_out;
40
41         /* Output (logging) buffer
42          * Console output is written to a ring buffer log_buf at index log_idx.
43          * The host may read the output when it sees log_idx advance.
44          * Output will be lost if the output wraps around faster than the host
45          * polls.
46          */
47         hndrte_log_t log;
48
49         /* Console input line buffer
50          * Characters are read one at a time into cbuf
51          * until <CR> is received, then
52          * the buffer is processed as a command line.
53          * Also used for virtual UART.
54          */
55         uint cbuf_idx;
56         char cbuf[CBUF_LEN];
57 } hndrte_cons_t;