heci_data_structures.h revision 617e2443dfc17fe44fd44c0675d6aad2ffc9df42
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Part of Intel(R) Manageability Engine Interface Linux driver
*
* Copyright (c) 2003 - 2008 Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
*/
#ifndef _HECI_DATA_STRUCTURES_H_
#define _HECI_DATA_STRUCTURES_H_
#ifndef SUNOS
#define SUNOS
#endif
/*
* error code definition
*/
#define ESLOTS_OVERFLOW 1
#define ECORRUPTED_MESSAGE_HEADER 1000
#define ECOMPLETE_MESSAGE 1001
#define HECI_FC_MESSAGE_RESERVED_LENGTH 5
/*
* Number of queue lists used by this driver
*/
#define HECI_IO_LISTS_NUMBER 7
/*
* Maximum transmission unit (MTU) of heci messages
*/
#define IAMTHIF_MTU 4160
#pragma pack(1)
/*
* HECI HW Section
*/
/* HECI registers */
/* H_CB_WW - Host Circular Buffer (CB) Write Window register */
#define H_CB_WW 0
/* H_CSR - Host Control Status register */
#define H_CSR 4
/* ME_CB_RW - ME Circular Buffer Read Window register (read only) */
#define ME_CB_RW 8
/* ME_CSR_HA - ME Control Status Host Access register (read only) */
#define ME_CSR_HA 0xC
/* register bits of H_CSR (Host Control Status register) */
/* Host Circular Buffer Depth - maximum number of 32-bit entries in CB */
#define H_CBD 0xFF000000
/* Host Circular Buffer Write Pointer */
#define H_CBWP 0x00FF0000
/* Host Circular Buffer Read Pointer */
#define H_CBRP 0x0000FF00
/* Host Reset */
#define H_RST 0x00000010
/* Host Ready */
#define H_RDY 0x00000008
/* Host Interrupt Generate */
#define H_IG 0x00000004
/* Host Interrupt Status */
#define H_IS 0x00000002
/* Host Interrupt Enable */
#define H_IE 0x00000001
/*
* register bits of ME_CSR_HA (ME Control Status Host Access register)
* ME CB (Circular Buffer) Depth HRA (Host Read Access)
* - host read only access to ME_CBD
*/
#define ME_CBD_HRA 0xFF000000
/* ME CB Write Pointer HRA - host read only access to ME_CBWP */
#define ME_CBWP_HRA 0x00FF0000
/* ME CB Read Pointer HRA - host read only access to ME_CBRP */
#define ME_CBRP_HRA 0x0000FF00
/* ME Reset HRA - host read only access to ME_RST */
#define ME_RST_HRA 0x00000010
/* ME Ready HRA - host read only access to ME_RDY */
#define ME_RDY_HRA 0x00000008
/* ME Interrupt Generate HRA - host read only access to ME_IG */
#define ME_IG_HRA 0x00000004
/* ME Interrupt Status HRA - host read only access to ME_IS */
#define ME_IS_HRA 0x00000002
/* ME Interrupt Enable HRA - host read only access to ME_IE */
#define ME_IE_HRA 0x00000001
#define HECI_MINOR_NUMBER 1
/* #define HECI_PTHI_MINOR_NUMBER 0 */
| ((instance) & 0xFF))
#define HECI_MINOR_TO_INSTANCE(x) ((x) & 0xFF)
#define HECI_MAX_OPEN_HANDLE_COUNT 253
/*
* debug kernel print macro define
*/
#ifdef DEBUG
extern int heci_debug;
#else
#define DBG
#endif
if (!(expr)) { \
}
#define walk_list(p, n, h) \
p != (h); \
p = n, n = list_next(p))
}
#define LIST_INIT_HEAD list_init
#define list_del_init(n) { \
list_del(n); \
list_init(n); \
}
#define list_empty(l) ((l)->list_next == (l))
}
}
#ifdef __GNUC__
{ \
})
#else
/* type unsafe version */
#endif
/*
* time to wait HECI become ready after init
*/
/*
* watch dog definition
*/
#define HECI_WATCHDOG_DATA_SIZE 16
#define HECI_START_WD_DATA_SIZE 20
#define HECI_WD_PARAMS_SIZE 4
#define HECI_WD_STATE_INDEPENDENCE_MSG_SENT (1 << 0)
#define HECI_WD_HOST_CLIENT_ID 1
#define HECI_IAMTHIF_HOST_CLIENT_ID 2
struct guid {
};
/* File state */
enum file_state {
};
/* HECI device states */
enum heci_states {
HECI_INITIALIZING = 0,
};
enum iamthif_states {
};
enum heci_file_transaction_states {
};
/* HECI CB */
enum heci_cb_major_types {
HECI_READ = 0,
};
/* HECI user data struct */
struct heci_message_data {
char *data;
#ifndef _LP64
char *pad;
#endif
};
struct heci_file {
void * private_data;
};
struct heci_cb_private {
void *file_private;
struct heci_message_data request_buffer;
struct heci_message_data response_buffer;
unsigned long information;
unsigned long read_time;
struct heci_file *file_object;
};
struct io_heci_list {
struct heci_cb_private heci_cb;
int status;
struct iamt_heci_device *device_extension;
};
struct heci_driver_version {
};
struct heci_client {
};
/*
* HECI BUS Interface Section
*/
struct heci_msg_hdr {
};
struct hbm_cmd {
};
struct heci_bus_message {
};
struct hbm_version {
};
struct hbm_host_version_request {
struct hbm_version host_version;
};
struct hbm_host_version_response {
struct hbm_version me_max_version;
};
struct hbm_host_stop_request {
};
struct hbm_host_stop_response {
};
struct hbm_me_stop_request {
};
struct hbm_host_enum_request {
};
struct hbm_host_enum_response {
};
struct heci_client_properties {
struct guid protocol_name;
};
struct hbm_props_request {
};
struct hbm_props_response {
};
struct hbm_client_connect_request {
};
struct hbm_client_connect_response {
};
struct hbm_client_disconnect_request {
};
struct hbm_flow_control {
};
struct heci_me_client {
struct heci_client_properties props;
};
#pragma pack()
/* Private file struct */
struct heci_file_private {
enum file_state state;
struct pollhead tx_pollwait;
int read_pending;
int status;
/* ID of client connected */
int sm_state;
struct heci_cb_private *read_cb;
};
/* private device struct */
struct iamt_heci_device {
/*
* lists of queues
*/
/* array of pointers to aio lists */
/* driver managed PTHI list for reading completed pthi cmd data */
struct io_heci_list pthi_read_complete_list;
/*
* list of files
*/
/*
* memory of device
*/
char *mem_addr;
/*
* lock for the device
*/
int recvd_msg;
/*
* hw states of host and fw(ME)
*/
/*
* waiting queue for receive message from FW
*/
/*
* heci device states
*/
enum heci_states heci_state;
int stop;
struct hbm_version version;
int host_buffer_is_empty;
struct heci_file_private wd_file_ext;
int wd_pending;
int wd_stoped;
unsigned char wd_data[HECI_START_WD_DATA_SIZE];
int asf_mode;
int wd_bypass; /* if 1, don't refresh watchdog ME client */
struct heci_file *iamthif_file_object;
struct heci_file_private iamthif_file_ext;
int iamthif_ioctl;
int iamthif_canceled;
unsigned char iamthif_msg_buf[IAMTHIF_MTU];
enum iamthif_states iamthif_state;
struct heci_cb_private *iamthif_current_cb;
int need_reset;
long open_handle_count;
};
/*
* read_heci_register - Read a byte from the heci device
*
* @device: the device structure
* @offset: offset from which to read the data
*
* @return the byte read.
*/
unsigned long offset);
/*
* write_heci_register - Write 4 bytes to the heci device
*
* @device: the device structure
* @offset: offset from which to write the data
* @value: the byte to write
*/
#endif /* _HECI_DATA_STRUCTURES_H_ */