software/drivers/sd8887/src/wlan/mlinux/moal_cfg80211.c
/**
 * @brief Functions fills the coalesce rule information
 *
 * @param crule           A pointer to cfg80211_coalesce_rules structure
 * @param mrule           A pointer to coalesce_rules structure
 *
 * @return                0-- success, otherwise fail
 */
@brief Functions fills the coalesce rule information
@param crule           A pointer to cfg80211_coalesce_rules structure
@param mrule           A pointer to coalesce_rules structure

@return                0-- success, otherwise fail
@brief Functions fills the coalesce rule information @param crule A pointer to cfg80211_coalesce_rules structure @param mrule A pointer to coalesce_rules structure @return 0 -- success otherwise fail
static int
woal_fill_coalesce_rule_info(struct cfg80211_coalesce_rules *crule,
			     struct coalesce_rule *mrule)
{
	t_u8 byte_seq[COALESCE_MAX_BYTESEQ + 1];
	struct filt_field_param *param;
	int i;
	mrule->max_coalescing_delay = crule->delay;
	param = mrule->params;
	for (i = 0; i < crule->n_patterns; i++) {
		memset(byte_seq, 0, sizeof(byte_seq));
		if (!woal_is_pattern_supported(&crule->patterns[i],
					       byte_seq,
					       COALESCE_MAX_BYTESEQ)) {
			PRINTM(MERROR, "Pattern not supported\n");
			return -EOPNOTSUPP;
		}
		if (!crule->patterns[i].pkt_offset) {
			u8 pkt_type;
			pkt_type = woal_get_coalesce_pkt_type(byte_seq);
			if (pkt_type && mrule->pkt_type) {
				PRINTM(MERROR,
				       "Multiple packet types not allowed\n");
				return -EOPNOTSUPP;
			} else if (pkt_type) {
				mrule->pkt_type = pkt_type;
				continue;
			}
		}
		if (crule->condition == NL80211_COALESCE_CONDITION_MATCH)
			param->operation = RECV_FILTER_MATCH_TYPE_EQ;
		else
			param->operation = RECV_FILTER_MATCH_TYPE_NE;
		param->operand_len = byte_seq[COALESCE_MAX_BYTESEQ];
		memcpy(param->operand_byte_stream, byte_seq,
		       param->operand_len);
		param->offset = crule->patterns[i].pkt_offset;
		param++;
		mrule->num_of_fields++;
	}
	if (!mrule->pkt_type) {
		PRINTM(MERROR, "Packet type can not be determined\n");
		return -EOPNOTSUPP;
	}
	return 0;
}
static int woal_fill_coalesce_rule_info ( struct cfg80211_coalesce_rules * crule , struct coalesce_rule * mrule ) { t_u8 byte_seq [ COALESCE_MAX_BYTESEQ + 1 ] ; struct filt_field_param * param ; int i ; mrule -> max_coalescing_delay = crule -> delay ; param = mrule -> params ; for ( i = 0 ; i < crule -> n_patterns ; i ++ ) { memset ( byte_seq , 0 , sizeof ( byte_seq ) ) ; if ( ! woal_is_pattern_supported ( & crule -> patterns [ i ] , byte_seq , COALESCE_MAX_BYTESEQ ) ) { PRINTM ( MERROR , " \n " ) ; return - EOPNOTSUPP ; } if ( ! crule -> patterns [ i ] . pkt_offset ) { u8 pkt_type ; pkt_type = woal_get_coalesce_pkt_type ( byte_seq ) ; if ( pkt_type && mrule -> pkt_type ) { PRINTM ( MERROR , " \n " ) ; return - EOPNOTSUPP ; } else if ( pkt_type ) { mrule -> pkt_type = pkt_type ; continue ; } } if ( crule -> condition == NL80211_COALESCE_CONDITION_MATCH ) param -> operation = RECV_FILTER_MATCH_TYPE_EQ ; else param -> operation = RECV_FILTER_MATCH_TYPE_NE ; param -> operand_len = byte_seq [ COALESCE_MAX_BYTESEQ ] ; memcpy ( param -> operand_byte_stream , byte_seq , param -> operand_len ) ; param -> offset = crule -> patterns [ i ] . pkt_offset ; param ++ ; mrule -> num_of_fields ++ ; } if ( ! mrule -> pkt_type ) { PRINTM ( MERROR , " \n " ) ; return - EOPNOTSUPP ; } return 0 ; }
@brief Functions fills the coalesce rule information
 @param crule           A pointer to cfg80211_coalesce_rules structure
 @param mrule           A pointer to coalesce_rules structure
@brief Functions fills the coalesce rule information @param crule A pointer to cfg80211_coalesce_rules structure @param mrule A pointer to coalesce_rules structure