[BACK]Return to usbhid.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / usbhidctl

Diff for /src/usr.bin/usbhidctl/usbhid.c between version 1.2 and 1.3

version 1.2, 2001/12/30 07:10:42 version 1.3, 2002/05/02 20:12:07
Line 274 
Line 274 
                  * report in the variable-sized data field.                   * report in the variable-sized data field.
                  */                   */
                 report->buffer = malloc(sizeof(*report->buffer) -                  report->buffer = malloc(sizeof(*report->buffer) -
                                         sizeof(report->buffer->data) +                                          sizeof(report->buffer->ucr_data) +
                                         report->size);                                          report->size);
                 if (report->buffer == NULL)                  if (report->buffer == NULL)
                         err(1, NULL);                          err(1, NULL);
Line 300 
Line 300 
                 if (report->size == 0)                  if (report->size == 0)
                         return;                          return;
   
                 report->buffer->report = reptoparam[repindex].uhid_report;                  report->buffer->ucr_report = reptoparam[repindex].uhid_report;
                 if (ioctl(hidfd, USB_GET_REPORT, report->buffer) < 0)                  if (ioctl(hidfd, USB_GET_REPORT, report->buffer) < 0)
                         err(1, "USB_GET_REPORT");                          err(1, "USB_GET_REPORT");
         }          }
Line 310 
Line 310 
 setreport(struct Sreport *report, int hidfd, int repindex)  setreport(struct Sreport *report, int hidfd, int repindex)
 {  {
         if (report->status == srs_dirty) {          if (report->status == srs_dirty) {
                 report->buffer->report = reptoparam[repindex].uhid_report;                  report->buffer->ucr_report = reptoparam[repindex].uhid_report;
   
                 if (ioctl(hidfd, USB_SET_REPORT, report->buffer) < 0)                  if (ioctl(hidfd, USB_SET_REPORT, report->buffer) < 0)
                         err(1, "USB_SET_REPORT(%s)",                          err(1, "USB_SET_REPORT(%s)",
Line 440 
Line 440 
                 errx(1, "Input report descriptor invalid length");                  errx(1, "Input report descriptor invalid length");
   
         dlen = inreport.size;          dlen = inreport.size;
         dbuf = inreport.buffer->data;          dbuf = inreport.buffer->ucr_data;
   
         for (;;) {          for (;;) {
                 ssize_t readlen;                  ssize_t readlen;
Line 482 
Line 482 
                         if (matchvar != NULL)                          if (matchvar != NULL)
                                 matchvar->opfunc(&hitem, matchvar,                                  matchvar->opfunc(&hitem, matchvar,
                                                  colls, collind,                                                   colls, collind,
                                                  inreport.buffer->data);                                                   inreport.buffer->ucr_data);
                 }                  }
                 hid_end_parse(hdata);                  hid_end_parse(hdata);
                 printf("\n");                  printf("\n");
Line 560 
Line 560 
                                 getreport(repptr, hidfd, rd, repindex);                                  getreport(repptr, hidfd, rd, repindex);
   
                         bufdata = (repptr == NULL || repptr->buffer == NULL) ?                          bufdata = (repptr == NULL || repptr->buffer == NULL) ?
                                 NULL : repptr->buffer->data;                                  NULL : repptr->buffer->ucr_data;
   
                         if (matchvar->opfunc(&hitem, matchvar, colls, collind,                          if (matchvar->opfunc(&hitem, matchvar, colls, collind,
                                              bufdata))                                               bufdata))

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3