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.
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);
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,
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)))
45 #define AND_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) & (v))
49 #define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v))
52 #if !defined(OSL_SYSUPTIME)
53 #define OSL_SYSUPTIME() (0)
54 #define OSL_SYSUPTIME_SUPPORT false
56 #define OSL_SYSUPTIME_SUPPORT true
57 #endif /* OSL_SYSUPTIME */