Index: uspace/drv/bus/usb/ar9271/ar9271.c
===================================================================
--- uspace/drv/bus/usb/ar9271/ar9271.c	(revision 01784d20ebe77098db8f9fe743d50de2c8c9b646)
+++ uspace/drv/bus/usb/ar9271/ar9271.c	(revision 462054abcfa5153f73910e63137ea1db077091da)
@@ -255,19 +255,4 @@
 }
 
-/** Get MAC address of the AR9271 adapter
- *
- *  @param ar9271 The AR9271 device
- *  @param address The place to store the address
- *
- *  @return EOK if succeed, negative error code otherwise
- */
-inline static void ar9271_hw_get_addr(ar9271_t *ar9271, nic_address_t *addr)
-{
-	assert(ar9271);
-	assert(addr);
-	
-	// TODO
-}
-
 /** Force receiving all frames in the receive buffer
  *
@@ -409,4 +394,6 @@
 	
 	memset(ar9271, 0, sizeof(ar9271_t));
+	
+	ar9271->ddf_device = dev;
 	
 	rc = ar9271_init(ar9271, usb_device);
@@ -492,6 +479,4 @@
 	nic_t *nic = nic_get_from_ddf_dev(dev);
 	
-	/* TODO: Report HW address here. */
-	
 	/* Create AR9271 function.*/
 	fun = ddf_fun_create(nic_get_ddf_dev(nic), fun_exposed, "port0");
Index: uspace/drv/bus/usb/ar9271/ar9271.h
===================================================================
--- uspace/drv/bus/usb/ar9271/ar9271.h	(revision 01784d20ebe77098db8f9fe743d50de2c8c9b646)
+++ uspace/drv/bus/usb/ar9271/ar9271.h	(revision 462054abcfa5153f73910e63137ea1db077091da)
@@ -40,9 +40,25 @@
 #include "htc.h"
 
+/** Number of GPIO pin used for handling led light */
+#define AR9271_LED_PIN 15
+
 /** AR9271 Registers */
 typedef enum {
+	/* 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  */
+	AR9271_GPIO_OE_OUT = 0x404C,		/**< GPIO set to output  */
+	AR9271_GPIO_OE_OUT_ALWAYS = 0x3,	/**< GPIO always drive output */
+	AR9271_GPIO_OUT_MUX1 = 0x4060,
+	AR9271_GPIO_OUT_MUX2 = 0x4064,
+	AR9271_GPIO_OUT_MUX3 = 0x4068,
+	AR9271_GPIO_OUT_MUX_AS_OUT = 0x0,	/**< GPIO set mux as output */
     
 	/* Wakeup related registers */
@@ -62,6 +78,4 @@
 	
 	/* MAC Registers */
-	AR9271_MAC_REG_OFFSET = 0x10000000, /**< MAC Registers offset */
-			
 	AR9271_MAC_PCU_STA_ADDR_L32 = 0x8000, /**< STA Address Lower 32 Bits */
 	AR9271_MAC_PCU_STA_ADDR_U16 = 0x8004, /**< STA Address Upper 16 Bits */
@@ -78,4 +92,7 @@
 /** AR9271 device data */
 typedef struct {
+	/** DDF device pointer */
+	ddf_dev_t *ddf_device;
+	
 	/** USB device data */
 	usb_device_t *usb_device;
Index: uspace/drv/bus/usb/ar9271/hw.c
===================================================================
--- uspace/drv/bus/usb/ar9271/hw.c	(revision 01784d20ebe77098db8f9fe743d50de2c8c9b646)
+++ uspace/drv/bus/usb/ar9271/hw.c	(revision 462054abcfa5153f73910e63137ea1db077091da)
@@ -35,4 +35,5 @@
 #include <usb/debug.h>
 #include <unistd.h>
+#include <nic.h>
 
 #include "hw.h"
@@ -179,4 +180,92 @@
 }
 
+static int hw_addr_init(ar9271_t *ar9271)
+{
+	int rc;
+	uint32_t value;
+	nic_address_t ar9271_address;
+	
+	for(int i = 0; i < 3; i++) {
+		rc = wmi_reg_read(ar9271->htc_device, 
+			AR9271_EEPROM_MAC_ADDR_START + i*4,
+			&value);
+		
+		if(rc != EOK) {
+			usb_log_error("Failed to read %d. byte of MAC address."
+				"\n", i);
+			return rc;
+		}
+		
+		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_device);
+	
+	rc = nic_report_address(nic, &ar9271_address);
+	if(rc != EOK) {
+		usb_log_error("Failed to report NIC HW address.\n");
+			return rc;
+	}
+	
+	return EOK;
+}
+
+static int hw_gpio_set_output(ar9271_t *ar9271, uint32_t gpio, uint32_t type)
+{
+	uint32_t address, gpio_shift, temp;
+	
+	if(gpio > 11) {
+		address = AR9271_GPIO_OUT_MUX3;
+	} else if(gpio > 5) {
+		address = AR9271_GPIO_OUT_MUX2;
+	} else {
+		address = AR9271_GPIO_OUT_MUX1;
+	}
+	
+	gpio_shift = (gpio % 6) * 5;
+	
+	int rc = wmi_reg_read(ar9271->htc_device, address, &temp);
+	if(rc != EOK) {
+		usb_log_error("Failed to read GPIO output mux.\n");
+		return rc;
+	}
+	
+	temp = ((temp & 0x1F0) << 1) | (temp & ~0x1F0);
+	temp &= ~(0x1f << gpio_shift);
+	temp |= (type << gpio_shift);
+	
+	rc = wmi_reg_write(ar9271->htc_device, address, temp);
+	if(rc != EOK) {
+		usb_log_error("Failed to write GPIO output mux.\n");
+		return rc;
+	}
+	
+	gpio_shift = 2 * gpio;
+	
+	rc = wmi_reg_clear_set_bit(ar9271->htc_device, AR9271_GPIO_OE_OUT,
+		AR9271_GPIO_OE_OUT_ALWAYS << gpio_shift, 
+		AR9271_GPIO_OE_OUT_ALWAYS << gpio_shift);
+	if(rc != EOK) {
+		usb_log_error("Failed to config GPIO as output.\n");
+		return rc;
+	}
+	
+	return EOK;
+}
+
+static int hw_gpio_set_value(ar9271_t *ar9271, uint32_t gpio, uint32_t value)
+{
+	int rc = wmi_reg_clear_set_bit(ar9271->htc_device, AR9271_GPIO_IN_OUT,
+		(~value & 1) << gpio, 1 << gpio);
+	if(rc != EOK) {
+		usb_log_error("Failed to set GPIO.\n");
+		return rc;
+	}
+	
+	return EOK;
+}
+
 /**
  * Hardware reset of AR9271 device.
@@ -186,5 +275,5 @@
  * @return EOK if succeed, negative error code otherwise.
  */
-int hw_reset(ar9271_t *ar9271)
+static int hw_reset(ar9271_t *ar9271)
 {
 	int rc = hw_reset_power_on(ar9271);
@@ -200,5 +289,27 @@
 	}
 	
-	/* TODO: Finish HW init (EEPROM init, MAC ADDR init). */
+	rc = hw_addr_init(ar9271);
+	if(rc != EOK) {
+		usb_log_error("Failed to init HW addr.\n");
+		return rc;
+	}
+	
+	return EOK;
+}
+
+static int hw_init_led(ar9271_t *ar9271)
+{
+	int rc = hw_gpio_set_output(ar9271, AR9271_LED_PIN, 
+		AR9271_GPIO_OUT_MUX_AS_OUT);
+	if(rc != EOK) {
+		usb_log_error("Failed to set led GPIO to output.\n");
+		return rc;
+	}
+	
+	rc = hw_gpio_set_value(ar9271, AR9271_LED_PIN, 0);
+	if(rc != EOK) {
+		usb_log_error("Failed to init bring up GPIO led.\n");
+		return rc;
+	}
 	
 	return EOK;
@@ -220,4 +331,10 @@
 	}
 	
+	rc = hw_init_led(ar9271);
+	if(rc != EOK) {
+		usb_log_error("Failed to HW init led.\n");
+		return rc;
+	}
+	
 	usb_log_info("HW initialization finished successfully.\n");
 	
Index: uspace/drv/bus/usb/ar9271/hw.h
===================================================================
--- uspace/drv/bus/usb/ar9271/hw.h	(revision 01784d20ebe77098db8f9fe743d50de2c8c9b646)
+++ uspace/drv/bus/usb/ar9271/hw.h	(revision 462054abcfa5153f73910e63137ea1db077091da)
@@ -42,5 +42,4 @@
 
 extern int hw_init(ar9271_t *ar9271);
-extern int hw_reset(ar9271_t *ar9271);
 
 #endif	/* ATHEROS_HW_H */
Index: uspace/drv/bus/usb/ar9271/wmi.c
===================================================================
--- uspace/drv/bus/usb/ar9271/wmi.c	(revision 01784d20ebe77098db8f9fe743d50de2c8c9b646)
+++ uspace/drv/bus/usb/ar9271/wmi.c	(revision 462054abcfa5153f73910e63137ea1db077091da)
@@ -115,5 +115,5 @@
  * @return EOK if succeed, negative error code otherwise.
  */
-int wmi_reg_rmw(htc_device_t *htc_device, uint32_t reg_offset, 
+int wmi_reg_clear_set_bit(htc_device_t *htc_device, uint32_t reg_offset, 
 	uint32_t set_bit, uint32_t clear_bit)
 {
@@ -127,6 +127,6 @@
 	}
 	
+	value &= ~clear_bit;
 	value |= set_bit;
-	value &= ~clear_bit;
 	
 	rc = wmi_reg_write(htc_device, reg_offset, value);
@@ -152,5 +152,5 @@
 	uint32_t set_bit)
 {
-	return wmi_reg_rmw(htc_device, reg_offset, set_bit, 0);
+	return wmi_reg_clear_set_bit(htc_device, reg_offset, set_bit, 0);
 }
 
@@ -167,5 +167,5 @@
 	uint32_t clear_bit)
 {
-	return wmi_reg_rmw(htc_device, reg_offset, 0, clear_bit);
+	return wmi_reg_clear_set_bit(htc_device, reg_offset, 0, clear_bit);
 }
 
Index: uspace/drv/bus/usb/ar9271/wmi.h
===================================================================
--- uspace/drv/bus/usb/ar9271/wmi.h	(revision 01784d20ebe77098db8f9fe743d50de2c8c9b646)
+++ uspace/drv/bus/usb/ar9271/wmi.h	(revision 462054abcfa5153f73910e63137ea1db077091da)
@@ -118,5 +118,5 @@
 extern int wmi_reg_write(htc_device_t *htc_device, uint32_t reg_offset, 
 	uint32_t val);
-extern int wmi_reg_rmw(htc_device_t *htc_device, uint32_t reg_offset, 
+extern int wmi_reg_clear_set_bit(htc_device_t *htc_device, uint32_t reg_offset, 
 	uint32_t set_bit, uint32_t clear_bit);
 extern int wmi_reg_set_bit(htc_device_t *htc_device, uint32_t reg_offset, 
