summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2017-06-24 21:03:38 +0200
committerSami Kerola2017-08-30 21:32:48 +0200
commite69263c03bf03f85812eb2a2fdea45d8ef4f8f94 (patch)
tree02a22083aa813f41e4df0cb5a0dca18651ab9320
parentrfkill: merge rfkill.8 project to util-linux (diff)
downloadkernel-qcow2-util-linux-e69263c03bf03f85812eb2a2fdea45d8ef4f8f94.tar.gz
kernel-qcow2-util-linux-e69263c03bf03f85812eb2a2fdea45d8ef4f8f94.tar.xz
kernel-qcow2-util-linux-e69263c03bf03f85812eb2a2fdea45d8ef4f8f94.zip
rfkill: move files to appropriate locations
Also remove unnecessary items. Notice that the licence text from COPYING is moved to top of the command in comment section. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--AUTHORS10
-rw-r--r--Documentation/rfkill.readme (renamed from rfkill/README)3
-rw-r--r--rfkill/.gitignore5
-rw-r--r--rfkill/COPYING15
-rw-r--r--rfkill/Makefile62
-rw-r--r--rfkill/core.h8
-rw-r--r--rfkill/rfkill.h109
-rwxr-xr-xrfkill/version.sh32
-rw-r--r--sys-utils/rfkill.8 (renamed from rfkill/rfkill.8)0
-rw-r--r--sys-utils/rfkill.c (renamed from rfkill/rfkill.c)18
-rwxr-xr-xsys-utils/rfkill.py (renamed from rfkill/rfkill.py)0
11 files changed, 30 insertions, 232 deletions
diff --git a/AUTHORS b/AUTHORS
index 4da4fb8d8..83ed1afbf 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -51,6 +51,9 @@ AUTHORS (merged projects & commands):
runuser: [derived from coreutils su(1)]
Karel Zak <kzak@redhat.com>
resizepart: Vivek Goyal <vgoyal@redhat.com>
+ rfkill: Johannes Berg <johannes@sipsolutions.net>
+ Marcel Holtmann <marcel@holtmann.org>
+ Tim Gardner <tim.gardner@canonical.com>
rtcwake: David Brownell <david-b@pacbell.net>
Bernhard Walle <bwalle@suse.de>
schedutils: Robert Love <rlove@rlove.org>
@@ -190,6 +193,7 @@ CONTRIBUTORS:
Daniel Stodden <daniel.stodden@googlemail.com>
Daniel Thumim <dthumim@mit.edu>
Daniel Trebbien <dtrebbien@gmail.com>
+ Darren Salt <linux@youmustbejoking.demon.co.uk>
Dave Reisner <dreisner@archlinux.org>
David Brownell <david-b@pacbell.net>
David Holland <dholland@hcs.harvard.edu>
@@ -317,9 +321,11 @@ CONTRIBUTORS:
Jindrich Makovicka <makovick@gmail.com>
Jiro SEKIBA <jir@unicus.jp>
Joe Hansen <joedalton2@yahoo.dk>
+ Johannes Berg <johannes@sipsolutions.net>
John Keeping <john.keeping@lineone.net>
John Lindgren <john.lindgren@tds.net>
John Paul Morrison <jmorriso@rflab.ee.ubc.ca>
+ John W. Linville <linville@tuxdriver.com>
Jonathan Liu <net147@gmail.com>
Jon Grant <jg@jguk.org>
Jon Ringle <jon@ringle.org>
@@ -364,6 +370,7 @@ CONTRIBUTORS:
Mantas Mikulėnas <grawity@gmail.com>
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+ Marcel Holtmann <marcel@holtmann.org>
Marco Colombo <m.colombo@ed.ac.uk>
Marco d'Itri <md@Linux.IT>
Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl>
@@ -506,6 +513,7 @@ CONTRIBUTORS:
Rui Zhao (renyuneyun) <renyuneyun@gmail.com>
Sami Kerola <kerolasa@iki.fi>
Sami Liedes <sami.liedes@iki.fi>
+ Samuel Ortiz <sameo@linux.intel.com>
Samuel Thibault <samuel.thibault@ens-lyon.org>
Sam Varshavchik <mrsam@courier-mta.com>
Sander van Malssen <svm@kozmix.ow.nl>
@@ -560,10 +568,12 @@ CONTRIBUTORS:
Tilman Schmidt <tilman@imap.cc>
Timo Juhani Lindfors <timo.lindfors@iki.fi>
Timo Warns <Warns@Pre-Sense.DE>
+ Tim Gardner <tim.gardner@canonical.com>
Tim Waugh <twaugh@redhat.com>
Tobias Klauser <tklauser@distanz.ch>
Tobias Stoeckmann <tobias@stoeckmann.org>
Tom Gundersen <teg@jklm.no>
+ Tomas Winkler <tomas.winkler@intel.com>
Tomislav Krznar <tomislav.krznar@gmail.com>
Tommi Kyntola <kynde@iki.fi>
Tommy Thorn
diff --git a/rfkill/README b/Documentation/rfkill.readme
index 0f5dafe33..ec1c2a64c 100644
--- a/rfkill/README
+++ b/Documentation/rfkill.readme
@@ -1,3 +1,6 @@
+This was the original README when rfkill was a standalone project.
+
+-- snip
This is 'rfkill', a tool to use /dev/rfkill.
diff --git a/rfkill/.gitignore b/rfkill/.gitignore
deleted file mode 100644
index 528816db0..000000000
--- a/rfkill/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-version.c
-*.o
-rfkill
-*~
-*.gz
diff --git a/rfkill/COPYING b/rfkill/COPYING
deleted file mode 100644
index 58265cdc9..000000000
--- a/rfkill/COPYING
+++ /dev/null
@@ -1,15 +0,0 @@
-Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
-Copyright 2009 Marcel Holtmann <marcel@holtmann.org>
-Copyright 2009 Tim Gardner <tim.gardner@canonical.com>
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/rfkill/Makefile b/rfkill/Makefile
deleted file mode 100644
index 8d6c700be..000000000
--- a/rfkill/Makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-MAKEFLAGS += --no-print-directory
-
-PREFIX ?= /usr
-SBINDIR ?= $(PREFIX)/sbin
-MANDIR ?= $(PREFIX)/share/man
-
-MKDIR ?= mkdir -p
-INSTALL ?= install
-CC ?= "gcc"
-
-CFLAGS ?= -O2 -g
-CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
-
-OBJS = rfkill.o version.o
-ALL = rfkill
-
-ifeq ($(V),1)
-Q=
-NQ=true
-else
-Q=@
-NQ=echo
-endif
-
-all: $(ALL)
-
-VERSION_OBJS := $(filter-out version.o, $(OBJS))
-
-version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) rfkill.h Makefile \
- $(wildcard .git/index .git/refs/tags)
- @$(NQ) ' GEN ' $@
-ifeq (,$(VERSION_SUFFIX))
- $(Q)./version.sh $@
-else
- $(Q)./version.sh --suffix "$(VERSION_SUFFIX)" $@
-endif
-
-%.o: %.c rfkill.h
- @$(NQ) ' CC ' $@
- $(Q)$(CC) $(CFLAGS) -c -o $@ $<
-
-rfkill: $(OBJS)
- @$(NQ) ' CC ' rfkill
- $(Q)$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o rfkill
-
-check:
- $(Q)$(MAKE) all CC="REAL_CC=$(CC) CHECK=\"sparse -Wall\" cgcc"
-
-%.gz: %
- @$(NQ) ' GZIP' $<
- $(Q)gzip < $< > $@
-
-install: rfkill rfkill.8.gz
- @$(NQ) ' INST rfkill'
- $(Q)$(MKDIR) $(DESTDIR)$(SBINDIR)
- $(Q)$(INSTALL) -m 755 -t $(DESTDIR)$(SBINDIR) rfkill
- @$(NQ) ' INST rfkill.8'
- $(Q)$(MKDIR) $(DESTDIR)$(MANDIR)/man8/
- $(Q)$(INSTALL) -m 644 -t $(DESTDIR)$(MANDIR)/man8/ rfkill.8.gz
-
-clean:
- $(Q)rm -f rfkill *.o *~ *.gz version.c *-stamp
diff --git a/rfkill/core.h b/rfkill/core.h
deleted file mode 100644
index 56cde4044..000000000
--- a/rfkill/core.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __CORE
-#define __CORE
-
-#include "rfkill.h"
-
-extern const char rfkill_version[];
-
-#endif
diff --git a/rfkill/rfkill.h b/rfkill/rfkill.h
deleted file mode 100644
index 058757f7a..000000000
--- a/rfkill/rfkill.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2006 - 2007 Ivo van Doorn
- * Copyright (C) 2007 Dmitry Torokhov
- * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef _UAPI__RFKILL_H
-#define _UAPI__RFKILL_H
-
-
-#include <linux/types.h>
-
-/* define userspace visible states */
-#define RFKILL_STATE_SOFT_BLOCKED 0
-#define RFKILL_STATE_UNBLOCKED 1
-#define RFKILL_STATE_HARD_BLOCKED 2
-
-/**
- * enum rfkill_type - type of rfkill switch.
- *
- * @RFKILL_TYPE_ALL: toggles all switches (requests only - not a switch type)
- * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
- * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
- * @RFKILL_TYPE_UWB: switch is on a ultra wideband device.
- * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
- * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
- * @RFKILL_TYPE_GPS: switch is on a GPS device.
- * @RFKILL_TYPE_FM: switch is on a FM radio device.
- * @RFKILL_TYPE_NFC: switch is on an NFC device.
- * @NUM_RFKILL_TYPES: number of defined rfkill types
- */
-enum rfkill_type {
- RFKILL_TYPE_ALL = 0,
- RFKILL_TYPE_WLAN,
- RFKILL_TYPE_BLUETOOTH,
- RFKILL_TYPE_UWB,
- RFKILL_TYPE_WIMAX,
- RFKILL_TYPE_WWAN,
- RFKILL_TYPE_GPS,
- RFKILL_TYPE_FM,
- RFKILL_TYPE_NFC,
- NUM_RFKILL_TYPES,
-};
-
-/**
- * enum rfkill_operation - operation types
- * @RFKILL_OP_ADD: a device was added
- * @RFKILL_OP_DEL: a device was removed
- * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device
- * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all)
- */
-enum rfkill_operation {
- RFKILL_OP_ADD = 0,
- RFKILL_OP_DEL,
- RFKILL_OP_CHANGE,
- RFKILL_OP_CHANGE_ALL,
-};
-
-/**
- * struct rfkill_event - events for userspace on /dev/rfkill
- * @idx: index of dev rfkill
- * @type: type of the rfkill struct
- * @op: operation code
- * @hard: hard state (0/1)
- * @soft: soft state (0/1)
- *
- * Structure used for userspace communication on /dev/rfkill,
- * used for events from the kernel and control to the kernel.
- */
-struct rfkill_event {
- __u32 idx;
- __u8 type;
- __u8 op;
- __u8 soft, hard;
-} __attribute__((packed));
-
-/*
- * We are planning to be backward and forward compatible with changes
- * to the event struct, by adding new, optional, members at the end.
- * When reading an event (whether the kernel from userspace or vice
- * versa) we need to accept anything that's at least as large as the
- * version 1 event size, but might be able to accept other sizes in
- * the future.
- *
- * One exception is the kernel -- we already have two event sizes in
- * that we've made the 'hard' member optional since our only option
- * is to ignore it anyway.
- */
-#define RFKILL_EVENT_SIZE_V1 8
-
-/* ioctl for turning off rfkill-input (if present) */
-#define RFKILL_IOC_MAGIC 'R'
-#define RFKILL_IOC_NOINPUT 1
-#define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT)
-
-/* and that's all userspace gets */
-
-#endif /* _UAPI__RFKILL_H */
diff --git a/rfkill/version.sh b/rfkill/version.sh
deleted file mode 100755
index f2bcaace8..000000000
--- a/rfkill/version.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-
-VERSION="0.5"
-
-SUFFIX=
-if test "x$1" = x--suffix; then
- shift
- SUFFIX="-$1"
- shift
-fi
-OUT="$1"
-
-if test "x$SUFFIX" != 'x'; then
- v="$VERSION$SUFFIX"
-elif head=`git rev-parse --verify HEAD 2>/dev/null`; then
- git update-index --refresh --unmerged > /dev/null
- descr=$(git describe 2>/dev/null || echo "v$VERSION")
-
- # on git builds check that the version number above
- # is correct...
- [ "${descr%%-*}" = "v$VERSION" ] || exit 2
-
- echo -n 'const char rfkill_version[] = "' > "$OUT"
- v="${descr#v}"
- if git diff-index --name-only HEAD | read dummy ; then
- v="$v"-dirty
- fi
-else
- v="$VERSION"
-fi
-
-echo "const char rfkill_version[] = \"$v\";" > "$OUT"
diff --git a/rfkill/rfkill.8 b/sys-utils/rfkill.8
index 24baccc67..24baccc67 100644
--- a/rfkill/rfkill.8
+++ b/sys-utils/rfkill.8
diff --git a/rfkill/rfkill.c b/sys-utils/rfkill.c
index 8cd81fed9..60f8cdc27 100644
--- a/rfkill/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -1,5 +1,21 @@
/*
- * rfkill userspace tool
+ * /dev/rfkill userspace tool
+ *
+ * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
+ * Copyright 2009 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2009 Tim Gardner <tim.gardner@canonical.com>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <stdio.h>
diff --git a/rfkill/rfkill.py b/sys-utils/rfkill.py
index 57dcddc06..57dcddc06 100755
--- a/rfkill/rfkill.py
+++ b/sys-utils/rfkill.py