Print this page
5832 EOF wireless usb (aka UWB)
Reviewed by: TBD
Reviewed by: TBD
Approved by: TBD

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/usb/usba/parser.c
          +++ new/usr/src/uts/common/io/usb/usba/parser.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + *
       25 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24   26   */
  25   27  
  26   28  
  27   29  /*
  28   30   * Descriptor parsing functions
  29   31   */
  30   32  #define USBA_FRAMEWORK
  31   33  #include <sys/usb/usba/usba_impl.h>
  32   34  #include <sys/strsun.h>
  33   35  
↓ open down ↓ 579 lines elided ↑ open up ↑
 613  615                  }
 614  616  
 615  617                  /*
 616  618                   * Check for a bad buffer.
 617  619                   * If buf[0] is 0, then this will be an infite loop
 618  620                   */
 619  621                  INCREMENT_BUF(buf);
 620  622          }
 621  623  
 622  624          return (USB_PARSE_ERROR);
 623      -}
 624      -
 625      -size_t
 626      -usb_parse_bos_descr(uchar_t     *buf,   /* from GET_DESCRIPTOR(BOS) */
 627      -        size_t                  buflen,
 628      -        usb_bos_descr_t         *ret_descr,
 629      -        size_t                  ret_buf_len)
 630      -{
 631      -        if ((buf == NULL) || (ret_descr == NULL) ||
 632      -            (buflen < 2) || (buf[1] != USB_DESCR_TYPE_BOS)) {
 633      -
 634      -                return (USB_PARSE_ERROR);
 635      -        }
 636      -
 637      -        return (usb_parse_data("ccsc",
 638      -            buf, buflen, ret_descr, ret_buf_len));
 639      -}
 640      -
 641      -size_t
 642      -usb_parse_uwb_bos_descr(uchar_t *buf,   /* from GET_DESCRIPTOR(BOS) */
 643      -        size_t                  buflen,
 644      -        usb_uwb_cap_descr_t     *ret_descr,
 645      -        size_t                  ret_buf_len)
 646      -{
 647      -        uchar_t *bufend = buf + buflen;
 648      -
 649      -        if ((buf == NULL) || (ret_descr == NULL)) {
 650      -
 651      -                return (USB_PARSE_ERROR);
 652      -        }
 653      -
 654      -        while (buf + 3 <= bufend) {
 655      -                if ((buf[1] == USB_DESCR_TYPE_DEV_CAPABILITY) &&
 656      -                    (buf[2] == USB_CAP_TYPE_WUSB)) {
 657      -
 658      -                        return (usb_parse_data("ccccsccsc",
 659      -                            buf, _PTRDIFF(bufend, buf), ret_descr,
 660      -                            ret_buf_len));
 661      -                }
 662      -
 663      -                INCREMENT_BUF(buf);
 664      -        }
 665      -
 666      -        return (USB_PARSE_ERROR);
 667      -}
 668      -
 669      -size_t
 670      -usb_parse_comp_ep_descr(uchar_t *buf,   /* from GET_DESCRIPTOR(CONFIGURATION) */
 671      -        size_t                  buflen,
 672      -        uint_t                  if_number,
 673      -        uint_t                  alt_if_setting,
 674      -        uint_t                  ep_index,
 675      -        usb_ep_comp_descr_t     *ret_descr,
 676      -        size_t                  ret_buf_len)
 677      -{
 678      -        return (usb_parse_CV_ep_descr(buf, buflen, "ccccsscc",
 679      -            if_number, alt_if_setting, ep_index,
 680      -            USB_DESCR_TYPE_WIRELESS_EP_COMP, 0,
 681      -            ret_descr, ret_buf_len));
 682  625  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX