Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / brcm80211 / brcmfmac / dhd_cdc.c
index 81e1be7051caf044135f90fde1d3c1ed97ef62ee..59c77aa3b9597894385a9b8c4c8d72aa5f6db84f 100644 (file)
@@ -28,6 +28,7 @@
 #include "dhd.h"
 #include "dhd_proto.h"
 #include "dhd_bus.h"
+#include "fwsignal.h"
 #include "dhd_dbg.h"
 
 struct brcmf_proto_cdc_dcmd {
@@ -271,7 +272,7 @@ static void pkt_set_sum_good(struct sk_buff *skb, bool x)
        skb->ip_summed = (x ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE);
 }
 
-void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx,
+void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx, u8 offset,
                         struct sk_buff *pktbuf)
 {
        struct brcmf_proto_bdc_header *h;
@@ -279,7 +280,6 @@ void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx,
        brcmf_dbg(CDC, "Enter\n");
 
        /* Push BDC header used to convey priority for buses that don't */
-
        skb_push(pktbuf, BDC_HEADER_LEN);
 
        h = (struct brcmf_proto_bdc_header *)(pktbuf->data);
@@ -290,11 +290,11 @@ void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx,
 
        h->priority = (pktbuf->priority & BDC_PRIORITY_MASK);
        h->flags2 = 0;
-       h->data_offset = 0;
+       h->data_offset = offset;
        BDC_SET_IF_IDX(h, ifidx);
 }
 
-int brcmf_proto_hdrpull(struct brcmf_pub *drvr, u8 *ifidx,
+int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
                        struct sk_buff *pktbuf)
 {
        struct brcmf_proto_bdc_header *h;
@@ -303,8 +303,8 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, u8 *ifidx,
 
        /* Pop BDC header used to convey priority for buses that don't */
 
-       if (pktbuf->len < BDC_HEADER_LEN) {
-               brcmf_err("rx data too short (%d < %d)\n",
+       if (pktbuf->len <= BDC_HEADER_LEN) {
+               brcmf_dbg(INFO, "rx data too short (%d <= %d)\n",
                          pktbuf->len, BDC_HEADER_LEN);
                return -EBADE;
        }
@@ -341,7 +341,10 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, u8 *ifidx,
        pktbuf->priority = h->priority & BDC_PRIORITY_MASK;
 
        skb_pull(pktbuf, BDC_HEADER_LEN);
-       skb_pull(pktbuf, h->data_offset << 2);
+       if (do_fws)
+               brcmf_fws_hdrpull(drvr, *ifidx, h->data_offset << 2, pktbuf);
+       else
+               skb_pull(pktbuf, h->data_offset << 2);
 
        if (pktbuf->len == 0)
                return -ENODATA;