Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
msi.c File Reference
#include <linux/err.h>
#include <linux/mm.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/proc_fs.h>
#include <linux/msi.h>
#include <linux/smp.h>
#include <linux/errno.h>
#include <linux/io.h>
#include <linux/slab.h>
#include "pci.h"
#include "msi.h"

Go to the source code of this file.

Data Structures

struct  msi_attribute
 

Macros

#define arch_setup_msi_irqs   default_setup_msi_irqs
 
#define HAVE_DEFAULT_MSI_SETUP_IRQS
 
#define arch_teardown_msi_irqs   default_teardown_msi_irqs
 
#define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
 
#define arch_restore_msi_irqs   default_restore_msi_irqs
 
#define HAVE_DEFAULT_MSI_RESTORE_IRQS
 
#define to_msi_attr(obj)   container_of(obj, struct msi_attribute, attr)
 
#define to_msi_desc(obj)   container_of(obj, struct msi_desc, kobj)
 

Functions

int arch_msi_check_device (struct pci_dev *dev, int nvec, int type)
 
int default_setup_msi_irqs (struct pci_dev *dev, int nvec, int type)
 
void default_teardown_msi_irqs (struct pci_dev *dev)
 
void default_restore_msi_irqs (struct pci_dev *dev, int irq)
 
void mask_msi_irq (struct irq_data *data)
 
void unmask_msi_irq (struct irq_data *data)
 
void __read_msi_msg (struct msi_desc *entry, struct msi_msg *msg)
 
void read_msi_msg (unsigned int irq, struct msi_msg *msg)
 
void __get_cached_msi_msg (struct msi_desc *entry, struct msi_msg *msg)
 
void get_cached_msi_msg (unsigned int irq, struct msi_msg *msg)
 
void __write_msi_msg (struct msi_desc *entry, struct msi_msg *msg)
 
void write_msi_msg (unsigned int irq, struct msi_msg *msg)
 
void pci_restore_msi_state (struct pci_dev *dev)
 
 EXPORT_SYMBOL_GPL (pci_restore_msi_state)
 
void msi_kobj_release (struct kobject *kobj)
 
int pci_enable_msi_block (struct pci_dev *dev, unsigned int nvec)
 
 EXPORT_SYMBOL (pci_enable_msi_block)
 
void pci_msi_shutdown (struct pci_dev *dev)
 
void pci_disable_msi (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pci_disable_msi)
 
int pci_msix_table_size (struct pci_dev *dev)
 
int pci_enable_msix (struct pci_dev *dev, struct msix_entry *entries, int nvec)
 
 EXPORT_SYMBOL (pci_enable_msix)
 
void pci_msix_shutdown (struct pci_dev *dev)
 
void pci_disable_msix (struct pci_dev *dev)
 
 EXPORT_SYMBOL (pci_disable_msix)
 
void msi_remove_pci_irq_vectors (struct pci_dev *dev)
 
void pci_no_msi (void)
 
int pci_msi_enabled (void)
 
 EXPORT_SYMBOL (pci_msi_enabled)
 
void pci_msi_init_pci_dev (struct pci_dev *dev)
 

Variables

struct attributemsi_irq_default_attrs []
 

Macro Definition Documentation

#define arch_restore_msi_irqs   default_restore_msi_irqs

Definition at line 90 of file msi.c.

#define arch_setup_msi_irqs   default_setup_msi_irqs

Definition at line 39 of file msi.c.

#define arch_teardown_msi_irqs   default_teardown_msi_irqs

Definition at line 69 of file msi.c.

#define HAVE_DEFAULT_MSI_RESTORE_IRQS

Definition at line 91 of file msi.c.

#define HAVE_DEFAULT_MSI_SETUP_IRQS

Definition at line 40 of file msi.c.

#define HAVE_DEFAULT_MSI_TEARDOWN_IRQS

Definition at line 70 of file msi.c.

#define to_msi_attr (   obj)    container_of(obj, struct msi_attribute, attr)

Definition at line 444 of file msi.c.

#define to_msi_desc (   obj)    container_of(obj, struct msi_desc, kobj)

Definition at line 445 of file msi.c.

Function Documentation

void __get_cached_msi_msg ( struct msi_desc entry,
struct msi_msg msg 
)

Definition at line 270 of file msi.c.

void __read_msi_msg ( struct msi_desc entry,
struct msi_msg msg 
)

Definition at line 233 of file msi.c.

void __write_msi_msg ( struct msi_desc entry,
struct msi_msg msg 
)

Definition at line 287 of file msi.c.

