Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HDwzW-00029j-Hn for qemu-devel@nongnu.org; Mon, 05 Feb 2007 01:06:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HDwzT-00029X-Sb for qemu-devel@nongnu.org; Mon, 05 Feb 2007 01:06:12 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HDwzT-00029U-KE for qemu-devel@nongnu.org; Mon, 05 Feb 2007 01:06:11 -0500 Received: from ug-out-1314.google.com ([66.249.92.173]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HDwzT-0006Ya-4m for qemu-devel@nongnu.org; Mon, 05 Feb 2007 01:06:11 -0500 Received: by ug-out-1314.google.com with SMTP id j40so1191448ugd for ; Sun, 04 Feb 2007 22:06:10 -0800 (PST) Message-ID: <9cfa10eb0702042206mcbe91a8l7d513f60c059627f@mail.gmail.com> Date: Mon, 5 Feb 2007 08:06:07 +0200 From: "Marko Kohtala" Subject: Re: [Qemu-devel] [PATCH] parport EPP support for Linux MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fabrice@bellard.org Cc: qemu-devel@nongnu.org Fabrice Bellard: >Marko Kohtala wrote: > > Hi. > > With the attached patch I am able to use Kodak Advantix FD 300 APS > scanner from Win98 when hosted under Linux ix86. It adds EPP support > and fixes some register bits to match real hw so port identification > works better. > > I tried to separate the linux dependencies with #ifdef __linux__, but > can not test this does not break compilation for other ports of qemu. > >I don't understand why you need a #ifdef __linux__ in parallel.c. Normally, the qemu >character device should suffice to do the appropriate abstraction. I did not find appropriate abstraction. Linux parallel device needs to do a read() on the device. A read() on the parallel port device executes EPP read cycle on the parallel port to read from the device attached to it. Poll() does not execute such cycles, but it only signals read if the port makes an interrupt, and therefore the current poll() based character device abstraction does not work. So there are few read() and write() calls in the code. Also the parallel port device IEEE mode settings use some constants from linux/parport.h. These are needed to tell the device execute EPP data or address cycles on reads and writes. I am too new with qemu to say how to develop the qemu character device abstraction for these requirements. Marko