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