Index: uspace/drv/bus/usb/ar9271/ar9271.c
===================================================================
--- uspace/drv/bus/usb/ar9271/ar9271.c	(revision 66b3e0b36868909183dfb5c533a019cfef82440d)
+++ uspace/drv/bus/usb/ar9271/ar9271.c	(revision ef521d4091b277b23a8ea026424ce4b01e0677d9)
@@ -267,30 +267,5 @@
 	assert(addr);
 	
-	fibril_mutex_lock(&ar9271->htc_device->rx_lock);
-	
-	uint32_t *mac0_dest = (uint32_t *)(addr->address);
-	uint16_t *mac4_dest = (uint16_t *)(addr->address + 4);
-	
-	void *ar9271_mac_addr = 0;
-
-	/* Read MAC address from the i/o (4byte + 2byte reads) */
-	// TODO: Now just testing register address
-	/*
-	usb_log_info("Trying to get some testing register from device.\n");
-	
-	uint32_t result;
-	int rc = wmi_reg_read(ar9271->usb_device, 
-	    0x50040,
-	    //AR9271_MAC_REG_OFFSET | AR9271_MAC_PCU_STA_ADDR_L32, 
-	    &result);
-	if(rc != EOK) {
-		usb_log_info("Failed to read registry value. Error: %d\n", rc);
-		return rc;
-	}
-	
-	usb_log_info("Registry value: %x\n", result);
-	 */
-	
-	fibril_mutex_unlock(&ar9271->htc_device->rx_lock);
+	// TODO
 }
 
@@ -517,11 +492,5 @@
 	nic_t *nic = nic_get_from_ddf_dev(dev);
 	
-	/*
-	nic_address_t addr;
-	ar9271_hw_get_addr(ar9271, &addr);
-	rc = nic_report_address(nic, &addr);
-	
-	usb_log_info("Reported address.\n");
-	*/
+	/* TODO: Report HW address here. */
 	
 	/* Create AR9271 function.*/
Index: uspace/drv/bus/usb/ar9271/htc.c
===================================================================
--- uspace/drv/bus/usb/ar9271/htc.c	(revision 66b3e0b36868909183dfb5c533a019cfef82440d)
+++ uspace/drv/bus/usb/ar9271/htc.c	(revision ef521d4091b277b23a8ea026424ce4b01e0677d9)
@@ -50,10 +50,5 @@
 static inline uint8_t wmi_service_to_download_pipe(wmi_services_t service_id)
 {
-	switch(service_id) {
-		case WMI_CONTROL_SERVICE:
-			return 3;
-		default:
-			return 2;
-	}
+	return (service_id == WMI_CONTROL_SERVICE) ? 3 : 2;
 }
 
@@ -67,10 +62,5 @@
 static inline uint8_t wmi_service_to_upload_pipe(wmi_services_t service_id)
 {
-	switch(service_id) {
-		case WMI_CONTROL_SERVICE:
-			return 4;
-		default:
-                        return 1;
-	}
+	return (service_id == WMI_CONTROL_SERVICE) ? 4 : 1;
 }
 
@@ -126,5 +116,6 @@
  * @param response_endpoint_no HTC endpoint to be used for this service.
  * 
