Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/drv/nic/e1k/e1k.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -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);
