当前位置: 首页>>代码示例>>C++>>正文


C++ CCCI_MSG_INF函数代码示例

本文整理汇总了C++中CCCI_MSG_INF函数的典型用法代码示例。如果您正苦于以下问题:C++ CCCI_MSG_INF函数的具体用法?C++ CCCI_MSG_INF怎么用?C++ CCCI_MSG_INF使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CCCI_MSG_INF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: reset_md

int reset_md(void)
{
    CCCI_BUFF_T sys_msg;
	char buf = 1;
	
    CCCI_MSG_INF("ctl", "send reset modem request message\n");

    /* prevent another reset modem action from wdt timeout IRQ during modem reset */
	atomic_inc(&md_reset_on_going);
	if(atomic_read(&md_reset_on_going)>1){
		CCCI_MSG_INF("ctl", "One reset flow is on-going \n");
		return CCCI_MD_IN_RESET;
	}

	if(md_boot_stage == MD_BOOT_STAGE_2){
		lock_md_sleep(&buf, sizeof(char));
	}
	
	/* v1.3 20120601: mask CCIF IRQ to prevent md_boot_stage from updating by CCIF ISR */
    md_boot_stage = MD_BOOT_STAGE_0;
    //ccci_disable();
    ccci_mask();
    //CCCI_INIT_MAILBOX(&sys_msg, CCCI_SYS_MSG_RESET_MD);
    wake_lock_timeout(&trm_wake_lock, 10*HZ);
    CCCI_INIT_MAILBOX(&sys_msg, CCCI_MD_MSG_RESET);
    ccci_system_message(&sys_msg);

  //  CCCI_DEBUG("wait.....\n");
 //   schedule_timeout_interruptible(5*HZ);
 //  boot_md();
    return CCCI_SUCCESS;
}
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:32,代码来源:ccci_md_main.c

示例2: ready2boot

static int ready2boot(void)
{
    int addr, len;

    ccci_uart_base_req(0, &addr, &len);
    if (addr == 0 || len == 0) {
        CCCI_MSG_INF("ctl", "UART base address is not setup\n");
        return 0;
    }

    ccci_fs_base_req(&addr, &len);
    if (addr == 0 || len == 0) {
        CCCI_MSG_INF("ctl", "CCCI_FS base address is not setup\n");
        return 0;
    }

    ccci_pmic_base_req(&addr, &len);
    if (addr == 0 || len == 0) {
        CCCI_MSG_INF("ctl", "PMIC base address is not setup\n");
        return 0;
    }
	
    ccci_ipc_base_req(&addr, &len);
    if (addr == 0 || len == 0) {
        CCCI_MSG_INF("ctl", "CCCI_IPC base address is not setup\n");
        return 0;
    }

   if (platform_ready2boot())
   	return 0;

    return 1;
}
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:33,代码来源:ccci_md_main.c

示例3: get_logic_ch_data

int get_logic_ch_data(logic_channel_info_t *ch_info, ccci_msg_t *msg)
{
	if (unlikely(ch_info == NULL)){
		CCCI_MSG("%s fail: get invalid ch info\n", __FUNCTION__);
		return -CCCI_ERR_GET_NULL_POINTER;
	}

	if (unlikely(ch_info->m_attrs&L_CH_ATTR_TX)){
		CCCI_MSG_INF(ch_info->m_md_id, "cci", "%s fail: %s(ch%d) is tx \n", \
						__FUNCTION__, ch_info->m_ch_name, msg->channel);
		return -CCCI_ERR_GET_RX_DATA_FROM_TX_CHANNEL;
	}

	// check whether fifo is ready
	if (unlikely(!ch_info->m_kfifo_ready)){
		CCCI_MSG_INF(ch_info->m_md_id, "cci", "%s fail: %s(ch%d) kfifo not ready\n", \
						__FUNCTION__, ch_info->m_ch_name, msg->channel);
		return -CCCI_ERR_KFIFO_IS_NOT_READY;
	}

	// Check fifo if has data
	if (kfifo_is_empty(&ch_info->m_kfifo))
	{
		return 0;
	}

	// Pop data
	return kfifo_out(&ch_info->m_kfifo, msg, sizeof(ccif_msg_t));
}
开发者ID:agrloki,项目名称:android_kernel_ousheng_V9,代码行数:29,代码来源:ccci_logical.c

