@ -862,6 +862,74 @@ static void ipa3_get_pcie_ep_info(
}
}
static void ipa3_get_eth_ep_info (
struct ipa_ioc_get_ep_info * ep_info ,
struct ipa_ep_pair_info * pair_info
)
{
int ep_index = - 1 , i ;
ep_info - > num_ep_pairs = 0 ;
for ( i = 0 ; i < ep_info - > max_ep_pairs ; i + + ) {
pair_info [ i ] . consumer_pipe_num = - 1 ;
pair_info [ i ] . producer_pipe_num = - 1 ;
pair_info [ i ] . ep_id = - 1 ;
}
ep_index = ipa3_get_ep_mapping ( IPA_CLIENT_ETHERNET2_PROD ) ;
if ( ( ep_index ! = - 1 ) & & ipa3_ctx - > ep [ ep_index ] . valid ) {
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num = ep_index ;
ep_index = ipa3_get_ep_mapping ( IPA_CLIENT_ETHERNET2_CONS ) ;
if ( ( ep_index ! = - 1 ) & & ( ipa3_ctx - > ep [ ep_index ] . valid ) ) {
pair_info [ ep_info - > num_ep_pairs ] . producer_pipe_num =
ep_index ;
pair_info [ ep_info - > num_ep_pairs ] . ep_id =
IPA_ETH1_EP_ID ;
IPADBG ( " ep_pair_info consumer_pipe_num %d " ,
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num ) ;
IPADBG ( " producer_pipe_num %d ep_id %d \n " ,
pair_info [ ep_info - > num_ep_pairs ] . producer_pipe_num ,
pair_info [ ep_info - > num_ep_pairs ] . ep_id ) ;
ep_info - > num_ep_pairs + + ;
} else {
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num = - 1 ;
IPADBG ( " ep_pair_info consumer_pipe_num %d " ,
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num ) ;
IPADBG ( " producer_pipe_num %d ep_id %d \n " ,
pair_info [ ep_info - > num_ep_pairs ] . producer_pipe_num ,
pair_info [ ep_info - > num_ep_pairs ] . ep_id ) ;
}
}
ep_index = ipa3_get_ep_mapping ( IPA_CLIENT_ETHERNET_PROD ) ;
if ( ( ep_index ! = - 1 ) & & ipa3_ctx - > ep [ ep_index ] . valid ) {
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num = ep_index ;
ep_index = ipa3_get_ep_mapping ( IPA_CLIENT_ETHERNET_CONS ) ;
if ( ( ep_index ! = - 1 ) & & ( ipa3_ctx - > ep [ ep_index ] . valid ) ) {
pair_info [ ep_info - > num_ep_pairs ] . producer_pipe_num =
ep_index ;
pair_info [ ep_info - > num_ep_pairs ] . ep_id =
IPA_ETH0_EP_ID ;
IPADBG ( " ep_pair_info consumer_pipe_num %d " ,
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num ) ;
IPADBG ( " producer_pipe_num %d ep_id %d \n " ,
pair_info [ ep_info - > num_ep_pairs ] . producer_pipe_num ,
pair_info [ ep_info - > num_ep_pairs ] . ep_id ) ;
ep_info - > num_ep_pairs + + ;
} else {
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num = - 1 ;
IPADBG ( " ep_pair_info consumer_pipe_num %d " ,
pair_info [ ep_info - > num_ep_pairs ] . consumer_pipe_num ) ;
IPADBG ( " producer_pipe_num %d ep_id %d \n " ,
pair_info [ ep_info - > num_ep_pairs ] . producer_pipe_num ,
pair_info [ ep_info - > num_ep_pairs ] . ep_id ) ;
}
}
}
static int ipa3_get_ep_info ( struct ipa_ioc_get_ep_info * ep_info ,
u8 * param )
@ -878,6 +946,10 @@ static int ipa3_get_ep_info(struct ipa_ioc_get_ep_info *ep_info,
ipa3_get_pcie_ep_info ( ep_info , pair_info ) ;
break ;
case IPA_DATA_EP_TYP_ETH :
ipa3_get_eth_ep_info ( ep_info , pair_info ) ;
break ;
default :
IPAERR_RL ( " Undefined ep_type %d \n " , ep_info - > ep_type ) ;
ret = - EFAULT ;