software/drivers/sd8887/src/bluetooth/bt/bt_proc.c
/**
 *  @brief This function handle the generic file close
 *
 *  @param inode   A pointer to inode structure
 *  @param file    A pointer to file structure
 *  @return		N/A
 */
@brief This function handle the generic file close
@param inode   A pointer to inode structure
@param file    A pointer to file structure
@return             N/A
@brief This function handle the generic file close @param inode A pointer to inode structure @param file A pointer to file structure @return N / A
static void
proc_on_close(struct inode *inode, struct file *file)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
	struct proc_private_data *priv = PDE_DATA(inode);
#else
	struct proc_private_data *priv = PDE(inode)->data;
#endif
	struct proc_data *pdata = file->private_data;
	char *line;
	int i;
	ENTER();
	if (!pdata->wrlen)
		return;
	line = pdata->wrbuf;
	while (line[0]) {
		for (i = 0; i < priv->num_items; i++) {
			if (!strncmp
			    (line, priv->pdata[i].name,
			     strlen(priv->pdata[i].name))) {
				line += strlen(priv->pdata[i].name) + 1;
				if (priv->pdata[i].size == 1)
					*((u8 *)priv->pdata[i].addr) =
						(u8)string_to_number(line);
				else if (priv->pdata[i].size == 2)
					*((u16 *) priv->pdata[i].addr) =
						(u16) string_to_number(line);
				else if (priv->pdata[i].size == 4)
					*((u32 *)priv->pdata[i].addr) =
						(u32)string_to_number(line);
			}
		}
		while (line[0] && line[0] != '\n')
			line++;
		if (line[0])
			line++;
	}
	if (priv->pbt->bt_dev.hscmd || priv->pbt->bt_dev.pscmd
	    || priv->pbt->bt_dev.sdio_pull_ctrl
	    || priv->pbt->bt_dev.test_mode || priv->pbt->bt_dev.hscfgcmd) {
		bt_prepare_command(priv->pbt);
		wake_up_interruptible(&priv->pbt->MainThread.waitQ);
	}
	LEAVE();
	return;
}
static void proc_on_close ( struct inode * inode , struct file * file ) { #if LINUX_VERSION_CODE >= KERNEL_VERSION ( 3 , 10 , 0 ) struct proc_private_data * priv = PDE_DATA ( inode ) ; #else struct proc_private_data * priv = PDE ( inode ) -> data ; #endif struct proc_data * pdata = file -> private_data ; char * line ; int i ; ENTER ( ) ; if ( ! pdata -> wrlen ) return ; line = pdata -> wrbuf ; while ( line [ 0 ] ) { for ( i = 0 ; i < priv -> num_items ; i ++ ) { if ( ! strncmp ( line , priv -> pdata [ i ] . name , strlen ( priv -> pdata [ i ] . name ) ) ) { line += strlen ( priv -> pdata [ i ] . name ) + 1 ; if ( priv -> pdata [ i ] . size == 1 ) * ( ( u8 * ) priv -> pdata [ i ] . addr ) = ( u8 ) string_to_number ( line ) ; else if ( priv -> pdata [ i ] . size == 2 ) * ( ( u16 * ) priv -> pdata [ i ] . addr ) = ( u16 ) string_to_number ( line ) ; else if ( priv -> pdata [ i ] . size == 4 ) * ( ( u32 * ) priv -> pdata [ i ] . addr ) = ( u32 ) string_to_number ( line ) ; } } while ( line [ 0 ] && line [ 0 ] != ' \n ' ) line ++ ; if ( line [ 0 ] ) line ++ ; } if ( priv -> pbt -> bt_dev . hscmd || priv -> pbt -> bt_dev . pscmd || priv -> pbt -> bt_dev . sdio_pull_ctrl || priv -> pbt -> bt_dev . test_mode || priv -> pbt -> bt_dev . hscfgcmd ) { bt_prepare_command ( priv -> pbt ) ; wake_up_interruptible ( & priv -> pbt -> MainThread . waitQ ) ; } LEAVE ( ) ; return ; }
@brief This function handle the generic file close
  @param inode   A pointer to inode structure
  @param file    A pointer to file structure
  @return             N/A
@brief This function handle the generic file close @param inode A pointer to inode structure @param file A pointer to file structure @return N / A