summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile.am11
-rw-r--r--bin/Makefile.in45
-rwxr-xr-xbin/wimaxll-reset4
-rw-r--r--bin/wimaxll-reset.c76
-rwxr-xr-xbin/wimaxll-rfkill5
-rw-r--r--bin/wimaxll-rfkill.c123
-rwxr-xr-xbin/wimaxll-wait-for-state-change4
-rw-r--r--bin/wimaxll-wait-for-state-change.c82
8 files changed, 28 insertions, 322 deletions
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 95dfd72..394bf62 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -7,13 +7,14 @@ INCLUDES = \
LDADD = ../lib/libwimaxll.la $(LIBNL1_LIBS)
-bin_SCRIPTS = wimax-tools-version
+bin_SCRIPTS = \
+ wimax-tools-version \
+ wimaxll-reset \
+ wimaxll-rfkill \
+ wimaxll-wait-for-state-change
bin_PROGRAMS = \
- wimaxll \
- wimaxll-wait-for-state-change \
- wimaxll-rfkill \
- wimaxll-reset
+ wimaxll
AM_CFLAGS = @GLIB_CFLAGS@ -DPLUGINDIR=\""$(plugindir)"\"
AM_LDFLAGS = @GLIB_LIBS@ ../lib/libwimaxll.la $(LIBNL1_LIBS)
diff --git a/bin/Makefile.in b/bin/Makefile.in
index 74e6e45..80db28a 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -34,8 +34,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-bin_PROGRAMS = wimaxll$(EXEEXT) wimaxll-wait-for-state-change$(EXEEXT) \
- wimaxll-rfkill$(EXEEXT) wimaxll-reset$(EXEEXT)
+bin_PROGRAMS = wimaxll$(EXEEXT)
subdir = bin
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/wimax-tools-version.in
@@ -83,23 +82,6 @@ am__DEPENDENCIES_1 =
wimaxll_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(wimaxll_LDFLAGS) \
$(LDFLAGS) -o $@
-wimaxll_reset_SOURCES = wimaxll-reset.c
-wimaxll_reset_OBJECTS = wimaxll-reset.$(OBJEXT)
-wimaxll_reset_LDADD = $(LDADD)
-wimaxll_reset_DEPENDENCIES = ../lib/libwimaxll.la \
- $(am__DEPENDENCIES_1)
-wimaxll_rfkill_SOURCES = wimaxll-rfkill.c
-wimaxll_rfkill_OBJECTS = wimaxll-rfkill.$(OBJEXT)
-wimaxll_rfkill_LDADD = $(LDADD)
-wimaxll_rfkill_DEPENDENCIES = ../lib/libwimaxll.la \
- $(am__DEPENDENCIES_1)
-wimaxll_wait_for_state_change_SOURCES = \
- wimaxll-wait-for-state-change.c
-wimaxll_wait_for_state_change_OBJECTS = \
- wimaxll-wait-for-state-change.$(OBJEXT)
-wimaxll_wait_for_state_change_LDADD = $(LDADD)
-wimaxll_wait_for_state_change_DEPENDENCIES = ../lib/libwimaxll.la \
- $(am__DEPENDENCIES_1)
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
@@ -115,11 +97,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = wimaxll-pl-reset.c wimaxll-pl-rfkill.c wimaxll-pl-wfsc.c \
- wimaxll.c wimaxll-reset.c wimaxll-rfkill.c \
- wimaxll-wait-for-state-change.c
+ wimaxll.c
DIST_SOURCES = wimaxll-pl-reset.c wimaxll-pl-rfkill.c \
- wimaxll-pl-wfsc.c wimaxll.c wimaxll-reset.c wimaxll-rfkill.c \
- wimaxll-wait-for-state-change.c
+ wimaxll-pl-wfsc.c wimaxll.c
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -248,7 +228,12 @@ INCLUDES = \
$(I2400M_INCLUDES)
LDADD = ../lib/libwimaxll.la $(LIBNL1_LIBS)
-bin_SCRIPTS = wimax-tools-version
+bin_SCRIPTS = \
+ wimax-tools-version \
+ wimaxll-reset \
+ wimaxll-rfkill \
+ wimaxll-wait-for-state-change
+
AM_CFLAGS = @GLIB_CFLAGS@ -DPLUGINDIR=\""$(plugindir)"\"
AM_LDFLAGS = @GLIB_LIBS@ ../lib/libwimaxll.la $(LIBNL1_LIBS)
wimaxll_LDFLAGS = $(AM_LDFLAGS) -ldl -Wl,--export-dynamic -Wl,--version-script=wimaxll.ver
@@ -364,15 +349,6 @@ clean-binPROGRAMS:
wimaxll$(EXEEXT): $(wimaxll_OBJECTS) $(wimaxll_DEPENDENCIES)
@rm -f wimaxll$(EXEEXT)
$(wimaxll_LINK) $(wimaxll_OBJECTS) $(wimaxll_LDADD) $(LIBS)
-wimaxll-reset$(EXEEXT): $(wimaxll_reset_OBJECTS) $(wimaxll_reset_DEPENDENCIES)
- @rm -f wimaxll-reset$(EXEEXT)
- $(LINK) $(wimaxll_reset_OBJECTS) $(wimaxll_reset_LDADD) $(LIBS)
-wimaxll-rfkill$(EXEEXT): $(wimaxll_rfkill_OBJECTS) $(wimaxll_rfkill_DEPENDENCIES)
- @rm -f wimaxll-rfkill$(EXEEXT)
- $(LINK) $(wimaxll_rfkill_OBJECTS) $(wimaxll_rfkill_LDADD) $(LIBS)
-wimaxll-wait-for-state-change$(EXEEXT): $(wimaxll_wait_for_state_change_OBJECTS) $(wimaxll_wait_for_state_change_DEPENDENCIES)
- @rm -f wimaxll-wait-for-state-change$(EXEEXT)
- $(LINK) $(wimaxll_wait_for_state_change_OBJECTS) $(wimaxll_wait_for_state_change_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@@ -402,9 +378,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wimaxll-pl-reset.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wimaxll-pl-rfkill.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wimaxll-pl-wfsc.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wimaxll-reset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wimaxll-rfkill.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wimaxll-wait-for-state-change.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wimaxll.Po@am__quote@
.c.o:
diff --git a/bin/wimaxll-reset b/bin/wimaxll-reset
new file mode 100755
index 0000000..9b9ec0a
--- /dev/null
+++ b/bin/wimaxll-reset
@@ -0,0 +1,4 @@
+#! /bin/sh
+dev=$1
+echo "INFO: this program is deprecated, use 'wimaxll -i DEVICE reset'"
+wimaxll -i "$dev" reset
diff --git a/bin/wimaxll-reset.c b/bin/wimaxll-reset.c
deleted file mode 100644
index 671222a..0000000
--- a/bin/wimaxll-reset.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Linux WiMax
- * Execute the reset function
- *
- *
- * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
- * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Intel Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *
- * FIXME: docs
- */
-#define _GNU_SOURCE
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <wimaxll.h>
-
-int main(int argc, char **argv)
-{
- int result;
- struct wimaxll_handle *wmx;
- char *dev_name;
-
- if (argc < 2) {
- fprintf(stderr, "E: need an argument "
- "(device interface name)\n");
- return 1;
- }
-
- dev_name = argv[1];
- wmx = wimaxll_open(dev_name);
- if (wmx == NULL) {
- fprintf(stderr, "E: open of interface %s failed: %m\n",
- dev_name);
- result = -errno;
- goto error_wimaxll_open;
- }
-
- result = wimaxll_reset(wmx);
- if (result < 0) {
- fprintf(stderr, "E: wimaxll_reset(): %d\n", result);
- goto error_rfkill;
- }
-error_rfkill:
- wimaxll_close(wmx);
-error_wimaxll_open:
- return result;
-}
-
diff --git a/bin/wimaxll-rfkill b/bin/wimaxll-rfkill
new file mode 100755
index 0000000..3a60e48
--- /dev/null
+++ b/bin/wimaxll-rfkill
@@ -0,0 +1,5 @@
+#! /bin/sh
+dev=$1
+arg=$2
+echo "INFO: this program is deprecated, use 'wimaxll -i DEVICE rfkill [ARG]'"
+wimaxll -i "$dev" rfkill "$arg"
diff --git a/bin/wimaxll-rfkill.c b/bin/wimaxll-rfkill.c
deleted file mode 100644
index cf59bca..0000000
--- a/bin/wimaxll-rfkill.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Linux WiMax
- * Execute rfkill commands
- *
- *
- * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
- * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Intel Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *
- * FIXME: docs
- */
-#define _GNU_SOURCE
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <wimaxll.h>
-
-static
-char *status_to_str(int status)
-{
- int bytes = 0;
- static char str[64];
-
- if ((status & 0x1) == WIMAX_RF_OFF)
- bytes += snprintf(str + bytes, sizeof(str),
- "HW off");
- else
- bytes += snprintf(str + bytes, sizeof(str),
- "HW on");
- if ((status & 0x2) >> 1 == WIMAX_RF_OFF)
- bytes += snprintf(str + bytes, sizeof(str),
- " SW off");
- else
- bytes += snprintf(str + bytes, sizeof(str),
- " SW on");
- return str;
-}
-
-int main(int argc, char **argv)
-{
- int result;
- struct wimaxll_handle *wmx;
- char *dev_name, *op_name;
- enum wimax_rf_state op;
-
- if (argc < 3) {
- fprintf(stderr, "E: need an argument "
- "(device interface name) and new status "
- "{on,off,query}\n");
- return 1;
- }
-
- dev_name = argv[1];
- op_name = argv[2];
-
- wmx = wimaxll_open(dev_name);
- if (wmx == NULL) {
- fprintf(stderr, "E: libwimax: open of interface %s "
- "failed: %m\n", dev_name);
- result = -errno;
- goto error_wimaxll_open;
- }
-
- result = -EINVAL;
- if (!strcasecmp("on", op_name))
- op = WIMAX_RF_ON;
- else if (!strcasecmp("off", op_name))
- op = WIMAX_RF_OFF;
- else if (!strcasecmp("query", op_name))
- op = WIMAX_RF_QUERY;
- else {
- fprintf(stderr, "E: unknown rfkill op %s\n", op_name);
- goto error_bad_op;
- }
-
- result = wimaxll_rfkill(wmx, op);
- if (result < 0) {
- fprintf(stderr, "E: wimaxll_rfkill(%s): %d\n", op_name, result);
- goto error_rfkill;
- }
- fprintf(stderr, "I: rfkill status is 0x%x (%s)\n", result,
- status_to_str(result));
- if (op != WIMAX_RF_QUERY && (result & 0x2) >> 1 != op) {
- fprintf(stderr, "E: rfkill failed to turn device %s\n",
- op_name);
- goto error_check;
- }
- result = 0;
-error_check:
-error_rfkill:
-error_bad_op:
- wimaxll_close(wmx);
-error_wimaxll_open:
- return result;
-}
-
diff --git a/bin/wimaxll-wait-for-state-change b/bin/wimaxll-wait-for-state-change
new file mode 100755
index 0000000..fff3ede
--- /dev/null
+++ b/bin/wimaxll-wait-for-state-change
@@ -0,0 +1,4 @@
+#! /bin/sh
+dev=$1
+echo "INFO: this program is deprecated, use 'wimaxll -i DEVICE wait-for-state-change'"
+wimaxll -i "$dev" wait-for-state-change
diff --git a/bin/wimaxll-wait-for-state-change.c b/bin/wimaxll-wait-for-state-change.c
deleted file mode 100644
index 2cabb82..0000000
--- a/bin/wimaxll-wait-for-state-change.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Linux WiMax
- * Execute rfkill commands
- *
- *
- * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
- * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Intel Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *
- * FIXME: docs
- */
-#define _GNU_SOURCE
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <wimaxll.h>
-
-
-int main(int argc, char **argv)
-{
- int result;
- struct wimaxll_handle *wmx;
- char *dev_name;
- enum wimax_st old, new;
-
- if (argc < 2) {
- fprintf(stderr, "E: need an argument "
- "(device interface name)\n");
- return 1;
- }
-
- dev_name = argv[1];
-
- wmx = wimaxll_open(dev_name);
- if (wmx == NULL) {
- fprintf(stderr, "E: libwimax: open of interface %s "
- "failed: %m\n", dev_name);
- result = -errno;
- goto error_wimaxll_open;
- }
-
- result = wimaxll_wait_for_state_change(wmx, &old, &new);
- if (result < 0) {
- fprintf(stderr, "E: wimaxll_wait_for_state_change: %d\n",
- result);
- goto error_op;
- }
- fprintf(stderr, "I: old state %u, new state %u\n", old, new);
- result = 0;
-error_op:
- wimaxll_close(wmx);
-error_wimaxll_open:
- return result;
-}
-