|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
|
|
*
|
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
@@ -27,7 +27,7 @@
|
|
|
#include <wlan_objmgr_global_obj.h>
|
|
|
#include <wlan_cmn.h>
|
|
|
#include <wlan_objmgr_vdev_obj.h>
|
|
|
-
|
|
|
+#include <wlan_objmgr_peer_obj.h>
|
|
|
|
|
|
#define mlme_fatal(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_MLME, params)
|
|
|
#define mlme_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MLME, params)
|
|
@@ -43,6 +43,14 @@ struct wlan_mlme_psoc_obj {
|
|
|
struct wlan_mlme_cfg cfg;
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * struct peer_mlme_priv_obj - peer MLME component object
|
|
|
+ * @ucast_key_cipher: unicast crypto type.
|
|
|
+ */
|
|
|
+struct peer_mlme_priv_obj {
|
|
|
+ uint32_t ucast_key_cipher;
|
|
|
+};
|
|
|
+
|
|
|
#ifdef CONFIG_VDEV_SM
|
|
|
|
|
|
/**
|
|
@@ -119,6 +127,89 @@ mlme_vdev_object_destroyed_notification(struct wlan_objmgr_vdev *vdev,
|
|
|
|
|
|
#endif
|
|
|
|
|
|
+/**
|
|
|
+ * wlan_peer_set_unicast_cipher() - set unicast cipher
|
|
|
+ * @peer: PEER object
|
|
|
+ * @value: value to be set
|
|
|
+ *
|
|
|
+ * Return: void
|
|
|
+ */
|
|
|
+static inline
|
|
|
+void wlan_peer_set_unicast_cipher(struct wlan_objmgr_peer *peer, uint32_t value)
|
|
|
+{
|
|
|
+ struct peer_mlme_priv_obj *peer_priv;
|
|
|
+
|
|
|
+ peer_priv = wlan_objmgr_peer_get_comp_private_obj(peer,
|
|
|
+ WLAN_UMAC_COMP_MLME);
|
|
|
+ if (!peer_priv) {
|
|
|
+ mlme_err(" peer mlme component object is NULL");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ peer_priv->ucast_key_cipher = value;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_peer_get_unicast_cipher() - get unicast cipher
|
|
|
+ * @peer: PEER object
|
|
|
+ *
|
|
|
+ * Return: ucast_key_cipher value
|
|
|
+ */
|
|
|
+static inline
|
|
|
+uint32_t wlan_peer_get_unicast_cipher(struct wlan_objmgr_peer *peer)
|
|
|
+{
|
|
|
+ struct peer_mlme_priv_obj *peer_priv;
|
|
|
+
|
|
|
+ peer_priv = wlan_objmgr_peer_get_comp_private_obj(peer,
|
|
|
+ WLAN_UMAC_COMP_MLME);
|
|
|
+ if (!peer_priv) {
|
|
|
+ mlme_err("peer mlme component object is NULL");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ return peer_priv->ucast_key_cipher;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * wma_get_peer_mic_len() - get mic hdr len and mic length for peer
|
|
|
+ * @psoc: psoc
|
|
|
+ * @pdev_id: pdev id for the peer
|
|
|
+ * @peer_mac: peer mac
|
|
|
+ * @mic_len: mic length for peer
|
|
|
+ * @mic_hdr_len: mic header length for peer
|
|
|
+ *
|
|
|
+ * Return: Success or Failure status
|
|
|
+ */
|
|
|
+QDF_STATUS mlme_get_peer_mic_len(struct wlan_objmgr_psoc *psoc, uint8_t pdev_id,
|
|
|
+ uint8_t *peer_mac, uint8_t *mic_len,
|
|
|
+ uint8_t *mic_hdr_len);
|
|
|
+
|
|
|
+/**
|
|
|
+ * mlme_peer_object_created_notification(): mlme peer create handler
|
|
|
+ * @peer: peer which is going to created by objmgr
|
|
|
+ * @arg: argument for vdev create handler
|
|
|
+ *
|
|
|
+ * Register this api with objmgr to detect peer is created
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS status in case of success else return error
|
|
|
+ */
|
|
|
+
|
|
|
+QDF_STATUS
|
|
|
+mlme_peer_object_created_notification(struct wlan_objmgr_peer *peer,
|
|
|
+ void *arg);
|
|
|
+
|
|
|
+/**
|
|
|
+ * mlme_peer_object_destroyed_notification(): mlme peer delete handler
|
|
|
+ * @peer: peer which is going to delete by objmgr
|
|
|
+ * @arg: argument for vdev delete handler
|
|
|
+ *
|
|
|
+ * Register this api with objmgr to detect peer is deleted
|
|
|
+ *
|
|
|
+ * Return: QDF_STATUS status in case of success else return error
|
|
|
+ */
|
|
|
+QDF_STATUS
|
|
|
+mlme_peer_object_destroyed_notification(struct wlan_objmgr_peer *peer,
|
|
|
+ void *arg);
|
|
|
+
|
|
|
/**
|
|
|
* mlme_get_dynamic_vdev_config() - get the vdev dynamic config params
|
|
|
* @vdev: vdev pointer
|