ia64/linux-2.6.18-xen.hg

diff drivers/char/rio/cmdpkt.h @ 0:831230e53067

Import 2.6.18 from kernel.org tarball.
author Ian Campbell <ian.campbell@xensource.com>
date Wed Apr 11 14:15:44 2007 +0100 (2007-04-11)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/drivers/char/rio/cmdpkt.h	Wed Apr 11 14:15:44 2007 +0100
     1.3 @@ -0,0 +1,183 @@
     1.4 +/*
     1.5 +** -----------------------------------------------------------------------------
     1.6 +**
     1.7 +**  Perle Specialix driver for Linux
     1.8 +**  Ported from existing RIO Driver for SCO sources.
     1.9 + *
    1.10 + *  (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
    1.11 + *
    1.12 + *      This program is free software; you can redistribute it and/or modify
    1.13 + *      it under the terms of the GNU General Public License as published by
    1.14 + *      the Free Software Foundation; either version 2 of the License, or
    1.15 + *      (at your option) any later version.
    1.16 + *
    1.17 + *      This program is distributed in the hope that it will be useful,
    1.18 + *      but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.19 + *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.20 + *      GNU General Public License for more details.
    1.21 + *
    1.22 + *      You should have received a copy of the GNU General Public License
    1.23 + *      along with this program; if not, write to the Free Software
    1.24 + *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    1.25 +**
    1.26 +**	Module		: cmdpkt.h
    1.27 +**	SID		: 1.2
    1.28 +**	Last Modified	: 11/6/98 11:34:09
    1.29 +**	Retrieved	: 11/6/98 11:34:20
    1.30 +**
    1.31 +**  ident @(#)cmdpkt.h	1.2
    1.32 +**
    1.33 +** -----------------------------------------------------------------------------
    1.34 +*/
    1.35 +#ifndef __rio_cmdpkt_h__
    1.36 +#define __rio_cmdpkt_h__
    1.37 +
    1.38 +#ifdef SCCS_LABELS
    1.39 +#ifndef lint
    1.40 +static char *_cmdpkt_h_sccs_ = "@(#)cmdpkt.h	1.2";
    1.41 +#endif
    1.42 +#endif
    1.43 +
    1.44 +/*
    1.45 +** overlays for the data area of a packet. Used in both directions
    1.46 +** (to build a packet to send, and to interpret a packet that arrives)
    1.47 +** and is very inconvenient for MIPS, so they appear as two separate
    1.48 +** structures - those used for modifying/reading packets on the card
    1.49 +** and those for modifying/reading packets in real memory, which have an _M
    1.50 +** suffix.
    1.51 +*/
    1.52 +
    1.53 +#define	RTA_BOOT_DATA_SIZE (PKT_MAX_DATA_LEN-2)
    1.54 +
    1.55 +/*
    1.56 +** The boot information packet looks like this:
    1.57 +** This structure overlays a PktCmd->CmdData structure, and so starts
    1.58 +** at Data[2] in the actual pkt!
    1.59 +*/
    1.60 +struct BootSequence {
    1.61 +	u16 NumPackets;
    1.62 +	u16 LoadBase;
    1.63 +	u16 CodeSize;
    1.64 +};
    1.65 +
    1.66 +#define	BOOT_SEQUENCE_LEN	8
    1.67 +
    1.68 +struct SamTop {
    1.69 +	u8 Unit;
    1.70 +	u8 Link;
    1.71 +};
    1.72 +
    1.73 +struct CmdHdr {
    1.74 +	u8 PcCommand;
    1.75 +	union {
    1.76 +		u8 PcPhbNum;
    1.77 +		u8 PcLinkNum;
    1.78 +		u8 PcIDNum;
    1.79 +	} U0;
    1.80 +};
    1.81 +
    1.82 +
    1.83 +struct PktCmd {
    1.84 +	union {
    1.85 +		struct {
    1.86 +			struct CmdHdr CmdHdr;
    1.87 +			struct BootSequence PcBootSequence;
    1.88 +		} S1;
    1.89 +		struct {
    1.90 +			u16 PcSequence;
    1.91 +			u8 PcBootData[RTA_BOOT_DATA_SIZE];
    1.92 +		} S2;
    1.93 +		struct {
    1.94 +			u16 __crud__;
    1.95 +			u8 PcUniqNum[4];	/* this is really a uint. */
    1.96 +			u8 PcModuleTypes;	/* what modules are fitted */
    1.97 +		} S3;
    1.98 +		struct {
    1.99 +			struct CmdHdr CmdHdr;
   1.100 +			u8 __undefined__;
   1.101 +			u8 PcModemStatus;
   1.102 +			u8 PcPortStatus;
   1.103 +			u8 PcSubCommand;	/* commands like mem or register dump */
   1.104 +			u16 PcSubAddr;	/* Address for command */
   1.105 +			u8 PcSubData[64];	/* Date area for command */
   1.106 +		} S4;
   1.107 +		struct {
   1.108 +			struct CmdHdr CmdHdr;
   1.109 +			u8 PcCommandText[1];
   1.110 +			u8 __crud__[20];
   1.111 +			u8 PcIDNum2;	/* It had to go somewhere! */
   1.112 +		} S5;
   1.113 +		struct {
   1.114 +			struct CmdHdr CmdHdr;
   1.115 +			struct SamTop Topology[LINKS_PER_UNIT];
   1.116 +		} S6;
   1.117 +	} U1;
   1.118 +};
   1.119 +
   1.120 +struct PktCmd_M {
   1.121 +	union {
   1.122 +		struct {
   1.123 +			struct {
   1.124 +				u8 PcCommand;
   1.125 +				union {
   1.126 +					u8 PcPhbNum;
   1.127 +					u8 PcLinkNum;
   1.128 +					u8 PcIDNum;
   1.129 +				} U0;
   1.130 +			} CmdHdr;
   1.131 +			struct {
   1.132 +				u16 NumPackets;
   1.133 +				u16 LoadBase;
   1.134 +				u16 CodeSize;
   1.135 +			} PcBootSequence;
   1.136 +		} S1;
   1.137 +		struct {
   1.138 +			u16 PcSequence;
   1.139 +			u8 PcBootData[RTA_BOOT_DATA_SIZE];
   1.140 +		} S2;
   1.141 +		struct {
   1.142 +			u16 __crud__;
   1.143 +			u8 PcUniqNum[4];	/* this is really a uint. */
   1.144 +			u8 PcModuleTypes;	/* what modules are fitted */
   1.145 +		} S3;
   1.146 +		struct {
   1.147 +			u16 __cmd_hdr__;
   1.148 +			u8 __undefined__;
   1.149 +			u8 PcModemStatus;
   1.150 +			u8 PcPortStatus;
   1.151 +			u8 PcSubCommand;
   1.152 +			u16 PcSubAddr;
   1.153 +			u8 PcSubData[64];
   1.154 +		} S4;
   1.155 +		struct {
   1.156 +			u16 __cmd_hdr__;
   1.157 +			u8 PcCommandText[1];
   1.158 +			u8 __crud__[20];
   1.159 +			u8 PcIDNum2;	/* Tacked on end */
   1.160 +		} S5;
   1.161 +		struct {
   1.162 +			u16 __cmd_hdr__;
   1.163 +			struct Top Topology[LINKS_PER_UNIT];
   1.164 +		} S6;
   1.165 +	} U1;
   1.166 +};
   1.167 +
   1.168 +#define Command		U1.S1.CmdHdr.PcCommand
   1.169 +#define PhbNum		U1.S1.CmdHdr.U0.PcPhbNum
   1.170 +#define IDNum		U1.S1.CmdHdr.U0.PcIDNum
   1.171 +#define IDNum2		U1.S5.PcIDNum2
   1.172 +#define LinkNum		U1.S1.CmdHdr.U0.PcLinkNum
   1.173 +#define Sequence	U1.S2.PcSequence
   1.174 +#define BootData	U1.S2.PcBootData
   1.175 +#define BootSequence	U1.S1.PcBootSequence
   1.176 +#define UniqNum		U1.S3.PcUniqNum
   1.177 +#define ModemStatus	U1.S4.PcModemStatus
   1.178 +#define PortStatus	U1.S4.PcPortStatus
   1.179 +#define SubCommand	U1.S4.PcSubCommand
   1.180 +#define SubAddr		U1.S4.PcSubAddr
   1.181 +#define SubData		U1.S4.PcSubData
   1.182 +#define CommandText	U1.S5.PcCommandText
   1.183 +#define RouteTopology	U1.S6.Topology
   1.184 +#define ModuleTypes	U1.S3.PcModuleTypes
   1.185 +
   1.186 +#endif