/* speed is given as the normal factor, e.g. 4 for 4x  */
static noinline_for_stack int pkt_set_speed(struct pktcdvd_device *pd, unsigned write_speed, unsigned read_speed)
/* speed is given as the normal factor, e.g. 4 for 4x  */
static noinline_for_stack int pkt_set_speed(struct pktcdvd_device *pd, unsigned write_speed, unsigned read_speed)
{
	struct packet_command cgc;
	struct request_sense sense;
	int ret;
	init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE);
	cgc.sense = &sense;
	cgc.cmd[0] = GPCMD_SET_SPEED;
	cgc.cmd[2] = (read_speed >> 8) & 0xff;
	cgc.cmd[3] = read_speed & 0xff;
	cgc.cmd[4] = (write_speed >> 8) & 0xff;
	cgc.cmd[5] = write_speed & 0xff;
	if ((ret = pkt_generic_packet(pd, &cgc)))
		pkt_dump_sense(&cgc);
	return ret;
}