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


C++ cancel_delayed_work函数代码示例

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


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

示例1: wl1271_scan_stm

void wl1271_scan_stm(struct wl1271 *wl)
{
	int ret = 0;

	switch (wl->scan.state) {
	case WL1271_SCAN_STATE_IDLE:
		break;

	case WL1271_SCAN_STATE_2GHZ_ACTIVE:
		ret = wl1271_scan_send(wl, IEEE80211_BAND_2GHZ, false,
				       wl->conf.tx.basic_rate);
		if (ret == WL1271_NOTHING_TO_SCAN) {
			wl->scan.state = WL1271_SCAN_STATE_2GHZ_PASSIVE;
			wl1271_scan_stm(wl);
		}

		break;

	case WL1271_SCAN_STATE_2GHZ_PASSIVE:
		ret = wl1271_scan_send(wl, IEEE80211_BAND_2GHZ, true,
				       wl->conf.tx.basic_rate);
		if (ret == WL1271_NOTHING_TO_SCAN) {
			if (wl->enable_11a)
				wl->scan.state = WL1271_SCAN_STATE_5GHZ_ACTIVE;
			else
				wl->scan.state = WL1271_SCAN_STATE_DONE;
			wl1271_scan_stm(wl);
		}

		break;

	case WL1271_SCAN_STATE_5GHZ_ACTIVE:
		ret = wl1271_scan_send(wl, IEEE80211_BAND_5GHZ, false,
				       wl->conf.tx.basic_rate_5);
		if (ret == WL1271_NOTHING_TO_SCAN) {
			wl->scan.state = WL1271_SCAN_STATE_5GHZ_PASSIVE;
			wl1271_scan_stm(wl);
		}

		break;

	case WL1271_SCAN_STATE_5GHZ_PASSIVE:
		ret = wl1271_scan_send(wl, IEEE80211_BAND_5GHZ, true,
				       wl->conf.tx.basic_rate_5);
		if (ret == WL1271_NOTHING_TO_SCAN) {
			wl->scan.state = WL1271_SCAN_STATE_DONE;
			wl1271_scan_stm(wl);
		}

		break;

	case WL1271_SCAN_STATE_DONE:
		wl->scan.failed = false;
		cancel_delayed_work(&wl->scan_complete_work);
		ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work,
					     msecs_to_jiffies(0));
		break;

	default:
		wl1271_error("invalid scan state");
		break;
	}

	if (ret < 0) {
		cancel_delayed_work(&wl->scan_complete_work);
		ieee80211_queue_delayed_work(wl->hw, &wl->scan_complete_work,
					     msecs_to_jiffies(0));
	}
}
开发者ID:padovan,项目名称:bluetooth-next,代码行数:69,代码来源:scan.c

示例2: nfs_release_automount_timer

