Henry Ptasinski | a9533e7 | 2010-09-08 21:04:42 -0700 | [diff] [blame] | 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 _wlc_rpctx_h_ |
| 18 | #define _wlc_rpctx_h_ |
| 19 | |
| 20 | /* forward declaration */ |
| 21 | struct wlc_info; |
| 22 | |
| 23 | /* This controls how many packets are given to the dongle. This is required as |
| 24 | * NTXD needs to be power of 2 but we may not have enough memory to absorb that |
| 25 | * large number of frames |
| 26 | */ |
| 27 | #ifndef NRPCTXBUFPOST |
| 28 | #define NRPCTXBUFPOST NTXD |
| 29 | #endif |
| 30 | |
| 31 | #if defined(WLC_HIGH_ONLY) |
| 32 | |
| 33 | struct wlc_rpc_phy { |
| 34 | struct rpc_info *rpc; |
| 35 | }; |
| 36 | |
Greg Kroah-Hartman | 0f0881b | 2010-10-12 12:15:18 -0700 | [diff] [blame^] | 37 | #define RPCTX_ENAB(pub) (true) |
Jason Cooper | 7cc4a4c | 2010-09-14 09:45:30 -0400 | [diff] [blame] | 38 | extern rpctx_info_t *wlc_rpctx_attach(wlc_pub_t *pub, struct wlc_info *wlc); |
| 39 | extern int wlc_rpctx_fifoinit(rpctx_info_t *rpctx, uint fifo, uint ntxd); |
| 40 | extern void wlc_rpctx_detach(rpctx_info_t *rpctx); |
| 41 | extern int wlc_rpctx_dump(rpctx_info_t *rpctx, struct bcmstrbuf *b); |
| 42 | extern void *wlc_rpctx_getnexttxp(rpctx_info_t *rpctx, uint fifo); |
| 43 | extern void wlc_rpctx_txreclaim(rpctx_info_t *rpctx); |
| 44 | extern uint wlc_rpctx_txavail(rpctx_info_t *rpctx, uint fifo); |
| 45 | extern int wlc_rpctx_pkteng(rpctx_info_t *rpctx, uint fifo, void *p); |
| 46 | extern int wlc_rpctx_tx(rpctx_info_t *rpctx, uint fifo, void *p, bool commit, |
Greg Kroah-Hartman | 7d4df48 | 2010-10-07 17:04:47 -0700 | [diff] [blame] | 47 | u16 frameid, u8 txpktpend); |
Greg Kroah-Hartman | 41feb5e | 2010-10-05 10:09:00 -0700 | [diff] [blame] | 48 | extern void wlc_rpctx_txpktpendinc(rpctx_info_t *rpctx, uint fifo, u8 val); |
| 49 | extern void wlc_rpctx_txpktpenddec(rpctx_info_t *rpctx, uint fifo, u8 val); |
Jason Cooper | 7cc4a4c | 2010-09-14 09:45:30 -0400 | [diff] [blame] | 50 | extern void wlc_rpctx_txpktpendclr(rpctx_info_t *rpctx, uint fifo); |
| 51 | extern int wlc_rpctx_txpktpend(rpctx_info_t *rpctx, uint fifo, bool all); |
Henry Ptasinski | a9533e7 | 2010-09-08 21:04:42 -0700 | [diff] [blame] | 52 | |
| 53 | #else |
| 54 | #define RPCTX_ENAB(pub) (FALSE) |
| 55 | #define wlc_rpctx_attach(pub, wlc) (NULL) |
| 56 | #define wlc_rpctx_fifoinit(rpctx, fifo, ntxd) (0) |
| 57 | #define wlc_rpctx_detach(rpctx) ASSERT(0) |
| 58 | #define wlc_rpctx_txavail(rpctx, f) (FALSE) |
| 59 | #define wlc_rpctx_dump(rpctx, b) (0) |
| 60 | #define wlc_rpctx_getnexttxp(rpctx, f) (NULL) |
| 61 | #define wlc_rpctx_txreclaim(rpctx) ASSERT(0) |
| 62 | #define wlc_rpctx_pkteng(rpctx, fifo, p) do { } while (0) |
| 63 | #define wlc_rpctx_tx(rpctx, f, p, c, fid, t) (0) |
| 64 | #define wlc_rpctx_txpktpendinc(rpctx, f, val) do { } while (0) |
| 65 | #define wlc_rpctx_txpktpenddec(rpctx, f, val) do { } while (0) |
| 66 | #define wlc_rpctx_txpktpendclr(rpctx, f) do { } while (0) |
| 67 | #define wlc_rpctx_txpktpend(rpctx, f, all) (0) |
| 68 | |
| 69 | #endif /* WLC_HIGH */ |
| 70 | |
| 71 | #endif /* _wlc_rpctx_h_ */ |