1/* $Id: xdi_msg.h,v 1.1.1.1 2007/08/03 18:52:35 Exp $ */
2
3#ifndef __DIVA_XDI_UM_CFG_MESSSGE_H__
4#define __DIVA_XDI_UM_CFG_MESSAGE_H__
5
6/*
7  Definition of messages used to communicate between
8  XDI device driver and user mode configuration utility
9*/
10
11/*
12  As acknowledge one DWORD - card ordinal will be read from the card
13*/
14#define DIVA_XDI_UM_CMD_GET_CARD_ORDINAL	0
15
16/*
17  no acknowledge will be generated, memory block will be written in the
18  memory at given offset
19*/
20#define DIVA_XDI_UM_CMD_WRITE_SDRAM_BLOCK	1
21
22/*
23  no acknowledge will be genatated, FPGA will be programmed
24*/
25#define DIVA_XDI_UM_CMD_WRITE_FPGA				2
26
27/*
28  As acknowledge block of SDRAM will be read in the user buffer
29*/
30#define DIVA_XDI_UM_CMD_READ_SDRAM				3
31
32/*
33  As acknowledge dword with serial number will be read in the user buffer
34*/
35#define DIVA_XDI_UM_CMD_GET_SERIAL_NR			4
36
37/*
38  As acknowledge struct consisting from 9 dwords with PCI info.
39  dword[0...7] = 8 PCI BARS
40  dword[9]		 = IRQ
41*/
42#define DIVA_XDI_UM_CMD_GET_PCI_HW_CONFIG	5
43
44/*
45  Reset of the board + activation of primary
46  boot loader
47*/
48#define DIVA_XDI_UM_CMD_RESET_ADAPTER			6
49
50/*
51  Called after code download to start adapter
52  at specified address
53  Start does set new set of features due to fact that we not know
54  if protocol features have changed
55*/
56#define DIVA_XDI_UM_CMD_START_ADAPTER			7
57
58/*
59  Stop adapter, called if user
60  wishes to stop adapter without unload
61  of the driver, to reload adapter with
62  different protocol
63*/
64#define DIVA_XDI_UM_CMD_STOP_ADAPTER			8
65
66/*
67  Get state of current adapter
68  Acknowledge is one dword with following values:
69  0 - adapter ready for download
70  1 - adapter running
71  2 - adapter dead
72  3 - out of service, driver should be restarted or hardware problem
73*/
74#define DIVA_XDI_UM_CMD_GET_CARD_STATE		9
75
76/*
77  Reads XLOG entry from the card
78*/
79#define DIVA_XDI_UM_CMD_READ_XLOG_ENTRY		10
80
81/*
82  Set untranslated protocol code features
83  */
84#define DIVA_XDI_UM_CMD_SET_PROTOCOL_FEATURES	11
85
86typedef struct _diva_xdi_um_cfg_cmd_data_set_features {
87	dword features;
88} diva_xdi_um_cfg_cmd_data_set_features_t;
89
90typedef struct _diva_xdi_um_cfg_cmd_data_start {
91	dword offset;
92	dword features;
93} diva_xdi_um_cfg_cmd_data_start_t;
94
95typedef struct _diva_xdi_um_cfg_cmd_data_write_sdram {
96	dword ram_number;
97	dword offset;
98	dword length;
99} diva_xdi_um_cfg_cmd_data_write_sdram_t;
100
101typedef struct _diva_xdi_um_cfg_cmd_data_write_fpga {
102	dword fpga_number;
103	dword image_length;
104} diva_xdi_um_cfg_cmd_data_write_fpga_t;
105
106typedef struct _diva_xdi_um_cfg_cmd_data_read_sdram {
107	dword ram_number;
108	dword offset;
109	dword length;
110} diva_xdi_um_cfg_cmd_data_read_sdram_t;
111
112typedef union _diva_xdi_um_cfg_cmd_data {
113	diva_xdi_um_cfg_cmd_data_write_sdram_t write_sdram;
114	diva_xdi_um_cfg_cmd_data_write_fpga_t write_fpga;
115	diva_xdi_um_cfg_cmd_data_read_sdram_t read_sdram;
116	diva_xdi_um_cfg_cmd_data_start_t start;
117	diva_xdi_um_cfg_cmd_data_set_features_t features;
118} diva_xdi_um_cfg_cmd_data_t;
119
120typedef struct _diva_xdi_um_cfg_cmd {
121	dword adapter;		/* Adapter number 1...N */
122	dword command;
123	diva_xdi_um_cfg_cmd_data_t command_data;
124	dword data_length;	/* Plain binary data will follow */
125} diva_xdi_um_cfg_cmd_t;
126
127#endif
128