From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 25 12:00:45 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A7A31065702 for ; Thu, 25 Aug 2011 12:00:45 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id C8EB08FC28 for ; Thu, 25 Aug 2011 12:00:44 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=Ic1eHMOXbQHcCvhs/sz3xt2crOpE4ZQ8e7+3c6x+FwY= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=M2B_LQOazjWGs0MlK5IA:9 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 2969296; Thu, 25 Aug 2011 14:00:36 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Thu, 25 Aug 2011 13:58:12 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108251358.12187.hselasky@c2i.net> Cc: Daniel Grech Subject: Re: USB Stack Hooking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2011 12:00:45 -0000 On Thursday 25 August 2011 13:04:26 Daniel Grech wrote: > Hi, I need to write a kernel module that would hook onto some function at a > low level in the USB stack in order to have direct access to the raw data > that is received from the USB Controller Hardware. Has this ever been done > before ? Any ideas as to which function I could hook onto to have access to > this data ? Hi, Recently there was an USB Packet Filter solution added, which can TAP data at the most common places. See /sys/dev/usb/usb_pf.c And: usbpf_xfertap() If you want to grab information lower than this, there is no formal API at the present moment. Are you thinking about USB Gadget/Device or USB Host data grabbing? --HPS