• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ del_timer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: qos_del_qdisc

static int qos_del_qdisc(ASF_uint32_t  ulVsgId,
			ASFQOSDeleteQdisc_t *qdisc)
{
	struct  asf_qdisc *root;
	uint32_t i;
	int	bLockFlag;

	root = qdisc->dev->asf_qdisc;
	if (!root) {
		asf_err("Qdisc not exists.\n");
		return ASFQOS_FAILURE;
	}

	if (qdisc->qdisc_type != ASF_QDISC_TBF) {
		asf_err("Unsupported Qdisc Delete Command.\n");
		return ASFQOS_SUCCESS;
	}
	ASF_RCU_READ_LOCK(bLockFlag);
	/* If root Qdisc is TBF then simply delete Shaper */
	if (root->qdisc_type == ASF_QDISC_TBF) {
		root->dev->asf_qdisc = NULL;
		kfree(root->priv);
		del_timer(&(root->timer));
		/* NAPI */
		napi_disable(&(root->qos_napi));
		netif_napi_del(&(root->qos_napi));

		if (root->pShaper)
			kfree(root->pShaper);
		for (i = 0; i < ASF_MAX_IFACES; i++) {
			if (qdisc_in_use[i] == root) {
				spin_lock(&cnt_lock);
				qdisc_in_use[i] = NULL;
				qdisc_cnt--;
				spin_unlock(&cnt_lock);
				asf_debug("Deleted Qdisc at index %d, qdisc_cnt %d\n",
					i, qdisc_cnt);
				break;
			}
		}
		kfree(root);
	} else {
		/* If Root is not TBF , it means we have
		configured any SCHEDULER over SHAPER */
		if (qdisc->parent != ROOT_ID) {
			/* Should be Queue Level Shaper */
			switch (root->qdisc_type) {
			case ASF_QDISC_PRIO:
			case ASF_QDISC_PRIO_DRR:
			case ASF_QDISC_DRR:
			{
				struct  asf_prio_sched_data *root_priv;
				/* Find out the Queue, to which shaper need to apply */
				i = qdisc->parent & MINOR_ID;
				i--; /* Index value */

				/* Deleting Per Queue Shaper */
				root_priv = root->priv;
				if (root_priv->q[i].shaper) {
					root_priv->q[i].shaper =  NULL;
					kfree(root_priv->q[i].shaper);
				}

			}
			break;
			default:
				asf_err("Ohh.., Unsupported Parent Qdisc\n");
			}

			ASF_RCU_READ_UNLOCK(bLockFlag);
			return ASFQOS_SUCCESS;
		}
		/* ELSE Request for Deleting Root TBF Shaper */
		/* Delete Inactive Shaper Qdisc */
		for (i = 0; i < ASF_MAX_IFACES; i++) {
			struct  asf_qdisc *x = qdisc_in_use[i];
			if (!x)
				continue;
			if ((x->handle == qdisc->handle) &&
					(x->dev == qdisc->dev)) {
				spin_lock(&cnt_lock);
				qdisc_in_use[i] = NULL;
				qdisc_cnt--;
				spin_unlock(&cnt_lock);
				asf_debug("Deleted Qdisc at index %d, qdisc_cnt %d\n",
					i, qdisc_cnt);
				kfree(x);
				break;
			}
		}
		/* Now delete Child Qdisc */
		qos_flush_qdisc(ulVsgId, qdisc);
	}
	ASF_RCU_READ_UNLOCK(bLockFlag);
	return ASFQOS_SUCCESS;
}
开发者ID:fsl-dpacc,项目名称:g_ipsec_la,代码行数:96,代码来源:asfqosapi.c


示例2: mesh_rx_plink_frame


//.........这里部分代码省略.........
			break;
		default:
			spin_unlock_bh(&sta->lock);
			break;
		}
		break;

	case PLINK_OPN_RCVD:
		switch (event) {
		case OPN_RJCT:
		case CNF_RJCT:
			reason = cpu_to_le16(MESH_CAPABILITY_POLICY_VIOLATION);
		case CLS_ACPT:
			if (!reason)
				reason = cpu_to_le16(MESH_CLOSE_RCVD);
			sta->reason = reason;
			sta->plink_state = PLINK_HOLDING;
			if (!mod_plink_timer(sta,
					     dot11MeshHoldingTimeout(sdata)))
				sta->ignore_plink_timer = true;

			llid = sta->llid;
			spin_unlock_bh(&sta->lock);
			mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
					    plid, reason);
			break;
		case OPN_ACPT:
			llid = sta->llid;
			spin_unlock_bh(&sta->lock);
			mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
					    plid, 0);
			break;
		case CNF_ACPT:
			del_timer(&sta->plink_timer);
			sta->plink_state = PLINK_ESTAB;
			mesh_plink_inc_estab_count(sdata);
			spin_unlock_bh(&sta->lock);
			mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
				sta->sta.addr);
			break;
		default:
			spin_unlock_bh(&sta->lock);
			break;
		}
		break;

	case PLINK_CNF_RCVD:
		switch (event) {
		case OPN_RJCT:
		case CNF_RJCT:
			reason = cpu_to_le16(MESH_CAPABILITY_POLICY_VIOLATION);
		case CLS_ACPT:
			if (!reason)
				reason = cpu_to_le16(MESH_CLOSE_RCVD);
			sta->reason = reason;
			sta->plink_state = PLINK_HOLDING;
			if (!mod_plink_timer(sta,
					     dot11MeshHoldingTimeout(sdata)))
				sta->ignore_plink_timer = true;

			llid = sta->llid;
			spin_unlock_bh(&sta->lock);
			mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid,
					    plid, reason);
			break;
		case OPN_ACPT:
