|
@@ -708,6 +708,42 @@ uint8_t wlan_crypto_is_htallowed(struct wlan_objmgr_vdev *vdev,
|
|
}
|
|
}
|
|
qdf_export_symbol(wlan_crypto_is_htallowed);
|
|
qdf_export_symbol(wlan_crypto_is_htallowed);
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * wlan_crypto_store_def_keyix - store default keyix
|
|
|
|
+ * @vdev: vdev
|
|
|
|
+ * @object: Peer object
|
|
|
|
+ * @arg: Argument passed by caller
|
|
|
|
+ *
|
|
|
|
+ * This function gets called from wlan_crypto_setkey
|
|
|
|
+ *
|
|
|
|
+ * Return: None
|
|
|
|
+ */
|
|
|
|
+static void wlan_crypto_store_def_keyix(struct wlan_objmgr_vdev *vdev,
|
|
|
|
+ void *object, void *arg)
|
|
|
|
+{
|
|
|
|
+ struct wlan_objmgr_peer *peer = object;
|
|
|
|
+ struct wlan_crypto_comp_priv *crypto_priv;
|
|
|
|
+ struct wlan_crypto_params *crypto_params;
|
|
|
|
+
|
|
|
|
+ uint16_t kid = *(uint16_t *)arg;
|
|
|
|
+
|
|
|
|
+ crypto_params = wlan_crypto_peer_get_comp_params(peer, &crypto_priv);
|
|
|
|
+ if (!crypto_priv) {
|
|
|
|
+ crypto_err("crypto_priv NULL");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ crypto_priv->def_tx_keyid = kid;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * wlan_crypto_setkey - called by ucfg to setkey
|
|
|
|
+ * @vdev: vdev
|
|
|
|
+ * @req_key: req_key with cipher type, key macaddress
|
|
|
|
+ *
|
|
|
|
+ * This function gets called from ucfg to sey key
|
|
|
|
+ *
|
|
|
|
+ * Return: QDF_STATUS_SUCCESS - in case of success
|
|
|
|
+ */
|
|
QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
|
|
QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
|
|
struct wlan_crypto_req_key *req_key)
|
|
struct wlan_crypto_req_key *req_key)
|
|
{
|
|
{
|
|
@@ -1073,7 +1109,8 @@ QDF_STATUS wlan_crypto_setkey(struct wlan_objmgr_vdev *vdev,
|
|
/*Iterate through the peer list on this vdev
|
|
/*Iterate through the peer list on this vdev
|
|
*and store the keyix in the peer's crypto_priv
|
|
*and store the keyix in the peer's crypto_priv
|
|
*/
|
|
*/
|
|
- wlan_objmgr_iterate_peerobj_list(vdev, store_def_keyix_peer,
|
|
|
|
|
|
+ wlan_objmgr_iterate_peerobj_list(vdev,
|
|
|
|
+ wlan_crypto_store_def_keyix,
|
|
(void *)&req_key->keyix,
|
|
(void *)&req_key->keyix,
|
|
WLAN_CRYPTO_ID);
|
|
WLAN_CRYPTO_ID);
|
|
|
|
|
|
@@ -1084,26 +1121,14 @@ err:
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
|
|
|
|
-void store_def_keyix_peer(struct wlan_objmgr_vdev *vdev, void *object,
|
|
|
|
- void *arg)
|
|
|
|
-{
|
|
|
|
- struct wlan_objmgr_peer *peer = NULL;
|
|
|
|
- struct wlan_crypto_comp_priv *crypto_priv;
|
|
|
|
- struct wlan_crypto_params *crypto_params;
|
|
|
|
-
|
|
|
|
- uint16_t kid = *(uint16_t *)arg;
|
|
|
|
-
|
|
|
|
- peer = (struct wlan_objmgr_peer *)object;
|
|
|
|
- crypto_params = wlan_crypto_peer_get_comp_params(peer, &crypto_priv);
|
|
|
|
- if (!crypto_priv) {
|
|
|
|
- crypto_err("crypto_priv NULL");
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- crypto_priv->def_tx_keyid = kid;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-qdf_export_symbol(store_def_keyix_peer);
|
|
|
|
-
|
|
|
|
|
|
+/**
|
|
|
|
+ * wlan_crypto_get_key_type - get keytype
|
|
|
|
+ * @key: key
|
|
|
|
+ *
|
|
|
|
+ * This function gets keytype from key
|
|
|
|
+ *
|
|
|
|
+ * Return: keytype
|
|
|
|
+ */
|
|
wlan_crypto_cipher_type wlan_crypto_get_key_type(struct wlan_crypto_key *key)
|
|
wlan_crypto_cipher_type wlan_crypto_get_key_type(struct wlan_crypto_key *key)
|
|
{
|
|
{
|
|
if (key && key->cipher_table) {
|
|
if (key && key->cipher_table) {
|