Path: blob/main/sys/contrib/dev/broadcom/brcm80211/brcmfmac/fwvid.h
178665 views
/* SPDX-License-Identifier: ISC */1/*2* Copyright (c) 2022 Broadcom Corporation3*/4#ifndef FWVID_H_5#define FWVID_H_67#include "firmware.h"8#include "cfg80211.h"910struct brcmf_pub;11struct brcmf_if;1213struct brcmf_fwvid_ops {14void (*feat_attach)(struct brcmf_if *ifp);15int (*set_sae_password)(struct brcmf_if *ifp, struct cfg80211_crypto_settings *crypto);16int (*alloc_fweh_info)(struct brcmf_pub *drvr);17int (*activate_events)(struct brcmf_if *ifp);18void (*get_cfg80211_ops)(struct brcmf_pub *drvr);19void (*register_event_handlers)(struct brcmf_pub *drvr);20};2122/* exported functions */23int brcmf_fwvid_register_vendor(enum brcmf_fwvendor fwvid, struct module *mod,24const struct brcmf_fwvid_ops *ops);25int brcmf_fwvid_unregister_vendor(enum brcmf_fwvendor fwvid, struct module *mod);2627/* core driver functions */28int brcmf_fwvid_attach(struct brcmf_pub *drvr);29void brcmf_fwvid_detach(struct brcmf_pub *drvr);30const char *brcmf_fwvid_vendor_name(struct brcmf_pub *drvr);3132static inline void brcmf_fwvid_feat_attach(struct brcmf_if *ifp)33{34const struct brcmf_fwvid_ops *vops = ifp->drvr->vops;3536if (!vops->feat_attach)37return;3839vops->feat_attach(ifp);40}4142static inline int brcmf_fwvid_set_sae_password(struct brcmf_if *ifp,43struct cfg80211_crypto_settings *crypto)44{45const struct brcmf_fwvid_ops *vops = ifp->drvr->vops;4647if (!vops || !vops->set_sae_password)48return -EOPNOTSUPP;4950return vops->set_sae_password(ifp, crypto);51}5253static inline int brcmf_fwvid_alloc_fweh_info(struct brcmf_pub *drvr)54{55if (!drvr->vops)56return -EIO;5758return drvr->vops->alloc_fweh_info(drvr);59}6061static inline int brcmf_fwvid_activate_events(struct brcmf_if *ifp)62{63const struct brcmf_fwvid_ops *vops = ifp->drvr->vops;6465if (!vops || !vops->activate_events)66return -EOPNOTSUPP;6768return vops->activate_events(ifp);69}7071static inline void brcmf_fwvid_get_cfg80211_ops(struct brcmf_pub *drvr)72{73if (!drvr->vops || !drvr->vops->get_cfg80211_ops)74return;7576drvr->vops->get_cfg80211_ops(drvr);77}7879static inline void brcmf_fwvid_register_event_handlers(struct brcmf_pub *drvr)80{81if (!drvr->vops || !drvr->vops->register_event_handlers)82return;8384drvr->vops->register_event_handlers(drvr);85}8687#endif /* FWVID_H_ */888990