iPXE
phantom_hw.h
Go to the documentation of this file.
00001 #ifndef _PHANTOM_HW_H
00002 #define _PHANTOM_HW_H
00003 
00004 /*
00005  * Copyright (C) 2008 Michael Brown <mbrown@fensystems.co.uk>.
00006  * Copyright (C) 2008 NetXen, Inc.
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the
00011  * License, or any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00021  * 02110-1301, USA.
00022  *
00023  * You can also choose to distribute this program under the terms of
00024  * the Unmodified Binary Distribution Licence (as given in the file
00025  * COPYING.UBDL), provided that you have satisfied its requirements.
00026  */
00027 
00028 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00029 
00030 /**
00031  * @file
00032  *
00033  * Phantom hardware definitions
00034  *
00035  */
00036 
00037 /** A Phantom RX descriptor */
00038 struct phantom_rds_pb {
00039         pseudo_bit_t handle[16];                /**< Reference handle */
00040         pseudo_bit_t flags[16];                 /**< Flags */
00041         pseudo_bit_t length[32];                /**< Buffer length */
00042 
00043         /* --------------------------------------------------------------- */
00044 
00045         pseudo_bit_t dma_addr[64];              /**< Buffer DMA address */
00046 
00047 };
00048 
00049 /** A Phantom RX status descriptor */
00050 struct phantom_sds_pb {
00051         pseudo_bit_t port[4];                   /**< Port number */
00052         pseudo_bit_t status[4];                 /**< Checksum status */
00053         pseudo_bit_t type[4];                   /**< Type */
00054         pseudo_bit_t total_length[16];          /**< Total packet length */
00055         pseudo_bit_t handle[16];                /**< Reference handle */
00056         pseudo_bit_t protocol[4];               /**< Protocol */
00057         pseudo_bit_t pkt_offset[5];             /**< Offset to packet start */
00058         pseudo_bit_t desc_cnt[3];               /**< Descriptor count */
00059         pseudo_bit_t owner[2];                  /**< Owner */
00060         pseudo_bit_t opcode[6];                 /**< Opcode */
00061 
00062         /* --------------------------------------------------------------- */
00063 
00064         pseudo_bit_t hash_value[32];            /**< RSS hash value */
00065         pseudo_bit_t hash_type[8];              /**< RSS hash type */
00066         pseudo_bit_t lro[8];                    /**< LRO data */
00067 };
00068 
00069 /** Phantom RX status opcodes */
00070 enum phantom_sds_opcode {
00071         UNM_SYN_OFFLOAD = 0x03,
00072         UNM_RXPKT_DESC = 0x04,
00073 };
00074 
00075 /** A Phantom TX descriptor */
00076 struct phantom_tx_cds_pb {
00077         pseudo_bit_t tcp_hdr_offset[8];         /**< TCP header offset (LSO) */
00078         pseudo_bit_t ip_hdr_offset[8];          /**< IP header offset (LSO) */
00079         pseudo_bit_t flags[7];                  /**< Flags */
00080         pseudo_bit_t opcode[6];                 /**< Opcode */
00081         pseudo_bit_t hw_rsvd_0[3];              /**< (Reserved) */
00082         pseudo_bit_t num_buffers[8];            /**< Total number of buffers */
00083         pseudo_bit_t length[24];                /**< Total length */
00084 
00085         /* --------------------------------------------------------------- */
00086 
00087         pseudo_bit_t buffer2_dma_addr[64];      /**< Buffer 2 DMA address */
00088 
00089         /* --------------------------------------------------------------- */
00090 
00091         pseudo_bit_t handle[16];                /**< Reference handle (n/a) */
00092         pseudo_bit_t port_mss[16];              /**< TCP MSS (LSO) */
00093         pseudo_bit_t port[4];                   /**< Port */
00094         pseudo_bit_t context_id[4];             /**< Context ID */
00095         pseudo_bit_t total_hdr_length[8];       /**< MAC+IP+TCP header (LSO) */
00096         pseudo_bit_t conn_id[16];               /**< IPSec connection ID */
00097 
00098         /* --------------------------------------------------------------- */
00099 
00100         pseudo_bit_t buffer3_dma_addr[64];      /**< Buffer 3 DMA address */
00101 
00102         /* --------------------------------------------------------------- */
00103 
00104         pseudo_bit_t buffer1_dma_addr[64];      /**< Buffer 1 DMA address */
00105 
00106         /* --------------------------------------------------------------- */
00107 
00108         pseudo_bit_t buffer1_length[16];        /**< Buffer 1 length */
00109         pseudo_bit_t buffer2_length[16];        /**< Buffer 2 length */
00110         pseudo_bit_t buffer3_length[16];        /**< Buffer 3 length */
00111         pseudo_bit_t buffer4_length[16];        /**< Buffer 4 length */
00112 
00113         /* --------------------------------------------------------------- */
00114 
00115         pseudo_bit_t buffer4_dma_addr[64];      /**< Buffer 4 DMA address */
00116 
00117         /* --------------------------------------------------------------- */
00118 
00119         pseudo_bit_t hw_rsvd_1[64];             /**< (Reserved) */
00120 };
00121 
00122 /** A Phantom MAC address request body */
00123 struct phantom_nic_request_body_mac_request_pb {
00124         pseudo_bit_t opcode[8];                 /**< Opcode */
00125         pseudo_bit_t tag[8];                    /**< Tag */
00126         pseudo_bit_t mac_addr_0[8];             /**< MAC address byte 0 */
00127         pseudo_bit_t mac_addr_1[8];             /**< MAC address byte 1 */
00128         pseudo_bit_t mac_addr_2[8];             /**< MAC address byte 2 */
00129         pseudo_bit_t mac_addr_3[8];             /**< MAC address byte 3 */
00130         pseudo_bit_t mac_addr_4[8];             /**< MAC address byte 4 */
00131         pseudo_bit_t mac_addr_5[8];             /**< MAC address byte 5 */
00132 };
00133 
00134 /** Phantom MAC request opcodes */
00135 enum phantom_mac_request_opcode {
00136         UNM_MAC_ADD = 0x01,                     /**< Add MAC address */
00137         UNM_MAC_DEL = 0x02,                     /**< Delete MAC address */
00138 };
00139 
00140 /** A Phantom NIC request command descriptor */
00141 struct phantom_nic_request_cds_pb {
00142         struct {
00143                 pseudo_bit_t dst_minor[18];
00144                 pseudo_bit_t dst_subq[1];
00145                 pseudo_bit_t dst_major[4];
00146                 pseudo_bit_t opcode[6];
00147                 pseudo_bit_t hw_rsvd_0[3];
00148                 pseudo_bit_t msginfo[24];
00149                 pseudo_bit_t hw_rsvd_1[2];
00150                 pseudo_bit_t qmsg_type[6];
00151         } common;
00152 
00153         /* --------------------------------------------------------------- */
00154 
00155         struct {
00156                 pseudo_bit_t opcode[8];
00157                 pseudo_bit_t comp_id [8];
00158                 pseudo_bit_t context_id[16];
00159                 pseudo_bit_t need_completion[1];
00160                 pseudo_bit_t hw_rsvd_0[23];
00161                 pseudo_bit_t sub_opcode[8];
00162         } header;
00163 
00164         /* --------------------------------------------------------------- */
00165 
00166         union {
00167                 struct phantom_nic_request_body_mac_request_pb mac_request;
00168                 pseudo_bit_t padding[384];
00169         } body;
00170 };
00171 
00172 /** Phantom NIC request opcodes */
00173 enum phantom_nic_request_opcode {
00174         UNM_MAC_EVENT = 0x01,                   /**< Add/delete MAC address */
00175 };
00176 
00177 /** A Phantom command descriptor */
00178 union phantom_cds_pb {
00179         struct phantom_tx_cds_pb tx;
00180         struct phantom_nic_request_cds_pb nic_request;
00181 };
00182 
00183 /** Phantom command descriptor opcodes */
00184 enum phantom_cds_opcode {
00185         UNM_TX_ETHER_PKT = 0x01,                /**< Transmit raw Ethernet */
00186         UNM_NIC_REQUEST = 0x14,                 /**< NIC request */
00187 };
00188 
00189 #endif /* _PHANTOM_HW_H */