Index: uspace/drv/nic/ar9271/ar9271.c
===================================================================
--- uspace/drv/nic/ar9271/ar9271.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/ar9271.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -148,7 +148,7 @@
 	assert(dev);
 	assert(info);
-	
+
 	memset(info, 0, sizeof(nic_device_info_t));
-	
+
 	info->vendor_id = 0x0cf3;
 	info->device_id = 0x9271;
@@ -157,5 +157,5 @@
 	str_cpy(info->model_name, NIC_MODEL_MAX_LENGTH,
 	    "AR9271");
-	
+
 	return EOK;
 }
@@ -167,5 +167,5 @@
 {
 	*state = NIC_CS_PLUGGED;
-	
+
 	return EOK;
 }
@@ -180,5 +180,5 @@
 	*speed = 10;
 	*role = NIC_ROLE_UNKNOWN;
-	
+
 	return EOK;
 }
@@ -203,5 +203,5 @@
 		return ENOTSUP;
 	}
-	
+
 	return EOK;
 }
@@ -229,5 +229,5 @@
 		return ENOTSUP;
 	}
-	
+
 	return EOK;
 }
@@ -249,5 +249,5 @@
 		return ENOTSUP;
 	}
-	
+
 	return EOK;
 }
@@ -261,10 +261,10 @@
 {
 	assert(arg);
-	
+
 	ar9271_t *ar9271 = (ar9271_t *) arg;
-	
+
 	size_t buffer_size = ar9271->ath_device->data_response_length;
 	void *buffer = malloc(buffer_size);
-	
+
 	while (true) {
 		size_t transferred_size;
@@ -275,34 +275,34 @@
 			    sizeof(htc_frame_header_t) +
 			    sizeof(htc_rx_status_t);
-			
+
 			if (transferred_size < strip_length)
 				continue;
-			
+
 			ath_usb_data_header_t *data_header =
 			    (ath_usb_data_header_t *) buffer;
-			
+
 			/* Invalid packet. */
 			if (data_header->tag != uint16_t_le2host(RX_TAG))
 				continue;
-			
+
 			htc_rx_status_t *rx_status =
 			    (htc_rx_status_t *) ((void *) buffer +
 			    sizeof(ath_usb_data_header_t) +
 			    sizeof(htc_frame_header_t));
-			
+
 			uint16_t data_length =
 			    uint16_t_be2host(rx_status->data_length);
-			
+
 			int16_t payload_length =
 			    transferred_size - strip_length;
-			
+
 			if (payload_length - data_length < 0)
 				continue;
-			
+
 			if (ar9271_rx_status_error(rx_status->status))
 				continue;
-			
+
 			void *strip_buffer = buffer + strip_length;
-			
+
 			ieee80211_rx_handler(ar9271->ieee80211_dev,
 			    strip_buffer,
@@ -310,7 +310,7 @@
 		}
 	}
-	
+
 	free(buffer);
-	
+
 	return EOK;
 }
@@ -323,11 +323,11 @@
 {
 	assert(ieee80211_dev);
-	
+
 	ar9271_t *ar9271 = (ar9271_t *) ieee80211_get_specific(ieee80211_dev);
-	
+
 	wmi_send_command(ar9271->htc_device, WMI_DISABLE_INTR, NULL, 0, NULL);
 	wmi_send_command(ar9271->htc_device, WMI_DRAIN_TXQ_ALL, NULL, 0, NULL);
 	wmi_send_command(ar9271->htc_device, WMI_STOP_RECV, NULL, 0, NULL);
-	
+
 	errno_t rc = hw_freq_switch(ar9271, freq);
 	if (rc != EOK) {
@@ -335,7 +335,7 @@
 		return rc;
 	}
-	
+
 	wmi_send_command(ar9271->htc_device, WMI_START_RECV, NULL, 0, NULL);
-	
+
 	rc = hw_rx_init(ar9271);
 	if (rc != EOK) {
@@ -343,10 +343,10 @@
 		return rc;
 	}
-	
+
 	uint16_t htc_mode = host2uint16_t_be(1);
 	wmi_send_command(ar9271->htc_device, WMI_SET_MODE,
 	    (uint8_t *) &htc_mode, sizeof(htc_mode), NULL);
 	wmi_send_command(ar9271->htc_device, WMI_ENABLE_INTR, NULL, 0, NULL);
-	
+
 	return EOK;
 }
@@ -356,11 +356,11 @@
 {
 	assert(ieee80211_dev);
-	
+
 	ar9271_t *ar9271 = (ar9271_t *) ieee80211_get_specific(ieee80211_dev);
-	
+
 	if (connected) {
 		nic_address_t bssid;
 		ieee80211_query_bssid(ieee80211_dev, &bssid);
-		
+
 		htc_sta_msg_t sta_msg;
 		memset(&sta_msg, 0, sizeof(htc_sta_msg_t));
@@ -371,8 +371,8 @@
 		sta_msg.vif_index = 0;
 		memcpy(&sta_msg.addr, bssid.address, ETH_ADDR);
-		
+
 		wmi_send_command(ar9271->htc_device, WMI_NODE_CREATE,
 		    (uint8_t *) &sta_msg, sizeof(sta_msg), NULL);
-		
+
 		htc_rate_msg_t rate_msg;
 		memset(&rate_msg, 0, sizeof(htc_rate_msg_t));
@@ -383,8 +383,8 @@
 		    ieee80211bg_data_rates,
 		    ARRAY_SIZE(ieee80211bg_data_rates));
-		
+
 		wmi_send_command(ar9271->htc_device, WMI_RC_RATE_UPDATE,
 		    (uint8_t *) &rate_msg, sizeof(rate_msg), NULL);
-		
+
 		hw_set_rx_filter(ar9271, true);
 	} else {
@@ -392,10 +392,10 @@
 		wmi_send_command(ar9271->htc_device, WMI_NODE_REMOVE,
 		    &station_id, sizeof(station_id), NULL);
-		
+
 		hw_set_rx_filter(ar9271, false);
 	}
-	
+
 	hw_set_bssid(ar9271);
-	
+
 	return EOK;
 }
@@ -405,18 +405,18 @@
 {
 	assert(ieee80211_dev);
-	
+
 	ar9271_t *ar9271 = (ar9271_t *) ieee80211_get_specific(ieee80211_dev);
-	
+
 	if(insert) {
 		assert(key_conf);
-		
+
 		uint32_t key[5];
 		uint32_t key_type;
 		uint32_t reg_ptr, mic_reg_ptr;
 		void *data_start;
-		
+
 		nic_address_t bssid;
 		ieee80211_query_bssid(ieee80211_dev, &bssid);
-		
+
 		switch (key_conf->suite) {
 		case IEEE80211_SECURITY_SUITE_WEP40:
@@ -435,13 +435,13 @@
 			key_type = -1;
 		}
-		
+
 		uint8_t key_id =
 		    (key_conf->flags & IEEE80211_KEY_FLAG_TYPE_PAIRWISE) ?
 		    AR9271_STA_KEY_INDEX : key_conf->id;
-		
+
 		reg_ptr = AR9271_KEY_TABLE(key_id);
 		mic_reg_ptr = AR9271_KEY_TABLE(key_id + 64);
 		data_start = (void *) key_conf->data;
-		
+
 		key[0] = uint32_t_le2host(*((uint32_t *) data_start));
 		key[1] = uint16_t_le2host(*((uint16_t *) (data_start + 4)));
@@ -449,9 +449,9 @@
 		key[3] = uint16_t_le2host(*((uint16_t *) (data_start + 10)));
 		key[4] = uint32_t_le2host(*((uint32_t *) (data_start + 12)));
-		
+
 		if ((key_conf->suite == IEEE80211_SECURITY_SUITE_WEP40) ||
 		    (key_conf->suite == IEEE80211_SECURITY_SUITE_WEP104))
 			key[4] &= 0xFF;
-		
+
 		wmi_reg_write(ar9271->htc_device, reg_ptr + 0, key[0]);
 		wmi_reg_write(ar9271->htc_device, reg_ptr + 4, key[1]);
@@ -460,5 +460,5 @@
 		wmi_reg_write(ar9271->htc_device, reg_ptr + 16, key[4]);
 		wmi_reg_write(ar9271->htc_device, reg_ptr + 20, key_type);
-		
+
 		uint32_t macl;
 		uint32_t mach;
@@ -471,13 +471,13 @@
 			mach = 0;
 		}
-		
+
 		macl >>= 1;
 		macl |= (mach & 1) << 31;
 		mach >>= 1;
 		mach |= 0x8000;
-		
+
 		wmi_reg_write(ar9271->htc_device, reg_ptr + 24, macl);
 		wmi_reg_write(ar9271->htc_device, reg_ptr + 28, mach);
-		
+
 		/* Setup MIC keys for TKIP. */
 		if (key_conf->suite == IEEE80211_SECURITY_SUITE_TKIP) {
@@ -485,10 +485,10 @@
 			uint8_t *gen_mic = data_start + IEEE80211_TKIP_RX_MIC_OFFSET;
 			uint8_t *tx_mic;
-			
+
 			if (key_conf->flags & IEEE80211_KEY_FLAG_TYPE_GROUP)
 				tx_mic = gen_mic;
 			else
 				tx_mic = data_start + IEEE80211_TKIP_TX_MIC_OFFSET;
-			
+
 			mic[0] = uint32_t_le2host(*((uint32_t *) gen_mic));
 			mic[1] = uint16_t_le2host(*((uint16_t *) (tx_mic + 2))) & 0xFFFF;
@@ -496,5 +496,5 @@
 			mic[3] = uint16_t_le2host(*((uint16_t *) tx_mic)) & 0xFFFF;
 			mic[4] = uint32_t_le2host(*((uint32_t *) (tx_mic + 4)));
-			
+
 			wmi_reg_write(ar9271->htc_device, mic_reg_ptr + 0, mic[0]);
 			wmi_reg_write(ar9271->htc_device, mic_reg_ptr + 4, mic[1]);
@@ -504,9 +504,9 @@
 			wmi_reg_write(ar9271->htc_device, mic_reg_ptr + 20,
 			    AR9271_KEY_TABLE_TYPE_CLR);
-			
+
 			wmi_reg_write(ar9271->htc_device, mic_reg_ptr + 24, 0);
 			wmi_reg_write(ar9271->htc_device, mic_reg_ptr + 28, 0);
 		}
-		
+
 		if (key_conf->flags & IEEE80211_KEY_FLAG_TYPE_GROUP)
 			ieee80211_setup_key_confirm(ieee80211_dev, true);
@@ -515,5 +515,5 @@
 		ieee80211_setup_key_confirm(ieee80211_dev, false);
 	}
-	
+
 	return EOK;
 }
@@ -523,12 +523,12 @@
 {
 	assert(ieee80211_dev);
-	
+
 	size_t complete_size;
 	size_t offset;
 	void *complete_buffer;
 	int endpoint;
-	
+
 	ar9271_t *ar9271 = (ar9271_t *) ieee80211_get_specific(ieee80211_dev);
-	
+
 	uint16_t frame_ctrl = *((uint16_t *) buffer);
 	if (ieee80211_is_data_frame(frame_ctrl)) {
@@ -538,5 +538,5 @@
 		complete_buffer = malloc(complete_size);
 		memset(complete_buffer, 0, complete_size);
-		
+
 		/*
 		 * Because we handle just station mode yet, node ID and VIF ID
@@ -550,11 +550,11 @@
 		data_header->vif_idx = 0;
 		data_header->cookie = 0;
-		
+
 		if (ieee80211_query_using_key(ieee80211_dev)) {
 			data_header->keyix = AR9271_STA_KEY_INDEX;
-			
+
 			int sec_suite =
 			    ieee80211_get_pairwise_security(ieee80211_dev);
-			
+
 			switch (sec_suite) {
 			case IEEE80211_SECURITY_SUITE_WEP40:
@@ -573,5 +573,5 @@
 			data_header->keyix = 0xFF;
 		}
-		
+
 		endpoint = ar9271->htc_device->endpoints.data_be_endpoint;
 	} else {
@@ -581,5 +581,5 @@
 		complete_buffer = malloc(complete_size);
 		memset(complete_buffer, 0, complete_size);
-		
+
 		/*
 		 * Because we handle just station mode yet, node ID and VIF ID
@@ -593,16 +593,16 @@
 		mgmt_header->cookie = 0;
 		mgmt_header->keyix = 0xFF;
-		
+
 		endpoint = ar9271->htc_device->endpoints.mgmt_endpoint;
 	}
-	
+
 	/* Copy IEEE802.11 data to new allocated buffer with HTC headers. */
 	memcpy(complete_buffer + offset, buffer, buffer_size);
-	
+
 	htc_send_data_message(ar9271->htc_device, complete_buffer,
 	    complete_size, endpoint);
-	
+
 	free(complete_buffer);
-	
+
 	return EOK;
 }
@@ -611,9 +611,9 @@
 {
 	assert(ieee80211_dev);
-	
+
 	ar9271_t *ar9271 = (ar9271_t *) ieee80211_get_specific(ieee80211_dev);
-	
+
 	wmi_send_command(ar9271->htc_device, WMI_FLUSH_RECV, NULL, 0, NULL);
-	
+
 	errno_t rc = hw_reset(ar9271);
 	if (rc != EOK) {
@@ -621,5 +621,5 @@
 		return rc;
 	}
-	
+
 	uint16_t htc_mode = host2uint16_t_be(1);
 	wmi_send_command(ar9271->htc_device, WMI_SET_MODE,
@@ -628,5 +628,5 @@
 	wmi_send_command(ar9271->htc_device, WMI_START_RECV, NULL, 0, NULL);
 	wmi_send_command(ar9271->htc_device, WMI_ENABLE_INTR, NULL, 0, NULL);
-	
+
 	rc = hw_rx_init(ar9271);
 	if (rc != EOK) {
@@ -634,5 +634,5 @@
 		return rc;
 	}
-	
+
 	/* Send capability message to target. */
 	htc_cap_msg_t cap_msg;
@@ -641,8 +641,8 @@
 	cap_msg.enable_coex = 0;
 	cap_msg.tx_chainmask = 0x1;
-	
+
 	wmi_send_command(ar9271->htc_device, WMI_TARGET_IC_UPDATE,
 	    (uint8_t *) &cap_msg, sizeof(cap_msg), NULL);
-	
+
 	rc = htc_init_new_vif(ar9271->htc_device);
 	if (rc != EOK) {
@@ -650,17 +650,17 @@
 		return rc;
 	}
-	
+
 	/* Add data polling fibril. */
 	fid_t fibril = fibril_create(ar9271_data_polling, ar9271);
 	if (fibril == 0)
 		return ENOMEM;
-	
+
 	fibril_add_ready(fibril);
-	
+
 	ar9271->starting_up = false;
 	ieee80211_set_ready(ieee80211_dev, true);
-	
+
 	usb_log_info("Device fully initialized.\n");
-	
+
 	return EOK;
 }
@@ -670,7 +670,7 @@
 	ar9271->starting_up = true;
 	ar9271->usb_device = usb_device;
-	
+
 	fibril_mutex_initialize(&ar9271->ar9271_lock);
-	
+
 	ar9271->ath_device = calloc(1, sizeof(ath_t));
 	if (!ar9271->ath_device) {
@@ -679,5 +679,5 @@
 		return ENOMEM;
 	}
-	
+
 	errno_t rc = ath_usb_init(ar9271->ath_device, usb_device, endpoints);
 	if (rc != EOK) {
@@ -686,5 +686,5 @@
 		return rc;
 	}
-	
+
 	/* IEEE 802.11 framework structure initialization. */
 	ar9271->ieee80211_dev = ieee80211_device_create();
@@ -695,5 +695,5 @@
 		return ENOMEM;
 	}
-	
+
 	rc = ieee80211_device_init(ar9271->ieee80211_dev, ar9271->ddf_dev);
 	if (rc != EOK) {
@@ -704,7 +704,7 @@
 		return rc;
 	}
-	
+
 	ieee80211_set_specific(ar9271->ieee80211_dev, ar9271);
-	
+
 	/* HTC device structure initialization. */
 	ar9271->htc_device = calloc(1, sizeof(htc_device_t));
@@ -716,5 +716,5 @@
 		return ENOMEM;
 	}
