Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21799
b: refs/heads/master
c: b4dc762
h: refs/heads/master
i:
  21797: b9d976d
  21795: d81a6a4
  21791: 9deb583
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jan 27, 2006
1 parent 188acd7 commit f469cd7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f8b99589524f3e759e44721376abcdf88ed8915
refs/heads/master: b4dc7623c1bb258b66418261dab40f0e4cfc6d42
30 changes: 16 additions & 14 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
* ata_dev_try_classify - Parse returned ATA device signature
* @ap: ATA channel to examine
* @device: Device to examine (starting at zero)
* @r_err: Value of error register on completion
*
* After an event -- SRST, E.D.D., or SATA COMRESET -- occurs,
* an ATA/ATAPI-defined set of values is placed in the ATA
Expand All @@ -842,11 +843,14 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
*
* LOCKING:
* caller.
*
* RETURNS:
* Device type - %ATA_DEV_ATA, %ATA_DEV_ATAPI or %ATA_DEV_NONE.
*/

static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device)
static unsigned int
ata_dev_try_classify(struct ata_port *ap, unsigned int device, u8 *r_err)
{
struct ata_device *dev = &ap->device[device];
struct ata_taskfile tf;
unsigned int class;
u8 err;
Expand All @@ -857,27 +861,25 @@ static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device)

ap->ops->tf_read(ap, &tf);
err = tf.feature;

dev->class = ATA_DEV_NONE;
if (r_err)
*r_err = err;

/* see if device passed diags */
if (err == 1)
/* do nothing */ ;
else if ((device == 0) && (err == 0x81))
/* do nothing */ ;
else
return err;
return ATA_DEV_NONE;

/* determine if device if ATA or ATAPI */
/* determine if device is ATA or ATAPI */
class = ata_dev_classify(&tf);

if (class == ATA_DEV_UNKNOWN)
return err;
return ATA_DEV_NONE;
if ((class == ATA_DEV_ATA) && (ata_chk_status(ap) == 0))
return err;

dev->class = class;

return err;
return ATA_DEV_NONE;
return class;
}

/**
Expand Down Expand Up @@ -2177,9 +2179,9 @@ void ata_bus_reset(struct ata_port *ap)
/*
* determine by signature whether we have ATA or ATAPI devices
*/
err = ata_dev_try_classify(ap, 0);
ap->device[0].class = ata_dev_try_classify(ap, 0, &err);
if ((slave_possible) && (err != 0x81))
ata_dev_try_classify(ap, 1);
ap->device[1].class = ata_dev_try_classify(ap, 1, &err);

/* re-enable interrupts */
if (ap->ioaddr.ctl_addr) /* FIXME: hack. create a hook instead */
Expand Down

0 comments on commit f469cd7

Please sign in to comment.