@ -522,12 +522,12 @@ void mei_cl_init(struct mei_cl *priv, struct mei_device *dev)
priv - > dev = dev ;
}
int mei_find_me_client_index ( const struct mei_device * dev , uuid_le cuuid )
int mei_me_cl_by_uuid ( const struct mei_device * dev , const uuid_le * cuuid )
{
int i , res = - 1 ;
int i , res = - ENOENT ;
for ( i = 0 ; i < dev - > me_clients_num ; + + i )
if ( uuid_le_cmp ( cuuid ,
if ( uuid_le_cmp ( * cuuid ,
dev - > me_clients [ i ] . props . protocol_name ) = = 0 ) {
res = i ;
break ;
@ -538,35 +538,35 @@ int mei_find_me_client_index(const struct mei_device *dev, uuid_le cuuid)
/**
* mei_find_ me_client _update_filext - searches for ME client guid
* mei_me_cl_update_filext - searches for ME client guid
* sets client_id in mei_file_private if found
* @ dev : the device structure
* @ priv : private file structure to set client_id in
* @ cguid : searched g uid of ME client
* @ cl : private file structure to set client_id in
* @ cuuid : searched u uid of ME client
* @ client_id : id of host client to be set in file private structure
*
* returns ME client index
*/
u8 mei_find_me_client _update_filext( struct mei_device * dev , struct mei_cl * priv ,
const uuid_le * cg uid , u8 client _id )
int mei_me_cl _update_filext( struct mei_device * dev , struct mei_cl * cl ,
const uuid_le * cu uid , u8 host_ cl_id)
{
int i ;
if ( ! dev | | ! priv | | ! cg uid)
return 0 ;
if ( ! dev | | ! cl | | ! cu uid)
return - EINVAL ;
/* check for valid client id */
i = mei_find_me_client_index ( dev , * cg uid ) ;
i = mei_me_cl_by_uuid ( dev , cu uid ) ;
if ( i > = 0 ) {
priv - > me_client_id = dev - > me_clients [ i ] . client_id ;
priv - > state = MEI_FILE_CONNECTING ;
priv - > host_client_id = client _id ;
cl - > me_client_id = dev - > me_clients [ i ] . client_id ;
cl - > state = MEI_FILE_CONNECTING ;
cl - > host_client_id = host_ cl_id;
list_add_tail ( & priv - > link , & dev - > file_list ) ;
list_add_tail ( & cl - > link , & dev - > file_list ) ;
return ( u8 ) i ;
}
return 0 ;
return - ENOENT ;
}
/**
@ -577,16 +577,16 @@ u8 mei_find_me_client_update_filext(struct mei_device *dev, struct mei_cl *priv,
*/
void mei_host_init_iamthif ( struct mei_device * dev )
{
u8 i ;
int i ;
unsigned char * msg_buf ;
mei_cl_init ( & dev - > iamthif_cl , dev ) ;
dev - > iamthif_cl . state = MEI_FILE_DISCONNECTED ;
/* find ME amthi client */
i = mei_find_ me_client _update_filext ( dev , & dev - > iamthif_cl ,
i = mei_me_cl_update_filext ( dev , & dev - > iamthif_cl ,
& mei_amthi_guid , MEI_IAMTHIF_HOST_CLIENT_ID ) ;
if ( dev - > iamthif_cl . state ! = MEI_FILE_CONNECTING ) {
if ( i < 0 ) {
dev_dbg ( & dev - > pdev - > dev , " failed to find iamthif client. \n " ) ;
return ;
}