-	
+
 	rc = htc_device_init(ar9271->ath_device, ar9271->ieee80211_dev,
 	    ar9271->htc_device);
@@ -726,5 +726,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -740,8 +740,8 @@
 {
 	usb_device_t *usb_device = ar9271->usb_device;
-	
+
 	/* TODO: Set by maximum packet size in pipe. */
 	static const size_t MAX_TRANSFER_SIZE = 512;
-	
+
 	/* Load FW from file. */
 	FILE *fw_file = fopen(FIRMWARE_FILENAME, "rb");
@@ -750,9 +750,9 @@
 		return ENOENT;
 	}
-	
+
 	fseek(fw_file, 0, SEEK_END);
 	uint64_t file_size = ftell(fw_file);
 	fseek(fw_file, 0, SEEK_SET);
-	
+
 	void *fw_data = malloc(file_size);
 	if (fw_data == NULL) {
@@ -761,8 +761,8 @@
 		return ENOMEM;
 	}
-	
+
 	fread(fw_data, file_size, 1, fw_file);
 	fclose(fw_file);
-	
+
 	/* Upload FW to device. */
 	uint64_t remain_size = file_size;
@@ -770,5 +770,5 @@
 	uint8_t *current_data = fw_data;
 	uint8_t *buffer = malloc(MAX_TRANSFER_SIZE);
-	
+
 	while (remain_size > 0) {
 		size_t chunk_size = min(remain_size, MAX_TRANSFER_SIZE);
@@ -788,13 +788,13 @@
 			return rc;
 		}
-		
+
 		remain_size -= chunk_size;
 		current_addr += chunk_size;
 		current_data += chunk_size;
 	}
-	
+
 	free(fw_data);
 	free(buffer);
-	
+
 	/*
 	 * Send command that firmware is successfully uploaded.
@@ -809,5 +809,5 @@
 	    uint16_host2usb(AR9271_FW_OFFSET >> 8),
 	    0, NULL, 0);
-	
+
 	if (rc != EOK) {
 		usb_log_error("IO error when sending fw upload confirmation "
@@ -815,10 +815,10 @@
 		return rc;
 	}
-	
+
 	usb_log_info("Firmware uploaded successfully.\n");
-	
+
 	/* Wait until firmware is ready - wait for 1 second to be sure. */
 	async_sleep(1);
-	
+
 	return rc;
 }
@@ -840,5 +840,5 @@
 		return NULL;
 	}
-	
+
 	/* AR9271 structure initialization. */
 	ar9271_t *ar9271 = calloc(1, sizeof(ar9271_t));
@@ -848,7 +848,7 @@
 		return NULL;
 	}
-	
+
 	ar9271->ddf_dev = dev;
-	
+
 	rc = ar9271_init(ar9271, usb_device_get(dev), endpoints);
 	if (rc != EOK) {
@@ -858,5 +858,5 @@
 		return NULL;
 	}
-	
+
 	return ar9271;
 }
@@ -869,5 +869,5 @@
 {
 	assert(ar9271);
-	
+
 	// TODO
 }
@@ -882,5 +882,5 @@
 {
 	assert(dev);
-	
+
 	/* Allocate driver data for the device. */
 	ar9271_t *ar9271 = ar9271_create_dev_data(dev);
@@ -889,10 +889,10 @@
 		return ENOMEM;
 	}
-	
+
 	usb_log_info("HelenOS AR9271 device initialized.\n");
-	
+
 	/* Upload AR9271 firmware. */
 	ar9271_upload_fw(ar9271);
-	
+
 	/* Initialize AR9271 HTC services. */
 	errno_t rc = htc_init(ar9271->htc_device);
@@ -902,5 +902,5 @@
 		return rc;
 	}
-	
+
 	/* Initialize AR9271 HW. */
 	rc = hw_init(ar9271);
@@ -910,5 +910,5 @@
 		return rc;
 	}
-	
+
 	/* Initialize AR9271 IEEE 802.11 framework. */
 	rc = ieee80211_init(ar9271->ieee80211_dev, &ar9271_ieee80211_ops,
@@ -920,11 +920,11 @@
 		return rc;
 	}
-	
+
 	nic_set_filtering_change_handlers(nic_get_from_ddf_dev(dev),
 	    ar9271_on_unicast_mode_change, ar9271_on_multicast_mode_change,
 	    ar9271_on_broadcast_mode_change, NULL, NULL);
-	
+
 	usb_log_info("HelenOS AR9271 added device.\n");
-	
+
 	return EOK;
 }
@@ -933,10 +933,10 @@
 {
 	log_init(NAME);
-	
+
 	if (nic_driver_init(NAME) != EOK)
 		return 1;
-	
+
 	usb_log_info("HelenOS AR9271 driver started.\n");
-	
+
 	return ddf_driver_main(&ar9271_driver);
 }
Index: uspace/drv/nic/ar9271/ar9271.h
===================================================================
--- uspace/drv/nic/ar9271/ar9271.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/ar9271.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -69,19 +69,19 @@
 	AR9271_COMMAND = 0x0008,
 	AR9271_COMMAND_RX_ENABLE = 0x00000004,
-	
+
 	/* ATH config register */
 	AR9271_CONFIG = 0x0014,
 	AR9271_CONFIG_ADHOC = 0x00000020,
-	
+
 	AR9271_QUEUE_BASE_MASK = 0x1000,
-	
+
 	/* EEPROM Addresses */
 	AR9271_EEPROM_BASE = 0x2100,
 	AR9271_EEPROM_MAC_ADDR_START = 0x2118,
-	
+
 	/* Reset MAC interface */
 	AR9271_RC = 0x4000,
 	AR9271_RC_AHB = 0x00000001,
-	
+
 	/* GPIO registers */
 	AR9271_GPIO_IN_OUT = 0x4048,       /**< GPIO value read/set  */
@@ -92,5 +92,5 @@
 	AR9271_GPIO_OUT_MUX3 = 0x4068,
 	AR9271_GPIO_OUT_MUX_AS_OUT = 0x0,  /**< GPIO set mux as output */
-	
+
 	/* RTC related registers */
 	AR9271_RTC_RC = 0x7000,
@@ -109,5 +109,5 @@
 	AR9271_RTC_FORCE_WAKE_ENABLE = 0x00000001,
 	AR9271_RTC_FORCE_WAKE_ON_INT = 0x00000002,
-	
+
 	/* MAC Registers */
 	AR9271_STATION_ID0 = 0x8000,  /**< STA Address Lower 32 Bits */
@@ -122,5 +122,5 @@
 	AR9271_MULTICAST_FILTER2 = 0x8044,
 	AR9271_DIAG = 0x8048,
-	
+
 	/* RX filtering register */
 	AR9271_RX_FILTER = 0x803C,
@@ -134,5 +134,5 @@
 	AR9271_RX_FILTER_MYBEACON = 0x00000200,
 	AR9271_RX_FILTER_MCAST_BCAST_ALL = 0x00008000,
-	
+
 	/* Key related registers */
 	AR9271_KEY_TABLE_BASE = 0x8800,
@@ -142,5 +142,5 @@
 	AR9271_KEY_TABLE_TYPE_CCMP = 0x6,
 	AR9271_KEY_TABLE_TYPE_CLR = 0x7,
-	
+
 	/* Physical layer registers */
 	AR9271_PHY_ACTIVE = 0x981C,
@@ -168,15 +168,15 @@
 	AR9271_PHY_TPCRG1_PD_CALIB = 0x00400000,
 	AR9271_CARRIER_LEAK_CALIB = 0x00000002,
-	
+
 	AR9271_OPMODE_STATION_AP_MASK =	0x00010000,
 	AR9271_OPMODE_ADHOC_MASK = 0x00020000,
-	
+
 	AR9271_CLOCK_CONTROL = 0x50040,
 	AR9271_MAX_CPU_CLOCK = 0x304,
-	
+
 	AR9271_RESET_POWER_DOWN_CONTROL = 0x50044,
 	AR9271_RADIO_RF_RESET = 0x20,
 	AR9271_GATE_MAC_CONTROL = 0x4000,
-	
+
 	/* FW Addresses */
 	AR9271_FW_ADDRESS = 0x501000,
@@ -197,20 +197,20 @@
 	/** Lock for access. */
 	fibril_mutex_t ar9271_lock;
-	
+
 	/** Whether device is starting up. */
 	bool starting_up;
-	
+
 	/** Backing DDF device */
 	ddf_dev_t *ddf_dev;
-	
+
 	/** USB device data */
 	usb_device_t *usb_device;
-	
+
 	/** IEEE 802.11 device data */
 	ieee80211_dev_t *ieee80211_dev;
-	
+
 	/** ATH device data */
 	ath_t *ath_device;
-	
+
 	/** HTC device data */
 	htc_device_t *htc_device;
Index: uspace/drv/nic/ar9271/ath.h
===================================================================
--- uspace/drv/nic/ar9271/ath.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/ath.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -50,11 +50,11 @@
 	/** Maximum length of data response message. */
 	size_t data_response_length;
-	
+
 	/** Maximum length of control response message. */
 	size_t ctrl_response_length;
-	
+
 	/** Implementation specific data. */
 	void *specific_data;
-	
+
 	/** Generic Atheros wifi operations. */
 	const ath_ops_t *ops;
Index: uspace/drv/nic/ar9271/ath_usb.c
===================================================================
--- uspace/drv/nic/ar9271/ath_usb.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/ath_usb.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -68,7 +68,7 @@
 		return ENOMEM;
 	}
-	
+
 	ath_usb->usb_device = usb_device;
-	
+
 	int rc;
 
@@ -89,11 +89,11 @@
 
 #undef _MAP_EP
-	
+
 	ath->ctrl_response_length = 64;
 	ath->data_response_length = 512;
-	
+
 	ath->specific_data = ath_usb;
 	ath->ops = &ath_usb_ops;
-	
+
 	return EOK;
 err_ath_usb:
@@ -152,16 +152,16 @@
 	memcpy(complete_buffer + sizeof(ath_usb_data_header_t),
 	    buffer, buffer_size);
-	
+
 	ath_usb_data_header_t *data_header =
 	    (ath_usb_data_header_t *) complete_buffer;
 	data_header->length = host2uint16_t_le(buffer_size);
 	data_header->tag = host2uint16_t_le(TX_TAG);
-	
+
 	ath_usb_t *ath_usb = (ath_usb_t *) ath->specific_data;
 	const errno_t ret_val = usb_pipe_write(ath_usb->output_data_pipe,
 	    complete_buffer, complete_buffer_size);
-	
+
 	free(complete_buffer);
-	
+
 	return ret_val;
 }
Index: uspace/drv/nic/ar9271/ath_usb.h
===================================================================
--- uspace/drv/nic/ar9271/ath_usb.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/ath_usb.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -49,5 +49,5 @@
 	usb_pipe_t *input_data_pipe;
 	usb_pipe_t *output_data_pipe;
-	
+
 	/** Pointer to connected USB device. */
 	usb_device_t *usb_device;
Index: uspace/drv/nic/ar9271/htc.c
===================================================================
--- uspace/drv/nic/ar9271/htc.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/htc.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -70,19 +70,19 @@
 	htc_vif_msg_t vif_msg;
 	htc_sta_msg_t sta_msg;
-	
+
 	memset(&vif_msg, 0, sizeof(htc_vif_msg_t));
 	memset(&sta_msg, 0, sizeof(htc_sta_msg_t));
-	
+
 	nic_address_t addr;
 	nic_t *nic =
 	    nic_get_from_ddf_dev(ieee80211_get_ddf_dev(htc_device->ieee80211_dev));
 	nic_query_address(nic, &addr);
-	
+
 	memcpy(&vif_msg.addr, &addr.address, ETH_ADDR);
 	memcpy(&sta_msg.addr, &addr.address, ETH_ADDR);
-	
+
 	ieee80211_operating_mode_t op_mode =
 	    ieee80211_query_current_op_mode(htc_device->ieee80211_dev);
-	
+
 	switch (op_mode) {
 	case IEEE80211_OPMODE_ADHOC:
@@ -99,19 +99,19 @@
 		break;
 	}
-	
+
 	vif_msg.index = 0;
 	vif_msg.rts_thres = host2uint16_t_be(HTC_RTS_THRESHOLD);
-	
+
 	wmi_send_command(htc_device, WMI_VAP_CREATE, (uint8_t *) &vif_msg,
 	    sizeof(vif_msg), NULL);
-	
+
 	sta_msg.is_vif_sta = 1;
 	sta_msg.max_ampdu = host2uint16_t_be(0xFFFF);
 	sta_msg.sta_index = 0;
 	sta_msg.vif_index = 0;
-	
+
 	wmi_send_command(htc_device, WMI_NODE_CREATE, (uint8_t *) &sta_msg,
 	    sizeof(sta_msg), NULL);
-	
+
 	/* Write first 4 bytes of MAC address. */
 	uint32_t id0;
@@ -119,14 +119,14 @@
 	id0 = host2uint32_t_le(id0);
 	wmi_reg_write(htc_device, AR9271_STATION_ID0, id0);
-	
+
 	/* Write last 2 bytes of MAC address (and preserve existing data). */
 	uint32_t id1;
 	wmi_reg_read(htc_device, AR9271_STATION_ID1, &id1);
-	
+
 	uint16_t id1_addr;
 	memcpy(&id1_addr, &addr.address[4], 2);
 	id1 = (id1 & ~AR9271_STATION_ID1_MASK) | host2uint16_t_le(id1_addr);
 	wmi_reg_write(htc_device, AR9271_STATION_ID1, id1);
-	
+
 	return EOK;
 }
