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/usba.c
          +++ new/usr/src/uts/common/io/usb/usba/usba.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   * USBA: Solaris USB Architecture support
  29   31   */
  30   32  #define USBA_FRAMEWORK
  31   33  #include <sys/usb/usba/usba_impl.h>
  32   34  #include <sys/usb/usba/hcdi_impl.h>
  33   35  #include <sys/usb/hubd/hub.h>
↓ open down ↓ 78 lines elided ↑ open up ↑
 112  114  
 113  115          /*
 114  116           * usbai providing log support needs to be init'ed first
 115  117           * and destroyed last
 116  118           */
 117  119          usba_usbai_initialization();
 118  120          usba_usba_initialization();
 119  121          usba_usbai_register_initialization();
 120  122          usba_hcdi_initialization();
 121  123          usba_hubdi_initialization();
 122      -        usba_whcdi_initialization();
 123  124          usba_devdb_initialization();
 124  125  
 125  126          if ((rval = mod_install(&modlinkage)) != 0) {
 126  127                  usba_devdb_destroy();
 127      -                usba_whcdi_destroy();
 128  128                  usba_hubdi_destroy();
 129  129                  usba_hcdi_destroy();
 130  130                  usba_usbai_register_destroy();
 131  131                  usba_usba_destroy();
 132  132                  usba_usbai_destroy();
 133  133          }
 134  134  
 135  135          return (rval);
 136  136  }
 137  137  
 138  138  int
 139  139  _fini()
 140  140  {
 141  141          int rval;
 142  142  
 143  143          if ((rval = mod_remove(&modlinkage)) == 0) {
 144  144                  usba_devdb_destroy();
 145      -                usba_whcdi_destroy();
 146  145                  usba_hubdi_destroy();
 147  146                  usba_hcdi_destroy();
 148  147                  usba_usbai_register_destroy();
 149  148                  usba_usba_destroy();
 150  149                  usba_usbai_destroy();
 151  150          }
 152  151  
 153  152          return (rval);
 154  153  }
 155  154  
↓ open down ↓ 478 lines elided ↑ open up ↑
 634  633  
 635  634          while (evdata) {
 636  635                  next = evdata->ev_next;
 637  636                  kmem_free(evdata, sizeof (usba_evdata_t));
 638  637                  evdata = next;
 639  638          }
 640  639  }
 641  640  
 642  641  
 643  642  /*
 644      - * free wireless usb specific structure
 645      - */
 646      -void
 647      -usba_free_wireless_data(usba_wireless_data_t *wireless_data)
 648      -{
 649      -        if (wireless_data == NULL) {
 650      -
 651      -                return;
 652      -        }
 653      -
 654      -        if (wireless_data->wusb_bos) {
 655      -                kmem_free(wireless_data->wusb_bos,
 656      -                    wireless_data->wusb_bos_length);
 657      -        }
 658      -
 659      -        kmem_free(wireless_data, sizeof (usba_wireless_data_t));
 660      -}
 661      -
 662      -
 663      -/*
 664  643   * free usb device structure
 665  644   */
 666  645  void
 667  646  usba_free_usba_device(usba_device_t *usba_device)
 668  647  {
 669  648          int                     i, ep_idx;
 670  649          usb_pipe_handle_t       def_ph;
 671  650  
 672  651          if (usba_device == NULL) {
 673  652  
↓ open down ↓ 107 lines elided ↑ open up ↑
 781  760                  if (usba_device->usb_product_str) {
 782  761                          kmem_free(usba_device->usb_product_str,
 783  762                              strlen(usba_device->usb_product_str) + 1);
 784  763                  }
 785  764  
 786  765                  if (usba_device->usb_serialno_str) {
 787  766                          kmem_free(usba_device->usb_serialno_str,
 788  767                              strlen(usba_device->usb_serialno_str) + 1);
 789  768                  }
 790  769  
 791      -                if (usba_device->usb_wireless_data) {
 792      -                        mutex_enter(&usba_device->usb_mutex);
 793      -                        usba_free_wireless_data(
 794      -                            usba_device->usb_wireless_data);
 795      -                        mutex_exit(&usba_device->usb_mutex);
 796      -                }
 797      -
 798      -                /*
 799      -                 * The device address on the wireless bus is assigned
 800      -                 * by the wireless host controller driver(whci or hwahc),
 801      -                 * not by USBA framework, so skip this for wireless
 802      -                 * USB devices.
 803      -                 */
 804      -                if (!usba_device->usb_is_wireless) {
 805      -                        usba_unset_usb_address(usba_device);
 806      -                }
      770 +                usba_unset_usb_address(usba_device);
 807  771          }
 808  772  
 809  773  #ifndef __lock_lint
 810  774          ASSERT(usba_device->usb_client_dev_data_list.cddl_next == NULL);
 811  775  #endif
 812  776  
 813  777          if (usba_device->usb_client_flags) {
 814  778  #ifndef __lock_lint
 815  779                  int i;
 816  780  
↓ open down ↓ 605 lines elided ↑ open up ↑
1422 1386                  if (hub->dip == dip) {
1423 1387                          mutex_exit(&usba_hub_mutex);
1424 1388  
1425 1389                          return (1);
1426 1390                  }
1427 1391                  hub = hub->next;
1428 1392          }
1429 1393          mutex_exit(&usba_hub_mutex);
1430 1394  
1431 1395          return (0);
1432      -}
1433      -
1434      -/*
1435      - * check whether this dip is a wire adapter device
1436      - */
1437      -int
1438      -usba_is_wa(dev_info_t *dip)
1439      -{
1440      -        if (dip) {
1441      -                usba_device_t *usba_device;
1442      -
1443      -                usba_device = usba_get_usba_device(dip);
1444      -
1445      -                return (usba_device->usb_is_wa? 1:0);
1446      -        }
1447      -
1448      -        return (0);
1449      -}
1450      -
1451      -/*
1452      - * check whether this dip is a host wire adapter device node
1453      - */
1454      -int
1455      -usba_is_hwa(dev_info_t *dip)
1456      -{
1457      -        dev_info_t      *cdip;
1458      -
1459      -        if (dip == NULL) {
1460      -
1461      -                return (0);
1462      -        }
1463      -
1464      -        if (strcmp(ddi_driver_name(dip), "usb_mid") != 0) {
1465      -
1466      -                return (0);
1467      -        }
1468      -
1469      -        for (cdip = ddi_get_child(dip); cdip;
1470      -            cdip = ddi_get_next_sibling(cdip)) {
1471      -                if (strcmp(ddi_driver_name(cdip), "hwarc") == 0) {
1472      -
1473      -                        return (1);
1474      -                }
1475      -        }
1476      -
1477      -        return (0);
1478 1396  }
1479 1397  
1480 1398  /*
1481 1399   * get and store usba_device pointer in the devi
1482 1400   */
1483 1401  usba_device_t *
1484 1402  usba_get_usba_device(dev_info_t *dip)
1485 1403  {
1486 1404          /*
1487 1405           * we cannot use parent_data in the usb node because its
↓ open down ↓ 1849 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX