Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
pm_qos.h File Reference
#include <linux/plist.h>
#include <linux/notifier.h>
#include <linux/miscdevice.h>
#include <linux/device.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  pm_qos_request
 
struct  dev_pm_qos_request
 
struct  pm_qos_constraints
 

Macros

#define PM_QOS_DEFAULT_VALUE   -1
 
#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE   (2000 * USEC_PER_SEC)
 
#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE   (2000 * USEC_PER_SEC)
 
#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE   0
 
#define PM_QOS_DEV_LAT_DEFAULT_VALUE   0
 

Enumerations

enum  {
  PM_QOS_RESERVED = 0, PM_QOS_CPU_DMA_LATENCY, PM_QOS_NETWORK_LATENCY, PM_QOS_NETWORK_THROUGHPUT,
  PM_QOS_NUM_CLASSES
}
 
enum  pm_qos_type { PM_QOS_UNITIALIZED, PM_QOS_MAX, PM_QOS_MIN }
 
enum  pm_qos_req_action { PM_QOS_ADD_REQ, PM_QOS_UPDATE_REQ, PM_QOS_REMOVE_REQ }
 

Functions

int pm_qos_update_target (struct pm_qos_constraints *c, struct plist_node *node, enum pm_qos_req_action action, int value)
 
void pm_qos_add_request (struct pm_qos_request *req, int pm_qos_class, s32 value)
 
void pm_qos_update_request (struct pm_qos_request *req, s32 new_value)
 
void pm_qos_update_request_timeout (struct pm_qos_request *req, s32 new_value, unsigned long timeout_us)
 
void pm_qos_remove_request (struct pm_qos_request *req)
 
int pm_qos_request (int pm_qos_class)
 
int pm_qos_add_notifier (int pm_qos_class, struct notifier_block *notifier)
 
int pm_qos_remove_notifier (int pm_qos_class, struct notifier_block *notifier)
 
int pm_qos_request_active (struct pm_qos_request *req)
 
s32 pm_qos_read_value (struct pm_qos_constraints *c)
 

Macro Definition Documentation

#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE   (2000 * USEC_PER_SEC)

Definition at line 25 of file pm_qos.h.

#define PM_QOS_DEFAULT_VALUE   -1

Definition at line 23 of file pm_qos.h.

#define PM_QOS_DEV_LAT_DEFAULT_VALUE   0

Definition at line 28 of file pm_qos.h.

#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE   (2000 * USEC_PER_SEC)

Definition at line 26 of file pm_qos.h.

#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE   0

Definition at line 27 of file pm_qos.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
PM_QOS_RESERVED 
PM_QOS_CPU_DMA_LATENCY 
PM_QOS_NETWORK_LATENCY 
PM_QOS_NETWORK_THROUGHPUT 
PM_QOS_NUM_CLASSES 

Definition at line 13 of file pm_qos.h.

Enumerator:
PM_QOS_ADD_REQ 
PM_QOS_UPDATE_REQ 
PM_QOS_REMOVE_REQ 

Definition at line 61 of file pm_qos.h.

Enumerator:
PM_QOS_UNITIALIZED 
PM_QOS_MAX 
PM_QOS_MIN 

Definition at line 41 of file pm_qos.h.

Function Documentation

int pm_qos_add_notifier ( int  pm_qos_class,
struct notifier_block notifier 
)

pm_qos_add_notifier - sets notification entry for changes to target value : identifies which qos target changes should be notified. : notifier block managed by caller.

will register the notifier into a notification chain that gets called upon changes to the pm_qos_class target value.

Definition at line 374 of file qos.c.

void pm_qos_add_request ( struct pm_qos_request req,
int  pm_qos_class,
s32  value 
)

pm_qos_add_request - inserts new qos request into the list : pointer to a preallocated handle : identifies which list of qos request to use : defines the qos request

This function inserts a new entry in the pm_qos_class list of requested qos performance characteristics. It recomputes the aggregate QoS expectations for the pm_qos_class of parameters and initializes the pm_qos_request handle. Caller needs to save this handle for later use in updates and removal.

Definition at line 261 of file qos.c.

s32 pm_qos_read_value ( struct pm_qos_constraints c)

Definition at line 146 of file qos.c.

int pm_qos_remove_notifier ( int  pm_qos_class,
struct notifier_block notifier 
)

pm_qos_remove_notifier - deletes notification entry from chain. : identifies which qos target changes are notified. : notifier block to be removed.

will remove the notifier from the notification chain that gets called upon changes to the pm_qos_class target value.

Definition at line 394 of file qos.c.

void pm_qos_remove_request ( struct pm_qos_request req)

pm_qos_remove_request - modifies an existing qos request : handle to request list element

Will remove pm qos request from the list of constraints and recompute the current target value for the pm_qos_class. Call this on slow code paths.

Definition at line 345 of file qos.c.

int pm_qos_request ( int  pm_qos_class)

pm_qos_request - returns current system wide qos expectation : identification of which qos value is requested

This function returns the current target value.

Definition at line 221 of file qos.c.

int pm_qos_request_active ( struct pm_qos_request req)

Definition at line 227 of file qos.c.

void pm_qos_update_request ( struct pm_qos_request req,
s32  new_value 
)

pm_qos_update_request - modifies an existing qos request : handle to list element holding a pm_qos request to use : defines the qos request

Updates an existing qos request for the pm_qos_class of parameters along with updating the target pm_qos_class value.

Attempts are made to make this code callable on hot code paths.

Definition at line 288 of file qos.c.

void pm_qos_update_request_timeout ( struct pm_qos_request req,
s32  new_value,
unsigned long  timeout_us 
)

pm_qos_update_request_timeout - modifies an existing qos request temporarily. : handle to list element holding a pm_qos request to use : defines the temporal qos request : the effective duration of this qos request in usecs.

After timeout_us, this qos request is cancelled automatically.

Definition at line 317 of file qos.c.

int pm_qos_update_target ( struct pm_qos_constraints c,
struct plist_node node,
enum pm_qos_req_action  action,
int  value 
)

pm_qos_update_target - manages the constraints list and calls the notifiers if needed : constraints data struct : request to add to the list, to update or to remove : action to take on the constraints list : value of the request to add or update

This function returns 1 if the aggregated constraint value has changed, 0 otherwise.

Definition at line 167 of file qos.c.