wol for xl(4)

2011-03-31 Thread Stefan Sperling
This is an attempt to add wol support to xl(4). Unfortunately, while I have an xl(4) card to test with none of the motherboards I have will do WOL with it since they all lack an on-board WOL connector :( So test reports are needed. Please also check whether WOL is disabled by default. Index:

netinet6 bread crumbs

2011-04-02 Thread Stefan Sperling
Feel free to ack or reject these individually. Kill redundant offsetof definitions. All of these files include sys/param.h. Index: frag6.c === RCS file: /cvs/src/sys/netinet6/frag6.c,v retrieving revision 1.32 diff -u -p -r1.32

Re: fix display glitches with hexdump -C and tcpdump -X in UTF-8 locale

2011-04-03 Thread Stefan Sperling
On Sat, Mar 05, 2011 at 01:45:40AM +0100, Stefan Sperling wrote: There are some display glitches when the UTF-8 locale is used. So far I know about hexdump -C (reported by naddy) and tcpdump -X. Both print invalid UTF-8 to the screen. The problem is that latin1 characters end up being

add wcwidth man page

2011-04-03 Thread Stefan Sperling
Based on man page from FreeBSD with some tweaks: - use $OpenBSD$, $Mdocdate$ - removed trivial example code - removed quotes around .Nd arg I'd put in into lib/libc/locale along with the other locale-related man pages. ok? Index: wcwidth.3

Re: add wcwidth man page

2011-04-03 Thread Stefan Sperling
On Sun, Apr 03, 2011 at 04:31:50PM +0200, Stefan Sperling wrote: Based on man page from FreeBSD with some tweaks: - use $OpenBSD$, $Mdocdate$ - removed trivial example code - removed quotes around .Nd arg I'd put in into lib/libc/locale along with the other locale-related man pages

Re: add wcwidth man page

2011-04-03 Thread Stefan Sperling
On Sun, Apr 03, 2011 at 07:25:45PM +0100, Nicholas Marriott wrote: Do we normally have a LIBRARY section? mdoc(7) says no, good catch. .\ .Sh LIBRARY .\ For sections 2, 3, 9 only. .\ Not used in OpenBSD. Also $OpenBSD$ would be better at the start. Fixed.

wcswidth fix and man page

2011-04-03 Thread Stefan Sperling
Add a wcswidth man page (based on FreeBSD), and fix the implementation to return -1 in case of an unprintable character. Index: string/Makefile.inc === RCS file: /cvs/src/lib/libc/string/Makefile.inc,v retrieving revision 1.23 diff

wcwidth() fixes in libcurses

2011-04-03 Thread Stefan Sperling
The upcoming diff to make wcwidth() return -1 for non-printable characters might have funny effects for these callers in libcurses. Index: base/lib_addstr.c === RCS file: /cvs/src/lib/libcurses/base/lib_addstr.c,v retrieving revision

wcwidth() fixes in libedit

2011-04-03 Thread Stefan Sperling
These callers in libedit might get confused if wcwidth() returns -1. Note how the result ct_visual_width() is used in refresh.c: refresh.c: h += ct_visual_width(*cp); Index: chartype.c === RCS file:

wcwidth() fix in libform

2011-04-03 Thread Stefan Sperling
Some callers of myWCWIDTH(), a macro alias for cell_width(), won't cope with -1. Index: frm_driver.c === RCS file: /cvs/src/lib/libform/frm_driver.c,v retrieving revision 1.10 diff -u -p -r1.10 frm_driver.c --- frm_driver.c18

wcwidth() fix in file(1)

2011-04-03 Thread Stefan Sperling
Make the file_mbswidth() function cope if wcwidth() returns -1. Maybe this should just call wcswidth() but I'll leave that for another day. Index: file.c === RCS file: /cvs/src/usr.bin/file/file.c,v retrieving revision 1.22 diff -u

Re: wcwidth() fixes in libcurses

2011-04-04 Thread Stefan Sperling
On Sun, Apr 03, 2011 at 11:21:35PM +0100, Nicholas Marriott wrote: - if (x + len - 1 = win-_maxx) { + if (len = 0 x + len - 1 = win-_maxx) { Not sure this is required, astr is a cchar_t * which will come from setcchar. Right. That already makes sure the string cannot contain

Re: wcwidth() fix in libform

2011-04-04 Thread Stefan Sperling
it. Now that you've pointed it out I think it's pretty obvious that upstream is using their cchar_t to avoid such issues in the first place. So I don't think we'll need this diff either. On Sun, Apr 03, 2011 at 11:51:53PM +0200, Stefan Sperling wrote: Some callers of myWCWIDTH(), a macro alias

Re: wcwidth() fixes in libedit

2011-04-04 Thread Stefan Sperling
On Mon, Apr 04, 2011 at 06:44:10PM +, Miod Vallat wrote: Would it be better maybe to do the check in the Width() macro itself? Yes indeed. New diff below. -#define Width(c) wcwidth(c) +#define Width(c) (wcwidth(c) == -1 ? 0 : wcwidth(c)) But this calls wcwidth() to be

isprint() needs setlocale(); for usr.bin

2011-04-04 Thread Stefan Sperling
For isprint() to work correctly in a UTF-8 locale applications must set up the LC_CTYPE locale before using isprint(). As done for hexdump and tcpdump already. This diff covers all offenders in usr.bin. Index: bc/bc.y === RCS file:

if_ath oerrors with multicast traffic

2011-04-06 Thread Stefan Sperling
There is a correlation between netstat -I ath0 showing more Oerrs and multicast packets (e.g. CARP) leaving the interface. There is no apparent real problem since these frames are received just fine at the other end. The diff below stops the driver from doing this. Is this right? BTW, there

Re: wcwidth() fix in file(1)

2011-04-11 Thread Stefan Sperling
On Mon, Apr 04, 2011 at 12:08:29AM +0200, Stefan Sperling wrote: Make the file_mbswidth() function cope if wcwidth() returns -1. Maybe this should just call wcswidth() but I'll leave that for another day. Anyone? Fixing wcwidth() to return -1 for non-printable characters depends

pppoe(4) can sleep in interrupt context causing a panic

2011-04-15 Thread Stefan Sperling
My router crashed with the following trace during a carp failover that triggered a pppoe reconnection: # panic: assertwaitok: non-zero mutex count: 1 Stopped at Debugger+0x4: popl%ebp dougal.stsp.name 11:54 15-Apr-11 RUN AT LEAST 'trace' AND 'ps' AND INCLUDE OUTPUT WHEN REPORTING THIS

Re: if_ath oerrors with multicast traffic

2011-04-17 Thread Stefan Sperling
On Wed, Apr 06, 2011 at 10:41:14PM +0200, Stefan Sperling wrote: There is a correlation between netstat -I ath0 showing more Oerrs and multicast packets (e.g. CARP) leaving the interface. There is no apparent real problem since these frames are received just fine at the other end. The diff

Re: isprint() needs setlocale(); for usr.bin

2011-04-17 Thread Stefan Sperling
On Tue, Apr 05, 2011 at 12:25:37AM +0200, Stefan Sperling wrote: For isprint() to work correctly in a UTF-8 locale applications must set up the LC_CTYPE locale before using isprint(). As done for hexdump and tcpdump already. This diff covers all offenders in usr.bin. Todd Miller suggested

Re: wol for xl(4)

2011-04-17 Thread Stefan Sperling
On Thu, Mar 31, 2011 at 06:54:44PM +0200, Stefan Sperling wrote: This is an attempt to add wol support to xl(4). Unfortunately, while I have an xl(4) card to test with none of the motherboards I have will do WOL with it since they all lack an on-board WOL connector :( So test reports

Re: wprintf and friends

2011-04-17 Thread Stefan Sperling
On Sun, Apr 17, 2011 at 11:06:09AM +0100, Stuart Henderson wrote: What's the current status of this diff? I have received no negative comments, but no explicit OKs either. My plan is to fix the wxWidgets and minicom ports before this goes in because they fail to build with it. I haven't found

Re: wol for xl(4)

2011-04-18 Thread Stefan Sperling
On Mon, Apr 18, 2011 at 04:18:01AM +0200, Tobias Ulmer wrote: On Sun, Apr 17, 2011 at 11:05:38AM +0200, Stefan Sperling wrote: On Thu, Mar 31, 2011 at 06:54:44PM +0200, Stefan Sperling wrote: This is an attempt to add wol support to xl(4). Unfortunately, while I have an xl(4) card

Re: wol for xl(4)

2011-04-19 Thread Stefan Sperling
On Tue, Apr 19, 2011 at 02:03:54AM +0200, Tobias Ulmer wrote: On Mon, Apr 18, 2011 at 10:17:33AM +0200, Stefan Sperling wrote: On Mon, Apr 18, 2011 at 04:18:01AM +0200, Tobias Ulmer wrote: On Sun, Apr 17, 2011 at 11:05:38AM +0200, Stefan Sperling wrote: On Thu, Mar 31, 2011 at 06:54:44PM

Re: wprintf and friends

2011-04-22 Thread Stefan Sperling
On Fri, Apr 22, 2011 at 03:50:28PM +0200, Mark Kettenis wrote: === RCS file: /cvs/src/lib/libc/shlib_version,v retrieving revision 1.128 diff -u -p -r1.128 shlib_version @@ -1,4 +1,4 @@ -major=58 +major=59 minor=1

%ls and %lc for vfprintf()

2011-04-23 Thread Stefan Sperling
This patch implements the %ls and %lc format directives (wchar_t * and wint_t arguments, respectively). Based on NetBSD and FreeBSD code. The vfprintf(3) man page has wrongly been claiming that we already support them. Because vfprintf(3) is used on ramdisks, the code is #ifdef PRINTF_WIDE_CHAR

Re: %ls and %lc for vfprintf()

2011-04-29 Thread Stefan Sperling
Anyone? On Sat, Apr 23, 2011 at 10:52:59PM +0200, Stefan Sperling wrote: This patch implements the %ls and %lc format directives (wchar_t * and wint_t arguments, respectively). Based on NetBSD and FreeBSD code. The vfprintf(3) man page has wrongly been claiming that we already support them

wprintf man page

2011-04-29 Thread Stefan Sperling
Does this look alright? Based on FreeBSD's page. Index: Makefile.inc === RCS file: /cvs/src/lib/libc/stdio/Makefile.inc,v retrieving revision 1.16 diff -u -p -r1.16 Makefile.inc --- Makefile.inc28 Apr 2011 17:38:46 -

Re: wprintf man page

2011-04-29 Thread Stefan Sperling
On Fri, Apr 29, 2011 at 04:25:18PM +0200, Ingo Schwarze wrote: Hi Stefan, Stefan Sperling wrote on Fri, Apr 29, 2011 at 01:16:37PM +0200: Does this look alright? Based on FreeBSD's page. Looks good from the mdoc(7) side, except that we haven't support yet for measuring the width

Re: isprint() needs setlocale(); for usr.bin

2011-05-08 Thread Stefan Sperling
On Sun, Apr 17, 2011 at 03:52:14PM -0700, Philip Guenther wrote: On Sun, Apr 17, 2011 at 1:56 AM, Stefan Sperling s...@openbsd.org wrote: On Tue, Apr 05, 2011 at 12:25:37AM +0200, Stefan Sperling wrote: For isprint() to work correctly in a UTF-8 locale applications must set up the LC_CTYPE

Re: isprint() needs setlocale(); for usr.bin

2011-05-08 Thread Stefan Sperling
On Sun, May 08, 2011 at 01:22:55PM +0200, Stefan Sperling wrote: Setting LANG=C for system scripts makes sense to me if the default locale is something else. I suppose their problems are exacerbated by having implemented LC_NUMERIC and LC_TIME, which can change output of programs like bc(1

Re: %ls and %lc for vfprintf()

2011-05-28 Thread Stefan Sperling
On Mon, May 09, 2011 at 10:01:08PM +0200, Stefan Sperling wrote: On Fri, Apr 29, 2011 at 01:09:56PM +0200, Stefan Sperling wrote: Anyone? Updated diff following the vfwprintf() memory leak fix. The previous version of this diff had the same bug. ping Index: Makefile.inc

Re: isprint() needs setlocale(); for usr.bin

2011-06-19 Thread Stefan Sperling
On Sun, May 08, 2011 at 01:34:27PM +0200, Stefan Sperling wrote: On Sun, May 08, 2011 at 01:22:55PM +0200, Stefan Sperling wrote: Setting LANG=C for system scripts makes sense to me if the default locale is something else. I suppose their problems are exacerbated by having implemented

Re: wol for xl(4)

2011-06-19 Thread Stefan Sperling
On Sun, Jun 19, 2011 at 08:14:11PM +, Thomas Gerlach wrote: hey guys, i just had a look into the driver again, and i was able to get wol working now. :) basically, the missing point was to enable RX again. it is disabled in the xl_stop routine (xl.c). right now it's just a quick

Re: wol for xl(4)

2011-06-19 Thread Stefan Sperling
On Sun, Jun 19, 2011 at 08:55:17PM +, Thomas Gerlach wrote: Stefan Sperling stsp at stsp.name writes: hi stefan, oh, sorry, no. i just got back from the german southside festival this evening. should explain why i missed it... ;) seems you came to the same conclusion. fine. :) so

Re: wol for xl(4)

2011-06-22 Thread Stefan Sperling
On Wed, Jun 22, 2011 at 09:54:07AM +, Thomas Gerlach wrote: For me it works as well. :) Just two more little flaws: 1) If you configure WOL inside /etc/hostname.if, then you get the following error message during booting: xl0: command never completed! xl0: transmission error: ff

