From: Sergey Lapin <slapin@ossfans.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, linux-x25@vger.kernel.org,
Sergey Lapin <slapin@ossfans.org>
Subject: [PATCH 1/2] LAPB: added 'delivered' interface
Date: Thu, 31 May 2012 11:31:17 -0400 [thread overview]
Message-ID: <1338478278-24732-1-git-send-email-slapin@ossfans.org> (raw)
When using LAPB API for non-X.25 work, it is often necessary
to know if/when data is delivered to third party using LAPB
interface (e.g over serial or other media).
Signed-off-by: Sergey Lapin <slapin@ossfans.org>
---
include/linux/lapb.h | 1 +
net/lapb/lapb_iface.c | 6 ++++++
net/lapb/lapb_subr.c | 1 +
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/linux/lapb.h b/include/linux/lapb.h
index 873c1eb..fd963be 100644
--- a/include/linux/lapb.h
+++ b/include/linux/lapb.h
@@ -30,6 +30,7 @@ struct lapb_register_struct {
void (*disconnect_indication)(struct net_device *dev, int reason);
int (*data_indication)(struct net_device *dev, struct sk_buff *skb);
void (*data_transmit)(struct net_device *dev, struct sk_buff *skb);
+ void (*data_delivered)(struct net_device *dev, struct sk_buff *skb);
};
struct lapb_parms_struct {
diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
index 3cdaa04..0fe77ae 100644
--- a/net/lapb/lapb_iface.c
+++ b/net/lapb/lapb_iface.c
@@ -415,6 +415,12 @@ int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *skb)
return used;
}
+void lapb_data_delivered(struct lapb_cb *lapb, struct sk_buff *skb)
+{
+ if (lapb->callbacks->data_delivered)
+ lapb->callbacks->data_delivered(lapb->dev, skb);
+}
+
EXPORT_SYMBOL(lapb_register);
EXPORT_SYMBOL(lapb_unregister);
EXPORT_SYMBOL(lapb_getparms);
diff --git a/net/lapb/lapb_subr.c b/net/lapb/lapb_subr.c
index 9d0a426..a44451d 100644
--- a/net/lapb/lapb_subr.c
+++ b/net/lapb/lapb_subr.c
@@ -61,6 +61,7 @@ void lapb_frames_acked(struct lapb_cb *lapb, unsigned short nr)
if (lapb->va != nr)
while (skb_peek(&lapb->ack_queue) && lapb->va != nr) {
skb = skb_dequeue(&lapb->ack_queue);
+ lapb_data_delivered(lapb, skb);
kfree_skb(skb);
lapb->va = (lapb->va + 1) % modulus;
}
--
1.7.5.4
next reply other threads:[~2012-05-31 15:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 15:31 Sergey Lapin [this message]
2012-05-31 15:31 ` [PATCH 2/2] lapb-nl: Added driver Sergey Lapin
2012-06-01 13:52 ` Alan Cox
2012-06-01 14:40 ` Sergey Lapin
2012-06-01 14:54 ` Alan Cox
2012-06-01 12:28 ` [PATCH 1/2] LAPB: added 'delivered' interface Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1338478278-24732-1-git-send-email-slapin@ossfans.org \
--to=slapin@ossfans.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-x25@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox