Staging: Add initial release of brcm80211 - Broadcom 802.11n wireless LAN driver.
[linux-2.6/libata-dev.git] / drivers / staging / brcm80211 / include / osl.h
blobcd09f3c09b9b09a2f805fae2e9b6f09249e55a73
1 /*
2 * Copyright (c) 2010 Broadcom Corporation
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.
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.
17 #ifndef _osl_h_
18 #define _osl_h_
20 /* osl handle type forward declaration */
21 typedef struct osl_info osl_t;
22 typedef struct osl_dmainfo osldma_t;
24 #define OSL_PKTTAG_SZ 32 /* Size of PktTag */
26 /* Drivers use PKTFREESETCB to register a callback function when a packet is freed by OSL */
27 typedef void (*pktfree_cb_fn_t) (void *ctx, void *pkt, unsigned int status);
29 #ifdef BCMSDIO
30 /* Drivers use REGOPSSET() to register register read/write funcitons */
31 typedef unsigned int (*osl_rreg_fn_t) (void *ctx, void *reg, unsigned int size);
32 typedef void (*osl_wreg_fn_t) (void *ctx, void *reg, unsigned int val,
33 unsigned int size);
34 #endif
36 #include <linux_osl.h>
38 /* --------------------------------------------------------------------------
39 ** Register manipulation macros.
42 #define SET_REG(osh, r, mask, val) W_REG((osh), (r), ((R_REG((osh), r) & ~(mask)) | (val)))
44 #ifndef AND_REG
45 #define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v))
46 #endif /* !AND_REG */
48 #ifndef OR_REG
49 #define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v))
50 #endif /* !OR_REG */
52 #if !defined(OSL_SYSUPTIME)
53 #define OSL_SYSUPTIME() (0)
54 #define OSL_SYSUPTIME_SUPPORT FALSE
55 #else
56 #define OSL_SYSUPTIME_SUPPORT TRUE
57 #endif /* OSL_SYSUPTIME */
59 #endif /* _osl_h_ */