/* Add a special packet command request to the tail of the request queue, and wait for it to be serviced.  */
int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, struct ide_atapi_pc *pc, void *buf, unsigned int bufflen)
/* Add a special packet command request to the tail of the request queue, and wait for it to be serviced.  */
int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, struct ide_atapi_pc *pc, void *buf, unsigned int bufflen)
{
	struct request *rq;
	int error;
	rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
	rq->cmd_type = REQ_TYPE_SPECIAL;
	rq->special = (char *)pc;
	if (buf && bufflen) {
		error = blk_rq_map_kern(drive->queue, rq, buf, bufflen,
					GFP_NOIO);
		if (error)
			goto put_req;
	}
	memcpy(rq->cmd, pc->c, 12);
	if (drive->media == ide_tape)
		rq->cmd[13] = REQ_IDETAPE_PC1;
	error = blk_execute_rq(drive->queue, disk, rq, 0);
put_req:
	blk_put_request(rq);
	return error;
}