Re: wol for xl(4)

2011-06-22 Thread Stefan Sperling
On Wed, Jun 22, 2011 at 10:02:42AM +, Thomas Gerlach wrote: as for the pulling toghether, i would suggest something like this (draft, patches against latest -current files, _without_ stefan's recent patches): +#if 1 #ifndef SMALL_KERNEL #endif +#endif Huh? @@ -367,6 +365,22 @@ {

Re: wol for xl(4)

2011-06-22 Thread Stefan Sperling
On Wed, Jun 22, 2011 at 11:43:27AM +, Thomas Gerlach wrote: ...crap! sorry, something went wrong here. :( I'm not sure what you mean went wrong. But in an effort to try to wrap this up, can you please try -current with just this diff and report back if that works? Thanks! Index: xl.c

Re: wcsdup

2011-07-05 Thread Stefan Sperling
On Tue, Jul 05, 2011 at 01:52:06PM -0400, Todd C. Miller wrote: Also, what is that 'L' doing there before the foobar? Is it some sort of wide char thing I'm not aware of? L is C99 notation for wide character string literals. wchar_t is an int, so a pointer increment will consume 4 bytes, not

Re: isprint() needs setlocale(); for usr.bin

2011-07-06 Thread Stefan Sperling
On Sun, Jun 19, 2011 at 02:21:10PM +0200, Stefan Sperling wrote: [[[ Make tools in usr.bin which use isprint() call setlocale() so that the ctype map is initialised correctly. Prevents printing of invalid UTF-8 if the UTF-8 locale is active. ]]] I am still looking for OKs for this one

Re: libevent wide character functions

2011-07-07 Thread Stefan Sperling
On Thu, Jul 07, 2011 at 09:50:42AM +0100, Nicholas Marriott wrote: Let's turn 'em on. Not much supports them but we might as well have them. ok? Index: Makefile === RCS file: /cvs/src/lib/libedit/Makefile,v retrieving

Re: wcsdup

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 03:01:45AM +0100, Nicholas Marriott wrote: Index: wcsdup.3 === RCS file: /cvs/src/lib/libc/string/wcsdup.3,v retrieving revision 1.2 diff -u -p -r1.2 wcsdup.3 --- wcsdup.3 5 Jul 2011 19:01:31 -

Re: libedit readline bugs

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 06:21:17AM +0100, Nicholas Marriott wrote: EL_BIND and EL_SETTC must have their argument lists end in NULL. ok? To make sure I understood correctly, it crashes in ct_decode_argv() because it ends up passing a garbage pointer to mbstowcs(), right? If so, ok. If not,

Re: wol for xl(4)

2011-07-08 Thread Stefan Sperling
On Mon, Jun 27, 2011 at 09:31:26AM +, Thomas Gerlach wrote: Tobias Ulmer tobiasu at tmux.org writes: I've lost track which patches need to be applied or not, but once a complete patch appears, I'm willing to test it on a machine that has three different xl's. hi tobias,

Re: wol for xl(4)

2011-07-08 Thread Stefan Sperling
On Fri, Jul 08, 2011 at 11:18:59PM +0200, Thomas Gerlach wrote: however, there's still the following problem: if wol is enabled via /etc/hostname.xl0 (by adding the wol keyword), it's not possible to log into the system, since the error messages xl0: transmission error: ff and xl0: command

Re: wol for xl(4)

2011-07-09 Thread Stefan Sperling
On Sat, Jul 09, 2011 at 04:54:56PM +0200, Thomas Gerlach wrote: hi stefan, /etc/hostname.xl0: inet 192.168.0.2 255.255.255.0 192.168.0.255 wol (without ) What happens if you put wol on a separate line, like this? inet 192.168.0.2 255.255.255.0 192.168.0.255 wol ok, i don't

Re: wol for xl(4)

2011-07-09 Thread Stefan Sperling
On Sat, Jul 09, 2011 at 07:57:19PM +0200, Claudio Jeker wrote: I'll try to figure out a fix. It could very well be that the wol ioctl is issued before the card is up. ifconfig is strange when flags are set while configuring address. We must not call xl_wol_power() from xl_stop(). If we do

Re: Are there any plans/patches for wscanf(3) support?

2011-09-09 Thread Stefan Sperling
On Fri, Sep 09, 2011 at 04:00:10PM +0400, Vadim Zhukov wrote: Hello all. I saw this patch adding wscanf(3) implementation: http://marc.info/?l=openbsd-techm=130005550717332w=2 What's the current plans for wprintf(3)/wscanf(3) support are? It could be used in Virtuoso port; otherwise,

wscanf

2011-09-20 Thread Stefan Sperling
wscanf based on our scanf implementation. The delta from narrow to wide character support was obtained from FreeBSD and modified to fit our code. Does not include a libc bump yet! Please also review the diff between vfscanf.c and vfwscanf.c after applying this. Thanks. Index: include/wchar.h

Re: wscanf

2011-09-20 Thread Stefan Sperling
On Tue, Sep 20, 2011 at 12:01:18PM +0200, Stefan Sperling wrote: wscanf based on our scanf implementation. The delta from narrow to wide character support was obtained from FreeBSD and modified to fit our code. Does not include a libc bump yet! Here are corresponding libstdc++ changes, also

Re: wscanf

2011-09-21 Thread Stefan Sperling
On Wed, Sep 21, 2011 at 06:13:31PM +0200, Mark Kettenis wrote: wide character support in that version of libstdc++ was an all-or-nothing thing, and I don't think wer should change that. Fine. I'll leave that alone until we have all the functions it wants. Get working on wcsfstime() ;) AFAIK

Re: wscanf

2011-09-21 Thread Stefan Sperling
On Wed, Sep 21, 2011 at 07:59:08PM +0200, Stefan Sperling wrote: On Wed, Sep 21, 2011 at 06:13:31PM +0200, Mark Kettenis wrote: wide character support in that version of libstdc++ was an all-or-nothing thing, and I don't think wer should change that. Fine. I'll leave that alone until we

Re: fix possible NULL deref in sys/dev/usb/uhub.c

2011-09-29 Thread Stefan Sperling
On Fri, Feb 18, 2011 at 03:44:55AM +, Jacob Meuser wrote: at line 190, if nports == 0, 'hub' will be NULL at line 334, and 'if (hub-ports)' will be a NULL dereference. found by Amit Kulkarni using clang. I OK'd this diff back in February, but it seems this still hasn't been committed.

ath(4) sends duplicate multicast frames with AR5212 chipset

2011-10-01 Thread Stefan Sperling
I am running the following ath(4) card in hostap mode with WPA: ath0 at pci0 dev 12 function 0 Atheros AR5212 (IBM MiniPCI) rev 0x01: irq 9 ath0: AR5213A 5.9 phy 4.3 rf5112a 3.6, WOR01W, address 00:0e:9b:d7:36:f8 STAs can connect fine. However, multicast frames cause a lot of RX errors at the

Re: ath(4) sends duplicate multicast frames with AR5212 chipset

2011-10-01 Thread Stefan Sperling
On Sun, Oct 02, 2011 at 01:03:33AM +0200, Stefan Sperling wrote: Our AR5212 code retries 15 times, whether or not the frame is multicast. The tx retries value passed to the HAL is 11 and the HAL always adds 4 (not sure what's the point -- only the AR5212 HAL changes the value passed

carp error message diff

2011-10-02 Thread Stefan Sperling
Sync error strings between v4 and v6 carp code. ok? Index: ip_carp.c === RCS file: /cvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.190 diff -u -p -r1.190 ip_carp.c --- ip_carp.c 6 Sep 2011 16:00:22 - 1.190 +++

carp slaves send IPv6 neighbour advertisements

2011-10-02 Thread Stefan Sperling
After upgrading my carp setup to -current messages like the following started appearing in the logs of the carp master: Oct 1 22:09:39 dougal /bsd: nd6_na_input: duplicate IP6 address fe80:000a::0200:5eff:fe00:0101 Oct 1 22:09:39 dougal /bsd: nd6_na_input: duplicate IP6 address

carp ipv6 checksum fix

2011-10-02 Thread Stefan Sperling
I've started seeing the following problem after updating my carp setup to -current yesterday. But it is probably a bit older. My carp setup uses IPv6. The carp master complains as follows: Oct 1 22:10:19 dougal /bsd: carp: checksum failed, on carp0 The carp slave is also seeing checksum

Re: wscanf

2011-10-11 Thread Stefan Sperling
On Thu, Sep 22, 2011 at 11:50:31AM +0200, Mark Kettenis wrote: Date: Wed, 21 Sep 2011 21:25:40 +0200 From: Stefan Sperling s...@openbsd.org On Wed, Sep 21, 2011 at 07:59:08PM +0200, Stefan Sperling wrote: On Wed, Sep 21, 2011 at 06:13:31PM +0200, Mark Kettenis wrote: wide character

Re: rc.d/xdm, check for broken xkb

2011-11-02 Thread Stefan Sperling
On Wed, Nov 02, 2011 at 08:31:19AM -0400, Kenneth R Westerback wrote: On Tue, Nov 01, 2011 at 04:39:29PM +, Stuart Henderson wrote: If you hit the xkb file/directory problem (for example, if you follow the upgrading without install kernel instructions), you can't type at the keyboard,

mbstowcs(3) man page error

2011-11-16 Thread Stefan Sperling
Documentation of the mbstowcs(3) return value is wrong. The text was probably copied from the page for mbtowc(3). It says the returned value can never larger than MB_CUR_MAX... yeah right. More importantly, it is wrong about NUL being included in the returned count. This diff syncs the page with

Re: libedit wchar allocation issue

2011-11-16 Thread Stefan Sperling
On Tue, Nov 15, 2011 at 11:09:08PM +, Nicholas Marriott wrote: Hi libedit miscalculates the amount of space needed for constructing it's wchar_t version of argv, causing it to overrun the buffer. I don't see how the output of mbstowcs can be longer than (sum(strlen(argv)) * sizeof

Re: fix ral (and maybe other cards) hostap mode

2012-01-20 Thread Stefan Sperling
you'll need to apply the two recent CVS commits by Stefan Sperling, ieee80211_node.c,v 1.64 and ieee80211_proto.c,v 1.46. You may then try his 'inactivity' patch included below, otherwise active stations could be deauthed when the node cache becomes full. There used to be an LRU list

bioctl(8) with duid

2012-04-22 Thread Stefan Sperling
Teach bioctl(8) to resolve disks via duid. The realpath provided by opendev() cannot be used since bioctl internally uses the volume name (e.g. sd0) rather than the full path to the device node. Mapping a duid to a volume name with an extra BIOCVOL call is not pretty but works. Index: bioctl.c

Realtek RTS5209 (was: Re: Intel AHCI RAID controller in Sony VAIO Z23 laptop)

2012-05-31 Thread Stefan Sperling
On Thu, May 31, 2012 at 10:53:22AM +0200, Paul de Weerd wrote: I've recently bought a new Sony laptop, VPCZ23C5E. Some things on this machine work fine (sound, suspend, wired network), some things don't (X, resume, wireless). I suppose the card reader won't work either: Realtek RTS5209 Card

rt2560 bbp/antenna diff

2012-07-07 Thread Stefan Sperling
rt2560 is selecting antennas before initialising the baseband processor (BBP), however initialising antennas involves tweaking of BBP registers. The diff below (taken from dragonfly, written by sephe) ensures antennas are selected after the BBP has been initialised. Part of this diff was

add PCI ID for broadcom BCM43224 chip variant

2012-07-07 Thread Stefan Sperling
My laptop has a chip which the Linux brcm80211 driver calls #define BCM43224_D11N_ID_VEN1 0x0576 /* Vendor specific 43224 802.11n db */ Diff below adds the PCI id. ok? pcidump output: 1:0:0: Broadcom unknown 0x: Vendor ID: 14e4 Product ID: 0576 0x0004: Command: 0006

rt2560 tx/prio queue fixes

2012-07-08 Thread Stefan Sperling
The rt2560 part of the ral driver uses a prio queue for management frames and a tx queue for data frames. Both queues currently use a shared flag to tell the network stack that they are full (IFF_OACTIVE). It seems that IFF_OACTIVE can get cleared by the interrupt handler for one queue while the

Re: [patch] wpi(4): add promiscuous mode

2012-07-08 Thread Stefan Sperling
On Sun, Jul 08, 2012 at 01:45:45AM +0300, Lazaros Koromilas wrote: Hello all, I'm resending a diff that enables network cards running with the wpi driver to enter promiscuous mode. I have changed WPI_CMD_ASSOCIATE to WPI_CMD_ASSOCIATED to better designate its You forgot to update a

Re: [patch] wpi(4): add promiscuous mode

2012-07-08 Thread Stefan Sperling
On Sun, Jul 08, 2012 at 08:00:28PM +0300, Lazaros Koromilas wrote: On Sun, Jul 08, 2012 at 10:59:09AM +0200, Stefan Sperling wrote: The linux driver (iwlegacy) doesn't run this command in async mode. Is there a reason why you're passing 1 for the last param, i.e. not waiting for a command

Re: ral(4) tx/prio queue fixes (was: rt2560 tx/prio queue fixes)

2012-07-10 Thread Stefan Sperling
On Sun, Jul 08, 2012 at 10:11:44AM +0200, Stefan Sperling wrote: The rt2560 part of the ral driver uses a prio queue for management frames and a tx queue for data frames. Both queues currently use a shared flag to tell the network stack that they are full (IFF_OACTIVE). It seems

make net80211_input be nice to soekris

2012-07-12 Thread Stefan Sperling
Running ifconfig ral0 debug down up can leave slow systems, such as edd@'s soekris, with an unusable wireless interface until reboot. The net80211 layer will run a scan when the interface comes up. The scan hops from channel to channel every 200msec. This hopping is controlled via a timeout

Re: make net80211_input be nice to soekris

2012-07-13 Thread Stefan Sperling
On Thu, Jul 12, 2012 at 05:51:32PM +0200, Stefan Sperling wrote: Running ifconfig ral0 debug down up can leave slow systems, such as edd@'s soekris, with an unusable wireless interface until reboot. The net80211 layer will run a scan when the interface comes up. The scan hops from channel

improve hostap in noisy environments

2012-07-13 Thread Stefan Sperling
We've got lots of RF noise in the g2k12 hackroom. Edd's soekris sometimes failed to allow new nodes to associate and we found that this was due to ieee80211_node_alloc_helper() failing to add a new node to the cache. 'netstat -W ral0' showed the 'input packets dropped' counter, which corresponds

Re: make net80211_input be nice to soekris

2012-07-13 Thread Stefan Sperling
On Fri, Jul 13, 2012 at 03:16:27AM -0600, Theo de Raadt wrote: + printf(msg); This really should be printf(%s, msg); To avoid format string problems. Yes, you say you are completely in control of the string however someone could reuse this workq handler for some

Re: ral(4) tx/prio queue fixes (was: rt2560 tx/prio queue fixes)

2012-07-13 Thread Stefan Sperling
On Tue, Jul 10, 2012 at 05:56:29PM +0200, Stefan Sperling wrote: Updated version that includes similar fixes for the rt2661 variants. This seems to help soekris-based ral APs that get stuck with the OACTIVE flag set (see the flags line in ifconfig ral0 output when the AP stops responding

Re: rt2560 bbp/antenna diff

2012-07-13 Thread Stefan Sperling
On Sat, Jul 07, 2012 at 08:14:34PM -0400, Brad Smith wrote: I had posted a diff for this and a few other bug fixes here.. http://marc.info/?l=openbsd-techm=124139607313719w=2 I've looked at the additional changes you ported from dragonfly in that diff. I don't know what impact these changes

cosmetic netstat -W tweak

2012-07-13 Thread Stefan Sperling
Input packets dropped isn't really a good description of what happened when we failed to allocate a new node in the net80211 stack. This allocation doesn't happen for every packet, only for new nodes that appear in reach of the antenna. And we already mention nodes elsewhere in the output:

some more net80211 node leaks

2012-07-13 Thread Stefan Sperling
The ieee80211_dup_bss() function internally calls ieee80211_alloc_node_helper(), which means we should check the node cache for an existing entry before calling ieee80211_dup_bss(). ieee80211_node.c already does this but there are some instances in ieee80211_input.c where we fail to check for

Re: some more net80211 node leaks

2012-07-13 Thread Stefan Sperling
On Fri, Jul 13, 2012 at 08:16:56PM +0200, Stefan Sperling wrote: The ieee80211_dup_bss() function internally calls ieee80211_alloc_node_helper(), which means we should check the node cache for an existing entry before calling ieee80211_dup_bss(). ieee80211_node.c already does

Re: ral(4) tx/prio queue fixes (was: rt2560 tx/prio queue fixes)

2012-07-15 Thread Stefan Sperling
On Fri, Jul 13, 2012 at 07:14:19PM +0200, Mark Kettenis wrote: Date: Fri, 13 Jul 2012 11:37:41 +0200 From: Stefan Sperling s...@openbsd.org On Tue, Jul 10, 2012 at 05:56:29PM +0200, Stefan Sperling wrote: Updated version that includes similar fixes for the rt2661 variants

Re: ral(4) tx/prio queue fixes (was: rt2560 tx/prio queue fixes)

2012-07-16 Thread Stefan Sperling
On Sun, Jul 15, 2012 at 07:57:26PM +0200, Stefan Sperling wrote: The part of this change which resets sc-sc_tx_timer in a different way can cause spurious device timeouts, leading to unneccesary disassociations. I'm seeing a device timeout almost every minute on a net5501 soekris

Re: ral(4) tx/prio queue fixes (was: rt2560 tx/prio queue fixes)

2012-07-16 Thread Stefan Sperling
On Mon, Jul 16, 2012 at 02:35:05PM +0200, Stefan Sperling wrote: Disregard this diff. It makes things even worse because it re-introduces the problem where the interface gets stuck with OACTIVE set and isn't reset automatically. The problem with the prior diff was that it didn't look

small net80211 node cache fix

2012-07-18 Thread Stefan Sperling
Node cache eviction is too agressive, possibly kicking off associated stations for no good reason. I missed that associated stations are in state IEEE80211_S_RUN rather than IEEE80211_S_ASSOC (which means trying to associate). Also compile the debug message shown when a node is evicted from the

ral rt2661 tx interrupt race fix

2012-07-18 Thread Stefan Sperling
ral(4) cards using the rt2661 driver code (RT2561, RT2561S, RT2661 variants) suffer a race in TX interrupt handling which can cause TX processing to get stuck. This problem was previously discussed here: http://marc.info/?l=openbsd-miscm=125895269930106w=2 The patch proposed there was rejected by

Re: Small change to let mg handle localized characters

2012-08-23 Thread Stefan Sperling
On Thu, Aug 23, 2012 at 05:32:51PM -0400, Geoff Steckel wrote: Using iconv in an editor is EXTREMELY dangerous without complex precautions. Given a file containing characters not valid in the current locale, it will at minimum prevent viewing the file. An editor needs to convert between

inet6 autoconf spl fix

2012-09-02 Thread Stefan Sperling
prelist_update() runs at IPL_SOFTNET. Code moved out of it into a workq task for adding new addresses from process context should run at IPL_SOFTNET, too, shouldn't it? Index: netinet6/nd6_rtr.c === RCS file:

allow v6 privacy and static addresses to co-exist again

2012-09-02 Thread Stefan Sperling
Simon's recent commit to prevent SLAAC address formation when a static address is already configured has a side-effect for autoconfprivacy users. With the following in /etc/hostname.if: dhcp rtsol inet6 some-address 64 the netstart script will run rtsol after assigning the static address,

allow amd64 to boot from CONCAT softraid volumes

2012-09-16 Thread Stefan Sperling
This is very similar to booting from RAID1, except we only try the first chunk in the set. Tested with qemu-system-x86_64, using two disk images (-hda and -hdb parameters, and -cdrom cd52.iso -boot d to boot from cdrom). The softraid disk must be created manually during installation. At the

Re: Threads related SIGSEGV in random.c

2012-09-19 Thread Stefan Sperling
On Wed, Sep 19, 2012 at 10:37:09PM +0300, Alexey Suslikov wrote: Could you guide me how to rebuild/reinstall libc in a proper way? It's easy, just needs 11 steps. This is how I did it: 1) $ cd /usr/src/lib/libc 2) edit files 3) $ make obj 4) $ make clean 5) $ make 6) pray !!! 7) $ sudo make

Re: Threads related SIGSEGV in random.c

2012-09-20 Thread Stefan Sperling
On Thu, Sep 20, 2012 at 09:15:42AM +0200, Remco wrote: AFAICT at least the tools in /bin and /sbin are statically linked and would need to be rebuilt to include any changes in libc. That's correct, and it's actually very convenient. If you make some mistake dynamic binaries might no longer be

Re: help testing bridge diff

2012-09-23 Thread Stefan Sperling
On Thu, Sep 20, 2012 at 10:11:20AM +0200, Camiel Dobbelaar wrote: I need help testing this bridge diff, as I cannot test (or even imagine) all the possible bridge setups. It brings a nice speed improvement and simplifies the code. Testing especially appreciated with gif, tun and vether

Re: help testing bridge diff

2012-09-25 Thread Stefan Sperling
On Mon, Sep 24, 2012 at 06:12:21PM +0200, Camiel Dobbelaar wrote: And a new diff, A misplaced bracket in in_arpinput() caused make release to fail (as you noticed). I've tested this sending traffic through vr, vether, ral, and tun in a single bridge. Everything is working flawlessly here. As

add support for elantech touchpads to pms(4)

2012-10-04 Thread Stefan Sperling
This diff adds support for Elantech touchpads to pms(4), so that synpatics(4) will attach and allow configuration of edge-scrolling, 2-finger scrolling, toggle tap-to-click on/off, etc. Currently, such pads only work in compat mode, which means they are recognized as regular PS/2 mice and cannot

Re: ral rt2661 tx interrupt race fix

2012-10-04 Thread Stefan Sperling
On Sun, Sep 30, 2012 at 10:32:23PM +0100, Tom Murphy wrote: Stefan, Your patch works well on my system: ral0 at pci0 dev 14 function 0 Ralink RT2661 rev 0x00: irq 10, address 00:14:85:d5:39:bb ral0: MAC/BBP RT2661D, RF RT2529 (MIMO XR) Only problem is downloading from the

Re: add support for elantech touchpads to pms(4)

2012-10-05 Thread Stefan Sperling
On Fri, Oct 05, 2012 at 01:52:08PM +0200, Martin Pieuchot wrote: My first impression at looking the code is that the v2 and v3 use totally different packet formats and I don't see a real benefit of having only one entry in the protocol table if you need to check for the hardware version in

fix athn(4) rfkill switch detection for ar9003

2012-10-07 Thread Stefan Sperling
As reported a while ago (see http://marc.info/?l=openbsd-miscm=132911890531492w=2) athn(4) attaches to some ar9003 chips but fails to get past the hardware rfkill switch. It always reports radio is disabled by hardware switch regardless of the actual state of the switch. I've got an ar9485 which

update athn(4) ar9485 initvals (please test on any athn(4))

2012-10-07 Thread Stefan Sperling
The init values athn(4) has for the ar9485 are for version 1.0 of this chip, which according to Atheros Linux developers was never sold: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=903946e6e21ef4dd678acafb8881cabde9182caf This diff updates the initvals to what the

Re: fix athn(4) rfkill switch detection for ar9003

2012-10-07 Thread Stefan Sperling
On Sun, Oct 07, 2012 at 07:41:58PM +0200, Mark Kettenis wrote: Hmm, the AR9300_GPIO_IN_VAL define you introduce isn't actually used. Thanks, I forgot about using it. Not sure if it is important though maybe the upper bits of the register aren't always stable? In any case we should just use the

Re: update athn(4) ar9485 initvals (please test on any athn(4))

2012-10-13 Thread Stefan Sperling
On Sun, Oct 07, 2012 at 06:24:39PM +0200, Stefan Sperling wrote: The init values athn(4) has for the ar9485 are for version 1.0 of this chip, which according to Atheros Linux developers was never sold: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h

<    1   2   3   4   5   6   7   8   9   10   >