From patchwork Tue Jan 19 15:42:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jo=C3=A3o_Paulo_Rechi_Vita?= X-Patchwork-Id: 8063501 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 12A8ABEEED for ; Tue, 19 Jan 2016 15:46:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6A71203A1 for ; Tue, 19 Jan 2016 15:46:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3118C203A0 for ; Tue, 19 Jan 2016 15:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757039AbcASPpp (ORCPT ); Tue, 19 Jan 2016 10:45:45 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:35672 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756317AbcASPoI (ORCPT ); Tue, 19 Jan 2016 10:44:08 -0500 Received: by mail-qk0-f196.google.com with SMTP id s5so4577597qkd.2; Tue, 19 Jan 2016 07:44:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=mgIVMQxeGnpGWly4ihcTFw6QtiR58jVOLxS3OX2aqnQ=; b=ZYocC7E25DCWUnaEc8sndj7MXZPP+4mC2Uq6usT/QEycjEBGOxetgLGgX2QBfFUQKE 7LqROATyjfL0Xgx1c/jQWTdv2UuSd09VYq0E1vTcz6L6sgVp2EpyFgaSmsUTIp9nF4XL QcSrbAiOV8vwfn5Oynr0ilWY/kG5MQjmTM1sHcbjUzzFVlvsTFe3LR/7Q60rEAIAYqeP fw6fGiKGapH9+76Lumqyxc5kRl7nWCkx3nPG/n1flyCYLwE0TCdh5F05hNNaoQR89k1V raN4RSD7XHZdQSb6IHfHLd7VxbrxOEeQowXorsHFgHsJ4pb5gBUBiXiN8tHawzCh4SA/ Luug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=mgIVMQxeGnpGWly4ihcTFw6QtiR58jVOLxS3OX2aqnQ=; b=My5SmYOu58cJfOw6k4aU5iOONuuKSDzZa9hDakBw9Ph2tMEF9kSUnZa7L9Idlemutu lUB/WkJgE9SwVjK86X3WCoDpuyh0dyJFjgO2EHcqLwvnmwKDXQd+pzOgoJIFSrrcJwly w3jg6SOBQqHK8iDShS8nI+40LysmI+jd8NWzxQUomYLXVtKhfAJFTUtSa3giQS5EsSwJ cAOkguMPvF8CrMLHJYlwUqGSsYvlRVE2WAOsCKcNyFktHju4VJjd90cMlORYb07ZTlgn V6eyQpwQ3wb9l7UnKhMNPGlbfh6um4vPaik0yh7c3DIKn0vF3vJvo1jQddB4NY2zcx1i IRIg== X-Gm-Message-State: ALoCoQnn5P9L3UMBsQqAIDWIeSDCrWhcoAoLkbODECcyLd+Y4lJ1lVbyPhSwbV40KKzW644ype6yRkmf1fNZ4+5UvGY/I0Gp7w== X-Received: by 10.55.71.76 with SMTP id u73mr39577155qka.6.1453218247370; Tue, 19 Jan 2016 07:44:07 -0800 (PST) Received: from localhost.localdomain (c-98-239-150-235.hsd1.wv.comcast.net. [98.239.150.235]) by smtp.gmail.com with ESMTPSA id z10sm12336759qhz.5.2016.01.19.07.44.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jan 2016 07:44:06 -0800 (PST) From: "=?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?=" X-Google-Original-From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= To: johannes@sipsolutions.net Cc: marcel@holtmann.org, linux-wireless@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jprvita@endlessm.com, linux@endlessm.com Subject: [PATCH 5/8] rfkill: Remove obsolete "state" sysfs interface Date: Tue, 19 Jan 2016 10:42:40 -0500 Message-Id: <1453218163-31998-6-git-send-email-jprvita@endlessm.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453218163-31998-1-git-send-email-jprvita@endlessm.com> References: <1453218163-31998-1-git-send-email-jprvita@endlessm.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This was schedule to be removed in 2014 by: commit 69c86373c6ea1149aa559e6088362d58d8ec8835 Author: florian@mickler.org Date: Wed Feb 24 12:05:16 2010 +0100 Document the rfkill sysfs ABI This moves sysfs ABI info from Documentation/rfkill.txt to the ABI subfolder and reformats it. This also schedules the deprecated sysfs parts to be removed in 2012 (claim file) and 2014 (state file). Signed-off-by: Florian Mickler Signed-off-by: John W. Linville Signed-off-by: João Paulo Rechi Vita --- Documentation/ABI/obsolete/sysfs-class-rfkill | 20 --------------- Documentation/ABI/removed/sysfs-class-rfkill | 17 +++++++++++++ net/rfkill/core.c | 35 --------------------------- 3 files changed, 17 insertions(+), 55 deletions(-) delete mode 100644 Documentation/ABI/obsolete/sysfs-class-rfkill diff --git a/Documentation/ABI/obsolete/sysfs-class-rfkill b/Documentation/ABI/obsolete/sysfs-class-rfkill deleted file mode 100644 index e736d14..0000000 --- a/Documentation/ABI/obsolete/sysfs-class-rfkill +++ /dev/null @@ -1,20 +0,0 @@ -rfkill - radio frequency (RF) connector kill switch support - -For details to this subsystem look at Documentation/rfkill.txt. - -What: /sys/class/rfkill/rfkill[0-9]+/state -Date: 09-Jul-2007 -KernelVersion v2.6.22 -Contact: linux-wireless@vger.kernel.org -Description: Current state of the transmitter. - This file is deprecated and scheduled to be removed in 2014, - because its not possible to express the 'soft and hard block' - state of the rfkill driver. -Values: A numeric value. - 0: RFKILL_STATE_SOFT_BLOCKED - transmitter is turned off by software - 1: RFKILL_STATE_UNBLOCKED - transmitter is (potentially) active - 2: RFKILL_STATE_HARD_BLOCKED - transmitter is forced off by something outside of - the driver's control. diff --git a/Documentation/ABI/removed/sysfs-class-rfkill b/Documentation/ABI/removed/sysfs-class-rfkill index 3ce6231..1b93139 100644 --- a/Documentation/ABI/removed/sysfs-class-rfkill +++ b/Documentation/ABI/removed/sysfs-class-rfkill @@ -11,3 +11,20 @@ Description: This file was deprecated because there no longer was a way to This file was scheduled to be removed in 2012, and was removed in 2016. Values: 0: Kernel handles events + +What: /sys/class/rfkill/rfkill[0-9]+/state +Date: 09-Jul-2007 +KernelVersion v2.6.22 +Contact: linux-wireless@vger.kernel.org +Description: Current state of the transmitter. + This file was deprecated and scheduled to be removed in 2014, + because it was not possible to express the 'soft and hard block' + state of the rfkill driver. It was removed in 2016. +Values: A numeric value. + 0: RFKILL_STATE_SOFT_BLOCKED + transmitter is turned off by software + 1: RFKILL_STATE_UNBLOCKED + transmitter is (potentially) active + 2: RFKILL_STATE_HARD_BLOCKED + transmitter is forced off by something outside of + the driver's control. diff --git a/net/rfkill/core.c b/net/rfkill/core.c index a05d1f1..26da4f0 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -683,46 +683,11 @@ static u8 user_state_from_blocked(unsigned long state) return RFKILL_USER_STATE_UNBLOCKED; } -static ssize_t state_show(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct rfkill *rfkill = to_rfkill(dev); - - return sprintf(buf, "%d\n", user_state_from_blocked(rfkill->state)); -} - -static ssize_t state_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct rfkill *rfkill = to_rfkill(dev); - unsigned long state; - int err; - - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - - err = kstrtoul(buf, 0, &state); - if (err) - return err; - - if (state != RFKILL_USER_STATE_SOFT_BLOCKED && - state != RFKILL_USER_STATE_UNBLOCKED) - return -EINVAL; - - mutex_lock(&rfkill_global_mutex); - rfkill_set_block(rfkill, state == RFKILL_USER_STATE_SOFT_BLOCKED); - mutex_unlock(&rfkill_global_mutex); - - return count; -} -static DEVICE_ATTR_RW(state); - static struct attribute *rfkill_dev_attrs[] = { &dev_attr_name.attr, &dev_attr_type.attr, &dev_attr_index.attr, &dev_attr_persistent.attr, - &dev_attr_state.attr, &dev_attr_soft.attr, &dev_attr_hard.attr, NULL,