Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

nic1394.h

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1998 Microsoft Corporation 00004 00005 Module Name: 00006 00007 nic1394.h 00008 00009 Abstract: 00010 00011 This module defines the structures, macros, and manifests available 00012 to IEE1394-aware network components. 00013 00014 Revision History: 00015 00016 09/14/1998 JosephJ Created. 00017 00018 --*/ 00019 00020 #ifndef _NIC1394_H_ 00021 #define _NIC1394_H_ 00022 00024 // ADDRESS FAMILY VERSION INFORMATION 00026 00027 // 00028 // The current major and minor version, respectively, of the NIC1394 address family. 00029 // 00030 #define NIC1394_AF_CURRENT_MAJOR_VERSION 5 00031 #define NIC1394_AF_CURRENT_MINOR_VERSION 0 00032 00034 // MEDIA PARAMETERS // 00036 00037 // 00038 // 1394 FIFO Address, consisting of the 64-bit UniqueID and the 00039 // 48-bit address offset. 00040 // 00041 typedef struct _NIC1394_FIFO_ADDRESS 00042 { 00043 UINT64 UniqueID; 00044 ULONG Off_Low; 00045 USHORT Off_High; 00046 00047 } NIC1394_FIFO_ADDRESS, *PNIC1394_FIFO_ADDRESS; 00048 00049 00050 // enum to identify which of the two modes of transmission on a 1394 is to be used 00051 // 00052 // 00053 00054 typedef enum _NIC1394_ADDRESS_TYPE 00055 { 00056 NIC1394AddressType_Channel, // Indicates this is a channel address 00057 NIC1394AddressType_FIFO, // Indicates this is a FIFO address 00058 00059 } NIC1394_ADDRESS_TYPE, *PNIC1394_ADDRESS_TYPE; 00060 00061 00062 00063 // 00064 // General form of a 1394 destination, which can specify either a 1394 channel or 00065 // a FIFO address. This structure forms part of the 1394 media-specific 00066 // parameters. 00067 // 00068 typedef struct _NIC1394_DESTINATION 00069 { 00070 union 00071 { 00072 UINT Channel; // IEEE1394 channel number. 00073 NIC1394_FIFO_ADDRESS FifoAddress; // IEEE1394 NodeID and address offset. 00074 }; 00075 00076 00077 NIC1394_ADDRESS_TYPE AddressType; // Address- asynch or isoch 00078 00079 } NIC1394_DESTINATION, *PNIC1394_DESTINATION; 00080 00081 // 00082 // Special channels values 00083 // 00084 #define NIC1394_ANY_CHANNEL ((UINT)-1) // miniport should pick channel. 00085 #define NIC1394_BROADCAST_CHANNEL ((UINT)-2) // special broadcast channel. 00086 00087 // 00088 // This is the value of the ParamType field in the CO_SPECIFIC_PARAMETERS structure 00089 // when the Parameters[] field contains IEEE1394 media specific values in the 00090 // structure NIC1394_MEDIA_PARAMETERS. 00091 // 00092 #define NIC1394_MEDIA_SPECIFIC 0x13940000 00093 00094 00095 // 00096 // NOTE: 00097 // The CO_MEDIA_PARAMETERS.Flags field for FIFO vcs must specify either TRANSMIT_VC 00098 // or RECEIVE_VC, not both. If RECEIVE_VC is specified for a FIFO vc, this vc is 00099 // used to receive on a local FIFO. In this case, the Destination.RecvFIFO field 00100 // must be set to all-0s when creating the vc. On activation of the vc, 00101 // this field of the updated media parameters will contain the local nodes unique ID 00102 // and the allocated FIFO address. 00103 // 00104 00105 // 00106 // 1394 Specific Media parameters - this is the Media specific structure for 1394 00107 // that goes into MediaParameters->MediaSpecific.Parameters. 00108 // 00109 typedef struct _NIC1394_MEDIA_PARAMETERS 00110 { 00111 // 00112 // Identifies destination type (channel or FIFO) and type-specific address. 00113 // 00114 NIC1394_DESTINATION Destination; 00115 00116 // 00117 // Bitmap encoding characteristics of the vc. One or more NIC1394_VCFLAG_* 00118 // values. 00119 // 00120 ULONG Flags; 00121 00122 // 00123 // Maximum size, in bytes, of blocks to be sent on this vc. Must be set to 0 00124 // if this is a recv-only VCs. The miniport will choose a block size that is a 00125 // minimum of this value and the value dictated by the bus speed map. 00126 // Special value (ULONG -1) indicates "maximum possible block size." 00127 UINT MaxSendBlockSize; 00128 00129 // 00130 // One of the SCODE_* constants defined in 1394.h. Indicates 00131 // the maximum speed to be used for blocks sent on this vc. Must be set to 0 00132 // if this is a recv-only VC. The miniport will choose a speed that is a minimum 00133 // of this value and the value dicated by the bus speed map. 00134 // Special value (ULONG -1) indicates "maximum possible speed." 00135 // 00136 // TODO: change to ... MaxSendSpeedCode; 00137 // 00138 UINT MaxSendSpeed; 00139 00140 // 00141 // Size, in bytes, of the largest packet that will be sent or received on 00142 // this VC. The miniport may use this information to set up internal buffers 00143 // for link-layer fragmentation and reassembly. The miniport will 00144 // fail attempts to send packets and will discard received packets if the 00145 // size of these packets is larger than the MTU. 00146 // 00147 UINT MTU; 00148 // 00149 // Amount of bandwidth to reserve, in units of bytes per isochronous frame. 00150 // Applies only for isochronous transmission, and must be set to 0 for 00151 // asynchronous transmission (i.e., if the NIC1394_VCFLAG_ISOCHRONOUS bit is 0). 00152 // 00153 UINT Bandwidth; 00154 00155 // 00156 // One or more NIC1394_FRAMETYPE_* values. The miniport will attempt to send up 00157 // only pkts with these protocols. However it may send other pkts. 00158 // The client should be able to deal with this. Must be set to 0 if 00159 // no framing is used (i.e., if the NIC1394_VCFLAG_FRAMED bit is 0). 00160 // 00161 ULONG RecvFrameTypes; 00162 00163 } NIC1394_MEDIA_PARAMETERS, *PNIC1394_MEDIA_PARAMETERS; 00164 00165 00166 // 00167 // NIC1394_MEDIA_PARAMETERS.Flags bitfield values 00168 // 00169 00170 // 00171 // Indicates VC will be used for isochronous transmission. 00172 // 00173 #define NIC1394_VCFLAG_ISOCHRONOUS (0x1 << 1) 00174 00175 // 00176 // Indicates that the vc is used for framed data. If set, the miniport will 00177 // implement link-level fragmentation and reassembly. If clear, the miniport 00178 // will treat data sent and received on this vc as raw data. 00179 // 00180 #define NIC1394_VCFLAG_FRAMED (0x1 << 2) 00181 00182 // 00183 // Indicates the miniport should allocate the necessary bus resources. 00184 // Currently this only applies for non-broadcast channels, in which case 00185 // the bus resources consist of the network channel number and (for isochronous 00186 // vc's) the bandwidth specified in Bandwidth field. 00187 // This bit does not apply (and should be 0) when creating the broadcast channel 00188 // and either transmit or receive FIFO vcs. 00189 // 00190 #define NIC1394_VCFLAG_ALLOCATE (0x1 << 3) 00191 00192 // 00193 // End of NIC1394_MEDIA_PARAMETERS.Flags bitfield values. 00194 // 00195 00196 // 00197 // NIC1394_MEDIA_PARAMETERS.FrameType bitfield values 00198 // 00199 #define NIC1394_FRAMETYPE_ARP (0x1<<0) // Ethertype 0x806 00200 #define NIC1394_FRAMETYPE_IPV4 (0x1<<1) // Ethertype 0x800 00201 #define NIC1394_FRAMETYPE_IPV4MCAP (0x1<<2) // Ethertype 0x8861 00202 00203 00204 00206 // INFORMATIONAL OIDs // 00208 00209 // 00210 // the structure for returning basic information about the miniport 00211 // returned in response to OID_NIC1394_LOCAL_NODE_INFO. Associated with 00212 // the address family handle. 00213 // 00214 typedef struct _NIC1394_LOCAL_NODE_INFO 00215 { 00216 UINT64 UniqueID; // This node's 64-bit Unique ID. 00217 ULONG BusGeneration; // 1394 Bus generation ID. 00218 NODE_ADDRESS NodeAddress; // Local nodeID for the current bus 00219 // generation. 00220 USHORT Reserved; // Padding. 00221 UINT MaxRecvBlockSize; // Maximum size, in bytes, of blocks 00222 // that can be read. 00223 UINT MaxRecvSpeed; // Max speed which can be accepted 00224 // -- minimum 00225 // of the max local link speed and 00226 // the max local PHY speed. 00227 00228 } NIC1394_LOCAL_NODE_INFO, *PNIC1394_LOCAL_NODE_INFO; 00229 00230 00231 // 00232 // The structure for returning basic information about the specified vc 00233 // returned in response to OID_NIC1394_VC_INFO. Associated with 00234 // a vc handle 00235 // 00236 typedef struct _NIC1394_VC_INFO 00237 { 00238 // 00239 // Channel or (unique-ID,offset). In the case of a recv (local) FIFO vc, 00240 // this will be set to the local node's unique ID and address offset. 00241 // 00242 NIC1394_DESTINATION Destination; 00243 00244 } NIC1394_VC_INFO, *PNIC1394_VC_INFO; 00245 00246 00247 00249 // INDICATIONS // 00251 // Bus Reset 00252 // Params: NIC1394_LOCAL_NODE_INFO 00253 00255 // PACKET FORMATS // 00257 00258 00259 // 00260 // GASP Header, which prefixes all ip/1394 pkts sent over channels. 00261 // TODO: move this withing NIC1394, because it is not exposed to protocols. 00262 // 00263 typedef struct _NIC1394_GASP_HEADER 00264 { 00265 USHORT source_ID; 00266 USHORT specifier_ID_hi; 00267 UCHAR specifier_ID_lo; 00268 UCHAR version[3]; 00269 00270 } NIC1394_GASP_HEADER; 00271 00272 // 00273 // Unfragmented encapsulation header. 00274 // 00275 typedef struct _NIC1394_ENCAPSULATION_HEADER 00276 { 00277 // The Reserved field must be set to 0. 00278 // 00279 USHORT Reserved; 00280 00281 // The EtherType field is set to the byte-swapped version of one of the 00282 // constants defined immediately below. 00283 // 00284 USHORT EtherType; 00285 00286 // Ethertypes in machine byte order. These values need to be byteswapped 00287 // before they are sent on the wire. 00288 // 00289 #define NIC1394_ETHERTYPE_IP 0x800 00290 #define NIC1394_ETHERTYPE_ARP 0x806 00291 #define NIC1394_ETHERTYPE_MCAP 0x8861 00292 00293 } NIC1394_ENCAPSULATION_HEADER, *PNIC1394_ENCAPSULATION_HEADER; 00294 00295 // 00296 // TODO: get rid of NIC1394_ENCAPSULATION_HEADER 00297 // 00298 typedef 00299 NIC1394_ENCAPSULATION_HEADER 00300 NIC1394_UNFRAGMENTED_HEADER, *PNIC1394_UNFRAGMENTED_HEADER; 00301 00302 00303 // 00304 // FRAGMENTED PACKET FORMATS 00305 // 00306 // TODO: move these to inside NIC1394, because they are only 00307 // used within NIC1394. 00308 // 00309 00310 // 00311 // Fragmented Encapsulation header: first fragment 00312 // 00313 typedef struct _NIC1394_FIRST_FRAGMENT_HEADER 00314 { 00315 // Contains the 2-bit "lf" field and the 12-bit "buffer_size" field. 00316 // Use the macros immediately below to extract the above fields from 00317 // the lfbufsz. This field needs to be byteswapped before it is sent out 00318 // on the wire. 00319 // 00320 USHORT lfbufsz; 00321 00322 #define NIC1394_LF_FROM_LFBUFSZ(_lfbufsz) \ 00323 ((_lfbufz) >> 14) 00324 00325 #define NIC1394_BUFFER_SIZE_FROM_LFBUFSZ(_lfbufsz) \ 00326 ((_lfbufz) & 0xfff) 00327 00328 #define NIC1394_MAX_FRAGMENT_BUFFER_SIZE 0xfff 00329 00330 // 00331 // specifies what the packet is - an IPV4, ARP, or MCAP packet 00332 // 00333 USHORT EtherType; 00334 00335 00336 // Opaque datagram label. There is no need to byteswap this field before it 00337 // is sent out on the wire. 00338 // 00339 USHORT dgl; 00340 00341 // Must be set to 0 00342 // 00343 USHORT reserved; 00344 00345 } NIC1394_FIRST_FRAGMENT_HEADER, *PNIC1394_FIRST_FRAGMENT_HEADER; 00346 00347 // 00348 // Fragmented Encapsulation header: second and subsequent fragments 00349 // 00350 typedef struct _NIC1394_FRAGMENT_HEADER 00351 { 00352 #if OBSOLETE 00353 ULONG lf:2; // Bits 0-1 00354 ULONG rsv0:2; // Bits 2-3 00355 ULONG buffer_size:12; // Bits 4-15 00356 00357 ULONG rsv1:4; // Bits 16-19 00358 ULONG fragment_offset:12; // Bits 20-31 00359 00360 ULONG dgl:16; // Bits 0-15 00361 00362 ULONG reserved:16; // Bits 16-32 00363 #endif // OBSOLETE 00364 00365 // Contains the 2-bit "lf" field and the 12-bit "buffer_size" field. 00366 // The format is the same as NIC1394_FIRST_FRAGMENT_HEADER.lfbufsz. 00367 // 00368 USHORT lfbufsz; 00369 00370 // Opaque datagram label. There is no need to byteswap this field before it 00371 // is setn out on the wire. 00372 // 00373 USHORT dgl; 00374 00375 // Fragment offset. Must be less than or equal to NIC1394_MAX_FRAGMENT_OFFSET. 00376 // This field needs to be byteswapped before it is sent out on the wire. 00377 // 00378 USHORT fragment_offset; 00379 00380 #define NIC1394_MAX_FRAGMENT_OFFSET 0xfff 00381 00382 } NIC1394_FRAGMENT_HEADER, *PNIC1394_FRAGMENT_HEADER; 00383 00384 00385 00386 00387 00388 #define OID_1394_ISSUE_BUS_RESET 0x0C010201 00389 00390 #endif // _NIC1394_H_ 00391 00392 00393

Generated on Sat May 15 19:40:57 2004 for test by doxygen 1.3.7