Index: uspace/drv/nic/ar9271/ar9271.c
===================================================================
--- uspace/drv/nic/ar9271/ar9271.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/ar9271.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -99,12 +99,12 @@
 
 /* Callback when new device is to be controlled by this driver. */
-static int ar9271_add_device(ddf_dev_t *);
+static errno_t ar9271_add_device(ddf_dev_t *);
 
 /* IEEE 802.11 callbacks */
-static int ar9271_ieee80211_start(ieee80211_dev_t *);
-static int ar9271_ieee80211_tx_handler(ieee80211_dev_t *, void *, size_t);
-static int ar9271_ieee80211_set_freq(ieee80211_dev_t *, uint16_t);
-static int ar9271_ieee80211_bssid_change(ieee80211_dev_t *, bool);
-static int ar9271_ieee80211_key_config(ieee80211_dev_t *, ieee80211_key_config_t *,
+static errno_t ar9271_ieee80211_start(ieee80211_dev_t *);
+static errno_t ar9271_ieee80211_tx_handler(ieee80211_dev_t *, void *, size_t);
+static errno_t ar9271_ieee80211_set_freq(ieee80211_dev_t *, uint16_t);
+static errno_t ar9271_ieee80211_bssid_change(ieee80211_dev_t *, bool);
+static errno_t ar9271_ieee80211_key_config(ieee80211_dev_t *, ieee80211_key_config_t *,
     bool);
 
@@ -128,7 +128,7 @@
 static ieee80211_iface_t ar9271_ieee80211_iface;
 
-static int ar9271_get_device_info(ddf_fun_t *, nic_device_info_t *);
-static int ar9271_get_cable_state(ddf_fun_t *, nic_cable_state_t *);
-static int ar9271_get_operation_mode(ddf_fun_t *, int *, nic_channel_mode_t *,
+static errno_t ar9271_get_device_info(ddf_fun_t *, nic_device_info_t *);
+static errno_t ar9271_get_cable_state(ddf_fun_t *, nic_cable_state_t *);
+static errno_t ar9271_get_operation_mode(ddf_fun_t *, int *, nic_channel_mode_t *,
     nic_role_t *);
 
@@ -144,5 +144,5 @@
  *
  */
-static int ar9271_get_device_info(ddf_fun_t *dev, nic_device_info_t *info)
+static errno_t ar9271_get_device_info(ddf_fun_t *dev, nic_device_info_t *info)
 {
 	assert(dev);
@@ -164,5 +164,5 @@
  *
  */
-static int ar9271_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
+static errno_t ar9271_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
 {
 	*state = NIC_CS_PLUGGED;
@@ -174,5 +174,5 @@
  *
  */
-static int ar9271_get_operation_mode(ddf_fun_t *fun, int *speed,
+static errno_t ar9271_get_operation_mode(ddf_fun_t *fun, int *speed,
     nic_channel_mode_t *duplex, nic_role_t *role)
 {
@@ -187,5 +187,5 @@
  *
  */
-static int ar9271_on_multicast_mode_change(nic_t *nic,
+static errno_t ar9271_on_multicast_mode_change(nic_t *nic,
     nic_multicast_mode_t mode, const nic_address_t *addr, size_t addr_cnt)
 {
@@ -210,5 +210,5 @@
  *
  */
-static int ar9271_on_unicast_mode_change(nic_t *nic, nic_unicast_mode_t mode,
+static errno_t ar9271_on_unicast_mode_change(nic_t *nic, nic_unicast_mode_t mode,
     const nic_address_t *addr, size_t addr_cnt)
 {
@@ -236,5 +236,5 @@
  *
  */
-static int ar9271_on_broadcast_mode_change(nic_t *nic,
+static errno_t ar9271_on_broadcast_mode_change(nic_t *nic,
     nic_broadcast_mode_t mode)
 {
@@ -258,5 +258,5 @@
 }
 
-static int ar9271_data_polling(void *arg)
+static errno_t ar9271_data_polling(void *arg)
 {
 	assert(arg);
@@ -319,5 +319,5 @@
  *
  */
-static int ar9271_ieee80211_set_freq(ieee80211_dev_t *ieee80211_dev,
+static errno_t ar9271_ieee80211_set_freq(ieee80211_dev_t *ieee80211_dev,
     uint16_t freq)
 {
@@ -330,5 +330,5 @@
 	wmi_send_command(ar9271->htc_device, WMI_STOP_RECV, NULL, 0, NULL);
 	
-	int rc = hw_freq_switch(ar9271, freq);
+	errno_t rc = hw_freq_switch(ar9271, freq);
 	if (rc != EOK) {
 		usb_log_error("Failed to HW switch frequency.\n");
@@ -352,5 +352,5 @@
 }
 
-static int ar9271_ieee80211_bssid_change(ieee80211_dev_t *ieee80211_dev,
+static errno_t ar9271_ieee80211_bssid_change(ieee80211_dev_t *ieee80211_dev,
     bool connected)
 {
@@ -401,5 +401,5 @@
 }
 
-static int ar9271_ieee80211_key_config(ieee80211_dev_t *ieee80211_dev,
+static errno_t ar9271_ieee80211_key_config(ieee80211_dev_t *ieee80211_dev,
     ieee80211_key_config_t *key_conf, bool insert)
 {
@@ -519,5 +519,5 @@
 }
 
-static int ar9271_ieee80211_tx_handler(ieee80211_dev_t *ieee80211_dev,
+static errno_t ar9271_ieee80211_tx_handler(ieee80211_dev_t *ieee80211_dev,
     void *buffer, size_t buffer_size)
 {
@@ -608,5 +608,5 @@
 }
 
-static int ar9271_ieee80211_start(ieee80211_dev_t *ieee80211_dev)
+static errno_t ar9271_ieee80211_start(ieee80211_dev_t *ieee80211_dev)
 {
 	assert(ieee80211_dev);
@@ -616,5 +616,5 @@
 	wmi_send_command(ar9271->htc_device, WMI_FLUSH_RECV, NULL, 0, NULL);
 	
-	int rc = hw_reset(ar9271);
+	errno_t rc = hw_reset(ar9271);
 	if (rc != EOK) {
 		usb_log_error("Failed to do HW reset.\n");
@@ -666,5 +666,5 @@
 }
 
-static int ar9271_init(ar9271_t *ar9271, usb_device_t *usb_device, const usb_endpoint_description_t **endpoints)
+static errno_t ar9271_init(ar9271_t *ar9271, usb_device_t *usb_device, const usb_endpoint_description_t **endpoints)
 {
 	ar9271->starting_up = true;
@@ -680,5 +680,5 @@
 	}
 	
-	int rc = ath_usb_init(ar9271->ath_device, usb_device, endpoints);
+	errno_t rc = ath_usb_init(ar9271->ath_device, usb_device, endpoints);
 	if (rc != EOK) {
 		free(ar9271->ath_device);
@@ -737,5 +737,5 @@
  *
  */
-static int ar9271_upload_fw(ar9271_t *ar9271)
+static errno_t ar9271_upload_fw(ar9271_t *ar9271)
 {
 	usb_device_t *usb_device = ar9271->usb_device;
@@ -775,5 +775,5 @@
 		memcpy(buffer, current_data, chunk_size);
 		usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device);
-		int rc = usb_control_request_set(ctrl_pipe,
+		errno_t rc = usb_control_request_set(ctrl_pipe,
 		    USB_REQUEST_TYPE_VENDOR,
 		    USB_REQUEST_RECIPIENT_DEVICE,
@@ -803,5 +803,5 @@
 	*/
 	usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device);
-	int rc = usb_control_request_set(ctrl_pipe,
+	errno_t rc = usb_control_request_set(ctrl_pipe,
 	    USB_REQUEST_TYPE_VENDOR,
 	    USB_REQUEST_RECIPIENT_DEVICE,
@@ -834,5 +834,5 @@
 	/* USB framework initialization. */
 	const char *err_msg = NULL;
-	int rc = usb_device_create_ddf(dev, endpoints, &err_msg);
+	errno_t rc = usb_device_create_ddf(dev, endpoints, &err_msg);
 	if (rc != EOK) {
 		usb_log_error("Failed to create USB device: %s, "
@@ -879,5 +879,5 @@
  * @return EOK if succeed, error code otherwise
  */
-static int ar9271_add_device(ddf_dev_t *dev)
+static errno_t ar9271_add_device(ddf_dev_t *dev)
 {
 	assert(dev);
@@ -896,5 +896,5 @@
 	
 	/* Initialize AR9271 HTC services. */
-	int rc = htc_init(ar9271->htc_device);
+	errno_t rc = htc_init(ar9271->htc_device);
 	if (rc != EOK) {
 		ar9271_delete_dev_data(ar9271);
Index: uspace/drv/nic/ar9271/ath.h
===================================================================
--- uspace/drv/nic/ar9271/ath.h	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/ath.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -40,8 +40,8 @@
 /** Atheros wifi operations. */
 typedef struct {
-	int (*send_ctrl_message)(struct ath *, void *, size_t);
-	int (*read_ctrl_message)(struct ath *, void *, size_t, size_t *);
-	int (*send_data_message)(struct ath *, void *, size_t);
-	int (*read_data_message)(struct ath *, void *, size_t, size_t *);
+	errno_t (*send_ctrl_message)(struct ath *, void *, size_t);
+	errno_t (*read_ctrl_message)(struct ath *, void *, size_t, size_t *);
+	errno_t (*send_data_message)(struct ath *, void *, size_t);
+	errno_t (*read_data_message)(struct ath *, void *, size_t, size_t *);
 } ath_ops_t;
 
Index: uspace/drv/nic/ar9271/ath_usb.c
===================================================================
--- uspace/drv/nic/ar9271/ath_usb.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/ath_usb.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -39,8 +39,8 @@
 #include "ath_usb.h"
 
-static int ath_usb_send_ctrl_message(ath_t *, void *, size_t);
-static int ath_usb_read_ctrl_message(ath_t *, void *, size_t, size_t *);
-static int ath_usb_send_data_message(ath_t *, void *, size_t);
-static int ath_usb_read_data_message(ath_t *, void *, size_t, size_t *);
+static errno_t ath_usb_send_ctrl_message(ath_t *, void *, size_t);
+static errno_t ath_usb_read_ctrl_message(ath_t *, void *, size_t, size_t *);
+static errno_t ath_usb_send_data_message(ath_t *, void *, size_t);
+static errno_t ath_usb_read_data_message(ath_t *, void *, size_t, size_t *);
 
 static ath_ops_t ath_usb_ops = {
@@ -59,5 +59,5 @@
  *
  */
-int ath_usb_init(ath_t *ath, usb_device_t *usb_device, const usb_endpoint_description_t **endpoints)
+errno_t ath_usb_init(ath_t *ath, usb_device_t *usb_device, const usb_endpoint_description_t **endpoints)
 {
 	ath_usb_t *ath_usb = malloc(sizeof(ath_usb_t));
@@ -110,5 +110,5 @@
  *
  */
-static int ath_usb_send_ctrl_message(ath_t *ath, void *buffer,
+static errno_t ath_usb_send_ctrl_message(ath_t *ath, void *buffer,
     size_t buffer_size)
 {
@@ -127,5 +127,5 @@
  *
  */
-static int ath_usb_read_ctrl_message(ath_t *ath, void *buffer,
+static errno_t ath_usb_read_ctrl_message(ath_t *ath, void *buffer,
     size_t buffer_size, size_t *transferred_size)
 {
@@ -143,5 +143,5 @@
  *
  */
-static int ath_usb_send_data_message(ath_t *ath, void *buffer,
+static errno_t ath_usb_send_data_message(ath_t *ath, void *buffer,
     size_t buffer_size)
 {
@@ -158,6 +158,6 @@
 	
 	ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data;
-	int ret_val = usb_pipe_write(ath_usb->output_data_pipe, complete_buffer,
-	    complete_buffer_size);
+	const errno_t ret_val = usb_pipe_write(ath_usb->output_data_pipe,
+	    complete_buffer, complete_buffer_size);
 	
 	free(complete_buffer);
@@ -176,5 +176,5 @@
  *
  */
-static int ath_usb_read_data_message(ath_t *ath, void *buffer,
+static errno_t ath_usb_read_data_message(ath_t *ath, void *buffer,
     size_t buffer_size, size_t *transferred_size)
 {
Index: uspace/drv/nic/ar9271/ath_usb.h
===================================================================
--- uspace/drv/nic/ar9271/ath_usb.h	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/ath_usb.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -59,5 +59,5 @@
 } ath_usb_data_header_t;
 
-extern int ath_usb_init(ath_t *, usb_device_t *, const usb_endpoint_description_t **endpoints);
+extern errno_t ath_usb_init(ath_t *, usb_device_t *, const usb_endpoint_description_t **endpoints);
 
 #endif  /* ATHEROS_ATH_USB_H */
Index: uspace/drv/nic/ar9271/htc.c
===================================================================
--- uspace/drv/nic/ar9271/htc.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/htc.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -66,5 +66,5 @@
 }
 
-int htc_init_new_vif(htc_device_t *htc_device)
+errno_t htc_init_new_vif(htc_device_t *htc_device)
 {
 	htc_vif_msg_t vif_msg;
@@ -153,5 +153,5 @@
  *
  */
-int htc_send_control_message(htc_device_t *htc_device, void *buffer,
+errno_t htc_send_control_message(htc_device_t *htc_device, void *buffer,
     size_t buffer_size, uint8_t endpoint_id)
 {
@@ -176,5 +176,5 @@
  *
  */
-int htc_send_data_message(htc_device_t *htc_device, void *buffer,
+errno_t htc_send_data_message(htc_device_t *htc_device, void *buffer,
     size_t buffer_size, uint8_t endpoint_id)
 {
@@ -199,5 +199,5 @@
  *
  */
-int htc_read_data_message(htc_device_t *htc_device, void *buffer,
+errno_t htc_read_data_message(htc_device_t *htc_device, void *buffer,
     size_t buffer_size, size_t *transferred_size)
 {
@@ -219,5 +219,5 @@
  *
  */
-int htc_read_control_message(htc_device_t *htc_device, void *buffer,
+errno_t htc_read_control_message(htc_device_t *htc_device, void *buffer,
     size_t buffer_size, size_t *transferred_size)
 {
@@ -239,5 +239,5 @@
  *
  */
-static int htc_connect_service(htc_device_t *htc_device,
+static errno_t htc_connect_service(htc_device_t *htc_device,
     wmi_services_t service_id, int *response_endpoint_no)
 {
@@ -261,5 +261,5 @@
 	
 	/* Send HTC message. */
-	int rc = htc_send_control_message(htc_device, buffer, buffer_size,
+	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
 	    htc_device->endpoints.ctrl_endpoint);
 	if (rc != EOK) {
@@ -312,5 +312,5 @@
  *
  */
-static int htc_config_credits(htc_device_t *htc_device)
+static errno_t htc_config_credits(htc_device_t *htc_device)
 {
 	size_t buffer_size = sizeof(htc_frame_header_t) +
@@ -327,5 +327,5 @@
 	
 	/* Send HTC message. */
-	int rc = htc_send_control_message(htc_device, buffer, buffer_size,
+	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
 	    htc_device->endpoints.ctrl_endpoint);
 	if (rc != EOK) {
@@ -360,5 +360,5 @@
  *
  */
-static int htc_complete_setup(htc_device_t *htc_device)
+static errno_t htc_complete_setup(htc_device_t *htc_device)
 {
 	size_t buffer_size = sizeof(htc_frame_header_t) +
@@ -373,5 +373,5 @@
 	
 	/* Send HTC message. */
-	int rc = htc_send_control_message(htc_device, buffer, buffer_size,
+	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
 	    htc_device->endpoints.ctrl_endpoint);
 	if (rc != EOK)
@@ -394,5 +394,5 @@
  *
  */
-static int htc_check_ready(htc_device_t *htc_device)
+static errno_t htc_check_ready(htc_device_t *htc_device)
 {
 	size_t buffer_size = htc_device->ath_device->ctrl_response_length;
@@ -400,5 +400,5 @@
 	
 	/* Read response from device. */
-	int rc = htc_read_control_message(htc_device, buffer, buffer_size,
+	errno_t rc = htc_read_control_message(htc_device, buffer, buffer_size,
 	    NULL);
 	if (rc != EOK) {
@@ -430,5 +430,5 @@
  *
  */
-int htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev,
+errno_t htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev,
     htc_device_t *htc_device)
 {
@@ -451,8 +451,8 @@
  *
  */
-int htc_init(htc_device_t *htc_device)
+errno_t htc_init(htc_device_t *htc_device)
 {
 	/* First check ready message in device. */
-	int rc = htc_check_ready(htc_device);
+	errno_t rc = htc_check_ready(htc_device);
 	if (rc != EOK) {
 		usb_log_error("Device is not in ready state after loading "
Index: uspace/drv/nic/ar9271/htc.h
===================================================================
--- uspace/drv/nic/ar9271/htc.h	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/htc.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -297,11 +297,11 @@
 } __attribute__((packed)) htc_setup_complete_msg_t;
 
-extern int htc_device_init(ath_t *, ieee80211_dev_t *, htc_device_t *);
-extern int htc_init(htc_device_t *);
-extern int htc_init_new_vif(htc_device_t *);
-extern int htc_read_control_message(htc_device_t *, void *, size_t, size_t *);
-extern int htc_read_data_message(htc_device_t *, void *, size_t, size_t *);
-extern int htc_send_control_message(htc_device_t *, void *, size_t, uint8_t);
-extern int htc_send_data_message(htc_device_t *, void *, size_t, uint8_t);
+extern errno_t htc_device_init(ath_t *, ieee80211_dev_t *, htc_device_t *);
+extern errno_t htc_init(htc_device_t *);
+extern errno_t htc_init_new_vif(htc_device_t *);
+extern errno_t htc_read_control_message(htc_device_t *, void *, size_t, size_t *);
+extern errno_t htc_read_data_message(htc_device_t *, void *, size_t, size_t *);
+extern errno_t htc_send_control_message(htc_device_t *, void *, size_t, uint8_t);
+extern errno_t htc_send_data_message(htc_device_t *, void *, size_t, uint8_t);
 
 #endif  /* ATHEROS_HTC_H */
Index: uspace/drv/nic/ar9271/hw.c
===================================================================
--- uspace/drv/nic/ar9271/hw.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/hw.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -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");
Index: uspace/drv/nic/ar9271/hw.h
===================================================================
--- uspace/drv/nic/ar9271/hw.h	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/hw.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -41,10 +41,10 @@
 #define HW_WAIT_TIME_US  10
 
-extern int hw_init(ar9271_t *);
-extern int hw_freq_switch(ar9271_t *, uint16_t);
-extern int hw_rx_init(ar9271_t *);
-extern int hw_reset(ar9271_t *);
-extern int hw_set_bssid(ar9271_t *);
-extern int hw_set_rx_filter(ar9271_t *, bool);
+extern errno_t hw_init(ar9271_t *);
+extern errno_t hw_freq_switch(ar9271_t *, uint16_t);
+extern errno_t hw_rx_init(ar9271_t *);
+extern errno_t hw_reset(ar9271_t *);
+extern errno_t hw_set_bssid(ar9271_t *);
+extern errno_t hw_set_rx_filter(ar9271_t *, bool);
 
 #endif  /* ATHEROS_HW_H */
Index: uspace/drv/nic/ar9271/wmi.c
===================================================================
--- uspace/drv/nic/ar9271/wmi.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/wmi.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -50,5 +50,5 @@
  *
  */
-int wmi_reg_read(htc_device_t *htc_device, uint32_t reg_offset, uint32_t *res)
+errno_t wmi_reg_read(htc_device_t *htc_device, uint32_t reg_offset, uint32_t *res)
 {
 	uint32_t cmd_value = host2uint32_t_be(reg_offset);
@@ -57,5 +57,5 @@
 	    malloc(htc_device->ath_device->ctrl_response_length);
 	
-	int rc = wmi_send_command(htc_device, WMI_REG_READ,
+	errno_t rc = wmi_send_command(htc_device, WMI_REG_READ,
 	    (uint8_t *) &cmd_value, sizeof(cmd_value), resp_buffer);
 	
@@ -82,5 +82,5 @@
  *
  */
-int wmi_reg_write(htc_device_t *htc_device, uint32_t reg_offset, uint32_t val)
+errno_t wmi_reg_write(htc_device_t *htc_device, uint32_t reg_offset, uint32_t val)
 {
 	uint32_t cmd_buffer[] = {
@@ -92,5 +92,5 @@
 	    malloc(htc_device->ath_device->ctrl_response_length);
 	
-	int rc = wmi_send_command(htc_device, WMI_REG_WRITE,
+	errno_t rc = wmi_send_command(htc_device, WMI_REG_WRITE,
 	    (uint8_t *) &cmd_buffer, sizeof(cmd_buffer), resp_buffer);
 	
@@ -115,10 +115,10 @@
  *
  */
-int wmi_reg_set_clear_bit(htc_device_t *htc_device, uint32_t reg_offset,
+errno_t wmi_reg_set_clear_bit(htc_device_t *htc_device, uint32_t reg_offset,
     uint32_t set_bit, uint32_t clear_bit)
 {
 	uint32_t value;
 	
-	int rc = wmi_reg_read(htc_device, reg_offset, &value);
+	errno_t rc = wmi_reg_read(htc_device, reg_offset, &value);
 	if (rc != EOK) {
 		usb_log_error("Failed to read registry value in RMW "
@@ -149,5 +149,5 @@
  *
  */
-int wmi_reg_set_bit(htc_device_t *htc_device, uint32_t reg_offset,
+errno_t wmi_reg_set_bit(htc_device_t *htc_device, uint32_t reg_offset,
     uint32_t set_bit)
 {
@@ -164,5 +164,5 @@
  *
  */
-int wmi_reg_clear_bit(htc_device_t *htc_device, uint32_t reg_offset,
+errno_t wmi_reg_clear_bit(htc_device_t *htc_device, uint32_t reg_offset,
     uint32_t clear_bit)
 {
@@ -179,5 +179,5 @@
  *
  */
-int wmi_reg_buffer_write(htc_device_t *htc_device, wmi_reg_t *reg_buffer,
+errno_t wmi_reg_buffer_write(htc_device_t *htc_device, wmi_reg_t *reg_buffer,
     size_t elements)
 {
@@ -198,5 +198,5 @@
 	}
 	
-	int rc = wmi_send_command(htc_device, WMI_REG_WRITE,
+	errno_t rc = wmi_send_command(htc_device, WMI_REG_WRITE,
 	    (uint8_t *) buffer, buffer_size, resp_buffer);
 	
@@ -223,5 +223,5 @@
  *
  */
-int wmi_send_command(htc_device_t *htc_device, wmi_command_t command_id,
+errno_t wmi_send_command(htc_device_t *htc_device, wmi_command_t command_id,
     uint8_t *command_buffer, uint32_t command_length, void *response_buffer)
 {
@@ -242,5 +242,5 @@
 	
 	/* Send message. */
-	int rc = htc_send_control_message(htc_device, buffer, buffer_size,
+	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
 	    htc_device->endpoints.wmi_endpoint);
 	if (rc != EOK) {
Index: uspace/drv/nic/ar9271/wmi.h
===================================================================
--- uspace/drv/nic/ar9271/wmi.h	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ar9271/wmi.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -117,11 +117,11 @@
 } wmi_reg_t;
 
-extern int wmi_reg_read(htc_device_t *, uint32_t, uint32_t *);
-extern int wmi_reg_write(htc_device_t *, uint32_t, uint32_t);
-extern int wmi_reg_set_clear_bit(htc_device_t *, uint32_t, uint32_t, uint32_t);
-extern int wmi_reg_set_bit(htc_device_t *, uint32_t, uint32_t);
-extern int wmi_reg_clear_bit(htc_device_t *, uint32_t, uint32_t);
-extern int wmi_reg_buffer_write(htc_device_t *, wmi_reg_t *, size_t);
-extern int wmi_send_command(htc_device_t *, wmi_command_t, uint8_t *, uint32_t,
+extern errno_t wmi_reg_read(htc_device_t *, uint32_t, uint32_t *);
+extern errno_t wmi_reg_write(htc_device_t *, uint32_t, uint32_t);
+extern errno_t wmi_reg_set_clear_bit(htc_device_t *, uint32_t, uint32_t, uint32_t);
+extern errno_t wmi_reg_set_bit(htc_device_t *, uint32_t, uint32_t);
+extern errno_t wmi_reg_clear_bit(htc_device_t *, uint32_t, uint32_t);
+extern errno_t wmi_reg_buffer_write(htc_device_t *, wmi_reg_t *, size_t);
+extern errno_t wmi_send_command(htc_device_t *, wmi_command_t, uint8_t *, uint32_t,
     void *);
 
Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/e1k/e1k.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -179,22 +179,22 @@
 FIBRIL_MUTEX_INITIALIZE(irq_reg_mutex);
 
-static int e1000_get_address(e1000_t *, nic_address_t *);
+static errno_t e1000_get_address(e1000_t *, nic_address_t *);
 static void e1000_eeprom_get_address(e1000_t *, nic_address_t *);
-static int e1000_set_addr(ddf_fun_t *, const nic_address_t *);
-
-static int e1000_defective_get_mode(ddf_fun_t *, uint32_t *);
-static int e1000_defective_set_mode(ddf_fun_t *, uint32_t);
-
-static int e1000_get_cable_state(ddf_fun_t *, nic_cable_state_t *);
-static int e1000_get_device_info(ddf_fun_t *, nic_device_info_t *);
-static int e1000_get_operation_mode(ddf_fun_t *, int *,
+static errno_t e1000_set_addr(ddf_fun_t *, const nic_address_t *);
+
+static errno_t e1000_defective_get_mode(ddf_fun_t *, uint32_t *);
+static errno_t e1000_defective_set_mode(ddf_fun_t *, uint32_t);
+
+static errno_t e1000_get_cable_state(ddf_fun_t *, nic_cable_state_t *);
+static errno_t e1000_get_device_info(ddf_fun_t *, nic_device_info_t *);
+static errno_t e1000_get_operation_mode(ddf_fun_t *, int *,
     nic_channel_mode_t *, nic_role_t *);
-static int e1000_set_operation_mode(ddf_fun_t *, int,
+static errno_t e1000_set_operation_mode(ddf_fun_t *, int,
     nic_channel_mode_t, nic_role_t);
-static int e1000_autoneg_enable(ddf_fun_t *, uint32_t);
-static int e1000_autoneg_disable(ddf_fun_t *);
-static int e1000_autoneg_restart(ddf_fun_t *);
-
-static int e1000_vlan_set_tag(ddf_fun_t *, uint16_t, bool, bool);
+static errno_t e1000_autoneg_enable(ddf_fun_t *, uint32_t);
+static errno_t e1000_autoneg_disable(ddf_fun_t *);
+static errno_t e1000_autoneg_restart(ddf_fun_t *);
+
+static errno_t e1000_vlan_set_tag(ddf_fun_t *, uint16_t, bool, bool);
 
 /** Network interface options for E1000 card driver */
@@ -219,5 +219,5 @@
 static ddf_dev_ops_t e1000_dev_ops;
 
-static int e1000_dev_add(ddf_dev_t *);
+static errno_t e1000_dev_add(ddf_dev_t *);
 
 /** Basic driver operations for E1000 driver */
@@ -233,6 +233,6 @@
 
 /* The default implementation callbacks */
-static int e1000_on_activating(nic_t *);
-static int e1000_on_stopping(nic_t *);
+static errno_t e1000_on_activating(nic_t *);
+static errno_t e1000_on_stopping(nic_t *);
 static void e1000_send_frame(nic_t *, void *, size_t);
 
@@ -288,5 +288,5 @@
  *
  */
-static int e1000_get_device_info(ddf_fun_t *dev, nic_device_info_t *info)
+static errno_t e1000_get_device_info(ddf_fun_t *dev, nic_device_info_t *info)
 {
 	assert(dev);
@@ -316,5 +316,5 @@
  *
  */
-static int e1000_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
+static errno_t e1000_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
@@ -335,5 +335,5 @@
  *
  */
-static int e1000_get_operation_mode(ddf_fun_t *fun, int *speed,
+static errno_t e1000_get_operation_mode(ddf_fun_t *fun, int *speed,
     nic_channel_mode_t *duplex, nic_role_t *role)
 {
@@ -386,5 +386,5 @@
  *
  */
-static int e1000_set_operation_mode(ddf_fun_t *fun, int speed,
+static errno_t e1000_set_operation_mode(ddf_fun_t *fun, int speed,
     nic_channel_mode_t duplex, nic_role_t role)
 {
@@ -434,5 +434,5 @@
  *
  */
-static int e1000_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement)
+static errno_t e1000_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement)
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
@@ -462,5 +462,5 @@
  *
  */
-static int e1000_autoneg_disable(ddf_fun_t *fun)
+static errno_t e1000_autoneg_disable(ddf_fun_t *fun)
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
@@ -490,5 +490,5 @@
  *
  */
-static int e1000_autoneg_restart(ddf_fun_t *dev)
+static errno_t e1000_autoneg_restart(ddf_fun_t *dev)
 {
 	return e1000_autoneg_enable(dev, 0);
@@ -501,5 +501,5 @@
  *
  */
-static int e1000_defective_get_mode(ddf_fun_t *fun, uint32_t *mode)
+static errno_t e1000_defective_get_mode(ddf_fun_t *fun, uint32_t *mode)
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
@@ -522,8 +522,8 @@
  *
  */
-static int e1000_defective_set_mode(ddf_fun_t *fun, uint32_t mode)
+static errno_t e1000_defective_set_mode(ddf_fun_t *fun, uint32_t mode)
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
-	int rc = EOK;
+	errno_t rc = EOK;
 	
 	fibril_mutex_lock(&e1000->rx_lock);
@@ -827,9 +827,9 @@
  *
  */
-static int e1000_on_multicast_mode_change(nic_t *nic, nic_multicast_mode_t mode,
+static errno_t e1000_on_multicast_mode_change(nic_t *nic, nic_multicast_mode_t mode,
     const nic_address_t *addr, size_t addr_cnt)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	int rc = EOK;
+	errno_t rc = EOK;
 	
 	fibril_mutex_lock(&e1000->rx_lock);
@@ -881,9 +881,9 @@
  *
  */
-static int e1000_on_unicast_mode_change(nic_t *nic, nic_unicast_mode_t mode,
+static errno_t e1000_on_unicast_mode_change(nic_t *nic, nic_unicast_mode_t mode,
     const nic_address_t *addr, size_t addr_cnt)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	int rc = EOK;
+	errno_t rc = EOK;
 	
 	fibril_mutex_lock(&e1000->rx_lock);
@@ -937,8 +937,8 @@
  *
  */
-static int e1000_on_broadcast_mode_change(nic_t *nic, nic_broadcast_mode_t mode)
+static errno_t e1000_on_broadcast_mode_change(nic_t *nic, nic_broadcast_mode_t mode)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	int rc = EOK;
+	errno_t rc = EOK;
 	
 	fibril_mutex_lock(&e1000->rx_lock);
@@ -1048,5 +1048,5 @@
  *
  */
-static int e1000_vlan_set_tag(ddf_fun_t *fun, uint16_t tag, bool add,
+static errno_t e1000_vlan_set_tag(ddf_fun_t *fun, uint16_t tag, bool add,
     bool strip)
 {
@@ -1264,5 +1264,5 @@
  *
  */
-inline static int e1000_register_int_handler(nic_t *nic, cap_handle_t *handle)
+inline static errno_t e1000_register_int_handler(nic_t *nic, cap_handle_t *handle)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
@@ -1275,5 +1275,5 @@
 	e1000_irq_code.cmds[2].addr = e1000->reg_base_phys + E1000_IMC;
 	
-	int rc = register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq,
+	errno_t rc = register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq,
 	    e1000_interrupt_handler, &e1000_irq_code, handle);
 	
@@ -1319,5 +1319,5 @@
  *
  */
-static int e1000_poll_mode_change(nic_t *nic, nic_poll_mode_t mode,
+static errno_t e1000_poll_mode_change(nic_t *nic, nic_poll_mode_t mode,
     const struct timeval *period)
 {
@@ -1373,5 +1373,5 @@
  *
  */
-static int e1000_initialize_rx_structure(nic_t *nic)
+static errno_t e1000_initialize_rx_structure(nic_t *nic)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
@@ -1379,5 +1379,5 @@
 	
 	e1000->rx_ring_virt = AS_AREA_ANY;
-	int rc = dmamem_map_anonymous(
+	errno_t rc = dmamem_map_anonymous(
 	    E1000_RX_FRAME_COUNT * sizeof(e1000_rx_descriptor_t),
 	    DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0,
@@ -1567,5 +1567,5 @@
  *
  */
-static int e1000_initialize_tx_structure(e1000_t *e1000)
+static errno_t e1000_initialize_tx_structure(e1000_t *e1000)
 {
 	size_t i;
@@ -1579,5 +1579,5 @@
 	e1000->tx_frame_virt = NULL;
 	
-	int rc = dmamem_map_anonymous(
+	errno_t rc = dmamem_map_anonymous(
 	    E1000_TX_FRAME_COUNT * sizeof(e1000_tx_descriptor_t),
 	    DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0,
@@ -1718,5 +1718,5 @@
  *
  */
-static int e1000_reset(nic_t *nic)
+static errno_t e1000_reset(nic_t *nic)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
@@ -1749,5 +1749,5 @@
  *
  */
-static int e1000_on_activating(nic_t *nic)
+static errno_t e1000_on_activating(nic_t *nic)
 {
 	assert(nic);
@@ -1761,5 +1761,5 @@
 	e1000_enable_interrupts(e1000);
 	
-	int rc = hw_res_enable_interrupt(e1000->parent_sess, e1000->irq);
+	errno_t rc = hw_res_enable_interrupt(e1000->parent_sess, e1000->irq);
 	if (rc != EOK) {
 		e1000_disable_interrupts(e1000);
@@ -1795,5 +1795,5 @@
  *
  */
-static int e1000_on_down_unlocked(nic_t *nic)
+static errno_t e1000_on_down_unlocked(nic_t *nic)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
@@ -1826,5 +1826,5 @@
  *
  */
-static int e1000_on_down(nic_t *nic)
+static errno_t e1000_on_down(nic_t *nic)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
@@ -1834,5 +1834,5 @@
 	fibril_mutex_lock(&e1000->ctrl_lock);
 	
-	int rc = e1000_on_down_unlocked(nic);
+	errno_t rc = e1000_on_down_unlocked(nic);
 	
 	fibril_mutex_unlock(&e1000->ctrl_lock);
@@ -1851,5 +1851,5 @@
  *
  */
-static int e1000_on_stopping(nic_t *nic)
+static errno_t e1000_on_stopping(nic_t *nic)
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
@@ -1859,5 +1859,5 @@
 	fibril_mutex_lock(&e1000->ctrl_lock);
 	
-	int rc = e1000_on_down_unlocked(nic);
+	errno_t rc = e1000_on_down_unlocked(nic);
 	if (rc == EOK)
 		rc = e1000_reset(nic);
@@ -1943,5 +1943,5 @@
  *
  */
-static int e1000_fill_resource_info(ddf_dev_t *dev,
+static errno_t e1000_fill_resource_info(ddf_dev_t *dev,
     const hw_res_list_parsed_t *hw_resources)
 {
@@ -1968,5 +1968,5 @@
  *
  */
-static int e1000_get_resource_info(ddf_dev_t *dev)
+static errno_t e1000_get_resource_info(ddf_dev_t *dev)
 {
 	assert(dev != NULL);
@@ -1977,5 +1977,5 @@
 	
 	/* Get hw resources form parent driver */
-	int rc = nic_get_resources(NIC_DATA_DEV(dev), &hw_res_parsed);
+	errno_t rc = nic_get_resources(NIC_DATA_DEV(dev), &hw_res_parsed);
 	if (rc != EOK)
 		return rc;
@@ -1996,5 +1996,5 @@
  *
  */
-static int e1000_device_initialize(ddf_dev_t *dev)
+static errno_t e1000_device_initialize(ddf_dev_t *dev)
 {
 	/* Allocate driver data for the device. */
@@ -2012,5 +2012,5 @@
 	
 	/* Obtain and fill hardware resources info */
-	int rc = e1000_get_resource_info(dev);
+	errno_t rc = e1000_get_resource_info(dev);
 	if (rc != EOK) {
 		ddf_msg(LVL_ERROR, "Cannot obtain hardware resources");
@@ -2110,9 +2110,9 @@
  *
  */
-static int e1000_pio_enable(ddf_dev_t *dev)
+static errno_t e1000_pio_enable(ddf_dev_t *dev)
 {
 	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
 	
-	int rc = pio_enable(e1000->reg_base_phys, 8 * PAGE_SIZE,
+	errno_t rc = pio_enable(e1000->reg_base_phys, 8 * PAGE_SIZE,
 	    &e1000->reg_base_virt);
 	if (rc != EOK)
@@ -2127,10 +2127,10 @@
  *
  */
-int e1000_dev_add(ddf_dev_t *dev)
+errno_t e1000_dev_add(ddf_dev_t *dev)
 {
 	ddf_fun_t *fun;
 	
 	/* Initialize device structure for E1000 */
-	int rc = e1000_device_initialize(dev);
+	errno_t rc = e1000_device_initialize(dev);
 	if (rc != EOK)
 		return rc;
@@ -2258,5 +2258,5 @@
  *
  */
-static int e1000_get_address(e1000_t *e1000, nic_address_t *address)
+static errno_t e1000_get_address(e1000_t *e1000, nic_address_t *address)
 {
 	fibril_mutex_lock(&e1000->rx_lock);
@@ -2291,5 +2291,5 @@
  * @return An error code otherwise
  */
-static int e1000_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
+static errno_t e1000_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
 {
 	nic_t *nic = NIC_DATA_FUN(fun);
@@ -2299,5 +2299,5 @@
 	fibril_mutex_lock(&e1000->tx_lock);
 	
-	int rc = nic_report_address(nic, addr);
+	errno_t rc = nic_report_address(nic, addr);
 	if (rc == EOK)
 		e1000_write_receive_address(e1000, 0, addr, false);
Index: uspace/drv/nic/ne2k/dp8390.c
===================================================================
--- uspace/drv/nic/ne2k/dp8390.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ne2k/dp8390.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -194,5 +194,5 @@
  *
  */
-int ne2k_probe(ne2k_t *ne2k)
+errno_t ne2k_probe(ne2k_t *ne2k)
 {
 	unsigned int i;
@@ -250,5 +250,5 @@
  *
  */
-int ne2k_up(ne2k_t *ne2k)
+errno_t ne2k_up(ne2k_t *ne2k)
 {
 	if (!ne2k->probed)
Index: uspace/drv/nic/ne2k/dp8390.h
===================================================================
--- uspace/drv/nic/ne2k/dp8390.h	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ne2k/dp8390.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -265,6 +265,6 @@
 } ne2k_t;
 
-extern int ne2k_probe(ne2k_t *);
-extern int ne2k_up(ne2k_t *);
+extern errno_t ne2k_probe(ne2k_t *);
+extern errno_t ne2k_up(ne2k_t *);
 extern void ne2k_down(ne2k_t *);
 extern void ne2k_send(nic_t *, void *, size_t);
Index: uspace/drv/nic/ne2k/ne2k.c
===================================================================
--- uspace/drv/nic/ne2k/ne2k.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/ne2k/ne2k.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -124,5 +124,5 @@
 static void ne2k_interrupt_handler(ipc_call_t *, ddf_dev_t *);
 
-static int ne2k_register_interrupt(nic_t *nic_data, cap_handle_t *handle)
+static errno_t ne2k_register_interrupt(nic_t *nic_data, cap_handle_t *handle)
 {
 	ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data);
@@ -178,5 +178,5 @@
 }
 
-static int ne2k_dev_init(nic_t *nic_data)
+static errno_t ne2k_dev_init(nic_t *nic_data)
 {
 	/* Get HW resources */
@@ -184,5 +184,5 @@
 	hw_res_list_parsed_init(&hw_res_parsed);
 	
-	int rc = nic_get_resources(nic_data, &hw_res_parsed);
+	errno_t rc = nic_get_resources(nic_data, &hw_res_parsed);
 	
 	if (rc != EOK)
@@ -243,10 +243,10 @@
 }
 
-static int ne2k_on_activating(nic_t *nic_data)
+static errno_t ne2k_on_activating(nic_t *nic_data)
 {
 	ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data);
 
 	if (!ne2k->up) {
-		int rc = ne2k_up(ne2k);
+		errno_t rc = ne2k_up(ne2k);
 		if (rc != EOK)
 			return rc;
@@ -261,5 +261,5 @@
 }
 
-static int ne2k_on_stopping(nic_t *nic_data)
+static errno_t ne2k_on_stopping(nic_t *nic_data)
 {
 	ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data);
@@ -271,8 +271,8 @@
 }
 
-static int ne2k_set_address(ddf_fun_t *fun, const nic_address_t *address)
+static errno_t ne2k_set_address(ddf_fun_t *fun, const nic_address_t *address)
 {
 	nic_t *nic_data = DRIVER_DATA(ddf_fun_get_dev(fun));
-	int rc = nic_report_address(nic_data, address);
+	errno_t rc = nic_report_address(nic_data, address);
 	if (rc != EOK) {
 		return EINVAL;
@@ -286,5 +286,5 @@
 }
 
-static int ne2k_on_unicast_mode_change(nic_t *nic_data,
+static errno_t ne2k_on_unicast_mode_change(nic_t *nic_data,
 	nic_unicast_mode_t new_mode,
 	const nic_address_t *address_list, size_t address_count)
@@ -313,5 +313,5 @@
 }
 
-static int ne2k_on_multicast_mode_change(nic_t *nic_data,
+static errno_t ne2k_on_multicast_mode_change(nic_t *nic_data,
 	nic_multicast_mode_t new_mode,
 	const nic_address_t *address_list, size_t address_count)
@@ -339,5 +339,5 @@
 }
 
-static int ne2k_on_broadcast_mode_change(nic_t *nic_data,
+static errno_t ne2k_on_broadcast_mode_change(nic_t *nic_data,
 	nic_broadcast_mode_t new_mode)
 {
@@ -355,5 +355,5 @@
 }
 
-static int ne2k_dev_add(ddf_dev_t *dev)
+static errno_t ne2k_dev_add(ddf_dev_t *dev)
 {
 	ddf_fun_t *fun;
@@ -387,5 +387,5 @@
 	}
 	
-	int rc = ne2k_dev_init(nic_data);
+	errno_t rc = ne2k_dev_init(nic_data);
 	if (rc != EOK) {
 		ne2k_dev_cleanup(dev);
Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/rtl8139/driver.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -280,32 +280,32 @@
 }
 
-static int rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *);
-static int rtl8139_get_device_info(ddf_fun_t *fun, nic_device_info_t *info);
-static int rtl8139_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state);
-static int rtl8139_get_operation_mode(ddf_fun_t *fun, int *speed,
+static errno_t rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *);
+static errno_t rtl8139_get_device_info(ddf_fun_t *fun, nic_device_info_t *info);
+static errno_t rtl8139_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state);
+static errno_t rtl8139_get_operation_mode(ddf_fun_t *fun, int *speed,
     nic_channel_mode_t *duplex, nic_role_t *role);
-static int rtl8139_set_operation_mode(ddf_fun_t *fun, int speed,
+static errno_t rtl8139_set_operation_mode(ddf_fun_t *fun, int speed,
     nic_channel_mode_t duplex, nic_role_t);
 
-static int rtl8139_pause_get(ddf_fun_t*, nic_result_t*, nic_result_t*, 
+static errno_t rtl8139_pause_get(ddf_fun_t*, nic_result_t*, nic_result_t*, 
     uint16_t *);
-static int rtl8139_pause_set(ddf_fun_t*, int, int, uint16_t);
-
-static int rtl8139_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement);
-static int rtl8139_autoneg_disable(ddf_fun_t *fun);
-static int rtl8139_autoneg_probe(ddf_fun_t *fun, uint32_t *our_advertisement,
+static errno_t rtl8139_pause_set(ddf_fun_t*, int, int, uint16_t);
+
+static errno_t rtl8139_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement);
+static errno_t rtl8139_autoneg_disable(ddf_fun_t *fun);
+static errno_t rtl8139_autoneg_probe(ddf_fun_t *fun, uint32_t *our_advertisement,
     uint32_t *their_advertisement, nic_result_t *result, 
     nic_result_t *their_result);
-static int rtl8139_autoneg_restart(ddf_fun_t *fun);
-
-static int rtl8139_defective_get_mode(ddf_fun_t *fun, uint32_t *mode);
-static int rtl8139_defective_set_mode(ddf_fun_t *fun, uint32_t mode);
-
-static int rtl8139_wol_virtue_add(nic_t *nic_data,
+static errno_t rtl8139_autoneg_restart(ddf_fun_t *fun);
+
+static errno_t rtl8139_defective_get_mode(ddf_fun_t *fun, uint32_t *mode);
+static errno_t rtl8139_defective_set_mode(ddf_fun_t *fun, uint32_t mode);
+
+static errno_t rtl8139_wol_virtue_add(nic_t *nic_data,
 	const nic_wol_virtue_t *virtue);
 static void rtl8139_wol_virtue_rem(nic_t *nic_data,
 	const nic_wol_virtue_t *virtue);
 
-static int rtl8139_poll_mode_change(nic_t *nic_data, nic_poll_mode_t mode,
+static errno_t rtl8139_poll_mode_change(nic_t *nic_data, nic_poll_mode_t mode,
     const struct timeval *period);
 static void rtl8139_poll(nic_t *nic_data);
@@ -334,5 +334,5 @@
 static ddf_dev_ops_t rtl8139_dev_ops;
 
-static int rtl8139_dev_add(ddf_dev_t *dev);
+static errno_t rtl8139_dev_add(ddf_dev_t *dev);
 
 /** Basic driver operations for RTL8139 driver */
@@ -348,6 +348,6 @@
 
 /* The default implementation callbacks */
-static int rtl8139_on_activated(nic_t *nic_data);
-static int rtl8139_on_stopped(nic_t *nic_data);
+static errno_t rtl8139_on_activated(nic_t *nic_data);
+static errno_t rtl8139_on_stopped(nic_t *nic_data);
 static void rtl8139_send_frame(nic_t *nic_data, void *data, size_t size);
 
@@ -846,5 +846,5 @@
  *  @return An error code otherwise.
  */
-inline static int rtl8139_register_int_handler(nic_t *nic_data, cap_handle_t *handle)
+inline static errno_t rtl8139_register_int_handler(nic_t *nic_data, cap_handle_t *handle)
 {
 	rtl8139_t *rtl8139 = nic_get_specific(nic_data);
@@ -857,5 +857,5 @@
 	rtl8139_irq_code.cmds[2].addr = rtl8139->io_addr + ISR;
 	rtl8139_irq_code.cmds[3].addr = rtl8139->io_addr + IMR;
-	int rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
+	errno_t rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
 	    rtl8139->irq, rtl8139_interrupt_handler, &rtl8139_irq_code, handle);
 
@@ -904,5 +904,5 @@
  *  @return EOK if activated successfully, error code otherwise
  */
-static int rtl8139_on_activated(nic_t *nic_data)
+static errno_t rtl8139_on_activated(nic_t *nic_data)
 {
 	assert(nic_data);
@@ -919,5 +919,5 @@
 	rtl8139_hw_int_set(rtl8139);
 
-	int rc = hw_res_enable_interrupt(rtl8139->parent_sess, rtl8139->irq);
+	errno_t rc = hw_res_enable_interrupt(rtl8139->parent_sess, rtl8139->irq);
 	if (rc != EOK) {
 		rtl8139_on_stopped(nic_data);
@@ -935,5 +935,5 @@
  *  @return EOK if succeed, error code otherwise
  */
-static int rtl8139_on_stopped(nic_t *nic_data)
+static errno_t rtl8139_on_stopped(nic_t *nic_data)
 {
 	assert(nic_data);
@@ -955,9 +955,9 @@
 
 
-static int rtl8139_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
+static errno_t rtl8139_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
     const nic_address_t *, size_t);
-static int rtl8139_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
+static errno_t rtl8139_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
     const nic_address_t *addr, size_t addr_count);
-static int rtl8139_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode);
+static errno_t rtl8139_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode);
 
 
@@ -1027,5 +1027,5 @@
  *  @return EOK if succeed, error code otherwise
  */
-static int rtl8139_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t
+static errno_t rtl8139_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t
     *hw_resources)
 {
@@ -1067,5 +1067,5 @@
  *  @return EOK if succeed, error code otherwise
  */
-static int rtl8139_get_resource_info(ddf_dev_t *dev)
+static errno_t rtl8139_get_resource_info(ddf_dev_t *dev)
 {
 	assert(dev);
@@ -1078,10 +1078,10 @@
 
 	/* Get hw resources form parent driver */
-	int rc = nic_get_resources(nic_data, &hw_res_parsed);
+	errno_t rc = nic_get_resources(nic_data, &hw_res_parsed);
 	if (rc != EOK)
 		return rc;
 
 	/* Fill resources information to the device */
-	int ret = rtl8139_fill_resource_info(dev, &hw_res_parsed);
+	errno_t ret = rtl8139_fill_resource_info(dev, &hw_res_parsed);
 	hw_res_list_parsed_clean(&hw_res_parsed);
 
@@ -1098,8 +1098,8 @@
  * @return EOK in the case of success, error code otherwise
  */
-static int rtl8139_buffers_create(rtl8139_t *rtl8139)
+static errno_t rtl8139_buffers_create(rtl8139_t *rtl8139)
 {
 	size_t i = 0;
-	int rc;
+	errno_t rc;
 
 	ddf_msg(LVL_DEBUG, "Creating buffers");
@@ -1149,9 +1149,9 @@
  *  @return EOK if succeed, error code otherwise
  */
-static int rtl8139_device_initialize(ddf_dev_t *dev)
+static errno_t rtl8139_device_initialize(ddf_dev_t *dev)
 {
 	ddf_msg(LVL_DEBUG, "rtl8139_dev_initialize %s", ddf_dev_get_name(dev));
 
-	int ret = EOK;
+	errno_t ret = EOK;
 
 	ddf_msg(LVL_DEBUG, "rtl8139: creating device data");
@@ -1208,5 +1208,5 @@
  * @return EOK if successed, error code otherwise
  */
-static int rtl8139_pio_enable(ddf_dev_t *dev)
+static errno_t rtl8139_pio_enable(ddf_dev_t *dev)
 {
 	ddf_msg(LVL_DEBUG, NAME ": rtl8139_pio_enable %s", ddf_dev_get_name(dev));
@@ -1258,5 +1258,5 @@
  * @return EOK if added successfully, error code otherwise
  */
-int rtl8139_dev_add(ddf_dev_t *dev)
+errno_t rtl8139_dev_add(ddf_dev_t *dev)
 {
 	ddf_fun_t *fun;
@@ -1266,5 +1266,5 @@
 
 	/* Init device structure for rtl8139 */
-	int rc = rtl8139_device_initialize(dev);
+	errno_t rc = rtl8139_device_initialize(dev);
 	if (rc != EOK)
 		return rc;
@@ -1341,5 +1341,5 @@
  *  @return EOK if succeed, error code otherwise
  */
-static int rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
+static errno_t rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
 {
 	assert(fun);
@@ -1352,5 +1352,5 @@
 	rtl8139_lock_all(rtl8139);
 
-	int rc = nic_report_address(nic_data, addr);
+	errno_t rc = nic_report_address(nic_data, addr);
 	if ( rc != EOK) {
 		rtl8139_unlock_all(rtl8139);
@@ -1371,5 +1371,5 @@
  *  @return EOK
  */
-static int rtl8139_get_device_info(ddf_fun_t *fun, nic_device_info_t *info)
+static errno_t rtl8139_get_device_info(ddf_fun_t *fun, nic_device_info_t *info)
 {
 	assert(fun);
@@ -1406,5 +1406,5 @@
  *  @return EOK
  */
-static int rtl8139_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
+static errno_t rtl8139_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
 {
 	assert(fun);
@@ -1425,5 +1425,5 @@
 /** Get operation mode of the device
  */
-static int rtl8139_get_operation_mode(ddf_fun_t *fun, int *speed,
+static errno_t rtl8139_get_operation_mode(ddf_fun_t *fun, int *speed,
     nic_channel_mode_t *duplex, nic_role_t *role)
 {
@@ -1502,5 +1502,5 @@
  *  @return EOK if succeed
  */
-static int rtl8139_pause_get(ddf_fun_t *fun, nic_result_t *we_send, 
+static errno_t rtl8139_pause_get(ddf_fun_t *fun, nic_result_t *we_send, 
     nic_result_t *we_receive, uint16_t *time)
 {
@@ -1537,5 +1537,5 @@
  *  @return EOK if succeed, INVAL if the pause frame has no sence
  */
-static int rtl8139_pause_set(ddf_fun_t *fun, int allow_send, int allow_receive, 
+static errno_t rtl8139_pause_set(ddf_fun_t *fun, int allow_send, int allow_receive, 
     uint16_t time)
 {
@@ -1567,5 +1567,5 @@
  *
  */
-static int rtl8139_set_operation_mode(ddf_fun_t *fun, int speed,
+static errno_t rtl8139_set_operation_mode(ddf_fun_t *fun, int speed,
     nic_channel_mode_t duplex, nic_role_t role)
 {
@@ -1611,5 +1611,5 @@
  *  @returns EOK if advertisement mode set successfully
  */
-static int rtl8139_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement)
+static errno_t rtl8139_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement)
 {
 	assert(fun);
@@ -1657,5 +1657,5 @@
  *  @returns EOK
  */
-static int rtl8139_autoneg_disable(ddf_fun_t *fun)
+static errno_t rtl8139_autoneg_disable(ddf_fun_t *fun)
 {
 	assert(fun);
@@ -1708,5 +1708,5 @@
  *  @returns EOK
  */
-static int rtl8139_autoneg_probe(ddf_fun_t *fun, uint32_t *advertisement,
+static errno_t rtl8139_autoneg_probe(ddf_fun_t *fun, uint32_t *advertisement,
     uint32_t *their_adv, nic_result_t *result, nic_result_t *their_result)
 {
@@ -1745,5 +1745,5 @@
  *  @returns EOK
  */
-static int rtl8139_autoneg_restart(ddf_fun_t *fun)
+static errno_t rtl8139_autoneg_restart(ddf_fun_t *fun)
 {
 	assert(fun);
@@ -1793,5 +1793,5 @@
  *  @returns EOK
  */
-static int rtl8139_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
+static errno_t rtl8139_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
     const nic_address_t *addr, size_t addr_cnt)
 {
@@ -1851,5 +1851,5 @@
  *  @returns EOK
  */
-static int rtl8139_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
+static errno_t rtl8139_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
     const nic_address_t *addr, size_t addr_count)
 {
@@ -1894,5 +1894,5 @@
  *  @returns EOK
  */
-static int rtl8139_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode)
+static errno_t rtl8139_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode)
 {
 	assert(nic_data);
@@ -1922,5 +1922,5 @@
  *  @param[out] mode    The current mode
  */
-static int rtl8139_defective_get_mode(ddf_fun_t *fun, uint32_t *mode)
+static errno_t rtl8139_defective_get_mode(ddf_fun_t *fun, uint32_t *mode)
 {
 	assert(fun);
@@ -1947,5 +1947,5 @@
  *  @returns EOK of mode was set
  */
-static int rtl8139_defective_set_mode(ddf_fun_t *fun, uint32_t mode)
+static errno_t rtl8139_defective_set_mode(ddf_fun_t *fun, uint32_t mode)
 {
 	assert(fun);
@@ -1979,5 +1979,5 @@
  *  @returns ELIMIT if no more methods of this kind can be enabled
  */
-static int rtl8139_wol_virtue_add(nic_t *nic_data,
+static errno_t rtl8139_wol_virtue_add(nic_t *nic_data,
 	const nic_wol_virtue_t *virtue)
 {
@@ -2058,9 +2058,9 @@
  *  @returns ENOTSUP if the mode is not supported
  */
-static int rtl8139_poll_mode_change(nic_t *nic_data, nic_poll_mode_t mode,
+static errno_t rtl8139_poll_mode_change(nic_t *nic_data, nic_poll_mode_t mode,
     const struct timeval *period)
 {
 	assert(nic_data);
-	int rc = EOK;
+	errno_t rc = EOK;
 
 	rtl8139_t *rtl8139 = nic_get_specific(nic_data);
@@ -2143,5 +2143,5 @@
 	printf("%s: HelenOS RTL8139 network adapter driver\n", NAME);
 
-	int rc = nic_driver_init(NAME);
+	errno_t rc = nic_driver_init(NAME);
 	if (rc != EOK)
 		return rc;
Index: uspace/drv/nic/rtl8139/general.c
===================================================================
--- uspace/drv/nic/rtl8139/general.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/rtl8139/general.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -83,5 +83,5 @@
  *  @return EOK if succeed, error code otherwise
  */
-int rtl8139_timer_act_init(rtl8139_timer_act_t * ta, uint32_t timer_freq,
+errno_t rtl8139_timer_act_init(rtl8139_timer_act_t * ta, uint32_t timer_freq,
     const struct timeval *time) 
 {
Index: uspace/drv/nic/rtl8139/general.h
===================================================================
--- uspace/drv/nic/rtl8139/general.h	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/rtl8139/general.h	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -61,5 +61,5 @@
 extern void *rtl8139_memcpy_wrapped(void *, const void *, size_t, size_t,
     size_t);
-extern int rtl8139_timer_act_init(rtl8139_timer_act_t *, uint32_t,
+extern errno_t rtl8139_timer_act_init(rtl8139_timer_act_t *, uint32_t,
     const struct timeval *);
 extern int rtl8139_timer_act_step(rtl8139_timer_act_t *, uint32_t *);
Index: uspace/drv/nic/rtl8169/driver.c
===================================================================
--- uspace/drv/nic/rtl8169/driver.c	(revision 132ab5d1e75253f9bae910b2748a4c13efe7e71f)
+++ uspace/drv/nic/rtl8169/driver.c	(revision 5a6cc679876514e29ac7899053554db66db754d9)
@@ -52,40 +52,40 @@
 FIBRIL_MUTEX_INITIALIZE(irq_reg_lock);
 
-static int rtl8169_set_addr(ddf_fun_t *fun, const nic_address_t *addr);
-static int rtl8169_get_device_info(ddf_fun_t *fun, nic_device_info_t *info);
-static int rtl8169_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state);
-static int rtl8169_get_operation_mode(ddf_fun_t *fun, int *speed,
+static errno_t rtl8169_set_addr(ddf_fun_t *fun, const nic_address_t *addr);
+static errno_t rtl8169_get_device_info(ddf_fun_t *fun, nic_device_info_t *info);
+static errno_t rtl8169_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state);
+static errno_t rtl8169_get_operation_mode(ddf_fun_t *fun, int *speed,
     nic_channel_mode_t *duplex, nic_role_t *role);
-static int rtl8169_set_operation_mode(ddf_fun_t *fun, int speed,
+static errno_t rtl8169_set_operation_mode(ddf_fun_t *fun, int speed,
     nic_channel_mode_t duplex, nic_role_t role);
-static int rtl8169_pause_get(ddf_fun_t *fun, nic_result_t *we_send, 
+static errno_t rtl8169_pause_get(ddf_fun_t *fun, nic_result_t *we_send, 
     nic_result_t *we_receive, uint16_t *time);
-static int rtl8169_pause_set(ddf_fun_t *fun, int allow_send, int allow_receive, 
+static errno_t rtl8169_pause_set(ddf_fun_t *fun, int allow_send, int allow_receive, 
     uint16_t time);
-static int rtl8169_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement);
-static int rtl8169_autoneg_disable(ddf_fun_t *fun);
-static int rtl8169_autoneg_probe(ddf_fun_t *fun, uint32_t *advertisement,
+static errno_t rtl8169_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement);
+static errno_t rtl8169_autoneg_disable(ddf_fun_t *fun);
+static errno_t rtl8169_autoneg_probe(ddf_fun_t *fun, uint32_t *advertisement,
     uint32_t *their_adv, nic_result_t *result, nic_result_t *their_result);
-static int rtl8169_autoneg_restart(ddf_fun_t *fun);
-static int rtl8169_defective_get_mode(ddf_fun_t *fun, uint32_t *mode);
-static int rtl8169_defective_set_mode(ddf_fun_t *fun, uint32_t mode);
-static int rtl8169_on_activated(nic_t *nic_data);
-static int rtl8169_on_stopped(nic_t *nic_data);
+static errno_t rtl8169_autoneg_restart(ddf_fun_t *fun);
+static errno_t rtl8169_defective_get_mode(ddf_fun_t *fun, uint32_t *mode);
+static errno_t rtl8169_defective_set_mode(ddf_fun_t *fun, uint32_t mode);
+static errno_t rtl8169_on_activated(nic_t *nic_data);
+static errno_t rtl8169_on_stopped(nic_t *nic_data);
 static void rtl8169_send_frame(nic_t *nic_data, void *data, size_t size);
 static void rtl8169_irq_handler(ipc_call_t *icall, ddf_dev_t *dev);
-static inline int rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle);
+static inline errno_t rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle);
 static inline void rtl8169_get_hwaddr(rtl8169_t *rtl8169, nic_address_t *addr);
 static inline void rtl8169_set_hwaddr(rtl8169_t *rtl8169, const nic_address_t *addr);
 
 static void rtl8169_reset(rtl8169_t *rtl8169);
-static int rtl8169_get_resource_info(ddf_dev_t *dev);
-static int rtl8169_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t *hw_resources);
+static errno_t rtl8169_get_resource_info(ddf_dev_t *dev);
+static errno_t rtl8169_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t *hw_resources);
 static rtl8169_t *rtl8169_create_dev_data(ddf_dev_t *dev);
 
-static int rtl8169_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
+static errno_t rtl8169_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
     const nic_address_t *, size_t);
-static int rtl8169_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
+static errno_t rtl8169_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
     const nic_address_t *addr, size_t addr_count);
-static int rtl8169_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode);
+static errno_t rtl8169_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode);
 
 static uint16_t rtl8169_mii_read(rtl8169_t *rtl8169, uint8_t addr);
@@ -161,5 +161,5 @@
 static ddf_dev_ops_t rtl8169_dev_ops;
 
-static int rtl8169_dev_add(ddf_dev_t *dev);
+static errno_t rtl8169_dev_add(ddf_dev_t *dev);
 
 /** Basic driver operations for RTL8169 driver */
@@ -174,5 +174,5 @@
 };
 
-static int rtl8169_get_resource_info(ddf_dev_t *dev)
+static errno_t rtl8169_get_resource_info(ddf_dev_t *dev)
 {
 	assert(dev);
@@ -185,10 +185,10 @@
 
 	/* Get hw resources form parent driver */
-	int rc = nic_get_resources(nic_data, &hw_res_parsed);
+	errno_t rc = nic_get_resources(nic_data, &hw_res_parsed);
 	if (rc != EOK)
 		return rc;
 
 	/* Fill resources information to the device */
-	int ret = rtl8169_fill_resource_info(dev, &hw_res_parsed);
+	errno_t ret = rtl8169_fill_resource_info(dev, &hw_res_parsed);
 	hw_res_list_parsed_clean(&hw_res_parsed);
 
@@ -196,5 +196,5 @@
 }
 
-static int rtl8169_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t
+static errno_t rtl8169_fill_resource_info(ddf_dev_t *dev, const hw_res_list_parsed_t
     *hw_resources)
 {
@@ -229,7 +229,7 @@
 }
 
-static int rtl8169_allocate_buffers(rtl8169_t *rtl8169)
-{
-	int rc;
+static errno_t rtl8169_allocate_buffers(rtl8169_t *rtl8169)
+{
+	errno_t rc;
 
 	ddf_msg(LVL_DEBUG, "Allocating DMA buffer rings");
@@ -334,7 +334,7 @@
 }
 
-static int rtl8169_dev_initialize(ddf_dev_t *dev)
-{
-	int ret;
+static errno_t rtl8169_dev_initialize(ddf_dev_t *dev)
+{
+	errno_t ret;
 
 	rtl8169_t *rtl8169 = rtl8169_create_dev_data(dev);
@@ -360,5 +360,5 @@
 }
 
-inline static int rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle)
+inline static errno_t rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle)
 {
 	rtl8169_t *rtl8169 = nic_get_specific(nic_data);
@@ -368,5 +368,5 @@
 	rtl8169_irq_code.cmds[2].addr = rtl8169->regs + ISR;
 	rtl8169_irq_code.cmds[3].addr = rtl8169->regs + IMR;
-	int rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
+	errno_t rc = register_interrupt_handler(nic_get_ddf_dev(nic_data),
 	    rtl8169->irq, rtl8169_irq_handler, &rtl8169_irq_code, handle);
 
@@ -374,9 +374,9 @@
 }
 
-static int rtl8169_dev_add(ddf_dev_t *dev)
+static errno_t rtl8169_dev_add(ddf_dev_t *dev)
 {
 	ddf_fun_t *fun;
 	nic_address_t nic_addr;
-	int rc;
+	errno_t rc;
 
 	assert(dev);
@@ -481,9 +481,9 @@
 }
 
-static int rtl8169_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
+static errno_t rtl8169_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
 {
 	nic_t *nic_data = nic_get_from_ddf_fun(fun);
 	rtl8169_t *rtl8169 = nic_get_specific(nic_data);
-	int rc;
+	errno_t rc;
 
 	fibril_mutex_lock(&rtl8169->rx_lock);
@@ -502,5 +502,5 @@
 }
 
-static int rtl8169_get_device_info(ddf_fun_t *fun, nic_device_info_t *info)
+static errno_t rtl8169_get_device_info(ddf_fun_t *fun, nic_device_info_t *info)
 {
 	nic_t *nic_data = nic_get_from_ddf_fun(fun);
@@ -528,5 +528,5 @@
 }
 
-static int rtl8169_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
+static errno_t rtl8169_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
 {
 	rtl8169_t *rtl8169 = nic_get_specific(nic_get_from_ddf_fun(fun));
@@ -541,5 +541,5 @@
 }
 
-static int rtl8169_get_operation_mode(ddf_fun_t *fun, int *speed,
+static errno_t rtl8169_get_operation_mode(ddf_fun_t *fun, int *speed,
     nic_channel_mode_t *duplex, nic_role_t *role)
 {
@@ -563,5 +563,5 @@
 }
 
-static int rtl8169_set_operation_mode(ddf_fun_t *fun, int speed,
+static errno_t rtl8169_set_operation_mode(ddf_fun_t *fun, int speed,
     nic_channel_mode_t duplex, nic_role_t role)
 {
@@ -594,5 +594,5 @@
 }
 
-static int rtl8169_pause_get(ddf_fun_t *fun, nic_result_t *we_send, 
+static errno_t rtl8169_pause_get(ddf_fun_t *fun, nic_result_t *we_send, 
     nic_result_t *we_receive, uint16_t *time)
 {
@@ -600,5 +600,5 @@
 }
 
-static int rtl8169_pause_set(ddf_fun_t *fun, int allow_send, int allow_receive, 
+static errno_t rtl8169_pause_set(ddf_fun_t *fun, int allow_send, int allow_receive, 
     uint16_t time)
 {
@@ -606,5 +606,5 @@
 }
 
-static int rtl8169_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement)
+static errno_t rtl8169_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement)
 {
 	rtl8169_t *rtl8169 = nic_get_specific(nic_get_from_ddf_fun(fun));
@@ -630,5 +630,5 @@
 }
 
-static int rtl8169_autoneg_disable(ddf_fun_t *fun)
+static errno_t rtl8169_autoneg_disable(ddf_fun_t *fun)
 {
 	rtl8169_t *rtl8169 = nic_get_specific(nic_get_from_ddf_fun(fun));
@@ -641,5 +641,5 @@
 }
 
-static int rtl8169_autoneg_probe(ddf_fun_t *fun, uint32_t *advertisement,
+static errno_t rtl8169_autoneg_probe(ddf_fun_t *fun, uint32_t *advertisement,
     uint32_t *their_adv, nic_result_t *result, nic_result_t *their_result)
 {
@@ -647,5 +647,5 @@
 }
 
-static int rtl8169_autoneg_restart(ddf_fun_t *fun)
+static errno_t rtl8169_autoneg_restart(ddf_fun_t *fun)
 {
 	rtl8169_t *rtl8169 = nic_get_specific(nic_get_from_ddf_fun(fun));
@@ -657,10 +657,10 @@
 }
 
-static int rtl8169_defective_get_mode(ddf_fun_t *fun, uint32_t *mode)
-{
-	return EOK;
-}
-
-static int rtl8169_defective_set_mode(ddf_fun_t *fun, uint32_t mode)
+static errno_t rtl8169_defective_get_mode(ddf_fun_t *fun, uint32_t *mode)
+{
+	return EOK;
+}
+
+static errno_t rtl8169_defective_set_mode(ddf_fun_t *fun, uint32_t mode)
 {
 	return EOK;
@@ -691,7 +691,7 @@
 }
 
-static int rtl8169_on_activated(nic_t *nic_data)
-{
-	int rc;
+static errno_t rtl8169_on_activated(nic_t *nic_data)
+{
+	errno_t rc;
 	uint64_t tmp;
 
@@ -753,5 +753,5 @@
 }
 
-static int rtl8169_on_stopped(nic_t *nic_data)
+static errno_t rtl8169_on_stopped(nic_t *nic_data)
 {
 	ddf_msg(LVL_NOTE, "Stopping device");
@@ -819,5 +819,5 @@
 }
 
-static int rtl8169_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
+static errno_t rtl8169_unicast_set(nic_t *nic_data, nic_unicast_mode_t mode,
     const nic_address_t *addr, size_t addr_count)
 {
@@ -871,5 +871,5 @@
 }
 
-static int rtl8169_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
+static errno_t rtl8169_multicast_set(nic_t *nic_data, nic_multicast_mode_t mode,
     const nic_address_t *addr, size_t addr_count)
 {
@@ -915,5 +915,5 @@
 }
 
-static int rtl8169_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode)
+static errno_t rtl8169_broadcast_set(nic_t *nic_data, nic_broadcast_mode_t mode)
 {
 	rtl8169_t *rtl8169 = nic_get_specific(nic_data);
@@ -1208,5 +1208,5 @@
 int main(void)
 {
-	int rc = nic_driver_init(NAME);
+	errno_t rc = nic_driver_init(NAME);
 	if (rc != EOK)
 		return rc;
