From owner-freebsd-wireless@FreeBSD.ORG Mon Feb 6 20:12:36 2012 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8189106566C; Mon, 6 Feb 2012 20:12:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id C76758FC0A; Mon, 6 Feb 2012 20:12:35 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so6642187wgb.31 for ; Mon, 06 Feb 2012 12:12:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=FIAzCqaMV2uTtjDedAq1eToM9STEEzQHeA7NlfoHmmU=; b=BGxhmNsMZSY7jAwuPBvIvWI7dJ/lOajg/vKu9KreGBFLFXfQzahZcT0bPE61fovACs 8/CQ5DCMABaM6HdeUED/pJuJteAP5+2+7+MpYzzRbpucFdr2YjCk0cW6ujQtzW11BzrD gmhn76dhxw/wCTZegX/xlvvIf8p9t2spqplIA= MIME-Version: 1.0 Received: by 10.180.107.34 with SMTP id gz2mr29350487wib.21.1328559154803; Mon, 06 Feb 2012 12:12:34 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.175.136 with HTTP; Mon, 6 Feb 2012 12:12:34 -0800 (PST) In-Reply-To: <201202062059.16816.bschmidt@freebsd.org> References: <201202062059.16816.bschmidt@freebsd.org> Date: Mon, 6 Feb 2012 12:12:34 -0800 X-Google-Sender-Auth: KM62c8NF1qUC7_VGBzvxUuc78tk Message-ID: From: Adrian Chadd To: Bernhard Schmidt Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org Subject: Re: [net80211] support vendor bitmap entries; teach if_ath to export PHY error code in error frames X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 20:12:36 -0000 On 6 February 2012 11:59, Bernhard Schmidt wrote: > Given that the calculation of the offsets is totally unrelated to the length of the actually vendor specific data, couldn't you just add the length of the additional ext field + padding based on the presents of VENDOREXT? Well, the problem is the lack of documented alignment requirements for a variable-length vendor data chunk. I'm aligning the vendor header @ a 4 byte boundary (which wireshark seems to accept) and johannes' reference radiotap parser comes with vendor chunks which are also 4 byte aligned. But: * the vendor header is 6 bytes, so * there's two bytes between it and the next 4 / 8 byte boundary; * there's no requirement for the vendor header to be 8 byte aligned, so you can't store uint64_t's inside the vendor data blob and assume they'll be "naturally aligned." For now I've just added a 2 byte pad (1 byte version, one byte rx chainmask) to pad it out to a 4 byte array, then all my sub-fields assume 4 byte alignment. Along with plenty of comments about alignment assumptions. I haven't yet tested my patch out on MIPS to ensure that I haven't busted alignment constraints. I'll do that before I finally commit it. Adrian