From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 24 01:48:58 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E485416A41F for ; Mon, 24 Oct 2005 01:48:58 +0000 (GMT) (envelope-from jason.harmening@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F27443D46 for ; Mon, 24 Oct 2005 01:48:58 +0000 (GMT) (envelope-from jason.harmening@gmail.com) Received: by zproxy.gmail.com with SMTP id 40so539876nzk for ; Sun, 23 Oct 2005 18:48:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:to:subject:date:user-agent:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:from; b=BUWnSzNYDsqA00GLUqp3ScLcirxYv7sSt18CwGjcRD6TI8UIU1rTO5T5HY3a8hurOp7KcPM8eviQJX3xQv4MrwcSQDS0zMMW9wZVV5W4ecTvtiV7GgH3mGqdFp3YT0IdzOpfqktmYgxWbVzxEc3Wzv3vH2rr/ON3fsN3afO4URQ= Received: by 10.37.13.79 with SMTP id q79mr5876045nzi; Sun, 23 Oct 2005 18:48:57 -0700 (PDT) Received: from ?192.168.0.3? ( [70.112.17.171]) by mx.gmail.com with ESMTP id 18sm3576722nzo.2005.10.23.18.48.55; Sun, 23 Oct 2005 18:48:57 -0700 (PDT) To: freebsd-hackers@freebsd.org Date: Sun, 23 Oct 2005 20:49:16 -0500 User-Agent: KMail/1.8.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510232049.16352.Jason.Harmening@gmail.com> From: Jason Harmening X-Mailman-Approved-At: Mon, 24 Oct 2005 13:48:03 +0000 Subject: Native ATAPI MO driver 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: Mon, 24 Oct 2005 01:48:59 -0000 Hi, I have a 2.3G Fujitsu MO drive, and I've gotten tired of using atapicam to access it. I'm thinking of writing a native ATAPI driver that could be added to the kernel through a configuration line like: device atapimo I've been doing a little work to see how feasible this is--the kernel already defines the ATA_ATAPI_TYPE_OPTICAL device type that is received from my drive during probing. But ATA_ATAPI_TYPE_OPTICAL isn't actually used anywhere, and there is no driver that can actually recognize and attach to an ATAPI MO drive. I modified the atapifd driver (src/sys/dev/ata/atapi-fd.c) to also recognize ATA_ATAPI_TYPE_OPTICAL, and my drive was actually recognized during probing as afd0, but afd_attach returned an error. It looks as if afd_sense() was failing, which I'm guessing is because ATAPI MO drives (or mine, at least) use a different capabilities page code and/or capabilities page structure than ATAPI floppies. The atapi-fd driver uses 0x5 for its "Capabilities and Mechanical Status" page code, while everything else (atapi-cd, atapi-tape) uses 0x2a. All three drivers have distinctly different structures for this page. So I'm wondering: do ATAPI MO drives use a capabilities page code/structure more like CD/DVD drives, or do they have their own unique ATAPI page structure? If so, where can I find a document outlining the structure? I've found loads of documents detailing the page structure for CD/DVD drives, but nothing for MO drives (or floppies or tape drives for that matter). Also, beyond the capabilities page, are there any other special considerations I'd need to make for an MO driver? Any answers would be really awesome. Thanks, Jason Harmening