开发者ID:Addision,项目名称:LVS,代码行数:67,代码来源:mesh_plink.c


示例3: irlmp_stop_idle_timer

void irlmp_stop_idle_timer(struct lap_cb *self) 
{
	/* If timer is activated, kill it! */
	del_timer(&self->idle_timer);
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:5,代码来源:timer.c


示例4: hfc2bds0_interrupt


//.........这里部分代码省略.........
		}
		if (val & 0x10) {
			if (!(bcs=Sel_BCS(cs, 1))) {
				if (cs->debug)
					debugl1(cs, "hfcd spurious 0x10 IRQ");
			} else 
				main_rec_2bds0(bcs);
		}
		if (val & 0x01) {
			if (!(bcs=Sel_BCS(cs, 0))) {
				if (cs->debug)
					debugl1(cs, "hfcd spurious 0x01 IRQ");
			} else {
				if (bcs->tx_skb) {
					if (!test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) {
						hfc_fill_fifo(bcs);
						test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
					} else
						debugl1(cs,"fill_data %d blocked", bcs->channel);
				} else {
					if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) {
						if (!test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) {
							hfc_fill_fifo(bcs);
							test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
						} else
							debugl1(cs,"fill_data %d blocked", bcs->channel);
					} else {
						hfc_sched_event(bcs, B_XMTBUFREADY);
					}
				}
			}
		}
		if (val & 0x02) {
			if (!(bcs=Sel_BCS(cs, 1))) {
				if (cs->debug)
					debugl1(cs, "hfcd spurious 0x02 IRQ");
			} else {
				if (bcs->tx_skb) {
					if (!test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) {
						hfc_fill_fifo(bcs);
						test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
					} else
						debugl1(cs,"fill_data %d blocked", bcs->channel);
				} else {
					if ((bcs->tx_skb = skb_dequeue(&bcs->squeue))) {
						if (!test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) {
							hfc_fill_fifo(bcs);
							test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
						} else
							debugl1(cs,"fill_data %d blocked", bcs->channel);
					} else {
						hfc_sched_event(bcs, B_XMTBUFREADY);
					}
				}
			}
		}
		if (val & 0x20) {	/* receive dframe */
			receive_dmsg(cs);
		}
		if (val & 0x04) {	/* dframe transmitted */
			if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags))
				del_timer(&cs->dbusytimer);
			if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags))
				sched_event_D(cs, D_CLEARBUSY);
			if (cs->tx_skb)
				if (cs->tx_skb->len) {
					if (!test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) {
						hfc_fill_dfifo(cs);
						test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
					} else {
						debugl1(cs, "hfc_fill_dfifo irq blocked");
					}
					goto afterXPR;
				} else {
					dev_kfree_skb(cs->tx_skb, FREE_WRITE);
					cs->tx_cnt = 0;
					cs->tx_skb = NULL;
				}
			if ((cs->tx_skb = skb_dequeue(&cs->sq))) {
				cs->tx_cnt = 0;
				if (!test_and_set_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags)) {
					hfc_fill_dfifo(cs);
					test_and_clear_bit(FLG_LOCK_ATOMIC, &cs->HW_Flags);
				} else {
					debugl1(cs, "hfc_fill_dfifo irq blocked");
				}
			} else
				sched_event_D(cs, D_XMTBUFREADY);
		}
      afterXPR:
		if (cs->hw.hfcD.int_s1 && count--) {
			val = cs->hw.hfcD.int_s1;
			cs->hw.hfcD.int_s1 = 0;
			if (cs->debug & L1_DEB_ISAC)
				debugl1(cs, "HFCD irq %x loop %d", val, 15-count);
		} else
			val = 0;
		restore_flags(flags);
	}
}
开发者ID:shattered,项目名称:linux-m68k,代码行数:101,代码来源:hfc_2bds0.c


示例5: ace_fsm_dostate

