[alsa-devel] [PATCH 16/39] firewire-lib: Add some AV/C general commands

Clemens Ladisch clemens at ladisch.de
Fri Mar 14 23:18:32 CET 2014


Takashi Sakamoto wrote:
> can I request your comments about corresponding between response codes and Linux error codes?
>
> Current my idea is below.
>
> Return codes of CONTROL command:
> if (err != 8) /* length of response is out of specification */
>     err = -EIO;
> else if (buf[0] == 0x08) /* NOT IMPLEMENTED */
>     err = -ENOSYS;
> else if (buf[0] == 0x0a) /* REJECTED */
>     err = -EINVAL;
>
> Return codes of STATUS command:
> if (err != 8)  /* length of response is not our expectation */
>     err = -EIO;
> else if (buf[0] == 0x08) /* NOT IMPLEMENTED */
>     err = -ENOSYS;
> else if (buf[0] == 0x0a) /* REJECTED */
>     err = -EINVAL;
> else if (buf[0] == 0x0b) /* IN TRANSITION */
>     err = -EAGAIN;
>
> Are these better?

Yes, these look like the codes that match best.


Regards,
Clemens


More information about the Alsa-devel mailing list