Index: uspace/lib/pcap/src/pcap_dumper.c
===================================================================
--- uspace/lib/pcap/src/pcap_dumper.c	(revision fb316822bc92404f7ec785477d173721f75b2232)
+++ uspace/lib/pcap/src/pcap_dumper.c	(revision 87b490e3bd8415518545092c263ede6ab3da8532)
@@ -30,6 +30,5 @@
  * @{
  */
-/** @file
- *  @brief pcap inteface: Dumping interface for the device which packets we want to dump
+/** @file Pcap dumper. Structure is a part of every device that is in category PCAP and can dump packets.
  */
 
@@ -43,7 +42,7 @@
 /** Initialize writing to .pcap file.
  *
- * @param writer    Interface for working with .pcap file.
+ * @param writer    Interface for writing data.
  * @param filename  Name of the file for dumping packets.
- * @return          EOK on success or an error code.
+ * @return          EOK on success, otherwise an error code.
  *
  */
@@ -66,4 +65,9 @@
 }
 
+/** Open file for appending to the end of it.
+ *  @param writer 	Interface for writing data.
+ *  @param filename Path to the file.
+ *  @return 		EOK on success, error code otherwise.
+ */
 static errno_t pcap_writer_to_file_init_append(pcap_writer_t *writer, const char *filename)
 {
@@ -76,4 +80,9 @@
 }
 
+/** Initialize file for dumping usb packets.
+ *  @param writer 	Interface for writing data.
+ *  @param filename Path to the file.
+ *  @return 		EOK on success, error code otherwise.
+ */
 static errno_t pcap_writer_to_file_usb_init(pcap_writer_t *writer, const char *filename)
 {
@@ -94,4 +103,9 @@
 }
 
+/** Write 4B to the file.
+ *  @param writer 	Interface for writing data.
+ *  @param data 	Bytes to write.
+ *  @return 		Size of successfully witten data.
+ */
 static size_t pcap_file_w32(pcap_writer_t *writer, uint32_t data)
 {
@@ -99,4 +113,9 @@
 }
 
+/** Write 2B to the file.
+ *  @param writer 	Interface for writing data.
+ *  @param data 	Bytes to write.
+ *  @return 		Size of successfully witten data.
+ */
 static size_t pcap_file_w16(pcap_writer_t *writer, uint16_t data)
 {
@@ -104,4 +123,10 @@
 }
 
+/** Write block of bytes to the file.
+ *  @param writer 	Interface for writing data.
+ *  @param data 	Bytes to write.
+ *  @param size		Size of block of bytes.
+ *  @return 		Size of successfully witten data.
+ */
 static size_t pcap_file_wbuffer(pcap_writer_t *writer, const void *data, size_t size)
 {
@@ -110,4 +135,7 @@
 }
 
+/** Close file for writing.
+ *  @param writer 	Interaface for writing data.
+ */
 static void pcap_file_close(pcap_writer_t *writer)
 {
@@ -116,4 +144,10 @@
 }
 
+/** Write <= 60B of block of bytes.
+ *  @param writer 	Interface for writing data.
+ *  @param data 	Bytes to write.
+ *  @param size		Size of block of bytes.
+ *  @return 		Size of successfully witten data.
+ */
 static size_t pcap_short_file_wbuffer(pcap_writer_t *writer, const void *data, size_t size)
 {
@@ -121,4 +155,5 @@
 }
 
+/** Standard writer operations for writing data to a newly created file. */
 static const pcap_writer_ops_t file_ops = {
 	.open = &pcap_writer_to_file_init,
@@ -129,4 +164,5 @@
 };
 
+/** Truncated writer operations. Only first 60 bytes of the packet are written. */
 static const pcap_writer_ops_t short_file_ops = {
 	.open = &pcap_writer_to_file_init,
@@ -138,4 +174,5 @@
 };
 
+/** Append writer operations. Instead of creating new file open existing file and append packets. */
 static const pcap_writer_ops_t append_file_ops = {
 	.open = &pcap_writer_to_file_init_append,
@@ -146,4 +183,5 @@
 };
 
+/** USB writer operations. Writing USB packets to the file. */
 static const pcap_writer_ops_t usb_file_ops = {
 	.open = &pcap_writer_to_file_usb_init,
@@ -154,6 +192,8 @@
 };
 
+/** Default array of operations. Must be consistens with constants in /uspace/app/pcapctl/main.c */
 static pcap_writer_ops_t ops[4] = { file_ops, short_file_ops, append_file_ops, usb_file_ops };
 
+/** Get number of writer operations in @ref ops */
 int pcap_dumper_get_ops_number(void)
 {
@@ -161,4 +201,9 @@
 }
 
+/** Open destination buffer for writing and set flag for dumping.
+ *  @param dumper	Structure responsible for dumping packets. Part of the driver.
+ *  @param name		Name of the destination buffer to dump packets to.
+ *  @return 		EOK if successful, erro code otherwise.
+ */
 errno_t pcap_dumper_start(pcap_dumper_t *dumper, const char *name)
 {
@@ -174,4 +219,9 @@
 }
 
+/** Set writer options for the writer.
+ *  @param dumper 	Structure responsible for dumping packets. Part of the driver.
+ *  @param index	Index of the writer operations from array @ref ops.
+ *  @return 		EOK if successful, erro code otherwise.
+ */
 errno_t pcap_dumper_set_ops(pcap_dumper_t *dumper, int index)
 {
@@ -183,4 +233,9 @@
 }
 
+/** Write packet to destination buffer.
+ *  @param dumper	Structure responsible for dumping packets. Part of the driver.
+ *  @param data		Packet data to write.
+ *  @param size		Size of the packet.
+ */
 void pcap_dumper_add_packet(pcap_dumper_t *dumper, const void *data, size_t size)
 {
@@ -196,4 +251,7 @@
 }
 
+/** Close destination buffer for writing and unset flag for dumping.
+ *  @param dumper	Structure responsible for dumping packets. Part of the driver.
+ */
 void pcap_dumper_stop(pcap_dumper_t *dumper)
 {
