Use access mode instead of open flags to determine needed permissions
[pv_ops_mirror.git] / drivers / s390 / net / qeth_mpc.h
blob6de2da5ed5fd6da2234c050efbf912b4caee9231
1 /*
2 * linux/drivers/s390/net/qeth_mpc.h
4 * Linux on zSeries OSA Express and HiperSockets support
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 <fpavlic@de.ibm.com>
12 #ifndef __QETH_MPC_H__
13 #define __QETH_MPC_H__
15 #include <asm/qeth.h>
17 #define IPA_PDU_HEADER_SIZE 0x40
18 #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer+0x0e)
19 #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer+0x26)
20 #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer+0x29)
21 #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer+0x3a)
23 extern unsigned char IPA_PDU_HEADER[];
24 #define QETH_IPA_CMD_DEST_ADDR(buffer) (buffer+0x2c)
26 #define IPA_CMD_LENGTH (IPA_PDU_HEADER_SIZE + sizeof(struct qeth_ipa_cmd))
28 #define QETH_SEQ_NO_LENGTH 4
29 #define QETH_MPC_TOKEN_LENGTH 4
30 #define QETH_MCL_LENGTH 4
31 #define OSA_ADDR_LEN 6
33 #define QETH_TIMEOUT (10 * HZ)
34 #define QETH_IPA_TIMEOUT (45 * HZ)
35 #define QETH_IDX_COMMAND_SEQNO 0xffff0000
36 #define SR_INFO_LEN 16
38 #define QETH_CLEAR_CHANNEL_PARM -10
39 #define QETH_HALT_CHANNEL_PARM -11
40 #define QETH_RCD_PARM -12
42 /*****************************************************************************/
43 /* IP Assist related definitions */
44 /*****************************************************************************/
45 #define IPA_CMD_INITIATOR_HOST 0x00
46 #define IPA_CMD_INITIATOR_OSA 0x01
47 #define IPA_CMD_INITIATOR_HOST_REPLY 0x80
48 #define IPA_CMD_INITIATOR_OSA_REPLY 0x81
49 #define IPA_CMD_PRIM_VERSION_NO 0x01
51 enum qeth_card_types {
52 QETH_CARD_TYPE_UNKNOWN = 0,
53 QETH_CARD_TYPE_OSAE = 10,
54 QETH_CARD_TYPE_IQD = 1234,
55 QETH_CARD_TYPE_OSN = 11,
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_OSN = 0x04,
65 QETH_LINK_TYPE_10GBIT_ETH = 0x10,
66 QETH_LINK_TYPE_LANE_ETH100 = 0x81,
67 QETH_LINK_TYPE_LANE_TR = 0x82,
68 QETH_LINK_TYPE_LANE_ETH1000 = 0x83,
69 QETH_LINK_TYPE_LANE = 0x88,
70 QETH_LINK_TYPE_ATM_NATIVE = 0x90,
73 enum qeth_tr_macaddr_modes {
74 QETH_TR_MACADDR_NONCANONICAL = 0,
75 QETH_TR_MACADDR_CANONICAL = 1,
78 enum qeth_tr_broadcast_modes {
79 QETH_TR_BROADCAST_ALLRINGS = 0,
80 QETH_TR_BROADCAST_LOCAL = 1,
83 /* these values match CHECKSUM_* in include/linux/skbuff.h */
84 enum qeth_checksum_types {
85 SW_CHECKSUMMING = 0, /* TODO: set to bit flag used in IPA Command */
86 HW_CHECKSUMMING = 1,
87 NO_CHECKSUMMING = 2,
89 #define QETH_CHECKSUM_DEFAULT SW_CHECKSUMMING
92 * Routing stuff
94 #define RESET_ROUTING_FLAG 0x10 /* indicate that routing type shall be set */
95 enum qeth_routing_types {
96 NO_ROUTER = 0, /* TODO: set to bit flag used in IPA Command */
97 PRIMARY_ROUTER = 1,
98 SECONDARY_ROUTER = 2,
99 MULTICAST_ROUTER = 3,
100 PRIMARY_CONNECTOR = 4,
101 SECONDARY_CONNECTOR = 5,
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_SETCCID = 0x41,
115 IPA_CMD_DELCCID = 0x42,
116 IPA_CMD_MODCCID = 0x43,
117 IPA_CMD_SETIP = 0xb1,
118 IPA_CMD_QIPASSIST = 0xb2,
119 IPA_CMD_SETASSPARMS = 0xb3,
120 IPA_CMD_SETIPM = 0xb4,
121 IPA_CMD_DELIPM = 0xb5,
122 IPA_CMD_SETRTG = 0xb6,
123 IPA_CMD_DELIP = 0xb7,
124 IPA_CMD_SETADAPTERPARMS = 0xb8,
125 IPA_CMD_SET_DIAG_ASS = 0xb9,
126 IPA_CMD_CREATE_ADDR = 0xc3,
127 IPA_CMD_DESTROY_ADDR = 0xc4,
128 IPA_CMD_REGISTER_LOCAL_ADDR = 0xd1,
129 IPA_CMD_UNREGISTER_LOCAL_ADDR = 0xd2,
130 IPA_CMD_UNKNOWN = 0x00
133 enum qeth_ip_ass_cmds {
134 IPA_CMD_ASS_START = 0x0001,
135 IPA_CMD_ASS_STOP = 0x0002,
136 IPA_CMD_ASS_CONFIGURE = 0x0003,
137 IPA_CMD_ASS_ENABLE = 0x0004,
140 enum qeth_arp_process_subcmds {
141 IPA_CMD_ASS_ARP_SET_NO_ENTRIES = 0x0003,
142 IPA_CMD_ASS_ARP_QUERY_CACHE = 0x0004,
143 IPA_CMD_ASS_ARP_ADD_ENTRY = 0x0005,
144 IPA_CMD_ASS_ARP_REMOVE_ENTRY = 0x0006,
145 IPA_CMD_ASS_ARP_FLUSH_CACHE = 0x0007,
146 IPA_CMD_ASS_ARP_QUERY_INFO = 0x0104,
147 IPA_CMD_ASS_ARP_QUERY_STATS = 0x0204,
151 /* Return Codes for IPA Commands
152 * according to OSA card Specs */
154 enum qeth_ipa_return_codes {
155 IPA_RC_SUCCESS = 0x0000,
156 IPA_RC_NOTSUPP = 0x0001,
157 IPA_RC_IP_TABLE_FULL = 0x0002,
158 IPA_RC_UNKNOWN_ERROR = 0x0003,
159 IPA_RC_UNSUPPORTED_COMMAND = 0x0004,
160 IPA_RC_DUP_IPV6_REMOTE = 0x0008,
161 IPA_RC_DUP_IPV6_HOME = 0x0010,
162 IPA_RC_UNREGISTERED_ADDR = 0x0011,
163 IPA_RC_NO_ID_AVAILABLE = 0x0012,
164 IPA_RC_ID_NOT_FOUND = 0x0013,
165 IPA_RC_INVALID_IP_VERSION = 0x0020,
166 IPA_RC_LAN_FRAME_MISMATCH = 0x0040,
167 IPA_RC_L2_UNSUPPORTED_CMD = 0x2003,
168 IPA_RC_L2_DUP_MAC = 0x2005,
169 IPA_RC_L2_ADDR_TABLE_FULL = 0x2006,
170 IPA_RC_L2_DUP_LAYER3_MAC = 0x200a,
171 IPA_RC_L2_GMAC_NOT_FOUND = 0x200b,
172 IPA_RC_L2_MAC_NOT_FOUND = 0x2010,
173 IPA_RC_L2_INVALID_VLAN_ID = 0x2015,
174 IPA_RC_L2_DUP_VLAN_ID = 0x2016,
175 IPA_RC_L2_VLAN_ID_NOT_FOUND = 0x2017,
176 IPA_RC_DATA_MISMATCH = 0xe001,
177 IPA_RC_INVALID_MTU_SIZE = 0xe002,
178 IPA_RC_INVALID_LANTYPE = 0xe003,
179 IPA_RC_INVALID_LANNUM = 0xe004,
180 IPA_RC_DUPLICATE_IP_ADDRESS = 0xe005,
181 IPA_RC_IP_ADDR_TABLE_FULL = 0xe006,
182 IPA_RC_LAN_PORT_STATE_ERROR = 0xe007,
183 IPA_RC_SETIP_NO_STARTLAN = 0xe008,
184 IPA_RC_SETIP_ALREADY_RECEIVED = 0xe009,
185 IPA_RC_IP_ADDR_ALREADY_USED = 0xe00a,
186 IPA_RC_MULTICAST_FULL = 0xe00b,
187 IPA_RC_SETIP_INVALID_VERSION = 0xe00d,
188 IPA_RC_UNSUPPORTED_SUBCMD = 0xe00e,
189 IPA_RC_ARP_ASSIST_NO_ENABLE = 0xe00f,
190 IPA_RC_PRIMARY_ALREADY_DEFINED = 0xe010,
191 IPA_RC_SECOND_ALREADY_DEFINED = 0xe011,
192 IPA_RC_INVALID_SETRTG_INDICATOR = 0xe012,
193 IPA_RC_MC_ADDR_ALREADY_DEFINED = 0xe013,
194 IPA_RC_LAN_OFFLINE = 0xe080,
195 IPA_RC_INVALID_IP_VERSION2 = 0xf001,
196 IPA_RC_FFFF = 0xffff
199 /* IPA function flags; each flag marks availability of respective function */
200 enum qeth_ipa_funcs {
201 IPA_ARP_PROCESSING = 0x00000001L,
202 IPA_INBOUND_CHECKSUM = 0x00000002L,
203 IPA_OUTBOUND_CHECKSUM = 0x00000004L,
204 IPA_IP_FRAGMENTATION = 0x00000008L,
205 IPA_FILTERING = 0x00000010L,
206 IPA_IPV6 = 0x00000020L,
207 IPA_MULTICASTING = 0x00000040L,
208 IPA_IP_REASSEMBLY = 0x00000080L,
209 IPA_QUERY_ARP_COUNTERS = 0x00000100L,
210 IPA_QUERY_ARP_ADDR_INFO = 0x00000200L,
211 IPA_SETADAPTERPARMS = 0x00000400L,
212 IPA_VLAN_PRIO = 0x00000800L,
213 IPA_PASSTHRU = 0x00001000L,
214 IPA_FLUSH_ARP_SUPPORT = 0x00002000L,
215 IPA_FULL_VLAN = 0x00004000L,
216 IPA_INBOUND_PASSTHRU = 0x00008000L,
217 IPA_SOURCE_MAC = 0x00010000L,
218 IPA_OSA_MC_ROUTER = 0x00020000L,
219 IPA_QUERY_ARP_ASSIST = 0x00040000L,
220 IPA_INBOUND_TSO = 0x00080000L,
221 IPA_OUTBOUND_TSO = 0x00100000L,
224 /* SETIP/DELIP IPA Command: ***************************************************/
225 enum qeth_ipa_setdelip_flags {
226 QETH_IPA_SETDELIP_DEFAULT = 0x00L, /* default */
227 QETH_IPA_SETIP_VIPA_FLAG = 0x01L, /* no grat. ARP */
228 QETH_IPA_SETIP_TAKEOVER_FLAG = 0x02L, /* nofail on grat. ARP */
229 QETH_IPA_DELIP_ADDR_2_B_TAKEN_OVER = 0x20L,
230 QETH_IPA_DELIP_VIPA_FLAG = 0x40L,
231 QETH_IPA_DELIP_ADDR_NEEDS_SETIP = 0x80L,
234 /* SETADAPTER IPA Command: ****************************************************/
235 enum qeth_ipa_setadp_cmd {
236 IPA_SETADP_QUERY_COMMANDS_SUPPORTED = 0x01,
237 IPA_SETADP_ALTER_MAC_ADDRESS = 0x02,
238 IPA_SETADP_ADD_DELETE_GROUP_ADDRESS = 0x04,
239 IPA_SETADP_ADD_DELETE_FUNCTIONAL_ADDR = 0x08,
240 IPA_SETADP_SET_ADDRESSING_MODE = 0x10,
241 IPA_SETADP_SET_CONFIG_PARMS = 0x20,
242 IPA_SETADP_SET_CONFIG_PARMS_EXTENDED = 0x40,
243 IPA_SETADP_SET_BROADCAST_MODE = 0x80,
244 IPA_SETADP_SEND_OSA_MESSAGE = 0x0100,
245 IPA_SETADP_SET_SNMP_CONTROL = 0x0200,
246 IPA_SETADP_QUERY_CARD_INFO = 0x0400,
247 IPA_SETADP_SET_PROMISC_MODE = 0x0800,
249 enum qeth_ipa_mac_ops {
250 CHANGE_ADDR_READ_MAC = 0,
251 CHANGE_ADDR_REPLACE_MAC = 1,
252 CHANGE_ADDR_ADD_MAC = 2,
253 CHANGE_ADDR_DEL_MAC = 4,
254 CHANGE_ADDR_RESET_MAC = 8,
256 enum qeth_ipa_addr_ops {
257 CHANGE_ADDR_READ_ADDR = 0,
258 CHANGE_ADDR_ADD_ADDR = 1,
259 CHANGE_ADDR_DEL_ADDR = 2,
260 CHANGE_ADDR_FLUSH_ADDR_TABLE = 4,
262 enum qeth_ipa_promisc_modes {
263 SET_PROMISC_MODE_OFF = 0,
264 SET_PROMISC_MODE_ON = 1,
267 /* (SET)DELIP(M) IPA stuff ***************************************************/
268 struct qeth_ipacmd_setdelip4 {
269 __u8 ip_addr[4];
270 __u8 mask[4];
271 __u32 flags;
272 } __attribute__ ((packed));
274 struct qeth_ipacmd_setdelip6 {
275 __u8 ip_addr[16];
276 __u8 mask[16];
277 __u32 flags;
278 } __attribute__ ((packed));
280 struct qeth_ipacmd_setdelipm {
281 __u8 mac[6];
282 __u8 padding[2];
283 __u8 ip6[12];
284 __u8 ip4[4];
285 } __attribute__ ((packed));
287 struct qeth_ipacmd_layer2setdelmac {
288 __u32 mac_length;
289 __u8 mac[6];
290 } __attribute__ ((packed));
292 struct qeth_ipacmd_layer2setdelvlan {
293 __u16 vlan_id;
294 } __attribute__ ((packed));
297 struct qeth_ipacmd_setassparms_hdr {
298 __u32 assist_no;
299 __u16 length;
300 __u16 command_code;
301 __u16 return_code;
302 __u8 number_of_replies;
303 __u8 seq_no;
304 } __attribute__((packed));
306 struct qeth_arp_query_data {
307 __u16 request_bits;
308 __u16 reply_bits;
309 __u32 no_entries;
310 char data;
311 } __attribute__((packed));
313 /* used as parameter for arp_query reply */
314 struct qeth_arp_query_info {
315 __u32 udata_len;
316 __u16 mask_bits;
317 __u32 udata_offset;
318 __u32 no_entries;
319 char *udata;
322 /* SETASSPARMS IPA Command: */
323 struct qeth_ipacmd_setassparms {
324 struct qeth_ipacmd_setassparms_hdr hdr;
325 union {
326 __u32 flags_32bit;
327 struct qeth_arp_cache_entry add_arp_entry;
328 struct qeth_arp_query_data query_arp;
329 __u8 ip[16];
330 } data;
331 } __attribute__ ((packed));
334 /* SETRTG IPA Command: ****************************************************/
335 struct qeth_set_routing {
336 __u8 type;
339 /* SETADAPTERPARMS IPA Command: *******************************************/
340 struct qeth_query_cmds_supp {
341 __u32 no_lantypes_supp;
342 __u8 lan_type;
343 __u8 reserved1[3];
344 __u32 supported_cmds;
345 __u8 reserved2[8];
346 } __attribute__ ((packed));
348 struct qeth_change_addr {
349 __u32 cmd;
350 __u32 addr_size;
351 __u32 no_macs;
352 __u8 addr[OSA_ADDR_LEN];
353 } __attribute__ ((packed));
356 struct qeth_snmp_cmd {
357 __u8 token[16];
358 __u32 request;
359 __u32 interface;
360 __u32 returncode;
361 __u32 firmwarelevel;
362 __u32 seqno;
363 __u8 data;
364 } __attribute__ ((packed));
366 struct qeth_snmp_ureq_hdr {
367 __u32 data_len;
368 __u32 req_len;
369 __u32 reserved1;
370 __u32 reserved2;
371 } __attribute__ ((packed));
373 struct qeth_snmp_ureq {
374 struct qeth_snmp_ureq_hdr hdr;
375 struct qeth_snmp_cmd cmd;
376 } __attribute__((packed));
378 struct qeth_ipacmd_setadpparms_hdr {
379 __u32 supp_hw_cmds;
380 __u32 reserved1;
381 __u16 cmdlength;
382 __u16 reserved2;
383 __u32 command_code;
384 __u16 return_code;
385 __u8 used_total;
386 __u8 seq_no;
387 __u32 reserved3;
388 } __attribute__ ((packed));
390 struct qeth_ipacmd_setadpparms {
391 struct qeth_ipacmd_setadpparms_hdr hdr;
392 union {
393 struct qeth_query_cmds_supp query_cmds_supp;
394 struct qeth_change_addr change_addr;
395 struct qeth_snmp_cmd snmp;
396 __u32 mode;
397 } data;
398 } __attribute__ ((packed));
400 /* IPFRAME IPA Command: ***************************************************/
401 /* TODO: define in analogy to commands define above */
403 /* ADD_ADDR_ENTRY IPA Command: ********************************************/
404 /* TODO: define in analogy to commands define above */
406 /* DELETE_ADDR_ENTRY IPA Command: *****************************************/
407 /* TODO: define in analogy to commands define above */
409 /* CREATE_ADDR IPA Command: ***********************************************/
410 struct qeth_create_destroy_address {
411 __u8 unique_id[8];
412 } __attribute__ ((packed));
414 /* REGISTER_LOCAL_ADDR IPA Command: ***************************************/
415 /* TODO: define in analogy to commands define above */
417 /* UNREGISTER_LOCAL_ADDR IPA Command: *************************************/
418 /* TODO: define in analogy to commands define above */
420 /* Header for each IPA command */
421 struct qeth_ipacmd_hdr {
422 __u8 command;
423 __u8 initiator;
424 __u16 seqno;
425 __u16 return_code;
426 __u8 adapter_type;
427 __u8 rel_adapter_no;
428 __u8 prim_version_no;
429 __u8 param_count;
430 __u16 prot_version;
431 __u32 ipa_supported;
432 __u32 ipa_enabled;
433 } __attribute__ ((packed));
435 /* The IPA command itself */
436 struct qeth_ipa_cmd {
437 struct qeth_ipacmd_hdr hdr;
438 union {
439 struct qeth_ipacmd_setdelip4 setdelip4;
440 struct qeth_ipacmd_setdelip6 setdelip6;
441 struct qeth_ipacmd_setdelipm setdelipm;
442 struct qeth_ipacmd_setassparms setassparms;
443 struct qeth_ipacmd_layer2setdelmac setdelmac;
444 struct qeth_ipacmd_layer2setdelvlan setdelvlan;
445 struct qeth_create_destroy_address create_destroy_addr;
446 struct qeth_ipacmd_setadpparms setadapterparms;
447 struct qeth_set_routing setrtg;
448 } data;
449 } __attribute__ ((packed));
452 * special command for ARP processing.
453 * this is not included in setassparms command before, because we get
454 * problem with the size of struct qeth_ipacmd_setassparms otherwise
456 enum qeth_ipa_arp_return_codes {
457 QETH_IPA_ARP_RC_SUCCESS = 0x0000,
458 QETH_IPA_ARP_RC_FAILED = 0x0001,
459 QETH_IPA_ARP_RC_NOTSUPP = 0x0002,
460 QETH_IPA_ARP_RC_OUT_OF_RANGE = 0x0003,
461 QETH_IPA_ARP_RC_Q_NOTSUPP = 0x0004,
462 QETH_IPA_ARP_RC_Q_NO_DATA = 0x0008,
466 extern char *
467 qeth_get_ipa_msg(enum qeth_ipa_return_codes rc);
468 extern char *
469 qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd);
471 #define QETH_SETASS_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \
472 sizeof(struct qeth_ipacmd_setassparms_hdr))
473 #define QETH_IPA_ARP_DATA_POS(buffer) (buffer + IPA_PDU_HEADER_SIZE + \
474 QETH_SETASS_BASE_LEN)
475 #define QETH_SETADP_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \
476 sizeof(struct qeth_ipacmd_setadpparms_hdr))
477 #define QETH_SNMP_SETADP_CMDLENGTH 16
479 #define QETH_ARP_DATA_SIZE 3968
480 #define QETH_ARP_CMD_LEN (QETH_ARP_DATA_SIZE + 8)
481 /* Helper functions */
482 #define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \
483 (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY))
485 /*****************************************************************************/
486 /* END OF IP Assist related definitions */
487 /*****************************************************************************/
490 extern unsigned char WRITE_CCW[];
491 extern unsigned char READ_CCW[];
493 extern unsigned char CM_ENABLE[];
494 #define CM_ENABLE_SIZE 0x63
495 #define QETH_CM_ENABLE_ISSUER_RM_TOKEN(buffer) (buffer+0x2c)
496 #define QETH_CM_ENABLE_FILTER_TOKEN(buffer) (buffer+0x53)
497 #define QETH_CM_ENABLE_USER_DATA(buffer) (buffer+0x5b)
499 #define QETH_CM_ENABLE_RESP_FILTER_TOKEN(buffer) \
500 (PDU_ENCAPSULATION(buffer)+ 0x13)
503 extern unsigned char CM_SETUP[];
504 #define CM_SETUP_SIZE 0x64
505 #define QETH_CM_SETUP_DEST_ADDR(buffer) (buffer+0x2c)
506 #define QETH_CM_SETUP_CONNECTION_TOKEN(buffer) (buffer+0x51)
507 #define QETH_CM_SETUP_FILTER_TOKEN(buffer) (buffer+0x5a)
509 #define QETH_CM_SETUP_RESP_DEST_ADDR(buffer) \
510 (PDU_ENCAPSULATION(buffer) + 0x1a)
512 extern unsigned char ULP_ENABLE[];
513 #define ULP_ENABLE_SIZE 0x6b
514 #define QETH_ULP_ENABLE_LINKNUM(buffer) (buffer+0x61)
515 #define QETH_ULP_ENABLE_DEST_ADDR(buffer) (buffer+0x2c)
516 #define QETH_ULP_ENABLE_FILTER_TOKEN(buffer) (buffer+0x53)
517 #define QETH_ULP_ENABLE_PORTNAME_AND_LL(buffer) (buffer+0x62)
518 #define QETH_ULP_ENABLE_RESP_FILTER_TOKEN(buffer) \
519 (PDU_ENCAPSULATION(buffer) + 0x13)
520 #define QETH_ULP_ENABLE_RESP_MAX_MTU(buffer) \
521 (PDU_ENCAPSULATION(buffer)+ 0x1f)
522 #define QETH_ULP_ENABLE_RESP_DIFINFO_LEN(buffer) \
523 (PDU_ENCAPSULATION(buffer) + 0x17)
524 #define QETH_ULP_ENABLE_RESP_LINK_TYPE(buffer) \
525 (PDU_ENCAPSULATION(buffer)+ 0x2b)
526 /* Layer 2 defintions */
527 #define QETH_PROT_LAYER2 0x08
528 #define QETH_PROT_TCPIP 0x03
529 #define QETH_PROT_OSN2 0x0a
530 #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50)
531 #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19)
533 extern unsigned char ULP_SETUP[];
534 #define ULP_SETUP_SIZE 0x6c
535 #define QETH_ULP_SETUP_DEST_ADDR(buffer) (buffer+0x2c)
536 #define QETH_ULP_SETUP_CONNECTION_TOKEN(buffer) (buffer+0x51)
537 #define QETH_ULP_SETUP_FILTER_TOKEN(buffer) (buffer+0x5a)
538 #define QETH_ULP_SETUP_CUA(buffer) (buffer+0x68)
539 #define QETH_ULP_SETUP_REAL_DEVADDR(buffer) (buffer+0x6a)
541 #define QETH_ULP_SETUP_RESP_CONNECTION_TOKEN(buffer) \
542 (PDU_ENCAPSULATION(buffer)+0x1a)
545 extern unsigned char DM_ACT[];
546 #define DM_ACT_SIZE 0x55
547 #define QETH_DM_ACT_DEST_ADDR(buffer) (buffer+0x2c)
548 #define QETH_DM_ACT_CONNECTION_TOKEN(buffer) (buffer+0x51)
552 #define QETH_TRANSPORT_HEADER_SEQ_NO(buffer) (buffer+4)
553 #define QETH_PDU_HEADER_SEQ_NO(buffer) (buffer+0x1c)
554 #define QETH_PDU_HEADER_ACK_SEQ_NO(buffer) (buffer+0x20)
556 extern unsigned char IDX_ACTIVATE_READ[];
557 extern unsigned char IDX_ACTIVATE_WRITE[];
559 #define IDX_ACTIVATE_SIZE 0x22
560 #define QETH_IDX_ACT_ISSUER_RM_TOKEN(buffer) (buffer+0x0c)
561 #define QETH_IDX_NO_PORTNAME_REQUIRED(buffer) ((buffer)[0x0b]&0x80)
562 #define QETH_IDX_ACT_FUNC_LEVEL(buffer) (buffer+0x10)
563 #define QETH_IDX_ACT_DATASET_NAME(buffer) (buffer+0x16)
564 #define QETH_IDX_ACT_QDIO_DEV_CUA(buffer) (buffer+0x1e)
565 #define QETH_IDX_ACT_QDIO_DEV_REALADDR(buffer) (buffer+0x20)
566 #define QETH_IS_IDX_ACT_POS_REPLY(buffer) (((buffer)[0x08]&3)==2)
567 #define QETH_IDX_REPLY_LEVEL(buffer) (buffer+0x12)
568 #define QETH_IDX_ACT_CAUSE_CODE(buffer) (buffer)[0x09]
570 #define PDU_ENCAPSULATION(buffer) \
571 (buffer + *(buffer + (*(buffer+0x0b)) + \
572 *(buffer + *(buffer+0x0b)+0x11) +0x07))
574 #define IS_IPA(buffer) \
575 ((buffer) && \
576 ( *(buffer + ((*(buffer+0x0b))+4) )==0xc1) )
578 #define ADDR_FRAME_TYPE_DIX 1
579 #define ADDR_FRAME_TYPE_802_3 2
580 #define ADDR_FRAME_TYPE_TR_WITHOUT_SR 0x10
581 #define ADDR_FRAME_TYPE_TR_WITH_SR 0x20
583 #endif