public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] atm : fix /sys/devices/virtual/atm/X/carrier(ATM_PHY_SIG_UNKNOWN)
@ 2010-02-13 21:56 Philippe De Muyter
  2010-02-13 23:24 ` Chas Williams (CONTRACTOR)
  0 siblings, 1 reply; 8+ messages in thread
From: Philippe De Muyter @ 2010-02-13 21:56 UTC (permalink / raw)
  To: chas, netdev

When trying to design udev rules to automate usage of cxacru usb atm (adsl)
modem, I have discovered that /sys/devices/virtual/atm/cxacru0/carrier had the
value '1' while actually carrier was not yet established and real carrier
state was not yet known to linux.  I propose to fix that by using '?' as the
/sys/devices/virtual/atm/cxacru0/carrier value when carrier state is not yet
known to linux.  Any other value except '1' would also be OK for me.

--
Currently, just after the interface creation,
/sys/devices/virtual/atm/cxacru0/carrier gives wrong info (carrier = 1),
while actually carrier is unknown.  Fix that.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>

--- a/net/atm/atm_sysfs.c	2010-02-13 22:54:04.598847195 +0100
+++ b/net/atm/atm_sysfs.c	2010-02-13 19:13:45.395308531 +0100
@@ -63,9 +63,9 @@ static ssize_t show_carrier(struct devic
 	char *pos = buf;
 	struct atm_dev *adev = to_atm_dev(cdev);
 
-	pos += sprintf(pos, "%d\n",
-		       adev->signal ==
-		       adev->signal == ATM_PHY_SIG_LOST ? 0 : 1);
+	pos += sprintf(pos, "%c\n",
+		       adev->signal == ATM_PHY_SIG_FOUND ? '1' :
+		       adev->signal == ATM_PHY_SIG_LOST ? '0' : '?');
 
 	return pos - buf;
 }

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

end of thread, other threads:[~2013-08-08  8:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-13 21:56 [PATCH] atm : fix /sys/devices/virtual/atm/X/carrier(ATM_PHY_SIG_UNKNOWN) Philippe De Muyter
2010-02-13 23:24 ` Chas Williams (CONTRACTOR)
2010-02-14 17:51   ` Philippe De Muyter
2010-02-14 21:34     ` Chas Williams (CONTRACTOR)
2010-02-17  6:16       ` David Miller
2010-02-17 11:35         ` Philippe De Muyter
2010-02-18 14:22     ` Chas Williams (CONTRACTOR)
2013-08-08  8:34       ` Philippe De Muyter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox