diff options
author | tilghman <tilghman@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-06-22 20:23:41 +0000 |
---|---|---|
committer | tilghman <tilghman@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-06-22 20:23:41 +0000 |
commit | df2e8131e92f1967eb61fb443036fdf9491ce745 (patch) | |
tree | ff896c23081a2c04ef47d1be583c9c7e612e7fe0 /ztd-eth.c | |
parent | e7324ee365da30e9b7b18d6baaec5ae21de1894b (diff) |
Bug 5126 - Fix for incompatiblities between the TDMo* drivers and the 2.6 kernel
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1157 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'ztd-eth.c')
-rw-r--r-- | ztd-eth.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -56,6 +56,8 @@ static DEFINE_SPINLOCK(zlock); static spinlock_t zlock = SPIN_LOCK_UNLOCKED; #endif +static struct sk_buff_head skbs; + static struct ztdeth { unsigned char addr[ETH_ALEN]; unsigned short subaddr; /* Network byte order */ @@ -171,7 +173,7 @@ static int ztdeth_transmit(void *pvt, unsigned char *msg, int msglen) skb->dev = dev; if (dev->hard_header) dev->hard_header(skb, dev, ETH_P_ZTDETH, addr, dev->dev_addr, skb->len); - dev_queue_xmit(skb); + skb_queue_tail(&skbs, skb); } } else @@ -179,6 +181,18 @@ static int ztdeth_transmit(void *pvt, unsigned char *msg, int msglen) return 0; } + +static int ztdeth_flush(void) +{ + struct sk_buff *skb; + + /* Handle all transmissions now */ + while ((skb = skb_dequeue(&skbs))) { + dev_queue_xmit(skb); + } + return 0; +} + static struct packet_type ztdeth_ptype = { type: __constant_htons(ETH_P_ZTDETH), /* Protocol */ dev: NULL, /* Device (NULL = wildcard) */ @@ -381,7 +395,8 @@ static struct zt_dynamic_driver ztd_eth = { "Ethernet", ztdeth_create, ztdeth_destroy, - ztdeth_transmit + ztdeth_transmit, + ztdeth_flush }; static struct notifier_block ztdeth_nblock = { @@ -393,6 +408,9 @@ static int __init ztdeth_init(void) dev_add_pack(&ztdeth_ptype); register_netdevice_notifier(&ztdeth_nblock); zt_dynamic_register(&ztd_eth); + + skb_queue_head_init(&skbs); + return 0; } |