netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karl Hiramoto <karl@hiramoto.org>
To: linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org,
	chas@cmf.nrl.navy.mil
Cc: nathan@traverse.com.au, Karl Hiramoto <karl@hiramoto.org>
Subject: [PATCH 2/6] atm br2684: add callback for carrier signal changes.
Date: Fri,  2 Jul 2010 19:47:06 +0200	[thread overview]
Message-ID: <1278092830-10473-3-git-send-email-karl@hiramoto.org> (raw)
In-Reply-To: <1278092830-10473-1-git-send-email-karl@hiramoto.org>

When a signal change event occurs call netif_carrier_on/off.

Signed-off-by: Karl Hiramoto <karl@hiramoto.org>
---
 net/atm/br2684.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 6719af6..e0136ec 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -448,6 +448,17 @@ free_skb:
 	dev_kfree_skb(skb);
 }
 
+static void br2684_signal_change(struct atm_vcc *atmvcc)
+{
+	struct br2684_vcc *brvcc = BR2684_VCC(atmvcc);
+	struct net_device *net_dev = brvcc->device;
+
+	if (atmvcc->dev->signal == ATM_PHY_SIG_LOST)
+		netif_carrier_off(net_dev);
+	else
+		netif_carrier_on(net_dev);
+}
+
 /*
  * Assign a vcc to a dev
  * Note: we do not have explicit unassign, but look at _push()
@@ -514,6 +525,7 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
 	barrier();
 	atmvcc->push = br2684_push;
 	atmvcc->pop = br2684_pop;
+	atmvcc->signal_change = br2684_signal_change;
 
 	__skb_queue_head_init(&queue);
 	rq = &sk_atm(atmvcc)->sk_receive_queue;
@@ -530,6 +542,7 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
 
 		br2684_push(atmvcc, skb);
 	}
+	br2684_signal_change(atmvcc); /* initialize netdev carrier state */
 	__module_get(THIS_MODULE);
 	return 0;
 
-- 
1.7.1


  parent reply	other threads:[~2010-07-02 17:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02 17:47 [PATCH 0/6] atm: propagate atm_dev signal carrier to LOWER_UP of netdevice Karl Hiramoto
2010-07-02 17:47 ` [PATCH 1/6] atm: add hooks to propagate signal changes to netdevice Karl Hiramoto
2010-07-02 17:47 ` Karl Hiramoto [this message]
2010-07-02 17:47 ` [PATCH 3/6] atm/idt77105.c: call atm_dev_signal_change() when signal changes Karl Hiramoto
2010-07-02 17:47 ` [PATCH 4/6] atm/solos-pci: " Karl Hiramoto
2010-07-02 17:47 ` [PATCH 5/6] atm/suni.c: " Karl Hiramoto
2010-07-02 17:47 ` [PATCH 6/6] atm/adummy: add syfs DEVICE_ATTR to change signal Karl Hiramoto
2010-07-03 20:09 ` [Linux-ATM-General] [PATCH 0/6] atm: propagate atm_dev signal carrier to LOWER_UP of netdevice chas williams - CONTRACTOR

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=1278092830-10473-3-git-send-email-karl@hiramoto.org \
    --to=karl@hiramoto.org \
    --cc=chas@cmf.nrl.navy.mil \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=nathan@traverse.com.au \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).