static void rmnet_tx_timeout(struct net_device *dev)
{
	int chno;
	dynadbg_module(DYNADBG_WARN|DYNADBG_TX,"rmnet_tx_timeout()\n");

	for(chno=0; chno < 16; chno++) {
		if(rmnet_ch_block_info[chno].dev == dev) {
			rmnet_restart_queue(chno);
			break;
		}
	}
}
Ejemplo n.º 2
0
void hsi_write_work(struct work_struct *work)
{
	/* function registered with write work q */
	struct hsi_channel *ch = (struct hsi_channel*) container_of(work,
													struct hsi_channel,
													write_work);
	int chno = ch->info->chno;
	struct x_data *data = NULL;
	int err;

//                                                  
/* RIL recovery memory initialization  */
#if 0
	if (hsi_mcm_state == HSI_MCM_STATE_ERR_RECOVERY) {
#if MCM_DBG_ERR_RECOVERY_LOG
		printk("\nmcm:Dropping packets of channel %d from WQ as error recovery is in progress\n", chno);
#endif
		goto quit_write_wq;
	}
#endif
//                                                

	if (hsi_channels[chno].write_queued == HSI_TRUE) {
#if MCM_DBG_LOG
		printk("\nmcm: write wq already in progress\n");
#endif
		return;
	}

	hsi_channels[chno].write_queued = HSI_TRUE;

	while ((data = read_q(chno, &hsi_channels[chno].tx_q)) != NULL) {
//                                                  
/* RIL recovery memory initialization  */
#if 1
		if (hsi_mcm_state == HSI_MCM_STATE_ERR_RECOVERY) {
#if MCM_DBG_ERR_RECOVERY_LOG
			printk("\nmcm:Dropping packets of channel %d from WQ "
					"as error recovery is in progress\n", chno);
#endif
			hsi_mem_free(data->buf);
			continue;
		}
#endif
//                                                
		hsi_channels[chno].write_happening = HSI_TRUE;
		data->being_used = HSI_TRUE;
		err = hsi_ll_write(chno, (unsigned char *)data->buf, data->size);
		if (err < 0) {
#if MCM_DBG_ERR_LOG
			printk("\nmcm: hsi_ll_write failed\n");
#endif
			hsi_channels[chno].write_happening = HSI_FALSE;
		} else {
#if MCM_DBG_LOG
			printk("\nmcm:locking mutex for ch: %d\n",chno);
#endif
			wait_event(hsi_channels[chno].write_wait,
						hsi_channels[chno].write_happening == HSI_FALSE);
		}
		hsi_channels[chno].pending_tx_msgs--;
		data->being_used = HSI_FALSE;

		if (hsi_channels[chno].tx_blocked == 1) {
			hsi_channels[chno].tx_blocked = 0;
//#if MCM_DBG_LOG
			printk("\nmcm: Channel queue free , restarting TX queue for ch %d \n",chno);
//#endif
			rmnet_restart_queue(chno);
		}
	}

//                                                  
#if 0
/* RIL recovery memory initialization  */
quit_write_wq:
#endif
//                                                
	hsi_channels[chno].write_queued = HSI_FALSE;
}