Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
libata-acpi.c File Reference
#include <linux/module.h>
#include <linux/ata.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/acpi.h>
#include <linux/libata.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <scsi/scsi_device.h>
#include "libata.h"
#include <acpi/acpi_bus.h>

Go to the source code of this file.

Data Structures

struct  ata_acpi_gtf
 

Macros

#define NO_PORT_MULT   0xffff
 
#define SATA_ADR(root, pmp)   (((root) << 16) | (pmp))
 
#define REGS_PER_GTF   7
 

Functions

 module_param_named (acpi_gtf_filter, ata_acpi_gtf_filter, int, 0644)
 
 MODULE_PARM_DESC (acpi_gtf_filter,"filter mask for ACPI _GTF commands, set to filter out (0x1=set xfermode, 0x2=lock/freeze lock, 0x4=DIPM, 0x8=FPDMA non-zero offset, 0x10=FPDMA DMA Setup FIS auto-activate)")
 
acpi_handle ata_ap_acpi_handle (struct ata_port *ap)
 
 EXPORT_SYMBOL (ata_ap_acpi_handle)
 
acpi_handle ata_dev_acpi_handle (struct ata_device *dev)
 
 EXPORT_SYMBOL (ata_dev_acpi_handle)
 
void ata_acpi_dissociate (struct ata_host *host)
 
int ata_acpi_gtm (struct ata_port *ap, struct ata_acpi_gtm *gtm)
 
 EXPORT_SYMBOL_GPL (ata_acpi_gtm)
 
int ata_acpi_stm (struct ata_port *ap, const struct ata_acpi_gtm *stm)
 
 EXPORT_SYMBOL_GPL (ata_acpi_stm)
 
unsigned long ata_acpi_gtm_xfermask (struct ata_device *dev, const struct ata_acpi_gtm *gtm)
 
 EXPORT_SYMBOL_GPL (ata_acpi_gtm_xfermask)
 
int ata_acpi_cbl_80wire (struct ata_port *ap, const struct ata_acpi_gtm *gtm)
 
 EXPORT_SYMBOL_GPL (ata_acpi_cbl_80wire)
 
int ata_acpi_on_suspend (struct ata_port *ap)
 
void ata_acpi_on_resume (struct ata_port *ap)
 
void ata_acpi_set_state (struct ata_port *ap, pm_message_t state)
 
int ata_acpi_on_devcfg (struct ata_device *dev)
 
void ata_acpi_on_disable (struct ata_device *dev)
 
void ata_acpi_bind (struct ata_device *dev)
 
void ata_acpi_unbind (struct ata_device *dev)
 
int ata_acpi_register (void)
 
void ata_acpi_unregister (void)
 

Variables

unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT
 
struct ata_acpi_gtf __packed
 

Macro Definition Documentation

#define NO_PORT_MULT   0xffff

Definition at line 29 of file libata-acpi.c.

#define REGS_PER_GTF   7

Definition at line 32 of file libata-acpi.c.

#define SATA_ADR (   root,
  pmp 
)    (((root) << 16) | (pmp))

Definition at line 30 of file libata-acpi.c.

Function Documentation

void ata_acpi_bind ( struct ata_device dev)

Definition at line 1054 of file libata-acpi.c.

int ata_acpi_cbl_80wire ( struct ata_port ap,
const struct ata_acpi_gtm gtm 
)

ata_acpi_cbl_80wire - Check for 80 wire cable : Port to check : GTM data to use

Return 1 if the indicates the BIOS selected an 80wire mode.

Definition at line 493 of file libata-acpi.c.

void ata_acpi_dissociate ( struct ata_host host)

ata_acpi_dissociate - dissociate ATA host from ACPI objects : target ATA host

This function is called during driver detach after the whole host is shut down.

LOCKING: EH context.

Definition at line 223 of file libata-acpi.c.

ata_acpi_gtm - execute _GTM : target ATA port : out parameter for _GTM result

Evaluate _GTM and store the result in .

LOCKING: EH context.

RETURNS: 0 on success, -ENOENT if _GTM doesn't exist, -errno on failure.

Definition at line 252 of file libata-acpi.c.

unsigned long ata_acpi_gtm_xfermask ( struct ata_device dev,
const struct ata_acpi_gtm gtm 
)

ata_acpi_gtm_xfermode - determine xfermode from GTM parameter : target device : GTM parameter to use

Determine xfermask for from .

LOCKING: None.

RETURNS: Determined xfermask.

Definition at line 453 of file libata-acpi.c.

int ata_acpi_on_devcfg ( struct ata_device dev)

ata_acpi_on_devcfg - ATA ACPI hook called on device donfiguration : target ATA device

This function is called when is about to be configured. IDENTIFY data might have been modified after this hook is run.

LOCKING: EH context.

RETURNS: Positive number if IDENTIFY data needs to be refreshed, 0 if not, -errno on failure.

Definition at line 895 of file libata-acpi.c.

void ata_acpi_on_disable ( struct ata_device dev)

ata_acpi_on_disable - ATA ACPI hook called when a device is disabled : target ATA device

This function is called when is about to be disabled.

LOCKING: EH context.

Definition at line 968 of file libata-acpi.c.

void ata_acpi_on_resume ( struct ata_port ap)

ata_acpi_on_resume - ATA ACPI hook called on resume : target ATA port

This function is called when is resumed - right after port itself is resumed but before any EH action is taken.

LOCKING: EH context.

Definition at line 801 of file libata-acpi.c.

int ata_acpi_on_suspend ( struct ata_port ap)

ata_acpi_on_suspend - ATA ACPI hook called on suspend : target ATA port

This function is called when is about to be suspended. All devices are already put to sleep but the port_suspend() callback hasn't been executed yet. Error return from this function aborts suspend.

LOCKING: EH context.

RETURNS: 0 on success, -errno on failure.

Definition at line 785 of file libata-acpi.c.

int ata_acpi_register ( void  )

Definition at line 1186 of file libata-acpi.c.

void ata_acpi_set_state ( struct ata_port ap,
pm_message_t  state 
)

ata_acpi_set_state - set the port power state : target ATA port : state, on/off

This function executes the _PS0/_PS3 ACPI method to set the power state. ACPI spec requires _PS0 when IDE power on and _PS3 when power off

Definition at line 843 of file libata-acpi.c.

int ata_acpi_stm ( struct ata_port ap,
const struct ata_acpi_gtm stm 
)

ata_acpi_stm - execute _STM : target ATA port : timing parameter to _STM

Evaluate _STM with timing parameter .

LOCKING: EH context.

RETURNS: 0 on success, -ENOENT if _STM doesn't exist, -errno on failure.

Definition at line 309 of file libata-acpi.c.

void ata_acpi_unbind ( struct ata_device dev)

Definition at line 1060 of file libata-acpi.c.

void ata_acpi_unregister ( void  )

Definition at line 1191 of file libata-acpi.c.

acpi_handle ata_ap_acpi_handle ( struct ata_port ap)

ata_ap_acpi_handle - provide the acpi_handle for an ata_port : the acpi_handle returned will correspond to this port

Returns the acpi_handle for the ACPI namespace object corresponding to the ata_port passed into the function, or NULL if no such object exists

Definition at line 58 of file libata-acpi.c.

acpi_handle ata_dev_acpi_handle ( struct ata_device dev)

ata_dev_acpi_handle - provide the acpi_handle for an ata_device : the acpi_device returned will correspond to this port

Returns the acpi_handle for the ACPI namespace object corresponding to the ata_device passed into the function, or NULL if no such object exists

Definition at line 74 of file libata-acpi.c.

EXPORT_SYMBOL ( ata_ap_acpi_handle  )
EXPORT_SYMBOL ( ata_dev_acpi_handle  )
EXPORT_SYMBOL_GPL ( ata_acpi_gtm  )
EXPORT_SYMBOL_GPL ( ata_acpi_stm  )
EXPORT_SYMBOL_GPL ( ata_acpi_gtm_xfermask  )
EXPORT_SYMBOL_GPL ( ata_acpi_cbl_80wire  )
module_param_named ( acpi_gtf_filter  ,
ata_acpi_gtf_filter  ,
int  ,
0644   
)
MODULE_PARM_DESC ( acpi_gtf_filter  ,
"filter mask for ACPI _GTF  commands,
set to filter out(0x1=set xfermode, 0x2=lock/freeze lock, 0x4=DIPM, 0x8=FPDMA non-zero offset, 0x10=FPDMA DMA Setup FIS auto-activate)"   
)

Variable Documentation

unsigned int ata_acpi_gtf_filter = ATA_ACPI_FILTER_DEFAULT

Definition at line 25 of file libata-acpi.c.