From owner-freebsd-drivers@FreeBSD.ORG Sun Jun 3 03:37:02 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95DE216A46B for ; Sun, 3 Jun 2007 03:37:02 +0000 (UTC) (envelope-from nslay@comcast.net) Received: from alnrmhc14.comcast.net (alnrmhc14.comcast.net [204.127.225.94]) by mx1.freebsd.org (Postfix) with ESMTP id 6438A13C46A for ; Sun, 3 Jun 2007 03:37:02 +0000 (UTC) (envelope-from nslay@comcast.net) Received: from lightbulb.local (c-68-35-224-189.hsd1.fl.comcast.net[68.35.224.189]) by comcast.net (alnrmhc14) with ESMTP id <20070603032559b140040e05e>; Sun, 3 Jun 2007 03:26:00 +0000 Message-ID: <4662348F.4060306@comcast.net> Date: Sat, 02 Jun 2007 23:25:03 -0400 From: Nathan Lay User-Agent: Thunderbird 2.0.0.0 (X11/20070522) MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: multipart/mixed; boundary="------------040503000102060204010206" Subject: Microsoft Wireless Notebook Presenter Mouse (patch) 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: Sun, 03 Jun 2007 03:37:02 -0000 This is a multi-part message in MIME format. --------------040503000102060204010206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi everyone, I got this wireless mouse for free from a friend and noticed it didn't work with ums. The mouse uses a bluetooth dongle, but the dongle can also impersonate a USB hub with the mouse plugged in, however the mouse's usage flags are HUP_CONSUMER and HUG_POINTER instead of the usage flags ums expects HUP_GENERIC_DESKTOP and HUG_MOUSE. The mouse also lies about the bit positions of the X, Y, Z, T and 5 buttons, and the size of the ibuf. I created a patch for sys/dev/usb/ums.c and sys/dev/usb/usbdevs Anyway I can make this patch better? cd /usr/src patch < /path/to/ums.c.patch patch < /path/to/usbdevs.patch Best Regards, Nathan Lay --------------040503000102060204010206 Content-Type: text/plain; name="ums.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ums.c.patch" *** sys/dev/usb/ums.c Mon Feb 6 15:29:17 2006 --- /root/ums.c Sat Jun 2 22:41:10 2007 *************** *** 195,198 **** --- 195,204 ---- ret = UMATCH_NONE; + /* Odd usage flags in Presenter mice! */ + if (hid_is_collection(desc, size, HID_USAGE2(HUP_CONSUMER, HUG_POINTER))) + ret = UMATCH_IFACECLASS; + else + ret = UMATCH_NONE; + free(desc, M_TEMP); return (ret); *************** *** 313,317 **** --- 319,342 ---- hid_input, &sc->sc_loc_btn[i-1], 0); + sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid); + + /* Mouse quirks, add here! */ + switch ( uaa->product ) { + case USB_PRODUCT_MICROSOFT_PRESENTER: + /* This mouse lies about its buttons and x,y,z positions * Offset by 16 instead of 8 because of UMS_T *ibuff++ thingy + */ + /* XXX Not sure if UMS_T is on all Presenter mice! */ + sc->sc_loc_x.pos -= 16; + sc->sc_loc_y.pos -= 16; + sc->sc_loc_z.pos -= 16; + sc->sc_loc_t.pos -= 16; + for (i = 1; i <= sc->nbuttons; i++ ) sc->sc_loc_btn[i-1].pos -= 16; + /* This mouse also lies about the size! */ + sc->sc_isize = 6; + break; + } + + sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT); if (!sc->sc_ibuf) { --------------040503000102060204010206 Content-Type: text/plain; name="usbdevs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="usbdevs.patch" *** sys/dev/usb/usbdevs Tue Nov 14 07:54:38 2006 --- /root/usbdevs Sat Jun 2 22:48:52 2007 *************** *** 1250,1253 **** --- 1250,1254 ---- product MICROSOFT INETPRO2 0x002b Internet Keyboard Pro product MICROSOFT MN110 0x007a 10/100 USB NIC + product MICROSOFT PRESENTER 0x0713 Microsoft Wireless Presenter Mouse /* Microtech products */ --------------040503000102060204010206-- From owner-freebsd-drivers@FreeBSD.ORG Mon Jun 4 11:05:25 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02E5316A400 for ; Mon, 4 Jun 2007 11:05:25 +0000 (UTC) (envelope-from conrads@cox.net) Received: from eastrmmtai110.cox.net (eastrmmtai110.cox.net [68.230.240.29]) by mx1.freebsd.org (Postfix) with ESMTP id 492CC13C45B for ; Mon, 4 Jun 2007 11:05:24 +0000 (UTC) (envelope-from conrads@cox.net) Received: from eastrmimpo01.cox.net ([68.1.16.119]) by eastrmmtao106.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20070604101653.HFKC8257.eastrmmtao106.cox.net@eastrmimpo01.cox.net> for ; Mon, 4 Jun 2007 06:16:53 -0400 Received: from serene.no-ip.org ([72.200.17.85]) by eastrmimpo01.cox.net with bizsmtp id 7NGU1X0081q7YRk0000000; Mon, 04 Jun 2007 06:16:53 -0400 Received: from serene.no-ip.org (localhost [127.0.0.1]) by serene.no-ip.org (8.14.1/8.14.1) with ESMTP id l54AG6A2043814 for ; Mon, 4 Jun 2007 05:16:06 -0500 (CDT) (envelope-from conrads@cox.net) Message-Id: <200706041016.l54AG6A2043814@serene.no-ip.org> Date: Mon, 4 Jun 2007 05:15:56 -0500 From: "Conrad J. Sabatier" To: freebsd-drivers@FreeBSD.org X-Mailer: Claws Mail 2.9.2 (GTK+ 2.10.12; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Subject: What's the latest news on nVidia amd64 driver support? 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: Mon, 04 Jun 2007 11:05:25 -0000 I was recently browsing the nVidia site, and noticed that the last significant info posting re: FreeBSD support for the nVidia video driver was just about a year ago. Just wondering what sort of progress has been made since then. Thanks! -- Conrad J. Sabatier From owner-freebsd-drivers@FreeBSD.ORG Mon Jun 4 11:45:54 2007 Return-Path: X-Original-To: freebsd-drivers@FreeBSD.org Delivered-To: freebsd-drivers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78E2316A468 for ; Mon, 4 Jun 2007 11:45:54 +0000 (UTC) (envelope-from stefan.lambrev@sun-fish.com) Received: from blah.sun-fish.com (blah.sun-fish.com [217.18.249.150]) by mx1.freebsd.org (Postfix) with ESMTP id 3510313C43E for ; Mon, 4 Jun 2007 11:45:54 +0000 (UTC) (envelope-from stefan.lambrev@sun-fish.com) Received: from blah.sun-fish.com (localhost [127.0.0.1]) by blah.sun-fish.com (Postfix) with ESMTP id E23F51B10EF3; Mon, 4 Jun 2007 13:28:37 +0200 (CEST) Received: from hater.cmotd.com (hater.cmotd.com [192.168.3.125]) by blah.sun-fish.com (Postfix) with ESMTP id DE7331B10EF2; Mon, 4 Jun 2007 13:28:37 +0200 (CEST) Message-ID: <4663F765.50104@sun-fish.com> Date: Mon, 04 Jun 2007 14:28:37 +0300 From: Stefan Lambrev User-Agent: Thunderbird 2.0.0.0 (X11/20070521) MIME-Version: 1.0 To: "Conrad J. Sabatier" References: <200706041016.l54AG6A2043814@serene.no-ip.org> In-Reply-To: <200706041016.l54AG6A2043814@serene.no-ip.org> Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP on BLAH Cc: freebsd-drivers@FreeBSD.org Subject: Re: What's the latest news on nVidia amd64 driver support? 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: Mon, 04 Jun 2007 11:45:54 -0000 Hi all, Conrad J. Sabatier wrote: > I was recently browsing the nVidia site, and noticed that the last > significant info posting re: FreeBSD support for the nVidia video > driver was just about a year ago. > > Just wondering what sort of progress has been made since then. > > Thanks! > > I was wondering the same :) as FreeBSD 7 release is on its way. But I wasn't sure about the proper mail list as this driver was mostly discussed in multimedia@ and hackers@ :) What I read on forums is from 03-05-07 - posted by zander, one of the main developers of this driver for freebsd (?) : "To the best of my knowledge, the various obstacles still stand, e.g. the pmap_change_attr() interface doesn't handle large pages on FreeBSD/amd64 and the mmap() character driver callback doesn't allow drivers to specify a memory type for the mapping. As to device cloning, it unfortunately turned out to be too immature to support; it doesn't block a FreeBSD/amd64 port, though." But from what I know - http://freshbsd.org/2007/05/02/19/42/47 this is already done? I really hope that we will have driver for freebsd 6.3 or freebsd 7.0 :) -- Best Wishes, Stefan Lambrev ICQ# 24134177 From owner-freebsd-drivers@FreeBSD.ORG Mon Jun 4 11:55:05 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43D2016A46C for ; Mon, 4 Jun 2007 11:55:05 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by mx1.freebsd.org (Postfix) with ESMTP id C17B313C46C for ; Mon, 4 Jun 2007 11:55:04 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: by py-out-1112.google.com with SMTP id a29so2334941pyi for ; Mon, 04 Jun 2007 04:55:04 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=lXCTmSkmb2LE+NujmnAmOE429JlFCBkXeg+OT0oWo2ur+2augZDYIFHX/ZuLpvqPEE6unsBctqcYbOshalAoyttho46jJswU0MWALX8y1shexaWZsIXKVCp/kiFLQWDgYmgj8dM6mEUeupRrpLS0o+vPD343aY7o1oOmTNwUl8I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=VVcH0SI/tI6SVwlh24Qf0b8vdTzVNThRAcQDR0UntZUV8ULiRk2eAm41n+5x8xVbnoh+1nKzmT1s9tqm7vQuH0PWKsKU5IAOtG3kmcB5gMY3JKRj1DKkHkJNzXKgBL/cxFM5NAnxnA9ypSMhqEBizAfTeTReeTdjCzKDl9JrEdc= Received: by 10.64.131.17 with SMTP id e17mr6707881qbd.1180958104022; Mon, 04 Jun 2007 04:55:04 -0700 (PDT) Received: by 10.64.181.10 with HTTP; Mon, 4 Jun 2007 04:55:03 -0700 (PDT) Message-ID: <5bf3e10d0706040455j2015a2dan685e7e80db66bd95@mail.gmail.com> Date: Mon, 4 Jun 2007 13:55:03 +0200 From: "Die Gestalt" To: freebsd-drivers@freebsd.org In-Reply-To: <5bf3e10d0706010709yab08f21s256cb894118d3bf4@mail.gmail.com> MIME-Version: 1.0 References: <5bf3e10d0705150724q3f0fd25fq89094bd02d8f9d29@mail.gmail.com> <86veetgnk4.fsf@dwp.des.no> <5bf3e10d0705210744s119d1c5cpc20ab1036e9f98ff@mail.gmail.com> <5bf3e10d0705221130t222b80b5w64a4e446b04d6029@mail.gmail.com> <863b1nvqqa.fsf@dwp.des.no> <5bf3e10d0705230314w3038a532uf0d8c0ed18a5d05f@mail.gmail.com> <5bf3e10d0705240839x17792a96hf17e6eebfa5a83da@mail.gmail.com> <5bf3e10d0705241345t11e739we0b896bab868fec6@mail.gmail.com> <5bf3e10d0706010709yab08f21s256cb894118d3bf4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: Generic int 13h driver 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: Mon, 04 Jun 2007 11:55:05 -0000 Problem understood. What happens is that for reading the BIOS writes at the physical address and not the virtual address, and the virtual translation doesn't occur in this case since the write doesn't come from the CPU. I don't get why it works with writing though, maybe the BIOS uses DMA only for reading? My buffer is therefore never written but physical memory get happilly overwritten (omg!!). Unfortunately I cannot manage to allocate physical memory below 1 MB by the time I load my driver. bus_dmamem_alloc fails as well as contigalloc (on which bus_dmamem_alloc is based anyways). Any clue? Should I add some code in the booting process to reserve few chunks below 1 MB for me? Is the dark side stronger? Another question, is there anyway I can know if the BIOS is using DMA or not? Obviously in one case I need to give a physical address and the other case virtual address. When this is fixed I will have a fully working int13h driver. w00t. On 6/1/07, Die Gestalt wrote: > > Hi me again... ;) > > Well now I correctly hook the interrupts, they are correctly reflected > back to the BIOS and I can write to the disk without a problem. When DMA is > on, however, reading fails (it works when DMA is off in the BIOS). This is > obviously a DMA problem and for some reason the machine does not read the > correct page value. > > The problem is that the Virtual 8086 monitor makes an "invalidate page" > call when the operation is finished and my buffers are loaded into a DMA > mapping and I do the proper pre/post synchronization, I've even tried with > reversed sync in case I got it wrong. > > I think the problem is a lack of understanding on my side about how DMA > works in FreeBSD. What I do is I have a parent tag and two child tags (one > for reading the other for writing), I do : > > bus_dma_tag_create -> bus_dmamap_create > > Later I do contigmalloc of my buffer and I load this buffer with bus_dmamap_load. > I do bus_dmamap_sync before and after the call the BIOS. > > The writes are succesfull but the read buffer is left untouched. What do I > do wrong? What is the exact use of the callback? > > Thanks for any hint. > > From owner-freebsd-drivers@FreeBSD.ORG Mon Jun 4 20:15:30 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C95EB16A46B for ; Mon, 4 Jun 2007 20:15:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 719CE13C45D for ; Mon, 4 Jun 2007 20:15:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l54JdeeM021508; Mon, 4 Jun 2007 15:39:40 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Mon, 4 Jun 2007 14:26:00 -0400 User-Agent: KMail/1.9.6 References: <200706041016.l54AG6A2043814@serene.no-ip.org> <4663F765.50104@sun-fish.com> In-Reply-To: <4663F765.50104@sun-fish.com> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706041426.01179.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 04 Jun 2007 15:39:41 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3349/Mon Jun 4 10:32:21 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Stefan Lambrev Subject: Re: What's the latest news on nVidia amd64 driver support? 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: Mon, 04 Jun 2007 20:15:30 -0000 On Monday 04 June 2007 07:28:37 am Stefan Lambrev wrote: > Hi all, > > Conrad J. Sabatier wrote: > > I was recently browsing the nVidia site, and noticed that the last > > significant info posting re: FreeBSD support for the nVidia video > > driver was just about a year ago. > > > > Just wondering what sort of progress has been made since then. > > > > Thanks! > > > > > I was wondering the same :) as FreeBSD 7 release is on its way. > But I wasn't sure about the proper mail list as this driver was mostly > discussed in multimedia@ and hackers@ :) > > What I read on forums is from 03-05-07 - posted by zander, one of the > main developers of this driver for freebsd (?) : > > "To the best of my knowledge, the various obstacles still stand, e.g. > the pmap_change_attr() interface doesn't handle > large pages on FreeBSD/amd64 and the mmap() character driver callback > doesn't allow drivers to specify a memory > type for the mapping. As to device cloning, it unfortunately turned out > to be too immature to support; it doesn't block > a FreeBSD/amd64 port, though." > > But from what I know - http://freshbsd.org/2007/05/02/19/42/47 this is > already done? > > I really hope that we will have driver for freebsd 6.3 or freebsd 7.0 :) No, the current PAT stuff still has the limitations Zander has indicated. -- John Baldwin