- * @return EOK if succeed, negative error code otherwise.
+ * @return EOK if succeed, EINVAL when failed to connect service, 
+ * negative error code otherwise.
  */
 static int htc_connect_service(htc_device_t *htc_device, 
@@ -152,4 +143,5 @@
 		htc_device->endpoints.ctrl_endpoint);
 	if(rc != EOK) {
+		free(buffer);
 		usb_log_error("Failed to send HTC message. Error: %d\n", rc);
 		return rc;
@@ -164,4 +156,5 @@
 	rc = htc_read_message(htc_device, buffer, buffer_size, NULL);
 	if(rc != EOK) {
+		free(buffer);
 		usb_log_error("Failed to receive HTC service connect response. "
 			"Error: %d\n", rc);
@@ -176,10 +169,14 @@
 	if(response_message->status == HTC_SERVICE_SUCCESS) {
 		*response_endpoint_no = response_message->endpoint_id;
-		return EOK;
+		rc = EOK;
 	} else {
 		usb_log_error("Failed to connect HTC service. "
 			"Message status: %d\n", response_message->status);
-		return rc;
+		rc = EINVAL;
         }
+	
+	free(buffer);
+	
+	return rc;
 }
 
@@ -193,5 +190,6 @@
 static int htc_config_credits(htc_device_t *htc_device)
 {
-	size_t buffer_size = sizeof(htc_frame_header_t) + 50;
+	size_t buffer_size = sizeof(htc_frame_header_t) + 
+		sizeof(htc_config_msg_t);
 	void *buffer = malloc(buffer_size);
 	htc_config_msg_t *config_message = (htc_config_msg_t *)
@@ -204,7 +202,9 @@
 	config_message->pipe_id = 1;
 
+	/* Send HTC message. */
 	int rc = htc_send_message(htc_device, buffer, buffer_size,
 		htc_device->endpoints.ctrl_endpoint);
 	if(rc != EOK) {
+		free(buffer);
 		usb_log_error("Failed to send HTC config message. "
 			"Error: %d\n", rc);
@@ -222,6 +222,7 @@
 		usb_log_error("Failed to receive HTC config response message. "
 			"Error: %d\n", rc);
-		return rc;
-	}
+	}
+	
+	free(buffer);
 
 	return rc;
@@ -237,5 +238,6 @@
 static int htc_complete_setup(htc_device_t *htc_device)
 {
-	size_t buffer_size = sizeof(htc_frame_header_t) + 50;
+	size_t buffer_size = sizeof(htc_frame_header_t) + 
+		sizeof(htc_setup_complete_msg_t);
 	void *buffer = malloc(buffer_size);
 	htc_setup_complete_msg_t *complete_message = 
@@ -246,4 +248,5 @@
 		host2uint16_t_be(HTC_MESSAGE_SETUP_COMPLETE);
 
+	/* Send HTC message. */
 	int rc = htc_send_message(htc_device, buffer, buffer_size, 
 		htc_device->endpoints.ctrl_endpoint);
@@ -251,6 +254,7 @@
 		usb_log_error("Failed to send HTC setup complete message. "
 			"Error: %d\n", rc);
-		return rc;
-	}
+	}
+	
+	free(buffer);
 
 	return rc;
@@ -263,5 +267,6 @@
  * @param htc_device HTC device structure.
  * 
- * @return EOK if succeed, negative error code otherwise.
+ * @return EOK if succeed, EINVAL if response error, negative error code 
+ * otherwise.
  */
 static int htc_check_ready(htc_device_t *htc_device)
@@ -270,6 +275,8 @@
 	void *buffer = malloc(buffer_size);
 
+	/* Read response from device. */
 	int rc = htc_read_message(htc_device, buffer, buffer_size, NULL);
 	if(rc != EOK) {
+		free(buffer);
 		usb_log_error("Failed to receive HTC check ready message. "
 			"Error: %d\n", rc);
@@ -280,8 +287,12 @@
 		sizeof(htc_frame_header_t));
 	if(uint16_t_be2host(*message_id) == HTC_MESSAGE_READY) {
-		return EOK;
+		rc = EOK;
 	} else {
-		return EINVAL;
-	}
+		rc = EINVAL;
+	}
+	
+	free(buffer);
+	
+	return rc;
 }
 
Index: uspace/drv/bus/usb/ar9271/hw.c
===================================================================
--- uspace/drv/bus/usb/ar9271/hw.c	(revision 66b3e0b36868909183dfb5c533a019cfef82440d)
+++ uspace/drv/bus/usb/ar9271/hw.c	(revision ef521d4091b277b23a8ea026424ce4b01e0677d9)
@@ -128,4 +128,6 @@
 	}
 	
+	/* TODO: Finish HW init. */
+	
 	return EOK;
 }
Index: uspace/drv/bus/usb/ar9271/wmi.c
===================================================================
--- uspace/drv/bus/usb/ar9271/wmi.c	(revision 66b3e0b36868909183dfb5c533a019cfef82440d)
+++ uspace/drv/bus/usb/ar9271/wmi.c	(revision ef521d4091b277b23a8ea026424ce4b01e0677d9)
@@ -163,8 +163,11 @@
 		host2uint16_t_be(++htc_device->sequence_number);
 	
+	/* Send message. */
 	int rc = htc_send_message(htc_device, buffer, buffer_size,
 		htc_device->endpoints.wmi_endpoint);
 	if(rc != EOK) {
+		free(buffer);
 		usb_log_error("Failed to send WMI message. Error: %d\n", rc);
+		return rc;
 	}
 	
@@ -174,4 +177,5 @@
 	buffer = malloc(buffer_size);
 	
+	/* Read response. */
 	rc = htc_read_message(htc_device, buffer, buffer_size, NULL);
 	if(rc != EOK) {
