On 2013/05/02 23:57, SASANO Takayoshi wrote:
> 
> >> +int
> >> +ugold_issue_cmd(struct ugold_softc *sc, uint8_t *cmd, int len, int delay)
> >> +{
> >> +  usb_device_request_t req;
> >> +
> >> +  bzero(sc->sc_ibuf, sc->sc_ilen);
> >> +
> >> +  req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
> >> +  req.bRequest = UR_SET_REPORT;
> >> +  USETW(req.wValue, 0x0200);
> >> +  USETW(req.wIndex, 0x0001);
> >> +  USETW(req.wLength, len);
> >> +  if (usbd_do_request(sc->sc_udev, &req, cmd))
> >> +          return EIO;
> >
> > I would suggest you to have a look at uhidev_set_report{,_async}() instead 
> > of
> > writing your own version here.
> 
> I think this can replace with uhidev_set_report(), I will try rewrite.

*if* sc->sc_hdev.sc_report_id is set to 0 then I think this may be
something like: uhidev_set_report(&sc->sc_hdev, 2, cmd, len)

the ugold(4) hardware I currently have access to is remote, so I can't
test this easily ;)

if sc_report_id isn't set how we need, then maybe we could at least
call usbd_set_report with hardcoded id.

Reply via email to