software/drivers/sd8887/src/wlan/mlan/mlan_join.c
/**
  *  @brief Append TSF tracking info from the scan table for the target AP
  *
  *  This function is called from the network join command prep. routine.
  *     The TSF table TSF sent to the firmware contains two TSF values:
  *        - the TSF of the target AP from its previous beacon/probe response
  *        - the TSF timestamp of our local MAC at the time we observed the
  *          beacon/probe response.
  *
  *     The firmware uses the timestamp values to set an initial TSF value
  *        in the MAC for the new association after a reassociation attempt.
  *
  *    @param pmpriv     A pointer to mlan_private structure
  *    @param ppbuffer   A pointer to command buffer pointer
  *    @param pbss_desc  A pointer to the BSS Descriptor from the scan table of
  *                      the AP we are trying to join
  *
  *    @return         bytes added to the buffer
  */
@brief Append TSF tracking info from the scan table for the target AP
This function is called from the network join command prep. routine.
The TSF table TSF sent to the firmware contains two TSF values:
- the TSF of the target AP from its previous beacon/probe response
- the TSF timestamp of our local MAC at the time we observed the
beacon/probe response.

The firmware uses the timestamp values to set an initial TSF value
in the MAC for the new association after a reassociation attempt.

@param pmpriv     A pointer to mlan_private structure
@param ppbuffer   A pointer to command buffer pointer
@param pbss_desc  A pointer to the BSS Descriptor from the scan table of
the AP we are trying to join

@return         bytes added to the buffer
@brief Append TSF tracking info from the scan table for the target AP This function is called from the network join command prep . routine . The TSF table TSF sent to the firmware contains two TSF values : - the TSF of the target AP from its previous beacon / probe response - the TSF timestamp of our local MAC at the time we observed the beacon / probe response . The firmware uses the timestamp values to set an initial TSF value in the MAC for the new association after a reassociation attempt . @param pmpriv A pointer to mlan_private structure @param ppbuffer A pointer to command buffer pointer @param pbss_desc A pointer to the BSS Descriptor from the scan table of the AP we are trying to join @return bytes added to the buffer
static int
wlan_cmd_append_tsf_tlv(mlan_private *pmriv, t_u8 **ppbuffer,
			BSSDescriptor_t *pbss_desc)
{
	MrvlIEtypes_TsfTimestamp_t tsf_tlv;
	t_u64 tsf_val;
	ENTER();
	if (ppbuffer == MNULL) {
		LEAVE();
		return 0;
	}
	if (*ppbuffer == MNULL) {
		LEAVE();
		return 0;
	}
	memset(pmriv->adapter, &tsf_tlv, 0x00,
	       sizeof(MrvlIEtypes_TsfTimestamp_t));
	tsf_tlv.header.type = wlan_cpu_to_le16(TLV_TYPE_TSFTIMESTAMP);
	tsf_tlv.header.len = wlan_cpu_to_le16(2 * sizeof(tsf_val));
	memcpy(pmriv->adapter, *ppbuffer, &tsf_tlv, sizeof(tsf_tlv.header));
	*ppbuffer += sizeof(tsf_tlv.header);
	tsf_val = wlan_cpu_to_le64(pbss_desc->network_tsf);
	memcpy(pmriv->adapter, *ppbuffer, &tsf_val, sizeof(tsf_val));
	*ppbuffer += sizeof(tsf_val);
	memcpy(pmriv->adapter, &tsf_val, pbss_desc->time_stamp,
	       sizeof(tsf_val));
	PRINTM(MINFO, "ASSOC: TSF offset calc: %016llx - %016llx\n",
	       tsf_val, pbss_desc->network_tsf);
	memcpy(pmriv->adapter, *ppbuffer, &tsf_val, sizeof(tsf_val));
	*ppbuffer += sizeof(tsf_val);
	LEAVE();
	return sizeof(tsf_tlv.header) + (2 * sizeof(tsf_val));
}
static int wlan_cmd_append_tsf_tlv ( mlan_private * pmriv , t_u8 * * ppbuffer , BSSDescriptor_t * pbss_desc ) { MrvlIEtypes_TsfTimestamp_t tsf_tlv ; t_u64 tsf_val ; ENTER ( ) ; if ( ppbuffer == MNULL ) { LEAVE ( ) ; return 0 ; } if ( * ppbuffer == MNULL ) { LEAVE ( ) ; return 0 ; } memset ( pmriv -> adapter , & tsf_tlv , 0x00 , sizeof ( MrvlIEtypes_TsfTimestamp_t ) ) ; tsf_tlv . header . type = wlan_cpu_to_le16 ( TLV_TYPE_TSFTIMESTAMP ) ; tsf_tlv . header . len = wlan_cpu_to_le16 ( 2 * sizeof ( tsf_val ) ) ; memcpy ( pmriv -> adapter , * ppbuffer , & tsf_tlv , sizeof ( tsf_tlv . header ) ) ; * ppbuffer += sizeof ( tsf_tlv . header ) ; tsf_val = wlan_cpu_to_le64 ( pbss_desc -> network_tsf ) ; memcpy ( pmriv -> adapter , * ppbuffer , & tsf_val , sizeof ( tsf_val ) ) ; * ppbuffer += sizeof ( tsf_val ) ; memcpy ( pmriv -> adapter , & tsf_val , pbss_desc -> time_stamp , sizeof ( tsf_val ) ) ; PRINTM ( MINFO , " \n " , tsf_val , pbss_desc -> network_tsf ) ; memcpy ( pmriv -> adapter , * ppbuffer , & tsf_val , sizeof ( tsf_val ) ) ; * ppbuffer += sizeof ( tsf_val ) ; LEAVE ( ) ; return sizeof ( tsf_tlv . header ) + ( 2 * sizeof ( tsf_val ) ) ; }
@brief Append TSF tracking info from the scan table for the target AP
  This function is called from the network join command prep.
@brief Append TSF tracking info from the scan table for the target AP This function is called from the network join command prep .
/* Null Checks */ /* TSF timestamp from the firmware TSF when the bcn/prb rsp was received */