From patchwork Sat Feb 13 21:56:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe De Muyter X-Patchwork-Id: 45279 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 934CFB7080 for ; Sun, 14 Feb 2010 08:56:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758128Ab0BMV4j (ORCPT ); Sat, 13 Feb 2010 16:56:39 -0500 Received: from mailrelay007.isp.belgacom.be ([195.238.6.173]:44437 "EHLO mailrelay007.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989Ab0BMV4j (ORCPT ); Sat, 13 Feb 2010 16:56:39 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAEaudkvCTtAn/2dsb2JhbACbIHS6OYRbBA Received: from mail.macqel.be ([194.78.208.39]) by relay.skynet.be with ESMTP; 13 Feb 2010 22:56:36 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.macqel.be (Postfix) with ESMTP id A539E130CAC; Sat, 13 Feb 2010 22:56:35 +0100 (CET) X-Virus-Scanned: amavisd-new at macqel.be Received: from mail.macqel.be ([127.0.0.1]) by localhost (mail.macqel.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rgZWvltV62Hu; Sat, 13 Feb 2010 22:56:33 +0100 (CET) Received: from frolo.macqel.be (frolo.macqel [10.1.40.73]) by mail.macqel.be (Postfix) with ESMTP id B5F5A130C83; Sat, 13 Feb 2010 22:56:33 +0100 (CET) Received: by frolo.macqel.be (Postfix, from userid 1000) id B8BCFDF09C7; Sat, 13 Feb 2010 22:56:33 +0100 (CET) Date: Sat, 13 Feb 2010 22:56:33 +0100 From: Philippe De Muyter To: chas@cmf.nrl.navy.mil, netdev@vger.kernel.org Subject: [PATCH] atm : fix /sys/devices/virtual/atm/X/carrier(ATM_PHY_SIG_UNKNOWN) Message-ID: <20100213215633.GA4345@frolo.macqel> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.16 (2007-06-09) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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; }