heci_interface.h revision 617e2443dfc17fe44fd44c0675d6aad2ffc9df42
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Part of Intel(R) Manageability Engine Interface Linux driver
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright (c) 2003 - 2008 Intel Corp.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Redistribution and use in source and binary forms, with or without
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * modification, are permitted provided that the following conditions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are met:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 1. Redistributions of source code must retain the above copyright
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * notice, this list of conditions, and the following disclaimer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * without modification.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2. Redistributions in binary form must reproduce at minimum a disclaimer
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * substantially similar to the "NO WARRANTY" disclaimer below
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ("Disclaimer") and any redistribution must be conditioned upon
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * including a substantially similar Disclaimer requirement for further
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * binary redistribution.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 3. Neither the names of the above-listed copyright holders nor the names
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of any contributors may be used to endorse or promote products derived
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * from this software without specific prior written permission.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Alternatively, this software may be distributed under the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * GNU General Public License ("GPL") version 2 as published by the Free
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Software Foundation.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * NO WARRANTY
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * POSSIBILITY OF SUCH DAMAGES.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _HECI_INTERFACE_H_
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _HECI_INTERFACE_H_
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBM_MINOR_VERSION 0
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBM_MAJOR_VERSION 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HBM_TIMEOUT 1 /* 1 second */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_START_REQ_CMD 0x01
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_START_RES_CMD 0x81
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_STOP_REQ_CMD 0x02
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_STOP_RES_CMD 0x82
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ME_STOP_REQ_CMD 0x03
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_ENUM_REQ_CMD 0x04
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_ENUM_RES_CMD 0x84
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_CLIENT_PROPERTEIS_REQ_CMD 0x05
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HOST_CLIENT_PROPERTEIS_RES_CMD 0x85
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CLIENT_CONNECT_REQ_CMD 0x06
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CLIENT_CONNECT_RES_CMD 0x86
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CLIENT_DISCONNECT_REQ_CMD 0x07
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CLIENT_DISCONNECT_RES_CMD 0x87
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HECI_FLOW_CONTROL_CMD 0x08
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define AMT_WD_VALUE 120 /* seconds */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HECI_WATCHDOG_DATA_SIZE 16
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HECI_START_WD_DATA_SIZE 20
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define HECI_WD_PARAMS_SIZE 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma pack(1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* IOCTL commands */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IOCTL_HECI_GET_VERSION \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _IOWR('H', 0x0, struct heci_message_data)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IOCTL_HECI_CONNECT_CLIENT \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _IOWR('H', 0x01, struct heci_message_data)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IOCTL_HECI_WD \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _IOWR('H', 0x02, struct heci_message_data)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IOCTL_HECI_BYPASS_WD \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _IOWR('H', 0x10, struct heci_message_data)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteenum heci_stop_reason_types {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DRIVER_STOP_REQUEST = 0x00,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DEVICE_D1_ENTRY = 0x01,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DEVICE_D2_ENTRY = 0x02,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte DEVICE_D3_ENTRY = 0x03,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SYSTEM_S1_ENTRY = 0x04,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SYSTEM_S2_ENTRY = 0x05,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SYSTEM_S3_ENTRY = 0x06,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SYSTEM_S4_ENTRY = 0x07,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte SYSTEM_S5_ENTRY = 0x08
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteenum me_stop_reason_types {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte FW_UPDATE = 0x00
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteenum client_connect_status_types {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CCS_SUCCESS = 0x00,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CCS_NOT_FOUND = 0x01,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CCS_ALREADY_STARTED = 0x02,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CCS_OUT_OF_RESOURCES = 0x03,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CCS_MESSAGE_SMALL = 0x04
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteenum client_disconnect_status_types {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CDS_SUCCESS = 0x00
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * heci interface function prototypes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid heci_set_csr_register(struct iamt_heci_device *dev);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid heci_csr_enable_interrupts(struct iamt_heci_device *dev);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid heci_csr_disable_interrupts(struct iamt_heci_device *dev);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid heci_read_slots(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char *buffer, unsigned long buffer_length);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint heci_write_message(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct heci_msg_hdr *header,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char *write_buffer,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned long write_length);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint host_buffer_is_empty(struct iamt_heci_device *dev);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint32_t count_full_read_slots(struct iamt_heci_device *dev);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint32_t count_empty_write_slots(struct iamt_heci_device *dev);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint flow_ctrl_creds(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct heci_file_private *file_ext);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint heci_send_wd(struct iamt_heci_device *dev);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid flow_ctrl_reduce(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct heci_file_private *file_ext);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint heci_send_flow_control(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct heci_file_private *file_ext);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint heci_disconnect(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct heci_file_private *file_ext);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint other_client_is_connecting(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct heci_file_private *file_ext);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint heci_connect(struct iamt_heci_device *dev,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct heci_file_private *file_ext);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _HECI_INTERFACE_H_ */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte