Lines Matching refs:drive
31 ide_drive_t *drive = cdi->handle;
34 drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID;
44 ide_drive_t *drive = cdi->handle;
52 stat = cdrom_check_status(drive, &sshdr);
93 ide_drive_t *drive = cdi->handle;
97 (void) cdrom_check_status(drive, NULL);
98 retval = (drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED) ? 1 : 0;
99 drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
109 int cdrom_eject(ide_drive_t *drive, int ejectflag)
111 struct cdrom_info *cd = drive->driver_data;
116 if ((drive->atapi_flags & IDE_AFLAG_NO_EJECT) && !ejectflag)
120 if ((drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED) && ejectflag)
123 /* only tell drive to close tray if open, if it can do that */
132 return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, NULL, 0, 0);
137 int ide_cd_lockdoor(ide_drive_t *drive, int lockflag)
142 /* If the drive cannot lock the door, just pretend. */
143 if ((drive->dev_flags & IDE_DFLAG_DOORLOCKING) == 0) {
153 stat = ide_cd_queue_pc(drive, cmd, 0, NULL, NULL,
157 /* If we got an illegal field error, the drive
163 drive->name);
164 drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
174 drive->atapi_flags |= IDE_AFLAG_DOOR_LOCKED;
176 drive->atapi_flags &= ~IDE_AFLAG_DOOR_LOCKED;
184 ide_drive_t *drive = cdi->handle;
187 int stat = ide_cd_lockdoor(drive, 0);
193 return cdrom_eject(drive, !position);
198 ide_drive_t *drive = cdi->handle;
200 return ide_cd_lockdoor(drive, lock);
209 ide_drive_t *drive = cdi->handle;
210 struct cdrom_info *cd = drive->driver_data;
233 stat = ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, NULL, 0, 0);
235 if (!ide_cdrom_get_capabilities(drive, buf)) {
236 ide_cdrom_update_speed(drive, buf);
247 ide_drive_t *drive = cdi->handle;
248 struct cdrom_info *info = drive->driver_data;
251 if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0 || !info->toc) {
252 ret = ide_cd_read_toc(drive);
267 ide_drive_t *drive = cdi->handle;
281 stat = ide_cd_queue_pc(drive, cmd, 0, buf, &len, NULL, 0, 0);
294 ide_drive_t *drive = cdi->handle;
295 struct cdrom_info *cd = drive->driver_data;
299 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
302 blk_execute_rq(drive->queue, cd->disk, rq, 0);
309 if (drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED)
310 (void)ide_cd_lockdoor(drive, 1);
315 static int ide_cd_get_toc_entry(ide_drive_t *drive, int track,
318 struct cdrom_info *info = drive->driver_data;
325 if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0)
344 static int ide_cd_fake_play_trkind(ide_drive_t *drive, void *arg)
352 stat = ide_cd_get_toc_entry(drive, ti->cdti_trk0, &first_toc);
356 stat = ide_cd_get_toc_entry(drive, ti->cdti_trk1, &last_toc);
374 return ide_cd_queue_pc(drive, cmd, 0, NULL, NULL, NULL, 0, 0);
377 static int ide_cd_read_tochdr(ide_drive_t *drive, void *arg)
379 struct cdrom_info *cd = drive->driver_data;
385 stat = ide_cd_read_toc(drive);
396 static int ide_cd_read_tocentry(ide_drive_t *drive, void *arg)
402 stat = ide_cd_get_toc_entry(drive, tocentry->cdte_track, &toce);
422 ide_drive_t *drive = cdi->handle;
430 return ide_cd_fake_play_trkind(drive, arg);
432 return ide_cd_read_tochdr(drive, arg);
434 return ide_cd_read_tocentry(drive, arg);
444 ide_drive_t *drive = cdi->handle;
461 cgc->stat = ide_cd_queue_pc(drive, cgc->cmd,