Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 93234 Details for
Bug 142470
app-misc/setcd (new ebuild)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to include speed setting of DVD-ROM
setcd-1.5.patch (text/plain), 2.27 KB, created by
Shane Chen
on 2006-08-01 15:51:12 UTC
(
hide
)
Description:
patch to include speed setting of DVD-ROM
Filename:
MIME Type:
Creator:
Shane Chen
Created:
2006-08-01 15:51:12 UTC
Size:
2.27 KB
patch
obsolete
>--- setcd.c >+++ setcd.c >@@ -1,5 +1,6 @@ > /* Setcd.c: Set various flags to control the behaviour of your cdrom device. > (c) 1997 David A. van Leeuwen >+ (c) 2004 Thomas Fritzsche <tf@noto.de> > > $Id: setcd.c,v 1.4 1999/08/24 19:07:34 david Exp $ > >@@ -23,7 +24,7 @@ > #include <fcntl.h> > #include <ctype.h> /* tolower */ > #include <unistd.h> /* lseek, read */ >-#include <string.h> /* strncmp */ >+#include <string.h> /* strncmp, memset */ > #include <sys/ioctl.h> /* ioctl */ > #include <linux/cdrom.h> > #ifndef CDC_CLOSE_TRAY /* moved into cdrom.h... */ >@@ -248,7 +249,49 @@ > if (set || clear || status) > print_options(flags, set | clear | ~0 * status); > if (speed>=0) { >- if (ioctl(fd, CDROM_SELECT_SPEED, speed)<0) { >+ struct cdrom_generic_command cgc; >+ struct request_sense sense; >+ unsigned char buffer[28]; >+ unsigned long rw_size; >+ memset(&cgc, 0, sizeof(cgc)); >+ memset(&sense, 0, sizeof(sense)); >+ memset(&buffer, 0, sizeof(buffer)); >+ /* SET STREAMING command */ >+ cgc.cmd[0] = 0xb6; >+ /* 28 byte parameter list length */ >+ cgc.cmd[10] = 28; >+ cgc.sense = &sense; >+ cgc.buffer = buffer; >+ cgc.buflen = sizeof(buffer); >+ cgc.data_direction = CGC_DATA_WRITE; >+ cgc.quiet = 1; >+ if(speed == 0) { >+ /* set Restore Drive Defaults */ >+ buffer[0] = 4; >+ } >+ buffer[8] = 0xff; >+ buffer[9] = 0xff; >+ buffer[10] = 0xff; >+ buffer[11] = 0xff; >+ rw_size = 177 * speed; >+ /* read size */ >+ buffer[12] = (rw_size >> 24) & 0xff; >+ buffer[13] = (rw_size >> 16) & 0xff; >+ buffer[14] = (rw_size >> 8) & 0xff; >+ buffer[15] = rw_size & 0xff; >+ /* read time 1 sec. */ >+ buffer[18] = 0x03; >+ buffer[19] = 0xE8; >+ /* write size */ >+ buffer[20] = (rw_size >> 24) & 0xff; >+ buffer[21] = (rw_size >> 16) & 0xff; >+ buffer[22] = (rw_size >> 8) & 0xff; >+ buffer[23] = rw_size & 0xff; >+ /* write time 1 sec. */ >+ buffer[26] = 0x03; >+ buffer[27] = 0xE8; >+ if ((ioctl(fd, CDROM_SEND_PACKET, &cgc) != 0) >+ && (ioctl(fd, CDROM_SELECT_SPEED, speed) < 0)) { > perror("can't set speed"); > exit(-6); > } else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 142470
:
93224
|
93225
|
93228
|
93230
|
93232
| 93234 |
110779