software/drivers/sd8887/src/wlan/mlan/mlan_uap_cmdevent.c
/**
 *  @brief This function will update WAPI PN in statation assoc event
 *
 *  @param priv    A pointer to mlan_private
 *  @param pevent  A pointer to event buf
 *
 *  @return	       MFALSE
 */
@brief This function will update WAPI PN in statation assoc event
@param priv    A pointer to mlan_private
@param pevent  A pointer to event buf

@return            MFALSE
@brief This function will update WAPI PN in statation assoc event @param priv A pointer to mlan_private @param pevent A pointer to event buf @return MFALSE
static t_u32
wlan_update_wapi_info_tlv(pmlan_private priv, pmlan_buffer pevent)
{
	t_u32 ret = MFALSE;
	t_u16 tlv_type, tlv_len;
	t_u32 tx_pn[4];
	t_u32 i = 0;
	int tlv_buf_left = pevent->data_len - ASSOC_EVENT_FIX_SIZE;
	MrvlIEtypesHeader_t *tlv = (MrvlIEtypesHeader_t *)
		(pevent->pbuf + pevent->data_offset + ASSOC_EVENT_FIX_SIZE);
	MrvlIEtypes_wapi_info_t *wapi_tlv = MNULL;
	ENTER();
	while (tlv_buf_left >= (int)sizeof(MrvlIEtypesHeader_t)) {
		tlv_type = wlan_le16_to_cpu(tlv->type);
		tlv_len = wlan_le16_to_cpu(tlv->len);
		if ((sizeof(MrvlIEtypesHeader_t) + tlv_len) >
		    (unsigned int)tlv_buf_left) {
			PRINTM(MERROR, "wrong tlv: tlvLen=%d, tlvBufLeft=%d\n",
			       tlv_len, tlv_buf_left);
			break;
		}
		if (tlv_type == TLV_TYPE_AP_WAPI_INFO) {
			wapi_tlv = (MrvlIEtypes_wapi_info_t *)tlv;
			DBG_HEXDUMP(MCMD_D, "Fw:multicast_PN",
				    wapi_tlv->multicast_PN, PN_SIZE);
			memcpy(priv->adapter, (t_u8 *)tx_pn,
			       wapi_tlv->multicast_PN, PN_SIZE);
			for (i = 0; i < 4; i++)
				tx_pn[i] = mlan_ntohl(tx_pn[i]);
			memcpy(priv->adapter, wapi_tlv->multicast_PN,
			       (t_u8 *)tx_pn, PN_SIZE);
			DBG_HEXDUMP(MCMD_D, "Host:multicast_PN",
				    wapi_tlv->multicast_PN, PN_SIZE);
			break;
		}
		tlv_buf_left -= (sizeof(MrvlIEtypesHeader_t) + tlv_len);
		tlv = (MrvlIEtypesHeader_t *)((t_u8 *)tlv + tlv_len +
					      sizeof(MrvlIEtypesHeader_t));
	}
	LEAVE();
	return ret;
}
static t_u32 wlan_update_wapi_info_tlv ( pmlan_private priv , pmlan_buffer pevent ) { t_u32 ret = MFALSE ; t_u16 tlv_type , tlv_len ; t_u32 tx_pn [ 4 ] ; t_u32 i = 0 ; int tlv_buf_left = pevent -> data_len - ASSOC_EVENT_FIX_SIZE ; MrvlIEtypesHeader_t * tlv = ( MrvlIEtypesHeader_t * ) ( pevent -> pbuf + pevent -> data_offset + ASSOC_EVENT_FIX_SIZE ) ; MrvlIEtypes_wapi_info_t * wapi_tlv = MNULL ; ENTER ( ) ; while ( tlv_buf_left >= ( int ) sizeof ( MrvlIEtypesHeader_t ) ) { tlv_type = wlan_le16_to_cpu ( tlv -> type ) ; tlv_len = wlan_le16_to_cpu ( tlv -> len ) ; if ( ( sizeof ( MrvlIEtypesHeader_t ) + tlv_len ) > ( unsigned int ) tlv_buf_left ) { PRINTM ( MERROR , " \n " , tlv_len , tlv_buf_left ) ; break ; } if ( tlv_type == TLV_TYPE_AP_WAPI_INFO ) { wapi_tlv = ( MrvlIEtypes_wapi_info_t * ) tlv ; DBG_HEXDUMP ( MCMD_D , " " , wapi_tlv -> multicast_PN , PN_SIZE ) ; memcpy ( priv -> adapter , ( t_u8 * ) tx_pn , wapi_tlv -> multicast_PN , PN_SIZE ) ; for ( i = 0 ; i < 4 ; i ++ ) tx_pn [ i ] = mlan_ntohl ( tx_pn [ i ] ) ; memcpy ( priv -> adapter , wapi_tlv -> multicast_PN , ( t_u8 * ) tx_pn , PN_SIZE ) ; DBG_HEXDUMP ( MCMD_D , " " , wapi_tlv -> multicast_PN , PN_SIZE ) ; break ; } tlv_buf_left -= ( sizeof ( MrvlIEtypesHeader_t ) + tlv_len ) ; tlv = ( MrvlIEtypesHeader_t * ) ( ( t_u8 * ) tlv + tlv_len + sizeof ( MrvlIEtypesHeader_t ) ) ; } LEAVE ( ) ; return ret ; }
@brief This function will update WAPI PN in statation assoc event
  @param priv    A pointer to mlan_private
  @param pevent  A pointer to event buf
@brief This function will update WAPI PN in statation assoc event @param priv A pointer to mlan_private @param pevent A pointer to event buf