wil6210: unify wmi_set_ie() error handling
When printing error message, provide string describing IE kind. Derive it from IE type This allows removing of error messages printing in callers Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Este cometimento está contido em:

cometido por
Kalle Valo

ascendente
cab5abbf9d
cometimento
5421bf0c1e
@@ -1022,12 +1022,21 @@ int wmi_add_cipher_key(struct wil6210_priv *wil, u8 key_index,
|
||||
|
||||
int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie)
|
||||
{
|
||||
static const char *const names[] = {
|
||||
[WMI_FRAME_BEACON] = "BEACON",
|
||||
[WMI_FRAME_PROBE_REQ] = "PROBE_REQ",
|
||||
[WMI_FRAME_PROBE_RESP] = "WMI_FRAME_PROBE_RESP",
|
||||
[WMI_FRAME_ASSOC_REQ] = "WMI_FRAME_ASSOC_REQ",
|
||||
[WMI_FRAME_ASSOC_RESP] = "WMI_FRAME_ASSOC_RESP",
|
||||
};
|
||||
int rc;
|
||||
u16 len = sizeof(struct wmi_set_appie_cmd) + ie_len;
|
||||
struct wmi_set_appie_cmd *cmd = kzalloc(len, GFP_KERNEL);
|
||||
|
||||
if (!cmd)
|
||||
return -ENOMEM;
|
||||
if (!cmd) {
|
||||
rc = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
if (!ie)
|
||||
ie_len = 0;
|
||||
|
||||
@@ -1037,6 +1046,12 @@ int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie)
|
||||
memcpy(cmd->ie_info, ie, ie_len);
|
||||
rc = wmi_send(wil, WMI_SET_APPIE_CMDID, cmd, len);
|
||||
kfree(cmd);
|
||||
out:
|
||||
if (rc) {
|
||||
const char *name = type < ARRAY_SIZE(names) ?
|
||||
names[type] : "??";
|
||||
wil_err(wil, "set_ie(%d %s) failed : %d\n", type, name, rc);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador