On Mon, Jan 28, 2013 at 04:44:39PM +0100, Mark Kettenis wrote:
> When working on the WPA-Enterprise stuff, I actually ran into an issue
> with the rsu(4) I was using. It seems there is a problem with
> submitting the "join BSS" command when an RSN information element is
> included, which makes the command never complete. The crucial bit
> seems to be that this changes the length of the command to something
> the firmware doesn't like. The code rounds the length up to the next
> multiple of 8, but it seems the firmware wants it to be at least a
> multiple of 16. The easiest fix seems to be to just send the entire
> buffer that we allocate for the command. This will transfer more
> bytes than strictly necessary, but this command isn't sent invoked
> very often so I don't think this will be a problem. This diff might
> fix issues with WPA-PSK as well.
>
> ok?
Tested with
rsu0 at uhub0 port 5 "Manufacturer Realtek RTL8188S WLAN Adapter" rev
2.00/2.00 addr 2
rsu0: MAC/BB RTL8712 cut 3, address 00:13:33:ad:0a:fc
while constantly switching between OpenBSD and Linux APs with WPA.
Works fine. ok.
> Index: if_rsu.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/if_rsu.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 if_rsu.c
> --- if_rsu.c 3 Jul 2011 15:47:17 -0000 1.14
> +++ if_rsu.c 28 Jan 2013 15:23:46 -0000
> @@ -1078,7 +1078,7 @@ rsu_join_bss(struct rsu_softc *sc, struc
> bss->len = htole32(((frm - buf) + 3) & ~3);
> DPRINTF(("sending join bss command to %s chan %d\n",
> ether_sprintf(bss->macaddr), letoh32(bss->config.dsconfig)));
> - return (rsu_fw_cmd(sc, R92S_CMD_JOIN_BSS, buf, frm - buf));
> + return (rsu_fw_cmd(sc, R92S_CMD_JOIN_BSS, buf, sizeof(buf)));
> }
>
> int