forked from Minki/linux
staging: android: logger: Finish documentation of two structs
Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
adb913658f
commit
0edc6c6d54
@ -32,38 +32,50 @@
|
|||||||
|
|
||||||
#include <asm/ioctls.h>
|
#include <asm/ioctls.h>
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* struct logger_log - represents a specific log, such as 'main' or 'radio'
|
* struct logger_log - represents a specific log, such as 'main' or 'radio'
|
||||||
|
* @buffer: The actual ring buffer
|
||||||
|
* @misc: The "misc" device representing the log
|
||||||
|
* @wq: The wait queue for @readers
|
||||||
|
* @readers: This log's readers
|
||||||
|
* @mutex: The mutex that protects the @buffer
|
||||||
|
* @w_off: The current write head offset
|
||||||
|
* @head: The head, or location that readers start reading at.
|
||||||
|
* @size: The size of the log
|
||||||
|
* @logs: The list of log channels
|
||||||
*
|
*
|
||||||
* This structure lives from module insertion until module removal, so it does
|
* This structure lives from module insertion until module removal, so it does
|
||||||
* not need additional reference counting. The structure is protected by the
|
* not need additional reference counting. The structure is protected by the
|
||||||
* mutex 'mutex'.
|
* mutex 'mutex'.
|
||||||
*/
|
*/
|
||||||
struct logger_log {
|
struct logger_log {
|
||||||
unsigned char *buffer;/* the ring buffer itself */
|
unsigned char *buffer;
|
||||||
struct miscdevice misc; /* misc device representing the log */
|
struct miscdevice misc;
|
||||||
wait_queue_head_t wq; /* wait queue for readers */
|
wait_queue_head_t wq;
|
||||||
struct list_head readers; /* this log's readers */
|
struct list_head readers;
|
||||||
struct mutex mutex; /* mutex protecting buffer */
|
struct mutex mutex;
|
||||||
size_t w_off; /* current write head offset */
|
size_t w_off;
|
||||||
size_t head; /* new readers start here */
|
size_t head;
|
||||||
size_t size; /* size of the log */
|
size_t size;
|
||||||
struct list_head logs; /* list of log channels (myself)*/
|
struct list_head logs;
|
||||||
};
|
};
|
||||||
|
|
||||||
static LIST_HEAD(log_list);
|
static LIST_HEAD(log_list);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* struct logger_reader - a logging device open for reading
|
* struct logger_reader - a logging device open for reading
|
||||||
|
* @log: The associated log
|
||||||
|
* @list: The associated entry in @logger_log's list
|
||||||
|
* @r_off: The current read head offset.
|
||||||
*
|
*
|
||||||
* This object lives from open to release, so we don't need additional
|
* This object lives from open to release, so we don't need additional
|
||||||
* reference counting. The structure is protected by log->mutex.
|
* reference counting. The structure is protected by log->mutex.
|
||||||
*/
|
*/
|
||||||
struct logger_reader {
|
struct logger_reader {
|
||||||
struct logger_log *log; /* associated log */
|
struct logger_log *log;
|
||||||
struct list_head list; /* entry in logger_log's list */
|
struct list_head list;
|
||||||
size_t r_off; /* current read head offset */
|
size_t r_off;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* logger_offset - returns index 'n' into the log via (optimized) modulus */
|
/* logger_offset - returns index 'n' into the log via (optimized) modulus */
|
||||||
|
Loading…
Reference in New Issue
Block a user