@@ -136,5 +136,5 @@
 {
 	memset(header, 0, sizeof(htc_frame_header_t));
-	
+
 	header->endpoint_id = endpoint_id;
 	header->payload_length =
@@ -158,7 +158,7 @@
 	htc_config_frame_header((htc_frame_header_t *) buffer, buffer_size,
 	    endpoint_id);
-	
+
 	ath_t *ath_device = htc_device->ath_device;
-	
+
 	return ath_device->ops->send_ctrl_message(ath_device, buffer,
 	    buffer_size);
@@ -181,7 +181,7 @@
 	htc_config_frame_header((htc_frame_header_t *) buffer, buffer_size,
 	    endpoint_id);
-	
+
 	ath_t *ath_device = htc_device->ath_device;
-	
+
 	return ath_device->ops->send_data_message(ath_device, buffer,
 	    buffer_size);
@@ -203,5 +203,5 @@
 {
 	ath_t *ath_device = htc_device->ath_device;
-	
+
 	return ath_device->ops->read_data_message(ath_device, buffer,
 	    buffer_size, transferred_size);
@@ -223,5 +223,5 @@
 {
 	ath_t *ath_device = htc_device->ath_device;
-	
+
 	return ath_device->ops->read_ctrl_message(ath_device, buffer,
 	    buffer_size, transferred_size);
@@ -246,5 +246,5 @@
 	void *buffer = malloc(buffer_size);
 	memset(buffer, 0, buffer_size);
-	
+
 	/* Fill service message structure. */
 	htc_service_msg_t *service_message = (htc_service_msg_t *)
@@ -259,5 +259,5 @@
 	    wmi_service_to_upload_pipe(service_id);
 	service_message->connection_flags = 0;
-	
+
 	/* Send HTC message. */
 	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
@@ -268,10 +268,10 @@
 		return rc;
 	}
-	
+
 	free(buffer);
-	
+
 	buffer_size = htc_device->ath_device->ctrl_response_length;
 	buffer = malloc(buffer_size);
-	
+
 	/* Read response from device. */
 	rc = htc_read_control_message(htc_device, buffer, buffer_size, NULL);
@@ -282,8 +282,8 @@
 		return rc;
 	}
-	
+
 	htc_service_resp_msg_t *response_message = (htc_service_resp_msg_t *)
 	    ((void *) buffer + sizeof(htc_frame_header_t));
-	
+
 	/*
 	 * If service was successfully connected,
@@ -299,7 +299,7 @@
 		rc = EINVAL;
 	}
-	
+
 	free(buffer);
-	
+
 	return rc;
 }
@@ -319,5 +319,5 @@
 	htc_config_msg_t *config_message = (htc_config_msg_t *)
 	    ((void *) buffer + sizeof(htc_frame_header_t));
-	
+
 	config_message->message_id =
 	    host2uint16_t_be(HTC_MESSAGE_CONFIG);
@@ -325,5 +325,5 @@
 	config_message->credits = 33;
 	config_message->pipe_id = 1;
-	
+
 	/* Send HTC message. */
 	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
@@ -335,10 +335,10 @@
 		return rc;
 	}
-	
+
 	free(buffer);
-	
+
 	buffer_size = htc_device->ath_device->ctrl_response_length;
 	buffer = malloc(buffer_size);
-	
+
 	/* Check response from device. */
 	rc = htc_read_control_message(htc_device, buffer, buffer_size, NULL);
@@ -347,7 +347,7 @@
 		    "Error: %s\n", str_error_name(rc));
 	}
-	
+
 	free(buffer);
-	
+
 	return rc;
 }
@@ -368,8 +368,8 @@
 	    (htc_setup_complete_msg_t *)
 	    ((void *) buffer + sizeof(htc_frame_header_t));
-	
+
 	complete_message->message_id =
 	    host2uint16_t_be(HTC_MESSAGE_SETUP_COMPLETE);
-	
+
 	/* Send HTC message. */
 	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
@@ -378,7 +378,7 @@
 		usb_log_error("Failed to send HTC setup complete message. "
 		    "Error: %s\n", str_error_name(rc));
-	
+
 	free(buffer);
-	
+
 	return rc;
 }
@@ -398,5 +398,5 @@
 	size_t buffer_size = htc_device->ath_device->ctrl_response_length;
 	void *buffer = malloc(buffer_size);
-	
+
 	/* Read response from device. */
 	errno_t rc = htc_read_control_message(htc_device, buffer, buffer_size,
@@ -408,5 +408,5 @@
 		return rc;
 	}
-	
+
 	uint16_t *message_id = (uint16_t *) ((void *) buffer +
 	    sizeof(htc_frame_header_t));
@@ -415,7 +415,7 @@
 	else
 		rc = EINVAL;
-	
+
 	free(buffer);
-	
+
 	return rc;
 }
@@ -435,10 +435,10 @@
 	fibril_mutex_initialize(&htc_device->rx_lock);
 	fibril_mutex_initialize(&htc_device->tx_lock);
-	
+
 	htc_device->endpoints.ctrl_endpoint = 0;
-	
+
 	htc_device->ath_device = ath_device;
 	htc_device->ieee80211_dev = ieee80211_dev;
-	
+
 	return EOK;
 }
@@ -460,5 +460,5 @@
 		return rc;
 	}
-	
+
 	/*
 	 * HTC services initialization start.
@@ -470,5 +470,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_BEACON_SERVICE,
 	    &htc_device->endpoints.beacon_endpoint);
@@ -477,5 +477,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_CAB_SERVICE,
 	    &htc_device->endpoints.cab_endpoint);
@@ -484,5 +484,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_UAPSD_SERVICE,
 	    &htc_device->endpoints.uapsd_endpoint);
@@ -491,5 +491,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_MGMT_SERVICE,
 	    &htc_device->endpoints.mgmt_endpoint);
@@ -498,5 +498,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_DATA_BE_SERVICE,
 	    &htc_device->endpoints.data_be_endpoint);
@@ -506,5 +506,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_DATA_BK_SERVICE,
 	    &htc_device->endpoints.data_bk_endpoint);
@@ -514,5 +514,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_DATA_VIDEO_SERVICE,
 	    &htc_device->endpoints.data_video_endpoint);
@@ -521,5 +521,5 @@
 		return rc;
 	}
-	
+
 	rc = htc_connect_service(htc_device, WMI_DATA_VOICE_SERVICE,
 	    &htc_device->endpoints.data_voice_endpoint);
@@ -528,9 +528,9 @@
 		return rc;
 	}
-	
+
 	/*
 	 * HTC services initialization end.
 	 */
-	
+
 	/* Credits initialization message. */
 	rc = htc_config_credits(htc_device);
@@ -539,5 +539,5 @@
 		return rc;
 	}
-	
+
 	/* HTC setup complete confirmation message. */
 	rc = htc_complete_setup(htc_device);
@@ -546,7 +546,7 @@
 		return rc;
 	}
-	
+
 	usb_log_info("HTC services initialization finished successfully.\n");
-	
+
 	return EOK;
 }
Index: uspace/drv/nic/ar9271/htc.h
===================================================================
--- uspace/drv/nic/ar9271/htc.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/htc.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -112,17 +112,17 @@
 	/** WMI message sequence number */
 	uint16_t sequence_number;
-	
+
 	/** HTC endpoints numbers */
 	htc_pipes_t endpoints;
-	
+
 	/** Lock for receiver */
 	fibril_mutex_t rx_lock;
-	
+
 	/** Lock for transmitter */
 	fibril_mutex_t tx_lock;
-	
+
 	/** Pointer to related IEEE 802.11 device */
 	ieee80211_dev_t *ieee80211_dev;
-	
+
 	/** Pointer to Atheros WiFi device structure */
 	ath_t *ath_device;
@@ -175,5 +175,5 @@
 	uint16_t credits;      /**< Big Endian value! */
 	uint16_t credit_size;  /**< Big Endian value! */
-	
+
 	uint8_t max_endpoints;
 	uint8_t pad;
@@ -187,5 +187,5 @@
 	uint16_t service_id;        /**< Big Endian value! */
 	uint16_t connection_flags;  /**< Big Endian value! */
-	
+
 	uint8_t download_pipe_id;
 	uint8_t upload_pipe_id;
@@ -237,9 +237,9 @@
 	uint8_t vif_index;
 	uint8_t is_vif_sta;
-	
+
 	uint16_t flags;      /**< Big Endian value! */
 	uint16_t ht_cap;     /**< Big Endian value! */
 	uint16_t max_ampdu;  /**< Big Endian value! */
-	
+
 	uint8_t pad;
 } __attribute__((packed)) htc_sta_msg_t;
Index: uspace/drv/nic/ar9271/hw.c
===================================================================
--- uspace/drv/nic/ar9271/hw.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/hw.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -57,5 +57,5 @@
 	for (size_t i = 0; i < HW_WAIT_LOOPS; i++) {
 		udelay(HW_WAIT_TIME_US);
-		
+
 		uint32_t result;
 		wmi_reg_read(ar9271->htc_device, offset, &result);
@@ -63,5 +63,5 @@
 			return EOK;
 	}
-	
+
 	return ETIMEOUT;
 }
@@ -84,13 +84,13 @@
 		}
 	};
-	
+
 	wmi_reg_buffer_write(ar9271->htc_device, buffer,
 	    sizeof(buffer) / sizeof(wmi_reg_t));
-	
+
 	udelay(2);
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_RC, 0);
 	wmi_reg_write(ar9271->htc_device, AR9271_RTC_RESET, 1);
-	
+
 	errno_t rc = hw_read_wait(ar9271,
 	    AR9271_RTC_STATUS,
@@ -101,5 +101,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -108,8 +108,8 @@
 {
 	uint32_t reset_value = AR9271_RTC_RC_MAC_WARM;
-	
+
 	if (cold)
 		reset_value |= AR9271_RTC_RC_MAC_COLD;
-	
+
 	wmi_reg_t buffer[] = {
 		{
@@ -127,12 +127,12 @@
 		}
 	};
-	
+
 	wmi_reg_buffer_write(ar9271->htc_device, buffer,
 	    sizeof(buffer) / sizeof(wmi_reg_t));
-	
+
 	udelay(100);
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_RTC_RC, 0);
-	
+
 	errno_t rc = hw_read_wait(ar9271, AR9271_RTC_RC, AR9271_RTC_RC_MASK, 0);
 	if (rc != EOK) {
@@ -140,9 +140,9 @@
 		return rc;
 	}
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_RC, 0);
 	wmi_reg_clear_bit(ar9271->htc_device, AR9271_STATION_ID1,
 	    AR9271_STATION_ID1_POWER_SAVING);
-	
+
 	return EOK;
 }
@@ -152,16 +152,16 @@
 	uint32_t value;
 	nic_address_t ar9271_address;
-	
+
 	for (unsigned int i = 0; i < 3; i++) {
 		wmi_reg_read(ar9271->htc_device,
 		    AR9271_EEPROM_MAC_ADDR_START + i * 4, &value);
-		
+
 		uint16_t two_bytes = uint16_t_be2host(value);
 		ar9271_address.address[2*i] = two_bytes >> 8;
 		ar9271_address.address[2*i+1] = two_bytes & 0xff;
 	}
-	
+
 	nic_t *nic = nic_get_from_ddf_dev(ar9271->ddf_dev);
-	
+
 	errno_t rc = nic_report_address(nic, &ar9271_address);
 	if (rc != EOK) {
@@ -169,5 +169,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -176,5 +176,5 @@
 {
 	uint32_t address;
-	
+
 	if (gpio > 11)
 		address = AR9271_GPIO_OUT_MUX3;
@@ -183,22 +183,22 @@
 	else
 		address = AR9271_GPIO_OUT_MUX1;
-	
+
 	uint32_t gpio_shift = (gpio % 6) * 5;
-	
+
 	uint32_t temp;
 	wmi_reg_read(ar9271->htc_device, address, &temp);
-	
+
 	temp = ((temp & 0x1f0) << 1) | (temp & ~0x1f0);
 	temp &= ~(0x1f << gpio_shift);
 	temp |= (type << gpio_shift);
-	
+
 	wmi_reg_write(ar9271->htc_device, address, temp);
-	
+
 	gpio_shift = 2 * gpio;
-	
+
 	wmi_reg_set_clear_bit(ar9271->htc_device, AR9271_GPIO_OE_OUT,
 	    AR9271_GPIO_OE_OUT_ALWAYS << gpio_shift,
 	    AR9271_GPIO_OE_OUT_ALWAYS << gpio_shift);
-	
+
 	return EOK;
 }
@@ -225,5 +225,5 @@
 		return rc;
 	}
-	
+
 	rc = hw_set_reset(ar9271, false);
 	if (rc != EOK) {
@@ -231,5 +231,5 @@
 		return rc;
 	}
-	
+
 	rc = hw_addr_init(ar9271);
 	if (rc != EOK) {
@@ -237,5 +237,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -249,5 +249,5 @@
 		return rc;
 	}
-	
+
 	rc = hw_gpio_set_value(ar9271, AR9271_LED_PIN, 0);
 	if (rc != EOK) {
@@ -255,5 +255,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -263,5 +263,5 @@
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_ACTIVE, 1);
 	udelay(1000);
-	
+
 	return EOK;
 }
@@ -271,5 +271,5 @@
 {
 	uint32_t set_bit = 0x10000000;
-	
+
 	switch(op_mode) {
 	case IEEE80211_OPMODE_ADHOC:
@@ -286,10 +286,10 @@
 		    AR9271_CONFIG_ADHOC);
 	}
-	
+
 	wmi_reg_set_clear_bit(ar9271->htc_device, AR9271_STATION_ID1,
 	    set_bit, AR9271_OPMODE_STATION_AP_MASK | AR9271_OPMODE_ADHOC_MASK);
-	
+
 	ieee80211_report_current_op_mode(ar9271->ieee80211_dev, op_mode);
-	
+
 	return EOK;
 }
@@ -302,5 +302,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -310,19 +310,19 @@
 	uint32_t value;
 	wmi_reg_read(ar9271->htc_device, AR9271_PHY_CAL, &value);
-	
+
 	value &= 0xfffffe00;
 	value |= (((uint32_t) AR9271_CALIB_NOMINAL_VALUE_2GHZ << 1) & 0x1ff);
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_CAL, value);
-	
+
 	wmi_reg_clear_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_CALIB_EN);
-	
+
 	wmi_reg_clear_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_NOT_UPDATE);
-	
+
 	wmi_reg_set_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_CALIB);
-	
+
 	errno_t rc = hw_read_wait(ar9271, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_CALIB, 0);
@@ -331,14 +331,14 @@
 		return rc;
 	}
-	
+
 	wmi_reg_set_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_CALIB_EN);
-	
+
 	wmi_reg_clear_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_NOT_UPDATE);
-	
+
 	wmi_reg_set_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_NF_CALIB);
-	
+
 	return EOK;
 }
@@ -349,14 +349,14 @@
 	if ((freq < IEEE80211_FIRST_FREQ) || (freq > IEEE80211_MAX_FREQ))
 		return EINVAL;
-	
+
 	/* Not supported channel frequency. */
 	if ((freq - IEEE80211_FIRST_FREQ) % IEEE80211_CHANNEL_GAP != 0)
 		return EINVAL;
-	
+
 	uint32_t tx_control;
 	wmi_reg_read(ar9271->htc_device, AR9271_PHY_CCK_TX_CTRL, &tx_control);
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_CCK_TX_CTRL,
 	    tx_control & ~AR9271_PHY_CCK_TX_CTRL_JAPAN);
-	
+
 	/* Some magic here. */
 	uint32_t synth_ctl;
@@ -365,9 +365,9 @@
 	uint32_t channel_select = (freq * 0x10000) / 15;
 	synth_ctl = synth_ctl | (1 << 29) | (1 << 28) | channel_select;
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_SYNTH_CONTROL, synth_ctl);
-	
+
 	ieee80211_report_current_freq(ar9271->ieee80211_dev, freq);
-	
+
 	return EOK;
 }
@@ -376,5 +376,5 @@
 {
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_RFBUS_KILL, 0x1);
-	
+
 	errno_t rc = hw_read_wait(ar9271, AR9271_PHY_RFBUS_GRANT, 0x1, 0x1);
 	if (rc != EOK) {
@@ -382,5 +382,5 @@
 		return rc;
 	}
-	
+
 	rc = hw_set_freq(ar9271, freq);
 	if (rc != EOK) {
@@ -388,5 +388,5 @@
 		return rc;
 	}
-	
+
 	rc = hw_activate_phy(ar9271);
 	if (rc != EOK) {
@@ -394,8 +394,8 @@
 		return rc;
 	}
-	
+
 	udelay(1000);
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_RFBUS_KILL, 0x0);
-	
+
 	rc = hw_noise_floor_calibration(ar9271);
 	if (rc != EOK) {
@@ -403,5 +403,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -410,16 +410,16 @@
 {
 	uint32_t additional_bits = 0;
-	
+
 	if (assoc)
 		additional_bits |= AR9271_RX_FILTER_MYBEACON;
 	else
 		additional_bits |= AR9271_RX_FILTER_BEACON;
-	
+
 	uint32_t filter_bits = AR9271_RX_FILTER_UNI |
 	    AR9271_RX_FILTER_MULTI | AR9271_RX_FILTER_BROAD |
 	    additional_bits;
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_RX_FILTER, filter_bits);
-	
+
 	return EOK;
 }
@@ -428,18 +428,18 @@
 {
 	ieee80211_dev_t *ieee80211_dev = ar9271->ieee80211_dev;
-	
+
 	nic_address_t bssid;
 	ieee80211_query_bssid(ieee80211_dev, &bssid);
-	
+
 	uint32_t *first_4bytes = (uint32_t *) &bssid.address;
 	uint16_t *last_2bytes = (uint16_t *) &bssid.address[4];
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_BSSID0,
 	    uint32_t_le2host(*first_4bytes));
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_BSSID1,
 	    uint16_t_le2host(*last_2bytes) |
 	    ((ieee80211_get_aid(ieee80211_dev) & 0x3fff) << 16));
-	
+
 	return EOK;
 }
@@ -449,5 +449,5 @@
 	wmi_reg_write(ar9271->htc_device, AR9271_COMMAND,
 	    AR9271_COMMAND_RX_ENABLE);
-	
+
 	errno_t rc = hw_set_rx_filter(ar9271, false);
 	if (rc != EOK) {
@@ -455,11 +455,11 @@
 		return rc;
 	}
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_MULTICAST_FILTER1, ~0);
 	wmi_reg_write(ar9271->htc_device, AR9271_MULTICAST_FILTER2, ~0);
-	
+
 	/* Disable RX blocking. */
 	wmi_reg_clear_bit(ar9271->htc_device, AR9271_DIAG, (0x20 | 0x02000000));
-	
+
 	return EOK;
 }
@@ -469,12 +469,12 @@
 	/* Some magic here (set for 2GHz channels). But VERY important :-) */
 	uint32_t pll = (0x5 << 10) | 0x2c;
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_RTC_PLL_CONTROL, pll);
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_RTC_SLEEP_CLOCK,
 	    AR9271_RTC_SLEEP_CLOCK_FORCE_DERIVED);
 	wmi_reg_set_bit(ar9271->htc_device, AR9271_RTC_FORCE_WAKE,
 	    AR9271_RTC_FORCE_WAKE_ENABLE);
-	
+
 	return EOK;
 }
@@ -484,7 +484,7 @@
 	uint32_t reg_offset;
 	uint32_t reg_value;
-	
+
 	size_t size = ARRAY_SIZE(ar9271_2g_mode_array);
-	
+
 	for (size_t i = 0; i < size; i++) {
 		reg_offset = ar9271_2g_mode_array[i][0];
@@ -492,7 +492,7 @@
 		wmi_reg_write(ar9271->htc_device, reg_offset, reg_value);
 	}
-	
+
 	size = ARRAY_SIZE(ar9271_2g_tx_array);
-	
+
 	for (size_t i = 0; i < size; i++) {
 		reg_offset = ar9271_2g_tx_array[i][0];
@@ -500,7 +500,7 @@
 		wmi_reg_write(ar9271->htc_device, reg_offset, reg_value);
 	}
-	
+
 	size = ARRAY_SIZE(ar9271_init_array);
-	
+
 	for (size_t i = 0; i < size; i++) {
 		reg_offset = ar9271_init_array[i][0];
@@ -522,5 +522,5 @@
 	wmi_reg_set_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_CALIB);
-	
+
 	errno_t rc = hw_read_wait(ar9271, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_CALIB, 0);
@@ -529,5 +529,5 @@
 		return rc;
 	}
-	
+
 	wmi_reg_set_bit(ar9271->htc_device, AR9271_ADC_CONTROL,
 	    AR9271_ADC_CONTROL_OFF_PWDADC);
@@ -536,5 +536,5 @@
 	wmi_reg_clear_bit(ar9271->htc_device, AR9271_AGC_CONTROL,
 	    AR9271_AGC_CONTROL_TX_CALIB);
-	
+
 	return EOK;
 }
@@ -544,13 +544,13 @@
 	/* Set physical layer as deactivated. */
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_ACTIVE, 0);
-	
+
 	if(ar9271->starting_up) {
 		wmi_reg_write(ar9271->htc_device,
 		    AR9271_RESET_POWER_DOWN_CONTROL,
 		    AR9271_RADIO_RF_RESET);
-		
+
 		udelay(50);
 	}
-	
+
 	/* Cold reset when RX is enabled. */
 	uint32_t config_reg;
@@ -558,5 +558,5 @@
 	if (config_reg & AR9271_COMMAND_RX_ENABLE)
 		hw_set_reset(ar9271, true);
-	
+
 	errno_t rc = hw_init_pll(ar9271);
 	if (rc != EOK) {
@@ -564,26 +564,26 @@
 		return rc;
 	}
-	
+
 	udelay(500);
-	
+
 	wmi_reg_write(ar9271->htc_device, AR9271_CLOCK_CONTROL,
 	    AR9271_MAX_CPU_CLOCK);
-	
+
 	udelay(100);
-	
+
 	if (ar9271->starting_up) {
 		wmi_reg_write(ar9271->htc_device,
 		    AR9271_RESET_POWER_DOWN_CONTROL,
 		    AR9271_GATE_MAC_CONTROL);
-		
+
 		udelay(50);
 	}
-	
+
 	hw_set_init_values(ar9271);
-	
+
 	/* Set physical layer mode. */
 	wmi_reg_write(ar9271->htc_device, AR9271_PHY_MODE,
 	    AR9271_PHY_MODE_DYNAMIC);
-	
+
 	/* Reset device operating mode. */
 	rc = hw_reset_operating_mode(ar9271);
@@ -592,5 +592,5 @@
 		return rc;
 	}
-	
+
 	/* Set initial channel frequency. */
 	rc = hw_set_freq(ar9271, IEEE80211_FIRST_FREQ);
@@ -599,5 +599,5 @@
 		return rc;
 	}
-	
+
 	/* Initialize transmission queues. */
 	for (unsigned int i = 0; i < AR9271_QUEUES_COUNT; i++) {
@@ -605,5 +605,5 @@
 		    AR9271_QUEUE_BASE_MASK + (i << 2), 1 << i);
 	}
-	
+
 	/* Activate physical layer. */
 	rc = hw_activate_phy(ar9271);
@@ -612,5 +612,5 @@
 		return rc;
 	}
-	
+
 	/* Calibration. */
 	rc = hw_calibration(ar9271);
@@ -619,5 +619,5 @@
 		return rc;
 	}
-	
+
 	rc = hw_noise_floor_calibration(ar9271);
 	if (rc != EOK) {
@@ -625,8 +625,8 @@
 		return rc;
 	}
-	
+
 	/* Byteswap TX and RX data buffer words. */
 	wmi_reg_write(ar9271->htc_device, AR9271_CONFIG, 0xA);
-	
+
 	return EOK;
 }
@@ -645,5 +645,5 @@
 		return rc;
 	}
-	
+
 	rc = hw_init_led(ar9271);
 	if (rc != EOK) {
@@ -651,7 +651,7 @@
 		return rc;
 	}
-	
+
 	usb_log_info("HW initialization finished successfully.\n");
-	
-	return EOK;
-}
+
+	return EOK;
+}
Index: uspace/drv/nic/ar9271/wmi.c
===================================================================
--- uspace/drv/nic/ar9271/wmi.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/wmi.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -53,21 +53,21 @@
 {
 	uint32_t cmd_value = host2uint32_t_be(reg_offset);
-	
+
 	void *resp_buffer =
 	    malloc(htc_device->ath_device->ctrl_response_length);
-	
+
 	errno_t rc = wmi_send_command(htc_device, WMI_REG_READ,
 	    (uint8_t *) &cmd_value, sizeof(cmd_value), resp_buffer);
-	
+
 	if (rc != EOK) {
 		usb_log_error("Failed to read registry value.\n");
 		return rc;
 	}
-	
+
 	uint32_t *resp_value = (uint32_t *) ((void *) resp_buffer +
 	    sizeof(htc_frame_header_t) + sizeof(wmi_command_header_t));
-	
+
 	*res = uint32_t_be2host(*resp_value);
-	
+
 	return rc;
 }
@@ -88,18 +88,18 @@
 		host2uint32_t_be(val)
 	};
-	
+
 	void *resp_buffer =
 	    malloc(htc_device->ath_device->ctrl_response_length);
-	
+
 	errno_t rc = wmi_send_command(htc_device, WMI_REG_WRITE,
 	    (uint8_t *) &cmd_buffer, sizeof(cmd_buffer), resp_buffer);
-	
+
 	free(resp_buffer);
-	
+
 	if (rc != EOK) {
 		usb_log_error("Failed to write registry value.\n");
 		return rc;
 	}
-	
+
 	return rc;
 }
@@ -119,5 +119,5 @@
 {
 	uint32_t value;
-	
+
 	errno_t rc = wmi_reg_read(htc_device, reg_offset, &value);
 	if (rc != EOK) {
@@ -126,8 +126,8 @@
 		return rc;
 	}
-	
+
 	value &= ~clear_bit;
 	value |= set_bit;
-	
+
 	rc = wmi_reg_write(htc_device, reg_offset, value);
 	if (rc != EOK) {
@@ -136,5 +136,5 @@
 		return rc;
 	}
-	
+
 	return rc;
 }
@@ -186,5 +186,5 @@
 	void *resp_buffer =
 	    malloc(htc_device->ath_device->ctrl_response_length);
-	
+
 	/* Convert values to correct endianness. */
 	for (size_t i = 0; i < elements; i++) {
@@ -197,16 +197,16 @@
 		    host2uint32_t_be(buffer_element->value);
 	}
-	
+
 	errno_t rc = wmi_send_command(htc_device, WMI_REG_WRITE,
 	    (uint8_t *) buffer, buffer_size, resp_buffer);
-	
+
 	free(buffer);
 	free(resp_buffer);
-	
+
 	if (rc != EOK) {
 		usb_log_error("Failed to write multi registry value.\n");
 		return rc;
 	}
-	
+
 	return rc;
 }
@@ -230,8 +230,8 @@
 	size_t buffer_size = header_size + command_length;
 	void *buffer = malloc(buffer_size);
-	
+
 	if (command_buffer != NULL)
 		memcpy(buffer+header_size, command_buffer, command_length);
-	
+
 	/* Set up WMI header */
 	wmi_command_header_t *wmi_header = (wmi_command_header_t *)
@@ -240,5 +240,5 @@
 	wmi_header->sequence_number =
 	    host2uint16_t_be(++htc_device->sequence_number);
-	
+
 	/* Send message. */
 	errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size,
@@ -249,7 +249,7 @@
 		return rc;
 	}
-	
+
 	free(buffer);
-	
+
 	bool clean_resp_buffer = false;
 	size_t response_buffer_size =
@@ -259,5 +259,5 @@
 		clean_resp_buffer = true;
 	}
-	
+
 	/* Read response. */
 	/* TODO: Ignoring WMI management RX messages ~ TX statuses etc. */
@@ -272,5 +272,5 @@
 			return rc;
 		}
-		
+
 		if (response_buffer_size < sizeof(htc_frame_header_t) +
 		    sizeof(wmi_command_header_t)) {
@@ -279,13 +279,13 @@
 			return EINVAL;
 		}
-		
+
 		wmi_command_header_t *wmi_hdr = (wmi_command_header_t *)
 		    ((void *) response_buffer + sizeof(htc_frame_header_t));
 		cmd_id = uint16_t_be2host(wmi_hdr->command_id);
 	} while(cmd_id & WMI_MGMT_CMD_MASK);
-	
+
 	if (clean_resp_buffer)
 		free(response_buffer);
-	
-	return rc;
-}
+
+	return rc;
+}
Index: uspace/drv/nic/ar9271/wmi.h
===================================================================
--- uspace/drv/nic/ar9271/wmi.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ar9271/wmi.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -76,5 +76,5 @@
 	WMI_ECHO = 0x0001,
 	WMI_ACCESS_MEMORY,
-	
+
 	/* Commands used for HOST -> DEVICE communication */
 	WMI_GET_FW_VERSION,
Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/e1k/e1k.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -122,54 +122,54 @@
 	/** Device configuration */
 	e1000_info_t info;
-	
+
 	/** Physical registers base address */
 	void *reg_base_phys;
 	/** Virtual registers base address */
 	void *reg_base_virt;
-	
+
 	/** Physical tx ring address */
 	uintptr_t tx_ring_phys;
 	/** Virtual tx ring address */
 	void *tx_ring_virt;
-	
+
 	/** Ring of TX frames, physical address */
 	uintptr_t *tx_frame_phys;
 	/** Ring of TX frames, virtual address */
 	void **tx_frame_virt;
-	
+
 	/** Physical rx ring address */
 	uintptr_t rx_ring_phys;
 	/** Virtual rx ring address */
 	void *rx_ring_virt;
-	
+
 	/** Ring of RX frames, physical address */
 	uintptr_t *rx_frame_phys;
 	/** Ring of RX frames, virtual address */
 	void **rx_frame_virt;
-	
+
 	/** VLAN tag */
 	uint16_t vlan_tag;
-	
+
 	/** Add VLAN tag to frame */
 	bool vlan_tag_add;
-	
+
 	/** Used unicast Receive Address count */
 	unsigned int unicast_ra_count;
-	
+
 	/** Used milticast Receive addrress count */
 	unsigned int multicast_ra_count;
-	
+
 	/** The irq assigned */
 	int irq;
-	
+
 	/** Lock for CTRL register */
 	fibril_mutex_t ctrl_lock;
-	
+
 	/** Lock for receiver */
 	fibril_mutex_t rx_lock;
-	
+
 	/** Lock for transmitter */
 	fibril_mutex_t tx_lock;
-	
+
 	/** Lock for EEPROM access */
 	fibril_mutex_t eeprom_lock;
@@ -292,7 +292,7 @@
 	assert(dev);
 	assert(info);
-	
+
 	memset(info, 0, sizeof(nic_device_info_t));
-	
+
 	info->vendor_id = 0x8086;
 	str_cpy(info->vendor_name, NIC_VENDOR_MAX_LENGTH,
@@ -300,9 +300,9 @@
 	str_cpy(info->model_name, NIC_MODEL_MAX_LENGTH,
 	    "Intel Pro");
-	
+
 	info->ethernet_support[ETH_10M] = ETH_10BASE_T;
 	info->ethernet_support[ETH_100M] = ETH_100BASE_TX;
 	info->ethernet_support[ETH_1000M] = ETH_1000BASE_T;
-	
+
 	return EOK;
 }
@@ -323,5 +323,5 @@
 	else
 		*state = NIC_CS_UNPLUGGED;
-	
+
 	return EOK;
 }
@@ -340,13 +340,13 @@
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	uint32_t status = E1000_REG_READ(e1000, E1000_STATUS);
-	
+
 	if (status & STATUS_FD)
 		*duplex = NIC_CM_FULL_DUPLEX;
 	else
 		*duplex = NIC_CM_HALF_DUPLEX;
-	
+
 	uint32_t speed_bits =
 	    (status >> STATUS_SPEED_SHIFT) & STATUS_SPEED_ALL;
-	
+
 	if (speed_bits == STATUS_SPEED_10)
 		*speed = 10;
@@ -356,5 +356,5 @@
 	    (speed_bits == STATUS_SPEED_1000B))
 		*speed = 1000;
-	
+
 	*role = NIC_ROLE_UNKNOWN;
 	return EOK;
@@ -364,14 +364,14 @@
 {
 	fibril_mutex_lock(&e1000->ctrl_lock);
-	
+
 	uint32_t ctrl = E1000_REG_READ(e1000, E1000_CTRL);
-	
+
 	if (ctrl & CTRL_SLU) {
 		ctrl &= ~(CTRL_SLU);
 		E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
 		fibril_mutex_unlock(&e1000->ctrl_lock);
-		
+
 		async_usleep(10);
-		
+
 		fibril_mutex_lock(&e1000->ctrl_lock);
 		ctrl = E1000_REG_READ(e1000, E1000_CTRL);
@@ -379,5 +379,5 @@
 		E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
 	}
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
 }
@@ -391,22 +391,22 @@
 	if ((speed != 10) && (speed != 100) && (speed != 1000))
 		return EINVAL;
-	
+
 	if ((duplex != NIC_CM_HALF_DUPLEX) && (duplex != NIC_CM_FULL_DUPLEX))
 		return EINVAL;
-	
+
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
-	
+
 	fibril_mutex_lock(&e1000->ctrl_lock);
 	uint32_t ctrl = E1000_REG_READ(e1000, E1000_CTRL);
-	
+
 	ctrl |= CTRL_FRCSPD;
 	ctrl |= CTRL_FRCDPLX;
 	ctrl &= ~(CTRL_ASDE);
-	
+
 	if (duplex == NIC_CM_FULL_DUPLEX)
 		ctrl |= CTRL_FD;
 	else
 		ctrl &= ~(CTRL_FD);
-	
+
 	ctrl &= ~(CTRL_SPEED_MASK);
 	if (speed == 1000)
@@ -416,11 +416,11 @@
 	else
 		ctrl |= CTRL_SPEED_10 << CTRL_SPEED_SHIFT;
-	
+
 	E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
-	
+
 	e1000_link_restart(e1000);
-	
+
 	return EOK;
 }
@@ -437,19 +437,19 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
-	
+
 	fibril_mutex_lock(&e1000->ctrl_lock);
-	
+
 	uint32_t ctrl = E1000_REG_READ(e1000, E1000_CTRL);
-	
+
 	ctrl &= ~(CTRL_FRCSPD);
 	ctrl &= ~(CTRL_FRCDPLX);
 	ctrl |= CTRL_ASDE;
-	
+
 	E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
-	
+
 	e1000_link_restart(e1000);
-	
+
 	return EOK;
 }
@@ -465,19 +465,19 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
-	
+
 	fibril_mutex_lock(&e1000->ctrl_lock);
-	
+
 	uint32_t ctrl = E1000_REG_READ(e1000, E1000_CTRL);
-	
+
 	ctrl |= CTRL_FRCSPD;
 	ctrl |= CTRL_FRCDPLX;
 	ctrl &= ~(CTRL_ASDE);
-	
+
 	E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
-	
+
 	e1000_link_restart(e1000);
-	
+
 	return EOK;
 }
@@ -504,10 +504,10 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
-	
+
 	*mode = 0;
 	uint32_t rctl = E1000_REG_READ(e1000, E1000_RCTL);
 	if (rctl & RCTL_SBP)
 		*mode = NIC_DEFECTIVE_BAD_CRC | NIC_DEFECTIVE_SHORT;
-	
+
 	return EOK;
 };
@@ -526,11 +526,11 @@
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	errno_t rc = EOK;
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	uint32_t rctl = E1000_REG_READ(e1000, E1000_RCTL);
 	bool short_mode = (mode & NIC_DEFECTIVE_SHORT ? true : false);
 	bool bad_mode = (mode & NIC_DEFECTIVE_BAD_CRC ? true : false);
-	
+
 	if (short_mode && bad_mode)
 		rctl |= RCTL_SBP;
@@ -539,7 +539,7 @@
 	else
 		rc = ENOTSUP;
-	
+
 	E1000_REG_WRITE(e1000, E1000_RCTL, rctl);
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 	return rc;
@@ -563,16 +563,16 @@
 	uint8_t *mac4 = (uint8_t *) address->address + 4;
 	uint8_t *mac5 = (uint8_t *) address->address + 5;
-	
+
 	uint32_t rah;
 	uint32_t ral;
-	
+
 	ral = ((*mac3) << 24) | ((*mac2) << 16) | ((*mac1) << 8) | (*mac0);
 	rah = ((*mac5) << 8) | ((*mac4));
-	
+
 	if (set_av_bit)
 		rah |= RAH_AV;
 	else
 		rah |= E1000_REG_READ(e1000, E1000_RAH_ARRAY(position)) & RAH_AV;
-	
+
 	E1000_REG_WRITE(e1000, E1000_RAH_ARRAY(position), rah);
 	E1000_REG_WRITE(e1000, E1000_RAL_ARRAY(position), ral);
@@ -605,5 +605,5 @@
 	    ra_num++)
 		e1000_disable_receive_address(e1000, ra_num);
-	
+
 	e1000->unicast_ra_count = 0;
 }
@@ -618,10 +618,10 @@
 	unsigned int first_multicast_ra_num =
 	    E1000_RECEIVE_ADDRESS - e1000->multicast_ra_count;
-	
+
 	for (unsigned int ra_num = E1000_RECEIVE_ADDRESS - 1;
 	    ra_num >= first_multicast_ra_num;
 	    ra_num--)
 		e1000_disable_receive_address(e1000, ra_num);
-	
+
 	e1000->multicast_ra_count = 0;
 }
@@ -662,7 +662,7 @@
 {
 	assert(addr_cnt <= get_free_unicast_address_count(e1000));
-	
+
 	nic_address_t *addr_iterator = (nic_address_t *) addr;
-	
+
 	/* ra_num = 0 is primary address */
 	for (unsigned int ra_num = 1;
@@ -685,7 +685,7 @@
 {
 	assert(addr_cnt <= get_free_multicast_address_count(e1000));
-	
+
 	nic_address_t *addr_iterator = (nic_address_t *) addr;
-	
+
 	unsigned int first_multicast_ra_num = E1000_RECEIVE_ADDRESS - addr_cnt;
 	for (unsigned int ra_num = E1000_RECEIVE_ADDRESS - 1;
@@ -832,7 +832,7 @@
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
 	errno_t rc = EOK;
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	switch (mode) {
 	case NIC_MULTICAST_BLOCKED:
@@ -866,5 +866,5 @@
 		break;
 	}
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 	return rc;
@@ -886,7 +886,7 @@
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
 	errno_t rc = EOK;
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	switch (mode) {
 	case NIC_UNICAST_BLOCKED:
@@ -924,5 +924,5 @@
 		break;
 	}
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 	return rc;
@@ -941,7 +941,7 @@
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
 	errno_t rc = EOK;
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	switch (mode) {
 	case NIC_BROADCAST_BLOCKED:
@@ -955,5 +955,5 @@
 		break;
 	}
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 	return rc;
@@ -971,5 +971,5 @@
 	if (E1000_REG_READ(e1000, E1000_RCTL) & (RCTL_EN))
 		return true;
-	
+
 	return false;
 }
@@ -1009,7 +1009,7 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	if (vlan_mask) {
 		/*
@@ -1020,5 +1020,5 @@
 		if (rx_enabled)
 			e1000_disable_rx(e1000);
-		
+
 		for (unsigned int i = 0; i < NIC_VLAN_BITMAP_SIZE; i += 4) {
 			uint32_t bitmap_part =
@@ -1029,5 +1029,5 @@
 			E1000_REG_WRITE(e1000, E1000_VFTA_ARRAY(i / 4), bitmap_part);
 		}
-		
+
 		e1000_enable_vlan_filter(e1000);
 		if (rx_enabled)
@@ -1035,5 +1035,5 @@
 	} else
 		e1000_disable_vlan_filter(e1000);
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 }
@@ -1054,5 +1054,5 @@
 	if (tag & VLANTAG_CFI)
 		return ENOTSUP;
-	
+
 	/*
 	 * CTRL.VME is neccessary for both strip and add
@@ -1061,12 +1061,12 @@
 	if (!strip && add)
 		return ENOTSUP;
-	
+
 	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
-	
+
 	e1000->vlan_tag = tag;
 	e1000->vlan_tag_add = add;
-	
+
 	fibril_mutex_lock(&e1000->ctrl_lock);
-	
+
 	uint32_t ctrl = E1000_REG_READ(e1000, E1000_CTRL);
 	if (strip)
@@ -1074,7 +1074,7 @@
 	else
 		ctrl &= ~CTRL_VME;
-	
+
 	E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
 	return EOK;
@@ -1092,8 +1092,8 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	e1000_rx_descriptor_t *rx_descriptor = (e1000_rx_descriptor_t *)
 	    (e1000->rx_ring_virt + offset * sizeof(e1000_rx_descriptor_t));
-	
+
 	rx_descriptor->phys_addr = PTR_TO_U64(e1000->rx_frame_phys[offset]);
 	rx_descriptor->length = 0;
@@ -1114,5 +1114,5 @@
 	e1000_rx_descriptor_t *rx_descriptor = (e1000_rx_descriptor_t *)
 	    (e1000->rx_ring_virt + offset * sizeof(e1000_rx_descriptor_t));
-	
+
 	rx_descriptor->length = 0;
 	rx_descriptor->checksum = 0;
@@ -1131,8 +1131,8 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	e1000_tx_descriptor_t *tx_descriptor = (e1000_tx_descriptor_t *)
 	    (e1000->tx_ring_virt + offset * sizeof(e1000_tx_descriptor_t));
-	
+
 	tx_descriptor->phys_addr = 0;
 	tx_descriptor->length = 0;
@@ -1168,16 +1168,16 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	uint32_t *tail_addr = E1000_REG_ADDR(e1000, E1000_RDT);
 	uint32_t next_tail = e1000_inc_tail(*tail_addr, E1000_RX_FRAME_COUNT);
-	
+
 	e1000_rx_descriptor_t *rx_descriptor = (e1000_rx_descriptor_t *)
 	    (e1000->rx_ring_virt + next_tail * sizeof(e1000_rx_descriptor_t));
-	
+
 	while (rx_descriptor->status & 0x01) {
 		uint32_t frame_size = rx_descriptor->length - E1000_CRC_SIZE;
-		
+
 		nic_frame_t *frame = nic_alloc_frame(nic, frame_size);
 		if (frame != NULL) {
@@ -1187,14 +1187,14 @@
 			ddf_msg(LVL_ERROR, "Memory allocation failed. Frame dropped.");
 		}
-		
+
 		e1000_fill_new_rx_descriptor(nic, next_tail);
-		
+
 		*tail_addr = e1000_inc_tail(*tail_addr, E1000_RX_FRAME_COUNT);
 		next_tail = e1000_inc_tail(*tail_addr, E1000_RX_FRAME_COUNT);
-		
+
 		rx_descriptor = (e1000_rx_descriptor_t *)
 		    (e1000->rx_ring_virt + next_tail * sizeof(e1000_rx_descriptor_t));
 	}
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 }
@@ -1247,5 +1247,5 @@
 	nic_t *nic = NIC_DATA_DEV(dev);
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	e1000_interrupt_handler_impl(nic, icr);
 	e1000_enable_interrupts(e1000);
@@ -1267,15 +1267,15 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	/* Lock the mutex in whole driver while working with global structure */
 	fibril_mutex_lock(&irq_reg_mutex);
-	
+
 	e1000_irq_code.ranges[0].base = (uintptr_t) e1000->reg_base_phys;
 	e1000_irq_code.cmds[0].addr = e1000->reg_base_phys + E1000_ICR;
 	e1000_irq_code.cmds[2].addr = e1000->reg_base_phys + E1000_IMC;
-	
+
 	errno_t rc = register_interrupt_handler(nic_get_ddf_dev(nic), e1000->irq,
 	    e1000_interrupt_handler, &e1000_irq_code, handle);
-	
+
 	fibril_mutex_unlock(&irq_reg_mutex);
 	return rc;
@@ -1290,8 +1290,8 @@
 {
 	assert(nic);
-	
+
 	e1000_t *e1000 = nic_get_specific(nic);
 	assert(e1000);
-	
+
 	uint32_t icr = E1000_REG_READ(e1000, E1000_ICR);
 	e1000_interrupt_handler_impl(nic, icr);
@@ -1323,8 +1323,8 @@
 {
 	assert(nic);
-	
+
 	e1000_t *e1000 = nic_get_specific(nic);
 	assert(e1000);
-	
+
 	switch (mode) {
 	case NIC_POLL_IMMEDIATE:
@@ -1344,5 +1344,5 @@
 		return ENOTSUP;
 	}
-	
+
 	return EOK;
 }
@@ -1357,8 +1357,8 @@
 	E1000_REG_WRITE(e1000, E1000_RDLEN, E1000_RX_FRAME_COUNT * 16);
 	E1000_REG_WRITE(e1000, E1000_RDH, 0);
-	
+
 	/* It is not posible to let HW use all descriptors */
 	E1000_REG_WRITE(e1000, E1000_RDT, E1000_RX_FRAME_COUNT - 1);
-	
+
 	/* Set Broadcast Enable Bit */
 	E1000_REG_WRITE(e1000, E1000_RCTL, RCTL_BAM);
@@ -1377,5 +1377,5 @@
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	e1000->rx_ring_virt = AS_AREA_ANY;
 	errno_t rc = dmamem_map_anonymous(
@@ -1385,10 +1385,10 @@
 	if (rc != EOK)
 		return rc;
-	
+
 	E1000_REG_WRITE(e1000, E1000_RDBAH,
 	    (uint32_t) (PTR_TO_U64(e1000->rx_ring_phys) >> 32));
 	E1000_REG_WRITE(e1000, E1000_RDBAL,
 	    (uint32_t) PTR_TO_U64(e1000->rx_ring_phys));
-	
+
 	e1000->rx_frame_phys = (uintptr_t *)
 	    calloc(E1000_RX_FRAME_COUNT, sizeof(uintptr_t));
@@ -1399,9 +1399,9 @@
 		goto error;
 	}
-	
+
 	for (size_t i = 0; i < E1000_RX_FRAME_COUNT; i++) {
 		uintptr_t frame_phys;
 		void *frame_virt = AS_AREA_ANY;
-		
+
 		rc = dmamem_map_anonymous(E1000_MAX_SEND_FRAME_SIZE,
 		    DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0,
@@ -1409,18 +1409,18 @@
 		if (rc != EOK)
 			goto error;
-		
+
 		e1000->rx_frame_phys[i] = frame_phys;
 		e1000->rx_frame_virt[i] = frame_virt;
 	}
-	
+
 	/* Write descriptor */
 	for (size_t i = 0; i < E1000_RX_FRAME_COUNT; i++)
 		e1000_fill_new_rx_descriptor(nic, i);
-	
+
 	e1000_initialize_rx_registers(e1000);
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 	return EOK;
-	
+
 error:
 	for (size_t i = 0; i < E1000_RX_FRAME_COUNT; i++) {
@@ -1431,15 +1431,15 @@
 		}
 	}
-	
+
 	if (e1000->rx_frame_phys != NULL) {
 		free(e1000->rx_frame_phys);
 		e1000->rx_frame_phys = NULL;
 	}
-	
+
 	if (e1000->rx_frame_virt != NULL) {
 		free(e1000->rx_frame_virt);
 		e1000->rx_frame_virt = NULL;
 	}
-	
+
 	return rc;
 }
@@ -1453,5 +1453,5 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	/* Write descriptor */
 	for (unsigned int offset = 0; offset < E1000_RX_FRAME_COUNT; offset++) {
@@ -1460,10 +1460,10 @@
 		e1000->rx_frame_virt[offset] = NULL;
 	}
-	
+
 	free(e1000->rx_frame_virt);
-	
+
 	e1000->rx_frame_phys = NULL;
 	e1000->rx_frame_virt = NULL;
-	
+
 	dmamem_unmap_anonymous(e1000->rx_ring_virt);
 }
@@ -1550,10 +1550,10 @@
 	E1000_REG_WRITE(e1000, E1000_TDH, 0);
 	E1000_REG_WRITE(e1000, E1000_TDT, 0);
-	
+
 	E1000_REG_WRITE(e1000, E1000_TIPG,
 	    10 << TIPG_IPGT_SHIFT |
 	    8 << TIPG_IPGR1_SHIFT |
 	    6 << TIPG_IPGR2_SHIFT);
-	
+
 	E1000_REG_WRITE(e1000, E1000_TCTL,
 	    0x0F << TCTL_CT_SHIFT /* Collision Threshold */ |
@@ -1570,13 +1570,13 @@
 {
 	size_t i;
-	
+
 	fibril_mutex_lock(&e1000->tx_lock);
-	
+
 	e1000->tx_ring_phys = 0;
 	e1000->tx_ring_virt = AS_AREA_ANY;
-	
+
 	e1000->tx_frame_phys = NULL;
 	e1000->tx_frame_virt = NULL;
-	
+
 	errno_t rc = dmamem_map_anonymous(
 	    E1000_TX_FRAME_COUNT * sizeof(e1000_tx_descriptor_t),
@@ -1585,8 +1585,8 @@
 	if (rc != EOK)
 		goto error;
-	
+
 	memset(e1000->tx_ring_virt, 0,
 	    E1000_TX_FRAME_COUNT * sizeof(e1000_tx_descriptor_t));
-	
+
 	e1000->tx_frame_phys = (uintptr_t *)
 	    calloc(E1000_TX_FRAME_COUNT, sizeof(uintptr_t));
@@ -1598,5 +1598,5 @@
 		goto error;
 	}
-	
+
 	for (i = 0; i < E1000_TX_FRAME_COUNT; i++) {
 		e1000->tx_frame_virt[i] = AS_AREA_ANY;
@@ -1607,15 +1607,15 @@
 			goto error;
 	}
-	
+
 	E1000_REG_WRITE(e1000, E1000_TDBAH,
 	    (uint32_t) (PTR_TO_U64(e1000->tx_ring_phys) >> 32));
 	E1000_REG_WRITE(e1000, E1000_TDBAL,
 	    (uint32_t) PTR_TO_U64(e1000->tx_ring_phys));
-	
+
 	e1000_initialize_tx_registers(e1000);
-	
+
 	fibril_mutex_unlock(&e1000->tx_lock);
 	return EOK;
-	
+
 error:
 	if (e1000->tx_ring_virt != NULL) {
@@ -1623,5 +1623,5 @@
 		e1000->tx_ring_virt = NULL;
 	}
-	
+
 	if ((e1000->tx_frame_phys != NULL) && (e1000->tx_frame_virt != NULL)) {
 		for (i = 0; i < E1000_TX_FRAME_COUNT; i++) {
@@ -1633,15 +1633,15 @@
 		}
 	}
-	
+
 	if (e1000->tx_frame_phys != NULL) {
 		free(e1000->tx_frame_phys);
 		e1000->tx_frame_phys = NULL;
 	}
-	
+
 	if (e1000->tx_frame_virt != NULL) {
 		free(e1000->tx_frame_virt);
 		e1000->tx_frame_virt = NULL;
 	}
-	
+
 	return rc;
 }
@@ -1655,5 +1655,5 @@
 {
 	size_t i;
-	
+
 	for (i = 0; i < E1000_TX_FRAME_COUNT; i++) {
 		dmamem_unmap_anonymous(e1000->tx_frame_virt[i]);
@@ -1661,15 +1661,15 @@
 		e1000->tx_frame_virt[i] = NULL;
 	}
-	
+
 	if (e1000->tx_frame_phys != NULL) {
 		free(e1000->tx_frame_phys);
 		e1000->tx_frame_phys = NULL;
 	}
-	
+
 	if (e1000->tx_frame_virt != NULL) {
 		free(e1000->tx_frame_virt);
 		e1000->tx_frame_virt = NULL;
 	}
-	
+
 	dmamem_unmap_anonymous(e1000->tx_ring_virt);
 }
@@ -1721,14 +1721,14 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	E1000_REG_WRITE(e1000, E1000_CTRL, CTRL_RST);
-	
+
 	/* Wait for the reset */
 	async_usleep(20);
-	
+
 	/* check if RST_BIT cleared */
 	if (E1000_REG_READ(e1000, E1000_CTRL) & (CTRL_RST))
 		return EINVAL;
-	
+
 	e1000_initialize_registers(e1000);
 	e1000_initialize_rx_registers(e1000);
@@ -1737,5 +1737,5 @@
 	e1000_initialize_filters(e1000);
 	e1000_initialize_vlan(e1000);
-	
+
 	return EOK;
 }
@@ -1752,13 +1752,13 @@
 {
 	assert(nic);
-	
+
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
 	fibril_mutex_lock(&e1000->tx_lock);
 	fibril_mutex_lock(&e1000->ctrl_lock);
-	
+
 	e1000_enable_interrupts(e1000);
-	
+
 	errno_t rc = hw_res_enable_interrupt(e1000->parent_sess, e1000->irq);
 	if (rc != EOK) {
@@ -1769,19 +1769,19 @@
 		return rc;
 	}
-	
+
 	e1000_clear_rx_ring(e1000);
 	e1000_enable_rx(e1000);
-	
+
 	e1000_clear_tx_ring(nic);
 	e1000_enable_tx(e1000);
-	
+
 	uint32_t ctrl = E1000_REG_READ(e1000, E1000_CTRL);
 	ctrl |= CTRL_SLU;
 	E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
 	fibril_mutex_unlock(&e1000->tx_lock);
 	fibril_mutex_unlock(&e1000->rx_lock);
-	
+
 	return EOK;
 }
@@ -1798,15 +1798,15 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	uint32_t ctrl = E1000_REG_READ(e1000, E1000_CTRL);
 	ctrl &= ~CTRL_SLU;
 	E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
-	
+
 	e1000_disable_tx(e1000);
 	e1000_disable_rx(e1000);
-	
+
 	hw_res_disable_interrupt(e1000->parent_sess, e1000->irq);
 	e1000_disable_interrupts(e1000);
-	
+
 	/*
 	 * Wait for the for the end of all data
@@ -1814,5 +1814,5 @@
 	 */
 	async_usleep(100);
-	
+
 	return EOK;
 }
@@ -1829,15 +1829,15 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
 	fibril_mutex_lock(&e1000->tx_lock);
 	fibril_mutex_lock(&e1000->ctrl_lock);
-	
+
 	errno_t rc = e1000_on_down_unlocked(nic);
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
 	fibril_mutex_unlock(&e1000->tx_lock);
 	fibril_mutex_unlock(&e1000->rx_lock);
-	
+
 	return rc;
 }
@@ -1854,17 +1854,17 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
 	fibril_mutex_lock(&e1000->tx_lock);
 	fibril_mutex_lock(&e1000->ctrl_lock);
-	
+
 	errno_t rc = e1000_on_down_unlocked(nic);
 	if (rc == EOK)
 		rc = e1000_reset(nic);
-	
+
 	fibril_mutex_unlock(&e1000->ctrl_lock);
 	fibril_mutex_unlock(&e1000->tx_lock);
 	fibril_mutex_unlock(&e1000->rx_lock);
-	
+
 	return rc;
 }
@@ -1880,5 +1880,5 @@
 	if (!nic)
 		return NULL;
-	
+
 	e1000_t *e1000 = malloc(sizeof(e1000_t));
 	if (!e1000) {
@@ -1886,8 +1886,8 @@
 		return NULL;
 	}
-	
+
 	memset(e1000, 0, sizeof(e1000_t));
 	e1000->dev = dev;
-	
+
 	nic_set_specific(nic, e1000);
 	nic_set_send_frame_handler(nic, e1000_send_frame);
@@ -1898,10 +1898,10 @@
 	    e1000_on_broadcast_mode_change, NULL, e1000_on_vlan_mask_change);
 	nic_set_poll_handlers(nic, e1000_poll_mode_change, e1000_poll);
-	
+
 	fibril_mutex_initialize(&e1000->ctrl_lock);
 	fibril_mutex_initialize(&e1000->rx_lock);
 	fibril_mutex_initialize(&e1000->tx_lock);
 	fibril_mutex_initialize(&e1000->eeprom_lock);
-	
+
 	return e1000;
 }
@@ -1915,5 +1915,5 @@
 {
 	assert(dev);
-	
+
 	if (ddf_dev_data_get(dev) != NULL)
 		nic_unbind_and_destroy(dev);
@@ -1928,5 +1928,5 @@
 {
 	assert(dev);
-	
+
 	e1000_delete_dev_data(dev);
 }
@@ -1947,12 +1947,12 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
-	
+
 	if (hw_resources->irqs.count != 1)
 		return EINVAL;
-	
+
 	e1000->irq = hw_resources->irqs.irqs[0];
 	e1000->reg_base_phys =
 	    MEMADDR_TO_PTR(RNGABS(hw_resources->mem_ranges.ranges[0]));
-	
+
 	return EOK;
 }
@@ -1972,17 +1972,17 @@
 	assert(dev != NULL);
 	assert(NIC_DATA_DEV(dev) != NULL);
-	
+
 	hw_res_list_parsed_t hw_res_parsed;
 	hw_res_list_parsed_init(&hw_res_parsed);
-	
+
 	/* Get hw resources form parent driver */
 	errno_t rc = nic_get_resources(NIC_DATA_DEV(dev), &hw_res_parsed);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Fill resources information to the device */
 	rc = e1000_fill_resource_info(dev, &hw_res_parsed);
 	hw_res_list_parsed_clean(&hw_res_parsed);
-	
+
 	return rc;
 }
@@ -2004,5 +2004,5 @@
 		return ENOMEM;
 	}
-	
+
 	e1000->parent_sess = ddf_dev_parent_sess_get(dev);
 	if (e1000->parent_sess == NULL) {
@@ -2010,5 +2010,5 @@
 		return EIO;
 	}
-	
+
 	/* Obtain and fill hardware resources info */
 	errno_t rc = e1000_get_resource_info(dev);
@@ -2018,5 +2018,5 @@
 		return rc;
 	}
-	
+
 	uint16_t device_id;
 	rc = pci_config_space_read_16(ddf_dev_parent_sess_get(dev), PCI_DEVICE_ID,
@@ -2027,5 +2027,5 @@
 		return rc;
 	}
-	
+
 	e1000_board_t board;
 	switch (device_id) {
@@ -2077,5 +2077,5 @@
 		return ENOTSUP;
 	}
-	
+
 	switch (board) {
 	case E1000_82540:
@@ -2098,5 +2098,5 @@
 		break;
 	}
-	
+
 	return EOK;
 }
@@ -2113,10 +2113,10 @@
 {
 	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
-	
+
 	errno_t rc = pio_enable(e1000->reg_base_phys, 8 * PAGE_SIZE,
 	    &e1000->reg_base_virt);
 	if (rc != EOK)
 		return EADDRNOTAVAIL;
-	
+
 	return EOK;
 }
@@ -2130,33 +2130,33 @@
 {
 	ddf_fun_t *fun;
-	
+
 	/* Initialize device structure for E1000 */
 	errno_t rc = e1000_device_initialize(dev);
 	if (rc != EOK)
 		return rc;
-	
+
 	/* Device initialization */
 	nic_t *nic = ddf_dev_data_get(dev);
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	/* Map registers */
 	rc = e1000_pio_enable(dev);
 	if (rc != EOK)
 		goto err_destroy;
-	
+
 	e1000_initialize_registers(e1000);
 	rc = e1000_initialize_tx_structure(e1000);
 	if (rc != EOK)
 		goto err_pio;
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	e1000_fill_mac_from_eeprom(e1000);
 	e1000_initialize_filters(e1000);
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
-	
+
 	e1000_initialize_vlan(e1000);
-	
+
 	fun = ddf_fun_create(nic_get_ddf_dev(nic), fun_exposed, "port0");
 	if (fun == NULL)
@@ -2164,5 +2164,5 @@
 	nic_set_ddf_fun(nic, fun);
 	ddf_fun_set_ops(fun, &e1000_dev_ops);
-	
+
 	int irq_cap;
 	rc = e1000_register_int_handler(nic, &irq_cap);
@@ -2170,9 +2170,9 @@
 		goto err_fun_create;
 	}
-	
+
 	rc = e1000_initialize_rx_structure(nic);
 	if (rc != EOK)
 		goto err_irq;
-	
+
 	nic_address_t e1000_address;
 	e1000_get_address(e1000, &e1000_address);
@@ -2180,5 +2180,5 @@
 	if (rc != EOK)
 		goto err_rx_structure;
-	
+
 	struct timeval period;
 	period.tv_sec = 0;
@@ -2187,15 +2187,15 @@
 	if (rc != EOK)
 		goto err_rx_structure;
-	
+
 	rc = ddf_fun_bind(fun);
 	if (rc != EOK)
 		goto err_fun_bind;
-	
+
 	rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
 	if (rc != EOK)
 		goto err_add_to_cat;
-	
+
 	return EOK;
-	
+
 err_add_to_cat:
 	ddf_fun_unbind(fun);
@@ -2230,5 +2230,5 @@
 {
 	fibril_mutex_lock(&e1000->eeprom_lock);
-	
+
 	/* Write address and START bit to EERD register */
 	uint32_t write_data = e1000->info.eerd_start |
@@ -2236,5 +2236,5 @@
 	    e1000->info.eerd_address_offset);
 	E1000_REG_WRITE(e1000, E1000_EERD, write_data);
-	
+
 	uint32_t eerd = E1000_REG_READ(e1000, E1000_EERD);
 	while ((eerd & e1000->info.eerd_done) == 0) {
@@ -2242,7 +2242,7 @@
 		eerd = E1000_REG_READ(e1000, E1000_EERD);
 	}
-	
+
 	fibril_mutex_unlock(&e1000->eeprom_lock);
-	
+
 	return (uint16_t) (eerd >> e1000->info.eerd_data_offset);
 }
@@ -2261,5 +2261,5 @@
 {
 	fibril_mutex_lock(&e1000->rx_lock);
-	
+
 	uint8_t *mac0_dest = (uint8_t *) address->address;
 	uint8_t *mac1_dest = (uint8_t *) address->address + 1;
@@ -2268,8 +2268,8 @@
 	uint8_t *mac4_dest = (uint8_t *) address->address + 4;
 	uint8_t *mac5_dest = (uint8_t *) address->address + 5;
-	
+
 	uint32_t rah = E1000_REG_READ(e1000, E1000_RAH_ARRAY(0));
 	uint32_t ral = E1000_REG_READ(e1000, E1000_RAL_ARRAY(0));
-	
+
 	*mac0_dest = (uint8_t) ral;
 	*mac1_dest = (uint8_t) (ral >> 8);
@@ -2278,5 +2278,5 @@
 	*mac4_dest = (uint8_t) rah;
 	*mac5_dest = (uint8_t) (rah >> 8);
-	
+
 	fibril_mutex_unlock(&e1000->rx_lock);
 	return EOK;
@@ -2295,15 +2295,15 @@
 	nic_t *nic = NIC_DATA_FUN(fun);
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
-	
+
 	fibril_mutex_lock(&e1000->rx_lock);
 	fibril_mutex_lock(&e1000->tx_lock);
-	
+
 	errno_t rc = nic_report_address(nic, addr);
 	if (rc == EOK)
 		e1000_write_receive_address(e1000, 0, addr, false);
-	
+
 	fibril_mutex_unlock(&e1000->tx_lock);
 	fibril_mutex_unlock(&e1000->rx_lock);
-	
+
 	return rc;
 }
@@ -2315,5 +2315,5 @@
 	uint16_t *mac2_dest = (uint16_t *) (address->address + 2);
 	uint16_t *mac4_dest = (uint16_t *) (address->address + 4);
-	
+
 	*mac0_dest = e1000_eeprom_read(e1000, 0);
 	*mac2_dest = e1000_eeprom_read(e1000, 1);
