Name

ata_drive_probe_reset — Perform probe reset with given methods

Synopsis

int ata_drive_probe_reset (struct ata_port *  ap,
 ata_probeinit_fn_t  probeinit,
 ata_reset_fn_t  softreset,
 ata_reset_fn_t  hardreset,
 ata_postreset_fn_t  postreset,
 unsigned int *  classes);

Arguments

ap

port to reset

probeinit

probeinit method (can be NULL)

softreset

softreset method (can be NULL)

hardreset

hardreset method (can be NULL)

postreset

postreset method (can be NULL)

classes

resulting classes of attached devices

Description

Reset the specified port and classify attached devices using given methods. This function prefers softreset but tries all possible reset sequences to reset and classify devices. This function is intended to be used for constructing ->probe_reset callback by low level drivers.

Reset methods should follow the following rules.

- Return 0 on sucess, -errno on failure. - If classification is supported, fill classes[] with recognized class codes. - If classification is not supported, leave classes[] alone. - If verbose is non-zero, print error message on failure; otherwise, shut up.

LOCKING

Kernel thread context (may sleep)

RETURNS

0 on success, -EINVAL if no reset method is avaliable, -ENODEV if classification fails, and any error code from reset methods.