Release 4.11 net/netrom/nr_loopback.c
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Copyright Tomi Manninen OH2BNS (oh2bns@sral.fi)
*/
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/socket.h>
#include <linux/timer.h>
#include <net/ax25.h>
#include <linux/skbuff.h>
#include <net/netrom.h>
#include <linux/init.h>
static void nr_loopback_timer(unsigned long);
static struct sk_buff_head loopback_queue;
static DEFINE_TIMER(loopback_timer, nr_loopback_timer, 0, 0);
void __init nr_loopback_init(void)
{
skb_queue_head_init(&loopback_queue);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 13 | 92.86% | 1 | 50.00% |
Vinay K. Nallamothu | 1 | 7.14% | 1 | 50.00% |
Total | 14 | 100.00% | 2 | 100.00% |
static inline int nr_loopback_running(void)
{
return timer_pending(&loopback_timer);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 15 | 93.75% | 2 | 66.67% |
Vinay K. Nallamothu | 1 | 6.25% | 1 | 33.33% |
Total | 16 | 100.00% | 3 | 100.00% |
int nr_loopback_queue(struct sk_buff *skb)
{
struct sk_buff *skbn;
if ((skbn = alloc_skb(skb->len, GFP_ATOMIC)) != NULL) {
skb_copy_from_linear_data(skb, skb_put(skbn, skb->len), skb->len);
skb_reset_transport_header(skbn);
skb_queue_tail(&loopback_queue, skbn);
if (!nr_loopback_running())
mod_timer(&loopback_timer, jiffies + 10);
}
kfree_skb(skb);
return 1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 74 | 83.15% | 2 | 40.00% |
Vinay K. Nallamothu | 9 | 10.11% | 1 | 20.00% |
Arnaldo Carvalho de Melo | 6 | 6.74% | 2 | 40.00% |
Total | 89 | 100.00% | 5 | 100.00% |
static void nr_loopback_timer(unsigned long param)
{
struct sk_buff *skb;
ax25_address *nr_dest;
struct net_device *dev;
if ((skb = skb_dequeue(&loopback_queue)) != NULL) {
nr_dest = (ax25_address *)(skb->data + 7);
dev = nr_dev_get(nr_dest);
if (dev == NULL || nr_rx_frame(skb, dev) == 0)
kfree_skb(skb);
if (dev != NULL)
dev_put(dev);
if (!skb_queue_empty(&loopback_queue) && !nr_loopback_running())
mod_timer(&loopback_timer, jiffies + 10);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 95 | 82.61% | 3 | 60.00% |
Dave Jones | 11 | 9.57% | 1 | 20.00% |
Vinay K. Nallamothu | 9 | 7.83% | 1 | 20.00% |
Total | 115 | 100.00% | 5 | 100.00% |
void __exit nr_loopback_clear(void)
{
del_timer_sync(&loopback_timer);
skb_queue_purge(&loopback_queue);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 18 | 90.00% | 2 | 50.00% |
Linus Torvalds | 1 | 5.00% | 1 | 25.00% |
Vinay K. Nallamothu | 1 | 5.00% | 1 | 25.00% |
Total | 20 | 100.00% | 4 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 242 | 79.61% | 6 | 42.86% |
Vinay K. Nallamothu | 36 | 11.84% | 1 | 7.14% |
Dave Jones | 11 | 3.62% | 1 | 7.14% |
Arnaldo Carvalho de Melo | 6 | 1.97% | 2 | 14.29% |
Ingo Molnar | 4 | 1.32% | 1 | 7.14% |
Tejun Heo | 3 | 0.99% | 1 | 7.14% |
Linus Torvalds | 1 | 0.33% | 1 | 7.14% |
Ralf Bächle | 1 | 0.33% | 1 | 7.14% |
Total | 304 | 100.00% | 14 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.