From arg@arg1.demon.co.uk  Sun Jul  1 12:09:02 2001
Return-Path: <arg@arg1.demon.co.uk>
Received: from arg1.demon.co.uk (arg1.demon.co.uk [194.222.34.166])
	by hub.freebsd.org (Postfix) with ESMTP id 08F4D37B405
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  1 Jul 2001 12:09:02 -0700 (PDT)
	(envelope-from arg@arg1.demon.co.uk)
Received: by arg1.demon.co.uk (Postfix, from userid 300)
	id 1118C9B03; Sun,  1 Jul 2001 20:08:57 +0100 (BST)
Message-Id: <20010701190857.1118C9B03@arg1.demon.co.uk>
Date: Sun,  1 Jul 2001 20:08:57 +0100 (BST)
From: arg@arg1.demon.co.uk
Reply-To: arg@arg1.demon.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: DVD_REPORT_RPC/DVD_SEND_RPC in ATAPI driver
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28604
>Category:       kern
>Synopsis:       DVD_REPORT_RPC/DVD_SEND_RPC in ATAPI driver
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 01 12:10:02 PDT 2001
>Closed-Date:    Thu Sep 6 01:52:58 PDT 2001
>Last-Modified:  Thu Sep 06 01:53:31 PDT 2001
>Originator:     Andrew Gordon
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD server.arg.sj.co.uk 4.3-STABLE FreeBSD 4.3-STABLE #12: Thu May 24 01:04:11 BST 2001 arg@server.arg.sj.co.uk:/usr/src/sys/compile/SERVER i386


>Description:
	The implementation DVD_REPORT_RPC/DVD_SEND_RPC ioctls in the
	atapi-cd driver is incomplete: it performs the correct
	operations on the drive, but fails to pass the parameter to/from
	user space, making the call useless. 

	[Note: these are the ioctls used to set/read the region code on
	a DVD drive - necessary to initialise an 'out of the box' drive
	to allow region-specific DVDs to be played]

	The equivalent ioctls in the CAM cd driver were fixed a while ago.
>How-To-Repeat:
	A small program to exercise these calls can be found at.
	 http://www.arg1.demon.co.uk/freebsd.html
>Fix:

Index: dev/ata/atapi-cd.c
===================================================================
RCS file: /repository/src/sys/dev/ata/atapi-cd.c,v
retrieving revision 1.48.2.10
diff -u -r1.48.2.10 atapi-cd.c
--- dev/ata/atapi-cd.c  2001/02/25 21:35:20     1.48.2.10
+++ dev/ata/atapi-cd.c  2001/07/01 19:02:32
@@ -1584,6 +1584,8 @@
        ai->reg_type = (d.data[0] >> 6);
        ai->vend_rsts = (d.data[0] >> 3) & 0x7;
        ai->user_rsts = d.data[0] & 0x7;
+       ai->region = d.data[1];
+       ai->rpc_scheme = d.data[2];
        break;
     
     case DVD_INVALIDATE_AGID:
@@ -1620,6 +1622,7 @@
        break;
     
     case DVD_SEND_RPC:
+       d.data[0] = ai->region;
        length = 8;
        break;
 

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: brooks 
Responsible-Changed-When: Wed Sep 5 17:33:35 PDT 2001 
Responsible-Changed-Why:  
sos is Mr. ATA.  FWIW, I've had these patches in my tree for quite a 
while and did use them to set the region on a DVD-ROM drive once. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28604 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Thu Sep 6 01:52:58 PDT 2001 
State-Changed-Why:  
Committed to -current. MFC will follow. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28604 
>Unformatted:
