From: Jens Axboe <axboe@suse.de>
To: Andreas Jellinghaus <aj@dungeon.inka.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ide cdrom sg like access / rpcmgr ?
Date: Wed, 12 Nov 2003 15:31:30 +0100 [thread overview]
Message-ID: <20031112143130.GL21141@suse.de> (raw)
In-Reply-To: <1068640776.10684.2.camel@simulacron>
On Wed, Nov 12 2003, Andreas Jellinghaus wrote:
> On Wed, 2003-11-12 at 12:36, Jens Axboe wrote:
> > Post the code and I'll show you how to do it. Generally, you should just
> > use SG_IO or CDROM_SEND_PACKET for this.
>
> thanks, the code is at
> http://www.ilovedvd.co.nz/downloads/unix-linux/rpcmgr11.c
How overly complex :-). I wrote a similar tool, dunno if it still works.
Googling shows:
http://www.au.linuxvideo.org/lists/livid-dev/2000-June/msg00649.html
To make the below work, all you probably need to do is change sgio() to
use CDROM_SEND_PACKET for instance. That'll work in 2.4 and 2.6. You
just need to fill a cdrom_generic_command and send it to the cdrom fd.
Ala
struct cdrom_generic_command cgc;
memset(&cgc, 0, sizeof(cgc));
memcpy(cgc.cmd, cdb, sizeof(cdb));
cgc.buffer = the_buffer_to_write_to;
cgc.buflen = sizeof(the_buffer_to_write_to);
cgc.data_direction = CGC_DATA_READ;
cgc.quiet = 1;
if (ioctl(cdrom_fd, CDROM_SEND_PACKET, cdrom_fd) < 0) {
perror("CDROM_SEND_PACKET");
return 1;
}
/* success */
return 0;
--
Jens Axboe
next prev parent reply other threads:[~2003-11-12 14:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-10 20:04 ide cdrom sg like access / rpcmgr ? Andreas Jellinghaus
2003-11-12 11:36 ` Jens Axboe
2003-11-12 12:39 ` Andreas Jellinghaus
2003-11-12 14:31 ` Jens Axboe [this message]
2003-11-12 16:33 ` Linus Torvalds
2003-11-12 17:32 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031112143130.GL21141@suse.de \
--to=axboe@suse.de \
--cc=aj@dungeon.inka.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.