diff options
author | Vladimir Kondratiev <QCA_vkondrat@QCA.qualcomm.com> | 2015-07-30 13:52:00 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-08-06 09:43:24 +0300 |
commit | 5421bf0c1e37642f42758fe1c73e43b27901dd61 (patch) | |
tree | 0a1a74ae87b2df8e694ac1cba3c1e0d60bf0f636 /drivers/net/wireless/ath/wil6210/wmi.c | |
parent | cab5abbf9d0ef8b36d5f5181f0087ed3836385d0 (diff) | |
download | linux-stable-5421bf0c1e37642f42758fe1c73e43b27901dd61.tar.gz linux-stable-5421bf0c1e37642f42758fe1c73e43b27901dd61.tar.bz2 linux-stable-5421bf0c1e37642f42758fe1c73e43b27901dd61.zip |
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>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/wmi.c')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index fbcea838ccfa..b9cf9a68d565 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c @@ -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; } |