aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/bcmdhd/include/bcmcdc.h')
-rw-r--r--drivers/net/wireless/bcmdhd/include/bcmcdc.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/drivers/net/wireless/bcmdhd/include/bcmcdc.h b/drivers/net/wireless/bcmdhd/include/bcmcdc.h
new file mode 100644
index 00000000000..77a20f87b7e
--- /dev/null
+++ b/drivers/net/wireless/bcmdhd/include/bcmcdc.h
@@ -0,0 +1,121 @@
1/*
2 * CDC network driver ioctl/indication encoding
3 * Broadcom 802.11abg Networking Device Driver
4 *
5 * Definitions subject to change without notice.
6 *
7 * Copyright (C) 1999-2011, Broadcom Corporation
8 *
9 * Unless you and Broadcom execute a separate written software license
10 * agreement governing use of this software, this software is licensed to you
11 * under the terms of the GNU General Public License version 2 (the "GPL"),
12 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
13 * following added to such license:
14 *
15 * As a special exception, the copyright holders of this software give you
16 * permission to link this software with independent modules, and to copy and
17 * distribute the resulting executable under terms of your choice, provided that
18 * you also meet, for each linked independent module, the terms and conditions of
19 * the license of that module. An independent module is a module which is not
20 * derived from this software. The special exception does not apply to any
21 * modifications of the software.
22 *
23 * Notwithstanding the above, under no circumstances may you combine this
24 * software in any way with any other Broadcom software provided under a license
25 * other than the GPL, without Broadcom's express prior written consent.
26 *
27 * $Id: bcmcdc.h 277737 2011-08-16 17:54:59Z $
28 */
29
30#ifndef _bcmcdc_h_
31#define _bcmcdc_h_
32#include <proto/ethernet.h>
33
34typedef struct cdc_ioctl {
35 uint32 cmd;
36 uint32 len;
37 uint32 flags;
38 uint32 status;
39} cdc_ioctl_t;
40
41
42#define CDC_MAX_MSG_SIZE ETHER_MAX_LEN
43
44
45#define CDCL_IOC_OUTLEN_MASK 0x0000FFFF
46
47#define CDCL_IOC_OUTLEN_SHIFT 0
48#define CDCL_IOC_INLEN_MASK 0xFFFF0000
49#define CDCL_IOC_INLEN_SHIFT 16
50
51
52#define CDCF_IOC_ERROR 0x01
53#define CDCF_IOC_SET 0x02
54#define CDCF_IOC_OVL_IDX_MASK 0x3c
55#define CDCF_IOC_OVL_RSV 0x40
56#define CDCF_IOC_OVL 0x80
57#define CDCF_IOC_ACTION_MASK 0xfe
58#define CDCF_IOC_ACTION_SHIFT 1
59#define CDCF_IOC_IF_MASK 0xF000
60#define CDCF_IOC_IF_SHIFT 12
61#define CDCF_IOC_ID_MASK 0xFFFF0000
62#define CDCF_IOC_ID_SHIFT 16
63
64#define CDC_IOC_IF_IDX(flags) (((flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT)
65#define CDC_IOC_ID(flags) (((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
66
67#define CDC_GET_IF_IDX(hdr) \
68 ((int)((((hdr)->flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT))
69#define CDC_SET_IF_IDX(hdr, idx) \
70 ((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | ((idx) << CDCF_IOC_IF_SHIFT)))
71
72
73
74#define BDC_HEADER_LEN 4
75
76#define BDC_PROTO_VER_1 1
77#define BDC_PROTO_VER 2
78
79#define BDC_FLAG_VER_MASK 0xf0
80#define BDC_FLAG_VER_SHIFT 4
81
82#define BDC_FLAG__UNUSED 0x03
83#define BDC_FLAG_SUM_GOOD 0x04
84#define BDC_FLAG_SUM_NEEDED 0x08
85
86#define BDC_PRIORITY_MASK 0x7
87
88#define BDC_FLAG2_FC_FLAG 0x10
89
90#define BDC_PRIORITY_FC_SHIFT 4
91
92#define BDC_FLAG2_IF_MASK 0x0f
93#define BDC_FLAG2_IF_SHIFT 0
94#define BDC_FLAG2_PAD_MASK 0xf0
95#define BDC_FLAG_PAD_MASK 0x03
96#define BDC_FLAG2_PAD_SHIFT 2
97#define BDC_FLAG_PAD_SHIFT 0
98#define BDC_FLAG2_PAD_IDX 0x3c
99#define BDC_FLAG_PAD_IDX 0x03
100#define BDC_GET_PAD_LEN(hdr) \
101 ((int)(((((hdr)->flags2) & BDC_FLAG2_PAD_MASK) >> BDC_FLAG2_PAD_SHIFT) | \
102 ((((hdr)->flags) & BDC_FLAG_PAD_MASK) >> BDC_FLAG_PAD_SHIFT)))
103#define BDC_SET_PAD_LEN(hdr, idx) \
104 ((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_PAD_MASK) | \
105 (((idx) & BDC_FLAG2_PAD_IDX) << BDC_FLAG2_PAD_SHIFT))); \
106 ((hdr)->flags = (((hdr)->flags & ~BDC_FLAG_PAD_MASK) | \
107 (((idx) & BDC_FLAG_PAD_IDX) << BDC_FLAG_PAD_SHIFT)))
108
109#define BDC_GET_IF_IDX(hdr) \
110 ((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT))
111#define BDC_SET_IF_IDX(hdr, idx) \
112 ((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | ((idx) << BDC_FLAG2_IF_SHIFT)))
113
114struct bdc_header {
115 uint8 flags;
116 uint8 priority;
117 uint8 flags2;
118 uint8 dataOffset;
119};
120
121#endif