示例4: ccci_send_run_time_data

int ccci_send_run_time_data(void)
{
	int ret=0;
	CCCI_BUFF_T buff;

	/* Set runtime data and echo start-boot command */
	CCCI_MSG_INF("ctl", "set modem runtime\n");
	ret = set_md_runtime();
	if (ret != 0) {
		CCCI_MSG_INF("ctl", "fail to set MODEM runtime data\n");
		return ret;
	}

	//printk("echo MD_INIT_START_BOOT\n");
	CCCI_INIT_MAILBOX(&buff, MD_INIT_START_BOOT);
	buff.reserved = MD_INIT_CHK_ID;
	ccci_before_modem_start_boot();
	ret = ccci_write(CCCI_CONTROL_TX, &buff);
	if (ret != 0) {
		CCCI_MSG_INF("ctl", "fail to write CCCI_CONTROL_TX\n");
		return ret;
	}
	CCCI_MSG_INF("ctl", "wait for NORMAL_BOOT_ID\n");
	//if (end)   end();
	//Notes:after load dsp_rom, dsp will write data back to dsp region, so set protect region at last
	//start_emi_mpu_protect();
	enable_emi_mpu_protection(ccci_smem_phy, ccci_smem_size);
	//mod_timer(&md_boot_up_check_timer, jiffies+5*HZ);
	mod_timer(&md_boot_up_check_timer, jiffies+10*HZ);
	return ret;
}
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:31,代码来源:ccci_md_main.c

示例5: send_stop_md_request

int send_stop_md_request(void)
{
	CCCI_BUFF_T sys_msg;
    char buf = 1;

	CCCI_MSG_INF("ctl", "send stop modem request message\n");
	/* prevent another reset modem action from wdt timeout IRQ during modem reset */
	atomic_inc(&md_reset_on_going);
	if(atomic_read(&md_reset_on_going)>1){
		CCCI_MSG_INF("ctl", "One stop flow is on-going \n");
		return CCCI_MD_IN_RESET;
	}

	if(md_boot_stage == MD_BOOT_STAGE_2){
		lock_md_sleep(&buf, sizeof(char));
	}
	
	/* mask CCIF IRQ to prevent md_boot_stage from updating by CCIF LISR */
	md_boot_stage = MD_BOOT_STAGE_0;
	/* v1.4 20120618: mask CCIF IRQ to prevent md_boot_stage from updating by CCIF ISR */
	//CCCI_MSG_INF("ctl", "stop request: mask ccci irq\n");
	ccci_mask();
	CCCI_INIT_MAILBOX(&sys_msg, CCCI_MD_MSG_STOP_MD_REQUEST);
	ccci_system_message(&sys_msg);

	return CCCI_SUCCESS;
}
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:27,代码来源:ccci_md_main.c

示例6: ccmni_v2_check_info

static int ccmni_v2_check_info(int md_id, int ch, const unsigned char *ccmni_ptr, int ccmni_len)
{
	int ret = 0;

	if ((ccmni_ptr == NULL) || (ccmni_len <= 0))
	{
		CCCI_MSG_INF(md_id, "net", "CCMNI%d_check_info() ptr_n or len_n error!\n", ch);
		ret = -CCCI_ERR_INVALID_PARAM;
		goto check_info_error;
	}

	//Check Header and Footer
	if ((*(int*)(ccmni_ptr - CCMNI_BUFF_HEADER_SIZE) != CCMNI_BUFF_HEADER) || \
		(*(int*)(ccmni_ptr + CCMNI_BUFF_DATA_FIELD_SIZE) != CCMNI_BUFF_FOOTER)) 
	{
		CCCI_MSG_INF(md_id, "net", "CCMNI%d_check_info() check header and footer error\n", ch);
		ret = -CCCI_ERR_MEM_CHECK_FAIL;
		goto check_info_error;
	}

	//Check End Byte
	if (*(unsigned char *)((unsigned int)(ccmni_ptr + ccmni_len + 3)&0xfffffffc) != CCMNI_DATA_END)
	{
		CCCI_MSG_INF(md_id, "net", "CCMNI%d_check_info() check end byte error\n", ch);
		ret = -CCCI_ERR_MEM_CHECK_FAIL;
		goto check_info_error;
	}

	ret = 0;

check_info_error:

	return ret;

}
开发者ID:agrloki,项目名称:android_kernel_ousheng_V9,代码行数:35,代码来源:ccmni_v2_net.c

示例7: __logic_dispatch_push

static int __logic_dispatch_push(ccif_msg_t *msg, void *ctl_b)
{
	logic_channel_info_t *ch_info;
	int ret = 0;
	logic_dispatch_ctl_block_t *ctl_block = (logic_dispatch_ctl_block_t*)ctl_b;
	int md_id = ctl_block->m_md_id;
	int drop = 1;

	if (unlikely(msg->channel >= CCCI_MAX_CH_NUM)){
		CCCI_MSG_INF(md_id, "cci", "%s get invalid logic ch id:%d\n", \
							__FUNCTION__, msg->channel);
		ret = -CCCI_ERR_INVALID_LOGIC_CHANNEL_ID;
		goto _out;
	}

	ch_info = &(ctl_block->m_logic_ch_table[msg->channel]);
	if (unlikely(ch_info->m_attrs&L_CH_ATTR_TX)){
		CCCI_MSG_INF(md_id, "cci", "%s CH:%d %s is tx channel\n", __FUNCTION__, \
							msg->channel, ch_info->m_ch_name);
		ret = -CCCI_ERR_PUSH_RX_DATA_TO_TX_CHANNEL;
		goto _out;
	}

	// check whether fifo is ready
	if (!ch_info->m_kfifo_ready){
		CCCI_MSG_INF(md_id, "cci", "%s CH:%d %s's kfifo is not ready\n", \
							__FUNCTION__, msg->channel, ch_info->m_ch_name);
		ret = -CCCI_ERR_KFIFO_IS_NOT_READY;
		goto _out;
	}

	// Check fifo free space
	if (kfifo_is_full(&ch_info->m_kfifo))
	{
		if (ch_info->m_attrs&L_CH_DROP_TOLERATED){
			CCCI_CTL_MSG(md_id, "Drop (%08X %08X %02d %08X) is tolerated\n", \
							msg->data[0], msg->data[1], msg->channel, msg->reserved);
			ret = sizeof(ccif_msg_t);
		} else {
			// message should NOT be droped
			CCCI_DBG_MSG(md_id, "cci", "kfifo full: ch:%s size:%d (%08X %08X %02d %08X)\n",
							ch_info->m_ch_name, kfifo_size(&ch_info->m_kfifo),msg->data[0], 
							msg->data[1], msg->channel, msg->reserved);
			// disalbe CCIF interrupt here????
			ret = 0; // Fix this!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
		}
		goto _out;
	}

	// Push data
	ret = kfifo_in(&ch_info->m_kfifo,msg,sizeof(ccif_msg_t));
	WARN_ON(ret!=sizeof(ccif_msg_t));
	ctl_block->m_has_pending_data = 1;
	drop = 0;
_out:
	add_logic_layer_record(md_id, (ccci_msg_t*)msg, drop);
	return ret;
}
开发者ID:agrloki,项目名称:android_kernel_ousheng_V9,代码行数:58,代码来源:ccci_logical.c

示例8: ccci_md_init_mod_init

int __init ccci_md_init_mod_init(void)
{
    int ret;

    CCCI_MSG("Ver. %s, @ %s %s\n",ccci_version, __DATE__, __TIME__); 
   
    ret = ccci_alloc_smem();
    if (ret)
	return ret;
	
    /*
     * IOREMAP the physical address where the modem firmware is stored.
     * We will need to dump this, when there's an exception.
     */
    //md_img_vir = (int *)ioremap_nocache(MODEM_REGION_BASE, MD_IMG_DUMP_SIZE);
//	 printk(KERN_ERR "----------->CCCI_MD: md_img_vir=%p.\n",md_img_vir);
    //if (!md_img_vir)
    //{
        //printk(KERN_ERR "[CCCI]:CCCI_MD[Exception] Mem dump ioremap failed\n");
        //return -ENOMEM;
    //}

    ret=platform_init();
    if (ret)
    {
	CCCI_MSG_INF("ctl", "platform_init failed.\n");
	//iounmap(md_img_vir);
	return ret;
    }
	
    ret=ccci_rpc_init();
    if (ret)
    {
	CCCI_MSG_INF("ctl", "rpc_init failed.\n");
	ccci_rpc_exit();
	//iounmap(md_img_vir);
	return ret;
    }
	
    // MUST register callbacks after memory is allocated
	boot_register_md_func(boot_md_show, boot_md_store);
	//slp_set_ccci_callback(ccci_dormancy);
	ccci_md_wdt_notify_register(reset_md);
	ccci_aed_cb_register(ccci_aed);
	register_resume_notify(RSM_ID_MD_LOCK_DORMANT, lock_md_dormant);
	register_suspend_notify(SLP_ID_MD_UNLOCK_DORMANT, unlock_md_dormant);
	register_ccci_kern_func(ID_CCCI_DORMANCY, ccci_dormancy);
    register_ccci_kern_func(ID_LOCK_MD_SLEEP, lock_md_sleep);
	register_ccci_kern_func(ID_ACK_MD_SLEEP, ack_md_sleep);
    
    register_filter_func("-l", ccci_msg_filter_store, ccci_msg_filter_show);
    register_filter_func("-c", ccci_ch_filter_store, ccci_ch_filter_show);
    wake_lock_init(&trm_wake_lock, WAKE_LOCK_SUSPEND, "ccci_trm");
    spin_lock_init(&md_slp_lock);
    
    return 0;
}
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:57,代码来源:ccci_md_main.c

示例9: ccmni_v2_receive

static int ccmni_v2_receive(ccmni_v2_instance_t *ccmni, const unsigned char *ccmni_ptr, int ccmni_len)
{
	int						packet_type, ret = 0;
	struct sk_buff			*skb;
	ccmni_v2_ctl_block_t	*ctl_b = (ccmni_v2_ctl_block_t*)ccmni->owner;
	int						md_id = ctl_b->m_md_id;

	if ((ccmni == NULL) || (ccmni_ptr == NULL) || (ccmni_len <= 0))
	{
		CCCI_MSG_INF(md_id, "net", "CCMNI%d_receive: invalid private data\n", ccmni->channel);
		ret = -1;
	}

	skb = dev_alloc_skb(ccmni_len);

	if (skb)
	{
		packet_type = ccmni_ptr[0] & 0xF0;
		memcpy(skb_put(skb, ccmni_len), ccmni_ptr, ccmni_len);
		ccmni_make_etherframe(skb->data - ETH_HLEN, ccmni->dev->dev_addr, packet_type);
		skb_set_mac_header(skb, -ETH_HLEN);

		skb->dev = ccmni->dev;
		if(packet_type == IPV6_VERSION)
		{
			skb->protocol  = htons(ETH_P_IPV6);
		}
		else
		{
			skb->protocol  = htons(ETH_P_IP);
		}
		//skb->ip_summed = CHECKSUM_UNNECESSARY;
		skb->ip_summed = CHECKSUM_NONE;

		ret = netif_rx(skb);

		CCCI_CCMNI_MSG(md_id, "CCMNI%d invoke netif_rx()=%d\n", ccmni->channel, ret);

		ccmni->dev->stats.rx_packets++;
		ccmni->dev->stats.rx_bytes	+= ccmni_len;
		CCCI_CCMNI_MSG(md_id, "CCMNI%d rx_pkts=%d, stats_rx_bytes=%d\n",ccmni->channel, \
			ccmni->dev->stats.rx_packets,ccmni->dev->stats.rx_bytes);

		ret = 0;
	}
	else
	{
		CCCI_MSG_INF(md_id, "net", "CCMNI%d Socket buffer allocate fail\n", ccmni->channel);
		ret = -CCCI_ERR_MEM_CHECK_FAIL;
	}

	return ret;
}
开发者ID:agrloki,项目名称:android_kernel_ousheng_V9,代码行数:53,代码来源:ccmni_v2_net.c

示例10: ccmni_v2_dump