static void ace_fsm_dostate(struct ace_device *ace)
{
	struct request *req;
	u32 status;
	u16 val;
	int count;

#if defined(DEBUG)
	dev_dbg(ace->dev, "fsm_state=%i, id_req_count=%i\n",
		ace->fsm_state, ace->id_req_count);
#endif

	/* Verify that there is actually a CF in the slot. If not, then
	 * bail out back to the idle state and wake up all the waiters */
	status = ace_in32(ace, ACE_STATUS);
	if ((status & ACE_STATUS_CFDETECT) == 0) {
		ace->fsm_state = ACE_FSM_STATE_IDLE;
		ace->media_change = 1;
		set_capacity(ace->gd, 0);
		dev_info(ace->dev, "No CF in slot\n");

		/* Drop all pending requests */
		while ((req = elv_next_request(ace->queue)) != NULL)
			end_request(req, 0);

		/* Drop back to IDLE state and notify waiters */
		ace->fsm_state = ACE_FSM_STATE_IDLE;
		ace->id_result = -EIO;
		while (ace->id_req_count) {
			complete(&ace->id_completion);
			ace->id_req_count--;
		}
	}

	switch (ace->fsm_state) {
	case ACE_FSM_STATE_IDLE:
		/* See if there is anything to do */
		if (ace->id_req_count || ace_get_next_request(ace->queue)) {
			ace->fsm_iter_num++;
			ace->fsm_state = ACE_FSM_STATE_REQ_LOCK;
			mod_timer(&ace->stall_timer, jiffies + HZ);
			if (!timer_pending(&ace->stall_timer))
				add_timer(&ace->stall_timer);
			break;
		}
		del_timer(&ace->stall_timer);
		ace->fsm_continue_flag = 0;
		break;

	case ACE_FSM_STATE_REQ_LOCK:
		if (ace_in(ace, ACE_STATUS) & ACE_STATUS_MPULOCK) {
			/* Already have the lock, jump to next state */
			ace->fsm_state = ACE_FSM_STATE_WAIT_CFREADY;
			break;
		}

		/* Request the lock */
		val = ace_in(ace, ACE_CTRL);
		ace_out(ace, ACE_CTRL, val | ACE_CTRL_LOCKREQ);
		ace->fsm_state = ACE_FSM_STATE_WAIT_LOCK;
		break;

	case ACE_FSM_STATE_WAIT_LOCK:
		if (ace_in(ace, ACE_STATUS) & ACE_STATUS_MPULOCK) {
			/* got the lock; move to next state */
			ace->fsm_state = ACE_FSM_STATE_WAIT_CFREADY;
			break;
		}

		/* wait a bit for the lock */
		ace_fsm_yield(ace);
		break;

	case ACE_FSM_STATE_WAIT_CFREADY:
		status = ace_in32(ace, ACE_STATUS);
		if (!(status & ACE_STATUS_RDYFORCFCMD) ||
		    (status & ACE_STATUS_CFBSY)) {
			/* CF card isn't ready; it needs to be polled */
			ace_fsm_yield(ace);
			break;
		}

		/* Device is ready for command; determine what to do next */
		if (ace->id_req_count)
			ace->fsm_state = ACE_FSM_STATE_IDENTIFY_PREPARE;
		else
			ace->fsm_state = ACE_FSM_STATE_REQ_PREPARE;
		break;

	case ACE_FSM_STATE_IDENTIFY_PREPARE:
		/* Send identify command */
		ace->fsm_task = ACE_TASK_IDENTIFY;
		ace->data_ptr = &ace->cf_id;
		ace->data_count = ACE_BUF_PER_SECTOR;
		ace_out(ace, ACE_SECCNTCMD, ACE_SECCNTCMD_IDENTIFY);

		/* As per datasheet, put config controller in reset */
		val = ace_in(ace, ACE_CTRL);
		ace_out(ace, ACE_CTRL, val | ACE_CTRL_CFGRESET);

//.........这里部分代码省略.........
开发者ID:10x-Amin,项目名称:x10_Th_kernel,代码行数:101,代码来源:xsysace.c


示例6: sfq_change

static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
{
	struct sfq_sched_data *q = qdisc_priv(sch);
	struct tc_sfq_qopt *ctl = nla_data(opt);
	struct tc_sfq_qopt_v1 *ctl_v1 = NULL;
	unsigned int qlen;
	struct red_parms *p = NULL;

	if (opt->nla_len < nla_attr_size(sizeof(*ctl)))
		return -EINVAL;
	if (opt->nla_len >= nla_attr_size(sizeof(*ctl_v1)))
		ctl_v1 = nla_data(opt);
	if (ctl->divisor &&
	    (!is_power_of_2(ctl->divisor) || ctl->divisor > 65536))
		return -EINVAL;
	if (ctl_v1 && ctl_v1->qth_min) {
		p = kmalloc(sizeof(*p), GFP_KERNEL);
		if (!p)
			return -ENOMEM;
	}
	sch_tree_lock(sch);
	if (ctl->quantum) {
		q->quantum = ctl->quantum;
		q->scaled_quantum = SFQ_ALLOT_SIZE(q->quantum);
	}
	q->perturb_period = ctl->perturb_period * HZ;
	if (ctl->flows)
		q->maxflows = min_t(u32, ctl->flows, SFQ_MAX_FLOWS);
	if (ctl->divisor) {
		q->divisor = ctl->divisor;
		q->maxflows = min_t(u32, q->maxflows, q->divisor);
	}
	if (ctl_v1) {
		if (ctl_v1->depth)
			q->maxdepth = min_t(u32, ctl_v1->depth, SFQ_MAX_DEPTH);
		if (p) {
			swap(q->red_parms, p);
			red_set_parms(q->red_parms,
				      ctl_v1->qth_min, ctl_v1->qth_max,
				      ctl_v1->Wlog,
				      ctl_v1->Plog, ctl_v1->Scell_log,
				      NULL,
				      ctl_v1->max_P);
		}
		q->flags = ctl_v1->flags;
		q->headdrop = ctl_v1->headdrop;
	}
	if (ctl->limit) {
		q->limit = min_t(u32, ctl->limit, q->maxdepth * q->maxflows);
		q->maxflows = min_t(u32, q->maxflows, q->limit);
	}

	qlen = sch->q.qlen;
	while (sch->q.qlen > q->limit)
		sfq_drop(sch);
	qdisc_tree_decrease_qlen(sch, qlen - sch->q.qlen);

	del_timer(&q->perturb_timer);
	if (q->perturb_period) {
		mod_timer(&q->perturb_timer, jiffies + q->perturb_period);
		q->perturbation = net_random();
	}
	sch_tree_unlock(sch);
	kfree(p);
	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:66,代码来源:sch_sfq.c


示例7: stop_timer

static void stop_timer(void)
{
	del_timer(&system_off_timer);
}
开发者ID:egonalter,项目名称:R-Link_kernel,代码行数:4,代码来源:board-strasbourg-psupply.c


示例8: athr_gmac_timer_del

void
athr_gmac_timer_del(athr_gmac_t *mac)
{
   if(enable_timer)
      del_timer(&mac->mac_phy_timer);
}
开发者ID:KHATEEBNSIT,项目名称:AP,代码行数:6,代码来源:athrs_mac_timer.c


示例9: ppp_cp_event

/* SCA: RCR+ must supply id, len and data
   SCN: RCR- must supply code, id, len and data
   STA: RTR must supply id
   SCJ: RUC must supply CP packet len and data */
static void ppp_cp_event(struct net_device *dev, u16 pid, u16 event, u8 code,
			 u8 id, unsigned int len, const void *data)
{
	int old_state, action;
	struct ppp *ppp = get_ppp(dev);
	struct proto *proto = get_proto(dev, pid);

	old_state = proto->state;
	BUG_ON(old_state >= STATES);
	BUG_ON(event >= EVENTS);

#if DEBUG_STATE
	printk(KERN_DEBUG "%s: %s ppp_cp_event(%s) %s ...\n", dev->name,
	       proto_name(pid), event_names[event], state_names[proto->state]);
#endif

	action = cp_table[event][old_state];

	proto->state = action & STATE_MASK;
	if (action & (SCR | STR)) /* set Configure-Req/Terminate-Req timer */
		mod_timer(&proto->timer, proto->timeout =
			  jiffies + ppp->req_timeout * HZ);
	if (action & ZRC)
		proto->restart_counter = 0;
	if (action & IRC)
		proto->restart_counter = (proto->state == STOPPING) ?
			ppp->term_retries : ppp->cr_retries;

	if (action & SCR)	/* send Configure-Request */
		ppp_tx_cp(dev, pid, CP_CONF_REQ, proto->cr_id = ++ppp->seq,
			  0, NULL);
	if (action & SCA)	/* send Configure-Ack */
		ppp_tx_cp(dev, pid, CP_CONF_ACK, id, len, data);
	if (action & SCN)	/* send Configure-Nak/Reject */
		ppp_tx_cp(dev, pid, code, id, len, data);
	if (action & STR)	/* send Terminate-Request */
		ppp_tx_cp(dev, pid, CP_TERM_REQ, ++ppp->seq, 0, NULL);
	if (action & STA)	/* send Terminate-Ack */
		ppp_tx_cp(dev, pid, CP_TERM_ACK, id, 0, NULL);
	if (action & SCJ)	/* send Code-Reject */
		ppp_tx_cp(dev, pid, CP_CODE_REJ, ++ppp->seq, len, data);

	if (old_state != OPENED && proto->state == OPENED) {
		netdev_info(dev, "%s up\n", proto_name(pid));
		if (pid == PID_LCP) {
			netif_dormant_off(dev);
			ppp_cp_event(dev, PID_IPCP, START, 0, 0, 0, NULL);
			ppp_cp_event(dev, PID_IPV6CP, START, 0, 0, 0, NULL);
			ppp->last_pong = jiffies;
			mod_timer(&proto->timer, proto->timeout =
				  jiffies + ppp->keepalive_interval * HZ);
		}
	}
	if (old_state == OPENED && proto->state != OPENED) {
		netdev_info(dev, "%s down\n", proto_name(pid));
		if (pid == PID_LCP) {
			netif_dormant_on(dev);
			ppp_cp_event(dev, PID_IPCP, STOP, 0, 0, 0, NULL);
			ppp_cp_event(dev, PID_IPV6CP, STOP, 0, 0, 0, NULL);
		}
	}
	if (old_state != CLOSED && proto->state == CLOSED)
		del_timer(&proto->timer);

#if DEBUG_STATE
	printk(KERN_DEBUG "%s: %s ppp_cp_event(%s) ... %s\n", dev->name,
	       proto_name(pid), event_names[event], state_names[proto->state]);
#endif
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:73,代码来源:hdlc_ppp.c


示例10: jiffies_exit

static void  __exit jiffies_exit(void)
{
	del_timer(&jiffies_timer);
}
开发者ID:jiankangshiye,项目名称:harvis_driver,代码行数:4,代码来源:jiffies.c


示例11: lbs_thread


//.........这里部分代码省略.........

		if (priv->wakeup_dev_required) {
			lbs_deb_thread("Waking up device...\n");
			/* Wake up device */
			if (priv->exit_deep_sleep(priv))
				lbs_deb_thread("Wakeup device failed\n");
			continue;
		}

		/* command timeout stuff */
		if (priv->cmd_timed_out && priv->cur_cmd) {
			struct cmd_ctrl_node *cmdnode = priv->cur_cmd;

			netdev_info(dev, "Timeout submitting command 0x%04x\n",
				    le16_to_cpu(cmdnode->cmdbuf->command));
			lbs_complete_command(priv, cmdnode, -ETIMEDOUT);

			/* Reset card, but only when it isn't in the process
			 * of being shutdown anyway. */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
			if (!dev->dismantle && priv->reset_card)
#else
			if (priv->reset_card)
#endif
				priv->reset_card(priv);
		}
		priv->cmd_timed_out = 0;

		if (!priv->fw_ready)
			continue;

		/* Check if we need to confirm Sleep Request received previously */
		if (priv->psstate == PS_STATE_PRE_SLEEP &&
		    !priv->dnld_sent && !priv->cur_cmd) {
			if (priv->connect_status == LBS_CONNECTED) {
				lbs_deb_thread("pre-sleep, currenttxskb %p, "
					"dnld_sent %d, cur_cmd %p\n",
					priv->currenttxskb, priv->dnld_sent,
					priv->cur_cmd);

				lbs_ps_confirm_sleep(priv);
			} else {
				/* workaround for firmware sending
				 * deauth/linkloss event immediately
				 * after sleep request; remove this
				 * after firmware fixes it
				 */
				priv->psstate = PS_STATE_AWAKE;
				netdev_alert(dev,
					     "ignore PS_SleepConfirm in non-connected state\n");
			}
		}

		/* The PS state is changed during processing of Sleep Request
		 * event above
		 */
		if ((priv->psstate == PS_STATE_SLEEP) ||
		    (priv->psstate == PS_STATE_PRE_SLEEP))
			continue;

		if (priv->is_deep_sleep)
			continue;

		/* Execute the next command */
		if (!priv->dnld_sent && !priv->cur_cmd)
			lbs_execute_next_command(priv);

		spin_lock_irq(&priv->driver_lock);
		if (!priv->dnld_sent && priv->tx_pending_len > 0) {
			int ret = priv->hw_host_to_card(priv, MVMS_DAT,
							priv->tx_pending_buf,
							priv->tx_pending_len);
			if (ret) {
				lbs_deb_tx("host_to_card failed %d\n", ret);
				priv->dnld_sent = DNLD_RES_RECEIVED;
			} else {
				mod_timer(&priv->tx_lockup_timer,
					  jiffies + (HZ * 5));
			}
			priv->tx_pending_len = 0;
			if (!priv->currenttxskb) {
				/* We can wake the queues immediately if we aren't
				   waiting for TX feedback */
				if (priv->connect_status == LBS_CONNECTED)
					netif_wake_queue(priv->dev);
				if (priv->mesh_dev &&
				    netif_running(priv->mesh_dev))
					netif_wake_queue(priv->mesh_dev);
			}
		}
		spin_unlock_irq(&priv->driver_lock);
	}

	del_timer(&priv->command_timer);
	del_timer(&priv->tx_lockup_timer);
	del_timer(&priv->auto_deepsleep_timer);

	lbs_deb_leave(LBS_DEB_THREAD);
	return 0;
}
开发者ID:Kratos1982,项目名称:UbuntuTouch,代码行数:101,代码来源:main.c


示例12: zero_resume

static void zero_resume(struct usb_composite_dev *cdev)
{
	DBG(cdev, "%s\n", __func__);
	del_timer(&autoresume_timer);
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:5,代码来源:zero.c


示例13: qos_flush_qdisc

static int qos_flush_qdisc(ASF_uint32_t  ulVsgId,
			ASFQOSDeleteQdisc_t *qdisc)
{
	struct  asf_qdisc *root;
	int	i;
	int	bLockFlag;

	/* Root Qdisc  */
	root = qdisc->dev->asf_qdisc;
	if (!root) {
		asf_err("Qdisc not exists.\n");
		return ASFQOS_SUCCESS;
	}

	ASF_RCU_READ_LOCK(bLockFlag);

	qdisc->dev->asf_qdisc = NULL;

	/* Destroying Shaper */
	switch (root->qdisc_type) {
	case ASF_QDISC_PRIO_DRR:
	case ASF_QDISC_DRR:
	case ASF_QDISC_PRIO:
	{
		struct  asf_prio_sched_data *root_priv;

		root_priv = root->priv;
		for (i = 0; i < ASF_PRIO_MAX; i++) {
			if (root_priv->q[i].shaper)
				kfree(root_priv->q[i].shaper);
		}

	}
	break;
	default:
		asf_err("Ohh.., Unsupported Parent Qdisc\n");
	}

	kfree(root->priv);
	del_timer(&(root->timer));
	/* NAPI */
	napi_disable(&(root->qos_napi));
	netif_napi_del(&(root->qos_napi));

	for (i = 0; i < ASF_MAX_IFACES; i++) {
		if (qdisc_in_use[i] == root) {
			spin_lock(&cnt_lock);
			qdisc_in_use[i] = NULL;
			qdisc_cnt--;
			spin_unlock(&cnt_lock);
			asf_debug("Deleted Qdisc at index %d, qdisc_cnt %d\n",
					i, qdisc_cnt);
			break;
		}
	}
	/* IF Port Shaper exists, Set it as Root Qdisc */
	for (i = 0; i < ASF_MAX_IFACES; i++) {
		struct  asf_qdisc *x = qdisc_in_use[i];
		if (x && (x->dev == qdisc->dev)) {
			/* Configure De-queue NAPI */
			netif_napi_add(x->dev, &(x->qos_napi),
					prio_tx_napi, qos_budget);
			napi_enable(&(x->qos_napi));

			setup_timer(&x->timer, timer_handler,
					(unsigned long)x);
			qdisc->dev->asf_qdisc = x;
			break;
		}
	}

	kfree(root);
	ASF_RCU_READ_UNLOCK(bLockFlag);

	return ASFQOS_SUCCESS;
}
开发者ID:fsl-dpacc,项目名称:g_ipsec_la,代码行数:76,代码来源:asfqosapi.c


示例14: slip_start

void slip_start(void)
{
    char buf[128];
    int disc, sencap;
    int res;

    rx_count = -1;

    if (dynamic_addrs && !force_dynamic) {
	if (debug&DEBUG_VERBOSE)
	    syslog(LOG_INFO,"Fetching IP addresses from SLIP server");
	if (dynamic_mode != DMODE_BOOTP) {
	    fail = 0;
	    failt.data = 0;
	    failt.function = slip_start_fail;
	    failt.expires = 30;	/* give 30 seconds for this to work */
	    add_timer(&failt);
	    if (dynamic_mode == DMODE_REMOTE || dynamic_mode == DMODE_REMOTE_LOCAL)
		if (!grab_addr(&remote_ip)) return;
	    if (dynamic_mode != DMODE_REMOTE)
		if (!grab_addr(&local_ip)) return;
	    if (dynamic_mode == DMODE_LOCAL_REMOTE)
		if (!grab_addr(&remote_ip)) return;
	    del_timer(&failt);
	    syslog(LOG_INFO,"New addresses: local %s, remote %s.",
		local_ip,remote_ip);
	}
    }

    if (ioctl(modem_fd, TIOCGETD, &start_disc) < 0)
	syslog(LOG_ERR,"Can't get line discipline on proxy device: %m"), die(1);

    /* change line disciple to SLIP and set the SLIP encapsulation */
    disc = N_SLIP;
    if ((link_iface = ioctl(modem_fd, TIOCSETD, &disc)) < 0) {
	if (errno == ENFILE) {
	   syslog(LOG_ERR,"No free slip device available for link."), die(1);
	} else if (errno == EEXIST) {
	    syslog(LOG_ERR,"Link device already in slip mode!?");
	} else if (errno == EINVAL) {
	    syslog(LOG_ERR,"SLIP not supported by kernel, can't build link.");
	    die(1);
	} else
	   syslog(LOG_ERR,"Can't set line discipline: %m"), die(1);
    }

    if (ioctl(modem_fd, SIOCSIFENCAP, &slip_encap) < 0)
	syslog(LOG_ERR,"Can't set encapsulation: %m"), die(1);

#ifdef SIOCSKEEPALIVE
    if (keepalive && (ioctl(modem_fd, SIOCSKEEPALIVE, &keepalive) < 0))
      syslog(LOG_ERR, "Can't set keepalive: %m (ignoring error)");
#endif

#ifdef SIOCSOUTFILL
    if (outfill && (ioctl(modem_fd, SIOCSOUTFILL, &outfill) < 0))
      syslog(LOG_ERR, "Can't set outfill: %m (ignoring error)");
#endif

    /* verify that it worked */
    if (ioctl(modem_fd, TIOCGETD, &disc) < 0)
	syslog(LOG_ERR,"Can't get line discipline: %m"), die(1);
    if (ioctl(modem_fd, SIOCGIFENCAP, &sencap) < 0)
	syslog(LOG_ERR,"Can't get encapsulation: %m"), die(1);

    if (disc != N_SLIP || sencap != slip_encap)
        syslog(LOG_ERR,"Couldn't set up the slip link correctly!"), die(1);

    if (debug&DEBUG_VERBOSE)
        syslog(LOG_INFO,"Slip link established on interface sl%d",
	    link_iface);

    /* mark the interface as up */
    if (netmask) {
        sprintf(buf,"%s sl%d %s pointopoint %s netmask %s mtu %d metric %d up",
	    PATH_IFCONFIG,link_iface,local_ip,remote_ip,netmask,mtu, metric);
    } else {
        sprintf(buf,"%s sl%d %s pointopoint %s mtu %d metric %d up",
	    PATH_IFCONFIG,link_iface,local_ip,remote_ip,mtu, metric);
    }
    res = system(buf);
    report_system_result(res,buf);

    /* Set the routing for the new slip interface */
    set_ptp("sl",link_iface,remote_ip,metric);

    /* run bootp if it is asked for */
    if (dynamic_addrs && dynamic_mode == DMODE_BOOTP && !force_dynamic) start_bootp();

    dead = 0;
}
开发者ID:OPSF,项目名称:uClinux,代码行数:91,代码来源:slip.c


示例15: nci_rsp_packet

void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
{
	__u16 rsp_opcode = nci_opcode(skb->data);

	/* we got a rsp, stop the cmd timer */
	del_timer(&ndev->cmd_timer);

	pr_debug("NCI RX: MT=rsp, PBF=%d, GID=0x%x, OID=0x%x, plen=%d\n",
		 nci_pbf(skb->data),
		 nci_opcode_gid(rsp_opcode),
		 nci_opcode_oid(rsp_opcode),
		 nci_plen(skb->data));

	/* strip the nci control header */
	skb_pull(skb, NCI_CTRL_HDR_SIZE);

	switch (rsp_opcode) {
	case NCI_OP_CORE_RESET_RSP:
		nci_core_reset_rsp_packet(ndev, skb);
		break;

	case NCI_OP_CORE_INIT_RSP:
		nci_core_init_rsp_packet(ndev, skb);
		break;

	case NCI_OP_CORE_SET_CONFIG_RSP:
		nci_core_set_config_rsp_packet(ndev, skb);
		break;

	case NCI_OP_CORE_CONN_CREATE_RSP:
		nci_core_conn_create_rsp_packet(ndev, skb);
		break;

	case NCI_OP_CORE_CONN_CLOSE_RSP:
		nci_core_conn_close_rsp_packet(ndev, skb);
		break;

	case NCI_OP_RF_DISCOVER_MAP_RSP:
		nci_rf_disc_map_rsp_packet(ndev, skb);
		break;

	case NCI_OP_RF_DISCOVER_RSP:
		nci_rf_disc_rsp_packet(ndev, skb);
		break;

	case NCI_OP_RF_DISCOVER_SELECT_RSP:
		nci_rf_disc_select_rsp_packet(ndev, skb);
		break;

	case NCI_OP_RF_DEACTIVATE_RSP:
		nci_rf_deactivate_rsp_packet(ndev, skb);
		break;

	case NCI_OP_NFCEE_DISCOVER_RSP:
		nci_nfcee_discover_rsp_packet(ndev, skb);
		break;

	case NCI_OP_NFCEE_MODE_SET_RSP:
		nci_nfcee_mode_set_rsp_packet(ndev, skb);
		break;

	default:
		pr_err("unknown rsp opcode 0x%x\n", rsp_opcode);
		break;
	}

	kfree_skb(skb);

	/* trigger the next cmd */
	atomic_set(&ndev->cmd_cnt, 1);
	if (!skb_queue_empty(&ndev->cmd_q))
		queue_work(ndev->cmd_wq, &ndev->cmd_work);
}
开发者ID:19Dan01,项目名称:linux,代码行数:73,代码来源:rsp.c


示例16: headsetobserve_work

static void headsetobserve_work(struct work_struct *work)
{
	int level = 0;
	//int level2 = 0;
	struct rk_headset_pdata *pdata = headset_info->pdata;
	static unsigned int old_status = 0;
	DBG("---headsetobserve_work---\n");
	mutex_lock(&headset_info->mutex_lock[HEADSET]);

	level = read_gpio(pdata->Headset_gpio);
	if(level < 0)
		goto out;
	/*
	msleep(100);	
	level2 = read_gpio(pdata->Headset_gpio);
	if(level2 < 0)
		goto out;
	if(level2 != level)
		goto out;
	*/
	old_status = headset_info->headset_status;
	if(pdata->headset_in_type == HEADSET_IN_HIGH)
		headset_info->headset_status = level?HEADSET_IN:HEADSET_OUT;
	else
		headset_info->headset_status = level?HEADSET_OUT:HEADSET_IN;

	if(old_status == headset_info->headset_status)	{
		DBG("old_status == headset_info->headset_status\n");
		goto out;
	}
	
	DBG("(headset in is %s)headset status is %s\n",
		pdata->headset_in_type?"high level":"low level",
		headset_info->headset_status?"in":"out");
		
	if(headset_info->headset_status == HEADSET_IN)
	{
		headset_info->cur_headset_status = BIT_HEADSET_NO_MIC;
		if(pdata->headset_in_type == HEADSET_IN_HIGH)
			irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_FALLING);
		else
			irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_RISING);
		if (pdata->Hook_gpio != INVALID_GPIO) {
			del_timer(&headset_info->headset_timer);//Start the timer, wait for switch to the headphone channel
			headset_info->headset_timer.expires = jiffies + 10;
			add_timer(&headset_info->headset_timer);
			goto out;
		}
	}
	else if(headset_info->headset_status == HEADSET_OUT)
	{	
		headset_info->hook_status = HOOK_UP;
		if(headset_info->isHook_irq == enable)
		{
			DBG("disable headset_hook irq\n");
			headset_info->isHook_irq = disable;
			disable_irq(headset_info->irq[HOOK]);		
		}	
		headset_info->cur_headset_status = 0;//~(BIT_HEADSET|BIT_HEADSET_NO_MIC);
		//#if defined(CONFIG_SND_RK_SOC_RK2928) || defined(CONFIG_SOC_RK3028)
		//rk2928_codec_set_spk(HEADSET_OUT);
		//#endif						
		if(pdata->headset_in_type == HEADSET_IN_HIGH)
			irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_RISING);
		else
			irq_set_irq_type(headset_info->irq[HEADSET],IRQF_TRIGGER_FALLING);
	}
	rk28_send_wakeup_key();
	switch_set_state(&headset_info->sdev, headset_info->cur_headset_status);	
	#if defined(CONFIG_SND_RK_SOC_RK2928) || defined(CONFIG_SND_RK29_SOC_RK610)
	if (headset_info->headset_status == HEADSET_OUT)
	{
		mdelay(200);
		rk2928_codec_set_spk(HEADSET_OUT);
		gpio_set_value(pdata->Sw_mic_gpio, headset_info->pdata->Main_mic_io_value);
	}
	#endif
	DBG("headset_info->cur_headset_status = %d\n",headset_info->cur_headset_status);

out:
	mutex_unlock(&headset_info->mutex_lock[HEADSET]);	
}
开发者ID:skelton,项目名称:RK_g7_KK,代码行数:82,代码来源:rk_headset.c


