lkml.org 
[lkml]   [1998]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: (fwd) DVD Progress and Information
Date
From
 .........----------------==================----
..--==- Tue, 15 Sep 1998 23:50:08 +0200 (MET DST),
..--==- Joerg Schilling (JS) discussed:

)) Does anyone know if DVD-ioctls are standardized under Unix? My
)) impression is that they aren't yet, but if so, any pointers would
)) be appreciated. I've created a reasonable standard and
)) implementation. When I get a web page ready in a few days and
)) clean stuff up a bit, I'll put the patches and stuff there for the
)) following stuff.

JS) Solaris 2.7 does not have (will not have DVD support ;-) but 2.8
JS) will do. Unfortunaetly 2.7 is currently in beta so I expect the
JS) 2.8 beta to be available ~ april 1999.

)) I've extended cdrom.h for 3 new DVD-related ioctls, and modified
)) cdrom.[ch] and ide-cd.[ch] for DVDs (note for ide-cd, if the drive
)) isn't a DVD device (CD) they will gracefully return EINVAL). They
)) worked fine before as ATAPI CD devices, but you couldn't do DVD
)) specific things (naturally).

)) I've modifed cdrom and ide-cd to detect if the drive is a DVD-ROM
)) or DVD-RAM, and have implemented the following ioctls for DVDs,
)) based on the recent MMC-2 C/DVD packet command interface:

)) The DVD_READ_STRUCT lets you obtain info for the following items:

)) #define DVD_READ_STRUCT 0x5390 /* read DVD structures */

JS) How do you define the interface to set the structure # ? Which
JS) structure #'s do you support ?

I created the following interface which I've implemented for the Linux
IDE CD-ROM driver. I have no idea what the future Solaris interface
is, but using the same interface is a good idea. Pertinent
information and my latest patch with the Linux IDE driver
implementation for 2.1.121 is here,
http://www.rpi.edu/~veliaa/linux-dvd.

At the moment I'm still trying to get info on the C-Cube Ziva DS
chipset on the Creative card on how to initialize the MPEG decoder,
upload the microcode and get/send the CSS keys, since the DVD decoder
driver can just use the same or similar interface to the following to
do authentication and key transfer (so it will act as an independent
arbiter).

/*
* DVD-ROM specific ioctls
*/
#define DVD_READ_STRUCT 0x5390 /* read DVD structures */
#define DVD_REPORT_KEY 0x5391 /* DVD CSS key reporting */
#define DVD_SEND_KEY 0x5392 /* DVD CSS key sending */

.....

/*******************************************************
* DVD-ROM IOCTL structures
*******************************************************/

/* This is used with the DVD_READ_STRUCT ioctl */
#define DVD_STRUCT_PHYSICAL 0x00
#define DVD_STRUCT_COPYRIGHT 0x01
#define DVD_STRUCT_DISCKEY 0x02
#define DVD_STRUCT_BCA 0x03
#define DVD_STRUCT_MANUFACT 0x04
union dvd_read_struct {
u_char type;
struct {
u_char type;
u_char layer_num;
struct dvd_layer {
unsigned book_version : 4;
unsigned book_type : 4;
unsigned min_rate : 4;
unsigned disc_size : 4;
unsigned layer_type : 4;
unsigned track_path : 1;
unsigned nlayers : 2;
unsigned track_density : 4;
unsigned linear_density : 4;
unsigned bca : 1;
unsigned start_sector;
unsigned end_sector;
unsigned end_sector_l0;
} layer[4];
} physical;
struct {
u_char type;
u_char layer_num;
u_char cpst;
u_char rmi;
} copyright;
struct {
u_char type;
unsigned agid : 2;
u_char value[2048];
} disckey;
struct {
u_char type;
int len;
u_char value[188];
} bca;
struct {
u_char type;
u_char layer_num;
int len;
u_char value[2048];
} manufact;
};

/* Key invalidation for DVD_REPORT_KEY and DVD_SEND_KEY ioctls. Must
be used to reset authentication process. */
#define DVD_KEY_INVAL_AGID 0x7f

/* This is used by the DVD_REPORT_KEY ioctl */
#define DVD_REPORT_KEY_AGID 0x00
#define DVD_REPORT_KEY_CHAL 0x01
#define DVD_REPORT_KEY_KEY1 0x02
#define DVD_REPORT_KEY_TITLE 0x04
#define DVD_REPORT_KEY_ASF 0x05
union dvd_report_key {
u_char type;
struct {
u_char type;
unsigned value : 2;
} agid;
struct {
u_char type;
unsigned agid : 2;
u_char value[10];
} chal;
struct {
u_char type;
unsigned agid : 2;
u_char value[5];
} key1;
struct {
u_char type;
unsigned agid : 2;
u_char value[5];
unsigned cpm : 1;
unsigned cp_sec : 1;
unsigned cgms : 2;
} title_key;
struct {
u_char type;
unsigned agid : 2;
unsigned value : 1;
} asf;
};

/* This is used by the DVD_SEND_KEY ioctl */
#define DVD_SEND_KEY_CHAL 0x01
#define DVD_SEND_KEY_KEY2 0x03
union dvd_send_key {
u_char type;
struct {
u_char type;
unsigned value : 2;
} agid;
struct {
u_char type;
unsigned agid : 2;
u_char value[10];
} chal;
struct {
u_char type;
unsigned agid : 2;
u_char value[5];
} key2;
};

..
~~~~~~~~~================-------------......---
--

Andrew Veliath
andrewtv@usa.net, veliaa@rpi.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.044 / U:0.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site