Index: uspace/drv/nic/ar9271/ar9271.c
===================================================================
--- uspace/drv/nic/ar9271/ar9271.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/drv/nic/ar9271/ar9271.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -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)
+static errno_t ar9271_init(ar9271_t *ar9271, usb_device_t *usb_device)
 {
 	ar9271->starting_up = true;
@@ -680,5 +680,5 @@
 	}
 	
-	int rc = ath_usb_init(ar9271->ath_device, usb_device);
+	errno_t rc = ath_usb_init(ar9271->ath_device, usb_device);
 	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);