示例17: ath_bluesleep_gpio_config

static int ath_bluesleep_gpio_config(int on)
{
	int ret = 0;

	BT_INFO("%s config: %d", __func__, on);
	if (!on) {
		if (disable_irq_wake(bsi->host_wake_irq))
			BT_ERR("Couldn't disable hostwake IRQ wakeup mode\n");
		goto free_host_wake_irq;
	}

	ret = gpio_request(bsi->host_wake, "bt_host_wake");
	if (ret < 0) {
		BT_ERR("failed to request gpio pin %d, error %d\n",
			bsi->host_wake, ret);
		goto gpio_config_failed;
	}

	/* configure host_wake as input */
	ret = gpio_direction_input(bsi->host_wake);
	if (ret < 0) {
		BT_ERR("failed to config GPIO %d as input pin, err %d\n",
			bsi->host_wake, ret);
		goto gpio_host_wake;
	}

	ret = gpio_request(bsi->ext_wake, "bt_ext_wake");
	if (ret < 0) {
		BT_ERR("failed to request gpio pin %d, error %d\n",
			bsi->ext_wake, ret);
		goto gpio_host_wake;
	}

	ret = gpio_direction_output(bsi->ext_wake, 1);
	if (ret < 0) {
		BT_ERR("failed to config GPIO %d as output pin, err %d\n",
			bsi->ext_wake, ret);
		goto gpio_ext_wake;
	}

	gpio_set_value(bsi->ext_wake, 1);

	/* Initialize spinlock. */
	spin_lock_init(&rw_lock);

	/* Initialize timer */
	init_timer(&tx_timer);
	tx_timer.function = bluesleep_tx_timer_expire;
	tx_timer.data = 0;

	/* initialize host wake tasklet */
	tasklet_init(&hostwake_task, hostwake_interrupt, 0);

	if (bsi->irq_polarity == POLARITY_LOW) {
		ret = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr,
				IRQF_DISABLED | IRQF_TRIGGER_FALLING,
				"bluetooth hostwake", NULL);
	} else  {
		ret = request_irq(bsi->host_wake_irq, bluesleep_hostwake_isr,
				IRQF_DISABLED | IRQF_TRIGGER_RISING,
				"bluetooth hostwake", NULL);
	}
	if (ret  < 0) {
		BT_ERR("Couldn't acquire BT_HOST_WAKE IRQ");
		goto delete_timer;
	}

	ret = enable_irq_wake(bsi->host_wake_irq);
	if (ret < 0) {
		BT_ERR("Couldn't enable BT_HOST_WAKE as wakeup interrupt");
		goto free_host_wake_irq;
	}

	return 0;

