All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] LAPB: added 'delivered' interface
@ 2012-05-31 15:31 Sergey Lapin
  2012-05-31 15:31 ` [PATCH 2/2] lapb-nl: Added driver Sergey Lapin
  2012-06-01 12:28 ` [PATCH 1/2] LAPB: added 'delivered' interface Alan Cox
  0 siblings, 2 replies; 6+ messages in thread
From: Sergey Lapin @ 2012-05-31 15:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel, linux-x25, Sergey Lapin

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-01 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 15:31 [PATCH 1/2] LAPB: added 'delivered' interface Sergey Lapin
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.