Index: uspace/drv/nic/ar9271/htc.h
===================================================================
--- uspace/drv/nic/ar9271/htc.h	(revision 1dcc0b9aaf9f79f759ef62cc27bccd9e6b7c8d80)
+++ uspace/drv/nic/ar9271/htc.h	(revision 8a64320e304a59746f5987caeba986e6baf11dd7)
@@ -29,5 +29,5 @@
 /** @file htc.h
  *
- * Definitions of the Atheros HTC (Host Target Communication) technology 
+ * Definitions of the Atheros HTC (Host Target Communication) technology
  * for communication between host (PC) and target (device firmware).
  *
@@ -35,5 +35,5 @@
 
 #ifndef ATHEROS_HTC_H
-#define	ATHEROS_HTC_H
+#define ATHEROS_HTC_H
 
 #include <ieee80211.h>
@@ -41,34 +41,33 @@
 #include <sys/types.h>
 #include <nic.h>
-
 #include "ath.h"
 
-#define HTC_RTS_THRESHOLD 2304
-#define HTC_RATES_MAX_LENGTH 30
-
-/**
- * HTC message IDs.
+#define HTC_RTS_THRESHOLD     2304
+#define HTC_RATES_MAX_LENGTH  30
+
+/** HTC message IDs.
+ *
  */
 typedef enum {
 	HTC_MESSAGE_READY = 1,
 	HTC_MESSAGE_CONNECT_SERVICE,
-        HTC_MESSAGE_CONNECT_SERVICE_RESPONSE,
-        HTC_MESSAGE_SETUP_COMPLETE,
-        HTC_MESSAGE_CONFIG
+	HTC_MESSAGE_CONNECT_SERVICE_RESPONSE,
+	HTC_MESSAGE_SETUP_COMPLETE,
+	HTC_MESSAGE_CONFIG
 } htc_message_id_t;
 
-/**
- * HTC response message status codes.
+/** HTC response message status codes.
+ *
  */
 typedef enum {
-        HTC_SERVICE_SUCCESS = 0,
-        HTC_SERVICE_NOT_FOUND,
-        HTC_SERVICE_FAILED,
-        HTC_SERVICE_NO_RESOURCES,
-        HTC_SERVICE_NO_MORE_EP
+	HTC_SERVICE_SUCCESS = 0,
+	HTC_SERVICE_NOT_FOUND,
+	HTC_SERVICE_FAILED,
+	HTC_SERVICE_NO_RESOURCES,
+	HTC_SERVICE_NO_MORE_EP
 } htc_response_status_code_t;
 
-/**
- * HTC operating mode definition.
+/** HTC operating mode definition.
+ *
  */
 typedef enum {
@@ -79,6 +78,6 @@
 } htc_operating_mode_t;
 
-/**
- * HTC data type indicator.
+/** HTC data type indicator.
+ *
  */
 typedef enum {
@@ -89,9 +88,9 @@
 } htc_data_type_t;
 
-/**
- * HTC endpoint numbers.
- */
-typedef struct {
-        int ctrl_endpoint;
+/** HTC endpoint numbers.
+ *
+ */
+typedef struct {
+	int ctrl_endpoint;
 	int wmi_endpoint;
 	int beacon_endpoint;
@@ -105,11 +104,11 @@
 } htc_pipes_t;
 
-/**
- * HTC device data.
- */
-typedef struct {
-        /** WMI message sequence number */
-        uint16_t sequence_number;
-    
+/** HTC device data.
+ *
+ */
+typedef struct {
+	/** WMI message sequence number */
+	uint16_t sequence_number;
+	
 	/** HTC endpoints numbers */
 	htc_pipes_t endpoints;
@@ -128,16 +127,16 @@
 } htc_device_t;
 
-/** 
- * HTC frame header structure.
- */
-typedef struct {
-	uint8_t   endpoint_id;
-	uint8_t   flags;
-	uint16_t  payload_length;	/**< Big Endian value! */
-	uint8_t   control_bytes[4];
+/** HTC frame header structure.
+ *
+ */
+typedef struct {
+	uint8_t endpoint_id;
+	uint8_t flags;
+	uint16_t payload_length;   /**< Big Endian value! */
+	uint8_t control_bytes[4];
 } __attribute__((packed)) htc_frame_header_t;
 
-/** 
- * HTC management TX frame header structure.
+/** HTC management TX frame header structure.
+ *
  */
 typedef struct {
@@ -152,6 +151,6 @@
 } __attribute__((packed)) htc_tx_management_header_t;
 
-/** 
- * HTC data TX frame header structure.
+/** HTC data TX frame header structure.
+ *
  */
 typedef struct {
@@ -160,5 +159,5 @@
 	uint8_t vif_idx;
 	uint8_t tidno;
-	uint32_t flags;			/**< Big Endian value! */
+	uint32_t flags;    /**< Big Endian value! */
 	uint8_t key_type;
 	uint8_t keyix;
@@ -167,23 +166,23 @@
 } __attribute__((packed)) htc_tx_data_header_t;
 
-/** 
- * HTC ready message structure.
- */
-typedef struct {
-        uint16_t message_id;		/**< Big Endian value! */
-        uint16_t credits;		/**< Big Endian value! */
-        uint16_t credit_size;		/**< Big Endian value! */
-        
-        uint8_t max_endpoints;
+/** HTC ready message structure.
+ *
+ */
+typedef struct {
+	uint16_t message_id;   /**< Big Endian value! */
+	uint16_t credits;      /**< Big Endian value! */
+	uint16_t credit_size;  /**< Big Endian value! */
+	
+	uint8_t max_endpoints;
 	uint8_t pad;
 } __attribute__((packed)) htc_ready_msg_t;
 
-/** 
- * HTC service message structure.
- */
-typedef struct {
-	uint16_t message_id;		/**< Big Endian value! */
-	uint16_t service_id;		/**< Big Endian value! */
-	uint16_t connection_flags;	/**< Big Endian value! */
+/** HTC service message structure.
+ *
+ */
+typedef struct {
+	uint16_t message_id;        /**< Big Endian value! */
+	uint16_t service_id;        /**< Big Endian value! */
+	uint16_t connection_flags;  /**< Big Endian value! */
 	
 	uint8_t download_pipe_id;
@@ -193,60 +192,60 @@
 } __attribute__((packed)) htc_service_msg_t;
 
-/** 
- * HTC service response message structure.
- */
-typedef struct {
-        uint16_t message_id;            /**< Big Endian value! */
-        uint16_t service_id;            /**< Big Endian value! */
-        uint8_t status;
-        uint8_t endpoint_id;
-        uint16_t max_message_length;    /**< Big Endian value! */
-        uint8_t service_meta_length;
-        uint8_t pad;
+/** HTC service response message structure.
+ *
+ */
+typedef struct {
+	uint16_t message_id;          /**< Big Endian value! */
+	uint16_t service_id;          /**< Big Endian value! */
+	uint8_t status;
+	uint8_t endpoint_id;
+	uint16_t max_message_length;  /**< Big Endian value! */
+	uint8_t service_meta_length;
+	uint8_t pad;
 } __attribute__((packed)) htc_service_resp_msg_t;
 
-/**
- * HTC credits config message structure.
- */
-typedef struct {
-        uint16_t message_id;            /**< Big Endian value! */
-        uint8_t pipe_id;
-        uint8_t credits;
+/** HTC credits config message structure.
+ *
+ */
+typedef struct {
+	uint16_t message_id;  /**< Big Endian value! */
+	uint8_t pipe_id;
+	uint8_t credits;
 } __attribute__((packed)) htc_config_msg_t;
 
-/**
- * HTC new virtual interface message.
- */
-typedef struct {
-        uint8_t index;
+/** HTC new virtual interface message.
+ *
+ */
+typedef struct {
+	uint8_t index;
 	uint8_t op_mode;
 	uint8_t addr[ETH_ADDR];
 	uint8_t ath_cap;
-	uint16_t rts_thres;		/**< Big Endian value! */
+	uint16_t rts_thres;      /**< Big Endian value! */
 	uint8_t pad;
 } __attribute__((packed)) htc_vif_msg_t;
 
-/**
- * HTC new station message.
+/** HTC new station message.
+ *
  */
 typedef struct {
 	uint8_t addr[ETH_ADDR];
 	uint8_t bssid[ETH_ADDR];
-        uint8_t sta_index;
+	uint8_t sta_index;
 	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! */
+	
+	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;
 
-/**
- * HTC message to inform target about available capabilities.
- */
-typedef struct {
-	uint32_t ampdu_limit;	/**< Big Endian value! */
+/** HTC message to inform target about available capabilities.
+ *
+ */
+typedef struct {
+	uint32_t ampdu_limit;     /**< Big Endian value! */
 	uint8_t ampdu_subframes;
 	uint8_t enable_coex;
@@ -258,5 +257,5 @@
 	uint8_t sta_index;
 	uint8_t is_new;
-	uint32_t cap_flags;	/**< Big Endian value! */
+	uint32_t cap_flags;  /**< Big Endian value! */
 	uint8_t legacy_rates_count;
 	uint8_t legacy_rates[HTC_RATES_MAX_LENGTH];
@@ -264,10 +263,10 @@
 } htc_rate_msg_t;
 
-/**
- * HTC RX status structure used in incoming HTC data messages.
- */
-typedef struct {
-	uint64_t timestamp;	/**< Big Endian value! */
-	uint16_t data_length;	/**< Big Endian value! */
+/** HTC RX status structure used in incoming HTC data messages.
+ *
+ */
+typedef struct {
+	uint64_t timestamp;    /**< Big Endian value! */
+	uint16_t data_length;  /**< Big Endian value! */
 	uint8_t status;
 	uint8_t phy_err;
@@ -284,29 +283,23 @@
 	uint8_t flags;
 	uint8_t dummy;
-	uint32_t evm0;		/**< Big Endian value! */
-	uint32_t evm1;		/**< Big Endian value! */
-	uint32_t evm2;		/**< Big Endian value! */
+	uint32_t evm0;         /**< Big Endian value! */
+	uint32_t evm1;         /**< Big Endian value! */
+	uint32_t evm2;         /**< Big Endian value! */
 } htc_rx_status_t;
 
-/**
- * HTC setup complete message structure
- */
-typedef struct {
-        uint16_t message_id;            /**< Big Endian value! */
+/** HTC setup complete message structure
+ *
+ */
+typedef struct {
+	uint16_t message_id;  /**< Big Endian value! */
 } __attribute__((packed)) htc_setup_complete_msg_t;
 
-extern int htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev, 
-	htc_device_t *htc_device);
-extern int htc_init(htc_device_t *htc_device);
-extern int htc_init_new_vif(htc_device_t *htc_device);
-extern int htc_read_control_message(htc_device_t *htc_device, void *buffer, 
-	size_t buffer_size, size_t *transferred_size);
-extern int htc_read_data_message(htc_device_t *htc_device, void *buffer, 
-	size_t buffer_size, size_t *transferred_size);
-extern int htc_send_control_message(htc_device_t *htc_device, void *buffer, 
-	size_t buffer_size, uint8_t endpoint_id);
-extern int htc_send_data_message(htc_device_t *htc_device, void *buffer, 
-	size_t buffer_size, uint8_t endpoint_id);
-
-#endif	/* ATHEROS_HTC_H */
-
+extern int htc_device_init(ath_t *, ieee80211_dev_t *, htc_device_t *);
+extern int htc_init(htc_device_t *);
+extern int htc_init_new_vif(htc_device_t *);
+extern int htc_read_control_message(htc_device_t *, void *, size_t, size_t *);
+extern int htc_read_data_message(htc_device_t *, void *, size_t, size_t *);
+extern int htc_send_control_message(htc_device_t *, void *, size_t, uint8_t);
+extern int htc_send_data_message(htc_device_t *, void *, size_t, uint8_t);
+
+#endif  /* ATHEROS_HTC_H */
