Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind...
[pandora-kernel.git] / drivers / staging / brcm80211 / brcmfmac / 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 #ifndef _hndrte_cons_h
17 #define _hndrte_cons_h
18
19 #define CBUF_LEN        (128)
20
21 #define LOG_BUF_LEN     1024
22
23 typedef struct {
24         u32 buf;                /* Can't be pointer on (64-bit) hosts */
25         uint buf_size;
26         uint idx;
27         char *_buf_compat;      /* Redundant pointer for backward compat. */
28 } hndrte_log_t;
29
30 typedef struct {
31         /* Virtual UART
32          * When there is no UART (e.g. Quickturn),
33          * the host should write a complete
34          * input line directly into cbuf and then write
35          * the length into vcons_in.
36          * This may also be used when there is a real UART
37          * (at risk of conflicting with
38          * the real UART).  vcons_out is currently unused.
39          */
40         volatile uint vcons_in;
41         volatile uint vcons_out;
42
43         /* Output (logging) buffer
44          * Console output is written to a ring buffer log_buf at index log_idx.
45          * The host may read the output when it sees log_idx advance.
46          * Output will be lost if the output wraps around faster than the host
47          * polls.
48          */
49         hndrte_log_t log;
50
51         /* Console input line buffer
52          * Characters are read one at a time into cbuf
53          * until <CR> is received, then
54          * the buffer is processed as a command line.
55          * Also used for virtual UART.
56          */
57         uint cbuf_idx;
58         char cbuf[CBUF_LEN];
59 } hndrte_cons_t;
60
61 #endif /* _hndrte_cons_h */
62