Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Nov 1999 21:08:20 +0100 (CET)
From:      Egervary Gergely <mauzi@faber.poli.hu>
To:        freebsd-hackers@freebsd.org
Subject:   cdrom speed adjustment ioctl
Message-ID:  <Pine.LNX.4.10.9911282107150.5931-100000@faber.poli.hu>

next in thread | raw e-mail | index | archive | help
hello,

I've just hacked a new ioctl into the ATAPI cdrom driver, which
lets the user to specify (pronounce: ``slow down'' :) the speed 
of todays' extremely high speed drives.

It's a documented ATAPI feature, and is very easy to implement,
and I've found it very useful :)

first, you need to add the ioctl into sys/cdio.h:


struct ioc_spdsel
{
	int rate;
}

#define CDIOCSPDSEL	_IOW('c',32,struct ioc_spdsel)


second, need to add this into i386/isa/atapi.h


#define ATAPI_SPEED_SELECT	0xbb


and finally need to add this case into the function ``acdioctl'' in 
i386/isa/atapi-cd.c


	case CDIOCSPDSEL:
	    {
	        struct ioc_spdsel *arg = (struct ioc_spdsel *)addr;
		
		return acd_request_wait(cdp, ATAPI_SPEED_SELECT, 0,
					arg->rate>>8 & 0xff,
					arg->rate & 0xff,
					0, 0, 0, 0, 0, 0, 0, 0);
	    }
	    

of course unified diff's are available. i'm not an experienced
kernel hacker, please feel free to correct me and drop me
a mail about this thingy...

thanks in advance

-- mauzi

Gergely EGERVARY
mauzi@lkg.rulez.org



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.10.9911282107150.5931-100000>