Print this page
XXXX introduce drv_sectohz

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/iwh/iwh.c
          +++ new/usr/src/uts/common/io/iwh/iwh.c
↓ open down ↓ 2155 lines elided ↑ open up ↑
2156 2156           * load init_text section of uCode to hardware
2157 2157           */
2158 2158          err = iwh_put_seg_fw(sc, sc->sc_dma_fw_init_text.cookie.dmac_address,
2159 2159              RTC_INST_LOWER_BOUND, sc->sc_dma_fw_init_text.cookie.dmac_size);
2160 2160          if (err != IWH_SUCCESS) {
2161 2161                  cmn_err(CE_WARN, "iwh_load_init_firmware(): "
2162 2162                      "failed to write init uCode.\n");
2163 2163                  return (err);
2164 2164          }
2165 2165  
2166      -        clk = ddi_get_lbolt() + drv_usectohz(1000000);
     2166 +        clk = ddi_get_lbolt() + drv_sectohz(1);
2167 2167  
2168 2168          /*
2169 2169           * wait loading init_text until completed or timeout
2170 2170           */
2171 2171          while (!(sc->sc_flags & IWH_F_PUT_SEG)) {
2172 2172                  if (cv_timedwait(&sc->sc_put_seg_cv, &sc->sc_glock, clk) < 0) {
2173 2173                          break;
2174 2174                  }
2175 2175          }
2176 2176  
↓ open down ↓ 9 lines elided ↑ open up ↑
2186 2186           * load init_data section of uCode to hardware
2187 2187           */
2188 2188          err = iwh_put_seg_fw(sc, sc->sc_dma_fw_init_data.cookie.dmac_address,
2189 2189              RTC_DATA_LOWER_BOUND, sc->sc_dma_fw_init_data.cookie.dmac_size);
2190 2190          if (err != IWH_SUCCESS) {
2191 2191                  cmn_err(CE_WARN, "iwh_load_init_firmware(): "
2192 2192                      "failed to write init_data uCode.\n");
2193 2193                  return (err);
2194 2194          }
2195 2195  
2196      -        clk = ddi_get_lbolt() + drv_usectohz(1000000);
     2196 +        clk = ddi_get_lbolt() + drv_sectohz(1);
2197 2197  
2198 2198          /*
2199 2199           * wait loading init_data until completed or timeout
2200 2200           */
2201 2201          while (!(sc->sc_flags & IWH_F_PUT_SEG)) {
2202 2202                  if (cv_timedwait(&sc->sc_put_seg_cv, &sc->sc_glock, clk) < 0) {
2203 2203                          break;
2204 2204                  }
2205 2205          }
2206 2206  
↓ open down ↓ 20 lines elided ↑ open up ↑
2227 2227           * load init_text section of uCode to hardware
2228 2228           */
2229 2229          err = iwh_put_seg_fw(sc, sc->sc_dma_fw_text.cookie.dmac_address,
2230 2230              RTC_INST_LOWER_BOUND, sc->sc_dma_fw_text.cookie.dmac_size);
2231 2231          if (err != IWH_SUCCESS) {
2232 2232                  cmn_err(CE_WARN, "iwh_load_run_firmware(): "
2233 2233                      "failed to write run uCode.\n");
2234 2234                  return (err);
2235 2235          }
2236 2236  
2237      -        clk = ddi_get_lbolt() + drv_usectohz(1000000);
     2237 +        clk = ddi_get_lbolt() + drv_sectohz(1);
2238 2238  
2239 2239          /*
2240 2240           * wait loading run_text until completed or timeout
2241 2241           */
2242 2242          while (!(sc->sc_flags & IWH_F_PUT_SEG)) {
2243 2243                  if (cv_timedwait(&sc->sc_put_seg_cv, &sc->sc_glock, clk) < 0) {
2244 2244                          break;
2245 2245                  }
2246 2246          }
2247 2247  
↓ open down ↓ 9 lines elided ↑ open up ↑
2257 2257           * load run_data section of uCode to hardware
2258 2258           */
2259 2259          err = iwh_put_seg_fw(sc, sc->sc_dma_fw_data_bak.cookie.dmac_address,
2260 2260              RTC_DATA_LOWER_BOUND, sc->sc_dma_fw_data.cookie.dmac_size);
2261 2261          if (err != IWH_SUCCESS) {
2262 2262                  cmn_err(CE_WARN, "iwh_load_run_firmware(): "
2263 2263                      "failed to write run_data uCode.\n");
2264 2264                  return (err);
2265 2265          }
2266 2266  
2267      -        clk = ddi_get_lbolt() + drv_usectohz(1000000);
     2267 +        clk = ddi_get_lbolt() + drv_sectohz(1);