@@ -2334,22 +2334,22 @@
 {
 	assert(nic);
-	
+
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
 	fibril_mutex_lock(&e1000->tx_lock);
-	
+
 	uint32_t tdt = E1000_REG_READ(e1000, E1000_TDT);
 	e1000_tx_descriptor_t *tx_descriptor_addr = (e1000_tx_descriptor_t *)
 	    (e1000->tx_ring_virt + tdt * sizeof(e1000_tx_descriptor_t));
-	
+
 	bool descriptor_available = false;
-	
+
 	/* Descriptor never used */
 	if (tx_descriptor_addr->length == 0)
 		descriptor_available = true;
-	
+
 	/* Descriptor done */
 	if (tx_descriptor_addr->status & TXDESCRIPTOR_STATUS_DD)
 		descriptor_available = true;
-	
+
 	if (!descriptor_available) {
 		/* Frame lost */
@@ -2357,10 +2357,10 @@
 		return;
 	}
-	
+
 	memcpy(e1000->tx_frame_virt[tdt], data, size);
-	
+
 	tx_descriptor_addr->phys_addr = PTR_TO_U64(e1000->tx_frame_phys[tdt]);
 	tx_descriptor_addr->length = size;
-	
+
 	/*
 	 * Report status to STATUS.DD (descriptor done),
@@ -2370,5 +2370,5 @@
 	    TXDESCRIPTOR_COMMAND_IFCS |
 	    TXDESCRIPTOR_COMMAND_EOP;
-	
+
 	tx_descriptor_addr->checksum_offset = 0;
 	tx_descriptor_addr->status = 0;
@@ -2378,13 +2378,13 @@
 	} else
 		tx_descriptor_addr->special = 0;
-	
+
 	tx_descriptor_addr->checksum_start_field = 0;
-	
+
 	tdt++;
 	if (tdt == E1000_TX_FRAME_COUNT)
 		tdt = 0;
-	
+
 	E1000_REG_WRITE(e1000, E1000_TDT, tdt);
-	
+
 	fibril_mutex_unlock(&e1000->tx_lock);
 }
@@ -2393,11 +2393,11 @@
 {
 	printf("%s: HelenOS E1000 network adapter driver\n", NAME);
-	
+
 	if (nic_driver_init(NAME) != EOK)
 		return 1;
-	
+
 	nic_driver_implement(&e1000_driver_ops, &e1000_dev_ops,
 	    &e1000_nic_iface);
-	
+
 	ddf_log_init(NAME);
 	return ddf_driver_main(&e1000_driver);
Index: uspace/drv/nic/e1k/e1k.h
===================================================================
--- uspace/drv/nic/e1k/e1k.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/e1k/e1k.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -97,5 +97,5 @@
 	uint32_t eerd_start;
 	uint32_t eerd_done;
-	
+
 	uint32_t eerd_address_offset;
 	uint32_t eerd_data_offset;
@@ -159,5 +159,5 @@
 	CTRL_SLU = (1 << 6),   /**< Set Link Up */
 	CTRL_ILOS = (1 << 7),  /**< Invert Loss-of-Signal */
-	
+
 	/** Speed selection shift */
 	CTRL_SPEED_SHIFT = 8,
@@ -174,5 +174,5 @@
 	/** Speed selection 10 Mb/s value */
 	CTRL_SPEED_1000 = 2,
-	
+
 	CTRL_FRCSPD = (1 << 11),   /**< Force Speed */
 	CTRL_FRCDPLX = (1 << 12),  /**< Force Duplex */
@@ -186,5 +186,5 @@
 	STATUS_FD = (1 << 0),  /**< Link Full Duplex configuration Indication */
 	STATUS_LU = (1 << 1),  /**< Link Up Indication */
-	
+
 	/** Link speed setting shift */
 	STATUS_SPEED_SHIFT = 6,
Index: uspace/drv/nic/ne2k/dp8390.c
===================================================================
--- uspace/drv/nic/ne2k/dp8390.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ne2k/dp8390.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -74,11 +74,11 @@
 	/** Copy of RSR */
 	uint8_t status;
-	
+
 	/** Pointer to next frame */
 	uint8_t next;
-	
+
 	/** Receive Byte Count Low */
 	uint8_t rbcl;
-	
+
 	/** Receive Byte Count High */
 	uint8_t rbch;
@@ -95,5 +95,5 @@
 {
 	size_t i;
-	
+
 	for (i = 0; (i << 1) < size; i++)
 		*((uint16_t *) buf + i) = pio_read_16((ioport16_t *) (port));
@@ -110,5 +110,5 @@
 {
 	size_t i;
-	
+
 	for (i = 0; (i << 1) < size; i++)
 		pio_write_16((ioport16_t *) port, *((uint16_t *) buf + i));
@@ -118,5 +118,5 @@
 {
 	size_t esize = size & ~1;
-	
+
 	pio_write_8(ne2k->port + DP_RBCR0, esize & 0xff);
 	pio_write_8(ne2k->port + DP_RBCR1, (esize >> 8) & 0xff);
@@ -124,5 +124,5 @@
 	pio_write_8(ne2k->port + DP_RSAR1, (addr >> 8) & 0xff);
 	pio_write_8(ne2k->port + DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
-	
+
 	if (esize != 0) {
 		pio_read_buf_16(ne2k->data_port, buf, esize);
@@ -130,8 +130,8 @@
 		buf += esize;
 	}
-	
+
 	if (size) {
 		assert(size == 1);
-		
+
 		uint16_t word = pio_read_16(ne2k->data_port);
 		memcpy(buf, &word, 1);
@@ -143,5 +143,5 @@
 	size_t esize_ru = (size + 1) & ~1;
 	size_t esize = size & ~1;
-	
+
 	pio_write_8(ne2k->port + DP_RBCR0, esize_ru & 0xff);
 	pio_write_8(ne2k->port + DP_RBCR1, (esize_ru >> 8) & 0xff);
@@ -149,5 +149,5 @@
 	pio_write_8(ne2k->port + DP_RSAR1, (addr >> 8) & 0xff);
 	pio_write_8(ne2k->port + DP_CR, CR_DM_RW | CR_PS_P0 | CR_STA);
-	
+
 	if (esize != 0) {
 		pio_write_buf_16(ne2k->data_port, buf, esize);
@@ -155,10 +155,10 @@
 		buf += esize;
 	}
-	
+
 	if (size) {
 		assert(size == 1);
-		
+
 		uint16_t word = 0;
-		
+
 		memcpy(&word, buf, 1);
 		pio_write_16(ne2k->data_port, word);
@@ -169,5 +169,5 @@
 {
 	unsigned int i;
-	
+
 	/* Reset the ethernet card */
 	uint8_t val = pio_read_8(ne2k->port + NE2K_RESET);
@@ -175,5 +175,5 @@
 	pio_write_8(ne2k->port + NE2K_RESET, val);
 	async_usleep(2000);
-	
+
 	/* Reset the DP8390 */
 	pio_write_8(ne2k->port + DP_CR, CR_STP | CR_DM_ABORT);
@@ -197,17 +197,17 @@
 {
 	unsigned int i;
-	
+
 	ne2k_init(ne2k);
-	
+
 	/* Check if the DP8390 is really there */
 	uint8_t val = pio_read_8(ne2k->port + DP_CR);
 	if ((val & (CR_STP | CR_TXP | CR_DM_ABORT)) != (CR_STP | CR_DM_ABORT))
 		return EXDEV;
-	
+
 	/* Disable the receiver and init TCR and DCR */
 	pio_write_8(ne2k->port + DP_RCR, RCR_MON);
 	pio_write_8(ne2k->port + DP_TCR, TCR_NORMAL);
 	pio_write_8(ne2k->port + DP_DCR, DCR_WORDWIDE | DCR_8BYTES | DCR_BMS);
-	
+
 	/* Setup a transfer to get the MAC address */
 	pio_write_8(ne2k->port + DP_RBCR0, ETH_ADDR << 1);
@@ -216,8 +216,8 @@
 	pio_write_8(ne2k->port + DP_RSAR1, 0);
 	pio_write_8(ne2k->port + DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
-	
+
 	for (i = 0; i < ETH_ADDR; i++)
 		ne2k->mac.address[i] = pio_read_16(ne2k->data_port);
-	
+
 	return EOK;
 }
@@ -226,7 +226,7 @@
 {
 	memcpy(&ne2k->mac, address, sizeof(nic_address_t));
-	
+
 	pio_write_8(ne2k->port + DP_CR, CR_PS_P0 | CR_DM_ABORT | CR_STP);
-	
+
 	pio_write_8(ne2k->port + DP_RBCR0, ETH_ADDR << 1);
 	pio_write_8(ne2k->port + DP_RBCR1, 0);
@@ -254,7 +254,7 @@
 	if (!ne2k->probed)
 		return EXDEV;
-	
+
 	ne2k_init(ne2k);
-	
+
 	/*
 	 * Setup send queue. Use the first
@@ -266,5 +266,5 @@
 	fibril_mutex_initialize(&ne2k->sq_mutex);
 	fibril_condvar_initialize(&ne2k->sq_cv);
-	
+
 	/*
 	 * Setup receive ring buffer. Use all the rest
@@ -275,5 +275,5 @@
 	ne2k->start_page = ne2k->sq.page + SQ_PAGES;
 	ne2k->stop_page = ne2k->sq.page + NE2K_SIZE / DP_PAGE;
-	
+
 	/*
 	 * Initialization of the DP8390 following the mandatory procedure
@@ -281,36 +281,36 @@
 	 * Controller", National Semiconductor, July 1995, Page 29).
 	 */
-	
+
 	/* Step 1: */
 	pio_write_8(ne2k->port + DP_CR, CR_PS_P0 | CR_STP | CR_DM_ABORT);
-	
+
 	/* Step 2: */
 	pio_write_8(ne2k->port + DP_DCR, DCR_WORDWIDE | DCR_8BYTES | DCR_BMS);
-	
+
 	/* Step 3: */
 	pio_write_8(ne2k->port + DP_RBCR0, 0);
 	pio_write_8(ne2k->port + DP_RBCR1, 0);
-	
+
 	/* Step 4: */
 	pio_write_8(ne2k->port + DP_RCR, ne2k->receive_configuration);
-	
+
 	/* Step 5: */
 	pio_write_8(ne2k->port + DP_TCR, TCR_INTERNAL);
-	
+
 	/* Step 6: */
 	pio_write_8(ne2k->port + DP_BNRY, ne2k->start_page);
 	pio_write_8(ne2k->port + DP_PSTART, ne2k->start_page);
 	pio_write_8(ne2k->port + DP_PSTOP, ne2k->stop_page);
-	
+
 	/* Step 7: */
 	pio_write_8(ne2k->port + DP_ISR, 0xff);
-	
+
 	/* Step 8: */
 	pio_write_8(ne2k->port + DP_IMR,
 	    IMR_PRXE | IMR_PTXE | IMR_RXEE | IMR_TXEE | IMR_OVWE | IMR_CNTE);
-	
+
 	/* Step 9: */
 	pio_write_8(ne2k->port + DP_CR, CR_PS_P1 | CR_DM_ABORT | CR_STP);
-	
+
 	pio_write_8(ne2k->port + DP_PAR0, ne2k->mac.address[0]);
 	pio_write_8(ne2k->port + DP_PAR1, ne2k->mac.address[1]);
@@ -319,5 +319,5 @@
 	pio_write_8(ne2k->port + DP_PAR4, ne2k->mac.address[4]);
 	pio_write_8(ne2k->port + DP_PAR5, ne2k->mac.address[5]);
-	
+
 	pio_write_8(ne2k->port + DP_MAR0, 0);
 	pio_write_8(ne2k->port + DP_MAR1, 0);
@@ -328,18 +328,18 @@
 	pio_write_8(ne2k->port + DP_MAR6, 0);
 	pio_write_8(ne2k->port + DP_MAR7, 0);
-	
+
 	pio_write_8(ne2k->port + DP_CURR, ne2k->start_page + 1);
-	
+
 	/* Step 10: */
 	pio_write_8(ne2k->port + DP_CR, CR_PS_P0 | CR_DM_ABORT | CR_STA);
-	
+
 	/* Step 11: */
 	pio_write_8(ne2k->port + DP_TCR, TCR_NORMAL);
-	
+
 	/* Reset counters by reading */
 	pio_read_8(ne2k->port + DP_CNTR0);
 	pio_read_8(ne2k->port + DP_CNTR1);
 	pio_read_8(ne2k->port + DP_CNTR2);
-	
+
 	/* Finish the initialization */
 	ne2k->up = true;
@@ -415,9 +415,9 @@
 
 	fibril_mutex_lock(&ne2k->sq_mutex);
-	
+
 	while (ne2k->sq.dirty) {
 		fibril_condvar_wait(&ne2k->sq_cv, &ne2k->sq_mutex);
 	}
-	
+
 	if ((size < ETH_MIN_PACK_SIZE) || (size > ETH_MAX_PACK_SIZE_TAGGED)) {
 		fibril_mutex_unlock(&ne2k->sq_mutex);
@@ -446,8 +446,8 @@
 	if (frame == NULL)
 		return NULL;
-	
+
 	memset(frame->data, 0, length);
 	uint8_t last = page + length / DP_PAGE;
-	
+
 	if (last >= ne2k->stop_page) {
 		size_t left = (ne2k->stop_page - page) * DP_PAGE
@@ -481,8 +481,8 @@
 		//TODO: isn't some locking necessary here?
 		uint8_t boundary = pio_read_8(ne2k->port + DP_BNRY) + 1;
-		
+
 		if (boundary == ne2k->stop_page)
 			boundary = ne2k->start_page;
-		
+
 		pio_write_8(ne2k->port + DP_CR, CR_PS_P1 | CR_STA);
 		uint8_t current = pio_read_8(ne2k->port + DP_CURR);
@@ -491,9 +491,9 @@
 			/* No more frames to process */
 			break;
-		
+
 		recv_header_t header;
 		size_t size = sizeof(header);
 		size_t offset = boundary * DP_PAGE;
-		
+
 		/* Get the frame header */
 		pio_write_8(ne2k->port + DP_RBCR0, size & 0xff);
@@ -502,5 +502,5 @@
 		pio_write_8(ne2k->port + DP_RSAR1, (offset >> 8) & 0xff);
 		pio_write_8(ne2k->port + DP_CR, CR_DM_RR | CR_PS_P0 | CR_STA);
-		
+
 		pio_read_buf_16(ne2k->data_port, (void *) &header, size);
 
@@ -508,5 +508,5 @@
 		    (((size_t) header.rbcl) | (((size_t) header.rbch) << 8)) - size;
 		uint8_t next = header.next;
-		
+
 		if ((length < ETH_MIN_PACK_SIZE)
 		    || (length > ETH_MAX_PACK_SIZE_TAGGED)) {
@@ -535,5 +535,5 @@
 				break;
 		}
-		
+
 		/*
 		 * Update the boundary pointer
@@ -585,5 +585,5 @@
 			ne2k->sq.dirty = false;
 			ne2k->sq.size = 0;
-			
+
 			/* Signal a next frame to be sent */
 			fibril_condvar_broadcast(&ne2k->sq_cv);
@@ -615,5 +615,5 @@
 		ne2k_reset(ne2k);
 	}
-	
+
 	/* Unmask interrupts to be processed in the next round */
 	pio_write_8(ne2k->port + DP_IMR,
@@ -627,5 +627,5 @@
 	else
 		ne2k->receive_configuration &= ~RCR_AB;
-	
+
 	pio_write_8(ne2k->port + DP_RCR, ne2k->receive_configuration);
 }
@@ -637,5 +637,5 @@
 	else
 		ne2k->receive_configuration &= ~RCR_AM;
-	
+
 	pio_write_8(ne2k->port + DP_RCR, ne2k->receive_configuration);
 }
@@ -647,5 +647,5 @@
 	else
 		ne2k->receive_configuration &= ~RCR_PRO;
-	
+
 	pio_write_8(ne2k->port + DP_RCR, ne2k->receive_configuration);
 }
@@ -655,5 +655,5 @@
 	/* Select Page 1 and stop all transfers */
 	pio_write_8(ne2k->port + DP_CR, CR_PS_P1 | CR_DM_ABORT | CR_STP);
-	
+
 	pio_write_8(ne2k->port + DP_MAR0, (uint8_t) hash);
 	pio_write_8(ne2k->port + DP_MAR1, (uint8_t) (hash >> 8));
@@ -664,5 +664,5 @@
 	pio_write_8(ne2k->port + DP_MAR6, (uint8_t) (hash >> 48));
 	pio_write_8(ne2k->port + DP_MAR7, (uint8_t) (hash >> 56));
-	
+
 	/* Select Page 0 and resume transfers */
 	pio_write_8(ne2k->port + DP_CR, CR_PS_P0 | CR_DM_ABORT | CR_STA);
Index: uspace/drv/nic/ne2k/dp8390.h
===================================================================
--- uspace/drv/nic/ne2k/dp8390.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ne2k/dp8390.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -235,8 +235,8 @@
 	int irq;
 	nic_address_t mac;
-	
+
 	uint8_t start_page;  /**< Ring buffer start page */
 	uint8_t stop_page;   /**< Ring buffer stop page */
-	
+
 	/* Send queue */
 	struct {
@@ -247,5 +247,5 @@
 	fibril_mutex_t sq_mutex;
 	fibril_condvar_t sq_cv;
-	
+
 	/* Driver run-time variables */
 	bool probed;
Index: uspace/drv/nic/ne2k/ne2k.c
===================================================================
--- uspace/drv/nic/ne2k/ne2k.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/ne2k/ne2k.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -183,53 +183,53 @@
 	hw_res_list_parsed_t hw_res_parsed;
 	hw_res_list_parsed_init(&hw_res_parsed);
-	
+
 	errno_t rc = nic_get_resources(nic_data, &hw_res_parsed);
-	
+
 	if (rc != EOK)
 		goto failed;
-	
+
 	if (hw_res_parsed.irqs.count == 0) {
 		rc = EINVAL;
 		goto failed;
 	}
-	
+
 	if (hw_res_parsed.io_ranges.count == 0) {
 		rc = EINVAL;
 		goto failed;
 	}
-	
+
 	if (hw_res_parsed.io_ranges.ranges[0].size < NE2K_IO_SIZE) {
 		rc = EINVAL;
 		goto failed;
 	}
-	
+
 	ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data);
 	ne2k->irq = hw_res_parsed.irqs.irqs[0];
-	
+
 	addr_range_t regs = hw_res_parsed.io_ranges.ranges[0];
 	ne2k->base_port = RNGABSPTR(regs);
-	
+
 	hw_res_list_parsed_clean(&hw_res_parsed);
-	
+
 	/* Enable programmed I/O */
 	if (pio_enable_range(&regs, &ne2k->port) != EOK)
 		return EADDRNOTAVAIL;
-	
+
 	ne2k->data_port = ne2k->port + NE2K_DATA;
 	ne2k->receive_configuration = RCR_AB | RCR_AM;
 	ne2k->probed = false;
 	ne2k->up = false;
-	
+
 	/* Find out whether the device is present. */
 	if (ne2k_probe(ne2k) != EOK)
 		return ENOENT;
-	
+
 	ne2k->probed = true;
-	
+
 	if (ne2k_register_interrupt(nic_data, NULL) != EOK)
 		return EINVAL;
-	
+
 	return EOK;
-	
+
 failed:
 	hw_res_list_parsed_clean(&hw_res_parsed);
@@ -358,10 +358,10 @@
 {
 	ddf_fun_t *fun;
-	
+
 	/* Allocate driver data for the device. */
 	nic_t *nic_data = nic_create_and_bind(dev);
 	if (nic_data == NULL)
 		return ENOMEM;
-	
+
 	nic_set_send_frame_handler(nic_data, ne2k_send);
 	nic_set_state_change_handlers(nic_data,
@@ -370,5 +370,5 @@
 		ne2k_on_unicast_mode_change, ne2k_on_multicast_mode_change,
 		ne2k_on_broadcast_mode_change, NULL, NULL);
-	
+
 	ne2k_t *ne2k = malloc(sizeof(ne2k_t));
 	if (NULL != ne2k) {
@@ -379,5 +379,5 @@
 		return ENOMEM;
 	}
-	
+
 	ne2k->dev = dev;
 	ne2k->parent_sess = ddf_dev_parent_sess_get(dev);
@@ -386,5 +386,5 @@
 		return ENOMEM;
 	}
-	
+
 	errno_t rc = ne2k_dev_init(nic_data);
 	if (rc != EOK) {
@@ -392,5 +392,5 @@
 		return rc;
 	}
-	
+
 	rc = nic_report_address(nic_data, &ne2k->mac);
 	if (rc != EOK) {
@@ -398,5 +398,5 @@
 		return rc;
 	}
-	
+
 	fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0");
 	if (fun == NULL) {
@@ -404,8 +404,8 @@
 		return ENOMEM;
 	}
-	
+
 	nic_set_ddf_fun(nic_data, fun);
 	ddf_fun_set_ops(fun, &ne2k_dev_ops);
-	
+
 	rc = ddf_fun_bind(fun);
 	if (rc != EOK) {
@@ -414,5 +414,5 @@
 		return rc;
 	}
-	
+
 	rc = ddf_fun_add_to_category(fun, DEVICE_CATEGORY_NIC);
 	if (rc != EOK) {
@@ -421,5 +421,5 @@
 		return rc;
 	}
-	
+
 	return EOK;
 }
@@ -441,8 +441,8 @@
 {
 	printf("%s: HelenOS NE 2000 network adapter driver\n", NAME);
-	
+
 	nic_driver_init(NAME);
 	nic_driver_implement(&ne2k_driver_ops, &ne2k_dev_ops, &ne2k_nic_iface);
-	
+
 	return ddf_driver_main(&ne2k_driver);
 }
Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/rtl8139/driver.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -156,5 +156,5 @@
 	    | rtl8139->rcr_data.defect_mask |
 	    (RXBUF_SIZE_FLAGS << RCR_RBLEN_SHIFT);
-	
+
 	ddf_msg(LVL_DEBUG, "Rewriting rcr: %x -> %x", pio_read_32(rtl8139->io_port + RCR),
 	    rcr);
@@ -419,5 +419,5 @@
 	pio_write_32(tsd, tsd_value);
 	return;
-	
+
 err_busy_no_inc:
 err_size:
@@ -550,5 +550,5 @@
 	bytes_received %= RxBUF_SIZE;
 	rx_offset %= RxBUF_SIZE;
-	
+
 	/* count how many bytes to read maximaly */
 	if (bytes_received < rx_offset)
@@ -775,5 +775,5 @@
 {
 	assert(nic_data);
-	
+
 	nic_poll_mode_t poll_mode = nic_query_poll_mode(nic_data, 0);
 
@@ -1104,5 +1104,5 @@
 
 	ddf_msg(LVL_DEBUG, "Creating buffers");
-	
+
 	rtl8139->tx_buff_virt = AS_AREA_ANY;
 	rc = dmamem_map_anonymous(TX_PAGES * PAGE_SIZE, DMAMEM_4GiB,
@@ -1125,5 +1125,5 @@
 	ddf_msg(LVL_DEBUG, "Allocating receiver buffer of the size %d bytes",
 	    RxBUF_TOT_LENGTH);
-	
+
 	rtl8139->rx_buff_virt = AS_AREA_ANY;
 	rc = dmamem_map_anonymous(RxBUF_TOT_LENGTH, DMAMEM_4GiB,
@@ -1195,5 +1195,5 @@
 	ddf_msg(LVL_DEBUG, "The device is initialized");
 	return ret;
-	
+
 failed:
 	ddf_msg(LVL_ERROR, "The device initialization failed");
@@ -1318,5 +1318,5 @@
 
 	return EOK;
-	
+
 err_fun_bind:
 	ddf_fun_unbind(fun);
@@ -1547,5 +1547,5 @@
 	if (rtl8139_pause_is_valid(rtl8139) != VALUE_RW)
 		return EINVAL;
-	
+
 	uint8_t msr = pio_read_8(rtl8139->io_port + MSR);
 	msr &= ~(uint8_t)(MSR_TXFCE | MSR_RXFCE);
@@ -1555,5 +1555,5 @@
 	if (allow_send)
 		msr |= MSR_TXFCE;
-	
+
 	pio_write_8(rtl8139->io_port + MSR, msr);
 
@@ -1624,5 +1624,5 @@
 	if ((advertisement | RTL8139_AUTONEG_CAPS) != RTL8139_AUTONEG_CAPS)
 		return EINVAL; /* some unsuported mode is requested */
-	
+
 	assert(advertisement != 0);
 
Index: uspace/drv/nic/rtl8139/general.h
===================================================================
--- uspace/drv/nic/rtl8139/general.h	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/rtl8139/general.h	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -45,14 +45,14 @@
 	/** Register value set in the last timer period */
 	uint32_t last_val;
-	
+
 	/** Register value set in the common timer period */
 	uint32_t full_val;
-	
+
 	/** Amount of full register periods in timer period */
 	size_t full_skips;
-	
+
 	/** Remaining full register periods to the next period end */
 	size_t full_skips_remains;
-	
+
 	/** Mark if there is a last run */
 	int last_run;
Index: uspace/drv/nic/rtl8169/driver.c
===================================================================
--- uspace/drv/nic/rtl8169/driver.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/drv/nic/rtl8169/driver.c	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -352,5 +352,5 @@
 	ddf_msg(LVL_DEBUG, "The device is initialized");
 	return ret;
-	
+
 failed:
 	ddf_msg(LVL_ERROR, "The device initialization failed");
@@ -460,5 +460,5 @@
 		goto err_fun_bind;
 	}
-	
+
 	ddf_msg(LVL_NOTE, "The %s device has been successfully initialized.",
 	    ddf_dev_get_name(dev));
@@ -512,11 +512,11 @@
 	if (rtl8169->pci_vid == PCI_VID_REALTEK)
 		str_cpy(info->vendor_name, NIC_VENDOR_MAX_LENGTH, "Realtek");
-	
+
 	if (rtl8169->pci_vid == PCI_VID_DLINK)
 		str_cpy(info->vendor_name, NIC_VENDOR_MAX_LENGTH, "D-Link");
-	
+
 	if (rtl8169->pci_pid == 0x8168)
 		str_cpy(info->model_name, NIC_MODEL_MAX_LENGTH, "RTL8168");
-	
+
 	if (rtl8169->pci_pid == 0x8169)
 		str_cpy(info->model_name, NIC_MODEL_MAX_LENGTH, "RTL8169");
@@ -577,5 +577,5 @@
 	bmcr = rtl8169_mii_read(rtl8169, MII_BMCR);
 	bmcr &= ~(BMCR_DUPLEX | BMCR_SPD_100 | BMCR_SPD_1000);
-	
+
 	/* Disable autonegotiation */
 	bmcr &= ~BMCR_AN_ENABLE;
@@ -918,5 +918,5 @@
 {
 	rtl8169_t *rtl8169 = nic_get_specific(nic_data);
-	
+
 	/* Configure Receive Control Register */
 	uint32_t rcr = pio_read_32(rtl8169->regs + RCR);
@@ -961,5 +961,5 @@
 		write_barrier();
 		ddf_msg(LVL_DEBUG, "TX status for descr %d: 0x%08x", tail, descr->control);
-	
+
 		tail = (tail + 1) % TX_BUFFERS_COUNT;
 		sent++;
@@ -1005,5 +1005,5 @@
 		if (descr->control & CONTROL_FS)
 			fsidx = tail;
-		
+
 		if (descr->control & CONTROL_LS) {
 			ddf_msg(LVL_DEBUG, "received message at slot %d, control 0x%08x", tail, descr->control);
