From a9533e7ea3c410fed2f4cd8b3e1e213e48529b75 Mon Sep 17 00:00:00 2001 From: Henry Ptasinski Date: Wed, 8 Sep 2010 21:04:42 -0700 Subject: Staging: Add initial release of brcm80211 - Broadcom 802.11n wireless LAN driver. Signed-off-by: Henry Ptasinski Cc: Brett Rudley Cc: Nohee Ko Signed-off-by: Greg Kroah-Hartman --- drivers/staging/brcm80211/include/bcm_rpc.h | 80 +++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 drivers/staging/brcm80211/include/bcm_rpc.h (limited to 'drivers/staging/brcm80211/include/bcm_rpc.h') diff --git a/drivers/staging/brcm80211/include/bcm_rpc.h b/drivers/staging/brcm80211/include/bcm_rpc.h new file mode 100644 index 0000000..33408fd --- /dev/null +++ b/drivers/staging/brcm80211/include/bcm_rpc.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010 Broadcom Corporation + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _BCM_RPC_H_ +#define _BCM_RPC_H_ + +#include +#include + +typedef struct rpc_info rpc_info_t; +typedef struct rpc_buf rpc_buf_t; +struct rpc_transport_info; +typedef void (*rpc_dispatch_cb_t) (void *ctx, struct rpc_buf * buf); +typedef void (*rpc_resync_cb_t) (void *ctx); +typedef void (*rpc_down_cb_t) (void *ctx); +typedef void (*rpc_txdone_cb_t) (void *ctx, struct rpc_buf * buf); +extern struct rpc_info *bcm_rpc_attach(void *pdev, osl_t * osh, + struct rpc_transport_info *rpc_th); + +extern void bcm_rpc_detach(struct rpc_info *rpc); +extern void bcm_rpc_down(struct rpc_info *rpc); +extern void bcm_rpc_watchdog(struct rpc_info *rpc); + +extern struct rpc_buf *bcm_rpc_buf_alloc(struct rpc_info *rpc, int len); +extern void bcm_rpc_buf_free(struct rpc_info *rpc, struct rpc_buf *b); +/* get rpc transport handle */ +extern struct rpc_transport_info *bcm_rpc_tp_get(struct rpc_info *rpc); + +/* callback for: data_rx, down, resync */ +extern void bcm_rpc_rxcb_init(struct rpc_info *rpc, void *ctx, + rpc_dispatch_cb_t cb, void *dnctx, + rpc_down_cb_t dncb, rpc_resync_cb_t resync_cb, + rpc_txdone_cb_t); +extern void bcm_rpc_rxcb_deinit(struct rpc_info *rpci); + +/* HOST or CLIENT rpc call, requiring no return value */ +extern int bcm_rpc_call(struct rpc_info *rpc, struct rpc_buf *b); + +/* HOST rpc call, demanding return. + * The thread may be suspended and control returns back to OS + * The thread will resume(waked up) on either the return signal received or timeout + * The implementation details depend on OS + */ +extern struct rpc_buf *bcm_rpc_call_with_return(struct rpc_info *rpc, + struct rpc_buf *b); + +/* CLIENT rpc call to respond to bcm_rpc_call_with_return, requiring no return value */ +extern int bcm_rpc_call_return(struct rpc_info *rpc, struct rpc_buf *retb); + +extern uint bcm_rpc_buf_header_len(struct rpc_info *rpci); + +#define RPC_PKTLOG_SIZE 50 /* Depth of the history */ +#define RPC_PKTLOG_RD_LEN 3 +#define RPC_PKTLOG_DUMP_SIZE 150 /* dump size should be more than the product of above two */ +extern int bcm_rpc_pktlog_get(struct rpc_info *rpci, uint32 * buf, + uint buf_size, bool send); +extern int bcm_rpc_dump(rpc_info_t * rpci, struct bcmstrbuf *b); + +/* HIGH/BMAC: bit 15-8: RPC module, bit 7-0: TP module */ +#define RPC_ERROR_VAL 0x0001 +#define RPC_TRACE_VAL 0x0002 +#define RPC_PKTTRACE_VAL 0x0004 +#define RPC_PKTLOG_VAL 0x0008 +extern void bcm_rpc_msglevel_set(struct rpc_info *rpci, uint16 msglevel, + bool high_low); + +#endif /* _BCM_RPC_H_ */ -- cgit v1.1