if (!(wn->state & IDENTIFIED) || (wn->state & DEAF)) {
/* Try to identify the device. */
if (w_identify() != OK) {
+#if VERBOSE
printf("%s: probe failed\n", w_name());
+#endif
if (wn->state & DEAF) w_reset();
wn->state = IGNORING;
return(ENXIO);
if (!(wn->state & ATAPI) && (m_ptr->COUNT & RO_BIT)) return EACCES;
/* Partition the disk. */
- partition(&w_dtab, w_drive * DEV_PER_DRIVE, P_PRIMARY);
+ partition(&w_dtab, w_drive * DEV_PER_DRIVE, P_PRIMARY, wn->state & ATAPI);
wn->open_ct++;
}
return(OK);
/*============================================================================*
* partition *
*============================================================================*/
-PUBLIC void partition(dp, device, style)
+PUBLIC void partition(dp, device, style, atapi)
struct driver *dp; /* device dependent entry points */
int device; /* device to partition */
int style; /* partitioning style: floppy, primary, sub. */
+int atapi; /* atapi device */
{
/* This routine is called on first open to initialize the partition tables
* of a device. It makes sure that each partition falls safely within the
limit = base + div64u(dv->dv_size, SECTOR_SIZE);
/* Read the partition table for the device. */
- if (!get_part_table(dp, device, 0L, table, &io))
- if(!io || !get_iso_fake_part_table(dp, device, 0L, table))
- return;
+ if(atapi) {
+ if(!get_iso_fake_part_table(dp, device, 0L, table))
+ return;
+ } else if(!get_part_table(dp, device, 0L, table, &io)) {
+ return;
+ }
/* Compute the device number of the first partition. */
switch (style) {
if (style == P_PRIMARY) {
/* Each Minix primary partition can be subpartitioned. */
if (pe->sysind == MINIX_PART)
- partition(dp, device + par, P_SUB);
+ partition(dp, device + par, P_SUB, atapi);
/* An extended partition has logical partitions. */
if (ext_part(pe->sysind))
#include <ibm/partition.h>
-_PROTOTYPE( void partition, (struct driver *dr, int device, int style) );
+_PROTOTYPE( void partition, (struct driver *dr, int device, int style, int atapi) );
/* BIOS parameter table layout. */
#define bp_cylinders(t) (* (u16_t *) (&(t)[0]))