int arch_msi_check_device ( struct pci_dev dev,
int  nvec,
int  type 
)

Definition at line 32 of file msi.c.

void default_restore_msi_irqs ( struct pci_dev dev,
int  irq 
)

Definition at line 95 of file msi.c.

int default_setup_msi_irqs ( struct pci_dev dev,
int  nvec,
int  type 
)

Definition at line 44 of file msi.c.

void default_teardown_msi_irqs ( struct pci_dev dev)

Definition at line 74 of file msi.c.

EXPORT_SYMBOL ( pci_enable_msi_block  )
EXPORT_SYMBOL ( pci_disable_msi  )
EXPORT_SYMBOL ( pci_enable_msix  )
EXPORT_SYMBOL ( pci_disable_msix  )
EXPORT_SYMBOL ( pci_msi_enabled  )
EXPORT_SYMBOL_GPL ( pci_restore_msi_state  )
void get_cached_msi_msg ( unsigned int  irq,
struct msi_msg msg 
)

Definition at line 280 of file msi.c.

void mask_msi_irq ( struct irq_data data)

Definition at line 223 of file msi.c.

void msi_kobj_release ( struct kobject kobj)

Definition at line 486 of file msi.c.

void msi_remove_pci_irq_vectors ( struct pci_dev dev)

msi_remove_pci_irq_vectors - reclaim MSI(X) irqs to unused state : pointer to the pci_dev data structure of MSI(X) device function

Being called during hotplug remove, from which the device function is hot-removed. All previous assigned MSI/MSI-X irqs, if allocated for this device function, are reclaimed to unused state, which may be used later on.

Definition at line 991 of file msi.c.

void pci_disable_msi ( struct pci_dev dev)

Definition at line 870 of file msi.c.

void pci_disable_msix ( struct pci_dev dev)

Definition at line 970 of file msi.c.

int pci_enable_msi_block ( struct pci_dev dev,
unsigned int  nvec 
)

pci_enable_msi_block - configure device's MSI capability structure : device to configure : number of interrupts to configure

Allocate IRQs for a device with the MSI capability. This function returns a negative errno if an error occurs. If it is unable to allocate the number of interrupts requested, it returns the number of interrupts it might be able to allocate. If it successfully allocates at least the number of interrupts requested, it returns 0 and updates the 's irq member to the lowest new interrupt number; the other interrupt numbers allocated to this device are consecutive.

Definition at line 811 of file msi.c.

int pci_enable_msix ( struct pci_dev dev,
struct msix_entry *  entries,
int  nvec 
)

pci_enable_msix - configure device's MSI-X capability structure : pointer to the pci_dev data structure of MSI-X device function : pointer to an array of MSI-X entries : number of MSI-X irqs requested for allocation by device driver

Setup the MSI-X capability structure of device function with the number of requested irqs upon its software driver call to request for MSI-X mode enabled on its hardware device function. A return of zero indicates the successful configuration of MSI-X capability structure with new allocated MSI-X irqs. A return of < 0 indicates a failure. Or a return of > 0 indicates that driver request is exceeding the number of irqs or MSI-X vectors available. Driver should use the returned value to re-send its request.

Definition at line 914 of file msi.c.

int pci_msi_enabled ( void  )

pci_msi_enabled - is MSI enabled?

Returns true if MSI has not been disabled by the command-line option pci=nomsi.

Definition at line 1011 of file msi.c.

void pci_msi_init_pci_dev ( struct pci_dev dev)

Definition at line 1017 of file msi.c.

void pci_msi_shutdown ( struct pci_dev dev)

Definition at line 842 of file msi.c.

void pci_msix_shutdown ( struct pci_dev dev)

Definition at line 952 of file msi.c.

int pci_msix_table_size ( struct pci_dev dev)

pci_msix_table_size - return the number of device's MSI-X table entries : pointer to the pci_dev data structure of MSI-X device function

Definition at line 886 of file msi.c.

void pci_no_msi ( void  )

Definition at line 1000 of file msi.c.

void pci_restore_msi_state ( struct pci_dev dev)

Definition at line 436 of file msi.c.

void read_msi_msg ( unsigned int  irq,
struct msi_msg msg 
)

Definition at line 263 of file msi.c.

void unmask_msi_irq ( struct irq_data data)

Definition at line 228 of file msi.c.

void write_msi_msg ( unsigned int  irq,
struct msi_msg msg 
)

Definition at line 324 of file msi.c.

Variable Documentation

struct attribute* msi_irq_default_attrs[]
Initial value:
= {
&mode_attribute.attr,
}

Definition at line 481 of file msi.c.