Changeset 053fc2b in mainline for uspace/drv/nic/ar9271/hw.c
- Timestamp:
- 2015-04-10T13:52:11Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a931b7b
- Parents:
- d7dadcb4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ar9271/hw.c
rd7dadcb4 r053fc2b 377 377 } 378 378 379 int hw_wakeup(ar9271_t *ar9271)380 {381 int rc;382 383 uint32_t rtc_status;384 wmi_reg_read(ar9271->htc_device, AR9271_RTC_STATUS, &rtc_status);385 if((rtc_status & AR9271_RTC_STATUS_MASK) == AR9271_RTC_STATUS_SHUTDOWN) {386 rc = hw_reset_power_on(ar9271);387 if(rc != EOK) {388 usb_log_info("Failed to HW reset power on.\n");389 return rc;390 }391 392 rc = hw_set_reset(ar9271, false);393 if(rc != EOK) {394 usb_log_info("Failed to HW warm reset.\n");395 return rc;396 }397 }398 399 wmi_reg_set_bit(ar9271->htc_device, AR9271_RTC_FORCE_WAKE,400 AR9271_RTC_FORCE_WAKE_ENABLE);401 402 size_t i;403 for(i = 0; i < HW_WAIT_LOOPS; i++) {404 wmi_reg_read(ar9271->htc_device, AR9271_RTC_STATUS,405 &rtc_status);406 if((rtc_status & AR9271_RTC_STATUS_MASK) ==407 AR9271_RTC_STATUS_ON) {408 break;409 }410 wmi_reg_set_bit(ar9271->htc_device, AR9271_RTC_FORCE_WAKE,411 AR9271_RTC_FORCE_WAKE_ENABLE);412 udelay(50);413 }414 415 if(i == HW_WAIT_LOOPS) {416 return EINVAL;417 } else {418 return EOK;419 }420 }421 422 379 int hw_freq_switch(ar9271_t *ar9271, uint16_t freq) 423 380 {
Note:
See TracChangeset
for help on using the changeset viewer.