src/connectivity/wlan/drivers/third_party/broadcom/brcmfmac/msgbuf/msgbuf_proto.cc
// Create a brcmf_proto instance with the appropriate trampolines.
Create a brcmf_proto instance with the appropriate trampolines.
Create a brcmf_proto instance with the appropriate trampolines .
std::unique_ptr<brcmf_proto> CreateProto(MsgbufProto* msgbuf) {
  auto proto = std::make_unique<brcmf_proto>();
  proto->hdrpull = [](brcmf_pub* drvr, bool do_fws, brcmf_netbuf* netbuf, brcmf_if** ifp) {
    return reinterpret_cast<MsgbufProto*>(drvr->proto->pd)->HdrPull(do_fws, netbuf, ifp);
  };
  proto->query_dcmd = [](brcmf_pub* drvr, int ifidx, uint cmd, void* buf, uint len,
                         bcme_status_t* fwerr) {
    return reinterpret_cast<MsgbufProto*>(drvr->proto->pd)->QueryDcmd(ifidx, cmd, buf, len, fwerr);
  };
  proto->set_dcmd = [](brcmf_pub* drvr, int ifidx, uint cmd, void* buf, uint len,
                       bcme_status_t* fwerr) {
    return reinterpret_cast<MsgbufProto*>(drvr->proto->pd)->SetDcmd(ifidx, cmd, buf, len, fwerr);
  };
  proto->tx_queue_data = [](brcmf_pub* drvr, int ifidx, std::unique_ptr<Netbuf> netbuf) {
    return reinterpret_cast<MsgbufProto*>(drvr->proto->pd)->TxQueueData(ifidx, std::move(netbuf));
  };
  proto->configure_addr_mode = [](brcmf_pub* drvr, int ifidx, proto_addr_mode addr_mode) {
    return reinterpret_cast<MsgbufProto*>(drvr->proto->pd)->ConfigureAddrMode(ifidx, addr_mode);
  };
  proto->delete_peer = [](brcmf_pub* drvr, int ifidx, uint8_t peer[ETH_ALEN]) {
    return reinterpret_cast<MsgbufProto*>(drvr->proto->pd)->DeletePeer(ifidx, peer);
  };
  proto->add_tdls_peer = [](brcmf_pub* drvr, int ifidx, uint8_t peer[ETH_ALEN]) {
    return reinterpret_cast<MsgbufProto*>(drvr->proto->pd)->AddTdlsPeer(ifidx, peer);
  };
  proto->rxreorder = [](brcmf_if* ifp, brcmf_netbuf* netbuf) {
    return reinterpret_cast<MsgbufProto*>(ifp->drvr->proto->pd)->RxReorder(netbuf);
  };
  proto->pd = msgbuf;
  return proto;
}
std :: unique_ptr < brcmf_proto > CreateProto ( MsgbufProto * msgbuf ) { auto proto = std :: make_unique < brcmf_proto > ( ) ; proto -> hdrpull = [ ] ( brcmf_pub * drvr , bool do_fws , brcmf_netbuf * netbuf , brcmf_if * * ifp ) { return reinterpret_cast < MsgbufProto * > ( drvr -> proto -> pd ) -> HdrPull ( do_fws , netbuf , ifp ) ; } ; proto -> query_dcmd = [ ] ( brcmf_pub * drvr , int ifidx , uint cmd , void * buf , uint len , bcme_status_t * fwerr ) { return reinterpret_cast < MsgbufProto * > ( drvr -> proto -> pd ) -> QueryDcmd ( ifidx , cmd , buf , len , fwerr ) ; } ; proto -> set_dcmd = [ ] ( brcmf_pub * drvr , int ifidx , uint cmd , void * buf , uint len , bcme_status_t * fwerr ) { return reinterpret_cast < MsgbufProto * > ( drvr -> proto -> pd ) -> SetDcmd ( ifidx , cmd , buf , len , fwerr ) ; } ; proto -> tx_queue_data = [ ] ( brcmf_pub * drvr , int ifidx , std :: unique_ptr < Netbuf > netbuf ) { return reinterpret_cast < MsgbufProto * > ( drvr -> proto -> pd ) -> TxQueueData ( ifidx , std :: move ( netbuf ) ) ; } ; proto -> configure_addr_mode = [ ] ( brcmf_pub * drvr , int ifidx , proto_addr_mode addr_mode ) { return reinterpret_cast < MsgbufProto * > ( drvr -> proto -> pd ) -> ConfigureAddrMode ( ifidx , addr_mode ) ; } ; proto -> delete_peer = [ ] ( brcmf_pub * drvr , int ifidx , uint8_t peer [ ETH_ALEN ] ) { return reinterpret_cast < MsgbufProto * > ( drvr -> proto -> pd ) -> DeletePeer ( ifidx , peer ) ; } ; proto -> add_tdls_peer = [ ] ( brcmf_pub * drvr , int ifidx , uint8_t peer [ ETH_ALEN ] ) { return reinterpret_cast < MsgbufProto * > ( drvr -> proto -> pd ) -> AddTdlsPeer ( ifidx , peer ) ; } ; proto -> rxreorder = [ ] ( brcmf_if * ifp , brcmf_netbuf * netbuf ) { return reinterpret_cast < MsgbufProto * > ( ifp -> drvr -> proto -> pd ) -> RxReorder ( netbuf ) ; } ; proto -> pd = msgbuf ; return proto ; }
Create a brcmf_proto instance with the appropriate trampolines.
Create a brcmf_proto instance with the appropriate trampolines .