Commit | Line | Data |
---|---|---|
a9533e7e HP |
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 | #ifndef _osl_h_ | |
18 | #define _osl_h_ | |
19 | ||
20 | /* osl handle type forward declaration */ | |
21 | typedef struct osl_info osl_t; | |
22 | typedef struct osl_dmainfo osldma_t; | |
23 | ||
a9533e7e HP |
24 | /* Drivers use PKTFREESETCB to register a callback function when a packet is freed by OSL */ |
25 | typedef void (*pktfree_cb_fn_t) (void *ctx, void *pkt, unsigned int status); | |
26 | ||
27 | #ifdef BCMSDIO | |
28 | /* Drivers use REGOPSSET() to register register read/write funcitons */ | |
29 | typedef unsigned int (*osl_rreg_fn_t) (void *ctx, void *reg, unsigned int size); | |
30 | typedef void (*osl_wreg_fn_t) (void *ctx, void *reg, unsigned int val, | |
31 | unsigned int size); | |
32 | #endif | |
33 | ||
34 | #include <linux_osl.h> | |
35 | ||
36 | /* -------------------------------------------------------------------------- | |
37 | ** Register manipulation macros. | |
38 | */ | |
39 | ||
40 | #define SET_REG(osh, r, mask, val) W_REG((osh), (r), ((R_REG((osh), r) & ~(mask)) | (val))) | |
41 | ||
42 | #ifndef AND_REG | |
43 | #define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v)) | |
44 | #endif /* !AND_REG */ | |
45 | ||
46 | #ifndef OR_REG | |
47 | #define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v)) | |
48 | #endif /* !OR_REG */ | |
49 | ||
50 | #if !defined(OSL_SYSUPTIME) | |
51 | #define OSL_SYSUPTIME() (0) | |
0965ae88 | 52 | #define OSL_SYSUPTIME_SUPPORT false |
a9533e7e | 53 | #else |
0f0881b0 | 54 | #define OSL_SYSUPTIME_SUPPORT true |
a9533e7e HP |
55 | #endif /* OSL_SYSUPTIME */ |
56 | ||
57 | #endif /* _osl_h_ */ |