@@ -848,6 +848,7 @@ struct ath10k {
unsigned int filter_flags;
unsigned long dev_flags;
bool dfs_block_radar_events;
+ int install_key_rv; /* Store error code from key-install */
/* protected by conf_mutex */
bool radar_enabled;
@@ -702,8 +702,9 @@ enum htt_security_types {
};
enum htt_security_flags {
-#define HTT_SECURITY_TYPE_MASK 0x7F
+#define HTT_SECURITY_TYPE_MASK 0x3F
#define HTT_SECURITY_TYPE_LSB 0
+ HTT_SECURITY_IS_FAILURE = 1 << 6, /* CT firmware only */
HTT_SECURITY_IS_UNICAST = 1 << 7
};
@@ -712,7 +713,9 @@ struct htt_security_indication {
/* dont use bitfields; undefined behaviour */
u8 flags; /* %htt_security_flags */
struct {
- u8 security_type:7, /* %htt_security_types */
+ u8 security_type:6, /* %htt_security_types */
+ is_failure:1, /* does this response indicate failure
+ (CT Firmware) */
is_unicast:1;
} __packed;
} __packed;
@@ -2307,9 +2307,23 @@ bool ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
ath10k_dbg(ar, ATH10K_DBG_HTT,
"sec ind peer_id %d unicast %d type %d\n",
- __le16_to_cpu(ev->peer_id),
- !!(ev->flags & HTT_SECURITY_IS_UNICAST),
- MS(ev->flags, HTT_SECURITY_TYPE));
+ __le16_to_cpu(ev->peer_id),
+ !!(ev->flags & HTT_SECURITY_IS_UNICAST),
+ MS(ev->flags, HTT_SECURITY_TYPE));
+
+ /* CT firmware adds way to determine failure of key set, without
+ * just timing things out. Indication of failure is determined
+ * by the 6th bit of the security-type being set.
+ */
+ if (ev->flags & HTT_SECURITY_IS_FAILURE) {
+ ath10k_warn(ar, "Firmware failed to set security key, peer_id: %d unicast %d type %d\n",
+ __le16_to_cpu(ev->peer_id),
+ !!(ev->flags & HTT_SECURITY_IS_UNICAST),
+ MS(ev->flags, HTT_SECURITY_TYPE));
+ ar->install_key_rv = -EINVAL;
+ } else {
+ ar->install_key_rv = 0;
+ }
complete(&ar->install_key_done);
break;
}
@@ -255,7 +255,8 @@ static int ath10k_install_key(struct ath10k_vif *arvif,
if (time_left == 0)
return -ETIMEDOUT;
- return 0;
+ ret = ar->install_key_rv;
+ return ret;
}
static int ath10k_install_peer_wep_keys(struct ath10k_vif *arvif,