Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
drivers.c File Reference
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/export.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/pdc.h>
#include <asm/parisc-device.h>

Go to the source code of this file.

Data Structures

struct  recurse_struct
 
struct  match_count
 
struct  find_data
 
struct  match_id_data
 
struct  parse_tree_data
 

Macros

#define pa_dev_attr(name, field, format_string)
 
#define pa_dev_attr_id(field, format)   pa_dev_attr(field, id.field, format)
 
#define BC_PORT_MASK   0x8
 
#define BC_LOWER_PORT   0x8
 
#define BUS_CONVERTER(dev)   ((dev->id.hw_type == HPHW_IOA) || (dev->id.hw_type == HPHW_BCPORT))
 
#define IS_LOWER_PORT(dev)
 
#define MAX_NATIVE_DEVICES   64
 
#define NATIVE_DEVICE_OFFSET   0x1000
 
#define FLEX_MASK   F_EXTEND(0xfffc0000)
 
#define IO_IO_LOW   offsetof(struct bc_module, io_io_low)
 
#define IO_IO_HIGH   offsetof(struct bc_module, io_io_high)
 
#define READ_IO_IO_LOW(dev)   (unsigned long)(signed int)gsc_readl(dev->hpa.start + IO_IO_LOW)
 
#define READ_IO_IO_HIGH(dev)   (unsigned long)(signed int)gsc_readl(dev->hpa.start + IO_IO_HIGH)
 
#define CENTRAL_BUS_ADDR   F_EXTEND(0xfff80000)
 

Functions

 EXPORT_SYMBOL (hppa_dma_ops)
 
int register_parisc_driver (struct parisc_driver *driver)
 
 EXPORT_SYMBOL (register_parisc_driver)
 
int count_parisc_driver (struct parisc_driver *driver)
 
int unregister_parisc_driver (struct parisc_driver *driver)
 
 EXPORT_SYMBOL (unregister_parisc_driver)
 
struct parisc_devicefind_pa_parent_type (const struct parisc_device *padev, int type)
 
charprint_pa_hwpath (struct parisc_device *dev, char *output)
 
 EXPORT_SYMBOL (print_pa_hwpath)
 
struct parisc_devicecreate_tree_node (char id, struct device *parent)
 
struct parisc_devicealloc_pa_dev (unsigned long hpa, struct hardware_path *mod_path)
 
 pa_dev_attr (irq, irq,"%u\n")
 
 pa_dev_attr_id (hw_type,"0x%02x\n")
 
 pa_dev_attr (rev, id.hversion_rev,"0x%x\n")
 
 pa_dev_attr_id (hversion,"0x%03x\n")
 
 pa_dev_attr_id (sversion,"0x%05x\n")
 
int register_parisc_device (struct parisc_device *dev)
 
struct devicehwpath_to_device (struct hardware_path *modpath)
 
 EXPORT_SYMBOL (hwpath_to_device)
 
void device_to_hwpath (struct device *dev, struct hardware_path *path)
 
 EXPORT_SYMBOL (device_to_hwpath)
 
void walk_lower_bus (struct parisc_device *dev)
 
void walk_central_bus (void)
 
void init_parisc_bus (void)
 
void print_parisc_devices (void)
 

Variables

struct hppa_dma_ops *hppa_dma_ops __read_mostly
 
struct bus_type parisc_bus_type
 

Macro Definition Documentation

#define BC_LOWER_PORT   0x8

Definition at line 782 of file drivers.c.

#define BC_PORT_MASK   0x8

Definition at line 781 of file drivers.c.

#define BUS_CONVERTER (   dev)    ((dev->id.hw_type == HPHW_IOA) || (dev->id.hw_type == HPHW_BCPORT))

Definition at line 784 of file drivers.c.

#define CENTRAL_BUS_ADDR   F_EXTEND(0xfff80000)

Definition at line 861 of file drivers.c.

#define FLEX_MASK   F_EXTEND(0xfffc0000)

Definition at line 794 of file drivers.c.

#define IO_IO_HIGH   offsetof(struct bc_module, io_io_high)

Definition at line 796 of file drivers.c.

#define IO_IO_LOW   offsetof(struct bc_module, io_io_low)

Definition at line 795 of file drivers.c.

#define IS_LOWER_PORT (   dev)
Value:
((gsc_readl(dev->hpa.start + offsetof(struct bc_module, io_status)) \

Definition at line 787 of file drivers.c.

#define MAX_NATIVE_DEVICES   64

Definition at line 791 of file drivers.c.

#define NATIVE_DEVICE_OFFSET   0x1000

Definition at line 792 of file drivers.c.

#define pa_dev_attr (   name,
  field,
  format_string 
)
Value:
static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \
{ \
return sprintf(buf, format_string, padev->field); \
}

Definition at line 585 of file drivers.c.

#define pa_dev_attr_id (   field,
  format 
)    pa_dev_attr(field, id.field, format)