void ccmni_v2_dump(int md_id)
{
	int i=0,port=0;
	ccmni_v2_ctl_block_t *ctl_b = (ccmni_v2_ctl_block_t *)ccmni_ctl_block[md_id];
	
	CCCI_MSG_INF(md_id, "ctl", "ccmni v2 dump start\n");
	for(port=0;port<CCMNI_V2_PORT_NUM;port++){
		ccmni_v2_instance_t *ccmni= ctl_b->ccmni_v2_instance[port];
		CCCI_MSG_INF(md_id, "ctl", "Port%d RX CONTROL: read_out=%d, avai_out=%d, avai_in=%d,q_len=%d\n",port,
			ccmni->shared_mem->rx_control.read_out,
			ccmni->shared_mem->rx_control.avai_out,
			ccmni->shared_mem->rx_control.avai_in,
			ccmni->shared_mem->rx_control.q_length);
		CCCI_MSG_INF(md_id, "ctl", "Port%d RX ringbuff:\n",port);
		for(i=0; i<CCMNI_CTRL_Q_RX_SIZE; i++)
		{
			if(ccmni->shared_mem->q_rx_ringbuff[i].ptr!=NULL && ccmni->shared_mem->q_rx_ringbuff[i].len!=0)
				CCCI_MSG_INF(md_id,"ctl","[%d]: ptr=%08X len=%d\n",i,(int)(ccmni->shared_mem->q_rx_ringbuff[i].ptr), ccmni->shared_mem->q_rx_ringbuff[i].len);
		}
		CCCI_MSG_INF(md_id, "ctl", "Port%d TX CONTROL: read_out=%d, avai_out=%d, avai_in=%d,q_len=%d\n",port,
			ccmni->shared_mem->tx_control.read_out,
			ccmni->shared_mem->tx_control.avai_out,
			ccmni->shared_mem->tx_control.avai_in,
			ccmni->shared_mem->tx_control.q_length);
		CCCI_MSG_INF(md_id, "ctl", "Port%d TX ringbuff:\n",port);
		
		for(i=0; i < CCMNI_CTRL_Q_TX_SIZE; i++)
		{
			if(ccmni->shared_mem->q_tx_ringbuff[i].ptr!=NULL&&ccmni->shared_mem->q_tx_ringbuff[i].len!=0)
				CCCI_MSG_INF(md_id,"ctl","[%d]: ptr=%08X len=%d\n",i,(int)(ccmni->shared_mem->q_tx_ringbuff[i].ptr),ccmni->shared_mem->q_tx_ringbuff[i].len);
		}
	}
	CCCI_MSG_INF(md_id, "ctl", "ccmni v2 dump end\n");
}
开发者ID:Swapnil133609,项目名称:Zeus_exp,代码行数:34,代码来源:ccmni_v2_net.c

示例11: ccmni_v2_init

int ccmni_v2_init(int md_id)
{
	int						count, ret, curr;
	ccmni_v2_ctl_block_t	*ctl_b;
	char					ccmni_lock_name[32];

	// Create control block structure
	ctl_b = (ccmni_v2_ctl_block_t *)kmalloc(sizeof(ccmni_v2_ctl_block_t), GFP_KERNEL);
	if(ctl_b == NULL)
		return -CCCI_ERR_GET_MEM_FAIL;

	memset(ctl_b, 0, sizeof(ccmni_v2_ctl_block_t));
	ccmni_ctl_block[md_id] = ctl_b;

	// Init ctl_b
	ctl_b->m_md_id = md_id;
	ctl_b->ccmni_notifier.call = ccmni_v2_notifier_call;
	ctl_b->ccmni_notifier.next = NULL;

	for(count = 0; count < CCMNI_CHANNEL_CNT; count++)
	{
		ret = ccmni_v2_create_instance(md_id, count);
		if (ret != 0) {
			CCCI_MSG_INF(md_id, "net", "CCMNI%d create instance fail: %d\n", count, ret);
			goto _CCMNI_INSTANCE_CREATE_FAIL;
		} else {
			CCCI_DBG_MSG(md_id, "net", "CCMNI%d create instance ok!\n", count);
		}
	}

	ret = md_register_call_chain(md_id, &ctl_b->ccmni_notifier);
	if(ret) {
		CCCI_MSG_INF(md_id, "net", "md_register_call_chain fail: %d\n", ret);
		goto _CCMNI_INSTANCE_CREATE_FAIL;
	}

	snprintf(ccmni_lock_name, 32, "cc%dmni wake lock", md_id);
    
	wake_lock_init(&ctl_b->ccmni_wake_lock, WAKE_LOCK_SUSPEND, ccmni_lock_name);
	return ret;

_CCMNI_INSTANCE_CREATE_FAIL:
	for(curr=0; curr<count-1; curr++) {
		ccmni_v2_destroy_instance(md_id, curr);
	}
	kfree(ctl_b);
	ccmni_ctl_block[md_id] = NULL;
	return ret;
}
开发者ID:agrloki,项目名称:android_kernel_ousheng_V9,代码行数:49,代码来源:ccmni_v2_net.c

示例12: ccci_aed

void ccci_aed(unsigned int dump_flag, char *aed_str)
{
	#define AED_STR_LEN		(512)
	int *ex_log_addr = NULL;
	int ex_log_len = 0;
	int *md_img_addr = NULL;
	int md_img_len = 0;
	int info_str_len = 0;
	char buff[AED_STR_LEN];

	info_str_len = strlen(aed_str);
	info_str_len += strlen(image_buf);

	if(info_str_len > AED_STR_LEN){
		CCCI_MSG_INF("ctl", "Info string is too long, num:%d\n", info_str_len);
		buff[AED_STR_LEN-1] = '\0'; // Cut string length to AED_STR_LEN
	}

	snprintf(buff, AED_STR_LEN, "%s%s", aed_str, image_buf);

	if(dump_flag & CCCI_AED_DUMP_EX_MEM){
		ex_log_addr = md_ex_log;
		ex_log_len = MD_EX_LOG_SIZE;
	}
	if(dump_flag & CCCI_AED_DUMP_MD_IMG_MEM){
		md_img_addr = md_img_vir;
		md_img_len = MD_IMG_DUMP_SIZE;
	}

	#ifdef CONFIG_MTK_AEE_FEATURE
	aed_md_exception2(ex_log_addr, ex_log_len, md_img_addr, md_img_len, buff);
	#endif
}
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:33,代码来源:ccci_md_main.c

示例13: md_boot_up_timeout_func

static void md_boot_up_timeout_func(unsigned long data  __always_unused)
{
	CCCI_BUFF_T sys_msg;
	CCCI_MSG_INF("ctl", "Time out! Notify Deamon\n");
	CCCI_INIT_MAILBOX(&sys_msg, CCCI_MD_MSG_BOOT_TIMEOUT);
	ccci_system_message(&sys_msg);
}
开发者ID:wufuyue,项目名称:TCL_S820,代码行数:7,代码来源:ccci_md_main.c

示例14: register_to_logic_ch

int register_to_logic_ch(int md_id, int ch, void (*func)(void*), void *owner)
{
	logic_channel_info_t *ch_info;
	int ret = 0;
	unsigned long flags;
	logic_dispatch_ctl_block_t *ctl_b;

	ctl_b = logic_dispatch_ctlb[md_id];
	ch_info = &(ctl_b->m_logic_ch_table[ch]);
	
	if ((ch_info->m_attrs&L_CH_ATTR_TX) && (func != NULL)) {
		return 0;
	}

	spin_lock_irqsave(&ch_info->m_lock, flags);
	// Check whether call back function has been registered
	if (!ch_info->m_register) {
		ch_info->m_register = 1;
		ch_info->m_call_back = func;
		ch_info->m_owner = owner;
	} else {
		CCCI_MSG_INF(md_id, "cci", "%s fail: %s(ch%d) cb func has registered\n", \
					__FUNCTION__, ch_info->m_ch_name, ch_info->m_ch_id);
		ret = -CCCI_ERR_LOGIC_CH_HAS_REGISTERED;
	}
	spin_unlock_irqrestore(&ch_info->m_lock, flags);

	return ret;
}
开发者ID:agrloki,项目名称:android_kernel_ousheng_V9,代码行数:29,代码来源:ccci_logical.c

示例15: ccci_tty_writeable

static int ccci_tty_writeable(tty_instance_t	*tty_instance)
{
	int 	read, write, size,length;

	read   = tty_instance->shared_mem->tx_control.read;
	write  = tty_instance->shared_mem->tx_control.write;
	length = tty_instance->shared_mem->tx_control.length;

	if (read == write)
	{
		size = length - 1;
	}
	else if (read < write)
	{
		size =  length - write;
		size += read;
	}
	else
	{
		size = read - write - 1;
	}

	if ((size <= 0) || (length <= 0)) {
		CCCI_MSG_INF(tty_instance->m_md_id, "tty", "writeable: read=%d,write=%d,length=%d,size=%d\n",
			read, write, length, size);
	}
	return size;
}
开发者ID:4Fwolf,项目名称:motorola-hawk-kernel-3.4.67,代码行数:28,代码来源:ccci_tty.c


注:本文中的CCCI_MSG_INF函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。