mirror of
https://github.com/opnsense/src.git
synced 2026-06-12 18:20:49 -04:00
hidraw(4): Return actual length of read data from HIDIOCG* ioctls
To match Linux.
MFC after: 3 days
(cherry picked from commit 8d4d08d571)
This commit is contained in:
parent
2880e12cc9
commit
d04cc28f97
1 changed files with 8 additions and 2 deletions
|
|
@ -915,8 +915,14 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
|
|||
default:
|
||||
panic("Invalid report type");
|
||||
}
|
||||
return (hid_get_report(sc->sc_dev, addr, len, NULL,
|
||||
reptype, id));
|
||||
error = hid_get_report(sc->sc_dev, addr, len, &actsize,
|
||||
reptype, id);
|
||||
if (error == 0) {
|
||||
if (id == 0)
|
||||
actsize++;
|
||||
td->td_retval[0] = actsize;
|
||||
}
|
||||
return (error);
|
||||
|
||||
case HIDIOCGRAWUNIQ(0):
|
||||
strlcpy(addr, sc->sc_hw->serial, len);
|
||||
|
|
|
|||
Loading…
Reference in a new issue