Update to xfce4-wavelan 0.5.5.

As i took over upstream maintenance and merged our patches, let's remove them..
Tested on bwi/macppc and ral/i386.
This commit is contained in:
landry 2009-04-09 20:30:16 +00:00
parent 4f08976e0e
commit 16a02f3002
5 changed files with 30 additions and 143 deletions

View File

@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.15 2008/07/10 11:38:03 landry Exp $
# $OpenBSD: Makefile,v 1.16 2009/04/09 20:30:16 landry Exp $
COMMENT= displays stats from a WLAN interface
XFCE_VERSION= 0.5.4
XFCE_VERSION= 0.5.5
XFCE_PLUGIN= wavelan
PKGNAME= ${DISTNAME:S/-plugin//}p0
# BSD
PERMIT_DISTFILES_CDROM= Yes
@ -13,11 +12,10 @@ PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
MODULES= x11/xfce4
EXTRACT_SUFX= .tar.gz
WANTLIB= ICE SM X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext \
Xfixes Xi Xinerama Xrandr Xrender atk-1.0 c cairo expat \
fontconfig freetype gdk-x11-2.0 gdk_pixbuf-2.0 glib-2.0 \
fontconfig freetype gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 glib-2.0 \
glitz gmodule-2.0 gobject-2.0 gtk-x11-2.0 m pango-1.0 \
pangocairo-1.0 pangoft2-1.0 pcre pixman-1 png startup-notification-1 \
xfce4util xfcegui4 z

View File

@ -1,5 +1,5 @@
MD5 (xfce4/xfce4-wavelan-plugin-0.5.4.tar.gz) = sTmT+streiXKgayM3pqRAA==
RMD160 (xfce4/xfce4-wavelan-plugin-0.5.4.tar.gz) = MNSJOBIATP4M8RV5Drctr5K0218=
SHA1 (xfce4/xfce4-wavelan-plugin-0.5.4.tar.gz) = 1F2KE6FRL9t0qs8JxbaumcR0P90=
SHA256 (xfce4/xfce4-wavelan-plugin-0.5.4.tar.gz) = W4xeo3VhzDLxCzrrrGfPFPySFrdI4ZTzZ28m1CpPHAU=
SIZE (xfce4/xfce4-wavelan-plugin-0.5.4.tar.gz) = 596378
MD5 (xfce4/xfce4-wavelan-plugin-0.5.5.tar.bz2) = H6AK2fJMwpU2y3YiAWxqXg==
RMD160 (xfce4/xfce4-wavelan-plugin-0.5.5.tar.bz2) = j1B6UdQJnav9BV0oTtGITUC8etg=
SHA1 (xfce4/xfce4-wavelan-plugin-0.5.5.tar.bz2) = 7Xb2MezRVP76ysKI0ef2r6ito8E=
SHA256 (xfce4/xfce4-wavelan-plugin-0.5.5.tar.bz2) = Y0tuv/WwK4Q2RtQFbuZBkfMWvUXFT+JvVe0BVOIU4MA=
SIZE (xfce4/xfce4-wavelan-plugin-0.5.5.tar.bz2) = 260828

View File

@ -1,15 +0,0 @@
$OpenBSD: patch-panel-plugin_wavelan_c,v 1.1 2008/07/10 09:45:42 landry Exp $
--- panel-plugin/wavelan.c.orig Wed Jan 10 21:23:05 2007
+++ panel-plugin/wavelan.c Tue Jul 8 16:20:59 2008
@@ -219,9 +219,9 @@ wavelan_timer(gpointer data)
wavelan_set_state(wavelan, STATE_LINK0);
if (strlen(stats.ws_netname) > 0)
- tip = g_strdup_printf("%d%% (%s)", stats.ws_quality, stats.ws_netname);
+ tip = g_strdup_printf("%s: %ddB at %ddBm", stats.ws_netname, stats.ws_quality, stats.ws_rate);
else
- tip = g_strdup_printf("%d%%", stats.ws_quality);
+ tip = g_strdup_printf("%ddB at %ddBm", stats.ws_quality, stats.ws_rate);
}
}
else {

View File

@ -1,117 +0,0 @@
$OpenBSD: patch-panel-plugin_wi_bsd_c,v 1.2 2008/07/10 09:45:42 landry Exp $
--- panel-plugin/wi_bsd.c.orig Thu Dec 21 22:33:39 2006
+++ panel-plugin/wi_bsd.c Tue Jul 8 16:17:16 2008
@@ -56,9 +56,9 @@
#endif
#endif
#ifdef __OpenBSD__
-#include <net/if_ieee80211.h>
#include <dev/ic/if_wi_ieee.h>
-#define le16toh(x) letoh16(x)
+#include <net80211/ieee80211.h>
+#include <net80211/ieee80211_ioctl.h>
#endif
#endif
@@ -95,8 +95,10 @@ struct wi_device
};
static int _wi_carrier(const struct wi_device *);
+#if defined(__NetBSD__) || defined(__FreeBSD__)
static int _wi_getval(const struct wi_device *, struct wi_req *);
static int _wi_vendor(const struct wi_device *, char *, size_t);
+#endif
static int _wi_netname(const struct wi_device *, char *, size_t);
static int _wi_quality(const struct wi_device *, int *);
static int _wi_rate(const struct wi_device *, int *);
@@ -141,8 +143,10 @@ wi_query(struct wi_device *device, struct wi_stats *st
bzero((void *)stats, sizeof(*stats));
/* check vendor (independent of carrier state) */
+#if !defined(__OpenBSD__)
if ((result = _wi_vendor(device, stats->ws_vendor, WI_MAXSTRLEN)) != WI_OK)
return(result);
+#endif
/* check carrier */
if ((result = _wi_carrier(device)) != WI_OK)
@@ -193,7 +197,71 @@ _wi_carrier(const struct wi_device *device)
return((ifmr.ifm_status & IFM_ACTIVE) != 0 ? WI_OK : WI_NOCARRIER);
}
+/* OpenBSD uses net80211 API */
+#if defined(__OpenBSD__)
static int
+_wi_netname(const struct wi_device *device, char *buffer, size_t len)
+{
+ int result;
+ struct ifreq ifr;
+ struct ieee80211_nwid nwid;
+
+ bzero((void *) &ifr, sizeof(ifr));
+ ifr.ifr_data = (caddr_t) & nwid;
+ strlcpy(ifr.ifr_name, device->interface, sizeof(ifr.ifr_name));
+ if ((result = ioctl(device->socket, SIOCG80211NWID, (caddr_t) & ifr)) != WI_OK)
+ return (result);
+
+ strlcpy(buffer, (char *) nwid.i_nwid, MIN(len, strlen(nwid.i_nwid) + 1));
+
+ return(WI_OK);
+}
+
+static int
+_wi_quality(const struct wi_device *device, int *quality)
+{
+ int result;
+ struct ieee80211_nodereq nr;
+ struct ieee80211_bssid bssid;
+
+ bzero((void *) &bssid, sizeof(bssid));
+ bzero((void *) &nr, sizeof(nr));
+
+ /* get i_bssid from interface */
+ strlcpy(bssid.i_name, device->interface, sizeof(bssid.i_name));
+ if((result = ioctl(device->socket, SIOCG80211BSSID, (caddr_t) &bssid)) != WI_OK)
+ return (result);
+
+ /* put i_bssid into nr_macaddr to get nr_rssi */
+ bcopy(bssid.i_bssid, &nr.nr_macaddr, sizeof(nr.nr_macaddr));
+ strlcpy(nr.nr_ifname, device->interface, sizeof(nr.nr_ifname));
+ if ((result = ioctl(device->socket, SIOCG80211NODE, (caddr_t) & nr)) != WI_OK)
+ return (result);
+
+ *quality = nr.nr_rssi;
+ return(WI_OK);
+}
+
+static int
+_wi_rate(const struct wi_device *device, int *rate)
+{
+ int result;
+ struct ieee80211_txpower txpower;
+
+ bzero((void *) &txpower, sizeof(txpower));
+ strlcpy(txpower.i_name, device->interface, sizeof(txpower.i_name));
+ if ((result = ioctl(device->socket, SIOCG80211TXPOWER, (caddr_t) & txpower)) != WI_OK)
+
+ return (result);
+
+ *rate = txpower.i_val;
+ return(WI_OK);
+}
+#endif
+
+/* NetBSD and FreeBSD use old wi_* API */
+#if defined(__NetBSD__) || defined(__FreeBSD__)
+static int
_wi_getval(const struct wi_device *device, struct wi_req *wr)
{
struct ifreq ifr;
@@ -311,5 +379,5 @@ _wi_rate(const struct wi_device *device, int *rate)
return(WI_OK);
}
-#endif /* !defined(__NetBSD__) && !defined(__FreeBSD__) */
-
+#endif /* defined(__NetBSD__) || defined(__FreeBSD__) */
+#endif

View File

@ -1,16 +1,37 @@
@comment $OpenBSD: PLIST,v 1.3 2008/07/10 09:45:42 landry Exp $
@comment $OpenBSD: PLIST,v 1.4 2009/04/09 20:30:16 landry Exp $
@conflict xfce4-wavelan-plugin-*
libexec/xfce4/
libexec/xfce4/panel-plugins/
@bin libexec/xfce4/panel-plugins/xfce4-wavelan-plugin
share/locale/ar/
share/locale/ar/LC_MESSAGES/
share/locale/ar/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/cs/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/da/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/de/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/en_GB/
share/locale/en_GB/LC_MESSAGES/
share/locale/en_GB/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/es/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/eu/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/fr/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/gl/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/hu/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/id/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/it/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/ja/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/ko/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/lv/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/nb/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/pl/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/pt/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/pt_BR/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/sv/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/tr/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/uk/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/ur/
share/locale/ur/LC_MESSAGES/
share/locale/ur/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/locale/vi/LC_MESSAGES/xfce4-wavelan-plugin.mo
share/xfce4/
share/xfce4/panel-plugins/