diff options
author | Vladimir Kondratiev <QCA_vkondrat@QCA.qualcomm.com> | 2015-07-30 06:52:00 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-08-06 02:43:24 -0400 |
commit | 5421bf0c1e37642f42758fe1c73e43b27901dd61 (patch) | |
tree | 0a1a74ae87b2df8e694ac1cba3c1e0d60bf0f636 /drivers/net/wireless/ath/wil6210/wmi.c | |
parent | cab5abbf9d0ef8b36d5f5181f0087ed3836385d0 (diff) |
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, | |||
1022 | 1022 | ||
1023 | int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie) | 1023 | int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie) |
1024 | { | 1024 | { |
1025 | static const char *const names[] = { | ||
1026 | [WMI_FRAME_BEACON] = "BEACON", | ||
1027 | [WMI_FRAME_PROBE_REQ] = "PROBE_REQ", | ||
1028 | [WMI_FRAME_PROBE_RESP] = "WMI_FRAME_PROBE_RESP", | ||
1029 | [WMI_FRAME_ASSOC_REQ] = "WMI_FRAME_ASSOC_REQ", | ||
1030 | [WMI_FRAME_ASSOC_RESP] = "WMI_FRAME_ASSOC_RESP", | ||
1031 | }; | ||
1025 | int rc; | 1032 | int rc; |
1026 | u16 len = sizeof(struct wmi_set_appie_cmd) + ie_len; | 1033 | u16 len = sizeof(struct wmi_set_appie_cmd) + ie_len; |
1027 | struct wmi_set_appie_cmd *cmd = kzalloc(len, GFP_KERNEL); | 1034 | struct wmi_set_appie_cmd *cmd = kzalloc(len, GFP_KERNEL); |
1028 | 1035 | ||
1029 | if (!cmd) | 1036 | if (!cmd) { |
1030 | return -ENOMEM; | 1037 | rc = -ENOMEM; |
1038 | goto out; | ||
1039 | } | ||
1031 | if (!ie) | 1040 | if (!ie) |
1032 | ie_len = 0; | 1041 | ie_len = 0; |
1033 | 1042 | ||
@@ -1037,6 +1046,12 @@ int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie) | |||
1037 | memcpy(cmd->ie_info, ie, ie_len); | 1046 | memcpy(cmd->ie_info, ie, ie_len); |
1038 | rc = wmi_send(wil, WMI_SET_APPIE_CMDID, cmd, len); | 1047 | rc = wmi_send(wil, WMI_SET_APPIE_CMDID, cmd, len); |
1039 | kfree(cmd); | 1048 | kfree(cmd); |
1049 | out: | ||
1050 | if (rc) { | ||
1051 | const char *name = type < ARRAY_SIZE(names) ? | ||
1052 | names[type] : "??"; | ||
1053 | wil_err(wil, "set_ie(%d %s) failed : %d\n", type, name, rc); | ||
1054 | } | ||
1040 | 1055 | ||
1041 | return rc; | 1056 | return rc; |
1042 | } | 1057 | } |