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

Go to the source code of this file.

Data Structures

struct  GTM_buffer
 
struct  ide_acpi_drive_link
 
struct  ide_acpi_hwif_link
 

Macros

#define REGS_PER_GTF   7
 
#define DEBPRINT(fmt, args...)   do {} while (0)
 

Functions

 module_param_named (noacpi, ide_noacpi, bool, 0)
 
 MODULE_PARM_DESC (noacpi,"disable IDE ACPI support")
 
 module_param_named (acpigtf, ide_acpigtf, bool, 0)
 
 MODULE_PARM_DESC (acpigtf,"enable IDE ACPI _GTF support")
 
 module_param_named (acpionboot, ide_acpionboot, bool, 0)
 
 MODULE_PARM_DESC (acpionboot,"call IDE ACPI methods on boot")
 
int ide_acpi_init (void)
 
bool ide_port_acpi (ide_hwif_t *hwif)
 
int ide_acpi_exec_tfs (ide_drive_t *drive)
 
void ide_acpi_get_timing (ide_hwif_t *hwif)
 
void ide_acpi_push_timing (ide_hwif_t *hwif)
 
void ide_acpi_set_state (ide_hwif_t *hwif, int on)
 
void ide_acpi_init_port (ide_hwif_t *hwif)
 
void ide_acpi_port_init_devices (ide_hwif_t *hwif)
 

Macro Definition Documentation

#define DEBPRINT (   fmt,
  args... 
)    do {} while (0)

Definition at line 53 of file ide-acpi.c.

#define REGS_PER_GTF   7

Definition at line 24 of file ide-acpi.c.

Function Documentation

int ide_acpi_exec_tfs ( ide_drive_t drive)

ide_acpi_exec_tfs - get then write drive taskfile settings : the drive for which the taskfile settings should be written.

According to the ACPI spec this should be called after _STM has been evaluated for the interface. Some ACPI vendors interpret that as a hard requirement and modify the taskfile according to the Identify Drive information passed down with _STM. So one should really make sure to call this only after _STM has been executed.

Definition at line 352 of file ide-acpi.c.

void ide_acpi_get_timing ( ide_hwif_t hwif)

ide_acpi_get_timing - get the channel (controller) timings : target IDE interface (channel)

This function executes the _GTM ACPI method for the target channel.

Definition at line 387 of file ide-acpi.c.

int ide_acpi_init ( void  )

Definition at line 91 of file ide-acpi.c.

void ide_acpi_init_port ( ide_hwif_t hwif)

ide_acpi_init_port - initialize the ACPI link for an IDE interface : target IDE interface (channel)

The ACPI spec is not quite clear when the drive identify buffer should be obtained. Calling IDENTIFY DEVICE during shutdown is not the best of ideas as the drive might already being put to sleep. And obviously we can't call it during resume. So we get the information during startup; but this means that any changes during run-time will be lost after resume.

Definition at line 541 of file ide-acpi.c.

void ide_acpi_port_init_devices ( ide_hwif_t hwif)

Definition at line 555 of file ide-acpi.c.

void ide_acpi_push_timing ( ide_hwif_t hwif)

ide_acpi_push_timing - set the channel (controller) timings : target IDE interface (channel)

This function executes the _STM ACPI method for the target channel.

_STM requires Identify Drive data, which has to passed as an argument. Unfortunately drive->id is a mangled version which we can't readily use; hence we'll get the information afresh.

Definition at line 465 of file ide-acpi.c.

void ide_acpi_set_state ( ide_hwif_t hwif,
int  on 
)

ide_acpi_set_state - set the channel power state : target IDE interface : 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 506 of file ide-acpi.c.

bool ide_port_acpi ( ide_hwif_t hwif)

Definition at line 97 of file ide-acpi.c.

module_param_named ( noacpi  ,
ide_noacpi  ,
bool  ,
 
)
module_param_named ( acpigtf  ,
ide_acpigtf  ,
bool  ,
 
)
module_param_named ( acpionboot  ,
ide_acpionboot  ,
bool  ,
 
)
MODULE_PARM_DESC ( noacpi  ,
"disable IDE ACPI support  
)
MODULE_PARM_DESC ( acpigtf  ,
"enable IDE ACPI _GTF support  
)
MODULE_PARM_DESC ( acpionboot  ,
"call IDE ACPI methods on boot"   
)