Subversion Repositories f9daq

Rev

Blame | Last modification | View Log | RSS feed

#ifndef __ARWPCI_H__
#define __ARWPCI_H__
 
//****************************************************************************
// Copyright (C) 2000-2005  ARW Elektronik Germany
//
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// This product is not authorized for use as critical component in
// life support systems without the express written approval of
// ARW Elektronik Germany.
//  
// Please announce changes and hints to ARW Elektronik
//
// Maintainer(s): Klaus Hitschler (klaus.hitschler@gmx.de)
//
//****************************************************************************

//****************************************************************************
//
// askpci.h - definitions for basic access functions of pci information
//
// $Log: askpci.h,v $
// Revision 1.5  2005/10/07 16:57:10  klaus
// fixed a bug with request_irq with IRQs greater than 127
//
// Revision 1.4  2004/08/12 19:59:19  klaus
// conversion to kernel-version 2.6, released version 6.0
//
// Revision 1.3  2003/05/11 11:12:03  klaus
// matched to kernel 2.4 PCI handling, debug messages improved
//
// Revision 1.2  2001/11/20 20:12:50  klaus
// included new header and CVS log
//
//
// derived from code originated from Dirk Muehlenberg         AR   18.02.2000
//
//****************************************************************************

/*--- INCLUDES -------------------------------------------------------------------------*/
#include <linux/version.h>
#include <linux/pci.h>
#include <asm/types.h>

/*--- TYPEDEFS -------------------------------------------------------------------------*/
typedef struct
{
  __u32 base_address;                                   // base address of this window
  __u32 size;                                                                   // size of this window
  __u16 type;                                                                   // io or memory
  __u16 prefetchable;                                   // is it prefetchable
} IO_DESC;

typedef struct _PCIConfigHeader
{
  short index;                                                          // consecutive index of PCI devices
       
  __u16 device_id;                                              // PCI device id
  __u16 vendor_id;                                              // PCI vendor id
  __u16 subsystem_id;                                   // PCI subsystem device id
  __u16 subsystem_vendor_id;    // PCI subvendor id
 
  IO_DESC desc[6];                                              // address descriptors
       
        struct pci_dev *PCI_dev;                // pointer to linux managed PCI device
} PCIConfigHeader;

/*--- PROTOTYPES -------------------------------------------------------------------------*/
PCIConfigHeader *GetPCIConfigHeader(__u16 vendor_id, __u16 device_id, short index);

#endif  /* __ARWPCI_H__ */