2268 2268  
2269 2269          /*
2270 2270           * wait loading run_data until completed or timeout
2271 2271           */
2272 2272          while (!(sc->sc_flags & IWH_F_PUT_SEG)) {
2273 2273                  if (cv_timedwait(&sc->sc_put_seg_cv, &sc->sc_glock, clk) < 0) {
2274 2274                          break;
2275 2275                  }
2276 2276          }
2277 2277  
↓ open down ↓ 1587 lines elided ↑ open up ↑
3865 3865                          delay(drv_usectohz(200000));
3866 3866                          ieee80211_next_scan(ic);
3867 3867                  }
3868 3868  
3869 3869                  /*
3870 3870                   * rate ctl
3871 3871                   */
3872 3872                  if (ic->ic_mach &&
3873 3873                      (sc->sc_flags & IWH_F_RATE_AUTO_CTL)) {
3874 3874                          clk = ddi_get_lbolt();
3875      -                        if (clk > sc->sc_clk + drv_usectohz(1000000)) {
     3875 +                        if (clk > sc->sc_clk + drv_sectohz(1)) {
3876 3876                                  iwh_amrr_timeout(sc);
3877 3877                          }
3878 3878                  }
3879 3879  
3880 3880                  if ((ic->ic_state == IEEE80211_S_RUN) &&
3881 3881                      (ic->ic_beaconmiss++ > 100)) {      /* 10 seconds */
3882 3882                          cmn_err(CE_WARN, "iwh: beacon missed for 10 seconds\n");
3883 3883                          (void) ieee80211_new_state(ic,
3884 3884                              IEEE80211_S_INIT, -1);
3885 3885                  }
↓ open down ↓ 936 lines elided ↑ open up ↑
4822 4822                      "failed to setup init firmware\n");
4823 4823                  mutex_exit(&sc->sc_glock);
4824 4824                  return (IWH_FAIL);
4825 4825          }
4826 4826  
4827 4827          /*
4828 4828           * now press "execute" start running
4829 4829           */
4830 4830          IWH_WRITE(sc, CSR_RESET, 0);
4831 4831  
4832      -        clk = ddi_get_lbolt() + drv_usectohz(1000000);
     4832 +        clk = ddi_get_lbolt() + drv_sectohz(1);
4833 4833          while (!(sc->sc_flags & IWH_F_FW_INIT)) {
4834 4834                  if (cv_timedwait(&sc->sc_ucode_cv,
4835 4835                      &sc->sc_glock, clk) < 0) {
4836 4836                          break;
4837 4837                  }
4838 4838          }
4839 4839  
4840 4840          if (!(sc->sc_flags & IWH_F_FW_INIT)) {
4841 4841                  cmn_err(CE_WARN, "iwh_init(): "
4842 4842                      "failed to process init alive.\n");
↓ open down ↓ 26 lines elided ↑ open up ↑
4869 4869                      "failed to setup run firmware\n");
4870 4870                  mutex_exit(&sc->sc_glock);
4871 4871                  return (IWH_FAIL);
4872 4872          }
4873 4873  
4874 4874          /*
4875 4875           * now press "execute" start running
4876 4876           */
4877 4877          IWH_WRITE(sc, CSR_RESET, 0);
4878 4878  
4879      -        clk = ddi_get_lbolt() + drv_usectohz(1000000);
     4879 +        clk = ddi_get_lbolt() + drv_sectohz(1);
4880 4880          while (!(sc->sc_flags & IWH_F_FW_INIT)) {
4881 4881                  if (cv_timedwait(&sc->sc_ucode_cv,
4882 4882                      &sc->sc_glock, clk) < 0) {
4883 4883                          break;
4884 4884                  }
4885 4885          }
4886 4886  
4887 4887          if (!(sc->sc_flags & IWH_F_FW_INIT)) {
4888 4888                  cmn_err(CE_WARN, "iwh_init(): "
4889 4889                      "failed to process runtime alive.\n");
↓ open down ↓ 1713 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX