C++ (Cpp) skb_queue_tail Examples

C++ (Cpp) skb_queue_tail - 24 examples found. These are the top rated real world C++ (Cpp) examples of skb_queue_tail extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
static int queue_sendconfig(avmcard *card, char cval[4])
{
    struct sk_buff *skb;
    unsigned long flags;
    void *p;

    skb = alloc_skb(3+4, GFP_ATOMIC);
    if (!skb) {
        printk(KERN_CRIT "%s: no memory, send config\n",
               card->name);
        return -ENOMEM;
    }
    p = skb->data;
    _put_byte(&p, 0);
    _put_byte(&p, 0);
    _put_byte(&p, SEND_CONFIG);
    _put_byte(&p, cval[0]);
    _put_byte(&p, cval[1]);
    _put_byte(&p, cval[2]);
    _put_byte(&p, cval[3]);
    skb_put(skb, (u8 *)p - (u8 *)skb->data);

    skb_queue_tail(&card->dma->send_queue, skb);

    spin_lock_irqsave(&card->lock, flags);
    c4_dispatch_tx(card);
    spin_unlock_irqrestore(&card->lock, flags);
    return 0;
}
Example #2
0
void rose_transmit_link(struct sk_buff *skb, struct rose_neigh *neigh)
{
    unsigned char *dptr;

#if 0
    if (call_fw_firewall(PF_ROSE, skb->dev, skb->data, NULL, &skb) != FW_ACCEPT) {
        kfree_skb(skb);
        return;
    }
#endif

    if (neigh->loopback) {
        rose_loopback_queue(skb, neigh);
        return;
    }

    if (!rose_link_up(neigh))
        neigh->restarted = 0;

    dptr = skb_push(skb, 1);
    *dptr++ = AX25_P_ROSE;

    if (neigh->restarted) {
        if (!rose_send_frame(skb, neigh))
            kfree_skb(skb);
    } else {
        skb_queue_tail(&neigh->queue, skb);

        if (!rose_t0timer_running(neigh)) {
            rose_transmit_restart_request(neigh);
            neigh->dce_mode = 0;
            rose_start_t0timer(neigh);
        }
    }
}
Example #3
0
void
l3_msg(struct PStack *st, int pr, void *arg)
{
    switch (pr) {
    case (DL_DATA | REQUEST):
        if (st->l3.l3m.state == ST_L3_LC_ESTAB) {
            st->l3.l3l2(st, pr, arg);
        } else {
            struct sk_buff *skb = arg;

            skb_queue_tail(&st->l3.squeue, skb);
            FsmEvent(&st->l3.l3m, EV_ESTABLISH_REQ, NULL);
        }
        break;
    case (DL_ESTABLISH | REQUEST):
        FsmEvent(&st->l3.l3m, EV_ESTABLISH_REQ, NULL);
        break;
    case (DL_ESTABLISH | CONFIRM):
        FsmEvent(&st->l3.l3m, EV_ESTABLISH_CNF, NULL);
        break;
    case (DL_ESTABLISH | INDICATION):
        FsmEvent(&st->l3.l3m, EV_ESTABLISH_IND, NULL);
        break;
    case (DL_RELEASE | INDICATION):
        FsmEvent(&st->l3.l3m, EV_RELEASE_IND, NULL);
        break;
    case (DL_RELEASE | CONFIRM):
        FsmEvent(&st->l3.l3m, EV_RELEASE_CNF, NULL);
        break;
    case (DL_RELEASE | REQUEST):
        FsmEvent(&st->l3.l3m, EV_RELEASE_REQ, NULL);
        break;
    }
}
Example #4
0
static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
{
    if (dev->driver_info->rx_fixup &&
            !dev->driver_info->rx_fixup (dev, skb)) {
        /* With RX_ASSEMBLE, rx_fixup() must update counters */
        if (!(dev->driver_info->flags & FLAG_RX_ASSEMBLE))
            dev->net->stats.rx_errors++;
        goto done;
    }
    // else network stack removes extra byte if we forced a short packet

    if (skb->len) {
        /* all data was already cloned from skb inside the driver */
        if (dev->driver_info->flags & FLAG_MULTI_PACKET)
            dev_kfree_skb_any(skb);
        else
            usbnet_skb_return(dev, skb);
        return;
    }

    netif_dbg(dev, rx_err, dev->net, "drop\n");
    dev->net->stats.rx_errors++;
done:
    skb_queue_tail(&dev->done, skb);
}
void rose_transmit_link(struct sk_buff *skb, struct rose_neigh *neigh)
{
    unsigned char *dptr;

    if (neigh->loopback) {
        rose_loopback_queue(skb, neigh);
        return;
    }

    if (!rose_link_up(neigh))
        neigh->restarted = 0;

    dptr = skb_push(skb, 1);
    *dptr++ = AX25_P_ROSE;

    if (neigh->restarted) {
        if (!rose_send_frame(skb, neigh))
            kfree_skb(skb);
    } else {
        skb_queue_tail(&neigh->queue, skb);

        if (!rose_t0timer_running(neigh)) {
            rose_transmit_restart_request(neigh);
            neigh->dce_mode = 0;
            rose_start_t0timer(neigh);
        }
    }
}
Example #6
0
void c4_release_appl(struct capi_ctr *ctrl, u16 appl)
{
    avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
    avmcard *card = cinfo->card;
    unsigned long flags;
    struct sk_buff *skb;
    void *p;

    capilib_release_appl(&cinfo->ncci_head, appl);

    if (ctrl->cnr == card->cardnr) {
        skb = alloc_skb(7, GFP_ATOMIC);
        if (!skb) {
            printk(KERN_CRIT "%s: no memory, lost release appl.\n",
                   card->name);
            return;
        }
        p = skb->data;
        _put_byte(&p, 0);
        _put_byte(&p, 0);
        _put_byte(&p, SEND_RELEASE);
        _put_word(&p, appl);

        skb_put(skb, (u8 *)p - (u8 *)skb->data);
        skb_queue_tail(&card->dma->send_queue, skb);
        spin_lock_irqsave(&card->lock, flags);
        c4_dispatch_tx(card);
        spin_unlock_irqrestore(&card->lock, flags);
    }
}