~ubuntu-branches/ubuntu/saucy/bcmwl/saucy

« back to all changes in this revision

Viewing changes to src/src/include/bcmdefs.h

  • Committer: Bazaar Package Importer
  • Author(s): Tim Gardner
  • Date: 2009-05-11 16:04:29 UTC
  • Revision ID: james.westby@ubuntu.com-20090511160429-lciigiqnpp0fpu2k
Tags: 5.10.91.9-2
Add src/lib/LICENSE.txt to copyright notice. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Misc system wide definitions
 
3
 *
 
4
 * Copyright 2008, Broadcom Corporation
 
5
 * All Rights Reserved.
 
6
 * 
 
7
 *      Unless you and Broadcom execute a separate written software license
 
8
 * agreement governing use of this software, this software is licensed to you
 
9
 * under the terms of the GNU General Public License version 2, available at
 
10
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL"), with the
 
11
 * following added to such license:
 
12
 *      As a special exception, the copyright holders of this software give you
 
13
 * permission to link this software with independent modules, regardless of the
 
14
 * license terms of these independent modules, and to copy and distribute the
 
15
 * resulting executable under terms of your choice, provided that you also meet,
 
16
 * for each linked independent module, the terms and conditions of the license
 
17
 * of that module. An independent module is a module which is not derived from
 
18
 * this software.
 
19
 *
 
20
 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
 
21
 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
 
22
 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
 
23
 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
 
24
 *
 
25
 * $Id: bcmdefs.h,v 13.43.2.11 2009/02/11 01:59:34 Exp $
 
26
 */
 
27
 
 
28
#ifndef _bcmdefs_h_
 
29
#define _bcmdefs_h_
 
30
 
 
31
#define bcmreclaimed            0
 
32
#define BCMATTACHDATA(_data)    _data
 
33
#define BCMATTACHFN(_fn)        _fn
 
34
#define BCMINITDATA(_data)      _data
 
35
#define BCMINITFN(_fn)          _fn
 
36
#define BCMUNINITFN(_fn)        _fn
 
37
#define BCMNMIATTACHFN(_fn)     _fn
 
38
#define BCMNMIATTACHDATA(_data) _data
 
39
#define CONST   const
 
40
#define BCMFASTPATH
 
41
 
 
42
#define BCMROMDATA(_data)       _data
 
43
#define BCMROMFN(_fn)           _fn
 
44
 
 
45
#define SI_BUS                  0       
 
46
#define PCI_BUS                 1       
 
47
#define PCMCIA_BUS              2       
 
48
#define SDIO_BUS                3       
 
49
#define JTAG_BUS                4       
 
50
#define USB_BUS                 5       
 
51
#define SPI_BUS                 6       
 
52
#define RPC_BUS                 7       
 
53
 
 
54
#ifdef BCMBUSTYPE
 
55
#define BUSTYPE(bus)    (BCMBUSTYPE)
 
56
#else
 
57
#define BUSTYPE(bus)    (bus)
 
58
#endif
 
59
 
 
60
#ifdef BCMCHIPTYPE
 
61
#define CHIPTYPE(bus)   (BCMCHIPTYPE)
 
62
#else
 
63
#define CHIPTYPE(bus)   (bus)
 
64
#endif
 
65
 
 
66
#define SPROMBUS        (PCI_BUS)
 
67
 
 
68
#define CHIPID(chip)    (chip)
 
69
 
 
70
#define DMADDR_MASK_32 0x0              
 
71
#define DMADDR_MASK_30 0xc0000000       
 
72
#define DMADDR_MASK_0  0xffffffff       
 
73
 
 
74
#define DMADDRWIDTH_30  30 
 
75
#define DMADDRWIDTH_32  32 
 
76
#define DMADDRWIDTH_63  63 
 
77
#define DMADDRWIDTH_64  64 
 
78
 
 
79
#ifdef BCMDMA64OSL
 
80
typedef struct {
 
81
        uint32 loaddr;
 
82
        uint32 hiaddr;
 
83
} dma64addr_t;
 
84
 
 
85
typedef dma64addr_t dmaaddr_t;
 
86
#define PHYSADDRHI(_pa) ((_pa).hiaddr)
 
87
#define PHYSADDRHISET(_pa, _val) \
 
88
        do { \
 
89
                (_pa).hiaddr = (_val);          \
 
90
        } while (0)
 
91
#define PHYSADDRLO(_pa) ((_pa).loaddr)
 
92
#define PHYSADDRLOSET(_pa, _val) \
 
93
        do { \
 
94
                (_pa).loaddr = (_val);          \
 
95
        } while (0)
 
96
 
 
97
#else
 
98
typedef unsigned long dmaaddr_t;
 
99
#define PHYSADDRHI(_pa) (0)
 
100
#define PHYSADDRHISET(_pa, _val)
 
101
#define PHYSADDRLO(_pa) ((_pa))
 
102
#define PHYSADDRLOSET(_pa, _val) \
 
103
        do { \
 
104
                (_pa) = (_val);                 \
 
105
        } while (0)
 
106
#endif 
 
107
 
 
108
typedef struct  {
 
109
        dmaaddr_t addr;
 
110
        uint32    length;
 
111
} hnddma_seg_t;
 
112
 
 
113
#define MAX_DMA_SEGS 4
 
114
 
 
115
typedef struct {
 
116
        void *oshdmah; 
 
117
        uint origsize; 
 
118
        uint nsegs;
 
119
        hnddma_seg_t segs[MAX_DMA_SEGS];
 
120
} hnddma_seg_map_t;
 
121
 
 
122
#if defined(BCM_RPC_NOCOPY) || defined(BCM_RCP_TXNOCOPY)
 
123
#define BCMEXTRAHDROOM 220
 
124
#else
 
125
#define BCMEXTRAHDROOM 172
 
126
#endif
 
127
 
 
128
#define BCMDONGLEHDRSZ 12
 
129
 
 
130
#ifdef BCMDBG
 
131
 
 
132
#ifndef BCMDBG_ERR
 
133
#define BCMDBG_ERR
 
134
#endif 
 
135
 
 
136
#ifndef BCMDBG_ASSERT
 
137
#define BCMDBG_ASSERT
 
138
#endif 
 
139
 
 
140
#endif 
 
141
 
 
142
#if defined(BCMDBG_ASSERT)
 
143
#define BCMASSERT_SUPPORT
 
144
#endif 
 
145
 
 
146
#define BITFIELD_MASK(width) \
 
147
                (((unsigned)1 << (width)) - 1)
 
148
#define GFIELD(val, field) \
 
149
                (((val) >> field ## _S) & field ## _M)
 
150
#define SFIELD(val, field, bits) \
 
151
                (((val) & (~(field ## _M << field ## _S))) | \
 
152
                 ((unsigned)(bits) << field ## _S))
 
153
 
 
154
#undef  BCMSPACE
 
155
#define bcmspace        FALSE   
 
156
 
 
157
#define MAXSZ_NVRAM_VARS        4096
 
158
 
 
159
#define LOCATOR_EXTERN static
 
160
 
 
161
#endif