Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ipwctl ipwctl(8) - configure Intel(R) PRO/Wireless ...



details:   https://anonhg.NetBSD.org/src/rev/6d1167463bbc
branches:  trunk
changeset: 569526:6d1167463bbc
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Aug 23 11:45:37 2004 +0000

description:
ipwctl(8) - configure Intel(R) PRO/Wireless 2100 (ipw(4)) network adapter
Written by Damien Bergamini, from http://damien.bergamini.free.fr/ipw/

diffstat:

 usr.sbin/ipwctl/Makefile |    9 +
 usr.sbin/ipwctl/ipw.4    |   90 +++++++++
 usr.sbin/ipwctl/ipwctl.8 |   81 ++++++++
 usr.sbin/ipwctl/ipwctl.c |  428 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 608 insertions(+), 0 deletions(-)

diffs (truncated from 624 to 300 lines):

diff -r 6e2f986eecd5 -r 6d1167463bbc usr.sbin/ipwctl/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/ipwctl/Makefile  Mon Aug 23 11:45:37 2004 +0000
@@ -0,0 +1,9 @@
+# Id: Makefile,v 1.1.2.2 2004/08/19 16:29:47 damien Exp 
+
+PROG   = ipwctl
+SRCS   = ipwctl.c
+MAN    = ipw.4 ipwctl.8
+
+BINDIR = /usr/sbin
+
+.include <bsd.prog.mk>
diff -r 6e2f986eecd5 -r 6d1167463bbc usr.sbin/ipwctl/ipw.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/ipwctl/ipw.4     Mon Aug 23 11:45:37 2004 +0000
@@ -0,0 +1,90 @@
+.\" Id: ipw.4,v 1.1.2.2 2004/08/19 16:25:41 damien Exp 
+.\"
+.\" Copyright (c) 2004
+.\"    Damien Bergamini <damien.bergamini%free.fr@localhost>. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice unmodified, this list of conditions, and the following
+.\"    disclaimer.
+.\" 2. 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.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+.\"
+.Dd July 31, 2004
+.Os
+.Dt IPW 4
+.Sh NAME
+.Nm ipw
+.Nd Intel(R) PRO/Wireless 2100 IEEE 802.11 driver
+.Sh SYNOPSIS
+.Cd "ipw* at pci? dev ? function ?"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the Intel(R) PRO/Wireless 2100 MiniPCI network 
+adapter.
+.Pp
+By default, the
+.Nm
+driver configures the adapter for BSS operation (aka infrastructure mode).
+This mode requires the use of an access point.
+.Pp
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh EXAMPLES
+Join an existing BSS network (ie: connect to an access point):
+.Pp
+.Dl "ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00"
+.Pp
+Join a specific BSS network with network name
+.Dq Li my_net :
+.Pp
+.Dl "ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net"
+.Pp
+Join a specific BSS network with 64 bits WEP encryption:
+.Bd -literal -offset indent
+ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net \e
+        nwkey 0x1234567890
+.Ed
+.Pp
+Join a specific BSS network with 128bits WEP encryption:
+.Bd -literal -offset indent
+ifconfig ipw0 inet 192.168.0.20 netmask 0xffffff00 nwid my_net \e
+        nwkey 0x01020304050607080910111213
+.Ed
+.Sh DIAGNOSTICS
+.Bl -diag
+.It "ipw%d: device timeout"
+The driver will reset the hardware. This should not happen.
+.El
+.Sh SEE ALSO
+.Xr an 4 ,
+.Xr awi 4 ,
+.Xr pci 4 ,
+.Xr wi 4 ,
+.Xr ifconfig 8 ,
+.Xr ipwctl 8
+.Rs
+.%T The IPW Web Page
+.%O http://damien.bergamini.free.fr/ipw/
+.Re
+.Sh AUTHORS
+The 
+.Nm
+driver and this man page were written by
+.An Damien Bergamini Aq damien.bergamini%free.fr@localhost .
diff -r 6e2f986eecd5 -r 6d1167463bbc usr.sbin/ipwctl/ipwctl.8
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/ipwctl/ipwctl.8  Mon Aug 23 11:45:37 2004 +0000
@@ -0,0 +1,81 @@
+.\" Id: ipwctl.8,v 1.1.2.1 2004/08/19 16:24:50 damien Exp 
+.\"
+.\" Copyright (c) 2004
+.\"    Damien Bergamini <damien.bergamini%free.fr@localhost>. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice unmodified, this list of conditions, and the following
+.\"    disclaimer.
+.\" 2. 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.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+.\"
+.Dd July 31, 2004
+.Os
+.Dt IPWCTL 8
+.Sh NAME
+.Nm ipwctl
+.Nd configure Intel(R) PRO/Wireless 2100 network adapter
+.Sh SYNOPSIS
+.Nm
+.Op Fl i 
+.Ar iface
+.Nm
+.Op Fl i 
+.Ar iface Fl f Ar firmware
+.Nm
+.Op Fl i
+.Ar iface Fl k 
+(kill firmware)
+.Nm
+.Op Fl i 
+.Ar iface Fl r
+(display radio transmitter state)
+.Sh DESCRIPTION
+The
+.Nm
+utility controls the operation of Intel(R) PRO/Wireless 2100 networking
+devices via
+.Xr ipw 4
+driver.
+.Pp
+You should not use this program to configure IEEE 802.11 parameters. Use 
+.Xr ifconfig 8
+instead.
+.Sh OPTIONS
+The options are as follows:
+.Bl -tag -width indent
+.It Fl i Ar iface
+Displays adapter's internal statistics.
+.It Fl i Ar iface Fl f Ar firmware
+Download firmware binary image
+.Ar firmware
+to the driver.
+.It Fl i Ar iface Fl k
+Kill the firmware and reset the adapter.
+.It Fl i Ar iface Fl r
+Displays the radio switch state (on or off).
+.El
+.Sh SEE ALSO
+.Xr ipw 4 ,
+.Xr ifconfig 8
+.Sh AUTHORS
+The 
+.Nm
+utility and this man page were written by
+.An Damien Bergamini Aq damien.bergamini%free.fr@localhost .
diff -r 6e2f986eecd5 -r 6d1167463bbc usr.sbin/ipwctl/ipwctl.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.sbin/ipwctl/ipwctl.c  Mon Aug 23 11:45:37 2004 +0000
@@ -0,0 +1,428 @@
+/*     Id: ipwctl.c,v 1.1.2.1 2004/08/19 16:24:50 damien Exp   */
+
+/*-
+ * Copyright (c) 2004
+ *     Damien Bergamini <damien.bergamini%free.fr@localhost>. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+ */
+
+#include <sys/cdefs.h>
+#if defined(__RCSID)
+__RCSID("$Id: ipwctl.c,v 1.1.1.1 2004/08/23 11:46:18 lukem Exp $");
+#else
+#ifndef lint
+static char rcsid[] = "Id: ipwctl.c,v 1.1.2.1 2004/08/19 16:24:50 damien Exp ";
+#endif /* not lint */
+#endif
+
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+
+#include <net/if.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+#define SIOCSLOADFW     _IOW('i', 137, struct ifreq)
+#define SIOCSKILLFW     _IOW('i', 138, struct ifreq)
+#define SIOCGRADIO     _IOWR('i', 139, struct ifreq)
+#define SIOCGTABLE1    _IOWR('i', 140, struct ifreq)
+
+extern char *optarg;
+extern int optind;
+extern int optopt;
+extern int opterr;
+extern int optreset;
+
+static void usage(void);
+static int do_req(char *, unsigned long, void *);
+static void load_firmware(char *, char *);
+static void kill_firmware(char *);
+static void get_radio_state(char *);
+static void get_statistics(char *);
+
+int
+main(int argc, char **argv)
+{
+       int ch;
+       char *iface;
+
+       opterr = 0;
+       ch = getopt(argc, argv, "i:");
+       if (ch == 'i') {
+               iface = optarg;
+       } else {
+               if (argc > 1 && argv[1][0] != '-') {
+                       iface = argv[1];
+                       optind = 2;
+               } else {
+                       iface = "ipw0";
+                       optind = 1;
+               }
+               optreset = 1;
+       }
+       opterr = 1;
+
+       while ((ch = getopt(argc, argv, "f:kr")) != -1) {
+               switch (ch) {
+               case 'f':
+                       load_firmware(iface, optarg);
+                       return EX_OK;
+
+               case 'k':
+                       kill_firmware(iface);
+                       return EX_OK;



Home | Main Index | Thread Index | Old Index