本文整理汇总了C++中skb_queue_purge函数的典型用法代码示例。如果您正苦于以下问题:C++ skb_queue_purge函数的具体用法?C++ skb_queue_purge怎么用?C++ skb_queue_purge使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了skb_queue_purge函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nci_rf_deactivate_ntf_packet
static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
struct sk_buff *skb)
{
struct nci_rf_deactivate_ntf *ntf = (void *) skb->data;
pr_debug("entry, type 0x%x, reason 0x%x\n", ntf->type, ntf->reason);
/* drop tx data queue */
skb_queue_purge(&ndev->tx_q);
/* drop partial rx data packet */
if (ndev->rx_data_reassembly) {
kfree_skb(ndev->rx_data_reassembly);
ndev->rx_data_reassembly = NULL;
}
/* complete the data exchange transaction, if exists */
if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
nci_data_exchange_complete(ndev, NULL, -EIO);
switch (ntf->type) {
case NCI_DEACTIVATE_TYPE_IDLE_MODE:
nci_clear_target_list(ndev);
atomic_set(&ndev->state, NCI_IDLE);
break;
case NCI_DEACTIVATE_TYPE_SLEEP_MODE:
case NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE:
atomic_set(&ndev->state, NCI_W4_HOST_SELECT);
break;
case NCI_DEACTIVATE_TYPE_DISCOVERY:
nci_clear_target_list(ndev);
atomic_set(&ndev->state, NCI_DISCOVERY);
break;
}
nci_req_complete(ndev, NCI_STATUS_OK);
}
示例2: eicon_freecard
static void
eicon_freecard(eicon_card *card) {
int i;
for(i = 0; i < (card->nchannels + 1); i++) {
skb_queue_purge(&card->bch[i].e.X);
skb_queue_purge(&card->bch[i].e.R);
}
skb_queue_purge(&card->sndq);
skb_queue_purge(&card->rcvq);
skb_queue_purge(&card->rackq);
skb_queue_purge(&card->sackq);
skb_queue_purge(&card->statq);
#ifdef CONFIG_ISDN_DRV_EICON_PCI
kfree(card->sbufp);
kfree(card->sbuf);
kfree(card->dbuf);
#endif
kfree(card->bch);
kfree(card);
}
示例3: sigd_close
static void sigd_close(struct atm_vcc *vcc)
{
struct hlist_node *node;
struct sock *s;
int i;
DPRINTK("sigd_close\n");
sigd = NULL;
if (skb_peek(&sk_atm(vcc)->sk_receive_queue))
printk(KERN_ERR "sigd_close: closing with requests pending\n");
skb_queue_purge(&sk_atm(vcc)->sk_receive_queue);
read_lock(&vcc_sklist_lock);
for(i = 0; i < VCC_HTABLE_SIZE; ++i) {
struct hlist_head *head = &vcc_hash[i];
sk_for_each(s, node, head) {
struct atm_vcc *vcc = atm_sk(s);
purge_vcc(vcc);
}
}
read_unlock(&vcc_sklist_lock);
}
示例4: mem_handle_cp_crash
void mem_handle_cp_crash(struct mem_link_device *mld, enum modem_state state)
{
struct link_device *ld = &mld->link_dev;
struct modem_ctl *mc = ld->mc;
int i;
/* Disable normal IPC */
set_magic(mld, MEM_CRASH_MAGIC);
set_access(mld, 0);
if (!wake_lock_active(&mld->dump_wlock))
wake_lock(&mld->dump_wlock);
stop_net_ifaces(ld);
/* Purge the skb_txq in every IPC device (IPC_FMT, IPC_RAW, etc.) */
for (i = 0; i < MAX_SIPC5_DEV; i++)
skb_queue_purge(mld->dev[i]->skb_txq);
if (cp_online(mc))
set_modem_state(mld, state);
mld->forced_cp_crash = false;
}
示例5: mptp_release
static int mptp_release(struct socket *sock)
{
struct sock *sk = sock->sk;
struct mptp_sock *ssk = mptp_sk(sk);
if (unlikely(!sk))
return 0;
mptp_unhash(ssk->src);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
synchronize_net();
sock_orphan(sk);
sock->sk = NULL;
skb_queue_purge(&sk->sk_receive_queue);
log_debug("mptp_release sock=%p\n", sk);
sock_put(sk);
return 0;
}
示例6: nci_rf_deactivate_ntf_packet
static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
struct sk_buff *skb)
{
struct nci_rf_deactivate_ntf *ntf = (void *) skb->data;
pr_debug("entry, type 0x%x, reason 0x%x\n", ntf->type, ntf->reason);
/* drop tx data queue */
skb_queue_purge(&ndev->tx_q);
/* drop partial rx data packet */
if (ndev->rx_data_reassembly) {
kfree_skb(ndev->rx_data_reassembly);
ndev->rx_data_reassembly = NULL;
}
/* complete the data exchange transaction, if exists */
if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
nci_data_exchange_complete(ndev, NULL, -EIO);
nci_clear_target_list(ndev);
atomic_set(&ndev->state, NCI_IDLE);
nci_req_complete(ndev, NCI_STATUS_OK);
}
示例7: netlink_release
static int netlink_release(struct socket *sock)
{
struct sock *sk = sock->sk;
if (!sk)
return 0;
netlink_remove(sk);
spin_lock(&sk->protinfo.af_netlink->cb_lock);
if (sk->protinfo.af_netlink->cb) {
sk->protinfo.af_netlink->cb->done(sk->protinfo.af_netlink->cb);
netlink_destroy_callback(sk->protinfo.af_netlink->cb);
sk->protinfo.af_netlink->cb = NULL;
__sock_put(sk);
}
spin_unlock(&sk->protinfo.af_netlink->cb_lock);
/* OK. Socket is unlinked, and, therefore,
no new packets will arrive */
sock_orphan(sk);
sock->sk = NULL;
wake_up_interruptible_all(&sk->protinfo.af_netlink->wait);
skb_queue_purge(&sk->write_queue);
if (sk->protinfo.af_netlink->pid && !sk->protinfo.af_netlink->groups) {
struct netlink_notify n = { protocol:sk->protocol,
pid:sk->protinfo.af_netlink->pid };
notifier_call_chain(&netlink_chain, NETLINK_URELEASE, &n);
}
sock_put(sk);
return 0;
}
示例8: rose_remove_neigh
static void rose_remove_neigh(struct rose_neigh *rose_neigh)
{
struct rose_neigh *s;
unsigned long flags;
rose_stop_ftimer(rose_neigh);
rose_stop_t0timer(rose_neigh);
skb_queue_purge(&rose_neigh->queue);
save_flags(flags); cli();
if ((s = rose_neigh_list) == rose_neigh) {
rose_neigh_list = rose_neigh->next;
restore_flags(flags);
if (rose_neigh->digipeat != NULL)
kfree(rose_neigh->digipeat);
kfree(rose_neigh);
return;
}
while (s != NULL && s->next != NULL) {
if (s->next == rose_neigh) {
s->next = rose_neigh->next;
restore_flags(flags);
if (rose_neigh->digipeat != NULL)
kfree(rose_neigh->digipeat);
kfree(rose_neigh);
return;
}
s = s->next;
}
restore_flags(flags);
}
示例9: eemcs_ipc_state_callback_func
void eemcs_ipc_state_callback_func(EEMCS_STATE state){
switch(state){
case EEMCS_EXCEPTION:
case EEMCS_GATE: //MD reset
if (eemcs_ipc_inst.md_is_ready){
int i;
eemcs_ipc_inst.md_is_ready = 0;
for(i=0; i<EEMCS_IPCD_MAX_NUM;i++){
DBGLOG( IPCD, TRA, "ipc_state_callback: Clean device(%s) when ipc_sta=%d", \
eemcs_ipc_inst.ipc_node[i].dev_name, state);
skb_queue_purge(&eemcs_ipc_inst.ipc_node[i].rx_skb_list);
atomic_set(&eemcs_ipc_inst.ipc_node[i].rx_pkt_cnt, 0);
}
}
break;
case EEMCS_BOOTING_DONE:
DBGLOG( IPCD, TRA, "ipc_state_callback: MD booting DONE");
wake_up_interruptible(&eemcs_ipc_inst.state_waitq);
eemcs_ipc_inst.md_is_ready = 1;
break;
default:
break;
}
}
示例10: eemcs_ipc_kern_open
static int eemcs_ipc_kern_open(int id)
{
int ret = 0;
DEBUG_LOG_FUNCTION_ENTRY;
if (id >= EEMCS_IPCD_MAX_NUM || id < 0){
DBGLOG(IPCD,ERR,"Wrong minor num(%d)", id);
return -EINVAL;
}
DBGLOG(IPCD,DEF,"ipc_kern_open: deivce(%s) iminor(%d)", \
eemcs_ipc_inst.ipc_node[id].dev_name, id);
//4 <1> check multiple open
if(IPCD_CLOSE != atomic_read(&eemcs_ipc_inst.ipc_node[id].dev_state)){
DBGLOG(IPCD, ERR, "PORT%d multi-open fail!", id);
return -EIO;
}
//4 <2> clear the rx_skb_list
skb_queue_purge(&eemcs_ipc_inst.ipc_node[id].rx_skb_list);
atomic_set(&eemcs_ipc_inst.ipc_node[id].rx_pkt_cnt, 0);
atomic_set(&eemcs_ipc_inst.ipc_node[id].dev_state, IPCD_KERNEL);
DEBUG_LOG_FUNCTION_LEAVE;
return ret;
}
示例11: exit_oamkernel
/*
* Prototype : exit_oamkernel
* Description : oam kernel exit
* Input : void
* Return Value : void
* Calls :
* Called By :
*
* History :
* 1.Date : 2012/5/23
* Author : kf74033
* Modification : Created function
*
*/
void __exit exit_oamkernel(void)
{
#ifdef SDT_OAM_FOR_1151
{
oam_sdt_unregister(&tx_action);
kfree(tx_action);
}
#else
hwifi_rx_extern_unregister(HCC_OAM_TEST);
#endif
if (gst_kerenlglobal.pst_nlsk != NULL)
{
OS_SOCK_RELEASE(gst_kerenlglobal.pst_nlsk->sk_socket);
}
OS_MEM_KFREE(gst_kerenlglobal.puc_data);
destroy_workqueue(gst_kerenlglobal.oam_rx_workqueue);
skb_queue_purge(&gst_kerenlglobal.rx_wifi_dbg_seq);
OAM_INFO("oamkernel remove ok.\n");
return;
}
示例12: l2_connected
static void
l2_connected(struct FsmInst *fi, int event, void *arg)
{
struct layer2 *l2 = fi->userdata;
struct sk_buff *skb = arg;
int pr = -1;
if (!get_PollFlag(l2, skb)) {
l2_mdl_error_ua(fi, event, arg);
return;
}
dev_kfree_skb(skb);
if (test_and_clear_bit(FLG_PEND_REL, &l2->flag))
l2_disconnect(fi, event, NULL);
if (test_and_clear_bit(FLG_L3_INIT, &l2->flag)) {
pr = DL_ESTABLISH_CNF;
} else if (l2->vs != l2->va) {
skb_queue_purge(&l2->i_queue);
pr = DL_ESTABLISH_IND;
}
stop_t200(l2, 5);
l2->vr = 0;
l2->vs = 0;
l2->va = 0;
l2->sow = 0;
mISDN_FsmChangeState(fi, ST_L2_7);
mISDN_FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 4);
if (pr != -1)
l2up_create(l2, pr, 0, NULL);
if (skb_queue_len(&l2->i_queue) && cansend(l2))
mISDN_FsmEvent(fi, EV_L2_ACK_PULL, NULL);
if (l2->tm)
l2_tei(l2, MDL_STATUS_UP_IND, 0);
}
示例13: bch_l2l1
//.........这里部分代码省略.........
Write_hfc8(l1->hw, A_SUBCH_CFG, 0); /* 8 bits */
Write_hfc8(l1->hw, A_IRQ_MSK, 0); /* disable RX interrupts */
Write_hfc8(l1->hw, A_INC_RES_FIFO, 2); /* reset fifo */
Write_hfc8(l1->hw, R_ST_SEL,
l1->st_num);
l1->hw->mr.r_ctrl0 |=
(bch->bchan & 3);
Write_hfc8(l1->hw, A_ST_CTRL0,
l1->hw->mr.r_ctrl0);
bch->mode = L1_MODE_TRANS;
spin_unlock_irqrestore(&l1->lock,
flags);
bch->b_if.ifc.l1l2(&bch->b_if.ifc,
PH_ACTIVATE |
INDICATION,
NULL);
break;
default:
if (bch->mode == L1_MODE_NULL)
break;
spin_lock_irqsave(&l1->lock,
flags);
l1->hw->mr.
fifo_slow_timer_service[l1->
st_num]
&=
~((bch->bchan ==
1) ? 0x3 : 0xc);
l1->hw->mr.
fifo_rx_trans_enables[l1->
st_num]
&=
~((bch->bchan ==
1) ? 0x3 : 0xc);
l1->hw->mr.timer_usg_cnt--;
Write_hfc8(l1->hw, R_FIFO,
(l1->st_num * 8 +
((bch->bchan ==
1) ? 0 : 2)));
wait_busy(l1->hw);
Write_hfc8(l1->hw, A_IRQ_MSK, 0); /* disable TX interrupts */
wait_busy(l1->hw);
Write_hfc8(l1->hw, R_FIFO,
(l1->st_num * 8 +
((bch->bchan ==
1) ? 1 : 3)));
wait_busy(l1->hw);
Write_hfc8(l1->hw, A_IRQ_MSK, 0); /* disable RX interrupts */
Write_hfc8(l1->hw, R_ST_SEL,
l1->st_num);
l1->hw->mr.r_ctrl0 &=
~(bch->bchan & 3);
Write_hfc8(l1->hw, A_ST_CTRL0,
l1->hw->mr.r_ctrl0);
spin_unlock_irqrestore(&l1->lock,
flags);
bch->mode = L1_MODE_NULL;
bch->b_if.ifc.l1l2(&bch->b_if.ifc,
PH_DEACTIVATE |
INDICATION,
NULL);
if (bch->tx_skb) {
dev_kfree_skb(bch->tx_skb);
bch->tx_skb = NULL;
}
if (bch->rx_skb) {
dev_kfree_skb(bch->rx_skb);
bch->rx_skb = NULL;
}
skb_queue_purge(&bch->tx_queue);
bch->tx_cnt = 0;
bch->rx_ptr = NULL;
break;
}
/* timer is only used when at least one b channel */
/* is set up to transparent mode */
if (l1->hw->mr.timer_usg_cnt) {
Write_hfc8(l1->hw, R_IRQMSK_MISC,
M_TI_IRQMSK);
} else {
Write_hfc8(l1->hw, R_IRQMSK_MISC, 0);
}
break;
default:
printk(KERN_INFO
"HFC-4S/8S: Unknown B-chan cmd 0x%x received, ignored\n",
pr);
break;
}
if (!l1->enabled)
bch->b_if.ifc.l1l2(&bch->b_if.ifc,
PH_DEACTIVATE | INDICATION, NULL);
} /* bch_l2l1 */
示例14: W6692_l1hw
static void
W6692_l1hw(struct PStack *st, int pr, void *arg)
{
struct IsdnCardState *cs = (struct IsdnCardState *) st->l1.hardware;
struct sk_buff *skb = arg;
int val;
switch (pr) {
case (PH_DATA | REQUEST):
if (cs->debug & DEB_DLOG_HEX)
LogFrame(cs, skb->data, skb->len);
if (cs->debug & DEB_DLOG_VERBOSE)
dlogframe(cs, skb, 0);
if (cs->tx_skb) {
skb_queue_tail(&cs->sq, skb);
#ifdef L2FRAME_DEBUG /* psa */
if (cs->debug & L1_DEB_LAPD)
Logl2Frame(cs, skb, "PH_DATA Queued", 0);
#endif
} else {
cs->tx_skb = skb;
cs->tx_cnt = 0;
#ifdef L2FRAME_DEBUG /* psa */
if (cs->debug & L1_DEB_LAPD)
Logl2Frame(cs, skb, "PH_DATA", 0);
#endif
W6692_fill_fifo(cs);
}
break;
case (PH_PULL | INDICATION):
if (cs->tx_skb) {
if (cs->debug & L1_DEB_WARN)
debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
skb_queue_tail(&cs->sq, skb);
break;
}
if (cs->debug & DEB_DLOG_HEX)
LogFrame(cs, skb->data, skb->len);
if (cs->debug & DEB_DLOG_VERBOSE)
dlogframe(cs, skb, 0);
cs->tx_skb = skb;
cs->tx_cnt = 0;
#ifdef L2FRAME_DEBUG /* psa */
if (cs->debug & L1_DEB_LAPD)
Logl2Frame(cs, skb, "PH_DATA_PULLED", 0);
#endif
W6692_fill_fifo(cs);
break;
case (PH_PULL | REQUEST):
#ifdef L2FRAME_DEBUG /* psa */
if (cs->debug & L1_DEB_LAPD)
debugl1(cs, "-> PH_REQUEST_PULL");
#endif
if (!cs->tx_skb) {
test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
} else
test_and_set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
break;
case (HW_RESET | REQUEST):
if ((cs->dc.w6692.ph_state == W_L1IND_DRD))
ph_command(cs, W_L1CMD_ECK);
else {
ph_command(cs, W_L1CMD_RST);
cs->dc.w6692.ph_state = W_L1CMD_RST;
W6692_new_ph(cs);
}
break;
case (HW_ENABLE | REQUEST):
ph_command(cs, W_L1CMD_ECK);
break;
case (HW_INFO3 | REQUEST):
ph_command(cs, W_L1CMD_AR8);
break;
case (HW_TESTLOOP | REQUEST):
val = 0;
if (1 & (long) arg)
val |= 0x0c;
if (2 & (long) arg)
val |= 0x3;
/* !!! not implemented yet */
break;
case (HW_DEACTIVATE | RESPONSE):
skb_queue_purge(&cs->rq);
skb_queue_purge(&cs->sq);
if (cs->tx_skb) {
dev_kfree_skb_any(cs->tx_skb);
cs->tx_skb = NULL;
}
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))
W6692_sched_event(cs, D_CLEARBUSY);
break;
default:
if (cs->debug & L1_DEB_WARN)
debugl1(cs, "W6692_l1hw unknown %04x", pr);
break;
}
}
示例15: nr_loopback_clear
void __exit nr_loopback_clear(void)
{
del_timer_sync(&loopback_timer);
skb_queue_purge(&loopback_queue);
}