From owner-freebsd-drivers@FreeBSD.ORG Tue May 24 21:34:20 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8207106564A for ; Tue, 24 May 2011 21:34:20 +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 3D06E8FC16 for ; Tue, 24 May 2011 21:34:19 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=0KkIQGagYCvnrzE3Z2Lmid87OPdbX6VLcZYwAuLMZ50= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=kWWxOIFCDSEA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=e9o6qIhPbQBSJ5zuZXYA: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 131357557; Tue, 24 May 2011 23:24:16 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Tue, 24 May 2011 23:23:02 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4DDC20DF.6060805@gmail.com> In-Reply-To: <4DDC20DF.6060805@gmail.com> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105242323.02572.hselasky@c2i.net> Cc: freebsd-drivers@freebsd.org Subject: Re: traditional syscalls with DRIVER_MODULE ???? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 21:34:20 -0000 On Tuesday 24 May 2011 23:19:27 Jim Bryant wrote: > the only thing in the usb framework using the cdevsw framework seems to > be usb_dev.c, but it seems to be an abstraction, and not an end-device > in the sense that i'm doing. Hi, This framework is for USB devices only and can create any character device. This abstraction has additional code to be detach safe with regard to the USB device being unplugged. --HPS From owner-freebsd-drivers@FreeBSD.ORG Tue May 24 21:35:33 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CF2C106566B for ; Tue, 24 May 2011 21:35:33 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe06.c2i.net [212.247.154.162]) by mx1.freebsd.org (Postfix) with ESMTP id EE9898FC12 for ; Tue, 24 May 2011 21:35:32 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=NvrFngl24Vvwb7eBef0tfsytOWEnP/WlkqxQrRnklhk= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=kWWxOIFCDSEA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=VrRaG_UlQmsBQoRoqskA:9 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe06.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 130288785; Tue, 24 May 2011 23:25:29 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Tue, 24 May 2011 23:24:15 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4DDC20DF.6060805@gmail.com> In-Reply-To: <4DDC20DF.6060805@gmail.com> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105242324.15541.hselasky@c2i.net> Cc: freebsd-drivers@freebsd.org Subject: Re: traditional syscalls with DRIVER_MODULE ???? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 21:35:33 -0000 On Tuesday 24 May 2011 23:19:27 Jim Bryant wrote: > if i add such an interface to the current DRIVER_MODULE version, how > would i go about NOT having DRIVER_MODULE create the devfs entries? i > would prefer to have the devfs entries handled by make_dev, so to have > access to the desired syscalls. Look at /sys/dev/usb/serial/ulpt.c For a simple example. More abstract: "cd /usr/ports/multimedia/cuse4bsd" and "man libusb20" --HPS From owner-freebsd-drivers@FreeBSD.ORG Tue May 24 21:43:38 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E82D7106566B for ; Tue, 24 May 2011 21:43:38 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id A3BE58FC13 for ; Tue, 24 May 2011 21:43:38 +0000 (UTC) Received: by yxl31 with SMTP id 31so3597339yxl.13 for ; Tue, 24 May 2011 14:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=ONJ2dfe69tDMfYDY+eOmgt8AK/d4cJhhZRDZw46Ja3U=; b=vzKic1yikU98YS5U5rhSvjGIyZ16gA1ZUaOBb5x4tEr/AXQiYOhjp8+Loi4EOmi5Y8 S/bj98fg4sY8SGY0yJkMOrU/i0I6DDWDkQxgtoV9u9D5v15vrZ/Bq0Dz4zrciG23shk7 tnnsN4sbO1gRk3yWwBQtUkg+TwuyoFo4rSKoM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=Z2bwHTKN5ZDCgt7MFapKMO+SgX5OUtCECnDuGwU56dN8xvgTmQBWzKmTUpPPedXdEv cOs0uIQUlXEdwgSJoAXm2lLtk5Lk57YH0r6Hnj6LFHp6ldq7yxN5+iBkF7RxyxZ7HLOY JC7RHJMDHq0VYUPYfXVZGS7k+73d0N6ZxXDvI= Received: by 10.236.201.233 with SMTP id b69mr5268157yho.468.1306271972412; Tue, 24 May 2011 14:19:32 -0700 (PDT) Received: from argus.electron-tube.net (desm-44-169.dsl.netins.net [167.142.44.169]) by mx.google.com with ESMTPS id 65sm3399705yhl.85.2011.05.24.14.19.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 14:19:31 -0700 (PDT) Message-ID: <4DDC20DF.6060805@gmail.com> Date: Tue, 24 May 2011 16:19:27 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: freebsd-usb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org Subject: traditional syscalls with DRIVER_MODULE ???? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 21:43:39 -0000 i'm in the process of both learning the driver interface and writing a usb driver for a multimedia product. i'm kind of stuck here, as i'm seeing two distinct, and possibly mutually exclusive interfaces here. the test framework i'm currently using is the DRIVER_MODULE macro, but it lacks the traditional syscalls provided by cdevsw (in particular, i'm wanting open, close, poll, read, and write). if i add such an interface to the current DRIVER_MODULE version, how would i go about *NOT* having DRIVER_MODULE create the devfs entries? i would prefer to have the devfs entries handled by make_dev, so to have access to the desired syscalls. the only thing in the usb framework using the cdevsw framework seems to be usb_dev.c, but it seems to be an abstraction, and not an end-device in the sense that i'm doing. any tips? any pointers? i've done a grep, and found that there is no existing driver that uses DRIVER_MODULE with any *_read, *_write, or *_close. i can do the job with ioctls, but doing so would rule out select in userland code, and for the interrupt endpoints, i would rather have a poll and read interface that allows for select(2) and read(2). also, i would like to thank hans selasky for the pointer to his meetbsd/krakow presentation on the usb stack, i did learn a couple of new things about capabilities from it, but it lacked the detail i'm looking for. jim From owner-freebsd-drivers@FreeBSD.ORG Wed May 25 19:03:11 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3523B106566B; Wed, 25 May 2011 19:03:11 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id CC9898FC17; Wed, 25 May 2011 19:03:10 +0000 (UTC) Received: by gyg13 with SMTP id 13so4082819gyg.13 for ; Wed, 25 May 2011 12:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ag/0guOxoa5Do0k29gG/3XU8Gtu0r6GheQ/ld78rrf0=; b=NRYT5EcfNg9/ZFGzTdNHQ4xrIV/o8j/WLP4W5PIux/lOecKs5O5WP1WotqYTgTN2YS KOH1to79x7cQvYA/uFzwtKIiVgmRkWhwtU6TG011FhK5znsCQDgwc/U/jJ+Z9rYHfWdk 3L06lYcDEpH+Ek/ax36DsbkCqP7TZXmuvnnCQ= 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=bphQSTpX5MMEUq4xgTlWvF3vg1X/1e/7/0gOx2mdiTTaKv/tpBQLqG8eKcTdsrf6Ka GDTu15LJUSg0Y8CjJgGY5tOCIz7PWBw+ipuph5dShPkYTNR9rPy40UjpIerzD58lGe0v P8/sciHNqSauLsOtr/2WR4G3V6WXhr1nuogS8= Received: by 10.236.191.200 with SMTP id g48mr7003420yhn.437.1306350190030; Wed, 25 May 2011 12:03:10 -0700 (PDT) Received: from argus.electron-tube.net (desm-44-169.dsl.netins.net [167.142.44.169]) by mx.google.com with ESMTPS id f2sm79954ani.19.2011.05.25.12.02.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 12:03:08 -0700 (PDT) Message-ID: <4DDD5245.3040500@gmail.com> Date: Wed, 25 May 2011 14:02:29 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: Hans Petter Selasky References: <4DDC20DF.6060805@gmail.com> <201105242324.15541.hselasky@c2i.net> In-Reply-To: <201105242324.15541.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org, freebsd-usb@freebsd.org Subject: Re: traditional syscalls with DRIVER_MODULE ???? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 19:03:11 -0000 do start_read/stop_read and start_write/stop_write map directly to the userland read(2) and write(2) calls? i had looked at this previously, and am a bit confused on if the above is correct. even if they are the direct interface to read(2)/write(2), the issue of a poll method for select(2) still exists... grepping all DRIVER_MODULE usages comes up with only two poll methods: powerpc/powermac/pmu.c: DEVMETHOD(adb_hb_controller_poll, pmu_poll), powerpc/powermac/cuda.c: DEVMETHOD(adb_hb_controller_poll, cuda_poll), and those are unhelpful. usb_fifo_methods doesn't seem to have a poll, how would i go about this? select(2) is a more familiar interface for application programmers to use for this purpose, instead of using an ioctl for the same functionality in a way that is not compatible with select(2). please excuse me if these are newbie questions, but, i'm still in the learning process. i can do this if there is a way to prevent DRIVER_MODULE from creating the devfs nodes, and instead do this in a hybrid way using DRIVER_MODULE and make_dev(9), which has the exact traditional functionality i want in this. any ideas? two of the three device nodes this driver will create will require read(2)/select(2) interfaces visible to userland, and the third driver will require write(2) visible to userland. the question is: is there a way to use DRIVER_MODULE, which seems necessary for usbdi, yet create the devfs nodes using make_dev/cdevsw? i would prefer to not have DRIVER_MODULE create the device nodes. am i missing something? i again apologize for the newbie questions... jim Hans Petter Selasky wrote: > On Tuesday 24 May 2011 23:19:27 Jim Bryant wrote: > >> if i add such an interface to the current DRIVER_MODULE version, how >> would i go about NOT having DRIVER_MODULE create the devfs entries? i >> would prefer to have the devfs entries handled by make_dev, so to have >> access to the desired syscalls. >> > > Look at /sys/dev/usb/serial/ulpt.c > > For a simple example. > > More abstract: > > "cd /usr/ports/multimedia/cuse4bsd" and "man libusb20" > > --HPS > > From owner-freebsd-drivers@FreeBSD.ORG Wed May 25 19:24:07 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEB601065675; Wed, 25 May 2011 19:24:07 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 24D6B8FC13; Wed, 25 May 2011 19:24:07 +0000 (UTC) Received: by gwb15 with SMTP id 15so4096235gwb.13 for ; Wed, 25 May 2011 12:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=YdBIlbWLDQjLJ8jIiy0bWRC76QZo9Ol4iukwFiuQnSw=; b=ChOwkMfFGufTncGSiDvWc2eosYcC5mkSmORyo8di+9Gp5JfQZOgHCeyNxs5ql/VB+u RBAVsmdesVBwRo/GqS0tKMvjzyWKv7wGcf9+ZDmXiQSytPh8DWdTPUMLCLWxh+doopwy CWdAXKC8WEBRaQnfiIoqb8p30PmbTdl/H7Ivo= 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=eYZ9kWh+TLa3Nzf3hoX1tPskZrtTH2gGPop68Jj2SyYeZhHp60UCAsyKbgTQ4frVss lJOKoax3qSgLAuIUeTJ9xGwZRFv6/eCz7h7wTEJgYiM8onz97tcY4/4kPAh7pxJ7RIZS oG1tfDvIYLVkDE1VMgnbvpDezpnVZHZ1a72JE= Received: by 10.91.212.15 with SMTP id o15mr24120agq.189.1306351445559; Wed, 25 May 2011 12:24:05 -0700 (PDT) Received: from argus.electron-tube.net (desm-44-169.dsl.netins.net [167.142.44.169]) by mx.google.com with ESMTPS id i6sm92816anm.51.2011.05.25.12.23.55 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 12:24:04 -0700 (PDT) Message-ID: <4DDD5739.60600@gmail.com> Date: Wed, 25 May 2011 14:23:37 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: Dieter BSD References: <20110515162230.227510@gmx.com> In-Reply-To: <20110515162230.227510@gmx.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mav@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: Siis(4) does not play well with others! :-( X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 19:24:07 -0000 you have port multiplier working on that? i have a generic board (ebay from hong kong) that looks just like the siis reference board for that chip (1x pcie), and it IDs during probe/attach as not having port multiplier capability. does this capability only show if there is actually a port multiplier attached? i would have thought that it would show as a capability even without. also, i have a couple of WD Green (EADS) 2TB drives attached to mine without problem on an intel dq45ek mini-itx mobo (Core2 Duo E8200). i have an interest in the above question, as the goal for the mentioned box is to maintain it as the houshold server, and it's running out of space with six 2TB drives. on a side note, is there a way to do the equiv of atacontrol spindown on ahci? i get error messages on that command at startup now after switching to ahci a couple of months ago. this server will ultimately have 15 drives in it, and i really want spindown capability in ahci. jim Dieter BSD wrote: >> For now, I can only say that you are still running not the latest driver >> version. Latest have some delays reduced and report connect time in >> "us". May be some more of remaining could be replaced with interrupts >> (specifically on siis hardware), but I need to think and experiment more >> with it. >> > > I was able to swap cables and put that disk on the JMB363 controller. > (directly, no port multiplier) I now just get read errors from the disk > and a "error = 5" message from g_vfs_done(), but no messages from ahci(4) > at all, and no other problems. > > So much for testing the disk before putting it into service. I read the > entire disk, then wrote the entire disk with 0x00, 0xff, 0x55 and 0xaa, > reading it back each time into hexdump -C. Put it into service, and > after 82 GB of real data (on a 2 TB drive) it fails. grumble > > My todo list: > > 1) Build new kernel with the latest siis(4) and achi(4) bits. > > 2) Test if a read error causes achi(4) to lock out Ethernet for too long. > > 3) Test with achi(4) with and without a port multiplier. > > 3) Test with siis(4) with and without a port multiplier. > > >> Generally, the situation when the system doesn't reboot with the reset >> button doesn't smell good to me. >> > > FreeBSD does something that disables the soft power switch. I don't > recall if I've had problems with reset before. Stopping the PM LEDS > blinking but not doing a full reset seems pretty odd. Something > important must not be getting reset. I thought Tyan's mainboards were > supposed to be "tier 1". :-( > > I'm still puzzled that one Ethernet responded to ping but another did not. > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" > > From owner-freebsd-drivers@FreeBSD.ORG Wed May 25 19:32:39 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9672A1065673; Wed, 25 May 2011 19:32:39 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1652E8FC0C; Wed, 25 May 2011 19:32:37 +0000 (UTC) Received: by gwb15 with SMTP id 15so4100466gwb.13 for ; Wed, 25 May 2011 12:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=B5DJhMM9Xtg7+mDoD3K+4ucNdXCWoZokfsV6drfkR6s=; b=KQNSijYhGMA4JSPdmFunsBvlF8zaiZ5pwQIjEu3SGK6xhjZoq6oSm0f0bAlwWJeN43 52WhiPFGy2/AGZyIX1Ths2iVEosqArj2IZsecfkzruFvZlLcHg+cHsqkdI34j6XkUgSn cSKxL2xZCF32lEsFKQJSAiXTRZ/EOdVkZ54dQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=NtWIWTGnOEUSwSeLVqeU65px15/bDhL+9X2cn4BcdllY+aQEgK3OadK5+Tmoes8sY6 MWcEPHa0pdHxoc5MCCPvAxHylXh8LLLL0+O2WB2Uvz3CnH/+wBUNaFAwOfdvPmzW+E0P zlgeiFEhb6689QrPyAkVRVX5AytVrk/RVlJIw= Received: by 10.101.181.17 with SMTP id i17mr6511663anp.65.1306351957451; Wed, 25 May 2011 12:32:37 -0700 (PDT) Received: from argus.electron-tube.net (desm-44-169.dsl.netins.net [167.142.44.169]) by mx.google.com with ESMTPS id x33sm97437ana.22.2011.05.25.12.32.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 12:32:36 -0700 (PDT) Message-ID: <4DDD5934.2050404@gmail.com> Date: Wed, 25 May 2011 14:32:04 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-multimedia@freebsd.org, mav@freebsd.org, ariff@FreeBSD.org, sepotvin@videotron.ca Subject: hda sound driver request X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 19:32:39 -0000 i have a compaq (hp) presario c300 series laptop (with the 945gm chipset, not the 940) and a core2 duo t7600. it seems that the mute button used to work under fbsd7, but now it doesn't. the volume up/down buttons seem to work fine under x/kde. i have determined that the mute button will light up when ogain is muted (even though ogain has absolutely no function otherwise it seems). is there a way to tie ogain mute and main volume mute together so that they operate in tandem, to have normal functionality? i did notice that in the ac97 code, there seems to be something to this effect, and seemingly in particular for a hp laptop of similar vintage. i would do this myself, but i'm only just learning the driver interface, and in particular working on some usb projects that have been taking most of my available time for such things. thanks, jim From owner-freebsd-drivers@FreeBSD.ORG Wed May 25 19:34:41 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED7610656EA; Wed, 25 May 2011 19:34:41 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id 58EF28FC1A; Wed, 25 May 2011 19:34:39 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=EsGlCpMeIw85Gy1IHWHJoTo3ieATU4tNmYze/bSqBec= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=kWWxOIFCDSEA:10 a=WQU8e4WWZSUA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=zXwiK2_UkJisIPLbFaQA:9 a=Wyg7-9KaIBhVjG6LOEUA:7 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 131463937; Wed, 25 May 2011 21:34:37 +0200 From: Hans Petter Selasky To: Jim Bryant Date: Wed, 25 May 2011 21:33:23 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <4DDC20DF.6060805@gmail.com> <201105242324.15541.hselasky@c2i.net> <4DDD5245.3040500@gmail.com> In-Reply-To: <4DDD5245.3040500@gmail.com> 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: <201105252133.23321.hselasky@c2i.net> Cc: freebsd-drivers@freebsd.org, freebsd-usb@freebsd.org Subject: Re: traditional syscalls with DRIVER_MODULE ???? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 19:34:41 -0000 Hi, On Wednesday 25 May 2011 21:02:29 Jim Bryant wrote: > do start_read/stop_read and start_write/stop_write map directly to the > userland read(2) and write(2) calls? No, but they are called from these calls. The idea is that you use the FIFO mechanism already present there when moving data, and poll() will be automatically handled. Probably that is not suitable for your purpose? > i had looked at this previously, and am a bit confused on if the above > is correct. > > even if they are the direct interface to read(2)/write(2), the issue of > a poll method for select(2) still exists... > > grepping all DRIVER_MODULE usages comes up with only two poll methods: > > powerpc/powermac/pmu.c: DEVMETHOD(adb_hb_controller_poll, > pmu_poll), > powerpc/powermac/cuda.c: DEVMETHOD(adb_hb_controller_poll, > cuda_poll), > > and those are unhelpful. > > please excuse me if these are newbie questions, but, i'm still in the > learning process. It is OK to ask questions :-) > > i can do this if there is a way to prevent DRIVER_MODULE from creating > the devfs nodes, and instead do this in a hybrid way using DRIVER_MODULE > and make_dev(9), which has the exact traditional functionality i want in > this. any ideas? Why can't you create the node when you receive a device_attach event? > two of the three device nodes this driver will create > will require read(2)/select(2) interfaces visible to userland, and the > third driver will require write(2) visible to userland. > the question is: is there a way to use DRIVER_MODULE, which seems > necessary for usbdi, yet create the devfs nodes using make_dev/cdevsw? > i would prefer to not have DRIVER_MODULE create the device nodes. DRIVER_MODULE() only will create devices if you have a load function which does so. It is only called once! --HPS From owner-freebsd-drivers@FreeBSD.ORG Wed May 25 22:07:18 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E0221065672 for ; Wed, 25 May 2011 22:07:18 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A83EF8FC13 for ; Wed, 25 May 2011 22:07:17 +0000 (UTC) Received: by fxm11 with SMTP id 11so267525fxm.13 for ; Wed, 25 May 2011 15:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=4cgRPz8oATxCU3739wTPyrlAeKKtkf7or3pTlBUzS1c=; b=ZzyhhqsxHhR2MK3iyKY4pR67O1YH3ZqiewWSSX3+wKGb9p0D2ImrDjs04BaXEH+d2i TFQTH6OuAwtc+ekDlE0X21yHMkLquYluD7Zc1UVayJ7e555HZt8QpxD+TF8vyJjeKhLN xZ1dJHJ+HbGDWrl2rQcQhIF+i15N6zOBbuv0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=GZHkTtqvTCToimpjYhUg9USDUsFF0/2FCD90228dDH6muF9j3MpcBDqLZHwrwTn0wI h62dWUJUBHMclSLNqPNg5rn8REQOreAe8HK1EcGQNTBC/LQ9/qFnHKn801nXfIeZVCel bXZ6fgGURimTF4hWoAiY90hp1tsqcPGeoLBmM= Received: by 10.223.75.146 with SMTP id y18mr116970faj.61.1306361236283; Wed, 25 May 2011 15:07:16 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id m26sm30701fab.34.2011.05.25.15.07.14 (version=SSLv3 cipher=OTHER); Wed, 25 May 2011 15:07:15 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DDD7D7B.1000100@FreeBSD.org> Date: Thu, 26 May 2011 01:06:51 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Jim Bryant References: <20110515162230.227510@gmx.com> <4DDD5739.60600@gmail.com> In-Reply-To: <4DDD5739.60600@gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org, Dieter BSD Subject: Re: Siis(4) does not play well with others! :-( X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2011 22:07:18 -0000 Jim Bryant wrote: > you have port multiplier working on that? > > i have a generic board (ebay from hong kong) that looks just like the > siis reference board for that chip (1x pcie), and it IDs during > probe/attach as not having port multiplier capability. > > does this capability only show if there is actually a port multiplier > attached? i would have thought that it would show as a capability even > without. siis(4) hardware always supports port multipliers and FIS-based switching. > also, i have a couple of WD Green (EADS) 2TB drives attached to mine > without problem on an intel dq45ek mini-itx mobo (Core2 Duo E8200). > > i have an interest in the above question, as the goal for the mentioned > box is to maintain it as the houshold server, and it's running out of > space with six 2TB drives. > > on a side note, is there a way to do the equiv of atacontrol spindown on > ahci? i get error messages on that command at startup now after > switching to ahci a couple of months ago. this server will ultimately > have 15 drives in it, and i really want spindown capability in ahci. camcontrol idle/standby/sleep ... > Dieter BSD wrote: >>> For now, I can only say that you are still running not the latest driver >>> version. Latest have some delays reduced and report connect time in >>> "us". May be some more of remaining could be replaced with interrupts >>> (specifically on siis hardware), but I need to think and experiment more >>> with it. >>> >> >> I was able to swap cables and put that disk on the JMB363 controller. >> (directly, no port multiplier) I now just get read errors from the disk >> and a "error = 5" message from g_vfs_done(), but no messages from ahci(4) >> at all, and no other problems. >> >> So much for testing the disk before putting it into service. I read the >> entire disk, then wrote the entire disk with 0x00, 0xff, 0x55 and 0xaa, >> reading it back each time into hexdump -C. Put it into service, and >> after 82 GB of real data (on a 2 TB drive) it fails. grumble >> >> My todo list: >> >> 1) Build new kernel with the latest siis(4) and achi(4) bits. >> >> 2) Test if a read error causes achi(4) to lock out Ethernet for too long. >> >> 3) Test with achi(4) with and without a port multiplier. >> >> 3) Test with siis(4) with and without a port multiplier. >> >> >>> Generally, the situation when the system doesn't reboot with the reset >>> button doesn't smell good to me. >>> >> >> FreeBSD does something that disables the soft power switch. I don't >> recall if I've had problems with reset before. Stopping the PM LEDS >> blinking but not doing a full reset seems pretty odd. Something >> important must not be getting reset. I thought Tyan's mainboards were >> supposed to be "tier 1". :-( >> >> I'm still puzzled that one Ethernet responded to ping but another did >> not. -- Alexander Motin From owner-freebsd-drivers@FreeBSD.ORG Thu May 26 21:28:42 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D66F2106564A; Thu, 26 May 2011 21:28:42 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 430608FC16; Thu, 26 May 2011 21:28:41 +0000 (UTC) Received: by gwb15 with SMTP id 15so612796gwb.13 for ; Thu, 26 May 2011 14:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=sMXIGAQYRZcqj6EJbh+QDc3mUdIlZlOW/hxvI222B68=; b=MWcfm5XbcCbfs01g4DjRDN5nJf9Tp1Y45h0PNfjCk5Ceco2CwI9kBbjOFMOiklyemw kuUGRpl2A23aHFr+/VT/Hi7D3mkHrN0l2sOTpXEwIa6Dp+686hiYaYZgw2/zD7CPWFEG M51lkA86DxlnC8gZiwWdxQJrbC9lbqsd9RBTA= 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=JYP/TLktpP7eTBavGy8IyKgiLmSQPfX81UnQhiKoDnRncfqgeCOyYuc5Wt6bjKK+dZ eVAqxGxy0GkhnzXO+qGKa9lzKIq12BGJifwiaIfBM7KuH17yiKOerFI/f8NDI3LK0ORV P0trcT9jlC1wupphWUv8w9QTH6bO3kUQl6/JM= Received: by 10.146.248.19 with SMTP id v19mr1336053yah.25.1306445321351; Thu, 26 May 2011 14:28:41 -0700 (PDT) Received: from argus.electron-tube.net (desm-44-169.dsl.netins.net [167.142.44.169]) by mx.google.com with ESMTPS id b25sm955071anb.46.2011.05.26.14.28.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2011 14:28:40 -0700 (PDT) Message-ID: <4DDD7ED9.90500@gmail.com> Date: Wed, 25 May 2011 17:12:41 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: Hans Petter Selasky References: <4DDC20DF.6060805@gmail.com> <201105242324.15541.hselasky@c2i.net> <4DDD5245.3040500@gmail.com> <201105252133.23321.hselasky@c2i.net> In-Reply-To: <201105252133.23321.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org, freebsd-usb@freebsd.org Subject: Re: traditional syscalls with DRIVER_MODULE ???? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 21:28:43 -0000 excuse me while i pull my head out of my posterior... yup. it wasn't DRIVER_MODULE() doing it... it was the usb_fifo_attach.... i think i'm back on the right track now... thanks for pointing me in the right direction. Hans Petter Selasky wrote: > Hi, > > On Wednesday 25 May 2011 21:02:29 Jim Bryant wrote: > >> do start_read/stop_read and start_write/stop_write map directly to the >> userland read(2) and write(2) calls? >> > > No, but they are called from these calls. The idea is that you use the FIFO > mechanism already present there when moving data, and poll() will be > automatically handled. Probably that is not suitable for your purpose? > > >> i had looked at this previously, and am a bit confused on if the above >> is correct. >> >> even if they are the direct interface to read(2)/write(2), the issue of >> a poll method for select(2) still exists... >> >> grepping all DRIVER_MODULE usages comes up with only two poll methods: >> >> powerpc/powermac/pmu.c: DEVMETHOD(adb_hb_controller_poll, >> pmu_poll), >> powerpc/powermac/cuda.c: DEVMETHOD(adb_hb_controller_poll, >> cuda_poll), >> >> and those are unhelpful. >> >> > > >> please excuse me if these are newbie questions, but, i'm still in the >> learning process. >> > > It is OK to ask questions :-) > > >> i can do this if there is a way to prevent DRIVER_MODULE from creating >> the devfs nodes, and instead do this in a hybrid way using DRIVER_MODULE >> and make_dev(9), which has the exact traditional functionality i want in >> this. any ideas? >> > > Why can't you create the node when you receive a device_attach event? > > >> two of the three device nodes this driver will create >> will require read(2)/select(2) interfaces visible to userland, and the >> third driver will require write(2) visible to userland. >> > > >> the question is: is there a way to use DRIVER_MODULE, which seems >> necessary for usbdi, yet create the devfs nodes using make_dev/cdevsw? >> i would prefer to not have DRIVER_MODULE create the device nodes. >> > > DRIVER_MODULE() only will create devices if you have a load function which > does so. It is only called once! > > --HPS > > From owner-freebsd-drivers@FreeBSD.ORG Thu May 26 21:31:10 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 105EE106564A; Thu, 26 May 2011 21:31:10 +0000 (UTC) (envelope-from kc5vdj.freebsd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9A38FC1A; Thu, 26 May 2011 21:31:09 +0000 (UTC) Received: by gwb15 with SMTP id 15so613904gwb.13 for ; Thu, 26 May 2011 14:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=+TpXkIDidrGyLgdDl//By0qyVq/61u9uHLcqJ3lcpTc=; b=I7IHjRYoeC3HnV4gK6JT6G1O01Vnw4yJl7fpQGn11wngJOgfsCshp96qrtCgU/KdMK J1d+QXUGEYWW9nv94NVMWGnhK6oRtVOU3NAp/0qzIm1q8nKY0M1UXhOaZDtv1m7EAFef OTLcDFeCqc/wyPfTD9SDFbQbWslhJmGX7zNhg= 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=u2UjQsyI1GQ83miIyOpMzojr0kDlIIWKIGuYL3UjroKYhXHpaL6Sf3kNEnRfKBvqTE O/O87wbtWqAnBLpcnuoi7Av5eVok+5CUkvc0wWbMwzXEanaSkGIbbRwoHn+vx7nSFa4m Ne3T42oRFbXG9TuWSSEqNloDDpv3Mv/mRh1dg= Received: by 10.90.249.27 with SMTP id w27mr1422263agh.139.1306445469125; Thu, 26 May 2011 14:31:09 -0700 (PDT) Received: from argus.electron-tube.net (desm-44-169.dsl.netins.net [167.142.44.169]) by mx.google.com with ESMTPS id x37sm955846ana.26.2011.05.26.14.31.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2011 14:31:08 -0700 (PDT) Message-ID: <4DDEC692.80706@gmail.com> Date: Thu, 26 May 2011 16:30:58 -0500 From: Jim Bryant User-Agent: Thunderbird 2.0.0.24 (X11/20100911) MIME-Version: 1.0 To: Alexander Motin References: <20110515162230.227510@gmx.com> <4DDD5739.60600@gmail.com> <4DDD7D7B.1000100@FreeBSD.org> In-Reply-To: <4DDD7D7B.1000100@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org, Dieter BSD Subject: Re: Siis(4) does not play well with others! :-( X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2011 21:31:10 -0000 thanks! Alexander Motin wrote: > >> on a side note, is there a way to do the equiv of atacontrol spindown on >> ahci? i get error messages on that command at startup now after >> switching to ahci a couple of months ago. this server will ultimately >> have 15 drives in it, and i really want spindown capability in ahci. >> > > camcontrol idle/standby/sleep ... > > >