| 1 |
// SPDX-License-Identifier: ISC |
| 2 |
/* |
| 3 |
* Copyright (c) 2022 Broadcom Corporation |
| 4 |
*/ |
| 5 |
#include <linux/errno.h> |
| 6 |
#include <linux/types.h> |
| 7 |
#include <core.h> |
| 8 |
#include <bus.h> |
| 9 |
#include <fwvid.h> |
| 10 |
#include <cfg80211.h> |
| 11 |
|
| 12 |
#include "vops.h" |
| 13 |
|
| 14 |
#define BRCMF_WCC_E_LAST 213 |
| 15 |
|
| 16 |
static int brcmf_wcc_set_sae_pwd(struct brcmf_if *ifp, |
| 17 |
struct cfg80211_crypto_settings *crypto) |
| 18 |
{ |
| 19 |
return brcmf_set_wsec(ifp, crypto->sae_pwd, crypto->sae_pwd_len, |
| 20 |
BRCMF_WSEC_PASSPHRASE); |
| 21 |
} |
| 22 |
|
| 23 |
static int brcmf_wcc_alloc_fweh_info(struct brcmf_pub *drvr) |
| 24 |
{ |
| 25 |
struct brcmf_fweh_info *fweh; |
| 26 |
|
| 27 |
fweh = kzalloc_flex(*fweh, evt_handler, BRCMF_WCC_E_LAST); |
| 28 |
if (!fweh) |
| 29 |
return -ENOMEM; |
| 30 |
|
| 31 |
fweh->num_event_codes = BRCMF_WCC_E_LAST; |
| 32 |
drvr->fweh = fweh; |
| 33 |
return 0; |
| 34 |
} |
| 35 |
|
| 36 |
const struct brcmf_fwvid_ops brcmf_wcc_ops = { |
| 37 |
.set_sae_password = brcmf_wcc_set_sae_pwd, |
| 38 |
.alloc_fweh_info = brcmf_wcc_alloc_fweh_info, |
| 39 |
}; |