From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jul 15 12:10:17 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3B5337B401 for ; Tue, 15 Jul 2003 12:10:16 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E421C43FCB for ; Tue, 15 Jul 2003 12:10:15 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h6FJAFUp092632 for ; Tue, 15 Jul 2003 12:10:15 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h6FJAF3U092631; Tue, 15 Jul 2003 12:10:15 -0700 (PDT) Resent-Date: Tue, 15 Jul 2003 12:10:15 -0700 (PDT) Resent-Message-Id: <200307151910.h6FJAF3U092631@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Hendrik Scholz Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8A7F37B40A for ; Tue, 15 Jul 2003 12:03:07 -0700 (PDT) Received: from phobos.raisdorf.net (phobos.raisdorf.net [195.244.235.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00DBC43F3F for ; Tue, 15 Jul 2003 12:03:06 -0700 (PDT) (envelope-from hscholz@phobos.raisdorf.net) Received: by phobos.raisdorf.net (Postfix, from userid 66) id 1567023853; Tue, 15 Jul 2003 21:03:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by pandemonium.lan.raisdorf.net (Postfix) with ESMTP id BF65F698DB; Tue, 15 Jul 2003 20:52:36 +0200 (CEST) Received: from pandemonium.lan.raisdorf.net ([127.0.0.1])port 10024) with ESMTP id 75630-03; Tue, 15 Jul 2003 20:52:22 +0200 (CEST) Received: from goanna.lan.raisdorf.net (goanna.lan.raisdorf.net [10.10.1.2]) by pandemonium.lan.raisdorf.net (Postfix) with ESMTP id 3FC95697FF; Tue, 15 Jul 2003 20:52:22 +0200 (CEST) Received: from goanna.lan.raisdorf.net (localhost [127.0.0.1]) h6FIrPnO052277; Tue, 15 Jul 2003 20:53:25 +0200 (CEST) (envelope-from hscholz@goanna.lan.raisdorf.net) Received: (from hscholz@localhost) by goanna.lan.raisdorf.net (8.12.9/8.12.9/Submit) id h6FIr0kt052243; Tue, 15 Jul 2003 20:53:00 +0200 (CEST) Message-Id: <200307151853.h6FIr0kt052243@goanna.lan.raisdorf.net> Date: Tue, 15 Jul 2003 20:53:00 +0200 (CEST) From: Hendrik Scholz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: bms@spc.org Subject: ports/54511: patch: net/wmwave: more portable data gathering X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Hendrik Scholz List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 19:10:17 -0000 >Number: 54511 >Category: ports >Synopsis: patch: net/wmwave: more portable data gathering >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 15 12:10:14 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Hendrik Scholz >Release: FreeBSD 5.1-RELEASE i386 >Organization: >Environment: System: FreeBSD goanna.lan.raisdorf.net 5.1-RELEASE FreeBSD 5.1-RELEASE #4: Sat Jun 7 12:12:29 CEST 2003 hscholz@goanna.lan.raisdorf.net:/usr/src/sys/i386/compile/GOANNA i386 >Description: wmwave works on Prism cards but not on Lucent ones (minipci and PCMCIA tested) since wireq.wi_val is empty. I've patched it to use a more portable way for data acquisition known from gkrellm and other tools. I've tested this with my Lucent mini PCI card and a PCMCIA Prism card. Please DO TEST this before commiting. The attached file is a diff between the file after 'make patch' has been executed (and already patches by the port!). A complete diff against the distribution source can be found here: http://www.raisdorf.net/files/FreeBSD/wmwave-diff.patch diff against already patch file: http://www.raisdorf.net/files/FreeBSD/wmwave-patched-diff.patch Additionally I renamed the three values to more common names. >How-To-Repeat: Try to use wmwave with an Orinoco based card. >Fix: --- wmwave-patched-diff.patch begins here --- --- wmwave.c Tue Jul 15 20:39:20 2003 +++ /home/hscholz/note/wmwave.c Mon Jul 7 09:43:55 2003 @@ -1,11 +1,13 @@ /* * $Id$ * - * wmtop.c -- WindowMaker process view dock app + * wmwave.c -- WindowMaker IEEE802.11 status dock app + * based on wmtop.c from Dan Piponi * * This software is licensed through the GNU General Public License. * * Authors (in reverse chronological order): + * Hendrik Scholz * Bruce M. Simpson * Carsten Schuermann * Dan Piponi @@ -66,11 +68,11 @@ int wmwave_mask_height = 64; #define WMWAVE_DEFAULT_INTERFACE "wi0" -#define WMWAVE_VERSION "0.4_FreeBSD" +#define WMWAVE_VERSION "0.4_FreeBSD-2" int update_rate = 100000; char *ProgName; -char *iface = WMWAVE_DEFAULT_INTERFACE; +char *iface = WMWAVE_DEFAULT_INTERFACE; time_t curtime; time_t prevtime; int mode = 0; /* default: no card detected */ @@ -165,32 +167,27 @@ MODE_HAVE_CARD = 1 }; - s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (s == -1) - errx(errno, "socket"); - bzero(&ifr, sizeof(ifr)); - strncpy(ifr.ifr_name, iface, strlen(iface)); - bzero(&wireq, sizeof(wireq)); - wireq.wi_type = WI_RID_READ_CACHE; - wireq.wi_len = WI_MAX_DATALEN; - ifr.ifr_data = (void *) &wireq; + s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (s == -1) + errx(errno, "socket"); + bzero(&ifr, sizeof(ifr)); + strncpy(ifr.ifr_name, iface, strlen(iface)); + bzero(&wireq, sizeof(wireq)); + wireq.wi_type = WI_RID_COMMS_QUALITY; + wireq.wi_len = WI_MAX_DATALEN; + ifr.ifr_data = (void *) &wireq; - err = ioctl(s, SIOCGWAVELAN, (caddr_t)&ifr); - if (err < 0) { + err = ioctl(s, SIOCGWAVELAN, (caddr_t)&ifr); + if (err < 0) { mode = MODE_NO_CARD; goto draw; - } - wisigsnp = (int *) &wireq.wi_val; - if (*wisigsnp < 1) { - mode = MODE_NO_CARD; - goto draw; - } + } mode = MODE_HAVE_CARD; - wisigsp = (struct wi_sigcache *) (wisigsnp+1); - link = wisigsp->quality * 1.0; - level = wisigsp->signal * -1.0; - noise = wisigsp->noise * -1.0; + link = wireq.wi_val[0]; + level = wireq.wi_val[1]; + noise = wireq.wi_val[2]; + draw: /* * Print channel information, and signal ratio @@ -205,9 +202,9 @@ } else { DrawGreenDot(); }; - BlitString("Link ", 4, 18); + BlitString("Quality ", 4, 18); DrawBar(_fmin((int)(link * 1.8), 100.0), 4, 27); - BlitString("Level ", 4, 32); + BlitString("Signal ", 4, 32); DrawGreenBar(_fmin((int)(level * 0.3), 100.0), 4, 41); BlitString("Noise ", 4, 46); DrawGreenBar(_fmin((int)(noise * 0.3), 100.0), 4, 55); --- wmwave-patched-diff.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: