Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/usb/hcd/openhci/ohci.c
          +++ new/usr/src/uts/common/io/usb/hcd/openhci/ohci.c
↓ open down ↓ 1669 lines elided ↑ open up ↑
1670 1670  
1671 1671          Set_OpReg(hcr_control, curr_control);
1672 1672  
1673 1673          ASSERT((Get_OpReg(hcr_control) &
1674 1674              HCR_CONTROL_HCFS) == HCR_CONTROL_OPERAT);
1675 1675  
1676 1676          /* Set host controller soft state to operational */
1677 1677          ohcip->ohci_hc_soft_state = OHCI_CTLR_OPERATIONAL_STATE;
1678 1678  
1679 1679          /* Get the number of clock ticks to wait */
1680      -        sof_time_wait = drv_usectohz(OHCI_MAX_SOF_TIMEWAIT * 1000000);
     1680 +        sof_time_wait = drv_sectohz(OHCI_MAX_SOF_TIMEWAIT);
1681 1681  
1682 1682          /* Clear ohci_sof_flag indicating waiting for SOF interrupt */
1683 1683          ohcip->ohci_sof_flag = B_FALSE;
1684 1684  
1685 1685          /* Enable the SOF interrupt */
1686 1686          Set_OpReg(hcr_intr_enable, HCR_INTR_SOF);
1687 1687  
1688 1688          ASSERT(Get_OpReg(hcr_intr_enable) & HCR_INTR_SOF);
1689 1689  
1690 1690          (void) cv_reltimedwait(&ohcip->ohci_SOF_cv,
↓ open down ↓ 5814 lines elided ↑ open up ↑
7505 7505  
7506 7506          ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
7507 7507  
7508 7508          /*
7509 7509           * Start the global timer only if currently timer is not
7510 7510           * running and if there are any transfers on the timeout
7511 7511           * list. This timer will be per USB Host Controller.
7512 7512           */
7513 7513          if ((!ohcip->ohci_timer_id) && (ohcip->ohci_timeout_list)) {
7514 7514                  ohcip->ohci_timer_id = timeout(ohci_xfer_timeout_handler,
7515      -                    (void *)ohcip, drv_usectohz(1000000));
     7515 +                    (void *)ohcip, drv_sectohz(1));
7516 7516          }
7517 7517  }
7518 7518  
7519 7519  
7520 7520  /*
7521 7521   * ohci_deallocate_tw_resources:
7522 7522   * NOTE: This function is also called from POLLED MODE.
7523 7523   *
7524 7524   * Deallocate of a Transaction Wrapper (TW) and this involves the freeing of
7525 7525   * of DMA resources.
↓ open down ↓ 2418 lines elided ↑ open up ↑
9944 9944                      timeout(ohci_handle_root_hub_status_change,
9945 9945                      (void *)ohcip, drv_usectohz(OHCI_RH_POLL_TIME));
9946 9946  
9947 9947                  ohcip->ohci_root_hub.
9948 9948                      rh_intr_pipe_state = OHCI_PIPE_STATE_ACTIVE;
9949 9949          }
9950 9950  
9951 9951          /* Start the global timer */
9952 9952          if (xfer_timer_id) {
9953 9953                  ohcip->ohci_timer_id = timeout(ohci_xfer_timeout_handler,
9954      -                    (void *)ohcip, drv_usectohz(1000000));
     9954 +                    (void *)ohcip, drv_sectohz(1));
9955 9955          }
9956 9956  
9957 9957          return (USB_SUCCESS);
9958 9958  }
9959 9959  
9960 9960  
9961 9961  /*
9962 9962   * ohci_get_current_frame_number:
9963 9963   *
9964 9964   * Get the current software based usb frame number.
↓ open down ↓ 232 lines elided ↑ open up ↑
10197 10197          ASSERT(mutex_owned(&ohcip->ohci_int_mutex));
10198 10198  
10199 10199          rval = ohci_state_is_operational(ohcip);
10200 10200  
10201 10201          if (rval != USB_SUCCESS) {
10202 10202  
10203 10203                  return (rval);
10204 10204          }
10205 10205  
10206 10206          /* Get the number of clock ticks to wait */
10207      -        sof_time_wait = drv_usectohz(OHCI_MAX_SOF_TIMEWAIT * 1000000);
     10207 +        sof_time_wait = drv_sectohz(OHCI_MAX_SOF_TIMEWAIT);
10208 10208  
10209 10209          sof_wait_count = 0;
10210 10210  
10211 10211          /*
10212 10212           * Get the current usb frame number before waiting for the
10213 10213           * SOF interrupt event.
10214 10214           */
10215 10215          before_frame_number = ohci_get_current_frame_number(ohcip);
10216 10216  
10217 10217          while (sof_wait_count < MAX_SOF_WAIT_COUNT) {
↓ open down ↓ 263 lines elided ↑ open up ↑
10481 10481          USB_DPRINTF_L3(PRINT_MASK_LISTS, ohcip->ohci_log_hdl,
10482 10482              "ohci_wait_for_transfers_completion: count_done_tds = 0x%x",
10483 10483              pp->pp_count_done_tds);
10484 10484  
10485 10485          if (!pp->pp_count_done_tds) {
10486 10486  
10487 10487                  return;
10488 10488          }
10489 10489  
10490 10490          (void) cv_reltimedwait(&pp->pp_xfer_cmpl_cv, &ohcip->ohci_int_mutex,
10491      -            drv_usectohz(OHCI_XFER_CMPL_TIMEWAIT * 1000000), TR_CLOCK_TICK);
     10491 +            drv_sectohz(OHCI_XFER_CMPL_TIMEWAIT), TR_CLOCK_TICK);
10492 10492  
10493 10493          if (pp->pp_count_done_tds) {
10494 10494  
10495 10495                  USB_DPRINTF_L2(PRINT_MASK_LISTS, ohcip->ohci_log_hdl,
10496 10496                      "ohci_wait_for_transfers_completion: No transfers "
10497 10497                      "completion confirmation received for 0x%x requests",
10498 10498                      pp->pp_count_done_tds);
10499 10499          }
10500 10500  }
10501 10501  
↓ open down ↓ 859 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX