Skip to content

Commit

Permalink
brcmfmac: add parameter to brcmf_proto_hdrpush() for data offset
Browse files Browse the repository at this point in the history
The function brcmf_proto_hdrpush() increases the header space and
fills in the protocol header fields. One field is the data offset
which is currently fixed to zero meaning the data follows right
after the header. The parameter is added to determine the actual
start of data. This will be used for firmware signalling.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Mar 6, 2013
1 parent 17f14d7 commit 8f0c3b6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,14 @@ 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;

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);
Expand All @@ -291,7 +290,7 @@ 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);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,
atomic_inc(&ifp->pend_8021x_cnt);

/* If the protocol uses a data header, apply it */
brcmf_proto_hdrpush(drvr, ifp->ifidx, skb);
brcmf_proto_hdrpush(drvr, ifp->ifidx, 0, skb);

/* Use bus module to send data frame */
ret = brcmf_bus_txdata(drvr->bus_if, skb);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern void brcmf_proto_stop(struct brcmf_pub *drvr);
/* Add any protocol-specific data header.
* Caller must reserve prot_hdrlen prepend space.
*/
extern void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx,
extern void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx, u8 offset,
struct sk_buff *txp);

/* Sets dongle media info (drv_version, mac address). */
Expand Down

0 comments on commit 8f0c3b6

Please sign in to comment.