From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Feb 29 19:30:03 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56F1F1065671 for ; Fri, 29 Feb 2008 19:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 46A508FC12 for ; Fri, 29 Feb 2008 19:30:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1TJU3GG071088 for ; Fri, 29 Feb 2008 19:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1TJU3uF071079; Fri, 29 Feb 2008 19:30:03 GMT (envelope-from gnats) Date: Fri, 29 Feb 2008 19:30:03 GMT Message-Id: <200802291930.m1TJU3uF071079@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Ulrich Spoerlein Cc: Subject: Re: ports/121167: net/wmwifi - marked broken for wrong reason - its not because of gcc 4.2 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ulrich Spoerlein List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Feb 2008 19:30:03 -0000 The following reply was made to PR ports/121167; it has been noted by GNATS. From: Ulrich Spoerlein To: bug-followup@FreeBSD.org, dierk@blaxxtarz.de Cc: Subject: Re: ports/121167: net/wmwifi - marked broken for wrong reason - its not because of gcc 4.2 Date: Fri, 29 Feb 2008 20:19:26 +0100 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I know that the BROKEN line is in itself bogus and I already made a patch for wmwifi to address the issue on 7.x. I was waiting though, as I was wondering how many users actually use wmwifi, or if we should simply drop the port. Attached is a patch, which has been compile tested on 6.2 and run-tested on 7.0. Cheers, Ulrich Spoerlein --wac7ysb48OaltWcw Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="wmwifi.patch" ? working Index: Makefile =================================================================== RCS file: /home/ncvs/ports/net/wmwifi/Makefile,v retrieving revision 1.6 diff -u -p -r1.6 Makefile --- Makefile 1 Oct 2007 06:20:40 -0000 1.6 +++ Makefile 29 Feb 2008 19:15:00 -0000 @@ -23,10 +23,4 @@ CONFIGURE_ENV+= "CPPFLAGS=-I${X11BASE}/i PLIST_FILES= bin/wmwifi -.include - -.if ${OSVERSION} >= 700042 -BROKEN= Does not compile with GCC 4.2 -.endif - -.include +.include Index: files/patch-wireless.c =================================================================== RCS file: /home/ncvs/ports/net/wmwifi/files/patch-wireless.c,v retrieving revision 1.3 diff -u -p -r1.3 patch-wireless.c --- files/patch-wireless.c 16 Jun 2006 16:51:05 -0000 1.3 +++ files/patch-wireless.c 29 Feb 2008 19:15:00 -0000 @@ -1,6 +1,20 @@ ---- src/wireless.c.orig Tue Mar 9 20:39:17 2004 -+++ src/wireless.c Sun Jun 11 00:46:29 2006 -@@ -143,6 +143,7 @@ +--- src/wireless.c.orig 2004-03-09 20:39:17.000000000 +0100 ++++ src/wireless.c 2007-11-01 17:58:13.170763665 +0100 +@@ -25,7 +25,13 @@ + #include + #include + #include ++#include ++#if __FreeBSD_version > 700045 ++#include ++#include ++#else + #include ++#endif + #else + #error "sorry, your OS is not supported yet" + #endif +@@ -143,6 +149,7 @@ max = get_max_ifs(); step = 0; @@ -8,7 +22,7 @@ if (old > max) old = max; /* just be sure to not be out of bounds */ -@@ -178,8 +179,8 @@ +@@ -178,8 +185,8 @@ len = sizeof(ifmd); sysctl(name, 6, &ifmd, &len, NULL, 0); @@ -19,7 +33,7 @@ continue; s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); -@@ -193,9 +194,11 @@ +@@ -193,9 +200,11 @@ if (ioctl(s, SIOCGIFMEDIA, (caddr_t) &ifmr) < 0) { @@ -33,7 +47,7 @@ } close(s); /* we cannot monitor interfaces in hostap mode, so just -@@ -207,6 +210,10 @@ +@@ -207,6 +216,10 @@ found++; } } @@ -44,3 +58,71 @@ return index; } /* how many interfaces do we have? this includes non-wireless! */ +@@ -224,9 +237,18 @@ + struct ifmibdata ifmd; + + struct ifreq ifr; /* interface stats */ ++#if __FreeBSD_version > 700045 ++ uint8_t buf[24*1024]; ++ struct ieee80211req ireq; ++ const struct ieee80211req_scan_result *sr; ++#else + struct wi_req wireq; ++#endif + int s; + ++ wfi->link = 0; ++ wfi->max_qual = 128; ++ + /* lets find the current interface name */ + name[0] = CTL_NET; + name[1] = PF_LINK; +@@ -247,13 +269,38 @@ + perror("socket"); + exit(1); + } +- bzero(&ifr, sizeof(ifr)); + /* struct ifreq interface name can only be 16 Bytes long as of now */ + if (strlen(wfi->ifname) >= IFNAMSIZ) + { + fprintf(stderr, "ERROR: interface name too long\n"); + exit(1); + } ++#if __FreeBSD_version > 700045 ++ bzero(&ireq, sizeof(ireq)); ++ strncpy(ireq.i_name, wfi->ifname, sizeof(ireq.i_name)); ++ ++ ireq.i_type = IEEE80211_IOC_SCAN_RESULTS; ++ ireq.i_data = buf; ++ ireq.i_len = sizeof(buf); ++ if (ioctl(s, SIOCG80211, &ireq) < 0) { ++ perror("ioctl"); ++ exit(1); ++ } ++ close (s); ++ ++ if (ireq.i_len < sizeof(struct ieee80211req_scan_result)) { ++ return 1; ++ } ++ ++ sr = (const struct ieee80211req_scan_result *) buf; ++ ++ /* ++ * sr->isr_rssi Signal Strength ++ * sr->isr_noise Noise ++ */ ++ wfi->link = (int) sr->isr_rssi; ++#else ++ bzero(&ifr, sizeof(ifr)); + strncpy(ifr.ifr_name, wfi->ifname, strlen(wfi->ifname)); + wireq.wi_type = WI_RID_COMMS_QUALITY; + wireq.wi_len = WI_MAX_DATALEN; +@@ -272,7 +319,7 @@ + * wi_val[2] = noise + */ + wfi->link = (int) wireq.wi_val[1]; +- wfi->max_qual = 128; ++#endif + + return 1; + } --wac7ysb48OaltWcw--