From owner-freebsd-usb@FreeBSD.ORG Sat Aug 28 06:48:45 2010 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DEEA10656A5 for ; Sat, 28 Aug 2010 06:48:45 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 501A78FC0C for ; Sat, 28 Aug 2010 06:48:44 +0000 (UTC) Received: by iwn36 with SMTP id 36so3741503iwn.13 for ; Fri, 27 Aug 2010 23:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=zhTHztVfxTSE1KKUhWCg8B1qwv2bCiqgNtM6vEHMwl4=; b=QxIx/O8WCAg8VWUzTgOiieVJl0U+62983oLVLVKH9dDTCpDJXUKTxXjnVjqaAeYYEv Q+mWLTGc7KC5PMuBWTVkNrftPmzeIJh2FTjH4isxPfcuu+pi7dsu9M9v9A3Fn0HTJkSo myP8Syo/EQNvHxbunslUJEKpFzQu0jVqEjPoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=QQ9mUSj91auLthKX9SWUdNaO7kS+vsMYmMsORZh9Dc+SC0wygt+Tqyp24nLu2CxexI KR+i2ILZRaSKFncKuaSiP/n89Gf6XmbrXufhnuB4PNNaEC78Q73k1Ci4Kgn0HPrNDQMN 9Z+RYTUyP1zL5FXl64wuDiCQ/1tqVac0JTIYE= Received: by 10.231.151.135 with SMTP id c7mr1554079ibw.184.1282978039334; Fri, 27 Aug 2010 23:47:19 -0700 (PDT) Received: from orb.electron-tube.net (71-217-215-181.cdrr.qwest.net [71.217.215.181]) by mx.google.com with ESMTPS id h8sm4519232ibk.3.2010.08.27.23.47.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 27 Aug 2010 23:47:18 -0700 (PDT) Message-ID: <4C78B0F4.4020002@gmail.com> Date: Sat, 28 Aug 2010 01:47:16 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100731) MIME-Version: 1.0 To: Hans Petter Selasky References: <4C76AB76.4070806@gmail.com> <201008270856.43512.hselasky@c2i.net> <4C777D12.3040900@gmail.com> <201008271053.27731.hselasky@c2i.net> In-Reply-To: <201008271053.27731.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org Subject: Re: writing usb drivers under 8.x X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2010 06:48:45 -0000 thanks. am doing that now. I already have one patch for this one.... what kind of idiot defines a constant assignment for a 32k buffer as a 15 bit left shift of 1? clever, yes. but in production, stupid. a constant should be just that, a constant, and thus require no computation at runtime. i'm old school, and what a lot of kids don't understand today is that small and efficient is still as applicable today as it was then. *** ulpt.c~ Thu May 6 22:28:17 2010 --- ulpt.c Sat Aug 28 01:42:11 2010 *************** *** 87,93 **** &ulpt_debug, 0, "Debug level"); #endif ! #define ULPT_BSIZE (1<<15) /* bytes */ #define ULPT_IFQ_MAXLEN 2 /* units */ #define UR_GET_DEVICE_ID 0x00 --- 87,93 ---- &ulpt_debug, 0, "Debug level"); #endif ! #define ULPT_BSIZE 0x8000 /* bytes */ #define ULPT_IFQ_MAXLEN 2 /* units */ #define UR_GET_DEVICE_ID 0x00 Hans Petter Selasky wrote: > On Friday 27 August 2010 10:53:38 Jim Bryant wrote: > >> it'll be a pair of character devices. >> >> > > >> lirc compat is a goal of this project though. most of the work is done >> on that front, i just need to port that over from linux. the features >> of the imon remote control are well-supported in lirc. /dev/lirc will >> exist in my driver. >> > > See sys/dev/usb/input/ulpt.c driver for how to create cdevs. Don't use cdev > directly in the kernel. > > --HPS > >