void nfs_release_automount_timer(void)
{
	if (list_empty(&nfs_automount_list))
		cancel_delayed_work(&nfs_automount_task);
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:5,代码来源:namespace.c

示例3: input_work_func

static void input_work_func(struct work_struct *work)
{
	int adc_value = -1;
	int val = 0;
	ktime_t temptime;

	adc_value = auxadc_access(2);
	val = readl(io_p2v(REG_ANACR12));
//	printk("%s: REG_ANACR2=%d, REG_ANACR12=%d\n", __func__,adc_value , val);

	if(val >= KEY_PRESS_THRESHOLD && adc_value >= KEY1_THRESHOLD_L && adc_value < KEY3_THRESHOLD_U)
	{
		temptime = ktime_get();
		temptime = ktime_sub(temptime, mic.hsbtime);

		if(temptime.tv.nsec < VALID_RELEASE_REF_TIME && mic.keypressing == PRESS)
		{
			if ( adc_value >= KEY1_THRESHOLD_L && adc_value < KEY1_THRESHOLD_U )
			{
				mic.key_count[0]++;
				printk ("KEY_BCM_HEADSET_BUTTON \n");
			}
			else if ( adc_value >= KEY2_THRESHOLD_L && adc_value < KEY2_THRESHOLD_U ) 
			{
				mic.key_count[1]++;
				printk ("KEY_VOLUMEUP \n");
			}
			else if ( adc_value >= KEY3_THRESHOLD_L && adc_value < KEY3_THRESHOLD_U ) 
			{
				mic.key_count[2]++;
				printk ("KEY_VOLUMEDOWN \n");
			}
		}
		else
		{
			if(mic.keypressing == PRESS && (mic.key_count[0] + mic.key_count[1] + mic.key_count[2]))
			{
				input_report_key(mic.headset_button_idev, Return_valid_key(mic.key_count), PRESS);
				input_sync(mic.headset_button_idev);

				set_button(1); 
				mic.keypressing = RELEASE;
			}
		}

		cancel_delayed_work(&(mic.input_work));
		queue_delayed_work(mic.headset_workqueue, &(mic.input_work), KEY_PRESS_REF_TIME);
	}
	else
	{
		if(mic.keypressing == RELEASE && (mic.key_count[0] + mic.key_count[1] + mic.key_count[2]))
		{			
			printk ("%s: RELEASE key_count [%d, %d, %d] \n", __func__,  mic.key_count[0], mic.key_count[1], mic.key_count[2]);
			input_report_key(mic.headset_button_idev, Return_valid_key(mic.key_count), RELEASE);
			input_sync(mic.headset_button_idev);
		}
		else
		{
			printk("%s: NO PRESS\n",  __func__);
		}

		if(FactoryMode == DISABLE)
		{
			board_sysconfig(SYSCFG_AUXMIC, SYSCFG_ENABLE | SYSCFG_DISABLE);
			sync_use_mic = DISABLE;		
		}
		
		set_button(0); 
		mic.keypressing = NONE;
	}
}
开发者ID:vM00,项目名称:xm01,代码行数:71,代码来源:brcm_headset.c

示例4: rtl_op_config

static int rtl_op_config( struct ieee80211_hw *hw, u32 changed )
{
	struct rtl_priv *rtlpriv = rtl_priv( hw );
	struct rtl_phy *rtlphy = &( rtlpriv->phy );
	struct rtl_mac *mac = rtl_mac( rtl_priv( hw ) );
	struct rtl_ps_ctl *ppsc = rtl_psc( rtl_priv( hw ) );
	struct ieee80211_conf *conf = &hw->conf;

	if ( mac->skip_scan )
		return 1;

	mutex_lock( &rtlpriv->locks.conf_mutex );
	if ( changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL ) {	/*BIT( 2 )*/
		RT_TRACE( rtlpriv, COMP_MAC80211, DBG_LOUD,
			 "IEEE80211_CONF_CHANGE_LISTEN_INTERVAL\n" );
	}

	/*For IPS */
	if ( changed & IEEE80211_CONF_CHANGE_IDLE ) {
		if ( hw->conf.flags & IEEE80211_CONF_IDLE )
			rtl_ips_nic_off( hw );
		else
			rtl_ips_nic_on( hw );
	} else {
		/*
		 *although rfoff may not cause by ips, but we will
		 *check the reason in set_rf_power_state function
		 */
		if ( unlikely( ppsc->rfpwr_state == ERFOFF ) )
			rtl_ips_nic_on( hw );
	}

	/*For LPS */
	if ( changed & IEEE80211_CONF_CHANGE_PS ) {
		cancel_delayed_work( &rtlpriv->works.ps_work );
		cancel_delayed_work( &rtlpriv->works.ps_rfon_wq );
		if ( conf->flags & IEEE80211_CONF_PS ) {
			rtlpriv->psc.sw_ps_enabled = true;
			/* sleep here is must, or we may recv the beacon and
			 * cause mac80211 into wrong ps state, this will cause
			 * power save nullfunc send fail, and further cause
			 * pkt loss, So sleep must quickly but not immediatly
			 * because that will cause nullfunc send by mac80211
			 * fail, and cause pkt loss, we have tested that 5mA
			 * is worked very well */
			if ( !rtlpriv->psc.multi_buffered )
				queue_delayed_work( rtlpriv->works.rtl_wq,
						&rtlpriv->works.ps_work,
						MSECS( 5 ) );
		} else {
			rtl_swlps_rf_awake( hw );
			rtlpriv->psc.sw_ps_enabled = false;
		}
	}

	if ( changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS ) {
		RT_TRACE( rtlpriv, COMP_MAC80211, DBG_LOUD,
			 "IEEE80211_CONF_CHANGE_RETRY_LIMITS %x\n",
			 hw->conf.long_frame_max_tx_count );
		mac->retry_long = hw->conf.long_frame_max_tx_count;
		mac->retry_short = hw->conf.long_frame_max_tx_count;
		rtlpriv->cfg->ops->set_hw_reg( hw, HW_VAR_RETRY_LIMIT,
					      ( u8 * ) ( &hw->conf.
						      long_frame_max_tx_count ) );
	}

	if ( changed & IEEE80211_CONF_CHANGE_CHANNEL ) {
		struct ieee80211_channel *channel = hw->conf.chandef.chan;
		u8 wide_chan = ( u8 ) channel->hw_value;

		if ( mac->act_scanning )
			mac->n_channels++;

		if ( rtlpriv->dm.supp_phymode_switch &&
		    mac->link_state < MAC80211_LINKED &&
		    !mac->act_scanning ) {
			if ( rtlpriv->cfg->ops->chk_switch_dmdp )
				rtlpriv->cfg->ops->chk_switch_dmdp( hw );
		}

		/*
		 *because we should back channel to
		 *current_network.chan in in scanning,
		 *So if set_chan == current_network.chan
		 *we should set it.
		 *because mac80211 tell us wrong bw40
		 *info for cisco1253 bw20, so we modify
		 *it here based on UPPER & LOWER
		 */
		switch ( cfg80211_get_chandef_type( &hw->conf.chandef ) ) {
		case NL80211_CHAN_HT20:
		case NL80211_CHAN_NO_HT:
			/* SC */
			mac->cur_40_prime_sc =
				PRIME_CHNL_OFFSET_DONT_CARE;
			rtlphy->current_chan_bw = HT_CHANNEL_WIDTH_20;
			mac->bw_40 = false;
			break;
		case NL80211_CHAN_HT40MINUS:
			/* SC */
//.........这里部分代码省略.........
开发者ID:DavidLin1577TO1874,项目名称:rtl8188ce-linux-driver,代码行数:101,代码来源:core.c

示例5: input_work_func

static void input_work_func(struct work_struct *work)
{
	int adc_value = -1;
	int val = 0;
	ktime_t temptime;

	adc_value = auxadc_access(2);
	val = readl(io_p2v(REG_ANACR12));
//	printk("%s: REG_ANACR2=%d, REG_ANACR12=%d\n", __func__,adc_value , val);

#ifdef USE_SERVICEMODE
	if(val >= KEY_PRESS_THRESHOLD && adc_value >= Min_threshold && adc_value < Max_threshold)
	{
#else
	if(val >= KEY_PRESS_THRESHOLD && adc_value >= KEY1_THRESHOLD_L && adc_value < KEY3_THRESHOLD_U)
	{
#endif
		temptime = ktime_get();
		temptime = ktime_sub(temptime, mic.hsbtime);

		if(temptime.tv.nsec < VALID_RELEASE_REF_TIME && mic.keypressing == PRESS)
		{
			if ( adc_value >= KEY1_THRESHOLD_L && adc_value < KEY1_THRESHOLD_U )
			{
				mic.key_count[0]++;
				printk ("KEY_BCM_HEADSET_BUTTON \n");
			}
			else if ( adc_value >= KEY2_THRESHOLD_L && adc_value < KEY2_THRESHOLD_U ) 
			{
				mic.key_count[1]++;
				printk ("KEY_VOLUMEUP \n");
			}
			else if ( adc_value >= KEY3_THRESHOLD_L && adc_value < KEY3_THRESHOLD_U ) 
			{
				mic.key_count[2]++;
				printk ("KEY_VOLUMEDOWN \n");
			}
		}
		else
		{
			if(mic.keypressing == PRESS && (mic.key_count[0] + mic.key_count[1] + mic.key_count[2]))
			{
				input_report_key(mic.headset_button_idev, Return_valid_key(mic.key_count), PRESS);
				input_sync(mic.headset_button_idev);

				set_button(1); 
				mic.keypressing = RELEASE;
			}
		}

		cancel_delayed_work(&(mic.input_work));
		queue_delayed_work(mic.headset_workqueue, &(mic.input_work), KEY_PRESS_REF_TIME);
	}
	else
	{
		if(mic.keypressing == RELEASE && (mic.key_count[0] + mic.key_count[1] + mic.key_count[2]))
		{			
			printk ("%s: RELEASE key_count [%d, %d, %d] \n", __func__,  mic.key_count[0], mic.key_count[1], mic.key_count[2]);
			input_report_key(mic.headset_button_idev, Return_valid_key(mic.key_count), RELEASE);
			input_sync(mic.headset_button_idev);
		}
		else
		{
			printk("%s: NO PRESS\n",  __func__);
		}

		if(FactoryMode == DISABLE)
		{
			board_sysconfig(SYSCFG_AUXMIC, SYSCFG_ENABLE | SYSCFG_DISABLE);
			sync_use_mic = DISABLE;		
		}
		
		set_button(0); 
		mic.keypressing = NONE;
	}
}

/*------------------------------------------------------------------------------
Function name   : hs_buttonisr
Description     : interrupt handler

Return type     : irqreturn_t
------------------------------------------------------------------------------*/
irqreturn_t hs_buttonisr(int irq, void *dev_id)
{
	struct mic_t *p = &mic;
	int val = 0;
	ktime_t temptime;
	
#ifdef USE_SERVICEMODE
	if(TestMode == ENABLE)
	{
		if(p->headset_state == HEADSET_4_POLE)
			board_sysconfig(SYSCFG_AUXMIC, SYSCFG_ENABLE);
		
		return IRQ_NONE;
	}
#endif
	
	if(mic.keypressing == INIT)
//.........这里部分代码省略.........
开发者ID:manoranjan2050,项目名称:Compact,代码行数:101,代码来源:brcm_headset.c

示例6: nvhost_pod_estimate_freq

static int nvhost_pod_estimate_freq(struct devfreq *df,
				    unsigned long *freq)
{
	struct podgov_info_rec *podgov = df->data;
	struct devfreq_dev_status dev_stat;
	struct nvhost_devfreq_ext_stat *ext_stat;
	long delay;
	int current_event;
	int stat;
	ktime_t now;

	stat = df->profile->get_dev_status(df->dev.parent, &dev_stat);
	if (stat < 0)
		return stat;

	/* Ensure maximal clock when scaling is disabled */
	if (!podgov->enable) {
		*freq = df->max_freq;
		return 0;
	}

	if (podgov->p_user) {
		*freq = podgov->p_freq_request;
		return 0;
	}

	current_event = DEVICE_IDLE;
	stat = 0;
	now = ktime_get();

	/* Local adjustments (i.e. requests from kernel threads) are
	 * handled here */

	if (podgov->adjustment_type == ADJUSTMENT_LOCAL) {

		podgov->adjustment_type = ADJUSTMENT_DEVICE_REQ;

		/* Do not do unnecessary scaling */
		scaling_limit(df, &podgov->adjustment_frequency);
		if (df->previous_freq == podgov->adjustment_frequency)
			return GET_TARGET_FREQ_DONTSCALE;

		trace_podgov_estimate_freq(df->previous_freq,
			podgov->adjustment_frequency);

		*freq = podgov->adjustment_frequency;
		return 0;
	}

	/* Retrieve extended data */
	ext_stat = dev_stat.private_data;
	if (!ext_stat)
		return -EINVAL;

	current_event = ext_stat->busy;
	*freq = dev_stat.current_frequency;
	df->min_freq = ext_stat->min_freq;
	df->max_freq = ext_stat->max_freq;

	/* Sustain local variables */
	podgov->last_event_type = current_event;
	podgov->total_idle += (dev_stat.total_time - dev_stat.busy_time);
	podgov->last_total_idle += (dev_stat.total_time - dev_stat.busy_time);

	/* update the load estimate based on idle time */
	update_load_estimate(df);

	/* if throughput hint enabled, and last hint is recent enough, return */
	if (podgov->p_use_throughput_hint &&
		ktime_us_delta(now, podgov->last_throughput_hint) < 1000000)
		return GET_TARGET_FREQ_DONTSCALE;

	switch (current_event) {

	case DEVICE_IDLE:
		/* delay idle_max % of 2 * fast_response time (given in
		 * microseconds) */
		*freq = scaling_state_check(df, now);
		delay = (podgov->idle_max * podgov->p_estimation_window)
			/ 500000;
		schedule_delayed_work(&podgov->idle_timer,
			msecs_to_jiffies(delay));
		break;
	case DEVICE_BUSY:
		cancel_delayed_work(&podgov->idle_timer);
		*freq = scaling_state_check(df, now);
		break;
	case DEVICE_UNKNOWN:
		*freq = scaling_state_check(df, now);
		break;

	}

	if (!(*freq) || (*freq == df->previous_freq))
		return GET_TARGET_FREQ_DONTSCALE;

	trace_podgov_estimate_freq(df->previous_freq, *freq);


	return 0;
//.........这里部分代码省略.........
开发者ID:Ntemis,项目名称:LG_X3_P880_v20a,代码行数:101,代码来源:pod_scaling.c

示例7: fslepdc_send_update

static bool fslepdc_send_update(struct mxcfb_update_data *update_data, bool retry)
{
    bool result = false;
    
    if ( update_data )
    {
        unsigned long start_time, stop_time;
        int send_update_err;
        
        // If this isn't a retry...
        //
        if ( !retry )
        {
            // ...cancel any pending retries.
            //
            cancel_delayed_work(&fslepdc_send_update_work);
            
            // But accumulate any pending retry with the new data.
            //
            if ( fslepdc_send_update_retry_counter )
            {
                struct mxcfb_rect old_retry = fslepdc_send_update_retry_data.update_region,
                                  new_retry,
                                  update    = update_data->update_region;
                u32               old_retry_right,
                                  old_retry_bot,
                                  new_retry_right,
                                  new_retry_bot,
                                  update_right,
                                  update_bot;
                
                // First, accumulate the update region.
                //
                old_retry_right  = (old_retry.left + old_retry.width)  - 1;
                old_retry_bot    = (old_retry.top  + old_retry.height) - 1;
                update_right     = (update.left    + update.width)     - 1;
                update_bot       = (update.top     + update.height)    - 1;
                
                new_retry.left   = min(old_retry.left,  update.left);
                new_retry.top    = min(old_retry.top,   update.top);
                new_retry_right  = max(old_retry_right, update_right);
                new_retry_bot    = max(old_retry_bot,   update_bot);
                
                new_retry.width  = (new_retry_right - new_retry.left)  + 1;
                new_retry.height = (new_retry_bot   - new_retry.top)   + 1;
                
                fslepdc_send_update_retry_data.update_region = new_retry;
                
                // Since it's a retry, go for the highest fidelity possible.
                //
                fslepdc_send_update_retry_data.waveform_mode = fslepdc_get_waveform_mode(WF_UPD_MODE_GC);
                fslepdc_send_update_retry_data.update_mode   = UPDATE_MODE_FULL;
                
                // Use the latest marker and temperature.
                //
                fslepdc_send_update_retry_data.update_marker = update_data->update_marker;
                fslepdc_send_update_retry_data.temp          = update_data->temp;
                
                // Copy the retry data back for this attempt.
                //
                *update_data = fslepdc_send_update_retry_data;
            }
        }
        
        // We can get errors sending updates to EPDC if it's not ready to do
        // an update yet.  So, back off and retry a few times here first
        // before scheduling a retry.
        //
        start_time = jiffies; stop_time = start_time + FSLEPDC_SU_TIMEOUT;    

        do
        {
            send_update_err = mxc_epdc_fb_send_update(update_data, NULL);
            
            if ( 0 != send_update_err )
            {
                einkfb_print_error("EPDC_send_update_error=%d:\n", send_update_err);
                schedule_timeout_uninterruptible(FSLEPDC_SU_WAIT);
            }
        }
        while ( (0 != send_update_err) && time_before_eq(jiffies, stop_time) );
        
        if ( time_after(jiffies, stop_time) )
        {
             einkfb_print_crit("EDPC_send_update_timed_out=true:\n");
        }
        else
        {
            char temp_string[16];
            
            if ( TEMP_USE_AMBIENT == update_data->temp )
                strcpy(temp_string, "ambient");
            else
                sprintf(temp_string, "%d", update_data->temp);
            
            einkfb_debug("update_data:\n");
            einkfb_debug("  rect x: %d\n", update_data->update_region.left);
            einkfb_debug("  rect y: %d\n", update_data->update_region.top);
            einkfb_debug("  rect w: %d\n", update_data->update_region.width);
            einkfb_debug("  rect h: %d\n", update_data->update_region.height);
//.........这里部分代码省略.........
开发者ID:fread-ink,项目名称:fread-kernel-k4,代码行数:101,代码来源:fslepdc_hal.c

示例8: iwl_send_scan_abort

static int iwl_send_scan_abort(struct iwl_priv *priv)
{
	int ret;
	struct iwl_host_cmd cmd = {
		.id = REPLY_SCAN_ABORT_CMD,
		.flags = CMD_SYNC | CMD_WANT_SKB,
	};
	__le32 *status;

	/* Exit instantly with error when device is not ready
	 * to receive scan abort command or it does not perform
	 * hardware scan currently */
	if (!test_bit(STATUS_READY, &priv->status) ||
	    !test_bit(STATUS_SCAN_HW, &priv->status) ||
	    test_bit(STATUS_FW_ERROR, &priv->status))
		return -EIO;

	ret = iwl_dvm_send_cmd(priv, &cmd);
	if (ret)
		return ret;

	status = (void *)cmd.resp_pkt->data;
	if (*status != CAN_ABORT_STATUS) {
		/* The scan abort will return 1 for success or
		 * 2 for "failure".  A failure condition can be
		 * due to simply not being in an active scan which
		 * can occur if we send the scan abort before we
		 * the microcode has notified us that a scan is
		 * completed. */
		IWL_DEBUG_SCAN(priv, "SCAN_ABORT ret %d.\n",
			       le32_to_cpu(*status));
		ret = -EIO;
	}

	iwl_free_resp(&cmd);
	return ret;
}

static void iwl_complete_scan(struct iwl_priv *priv, bool aborted)
{
	/* check if scan was requested from mac80211 */
	if (priv->scan_request) {
		IWL_DEBUG_SCAN(priv, "Complete scan in mac80211\n");
		ieee80211_scan_completed(priv->hw, aborted);
	}

	priv->scan_type = IWL_SCAN_NORMAL;
	priv->scan_vif = NULL;
	priv->scan_request = NULL;
}

static void iwl_process_scan_complete(struct iwl_priv *priv)
{
	bool aborted;

	lockdep_assert_held(&priv->mutex);

	if (!test_and_clear_bit(STATUS_SCAN_COMPLETE, &priv->status))
		return;

	IWL_DEBUG_SCAN(priv, "Completed scan.\n");

	cancel_delayed_work(&priv->scan_check);

	aborted = test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->status);
	if (aborted)
		IWL_DEBUG_SCAN(priv, "Aborted scan completed.\n");

	if (!test_and_clear_bit(STATUS_SCANNING, &priv->status)) {
		IWL_DEBUG_SCAN(priv, "Scan already completed.\n");
		goto out_settings;
	}

	if (priv->scan_type != IWL_SCAN_NORMAL && !aborted) {
		int err;

		/* Check if mac80211 requested scan during our internal scan */
		if (priv->scan_request == NULL)
			goto out_complete;

		/* If so request a new scan */
		err = iwl_scan_initiate(priv, priv->scan_vif, IWL_SCAN_NORMAL,
					priv->scan_request->channels[0]->band);
		if (err) {
			IWL_DEBUG_SCAN(priv,
				"failed to initiate pending scan: %d\n", err);
			aborted = true;
			goto out_complete;
		}

		return;
	}

out_complete:
	iwl_complete_scan(priv, aborted);

out_settings:
	/* Can we still talk to firmware ? */
	if (!iwl_is_ready_rf(priv))
		return;
//.........这里部分代码省略.........
开发者ID:03199618,项目名称:linux,代码行数:101,代码来源:scan.c

示例9: soc_pcm_prepare

/*
 * Called by ALSA when the PCM substream is prepared, can set format, sample
 * rate, etc.  This function is non atomic and can be called multiple times,
 * it can refer to the runtime info.
 */
static int soc_pcm_prepare(struct snd_pcm_substream *substream)
{
	struct snd_soc_pcm_runtime *rtd = substream->private_data;
	struct snd_soc_platform *platform = rtd->platform;
	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
	struct snd_soc_dai *codec_dai = rtd->codec_dai;
	int ret = 0;

	mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);

	if (rtd->dai_link->ops && rtd->dai_link->ops->prepare) {
		ret = rtd->dai_link->ops->prepare(substream);
		if (ret < 0) {
			pr_err("asoc: machine prepare error: %d\n", ret);
			goto out;
		}
	}

	if (platform->driver->ops && platform->driver->ops->prepare) {
		ret = platform->driver->ops->prepare(substream);
		if (ret < 0) {
			dev_err(platform->dev, "platform prepare error: %d\n",
				ret);
			goto out;
		}
	}

	if (codec_dai->driver->ops->prepare) {
		ret = codec_dai->driver->ops->prepare(substream, codec_dai);
		if (ret < 0) {
			dev_err(codec_dai->dev, "DAI prepare error: %d\n",
				ret);
			goto out;
		}
	}

	if (cpu_dai->driver->ops->prepare) {
		ret = cpu_dai->driver->ops->prepare(substream, cpu_dai);
		if (ret < 0) {
			dev_err(cpu_dai->dev, "DAI prepare error: %d\n",
				ret);
			goto out;
		}
	}

	/* cancel any delayed stream shutdown that is pending */
	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
	    codec_dai->pop_wait) {
		codec_dai->pop_wait = 0;
		cancel_delayed_work(&rtd->delayed_work);
	}

	snd_soc_dapm_stream_event(rtd, substream->stream, codec_dai,
				  SND_SOC_DAPM_STREAM_START);

	snd_soc_dai_digital_mute(codec_dai, 0);

out:
	mutex_unlock(&rtd->pcm_mutex);
	return ret;
}
开发者ID:arshull,项目名称:halaszk-UNIVERSAL5420,代码行数:66,代码来源:soc-pcm.c

示例10: ieee80211softmac_wx_set_essid

int
ieee80211softmac_wx_set_essid(struct net_device *net_dev,
			      struct iw_request_info *info,
			      union iwreq_data *data,
			      char *extra)
{
	struct ieee80211softmac_device *sm = ieee80211_priv(net_dev);
	struct ieee80211softmac_network *n;
	struct ieee80211softmac_auth_queue_item *authptr;
	int length = 0;

	mutex_lock(&sm->associnfo.mutex);

	/* Check if we're already associating to this or another network
	 * If it's another network, cancel and start over with our new network
	 * If it's our network, ignore the change, we're already doing it!
	 */
	if((sm->associnfo.associating || sm->associnfo.associated) &&
	   (data->essid.flags && data->essid.length)) {
		/* Get the associating network */
		n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid);
		if(n && n->essid.len == data->essid.length &&
		   !memcmp(n->essid.data, extra, n->essid.len)) {
			dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n",
				MAC_ARG(sm->associnfo.bssid));
			goto out;
		} else {
			dprintk(KERN_INFO PFX "Canceling existing associate request!\n");
			/* Cancel assoc work */
			cancel_delayed_work(&sm->associnfo.work);
			/* We don't have to do this, but it's a little cleaner */
			list_for_each_entry(authptr, &sm->auth_queue, list)
				cancel_delayed_work(&authptr->work);
			sm->associnfo.bssvalid = 0;
			sm->associnfo.bssfixed = 0;
			flush_scheduled_work();
			sm->associnfo.associating = 0;
			sm->associnfo.associated = 0;
		}
	}


	sm->associnfo.static_essid = 0;
	sm->associnfo.assoc_wait = 0;

	if (data->essid.flags && data->essid.length) {
		length = min((int)data->essid.length, IW_ESSID_MAX_SIZE);
		if (length) {
			memcpy(sm->associnfo.req_essid.data, extra, length);
			sm->associnfo.static_essid = 1;
		}
	}

	/* set our requested ESSID length.
	 * If applicable, we have already copied the data in */
	sm->associnfo.req_essid.len = length;

	sm->associnfo.associating = 1;
	/* queue lower level code to do work (if necessary) */
	schedule_delayed_work(&sm->associnfo.work, 0);
out:
	mutex_unlock(&sm->associnfo.mutex);

	return 0;
}
开发者ID:StephenMacras,项目名称:dsl-n55u-bender,代码行数:65,代码来源:ieee80211softmac_wx.c

示例11: cancel_mac_stats_update

static inline void cancel_mac_stats_update(struct adapter *ap)
{
	cancel_delayed_work(&ap->stats_update_task);
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:4,代码来源:cxgb2.c

示例12: set_h3_irda_mode

static inline void set_h3_irda_mode(int mode)
{
	cancel_delayed_work(&set_h3_gpio_expa_work);
	which_speed = mode;
	schedule_work(&set_h3_gpio_expa_work);
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:6,代码来源:omap1610-ir.c

示例13: omap_cpu_thermal_manager

static int omap_cpu_thermal_manager(struct list_head *cooling_list, int temp)
{
	int cpu_temp, zone = NO_ACTION;
	bool set_cooling_level = true;

	omap_gov->sensor_temp = temp;
	cpu_temp = convert_omap_sensor_temp_to_hotspot_temp(temp);

	if (cpu_temp >= OMAP_FATAL_TEMP) {
		omap_fatal_zone(cpu_temp);
		return FATAL_ZONE;
	} else if (cpu_temp >= OMAP_PANIC_TEMP) {
		int temp_upper;

		omap_gov->panic_zone_reached++;
		temp_upper = (((OMAP_FATAL_TEMP - OMAP_PANIC_TEMP) / 4) *
				omap_gov->panic_zone_reached) + OMAP_PANIC_TEMP;
		if (temp_upper >= OMAP_FATAL_TEMP)
			temp_upper = OMAP_FATAL_TEMP;
		omap_thermal_zones[PANIC_ZONE - 1].temp_upper = temp_upper;
		zone = PANIC_ZONE;
	} else if (cpu_temp < (OMAP_PANIC_TEMP - HYSTERESIS_VALUE)) {
		if (cpu_temp >= OMAP_ALERT_TEMP) {
			set_cooling_level = omap_gov->panic_zone_reached == 0;
			zone = ALERT_ZONE;
		} else if (cpu_temp < (OMAP_ALERT_TEMP - HYSTERESIS_VALUE)) {
			if (cpu_temp >= OMAP_MONITOR_TEMP) {
				omap_gov->panic_zone_reached = 0;
				zone = MONITOR_ZONE;
			} else {
				/*
				 * this includes the case where :
				 * (OMAP_MONITOR_TEMP - HYSTERESIS_VALUE) <= T
				 * && T < OMAP_MONITOR_TEMP
				 */
				omap_gov->panic_zone_reached = 0;
				zone = SAFE_ZONE;
			}
		} else {
			/*
			 * this includes the case where :
			 * (OMAP_ALERT_TEMP - HYSTERESIS_VALUE) <= T
			 * && T < OMAP_ALERT_TEMP
			 */
			omap_gov->panic_zone_reached = 0;
			zone = MONITOR_ZONE;
		}
	} else {
		/*
		 * this includes the case where :
		 * (OMAP_PANIC_TEMP - HYSTERESIS_VALUE) <= T < OMAP_PANIC_TEMP
		 */
		set_cooling_level = omap_gov->panic_zone_reached == 0;
		zone = ALERT_ZONE;
	}

	if (zone != NO_ACTION) {
		struct omap_thermal_zone *therm_zone;

		therm_zone = &omap_thermal_zones[zone - 1];
		if (omap_gov->panic_zone_reached)
			start_panic_guard();
		else
			cancel_delayed_work(&omap_gov->decrease_mpu_freq_work);

		if ((omap_gov->prev_zone != zone) || (zone == PANIC_ZONE)) {
			pr_info("%s:sensor %d avg sensor %d pcb ",
				 __func__, temp,
				 omap_gov->avg_cpu_sensor_temp);
			pr_info("%d, delta %d hot spot %d\n",
				 omap_gov->pcb_temp, omap_gov->absolute_delta,
				 cpu_temp);
			pr_info("%s: hot spot temp %d - going into %s zone\n",
				__func__, cpu_temp, therm_zone->name);
			omap_gov->prev_zone = zone;
		}
		omap_enter_zone(therm_zone, set_cooling_level,
				cooling_list, cpu_temp);
	}

	omap_gov->zone_info = zone;

	return zone;
}
开发者ID:b7acc,项目名称:kernel_omap_bowser-common,代码行数:84,代码来源:omap_die_governor.c

示例14: _mali_osk_wq_delayed_cancel_work_async

void _mali_osk_wq_delayed_cancel_work_async( _mali_osk_wq_delayed_work_t *work )
{
	mali_osk_wq_delayed_work_object_t *work_object = (mali_osk_wq_delayed_work_object_t *)work;
	cancel_delayed_work(&work_object->work);
}
开发者ID:ih24n69,项目名称:android_samsung_sm-g355h_kernel,代码行数:5,代码来源:mali_osk_wq.c

示例15: exynos4x12_tmu_irq_handler


//.........这里部分代码省略.........
	device_remove_file(&pdev->dev, &dev_attr_tmu_state);

err_sysfs_file2:
	device_remove_file(&pdev->dev, &dev_attr_temperature);

err_sysfs_file1:
	if (info->irq >= 0)
		free_irq(info->irq, info);

err_irq:
	destroy_workqueue(tmu_monitor_wq);

err_wq:
	iounmap(info->tmu_base);

err_nomap:
	release_resource(info->ioarea);
	kfree(info->ioarea);

err_nores:
	kfree(info);
	info = NULL;

err_nomem:
	dev_err(&pdev->dev, "initialization failed.\n");

	return ret;
}

static int __devinit s5p_tmu_remove(struct platform_device *pdev)
{
	struct s5p_tmu_info *info = platform_get_drvdata(pdev);

	cancel_delayed_work(&info->polling);
	destroy_workqueue(tmu_monitor_wq);

	device_remove_file(&pdev->dev, &dev_attr_temperature);
	device_remove_file(&pdev->dev, &dev_attr_tmu_state);

	if (info->irq >= 0)
		free_irq(info->irq, info);

	iounmap(info->tmu_base);

	release_resource(info->ioarea);
	kfree(info->ioarea);

	kfree(info);
	info = NULL;

	pr_info("%s is removed\n", dev_name(&pdev->dev));
	return 0;
}

#ifdef CONFIG_PM
static int s5p_tmu_suspend(struct platform_device *pdev, pm_message_t state)
{
	struct s5p_tmu_info *info = platform_get_drvdata(pdev);

	if (!info)
		return -EAGAIN;

	/* save register value */
	info->reg_save[0] = __raw_readl(info->tmu_base + EXYNOS4_TMU_CONTROL);
	info->reg_save[1] = __raw_readl(info->tmu_base + EXYNOS4_TMU_SAMPLING_INTERNAL);
	info->reg_save[2] = __raw_readl(info->tmu_base + EXYNOS4_TMU_COUNTER_VALUE0);
开发者ID:yerlirock,项目名称:void-kernel,代码行数:67,代码来源:tmu.c


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