2 * Copyright (c) 2013 Broadcom Corporation
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.
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.
16 #ifndef BRCMFMAC_PROTO_H
17 #define BRCMFMAC_PROTO_H
20 enum proto_addr_mode {
27 int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws,
28 struct sk_buff *skb, struct brcmf_if **ifp);
29 int (*query_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd,
31 int (*set_dcmd)(struct brcmf_pub *drvr, int ifidx, uint cmd, void *buf,
33 int (*txdata)(struct brcmf_pub *drvr, int ifidx, u8 offset,
35 void (*configure_addr_mode)(struct brcmf_pub *drvr, int ifidx,
36 enum proto_addr_mode addr_mode);
37 void (*delete_peer)(struct brcmf_pub *drvr, int ifidx,
39 void (*add_tdls_peer)(struct brcmf_pub *drvr, int ifidx,
45 int brcmf_proto_attach(struct brcmf_pub *drvr);
46 void brcmf_proto_detach(struct brcmf_pub *drvr);
48 static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws,
50 struct brcmf_if **ifp)
52 struct brcmf_if *tmp = NULL;
54 /* assure protocol is always called with
55 * non-null initialized pointer.
61 return drvr->proto->hdrpull(drvr, do_fws, skb, ifp);
63 static inline int brcmf_proto_query_dcmd(struct brcmf_pub *drvr, int ifidx,
64 uint cmd, void *buf, uint len)
66 return drvr->proto->query_dcmd(drvr, ifidx, cmd, buf, len);
68 static inline int brcmf_proto_set_dcmd(struct brcmf_pub *drvr, int ifidx,
69 uint cmd, void *buf, uint len)
71 return drvr->proto->set_dcmd(drvr, ifidx, cmd, buf, len);
73 static inline int brcmf_proto_txdata(struct brcmf_pub *drvr, int ifidx,
74 u8 offset, struct sk_buff *skb)
76 return drvr->proto->txdata(drvr, ifidx, offset, skb);
79 brcmf_proto_configure_addr_mode(struct brcmf_pub *drvr, int ifidx,
80 enum proto_addr_mode addr_mode)
82 drvr->proto->configure_addr_mode(drvr, ifidx, addr_mode);
85 brcmf_proto_delete_peer(struct brcmf_pub *drvr, int ifidx, u8 peer[ETH_ALEN])
87 drvr->proto->delete_peer(drvr, ifidx, peer);
90 brcmf_proto_add_tdls_peer(struct brcmf_pub *drvr, int ifidx, u8 peer[ETH_ALEN])
92 drvr->proto->add_tdls_peer(drvr, ifidx, peer);
96 #endif /* BRCMFMAC_PROTO_H */