Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107474
b: refs/heads/master
c: 963e497
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Jul 31, 2008
1 parent be8b845 commit 9954506
Show file tree
Hide file tree
Showing 4 changed files with 266 additions and 40 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: 1f938d060a7bc01b5f82d46db3e38cd501b445a6
refs/heads/master: 963e4975c6f93c148ca809d986d412201df9af89
31 changes: 26 additions & 5 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,8 @@ void ata_id_string(const u16 *id, unsigned char *s,
{
unsigned int c;

BUG_ON(len & 1);

while (len > 0) {
c = id[ofs] >> 8;
*s = c;
Expand Down Expand Up @@ -1165,8 +1167,6 @@ void ata_id_c_string(const u16 *id, unsigned char *s,
{
unsigned char *p;

WARN_ON(!(len & 1));

ata_id_string(id, s, ofs, len - 1);

p = s + strnlen(s, len - 1);
Expand Down Expand Up @@ -1885,6 +1885,23 @@ static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
return 3 << ATA_SHIFT_PIO;
}

/**
* ata_do_dev_read_id - default ID read method
* @dev: device
* @tf: proposed taskfile
* @id: data buffer
*
* Issue the identify taskfile and hand back the buffer containing
* identify data. For some RAID controllers and for pre ATA devices
* this function is wrapped or replaced by the driver
*/
unsigned int ata_do_dev_read_id(struct ata_device *dev,
struct ata_taskfile *tf, u16 *id)
{
return ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE,
id, sizeof(id[0]) * ATA_ID_WORDS, 0);
}

/**
* ata_dev_read_id - Read ID data from the specified device
* @dev: target device
Expand Down Expand Up @@ -1920,7 +1937,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
if (ata_msg_ctl(ap))
ata_dev_printk(dev, KERN_DEBUG, "%s: ENTER\n", __func__);

retry:
retry:
ata_tf_init(dev, &tf);

switch (class) {
Expand Down Expand Up @@ -1948,8 +1965,11 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
*/
tf.flags |= ATA_TFLAG_POLLING;

err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE,
id, sizeof(id[0]) * ATA_ID_WORDS, 0);
if (ap->ops->read_id)
err_mask = ap->ops->read_id(dev, &tf, id);
else
err_mask = ata_do_dev_read_id(dev, &tf, id);

if (err_mask) {
if (err_mask & AC_ERR_NODEV_HINT) {
ata_dev_printk(dev, KERN_DEBUG,
Expand Down Expand Up @@ -6283,6 +6303,7 @@ EXPORT_SYMBOL_GPL(ata_host_resume);
#endif /* CONFIG_PM */
EXPORT_SYMBOL_GPL(ata_id_string);
EXPORT_SYMBOL_GPL(ata_id_c_string);
EXPORT_SYMBOL_GPL(ata_do_dev_read_id);
EXPORT_SYMBOL_GPL(ata_scsi_simulate);

EXPORT_SYMBOL_GPL(ata_pio_need_iordy);
Expand Down
Loading

0 comments on commit 9954506

Please sign in to comment.