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., 675 Mass Ave, Cambridge, MA 02139, USA. 00021 */ 00022 00023 FILE_LICENCE ( GPL2_OR_LATER ); 00024 00025 /** 00026 * @file 00027 * 00028 * Phantom hardware definitions 00029 * 00030 */ 00031 00032 /** A Phantom RX descriptor */ 00033 struct phantom_rds_pb { 00034 pseudo_bit_t handle[16]; /**< Reference handle */ 00035 pseudo_bit_t flags[16]; /**< Flags */ 00036 pseudo_bit_t length[32]; /**< Buffer length */ 00037 00038 /* --------------------------------------------------------------- */ 00039 00040 pseudo_bit_t dma_addr[64]; /**< Buffer DMA address */ 00041 00042 }; 00043 00044 /** A Phantom RX status descriptor */ 00045 struct phantom_sds_pb { 00046 pseudo_bit_t port[4]; /**< Port number */ 00047 pseudo_bit_t status[4]; /**< Checksum status */ 00048 pseudo_bit_t type[4]; /**< Type */ 00049 pseudo_bit_t total_length[16]; /**< Total packet length */ 00050 pseudo_bit_t handle[16]; /**< Reference handle */ 00051 pseudo_bit_t protocol[4]; /**< Protocol */ 00052 pseudo_bit_t pkt_offset[5]; /**< Offset to packet start */ 00053 pseudo_bit_t desc_cnt[3]; /**< Descriptor count */ 00054 pseudo_bit_t owner[2]; /**< Owner */ 00055 pseudo_bit_t opcode[6]; /**< Opcode */ 00056 00057 /* --------------------------------------------------------------- */ 00058 00059 pseudo_bit_t hash_value[32]; /**< RSS hash value */ 00060 pseudo_bit_t hash_type[8]; /**< RSS hash type */ 00061 pseudo_bit_t lro[8]; /**< LRO data */ 00062 }; 00063 00064 /** Phantom RX status opcodes */ 00065 enum phantom_sds_opcode { 00066 UNM_SYN_OFFLOAD = 0x03, 00067 UNM_RXPKT_DESC = 0x04, 00068 }; 00069 00070 /** A Phantom TX descriptor */ 00071 struct phantom_tx_cds_pb { 00072 pseudo_bit_t tcp_hdr_offset[8]; /**< TCP header offset (LSO) */ 00073 pseudo_bit_t ip_hdr_offset[8]; /**< IP header offset (LSO) */ 00074 pseudo_bit_t flags[7]; /**< Flags */ 00075 pseudo_bit_t opcode[6]; /**< Opcode */ 00076 pseudo_bit_t hw_rsvd_0[3]; /**< (Reserved) */ 00077 pseudo_bit_t num_buffers[8]; /**< Total number of buffers */ 00078 pseudo_bit_t length[24]; /**< Total length */ 00079 00080 /* --------------------------------------------------------------- */ 00081 00082 pseudo_bit_t buffer2_dma_addr[64]; /**< Buffer 2 DMA address */ 00083 00084 /* --------------------------------------------------------------- */ 00085 00086 pseudo_bit_t handle[16]; /**< Reference handle (n/a) */ 00087 pseudo_bit_t port_mss[16]; /**< TCP MSS (LSO) */ 00088 pseudo_bit_t port[4]; /**< Port */ 00089 pseudo_bit_t context_id[4]; /**< Context ID */ 00090 pseudo_bit_t total_hdr_length[8]; /**< MAC+IP+TCP header (LSO) */ 00091 pseudo_bit_t conn_id[16]; /**< IPSec connection ID */ 00092 00093 /* --------------------------------------------------------------- */ 00094 00095 pseudo_bit_t buffer3_dma_addr[64]; /**< Buffer 3 DMA address */ 00096 00097 /* --------------------------------------------------------------- */ 00098 00099 pseudo_bit_t buffer1_dma_addr[64]; /**< Buffer 1 DMA address */ 00100 00101 /* --------------------------------------------------------------- */ 00102 00103 pseudo_bit_t buffer1_length[16]; /**< Buffer 1 length */ 00104 pseudo_bit_t buffer2_length[16]; /**< Buffer 2 length */ 00105 pseudo_bit_t buffer3_length[16]; /**< Buffer 3 length */ 00106 pseudo_bit_t buffer4_length[16]; /**< Buffer 4 length */ 00107 00108 /* --------------------------------------------------------------- */ 00109 00110 pseudo_bit_t buffer4_dma_addr[64]; /**< Buffer 4 DMA address */ 00111 00112 /* --------------------------------------------------------------- */ 00113 00114 pseudo_bit_t hw_rsvd_1[64]; /**< (Reserved) */ 00115 }; 00116 00117 /** A Phantom MAC address request body */ 00118 struct phantom_nic_request_body_mac_request_pb { 00119 pseudo_bit_t opcode[8]; /**< Opcode */ 00120 pseudo_bit_t tag[8]; /**< Tag */ 00121 pseudo_bit_t mac_addr_0[8]; /**< MAC address byte 0 */ 00122 pseudo_bit_t mac_addr_1[8]; /**< MAC address byte 1 */ 00123 pseudo_bit_t mac_addr_2[8]; /**< MAC address byte 2 */ 00124 pseudo_bit_t mac_addr_3[8]; /**< MAC address byte 3 */ 00125 pseudo_bit_t mac_addr_4[8]; /**< MAC address byte 4 */ 00126 pseudo_bit_t mac_addr_5[8]; /**< MAC address byte 5 */ 00127 }; 00128 00129 /** Phantom MAC request opcodes */ 00130 enum phantom_mac_request_opcode { 00131 UNM_MAC_ADD = 0x01, /**< Add MAC address */ 00132 UNM_MAC_DEL = 0x02, /**< Delete MAC address */ 00133 }; 00134 00135 /** A Phantom NIC request command descriptor */ 00136 struct phantom_nic_request_cds_pb { 00137 struct { 00138 pseudo_bit_t dst_minor[18]; 00139 pseudo_bit_t dst_subq[1]; 00140 pseudo_bit_t dst_major[4]; 00141 pseudo_bit_t opcode[6]; 00142 pseudo_bit_t hw_rsvd_0[3]; 00143 pseudo_bit_t msginfo[24]; 00144 pseudo_bit_t hw_rsvd_1[2]; 00145 pseudo_bit_t qmsg_type[6]; 00146 } common; 00147 00148 /* --------------------------------------------------------------- */ 00149 00150 struct { 00151 pseudo_bit_t opcode[8]; 00152 pseudo_bit_t comp_id [8]; 00153 pseudo_bit_t context_id[16]; 00154 pseudo_bit_t need_completion[1]; 00155 pseudo_bit_t hw_rsvd_0[23]; 00156 pseudo_bit_t sub_opcode[8]; 00157 } header; 00158 00159 /* --------------------------------------------------------------- */ 00160 00161 union { 00162 struct phantom_nic_request_body_mac_request_pb mac_request; 00163 pseudo_bit_t padding[384]; 00164 } body; 00165 }; 00166 00167 /** Phantom NIC request opcodes */ 00168 enum phantom_nic_request_opcode { 00169 UNM_MAC_EVENT = 0x01, /**< Add/delete MAC address */ 00170 }; 00171 00172 /** A Phantom command descriptor */ 00173 union phantom_cds_pb { 00174 struct phantom_tx_cds_pb tx; 00175 struct phantom_nic_request_cds_pb nic_request; 00176 }; 00177 00178 /** Phantom command descriptor opcodes */ 00179 enum phantom_cds_opcode { 00180 UNM_TX_ETHER_PKT = 0x01, /**< Transmit raw Ethernet */ 00181 UNM_NIC_REQUEST = 0x14, /**< NIC request */ 00182 }; 00183 00184 #endif /* _PHANTOM_HW_H */
1.5.7.1