free_host_wake_irq:
	free_irq(bsi->host_wake_irq, NULL);
delete_timer:
	del_timer(&tx_timer);
gpio_ext_wake:
	gpio_free(bsi->ext_wake);
gpio_host_wake:
	gpio_free(bsi->host_wake);
gpio_config_failed:
	return ret;
}
开发者ID:AD5GB,项目名称:wicked_kernel_lge_hammerhead,代码行数:86,代码来源:hci_ath.c


示例18: L3DelTimer

void
L3DelTimer(struct L3Timer *t)
{
	del_timer(&t->tl);
}
开发者ID:romanalexander,项目名称:Trickles,代码行数:5,代码来源:isdnl3.c


示例19: icc_interrupt

void
icc_interrupt(struct IsdnCardState *cs, u_char val)
{
    u_char exval, v1;
    struct sk_buff *skb;
    unsigned int count;

    if (cs->debug & L1_DEB_ISAC)
        debugl1(cs, "ICC interrupt %x", val);
    if (val & 0x80) {	/* RME */
        exval = cs->readisac(cs, ICC_RSTA);
        if ((exval & 0x70) != 0x20) {
            if (exval & 0x40) {
                if (cs->debug & L1_DEB_WARN)
                    debugl1(cs, "ICC RDO");
#ifdef ERROR_STATISTIC
                cs->err_rx++;
#endif
            }
            if (!(exval & 0x20)) {
                if (cs->debug & L1_DEB_WARN)
                    debugl1(cs, "ICC CRC error");
#ifdef ERROR_STATISTIC
                cs->err_crc++;
#endif
            }
            cs->writeisac(cs, ICC_CMDR, 0x80);
        } else {
            count = cs->readisac(cs, ICC_RBCL) & 0x1f;
            if (count == 0)
                count = 32;
            icc_empty_fifo(cs, count);
            if ((count = cs->rcvidx) > 0) {
                cs->rcvidx = 0;
                if (!(skb = alloc_skb(count, GFP_ATOMIC)))
                    printk(KERN_WARNING "HiSax: D receive out of memory\n");
                else {
                    memcpy(skb_put(skb, count), cs->rcvbuf, count);
                    skb_queue_tail(&cs->rq, skb);
                }
            }
        }
        cs->rcvidx = 0;
        schedule_event(cs, D_RCVBUFREADY);
    }
    if (val & 0x40) {	/* RPF */
        icc_empty_fifo(cs, 32);
    }
    if (val & 0x20) {	/* RSC */
        /* never */
        if (cs->debug & L1_DEB_WARN)
            debugl1(cs, "ICC RSC interrupt");
    }
    if (val & 0x10) {	/* XPR */
        if (test_and_clear_bit(FLG_DBUSY_TIMER, &cs->HW_Flags))
            del_timer(&cs->dbusytimer);
        if (test_and_clear_bit(FLG_L1_DBUSY, &cs->HW_Flags))
            schedule_event(cs, D_CLEARBUSY);
        if (cs->tx_skb) {
            if (cs->tx_skb->len) {
                icc_fill_fifo(cs);
                goto afterXPR;
            } else {
                dev_kfree_skb_irq(cs->tx_skb);
                cs->tx_cnt = 0;
                cs->tx_skb = NULL;
            }
        }
        if ((cs->tx_skb = skb_dequeue(&cs->sq))) {
            cs->tx_cnt = 0;
            icc_fill_fifo(cs);
        } else
            schedule_event(cs, D_XMTBUFREADY);
    }
afterXPR:
    if (val & 0x04) {	/* CISQ */
        exval = cs->readisac(cs, ICC_CIR0);
        if (cs->debug & L1_DEB_ISAC)
            debugl1(cs, "ICC CIR0 %02X", exval );
        if (exval & 2) {
            cs->dc.icc.ph_state = (exval >> 2) & 0xf;
            if (cs->debug & L1_DEB_ISAC)
                debugl1(cs, "ph_state change %x", cs->dc.icc.ph_state);
            schedule_event(cs, D_L1STATECHANGE);
        }
开发者ID:houzhenggang,项目名称:ralink_sdk,代码行数:85,代码来源:icc.c


示例20: uart6850_close

static void uart6850_close(int dev)
{
    uart6850_cmd(UART_MODE_ON);
    del_timer(&uart6850_timer);
    uart6850_opened = 0;
}
开发者ID:274914765,项目名称:C,代码行数:6,代码来源:uart6850.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ del_timer_sync函数代码示例发布时间:2022-05-30
下一篇:
C++ del_panel函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap