@ -393,8 +393,8 @@ static enum ipa_client_cb_type ipa_get_client_cb_type(
return client_cb ;
}
void ipa3_register_lock_unlock _callback ( int ( * client_cb ) ( bool is_lock ) ,
u32 ipa_ep_idx )
void ipa3_register_client _callback ( int ( * client_cb ) ( bool is_lock ) ,
bool ( * teth_port_state ) ( void ) , u32 ipa_ep_idx )
{
enum ipa_client_cb_type client ;
enum ipa_client_type client_type ;
@ -413,10 +413,12 @@ void ipa3_register_lock_unlock_callback(int (*client_cb)(bool is_lock),
if ( ! ipa3_ctx - > client_lock_unlock [ client ] )
ipa3_ctx - > client_lock_unlock [ client ] = client_cb ;
if ( ! ipa3_ctx - > get_teth_port_state [ client ] )
ipa3_ctx - > get_teth_port_state [ client ] = teth_port_state ;
IPADBG ( " exit \n " ) ;
}
void ipa3_deregister_lock_unlock _callback ( u32 ipa_ep_idx )
void ipa3_deregister_client _callback ( u32 ipa_ep_idx )
{
enum ipa_client_cb_type client_cb ;
enum ipa_client_type client_type ;
@ -428,12 +430,14 @@ void ipa3_deregister_lock_unlock_callback(u32 ipa_ep_idx)
if ( client_cb = = IPA_MAX_CLNT )
return ;
if ( ipa3_ctx - > client_lock_unlock [ client_cb ] = = NULL ) {
if ( ipa3_ctx - > client_lock_unlock [ client_cb ] = = NULL & &
ipa3_ctx - > get_teth_port_state [ client_cb ] = = NULL ) {
IPAERR ( " client_lock_unlock is already NULL " ) ;
return ;
}
ipa3_ctx - > client_lock_unlock [ client_cb ] = NULL ;
ipa3_ctx - > get_teth_port_state [ client_cb ] = NULL ;
IPADBG ( " exit \n " ) ;
}
@ -1142,6 +1146,18 @@ int ipa3_set_reset_client_prod_pipe_delay(bool set_reset,
return result ;
}
static bool ipa3_get_teth_port_status ( enum ipa_client_type client )
{
enum ipa_client_cb_type client_cb ;
client_cb = ipa_get_client_cb_type ( client ) ;
if ( client_cb = = IPA_MAX_CLNT )
return false ;
if ( ipa3_ctx - > get_teth_port_state [ client_cb ] )
return ipa3_ctx - > get_teth_port_state [ client_cb ] ( ) ;
return false ;
}
/*
* Start / stop the CLIENT PROD pipes in SSR scenarios
*/
@ -1167,10 +1183,12 @@ int ipa3_start_stop_client_prod_gsi_chnl(enum ipa_client_type client,
client_lock_unlock_cb ( client , true ) ;
ep = & ipa3_ctx - > ep [ pipe_idx ] ;
if ( start_chnl )
result = ipa3_start_gsi_channel ( pipe_idx ) ;
else
result = ipa3_stop_gsi_channel ( pipe_idx ) ;
if ( ep - > valid & & ep - > skip_ep_cfg & & ipa3_get_teth_port_status ( client ) ) {
if ( start_chnl )
result = ipa3_start_gsi_channel ( pipe_idx ) ;
else
result = ipa3_stop_gsi_channel ( pipe_idx ) ;
}
client_lock_unlock_cb ( client , false ) ;
return result ;
}