software/drivers/sd8887/src/wlan/mlinux/moal_cfg80211.c
/**
 * @brief Give the data necessary for GTK rekeying to the driver
 *
 * @param wiphy         A pointer to wiphy structure
 * @param dev           A pointer to net_device structure
 * @param data        A pointer to cfg80211_gtk_rekey_data structure
 *
 * @return              0 -- success, otherwise fail
 */
@brief Give the data necessary for GTK rekeying to the driver
@param wiphy         A pointer to wiphy structure
@param dev           A pointer to net_device structure
@param data        A pointer to cfg80211_gtk_rekey_data structure

@return              0 -- success, otherwise fail
@brief Give the data necessary for GTK rekeying to the driver @param wiphy A pointer to wiphy structure @param dev A pointer to net_device structure @param data A pointer to cfg80211_gtk_rekey_data structure @return 0 -- success otherwise fail
int
woal_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev,
			     struct cfg80211_gtk_rekey_data *data)
{
	int ret = 0;
	moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
	mlan_ds_misc_gtk_rekey_data rekey;
	mlan_fw_info fw_info;
	ENTER();
	if (gtk_rekey_offload == GTK_REKEY_OFFLOAD_DISABLE) {
		PRINTM(MMSG,
		       "woal_cfg80211_set_rekey_data return: gtk_rekey_offload is DISABLE\n");
		LEAVE();
		return ret;
	}
	woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info);
	if (!fw_info.fw_supplicant_support) {
		LEAVE();
		return -1;
	}
	memcpy(rekey.kek, data->kek, MLAN_KEK_LEN);
	memcpy(rekey.kck, data->kck, MLAN_KCK_LEN);
	memcpy(rekey.replay_ctr, data->replay_ctr, MLAN_REPLAY_CTR_LEN);
	memcpy(&priv->gtk_rekey_data, &rekey,
	       sizeof(mlan_ds_misc_gtk_rekey_data));
	if (gtk_rekey_offload == GTK_REKEY_OFFLOAD_SUSPEND) {
		priv->gtk_data_ready = MTRUE;
		LEAVE();
		return ret;
	}
	if (MLAN_STATUS_SUCCESS !=
	    woal_set_rekey_data(priv, &rekey, MLAN_ACT_SET, MOAL_IOCTL_WAIT)) {
		ret = -EFAULT;
	}
	LEAVE();
	return ret;
}
int woal_cfg80211_set_rekey_data ( struct wiphy * wiphy , struct net_device * dev , struct cfg80211_gtk_rekey_data * data ) { int ret = 0 ; moal_private * priv = ( moal_private * ) woal_get_netdev_priv ( dev ) ; mlan_ds_misc_gtk_rekey_data rekey ; mlan_fw_info fw_info ; ENTER ( ) ; if ( gtk_rekey_offload == GTK_REKEY_OFFLOAD_DISABLE ) { PRINTM ( MMSG , " \n " ) ; LEAVE ( ) ; return ret ; } woal_request_get_fw_info ( priv , MOAL_IOCTL_WAIT , & fw_info ) ; if ( ! fw_info . fw_supplicant_support ) { LEAVE ( ) ; return -1 ; } memcpy ( rekey . kek , data -> kek , MLAN_KEK_LEN ) ; memcpy ( rekey . kck , data -> kck , MLAN_KCK_LEN ) ; memcpy ( rekey . replay_ctr , data -> replay_ctr , MLAN_REPLAY_CTR_LEN ) ; memcpy ( & priv -> gtk_rekey_data , & rekey , sizeof ( mlan_ds_misc_gtk_rekey_data ) ) ; if ( gtk_rekey_offload == GTK_REKEY_OFFLOAD_SUSPEND ) { priv -> gtk_data_ready = MTRUE ; LEAVE ( ) ; return ret ; } if ( MLAN_STATUS_SUCCESS != woal_set_rekey_data ( priv , & rekey , MLAN_ACT_SET , MOAL_IOCTL_WAIT ) ) { ret = - EFAULT ; } LEAVE ( ) ; return ret ; }
@brief Give the data necessary for GTK rekeying to the driver
 @param wiphy         A pointer to wiphy structure
 @param dev           A pointer to net_device structure
 @param data        A pointer to cfg80211_gtk_rekey_data structure
@brief Give the data necessary for GTK rekeying to the driver @param wiphy A pointer to wiphy structure @param dev A pointer to net_device structure @param data A pointer to cfg80211_gtk_rekey_data structure