summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/brcm80211/brcmfmac/proto.c
diff options
context:
space:
mode:
authorHante Meuleman <meuleman@broadcom.com>2014-07-30 11:20:03 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2014-07-31 17:45:26 (GMT)
commit9a1bb60250d2b6b546a62e5b73f55c4f1d22016b (patch)
tree7aae569da33de35db22e3f455382540be3da4b5c /drivers/net/wireless/brcm80211/brcmfmac/proto.c
parent8851cce085dce026f14e9fc525acc71e4c9d305b (diff)
downloadlinux-9a1bb60250d2b6b546a62e5b73f55c4f1d22016b.tar.xz
brcmfmac: Adding msgbuf protocol.
This patch will add the msgbuf protocol. This protocol is used by the soon to be added new bus interface PCIe. Msgbuf is a protocol where most data is and remains located on the host (driver) side and transferred by DMA from and to device. Msgbuf is the protocol which takes care of the signalling of the buffers between host and device which identifies this DMA-able data. Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/proto.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/proto.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/proto.c b/drivers/net/wireless/brcm80211/brcmfmac/proto.c
index d333ff8..44b1cb4 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/proto.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/proto.c
@@ -21,9 +21,11 @@
#include <brcmu_wifi.h>
#include "dhd.h"
+#include "dhd_bus.h"
#include "dhd_dbg.h"
#include "proto.h"
#include "bcdc.h"
+#include "msgbuf.h"
int brcmf_proto_attach(struct brcmf_pub *drvr)
@@ -37,10 +39,18 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
goto fail;
drvr->proto = proto;
- /* BCDC protocol is only protocol supported for the moment */
- if (brcmf_proto_bcdc_attach(drvr))
- goto fail;
+ if (drvr->bus_if->proto_type == BRCMF_PROTO_BCDC) {
+ if (brcmf_proto_bcdc_attach(drvr))
+ goto fail;
+ } else if (drvr->bus_if->proto_type == BRCMF_PROTO_MSGBUF) {
+ if (brcmf_proto_msgbuf_attach(drvr))
+ goto fail;
+ } else {
+ brcmf_err("Unsupported proto type %d\n",
+ drvr->bus_if->proto_type);
+ goto fail;
+ }
if ((proto->txdata == NULL) || (proto->hdrpull == NULL) ||
(proto->query_dcmd == NULL) || (proto->set_dcmd == NULL) ||
(proto->configure_addr_mode == NULL) ||
@@ -61,7 +71,10 @@ void brcmf_proto_detach(struct brcmf_pub *drvr)
brcmf_dbg(TRACE, "Enter\n");
if (drvr->proto) {
- brcmf_proto_bcdc_detach(drvr);
+ if (drvr->bus_if->proto_type == BRCMF_PROTO_BCDC)
+ brcmf_proto_bcdc_detach(drvr);
+ else if (drvr->bus_if->proto_type == BRCMF_PROTO_MSGBUF)
+ brcmf_proto_msgbuf_detach(drvr);
kfree(drvr->proto);
drvr->proto = NULL;
}