Index: uspace/drv/nic/ar9271/hw.c
===================================================================
--- uspace/drv/nic/ar9271/hw.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/drv/nic/ar9271/hw.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -52,5 +52,5 @@
  *
  */
-static int hw_read_wait(ar9271_t *ar9271, uint32_t offset, uint32_t mask,
+static errno_t hw_read_wait(ar9271_t *ar9271, uint32_t offset, uint32_t mask,
     uint32_t value)
 {
@@ -67,5 +67,5 @@
 }
 
-static int hw_reset_power_on(ar9271_t *ar9271)
+static errno_t hw_reset_power_on(ar9271_t *ar9271)
 {
 	wmi_reg_t buffer[] = {
@@ -93,5 +93,5 @@
 	wmi_reg_write(ar9271->htc_device, AR9271_RTC_RESET, 1);
 	
-	int rc = hw_read_wait(ar9271,
+	errno_t rc = hw_read_wait(ar9271,
 	    AR9271_RTC_STATUS,
 	    AR9271_RTC_STATUS_MASK,
@@ -105,5 +105,5 @@
 }
 
-static int hw_set_reset(ar9271_t *ar9271, bool cold)
+static errno_t hw_set_reset(ar9271_t *ar9271, bool cold)
 {
 	uint32_t reset_value = AR9271_RTC_RC_MAC_WARM;
@@ -135,5 +135,5 @@
 	wmi_reg_write(ar9271->htc_device, AR9271_RTC_RC, 0);
 	
-	int rc = hw_read_wait(ar9271, AR9271_RTC_RC, AR9271_RTC_RC_MASK, 0);
+	errno_t rc = hw_read_wait(ar9271, AR9271_RTC_RC, AR9271_RTC_RC_MASK, 0);
 	if (rc != EOK) {
 		usb_log_error("Failed to wait for RTC RC register.\n");
@@ -148,5 +148,5 @@
 }
 
-static int hw_addr_init(ar9271_t *ar9271)
+static errno_t hw_addr_init(ar9271_t *ar9271)
 {
 	uint32_t value;
@@ -164,5 +164,5 @@
 	nic_t *nic = nic_get_from_ddf_dev(ar9271->ddf_dev);
 	
-	int rc = nic_report_address(nic, &ar9271_address);
+	errno_t rc = nic_report_address(nic, &ar9271_address);
 	if (rc != EOK) {
 		usb_log_error("Failed to report NIC HW address.\n");
@@ -173,5 +173,5 @@
 }
 
-static int hw_gpio_set_output(ar9271_t *ar9271, uint32_t gpio, uint32_t type)
+static errno_t hw_gpio_set_output(ar9271_t *ar9271, uint32_t gpio, uint32_t type)
 {
 	uint32_t address;
@@ -204,5 +204,5 @@
 }
 
-static int hw_gpio_set_value(ar9271_t *ar9271, uint32_t gpio, uint32_t value)
+static errno_t hw_gpio_set_value(ar9271_t *ar9271, uint32_t gpio, uint32_t value)
 {
 	wmi_reg_set_clear_bit(ar9271->htc_device, AR9271_GPIO_IN_OUT,
@@ -218,7 +218,7 @@
  *
  */
-static int hw_init_proc(ar9271_t *ar9271)
-{
-	int rc = hw_reset_power_on(ar9271);
+static errno_t hw_init_proc(ar9271_t *ar9271)
+{
+	errno_t rc = hw_reset_power_on(ar9271);
 	if (rc != EOK) {
 		usb_log_error("Failed to HW reset power on.\n");
@@ -241,7 +241,7 @@
 }
 
-static int hw_init_led(ar9271_t *ar9271)
-{
-	int rc = hw_gpio_set_output(ar9271, AR9271_LED_PIN,
+static errno_t hw_init_led(ar9271_t *ar9271)
+{
+	errno_t rc = hw_gpio_set_output(ar9271, AR9271_LED_PIN,
 	    AR9271_GPIO_OUT_MUX_AS_OUT);
 	if (rc != EOK) {
@@ -259,5 +259,5 @@
 }
 
-static int hw_activate_phy(ar9271_t *ar9271)
+static errno_t hw_activate_phy(ar9271_t *ar9271)
 {
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_ACTIVE, 1);
@@ -267,5 +267,5 @@
 }
 
-static int hw_set_operating_mode(ar9271_t *ar9271,
+static errno_t hw_set_operating_mode(ar9271_t *ar9271,
     ieee80211_operating_mode_t op_mode)
 {
@@ -295,7 +295,7 @@
 }
 
-static int hw_reset_operating_mode(ar9271_t *ar9271)
-{
-	int rc = hw_set_operating_mode(ar9271, IEEE80211_OPMODE_STATION);
+static errno_t hw_reset_operating_mode(ar9271_t *ar9271)
+{
+	errno_t rc = hw_set_operating_mode(ar9271, IEEE80211_OPMODE_STATION);
 	if (rc != EOK) {
 		usb_log_error("Failed to set opmode to station.\n");
@@ -306,5 +306,5 @@
 }
 
-static int hw_noise_floor_calibration(ar9271_t *ar9271)
+static errno_t hw_noise_floor_calibration(ar9271_t *ar9271)
 {
 	uint32_t value;
@@ -325,5 +325,5 @@
 	    AR9271_AGC_CONTROL_NF_CALIB);
 	
-	int rc = hw_read_wait(ar9271, AR9271_AGC_CONTROL,
+	errno_t rc = hw_read_wait(ar9271, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_CALIB, 0);
 	if (rc != EOK) {
@@ -344,5 +344,5 @@
 }
 
-static int hw_set_freq(ar9271_t *ar9271, uint16_t freq)
+static errno_t hw_set_freq(ar9271_t *ar9271, uint16_t freq)
 {
 	/* Not supported channel frequency. */
@@ -373,9 +373,9 @@
 }
 
-int hw_freq_switch(ar9271_t *ar9271, uint16_t freq)
+errno_t hw_freq_switch(ar9271_t *ar9271, uint16_t freq)
 {
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_RFBUS_KILL, 0x1);
 	
-	int rc = hw_read_wait(ar9271, AR9271_PHY_RFBUS_GRANT, 0x1, 0x1);
+	errno_t rc = hw_read_wait(ar9271, AR9271_PHY_RFBUS_GRANT, 0x1, 0x1);
 	if (rc != EOK) {
 		usb_log_error("Failed to kill RF bus.\n");
@@ -407,5 +407,5 @@
 }
 
-int hw_set_rx_filter(ar9271_t *ar9271, bool assoc)
+errno_t hw_set_rx_filter(ar9271_t *ar9271, bool assoc)
 {
 	uint32_t additional_bits = 0;
@@ -425,5 +425,5 @@
 }
 
-int hw_set_bssid(ar9271_t *ar9271)
+errno_t hw_set_bssid(ar9271_t *ar9271)
 {
 	ieee80211_dev_t *ieee80211_dev = ar9271->ieee80211_dev;
@@ -445,10 +445,10 @@
 }
 
-int hw_rx_init(ar9271_t *ar9271)
+errno_t hw_rx_init(ar9271_t *ar9271)
 {
 	wmi_reg_write(ar9271->htc_device, AR9271_COMMAND,
 	    AR9271_COMMAND_RX_ENABLE);
 	
-	int rc = hw_set_rx_filter(ar9271, false);
+	errno_t rc = hw_set_rx_filter(ar9271, false);
 	if (rc != EOK) {
 		usb_log_error("Failed to set RX filtering.\n");
@@ -465,5 +465,5 @@
 }
 
-static int hw_init_pll(ar9271_t *ar9271)
+static errno_t hw_init_pll(ar9271_t *ar9271)
 {
 	/* Some magic here (set for 2GHz channels). But VERY important :-) */
@@ -510,5 +510,5 @@
 }
 
-static int hw_calibration(ar9271_t *ar9271)
+static errno_t hw_calibration(ar9271_t *ar9271)
 {
 	wmi_reg_set_bit(ar9271->htc_device, AR9271_CARRIER_LEAK_CONTROL,
@@ -523,5 +523,5 @@
 	    AR9271_AGC_CONTROL_CALIB);
 	
-	int rc = hw_read_wait(ar9271, AR9271_AGC_CONTROL,
+	errno_t rc = hw_read_wait(ar9271, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_CALIB, 0);
 	if (rc != EOK) {
@@ -540,5 +540,5 @@
 }
 
-int hw_reset(ar9271_t *ar9271)
+errno_t hw_reset(ar9271_t *ar9271)
 {
 	/* Set physical layer as deactivated. */
@@ -559,5 +559,5 @@
 		hw_set_reset(ar9271, true);
 	
-	int rc = hw_init_pll(ar9271);
+	errno_t rc = hw_init_pll(ar9271);
 	if (rc != EOK) {
 		usb_log_error("Failed to init PLL.\n");
@@ -638,7 +638,7 @@
  * @return EOK if succeed, error code otherwise.
  */
-int hw_init(ar9271_t *ar9271)
-{
-	int rc = hw_init_proc(ar9271);
+errno_t hw_init(ar9271_t *ar9271)
+{
+	errno_t rc = hw_init_proc(ar9271);
 	if (rc != EOK) {
 		usb_log_error("Failed to HW reset device.\n");
