2005-04-16 15:20:36 -07:00
/*
* * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* *
* * Perle Specialix driver for Linux
* * Ported from existing RIO Driver for SCO sources .
*
* ( C ) 1990 - 2000 Specialix International Ltd . , Byfleet , Surrey , UK .
*
* 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 0213 9 , USA .
* *
* * Module : host . h
* * SID : 1.2
* * Last Modified : 11 / 6 / 98 11 : 34 : 10
* * Retrieved : 11 / 6 / 98 11 : 34 : 21
* *
* * ident @ ( # ) host . h 1.2
* *
* * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
# ifndef __rio_host_h__
# define __rio_host_h__
/*
* * the host structure - one per host card in the system .
*/
# define MAX_EXTRA_UNITS 64
/*
* * Host data structure . This is used for the software equiv . of
* * the host .
*/
2006-01-11 12:17:49 -08:00
struct Host {
2006-10-21 10:24:01 -07:00
struct pci_dev * pdev ;
2006-03-24 03:18:26 -08:00
unsigned char Type ; /* RIO_EISA, RIO_MCA, ... */
unsigned char Ivec ; /* POLLED or ivec number */
unsigned char Mode ; /* Control stuff */
unsigned char Slot ; /* Slot */
2006-05-27 00:08:25 -04:00
void __iomem * Caddr ; /* KV address of DPRAM */
struct DpRam __iomem * CardP ; /* KV address of DPRAM, with overlay */
2006-03-24 03:18:31 -08:00
unsigned long PaddrP ; /* Phys. address of DPRAM */
2006-01-11 12:17:49 -08:00
char Name [ MAX_NAME_LEN ] ; /* The name of the host */
2006-03-24 03:18:26 -08:00
unsigned int UniqueNum ; /* host unique number */
2006-01-11 12:17:49 -08:00
spinlock_t HostLock ; /* Lock structure for MPX */
2006-03-24 03:18:26 -08:00
unsigned int WorkToBeDone ; /* set to true each interrupt */
unsigned int InIntr ; /* Being serviced? */
unsigned int IntSrvDone ; /* host's interrupt has been serviced */
2006-05-27 00:08:25 -04:00
void ( * Copy ) ( void * , void __iomem * , int ) ; /* copy func */
2006-01-11 12:17:49 -08:00
struct timer_list timer ;
/*
* * I M P O R T A N T !
* *
* * The rest of this data structure is cleared to zero after
* * a RIO_HOST_FOAD command .
*/
2006-03-24 03:18:26 -08:00
unsigned long Flags ; /* Whats going down */
2005-04-16 15:20:36 -07:00
# define RC_WAITING 0
# define RC_STARTUP 1
# define RC_RUNNING 2
# define RC_STUFFED 3
# define RC_READY 7
# define RUN_STATE 7
/*
* * Boot mode applies to the way in which hosts in this system will
* * boot RTAs
*/
2006-03-24 03:18:26 -08:00
# define RC_BOOT_ALL 0x8 /* Boot all RTAs attached */
# define RC_BOOT_OWN 0x10 /* Only boot RTAs bound to this system */
# define RC_BOOT_NONE 0x20 /* Don't boot any RTAs (slave mode) */
2005-04-16 15:20:36 -07:00
2006-01-11 12:17:49 -08:00
struct Top Topology [ LINKS_PER_UNIT ] ; /* one per link */
2006-03-24 03:18:26 -08:00
struct Map Mapping [ MAX_RUP ] ; /* Mappings for host */
2006-05-27 00:08:25 -04:00
struct PHB __iomem * PhbP ; /* Pointer to the PHB array */
unsigned short __iomem * PhbNumP ; /* Ptr to Number of PHB's */
struct LPB __iomem * LinkStrP ; /* Link Structure Array */
struct RUP __iomem * RupP ; /* Sixteen real rups here */
struct PARM_MAP __iomem * ParmMapP ; /* points to the parmmap */
2006-03-24 03:18:26 -08:00
unsigned int ExtraUnits [ MAX_EXTRA_UNITS ] ; /* unknown things */
unsigned int NumExtraBooted ; /* how many of the above */
2006-01-11 12:17:49 -08:00
/*
* * Twenty logical rups .
* * The first sixteen are the real Rup entries ( above ) , the last four
* * are the link RUPs .
*/
struct UnixRup UnixRups [ MAX_RUP + LINKS_PER_UNIT ] ;
2006-03-24 03:18:26 -08:00
int timeout_id ; /* For calling 100 ms delays */
int timeout_sem ; /* For calling 100 ms delays */
long locks ; /* long req'd for set_bit --RR */
2006-01-11 12:17:49 -08:00
char ____end_marker____ ;
2005-04-16 15:20:36 -07:00
} ;
# define Control CardP->DpControl
# define SetInt CardP->DpSetInt
# define ResetTpu CardP->DpResetTpu
# define ResetInt CardP->DpResetInt
# define Signature CardP->DpSignature
# define Sram1 CardP->DpSram1
# define Sram2 CardP->DpSram2
# define Sram3 CardP->DpSram3
# define Scratch CardP->DpScratch
# define __ParmMapR CardP->DpParmMapR
# define SLX CardP->DpSlx
# define Revision CardP->DpRevision
# define Unique CardP->DpUnique
# define Year CardP->DpYear
# define Week CardP->DpWeek
2006-01-11 12:17:49 -08:00
# define RIO_DUMBPARM 0x0860 /* what not to expect */
2005-04-16 15:20:36 -07:00
# endif