Definition at line 592 of file drivers.c.

#define READ_IO_IO_HIGH (   dev)    (unsigned long)(signed int)gsc_readl(dev->hpa.start + IO_IO_HIGH)

Definition at line 798 of file drivers.c.

#define READ_IO_IO_LOW (   dev)    (unsigned long)(signed int)gsc_readl(dev->hpa.start + IO_IO_LOW)

Definition at line 797 of file drivers.c.

Function Documentation

struct parisc_device* alloc_pa_dev ( unsigned long  hpa,
struct hardware_path mod_path 
)
read

Definition at line 487 of file drivers.c.

int count_parisc_driver ( struct parisc_driver driver)

count_parisc_driver - count # of devices this driver would match : the PA-RISC driver to try

Use by IOMMU support to "guess" the right size IOPdir. Formula is something like memsize/(num_iommu * entry_size).

Definition at line 208 of file drivers.c.

struct parisc_device* create_tree_node ( char  id,
struct device parent 
)
read

Definition at line 412 of file drivers.c.

void device_to_hwpath ( struct device dev,
struct hardware_path path 
)

device_to_hwpath - Populates the hwpath corresponding to the given device.

Parameters
devthe target device
pathpointer to a previously allocated hwpath struct to be filled in

Definition at line 768 of file drivers.c.

EXPORT_SYMBOL ( hppa_dma_ops  )
EXPORT_SYMBOL ( register_parisc_driver  )
EXPORT_SYMBOL ( unregister_parisc_driver  )
EXPORT_SYMBOL ( print_pa_hwpath  )
EXPORT_SYMBOL ( hwpath_to_device  )
EXPORT_SYMBOL ( device_to_hwpath  )
struct parisc_device* find_pa_parent_type ( const struct parisc_device padev,
int  type 
)
read

find_pa_parent_type - Find a parent of a specific type : The device to start searching from : The device type to search for.

Walks up the device tree looking for a device of the specified type. If it finds it, it returns it. If not, it returns NULL.

Definition at line 272 of file drivers.c.

struct device* hwpath_to_device ( struct hardware_path modpath)
read

hwpath_to_device - Finds the generic device corresponding to a given hardware path. : the hardware path.

Returns
: The target device, NULL if not found.

Definition at line 745 of file drivers.c.

void init_parisc_bus ( void  )

init_parisc_bus - Some preparation to be done before inventory

Definition at line 898 of file drivers.c.

pa_dev_attr ( irq  ,
irq  ,
"%u\n"   
)
pa_dev_attr ( rev  ,
id.  hversion_rev,
"0x%x\n"   
)
pa_dev_attr_id ( hw_type  ,
"0x%02x\n"   
)
pa_dev_attr_id ( hversion  ,
"0x%03x\n"   
)
pa_dev_attr_id ( sversion  ,
"0x%05x\n"   
)
char* print_pa_hwpath ( struct parisc_device dev,
char output 
)

print_pa_hwpath - Returns hardware path for PA devices dev: The device to return the path for output: Pointer to a previously-allocated array to place the path in.

This function fills in the output array with a human-readable path to a PA device. This string is compatible with that used by PDC, and may be printed on the outside of the box.

Definition at line 348 of file drivers.c.

void print_parisc_devices ( void  )

print_parisc_devices - Print out a list of devices found in this system

Definition at line 920 of file drivers.c.

int register_parisc_device ( struct parisc_device dev)

register_parisc_device - Locate a driver to manage this device. : The parisc device.

Search the driver list for a driver that is willing to manage this device.

Definition at line 631 of file drivers.c.

int register_parisc_driver ( struct parisc_driver driver)

register_parisc_driver - Register this driver if it can handle a device : the PA-RISC driver to try

Definition at line 153 of file drivers.c.

int unregister_parisc_driver ( struct parisc_driver driver)

unregister_parisc_driver - Unregister this driver from the list of drivers : the PA-RISC driver to unregister

Definition at line 226 of file drivers.c.

void walk_central_bus ( void  )

walk_central_bus - Find devices attached to the central bus

PDC doesn't tell us about all devices in the system. This routine finds devices connected to the central bus.

Definition at line 869 of file drivers.c.

void walk_lower_bus ( struct parisc_device dev)

Definition at line 803 of file drivers.c.

Variable Documentation

Definition at line 43 of file drivers.c.

struct bus_type parisc_bus_type
Initial value:
= {
.name = "parisc",
.match = parisc_generic_match,
.uevent = parisc_uevent,
.dev_attrs = parisc_device_attrs,
.probe = parisc_driver_probe,
.remove = parisc_driver_remove,
}

Definition at line 615 of file drivers.c.