Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/drivers/s390/net/qeth_mpc.h |
| 3 | * |
| 4 | * Linux on zSeries OSA Express and HiperSockets support |
| 5 | * |
| 6 | * Copyright 2000,2003 IBM Corporation |
| 7 | * Author(s): Utz Bacher <utz.bacher@de.ibm.com> |
| 8 | * Thomas Spatzier <tspat@de.ibm.com> |
| 9 | * Frank Pavlic <pavlic@de.ibm.com> |
| 10 | * |
| 11 | */ |
| 12 | #ifndef __QETH_MPC_H__ |
| 13 | #define __QETH_MPC_H__ |
| 14 | |
| 15 | #include <asm/qeth.h> |
| 16 | |
| 17 | #define VERSION_QETH_MPC_H "$Revision: 1.43 $" |
| 18 | |
| 19 | extern const char *VERSION_QETH_MPC_C; |
| 20 | |
| 21 | #define IPA_PDU_HEADER_SIZE 0x40 |
| 22 | #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e) |
| 23 | #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26) |
| 24 | #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x2a) |
| 25 | #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a) |
| 26 | |
| 27 | extern unsigned char IPA_PDU_HEADER[]; |
| 28 | #define QETH_IPA_CMD_DEST_ADDR(buffer) (buffer+0x2c) |
| 29 | |
| 30 | #define IPA_CMD_LENGTH (IPA_PDU_HEADER_SIZE + sizeof(struct qeth_ipa_cmd)) |
| 31 | |
| 32 | #define QETH_SEQ_NO_LENGTH 4 |
| 33 | #define QETH_MPC_TOKEN_LENGTH 4 |
| 34 | #define QETH_MCL_LENGTH 4 |
| 35 | #define OSA_ADDR_LEN 6 |
| 36 | |
| 37 | #define QETH_TIMEOUT (10 * HZ) |
| 38 | #define QETH_IPA_TIMEOUT (45 * HZ) |
| 39 | #define QETH_IDX_COMMAND_SEQNO 0xffff0000 |
| 40 | #define SR_INFO_LEN 16 |
| 41 | |
| 42 | #define QETH_CLEAR_CHANNEL_PARM -10 |
| 43 | #define QETH_HALT_CHANNEL_PARM -11 |
| 44 | |
| 45 | /*****************************************************************************/ |
| 46 | /* IP Assist related definitions */ |
| 47 | /*****************************************************************************/ |
| 48 | #define IPA_CMD_INITIATOR_HOST 0x00 |
| 49 | #define IPA_CMD_INITIATOR_HYDRA 0x01 |
| 50 | #define IPA_CMD_PRIM_VERSION_NO 0x01 |
| 51 | |
| 52 | enum qeth_card_types { |
| 53 | QETH_CARD_TYPE_UNKNOWN = 0, |
| 54 | QETH_CARD_TYPE_OSAE = 10, |
| 55 | QETH_CARD_TYPE_IQD = 1234, |
| 56 | }; |
| 57 | |
| 58 | #define QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE 0x18 |
| 59 | /* only the first two bytes are looked at in qeth_get_cardname_short */ |
| 60 | enum qeth_link_types { |
| 61 | QETH_LINK_TYPE_FAST_ETH = 0x01, |
| 62 | QETH_LINK_TYPE_HSTR = 0x02, |
| 63 | QETH_LINK_TYPE_GBIT_ETH = 0x03, |
| 64 | QETH_LINK_TYPE_10GBIT_ETH = 0x10, |
| 65 | QETH_LINK_TYPE_LANE_ETH100 = 0x81, |
| 66 | QETH_LINK_TYPE_LANE_TR = 0x82, |
| 67 | QETH_LINK_TYPE_LANE_ETH1000 = 0x83, |
| 68 | QETH_LINK_TYPE_LANE = 0x88, |
| 69 | QETH_LINK_TYPE_ATM_NATIVE = 0x90, |
| 70 | }; |
| 71 | |
| 72 | enum qeth_tr_macaddr_modes { |
| 73 | QETH_TR_MACADDR_NONCANONICAL = 0, |
| 74 | QETH_TR_MACADDR_CANONICAL = 1, |
| 75 | }; |
| 76 | |
| 77 | enum qeth_tr_broadcast_modes { |
| 78 | QETH_TR_BROADCAST_ALLRINGS = 0, |
| 79 | QETH_TR_BROADCAST_LOCAL = 1, |
| 80 | }; |
| 81 | |
| 82 | /* these values match CHECKSUM_* in include/linux/skbuff.h */ |
| 83 | enum qeth_checksum_types { |
| 84 | SW_CHECKSUMMING = 0, /* TODO: set to bit flag used in IPA Command */ |
| 85 | HW_CHECKSUMMING = 1, |
| 86 | NO_CHECKSUMMING = 2, |
| 87 | }; |
| 88 | #define QETH_CHECKSUM_DEFAULT SW_CHECKSUMMING |
| 89 | |
| 90 | /* |
| 91 | * Routing stuff |
| 92 | */ |
| 93 | #define RESET_ROUTING_FLAG 0x10 /* indicate that routing type shall be set */ |
| 94 | enum qeth_routing_types { |
| 95 | NO_ROUTER = 0, /* TODO: set to bit flag used in IPA Command */ |
| 96 | PRIMARY_ROUTER = 1, |
| 97 | SECONDARY_ROUTER = 2, |
| 98 | MULTICAST_ROUTER = 3, |
| 99 | PRIMARY_CONNECTOR = 4, |
| 100 | SECONDARY_CONNECTOR = 5, |
| 101 | }; |
| 102 | |
| 103 | |
| 104 | /* IPA Commands */ |
| 105 | enum qeth_ipa_cmds { |
| 106 | IPA_CMD_STARTLAN = 0x01, |
| 107 | IPA_CMD_STOPLAN = 0x02, |
| 108 | IPA_CMD_SETVMAC = 0x21, |
| 109 | IPA_CMD_DELVMAC = 0x22, |
| 110 | IPA_CMD_SETGMAC = 0x23, |
| 111 | IPA_CMD_DELGMAC = 0x24, |
| 112 | IPA_CMD_SETVLAN = 0x25, |
| 113 | IPA_CMD_DELVLAN = 0x26, |
| 114 | IPA_CMD_SETIP = 0xb1, |
| 115 | IPA_CMD_DELIP = 0xb7, |
| 116 | IPA_CMD_QIPASSIST = 0xb2, |
| 117 | IPA_CMD_SETASSPARMS = 0xb3, |
| 118 | IPA_CMD_SETIPM = 0xb4, |
| 119 | IPA_CMD_DELIPM = 0xb5, |
| 120 | IPA_CMD_SETRTG = 0xb6, |
| 121 | IPA_CMD_SETADAPTERPARMS = 0xb8, |
| 122 | IPA_CMD_IPFRAME = 0xb9, |
| 123 | IPA_CMD_ADD_ADDR_ENTRY = 0xc1, |
| 124 | IPA_CMD_DELETE_ADDR_ENTRY = 0xc2, |
| 125 | IPA_CMD_CREATE_ADDR = 0xc3, |
| 126 | IPA_CMD_DESTROY_ADDR = 0xc4, |
| 127 | IPA_CMD_REGISTER_LOCAL_ADDR = 0xd1, |
| 128 | IPA_CMD_UNREGISTER_LOCAL_ADDR = 0xd2, |
| 129 | }; |
| 130 | |
| 131 | enum qeth_ip_ass_cmds { |
| 132 | IPA_CMD_ASS_START = 0x0001, |
| 133 | IPA_CMD_ASS_STOP = 0x0002, |
| 134 | IPA_CMD_ASS_CONFIGURE = 0x0003, |
| 135 | IPA_CMD_ASS_ENABLE = 0x0004, |
| 136 | }; |
| 137 | |
| 138 | enum qeth_arp_process_subcmds { |
| 139 | IPA_CMD_ASS_ARP_SET_NO_ENTRIES = 0x0003, |
| 140 | IPA_CMD_ASS_ARP_QUERY_CACHE = 0x0004, |
| 141 | IPA_CMD_ASS_ARP_ADD_ENTRY = 0x0005, |
| 142 | IPA_CMD_ASS_ARP_REMOVE_ENTRY = 0x0006, |
| 143 | IPA_CMD_ASS_ARP_FLUSH_CACHE = 0x0007, |
| 144 | IPA_CMD_ASS_ARP_QUERY_INFO = 0x0104, |
| 145 | IPA_CMD_ASS_ARP_QUERY_STATS = 0x0204, |
| 146 | }; |
| 147 | |
| 148 | /* Return Codes for IPA Commands */ |
| 149 | enum qeth_ipa_return_codes { |
| 150 | IPA_RC_SUCCESS = 0x0000, |
| 151 | IPA_RC_NOTSUPP = 0x0001, |
| 152 | IPA_RC_NO_ACCESS = 0x0002, |
| 153 | IPA_RC_FAILED = 0x0003, |
| 154 | IPA_RC_DATA_MISMATCH = 0xe001, |
| 155 | IPA_RC_INVALID_LAN_TYPE = 0xe003, |
| 156 | IPA_RC_INVALID_LAN_NO = 0xe004, |
| 157 | IPA_RC_IPADDR_ALREADY_REG = 0xe005, |
| 158 | IPA_RC_IPADDR_TABLE_FULL = 0xe006, |
| 159 | IPA_RC_IPADDR_ALREADY_USED = 0xe00a, |
| 160 | IPA_RC_ASSNO_NOT_SUPP = 0xe00d, |
| 161 | IPA_RC_ASSCMD_START_FAILED = 0xe00e, |
| 162 | IPA_RC_ASSCMD_PART_SUCCESS = 0xe00f, |
| 163 | IPA_RC_IPADDR_NOT_DEFINED = 0xe010, |
| 164 | IPA_RC_LAN_OFFLINE = 0xe080, |
| 165 | }; |
| 166 | |
| 167 | /* IPA function flags; each flag marks availability of respective function */ |
| 168 | enum qeth_ipa_funcs { |
| 169 | IPA_ARP_PROCESSING = 0x00000001L, |
| 170 | IPA_INBOUND_CHECKSUM = 0x00000002L, |
| 171 | IPA_OUTBOUND_CHECKSUM = 0x00000004L, |
| 172 | IPA_IP_FRAGMENTATION = 0x00000008L, |
| 173 | IPA_FILTERING = 0x00000010L, |
| 174 | IPA_IPV6 = 0x00000020L, |
| 175 | IPA_MULTICASTING = 0x00000040L, |
| 176 | IPA_IP_REASSEMBLY = 0x00000080L, |
| 177 | IPA_QUERY_ARP_COUNTERS = 0x00000100L, |
| 178 | IPA_QUERY_ARP_ADDR_INFO = 0x00000200L, |
| 179 | IPA_SETADAPTERPARMS = 0x00000400L, |
| 180 | IPA_VLAN_PRIO = 0x00000800L, |
| 181 | IPA_PASSTHRU = 0x00001000L, |
| 182 | IPA_FULL_VLAN = 0x00004000L, |
| 183 | IPA_SOURCE_MAC = 0x00010000L, |
| 184 | IPA_OSA_MC_ROUTER = 0x00020000L, |
| 185 | IPA_QUERY_ARP_ASSIST = 0x00040000L, |
| 186 | IPA_INBOUND_TSO = 0x00080000L, |
| 187 | IPA_OUTBOUND_TSO = 0x00100000L, |
| 188 | }; |
| 189 | |
| 190 | /* SETIP/DELIP IPA Command: ***************************************************/ |
| 191 | enum qeth_ipa_setdelip_flags { |
| 192 | QETH_IPA_SETDELIP_DEFAULT = 0x00L, /* default */ |
| 193 | QETH_IPA_SETIP_VIPA_FLAG = 0x01L, /* no grat. ARP */ |
| 194 | QETH_IPA_SETIP_TAKEOVER_FLAG = 0x02L, /* nofail on grat. ARP */ |
| 195 | QETH_IPA_DELIP_ADDR_2_B_TAKEN_OVER = 0x20L, |
| 196 | QETH_IPA_DELIP_VIPA_FLAG = 0x40L, |
| 197 | QETH_IPA_DELIP_ADDR_NEEDS_SETIP = 0x80L, |
| 198 | }; |
| 199 | |
| 200 | /* SETADAPTER IPA Command: ****************************************************/ |
| 201 | enum qeth_ipa_setadp_cmd { |
| 202 | IPA_SETADP_QUERY_COMMANDS_SUPPORTED = 0x01, |
| 203 | IPA_SETADP_ALTER_MAC_ADDRESS = 0x02, |
| 204 | IPA_SETADP_ADD_DELETE_GROUP_ADDRESS = 0x04, |
| 205 | IPA_SETADP_ADD_DELETE_FUNCTIONAL_ADDR = 0x08, |
| 206 | IPA_SETADP_SET_ADDRESSING_MODE = 0x10, |
| 207 | IPA_SETADP_SET_CONFIG_PARMS = 0x20, |
| 208 | IPA_SETADP_SET_CONFIG_PARMS_EXTENDED = 0x40, |
| 209 | IPA_SETADP_SET_BROADCAST_MODE = 0x80, |
| 210 | IPA_SETADP_SEND_OSA_MESSAGE = 0x0100, |
| 211 | IPA_SETADP_SET_SNMP_CONTROL = 0x0200, |
| 212 | IPA_SETADP_READ_SNMP_PARMS = 0x0400, |
| 213 | IPA_SETADP_WRITE_SNMP_PARMS = 0x0800, |
| 214 | IPA_SETADP_QUERY_CARD_INFO = 0x1000, |
| 215 | }; |
| 216 | enum qeth_ipa_mac_ops { |
| 217 | CHANGE_ADDR_READ_MAC = 0, |
| 218 | CHANGE_ADDR_REPLACE_MAC = 1, |
| 219 | CHANGE_ADDR_ADD_MAC = 2, |
| 220 | CHANGE_ADDR_DEL_MAC = 4, |
| 221 | CHANGE_ADDR_RESET_MAC = 8, |
| 222 | }; |
| 223 | enum qeth_ipa_addr_ops { |
| 224 | CHANGE_ADDR_READ_ADDR = 0, |
| 225 | CHANGE_ADDR_ADD_ADDR = 1, |
| 226 | CHANGE_ADDR_DEL_ADDR = 2, |
| 227 | CHANGE_ADDR_FLUSH_ADDR_TABLE = 4, |
| 228 | |
| 229 | |
| 230 | }; |
| 231 | /* (SET)DELIP(M) IPA stuff ***************************************************/ |
| 232 | struct qeth_ipacmd_setdelip4 { |
| 233 | __u8 ip_addr[4]; |
| 234 | __u8 mask[4]; |
| 235 | __u32 flags; |
| 236 | } __attribute__ ((packed)); |
| 237 | |
| 238 | struct qeth_ipacmd_setdelip6 { |
| 239 | __u8 ip_addr[16]; |
| 240 | __u8 mask[16]; |
| 241 | __u32 flags; |
| 242 | } __attribute__ ((packed)); |
| 243 | |
| 244 | struct qeth_ipacmd_setdelipm { |
| 245 | __u8 mac[6]; |
| 246 | __u8 padding[2]; |
| 247 | __u8 ip6[12]; |
| 248 | __u8 ip4[4]; |
| 249 | } __attribute__ ((packed)); |
| 250 | |
| 251 | struct qeth_ipacmd_layer2setdelmac { |
| 252 | __u32 mac_length; |
| 253 | __u8 mac[6]; |
| 254 | } __attribute__ ((packed)); |
| 255 | |
| 256 | struct qeth_ipacmd_layer2setdelvlan { |
| 257 | __u16 vlan_id; |
| 258 | } __attribute__ ((packed)); |
| 259 | |
| 260 | |
| 261 | struct qeth_ipacmd_setassparms_hdr { |
| 262 | __u32 assist_no; |
| 263 | __u16 length; |
| 264 | __u16 command_code; |
| 265 | __u16 return_code; |
| 266 | __u8 number_of_replies; |
| 267 | __u8 seq_no; |
| 268 | } __attribute__((packed)); |
| 269 | |
| 270 | struct qeth_arp_query_data { |
| 271 | __u16 request_bits; |
| 272 | __u16 reply_bits; |
| 273 | __u32 no_entries; |
| 274 | char data; |
| 275 | } __attribute__((packed)); |
| 276 | |
| 277 | /* used as parameter for arp_query reply */ |
| 278 | struct qeth_arp_query_info { |
| 279 | __u32 udata_len; |
| 280 | __u16 mask_bits; |
| 281 | __u32 udata_offset; |
| 282 | __u32 no_entries; |
| 283 | char *udata; |
| 284 | }; |
| 285 | |
| 286 | /* SETASSPARMS IPA Command: */ |
| 287 | struct qeth_ipacmd_setassparms { |
| 288 | struct qeth_ipacmd_setassparms_hdr hdr; |
| 289 | union { |
| 290 | __u32 flags_32bit; |
| 291 | struct qeth_arp_cache_entry add_arp_entry; |
| 292 | struct qeth_arp_query_data query_arp; |
| 293 | __u8 ip[16]; |
| 294 | } data; |
| 295 | } __attribute__ ((packed)); |
| 296 | |
| 297 | |
| 298 | /* SETRTG IPA Command: ****************************************************/ |
| 299 | struct qeth_set_routing { |
| 300 | __u8 type; |
| 301 | }; |
| 302 | |
| 303 | /* SETADAPTERPARMS IPA Command: *******************************************/ |
| 304 | struct qeth_query_cmds_supp { |
| 305 | __u32 no_lantypes_supp; |
| 306 | __u8 lan_type; |
| 307 | __u8 reserved1[3]; |
| 308 | __u32 supported_cmds; |
| 309 | __u8 reserved2[8]; |
| 310 | } __attribute__ ((packed)); |
| 311 | |
| 312 | struct qeth_change_addr { |
| 313 | __u32 cmd; |
| 314 | __u32 addr_size; |
| 315 | __u32 no_macs; |
| 316 | __u8 addr[OSA_ADDR_LEN]; |
| 317 | } __attribute__ ((packed)); |
| 318 | |
| 319 | |
| 320 | struct qeth_snmp_cmd { |
| 321 | __u8 token[16]; |
| 322 | __u32 request; |
| 323 | __u32 interface; |
| 324 | __u32 returncode; |
| 325 | __u32 firmwarelevel; |
| 326 | __u32 seqno; |
| 327 | __u8 data; |
| 328 | } __attribute__ ((packed)); |
| 329 | |
| 330 | struct qeth_snmp_ureq_hdr { |
| 331 | __u32 data_len; |
| 332 | __u32 req_len; |
| 333 | __u32 reserved1; |
| 334 | __u32 reserved2; |
| 335 | } __attribute__ ((packed)); |
| 336 | |
| 337 | struct qeth_snmp_ureq { |
| 338 | struct qeth_snmp_ureq_hdr hdr; |
| 339 | struct qeth_snmp_cmd cmd; |
| 340 | } __attribute__((packed)); |
| 341 | |
| 342 | struct qeth_ipacmd_setadpparms_hdr { |
| 343 | __u32 supp_hw_cmds; |
| 344 | __u32 reserved1; |
| 345 | __u16 cmdlength; |
| 346 | __u16 reserved2; |
| 347 | __u32 command_code; |
| 348 | __u16 return_code; |
| 349 | __u8 used_total; |
| 350 | __u8 seq_no; |
| 351 | __u32 reserved3; |
| 352 | } __attribute__ ((packed)); |
| 353 | |
| 354 | struct qeth_ipacmd_setadpparms { |
| 355 | struct qeth_ipacmd_setadpparms_hdr hdr; |
| 356 | union { |
| 357 | struct qeth_query_cmds_supp query_cmds_supp; |
| 358 | struct qeth_change_addr change_addr; |
| 359 | struct qeth_snmp_cmd snmp; |
| 360 | __u32 mode; |
| 361 | } data; |
| 362 | } __attribute__ ((packed)); |
| 363 | |
| 364 | /* IPFRAME IPA Command: ***************************************************/ |
| 365 | /* TODO: define in analogy to commands define above */ |
| 366 | |
| 367 | /* ADD_ADDR_ENTRY IPA Command: ********************************************/ |
| 368 | /* TODO: define in analogy to commands define above */ |
| 369 | |
| 370 | /* DELETE_ADDR_ENTRY IPA Command: *****************************************/ |
| 371 | /* TODO: define in analogy to commands define above */ |
| 372 | |
| 373 | /* CREATE_ADDR IPA Command: ***********************************************/ |
| 374 | struct qeth_create_destroy_address { |
| 375 | __u8 unique_id[8]; |
| 376 | } __attribute__ ((packed)); |
| 377 | |
| 378 | /* REGISTER_LOCAL_ADDR IPA Command: ***************************************/ |
| 379 | /* TODO: define in analogy to commands define above */ |
| 380 | |
| 381 | /* UNREGISTER_LOCAL_ADDR IPA Command: *************************************/ |
| 382 | /* TODO: define in analogy to commands define above */ |
| 383 | |
| 384 | /* Header for each IPA command */ |
| 385 | struct qeth_ipacmd_hdr { |
| 386 | __u8 command; |
| 387 | __u8 initiator; |
| 388 | __u16 seqno; |
| 389 | __u16 return_code; |
| 390 | __u8 adapter_type; |
| 391 | __u8 rel_adapter_no; |
| 392 | __u8 prim_version_no; |
| 393 | __u8 param_count; |
| 394 | __u16 prot_version; |
| 395 | __u32 ipa_supported; |
| 396 | __u32 ipa_enabled; |
| 397 | } __attribute__ ((packed)); |
| 398 | |
| 399 | /* The IPA command itself */ |
| 400 | struct qeth_ipa_cmd { |
| 401 | struct qeth_ipacmd_hdr hdr; |
| 402 | union { |
| 403 | struct qeth_ipacmd_setdelip4 setdelip4; |
| 404 | struct qeth_ipacmd_setdelip6 setdelip6; |
| 405 | struct qeth_ipacmd_setdelipm setdelipm; |
| 406 | struct qeth_ipacmd_setassparms setassparms; |
| 407 | struct qeth_ipacmd_layer2setdelmac setdelmac; |
| 408 | struct qeth_ipacmd_layer2setdelvlan setdelvlan; |
| 409 | struct qeth_create_destroy_address create_destroy_addr; |
| 410 | struct qeth_ipacmd_setadpparms setadapterparms; |
| 411 | struct qeth_set_routing setrtg; |
| 412 | } data; |
| 413 | } __attribute__ ((packed)); |
| 414 | |
| 415 | /* |
| 416 | * special command for ARP processing. |
| 417 | * this is not included in setassparms command before, because we get |
| 418 | * problem with the size of struct qeth_ipacmd_setassparms otherwise |
| 419 | */ |
| 420 | enum qeth_ipa_arp_return_codes { |
| 421 | QETH_IPA_ARP_RC_SUCCESS = 0x0000, |
| 422 | QETH_IPA_ARP_RC_FAILED = 0x0001, |
| 423 | QETH_IPA_ARP_RC_NOTSUPP = 0x0002, |
| 424 | QETH_IPA_ARP_RC_OUT_OF_RANGE = 0x0003, |
| 425 | QETH_IPA_ARP_RC_Q_NOTSUPP = 0x0004, |
| 426 | QETH_IPA_ARP_RC_Q_NO_DATA = 0x0008, |
| 427 | }; |
| 428 | |
| 429 | #define QETH_SETASS_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \ |
| 430 | sizeof(struct qeth_ipacmd_setassparms_hdr)) |
| 431 | #define QETH_IPA_ARP_DATA_POS(buffer) (buffer + IPA_PDU_HEADER_SIZE + \ |
| 432 | QETH_SETASS_BASE_LEN) |
| 433 | #define QETH_SETADP_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \ |
| 434 | sizeof(struct qeth_ipacmd_setadpparms_hdr)) |
| 435 | #define QETH_SNMP_SETADP_CMDLENGTH 16 |
| 436 | |
| 437 | #define QETH_ARP_DATA_SIZE 3968 |
| 438 | #define QETH_ARP_CMD_LEN (QETH_ARP_DATA_SIZE + 8) |
| 439 | /* Helper functions */ |
| 440 | #define IS_IPA_REPLY(cmd) (cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) |
| 441 | |
| 442 | /*****************************************************************************/ |
| 443 | /* END OF IP Assist related definitions */ |
| 444 | /*****************************************************************************/ |
| 445 | |
| 446 | |
| 447 | extern unsigned char WRITE_CCW[]; |
| 448 | extern unsigned char READ_CCW[]; |
| 449 | |
| 450 | extern unsigned char CM_ENABLE[]; |
| 451 | #define CM_ENABLE_SIZE 0x63 |
| 452 | #define QETH_CM_ENABLE_ISSUER_RM_TOKEN(buffer) (buffer+0x2c) |
| 453 | #define QETH_CM_ENABLE_FILTER_TOKEN(buffer) (buffer+0x53) |
| 454 | #define QETH_CM_ENABLE_USER_DATA(buffer) (buffer+0x5b) |
| 455 | |
| 456 | #define QETH_CM_ENABLE_RESP_FILTER_TOKEN(buffer) \ |
| 457 | (PDU_ENCAPSULATION(buffer)+ 0x13) |
| 458 | |
| 459 | |
| 460 | extern unsigned char CM_SETUP[]; |
| 461 | #define CM_SETUP_SIZE 0x64 |
| 462 | #define QETH_CM_SETUP_DEST_ADDR(buffer) (buffer+0x2c) |
| 463 | #define QETH_CM_SETUP_CONNECTION_TOKEN(buffer) (buffer+0x51) |
| 464 | #define QETH_CM_SETUP_FILTER_TOKEN(buffer) (buffer+0x5a) |
| 465 | |
| 466 | #define QETH_CM_SETUP_RESP_DEST_ADDR(buffer) \ |
| 467 | (PDU_ENCAPSULATION(buffer) + 0x1a) |
| 468 | |
| 469 | extern unsigned char ULP_ENABLE[]; |
| 470 | #define ULP_ENABLE_SIZE 0x6b |
| 471 | #define QETH_ULP_ENABLE_LINKNUM(buffer) (buffer+0x61) |
| 472 | #define QETH_ULP_ENABLE_DEST_ADDR(buffer) (buffer+0x2c) |
| 473 | #define QETH_ULP_ENABLE_FILTER_TOKEN(buffer) (buffer+0x53) |
| 474 | #define QETH_ULP_ENABLE_PORTNAME_AND_LL(buffer) (buffer+0x62) |
| 475 | #define QETH_ULP_ENABLE_RESP_FILTER_TOKEN(buffer) \ |
| 476 | (PDU_ENCAPSULATION(buffer) + 0x13) |
| 477 | #define QETH_ULP_ENABLE_RESP_MAX_MTU(buffer) \ |
| 478 | (PDU_ENCAPSULATION(buffer)+ 0x1f) |
| 479 | #define QETH_ULP_ENABLE_RESP_DIFINFO_LEN(buffer) \ |
| 480 | (PDU_ENCAPSULATION(buffer) + 0x17) |
| 481 | #define QETH_ULP_ENABLE_RESP_LINK_TYPE(buffer) \ |
| 482 | (PDU_ENCAPSULATION(buffer)+ 0x2b) |
| 483 | /* Layer 2 defintions */ |
| 484 | #define QETH_PROT_LAYER2 0x08 |
| 485 | #define QETH_PROT_TCPIP 0x03 |
| 486 | #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50) |
| 487 | #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19) |
| 488 | |
| 489 | extern unsigned char ULP_SETUP[]; |
| 490 | #define ULP_SETUP_SIZE 0x6c |
| 491 | #define QETH_ULP_SETUP_DEST_ADDR(buffer) (buffer+0x2c) |
| 492 | #define QETH_ULP_SETUP_CONNECTION_TOKEN(buffer) (buffer+0x51) |
| 493 | #define QETH_ULP_SETUP_FILTER_TOKEN(buffer) (buffer+0x5a) |
| 494 | #define QETH_ULP_SETUP_CUA(buffer) (buffer+0x68) |
| 495 | #define QETH_ULP_SETUP_REAL_DEVADDR(buffer) (buffer+0x6a) |
| 496 | |
| 497 | #define QETH_ULP_SETUP_RESP_CONNECTION_TOKEN(buffer) \ |
| 498 | (PDU_ENCAPSULATION(buffer)+0x1a) |
| 499 | |
| 500 | |
| 501 | extern unsigned char DM_ACT[]; |
| 502 | #define DM_ACT_SIZE 0x55 |
| 503 | #define QETH_DM_ACT_DEST_ADDR(buffer) (buffer+0x2c) |
| 504 | #define QETH_DM_ACT_CONNECTION_TOKEN(buffer) (buffer+0x51) |
| 505 | |
| 506 | |
| 507 | |
| 508 | #define QETH_TRANSPORT_HEADER_SEQ_NO(buffer) (buffer+4) |
| 509 | #define QETH_PDU_HEADER_SEQ_NO(buffer) (buffer+0x1c) |
| 510 | #define QETH_PDU_HEADER_ACK_SEQ_NO(buffer) (buffer+0x20) |
| 511 | |
| 512 | extern unsigned char IDX_ACTIVATE_READ[]; |
| 513 | extern unsigned char IDX_ACTIVATE_WRITE[]; |
| 514 | |
| 515 | #define IDX_ACTIVATE_SIZE 0x22 |
| 516 | #define QETH_IDX_ACT_ISSUER_RM_TOKEN(buffer) (buffer+0x0c) |
| 517 | #define QETH_IDX_NO_PORTNAME_REQUIRED(buffer) ((buffer)[0x0b]&0x80) |
| 518 | #define QETH_IDX_ACT_FUNC_LEVEL(buffer) (buffer+0x10) |
| 519 | #define QETH_IDX_ACT_DATASET_NAME(buffer) (buffer+0x16) |
| 520 | #define QETH_IDX_ACT_QDIO_DEV_CUA(buffer) (buffer+0x1e) |
| 521 | #define QETH_IDX_ACT_QDIO_DEV_REALADDR(buffer) (buffer+0x20) |
| 522 | #define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08]&3)==2) |
| 523 | #define QETH_IDX_REPLY_LEVEL(buffer) (buffer+0x12) |
| 524 | |
| 525 | #define PDU_ENCAPSULATION(buffer) \ |
| 526 | (buffer + *(buffer + (*(buffer+0x0b)) + \ |
| 527 | *(buffer + *(buffer+0x0b)+0x11) +0x07)) |
| 528 | |
| 529 | #define IS_IPA(buffer) \ |
| 530 | ((buffer) && \ |
| 531 | ( *(buffer + ((*(buffer+0x0b))+4) )==0xc1) ) |
| 532 | |
| 533 | #define ADDR_FRAME_TYPE_DIX 1 |
| 534 | #define ADDR_FRAME_TYPE_802_3 2 |
| 535 | #define ADDR_FRAME_TYPE_TR_WITHOUT_SR 0x10 |
| 536 | #define ADDR_FRAME_TYPE_TR_WITH_SR 0x20 |
| 537 | |
| 538 | #endif |