qcacmn: Add CDP APIs to get security type from peer handler

Add CDP API to get security type for ucast and mcast from
peer handler. Add additional peer handler argument for raw mode
rx decap functions. The peer handler is needed in the raw mode
functions for getting the security type of the frame and process
it accordingly.

Change-Id: I8b4728e9eb0ff29849805bb461c81e4fc3accc81
This commit is contained in:
c_cgodav
2017-06-07 12:31:40 +05:30
committed by snandini
parent a6e0694098
commit bd5b3c2c9b
7 changed files with 49 additions and 13 deletions

View File

@@ -36,6 +36,7 @@
#ifndef CONFIG_WIN
#include <cdp_txrx_mob_def.h>
#endif /* CONFIG_WIN */
#include <cdp_txrx_handle.h>
#ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
#define OL_TXRX_NUM_LOCAL_PEER_IDS 33 /* default */
@@ -310,10 +311,12 @@ typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
* @osif_dev - the virtual device's OS shim object
* @list_head - poniter to head of receive packet queue to decap
* @list_tail - poniter to tail of receive packet queue to decap
* @peer - Peer handler
*/
typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
qdf_nbuf_t *list_head,
qdf_nbuf_t *list_tail);
qdf_nbuf_t *list_tail,
struct cdp_peer *peer);
/* ol_txrx_rx_fp - external tx free function to read per packet stats and
* free tx buffer externally

View File

@@ -236,7 +236,7 @@ cdp_get_pdev_reo_dest(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
*/
static inline void
cdp_peer_authorize(ol_txrx_soc_handle soc,
struct ol_txrx_peer_t *peer, u_int32_t authorize)
struct cdp_peer *peer, u_int32_t authorize)
{
if (soc->ops->ctrl_ops->txrx_peer_authorize)
return soc->ops->ctrl_ops->txrx_peer_authorize
@@ -381,7 +381,7 @@ static inline void cdp_txrx_set_vdev_param(ol_txrx_soc_handle soc,
static inline void
cdp_peer_set_nawds(ol_txrx_soc_handle soc,
struct ol_txrx_peer_t *peer, uint8_t value)
struct cdp_peer *peer, uint8_t value)
{
if (soc->ops->ctrl_ops->txrx_peer_set_nawds)
return soc->ops->ctrl_ops->txrx_peer_set_nawds
@@ -450,4 +450,32 @@ cdp_wdi_event_unsub(ol_txrx_soc_handle soc,
(pdev, event_cb_sub, event);
return 0;
}
/**
* @brief Get security type from the from peer.
* @details
* This function gets the Security information from the peer handler.
* The security information is got from the rx descriptor and filled in
* to the peer handler.
*
* @param soc - pointer to the soc
* @param peer - peer handler
* @param sec_idx - mcast or ucast frame type.
* @return - int
*/
static inline int
cdp_get_sec_type(ol_txrx_soc_handle soc, struct cdp_peer *peer, uint8_t sec_idx)
{
if (!soc || !soc->ops || !soc->ops->ctrl_ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
"%s invalid instance", __func__);
return A_ERROR;
}
if (soc->ops->ctrl_ops->txrx_get_sec_type)
return soc->ops->ctrl_ops->txrx_get_sec_type
(peer, sec_idx);
return A_ERROR;
}
#endif

View File

@@ -309,7 +309,7 @@ struct cdp_ctrl_ops {
* @return none
*/
void
(*txrx_peer_authorize)(void *peer,
(*txrx_peer_authorize)(struct cdp_peer *peer,
u_int32_t authorize);
bool
@@ -378,7 +378,7 @@ struct cdp_ctrl_ops {
void (*txrx_set_vdev_param)(struct cdp_vdev *vdev,
enum cdp_vdev_param_type param, uint32_t val);
void (*txrx_peer_set_nawds)(void *peer, uint8_t value);
void (*txrx_peer_set_nawds)(struct cdp_peer *peer, uint8_t value);
/**
* @brief Set the reo dest ring num of the radio
* @details
@@ -409,6 +409,7 @@ struct cdp_ctrl_ops {
int (*txrx_wdi_event_unsub)(struct cdp_pdev *pdev, void *event_cb_sub,
uint32_t event);
int (*txrx_get_sec_type)(struct cdp_peer *peer, uint8_t sec_idx);
};
struct cdp_me_ops {

View File

@@ -2223,7 +2223,7 @@ fail0:
* @authorize
*
*/
static void dp_peer_authorize(void *peer_handle, uint32_t authorize)
static void dp_peer_authorize(struct cdp_peer *peer_handle, uint32_t authorize)
{
struct dp_peer *peer = (struct dp_peer *)peer_handle;
struct dp_soc *soc;
@@ -3592,7 +3592,7 @@ static void dp_set_vdev_param(struct cdp_vdev *vdev_handle,
*
* return: void
*/
static void dp_peer_set_nawds(void *peer_handle, uint8_t value)
static void dp_peer_set_nawds(struct cdp_peer *peer_handle, uint8_t value)
{
struct dp_peer *peer = (struct dp_peer *)peer_handle;
peer->nawds_enabled = value;

View File

@@ -214,11 +214,13 @@ QDF_STATUS dp_rx_buffers_replenish(struct dp_soc *dp_soc, uint32_t mac_id,
*
* @vdev: vdev on which RAW mode is enabled
* @nbuf_list: list of RAW pkts to process
* @peer: peer object from which the pkt is rx
*
* Return: void
*/
void
dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list)
dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list,
struct cdp_peer *peer)
{
qdf_nbuf_t deliver_list_head = NULL;
qdf_nbuf_t deliver_list_tail = NULL;
@@ -246,7 +248,7 @@ dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list)
}
vdev->osif_rsim_rx_decap(vdev->osif_vdev, &deliver_list_head,
&deliver_list_tail);
&deliver_list_tail, peer);
vdev->osif_rx(vdev->osif_vdev, deliver_list_head);
}
@@ -1305,8 +1307,9 @@ done:
}
if (qdf_unlikely(vdev->rx_decap_type == htt_cmn_pkt_type_raw) ||
(vdev->rx_decap_type == htt_cmn_pkt_type_native_wifi))
dp_rx_deliver_raw(vdev, deliver_list_head);
(vdev->rx_decap_type == htt_cmn_pkt_type_native_wifi))
dp_rx_deliver_raw(vdev, deliver_list_head,
(struct cdp_peer *) peer);
else if (qdf_likely(vdev->osif_rx) && deliver_list_head)
vdev->osif_rx(vdev->osif_vdev, deliver_list_head);
}

View File

@@ -304,7 +304,8 @@ void dp_rx_desc_pool_free(struct dp_soc *soc,
uint32_t pool_id,
struct rx_desc_pool *rx_desc_pool);
void dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list);
void dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list,
struct cdp_peer *peer);
/**
* dp_rx_add_to_free_desc_list() - Adds to a local free descriptor list

View File

@@ -393,7 +393,7 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, struct dp_rx_desc *rx_desc,
if (qdf_unlikely(vdev->rx_decap_type == htt_cmn_pkt_type_raw)) {
qdf_nbuf_set_next(nbuf, NULL);
dp_rx_deliver_raw(vdev, nbuf);
dp_rx_deliver_raw(vdev, nbuf, (struct cdp_peer *) peer);
} else {
if (qdf_unlikely(peer->bss_peer)) {
QDF_TRACE(QDF_MODULE_ID_DP,