diff options
author | fjoe <fjoe@FreeBSD.org> | 2004-03-16 22:29:26 +0000 |
---|---|---|
committer | fjoe <fjoe@FreeBSD.org> | 2004-03-16 22:29:26 +0000 |
commit | 7d2d6deecf36ab78dace21a1160668a957723bb8 (patch) | |
tree | cd23432ac3c0466312aa1487bc5aefb6a3867b4c /usr.sbin/arlcontrol | |
parent | 8a75d9d9aa221d8d196e66e8c64407e595f15722 (diff) | |
download | FreeBSD-src-7d2d6deecf36ab78dace21a1160668a957723bb8.zip FreeBSD-src-7d2d6deecf36ab78dace21a1160668a957723bb8.tar.gz |
Implement "arlconfig arlX quality".
Man pages fixes.
Submitted by: Stanislav A. Svirid <count@riss-telecom.ru>
Diffstat (limited to 'usr.sbin/arlcontrol')
-rw-r--r-- | usr.sbin/arlcontrol/arlcontrol.8 | 48 | ||||
-rw-r--r-- | usr.sbin/arlcontrol/arlcontrol.c | 156 |
2 files changed, 61 insertions, 143 deletions
diff --git a/usr.sbin/arlcontrol/arlcontrol.8 b/usr.sbin/arlcontrol/arlcontrol.8 index 09b9771..7858b12 100644 --- a/usr.sbin/arlcontrol/arlcontrol.8 +++ b/usr.sbin/arlcontrol/arlcontrol.8 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 25, 2003 +.Dd March 15, 2004 .Dt ARLCONFIG 8 i386 .Os .Sh NAME @@ -38,6 +38,8 @@ .Nd configure Aironet Arlan 655 device .Sh SYNOPSIS .Nm +.Ar iface +.Nm .Ar iface Cm name Ar name .Nm .Ar iface Cm sid Ar SID @@ -60,7 +62,7 @@ .Nm .Ar iface Cm stat .Nm -.Ar iface Cm quality Ar seconds [ Cm count Ar <count> ] +.Ar iface Cm quality .Sh DESCRIPTION The .Nm @@ -91,7 +93,11 @@ etc.) and must be specified. .Sh OPTIONS The options are as follows: .Bl -tag -width indent -.It Cm name Ar name +.It Ar iface +Display current settings of specified wireless interface. +This retrieves current card settings from the driver and prints +them out. +.It Ar iface Cm name Ar name Set .Ar Device Name . This @@ -104,7 +110,7 @@ If you choose to assign a name, while operating in .Ar TMA mode, the name will appear in the Arlan Access Point's Registration Table. Duplicate names are allowed. -.It Cm sid Ar SID +.It Ar iface Cm sid Ar SID Set .Ar System Identifier. The System Identifier @@ -127,7 +133,7 @@ SID is Since nodes will only receive packets from other nodes with a matching SID, you must make sure that the Arlan 655 Client Card is set the same SID as other nodes on your network. -.It Cm mode Ar mode ( Cm 640 | 655 ) +.It Ar iface Cm mode Ar mode ( Cm 640 | 655 ) Use .Ar operating mode parameter to specify whether you are operating in @@ -146,9 +152,9 @@ mode. .It PSP Ta Power save mode .El .!!! -.It Cm country Ar country ( Cm 9-15 ) -.It Cm channel Ar channel -.It Cm freq Ar freq ( Cm 2412, 2427, 2442, 2457, 2465 ) +.It Ar iface Cm country Ar country ( Cm 9-15 ) +.It Ar iface Cm channel Ar channel +.It Ar iface Cm freq Ar freq ( Cm 2412, 2427, 2442, 2457, 2465 ) Chose .Ar country , channel , freq parameters that depend on the @@ -170,8 +176,8 @@ according to the following table: .It "U.K. " Ta 15 Ta "2460" .It "Spain " Ta 15 Ta "2460" .El -.It Cm bitrate Ar bitrate ( Cm 0-4) -.It Cm spread Ar spread Cm ( 354, 500, 1000, 2000 ) +.It Ar iface Cm bitrate Ar bitrate ( Cm 0-4) +.It Ar iface Cm spread Ar spread Cm ( 354, 500, 1000, 2000 ) Set device operating bitrate or spread. .Bl -column ".Em Rate" ".Em Spread" ".Em kb/s" -offset indent indent .Em "Rate Spread kb/s" @@ -181,7 +187,7 @@ Set device operating bitrate or spread. .It 3 Ta 1000 Ta 1000 .It 4 Ta 2000 Ta 2000 .El -.It Cm priority Ar priority ( Cm normal, high, highest ) +.It Ar iface Cm priority Ar priority ( Cm normal, high, highest ) Use the .Ar priority parameter to set the priority of the Atlan 655 Radio Media Access Control @@ -196,21 +202,19 @@ to transmit at the same time. The percentage of units on your network that you set to other than .Dq normal should be kept small - 10 percent or less. -.It Cm stat +.It Ar iface Cm stat Print internal Arlan 655 statistics block. -.It Cm quality Ar seconds [ Cm count Ar <count> ] -Perform link quality test during -.Ar seconds -transmitting -.Ar count -packets. -Currently is broken. +.It Ar iface Cm quality +Display the cached signal level and quality mantained by the +.Xr arl 4 +driver . The driver retains information about quality and level for packets received from different hosts. Also driver extract values from ACK packets. .El .Sh EXAMPLES .Bd -literal -offset indent -alrlconfig arl0 name NODE1 sid 4 freq 2442 -arlconfig arl0 quality 10 seconds -arlconfig arl0 status +arlconfig arl0 name NODE1 sid 4 freq 2442 +arlconfig arl0 quality +arlconfig arl0 stat +arlconfig arl0 .Pp You can configure Arlan 655 card from /etc/start_if.arl0. For example: .Pp diff --git a/usr.sbin/arlcontrol/arlcontrol.c b/usr.sbin/arlcontrol/arlcontrol.c index 4ab5ca9..9055ddaa 100644 --- a/usr.sbin/arlcontrol/arlcontrol.c +++ b/usr.sbin/arlcontrol/arlcontrol.c @@ -1,5 +1,5 @@ /* - * $RISS: if_arl/arlconfig/arlconfig.c,v 1.3 2003/01/13 07:23:25 count Exp $ + * $RISS: if_arl/arlconfig/arlconfig.c,v 1.5 2004/03/16 05:00:21 count Exp $ */ #include <sys/cdefs.h> @@ -205,9 +205,10 @@ usage() #endif fprintf(stderr, "or: %s <ifname> stat\n", progname); fprintf(stderr, "\tprint internal arlan statistics block\n"); - fprintf(stderr, "or: %s <ifname> quality <seconds> [count <count>]\n", - progname); - fprintf(stderr, "\tprint receive packet level and quality with interval\n"); +#ifdef ARLCACHE + fprintf(stderr,"or: %s <ifname> quality\n", progname); + fprintf(stderr,"\tprint receive packet level and quality\n"); +#endif exit(0); } @@ -307,105 +308,31 @@ print_stb( struct arl_stats stb ) stb.numNACKReceived); } -#ifdef ARL_QUALITY +#ifdef ARLCACHE void -print_qlt(struct arl_quality qlt, int count) +print_qlt(struct arl_sigcache *qlt) { - int i, s; - int v, v1; - time_t t; - int minLevel, maxLevel, avgLevel; - int minQuality, maxQuality, avgQuality; - - t = time(NULL); - localtime(&t); - printf("#%d Current date-time: %s", count, ctime(&t)); - printf(" %-39s %s\n","Receive Level","Receive Quality"); - printf( -" pkts 0.......10 11............100 > pkts 0.......10 11............100 >\n"\ -" -----+----------+-----------------+--- -----+----------+-----------------+---\n"); - - minLevel = 16; - maxLevel = 0; - avgLevel = 0; - minQuality = 16; - maxQuality = 0; - avgQuality = 0; - - for (i = 0, s = 0; i < ARLAN_MAX_QUALITY; i++) { - v = qlt.rxLevel[i]; - if (v) { - if (i < minLevel) - minLevel = i; - if (i > maxLevel) - maxLevel = i; - avgLevel += v*i; - printf(" %-4d %x", v, i); - } else - printf(" o %x", i); - s += v; - if (v < 10) - ; - else if (v < 100) - v = 10 + ((v-10) * 20) / 90; - else if (v < 1000) - v = 31; - else - v = 32; - v1 = v; - while (v) { - printf("*"); - v--; - } - - v = 33 - v1; - while (v) { - printf(" "); - v--; - } - - v = qlt.rxQuality[i]; - if (v) { - if (i < minQuality) - minQuality = i; - if (i > maxQuality) - maxQuality = i; - avgQuality += v*i; - printf("%-4d %x", v, i); - } else - printf("o %x", i); - - if (v < 10) - ; - else if (v < 100) - v = 10 + ((v-10) * 20) / 90; - else if (v < 1000) - v = 31; - else - v = 32; - } - v1 = v; - while (v) { - printf("*"); - v--; - } - + int i; + u_int8_t zero[6] = {0, 0, 0, 0, 0, 0}; + + for (i = 0; i < MAXARLCACHE && bcmp(qlt->macsrc, zero, 6); i++) { + printf("[%d]:", i+1); + printf(" %02x:%02x:%02x:%02x:%02x:%02x,", + qlt->macsrc[0]&0xff, + qlt->macsrc[1]&0xff, + qlt->macsrc[2]&0xff, + qlt->macsrc[3]&0xff, + qlt->macsrc[4]&0xff, + qlt->macsrc[5]&0xff); + printf(" rx lvl/qlty: %d/%d,", qlt->level[ARLCACHE_RX], + qlt->quality[ARLCACHE_RX]); + printf(" tx lvl/qlty: %d/%d", qlt->level[ARLCACHE_TX], + qlt->quality[ARLCACHE_TX]); printf("\n"); + qlt++; } - printf(" -----+----------+-----------------+--- -----+----------+-----------------+---\n"); - if (minLevel > 15) - minLevel = 0; - if (minQuality > 15) - minQuality = 0; - printf("\tPackets count %-6d\n", s); - if (!s) - s++; - printf("\tLevel min %d/avg %d/max %d\n", - minLevel, avgLevel/s, maxLevel); - printf("\tQuality min %d/avg %d/max %d\n", - minQuality, avgQuality/s, maxQuality); } -#endif /* ARL_QUALITY */ +#endif int main(int argc, char *argv[]) @@ -414,11 +341,10 @@ main(int argc, char *argv[]) struct arl_req arl_io; struct ether_addr *ea; struct arl_stats stb; - /*static arl_quality qlt;*/ + struct arl_sigcache qlt[MAXARLCACHE]; int sd, argind, val = -1; long val2; char *param, *value, *value2; - /*int end_count, i;*/ if (argc < 2) usage(); @@ -448,30 +374,18 @@ main(int argc, char *argv[]) print_stb(stb); exit(0); } -#ifdef ARL_QUALITY - if (!strcasecmp(argv[2],"quality") && argc > 3) { - val = atoi(argv[3]); - if (val < 0 || val >= 3601) - err(1,"Bad time range"); - end_count = 0; - if (argc > 5 && !strcasecmp(argv[4], "count")) - end_count = atoi(argv[5]); +#ifdef ARLCACHE + if (!strcasecmp( argv[2],"quality")) { printf("\n"); - i = 0; - while (i < end_count || !end_count) { /* loop */ - if (i++) - sleep(val); - strncpy(ifr.ifr_name, - argv[1], sizeof(ifr.ifr_name)); - ifr.ifr_addr.sa_family = AF_INET; - ifr.ifr_data = (caddr_t)&qlt; - if (ioctl(sd, SIOCGARLQLT, (caddr_t)&ifr)) - err(1,"Get QLT"); - print_qlt(qlt, i); - } + strncpy(ifr.ifr_name, argv[1], sizeof(ifr.ifr_name)); + ifr.ifr_addr.sa_family = AF_INET; + ifr.ifr_data = (caddr_t)qlt; + if (ioctl(sd, SIOCGARLQLT, (caddr_t)&ifr)) + err(1,"Get QLT"); + print_qlt(qlt); exit(0); } -#endif /* ARL_QUALITY */ +#endif } arl_io.what_set = 0; |