From owner-freebsd-wireless@FreeBSD.ORG Wed Oct 29 18:34:21 2014 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0804A59B for ; Wed, 29 Oct 2014 18:34:21 +0000 (UTC) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96296276 for ; Wed, 29 Oct 2014 18:34:20 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id m15so2539290wgh.41 for ; Wed, 29 Oct 2014 11:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=s1JJtrAWo/7AlAh6fsF4KJf++AFONULPbY6ZIk00JZs=; b=OnIMjmi3gVdvsMAxP5MB4Kk5U3qJgH99cnbPf91NG6hC4rQdpio1uoWl+vtHARiWFA xP7WacV3tsh4tFOmRfSa+6aOH/7zs9xDwqdyM14y/ueb+Hdjt4SR7MvfWbHxCgiASJ/n W7VOmb3FHS18yCJ76wjneXPN35VJmvFe/TqS5vq7NQqXwszOqx3ZzxZoSv74yuLLft1k fLmF99IUk3Yj28679q8kqpgTG7ITQVvrLvyp27k1VnpRA7Z9kEjvHKjnvYdrLzYA69lW NGaVteg20yElQa9g2jyD60Lo2bbQ9HwEEaPp8HZYfEpfQyvsTqtwi2MteGdVeONmSZvy 7PtQ== MIME-Version: 1.0 X-Received: by 10.194.6.233 with SMTP id e9mr15182628wja.20.1414607658804; Wed, 29 Oct 2014 11:34:18 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Wed, 29 Oct 2014 11:34:18 -0700 (PDT) In-Reply-To: References: <1E0B1592-5212-4D65-8F08-344EC215EA47@student.ethz.ch> Date: Wed, 29 Oct 2014 11:34:18 -0700 X-Google-Sender-Auth: ybKh6IGX-dCdaJCVLlKLD_SWVmA Message-ID: Subject: Re: Time-of-flight positioning - Atheros From: Adrian Chadd To: Sergey Ryazanov Content-Type: text/plain; charset=UTF-8 Cc: Graf Monika , "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.18-1 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: Wed, 29 Oct 2014 18:34:21 -0000 Oh, I asked him to. I don't mind which list he's asking for hardware help on. On 29 October 2014 02:33, Sergey Ryazanov wrote: > Hi Monika, > > 2014-10-29 11:44 GMT+03:00 Graf Monika : >> Hello Everyone >> >> I am currently at a project where I am using Atheros Chipsets AR9590 with the ath9k driver. >> > It's a bit strange to ask questions about linux driver in > freebsd-wireless mailing list. Just in case, there are two mailing > lists for ath9k: ath9k-devel and linux-wireless. > >> I am wondering how the time-of-flight information can be retrieved per packet in most recent Atheros chipsets. Is it required a proprietary HAL version ? >> > If you need a round-trip-time: take a tx timestamp from tx-complete > descriptor of data frame, then take a timestamp from received ACK > frame and then compute the time. To get received ACK frames from NIC > you should enable control frames receiving in Rx filter. If you need > more details about descriptor format or time of timestamp capture, > then may be Adrian could help. The RX timestamp is from the MAC, not the PHY. So it's an OK estimate, but for metre and sub-metre accuracy you still need to get the original PHY timestamp. IIRC the timestamps are microsecond accurate, which limits your actual distance calculation. Now, the AR9380 and later chips do have some stuff to pull out the PHY timestamp and some information about the leading edge of the received frame. > BTW, a month ago or so, Lorenzo Bianconi added a dynamic ACK timeout > estimation to the ath9k, based exactly on round-trip-time computation. That was pretty cute. -adrian