| .. | .. |
|---|
| 11 | 11 | |
|---|
| 12 | 12 | #include <asm/qeth.h> |
|---|
| 13 | 13 | #include <uapi/linux/if_ether.h> |
|---|
| 14 | +#include <uapi/linux/in6.h> |
|---|
| 14 | 15 | |
|---|
| 16 | +extern const unsigned char IPA_PDU_HEADER[]; |
|---|
| 15 | 17 | #define IPA_PDU_HEADER_SIZE 0x40 |
|---|
| 16 | 18 | #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer + 0x0e) |
|---|
| 17 | 19 | #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer + 0x26) |
|---|
| 18 | 20 | #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer + 0x29) |
|---|
| 19 | 21 | #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer + 0x3a) |
|---|
| 20 | 22 | |
|---|
| 21 | | -extern unsigned char IPA_PDU_HEADER[]; |
|---|
| 22 | 23 | #define QETH_IPA_CMD_DEST_ADDR(buffer) (buffer + 0x2c) |
|---|
| 23 | | - |
|---|
| 24 | | -#define IPA_CMD_LENGTH (IPA_PDU_HEADER_SIZE + sizeof(struct qeth_ipa_cmd)) |
|---|
| 25 | 24 | |
|---|
| 26 | 25 | #define QETH_SEQ_NO_LENGTH 4 |
|---|
| 27 | 26 | #define QETH_MPC_TOKEN_LENGTH 4 |
|---|
| .. | .. |
|---|
| 29 | 28 | |
|---|
| 30 | 29 | #define QETH_TIMEOUT (10 * HZ) |
|---|
| 31 | 30 | #define QETH_IPA_TIMEOUT (45 * HZ) |
|---|
| 32 | | -#define QETH_IDX_COMMAND_SEQNO 0xffff0000 |
|---|
| 33 | | - |
|---|
| 34 | | -#define QETH_CLEAR_CHANNEL_PARM -10 |
|---|
| 35 | | -#define QETH_HALT_CHANNEL_PARM -11 |
|---|
| 36 | | -#define QETH_RCD_PARM -12 |
|---|
| 37 | | - |
|---|
| 38 | | -static inline bool qeth_intparm_is_iob(unsigned long intparm) |
|---|
| 39 | | -{ |
|---|
| 40 | | - switch (intparm) { |
|---|
| 41 | | - case QETH_CLEAR_CHANNEL_PARM: |
|---|
| 42 | | - case QETH_HALT_CHANNEL_PARM: |
|---|
| 43 | | - case QETH_RCD_PARM: |
|---|
| 44 | | - case 0: |
|---|
| 45 | | - return false; |
|---|
| 46 | | - } |
|---|
| 47 | | - return true; |
|---|
| 48 | | -} |
|---|
| 49 | 31 | |
|---|
| 50 | 32 | /*****************************************************************************/ |
|---|
| 51 | 33 | /* IP Assist related definitions */ |
|---|
| .. | .. |
|---|
| 56 | 38 | #define IPA_CMD_INITIATOR_OSA_REPLY 0x81 |
|---|
| 57 | 39 | #define IPA_CMD_PRIM_VERSION_NO 0x01 |
|---|
| 58 | 40 | |
|---|
| 41 | +struct qeth_ipa_caps { |
|---|
| 42 | + u32 supported; |
|---|
| 43 | + u32 enabled; |
|---|
| 44 | +}; |
|---|
| 45 | + |
|---|
| 46 | +static inline bool qeth_ipa_caps_supported(struct qeth_ipa_caps *caps, u32 mask) |
|---|
| 47 | +{ |
|---|
| 48 | + return (caps->supported & mask) == mask; |
|---|
| 49 | +} |
|---|
| 50 | + |
|---|
| 51 | +static inline bool qeth_ipa_caps_enabled(struct qeth_ipa_caps *caps, u32 mask) |
|---|
| 52 | +{ |
|---|
| 53 | + return (caps->enabled & mask) == mask; |
|---|
| 54 | +} |
|---|
| 55 | + |
|---|
| 56 | +#define qeth_adp_supported(c, f) \ |
|---|
| 57 | + qeth_ipa_caps_supported(&c->options.adp, f) |
|---|
| 58 | +#define qeth_is_supported(c, f) \ |
|---|
| 59 | + qeth_ipa_caps_supported(&c->options.ipa4, f) |
|---|
| 60 | +#define qeth_is_supported6(c, f) \ |
|---|
| 61 | + qeth_ipa_caps_supported(&c->options.ipa6, f) |
|---|
| 62 | +#define qeth_is_ipafunc_supported(c, prot, f) \ |
|---|
| 63 | + ((prot == QETH_PROT_IPV6) ? qeth_is_supported6(c, f) : \ |
|---|
| 64 | + qeth_is_supported(c, f)) |
|---|
| 65 | + |
|---|
| 59 | 66 | enum qeth_card_types { |
|---|
| 60 | 67 | QETH_CARD_TYPE_OSD = 1, |
|---|
| 61 | 68 | QETH_CARD_TYPE_IQD = 5, |
|---|
| .. | .. |
|---|
| 65 | 72 | }; |
|---|
| 66 | 73 | |
|---|
| 67 | 74 | #define IS_IQD(card) ((card)->info.type == QETH_CARD_TYPE_IQD) |
|---|
| 75 | +#define IS_OSD(card) ((card)->info.type == QETH_CARD_TYPE_OSD) |
|---|
| 76 | +#define IS_OSM(card) ((card)->info.type == QETH_CARD_TYPE_OSM) |
|---|
| 77 | + |
|---|
| 78 | +#ifdef CONFIG_QETH_OSN |
|---|
| 68 | 79 | #define IS_OSN(card) ((card)->info.type == QETH_CARD_TYPE_OSN) |
|---|
| 80 | +#else |
|---|
| 81 | +#define IS_OSN(card) false |
|---|
| 82 | +#endif |
|---|
| 83 | + |
|---|
| 84 | +#ifdef CONFIG_QETH_OSX |
|---|
| 85 | +#define IS_OSX(card) ((card)->info.type == QETH_CARD_TYPE_OSX) |
|---|
| 86 | +#else |
|---|
| 87 | +#define IS_OSX(card) false |
|---|
| 88 | +#endif |
|---|
| 89 | + |
|---|
| 90 | +#define IS_VM_NIC(card) ((card)->info.is_vm_nic) |
|---|
| 69 | 91 | |
|---|
| 70 | 92 | #define QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE 0x18 |
|---|
| 71 | 93 | /* only the first two bytes are looked at in qeth_get_cardname_short */ |
|---|
| .. | .. |
|---|
| 75 | 97 | QETH_LINK_TYPE_GBIT_ETH = 0x03, |
|---|
| 76 | 98 | QETH_LINK_TYPE_OSN = 0x04, |
|---|
| 77 | 99 | QETH_LINK_TYPE_10GBIT_ETH = 0x10, |
|---|
| 100 | + QETH_LINK_TYPE_25GBIT_ETH = 0x12, |
|---|
| 78 | 101 | QETH_LINK_TYPE_LANE_ETH100 = 0x81, |
|---|
| 79 | 102 | QETH_LINK_TYPE_LANE_TR = 0x82, |
|---|
| 80 | 103 | QETH_LINK_TYPE_LANE_ETH1000 = 0x83, |
|---|
| 81 | 104 | QETH_LINK_TYPE_LANE = 0x88, |
|---|
| 82 | 105 | }; |
|---|
| 83 | 106 | |
|---|
| 84 | | -/* |
|---|
| 85 | | - * Routing stuff |
|---|
| 86 | | - */ |
|---|
| 87 | | -#define RESET_ROUTING_FLAG 0x10 /* indicate that routing type shall be set */ |
|---|
| 88 | 107 | enum qeth_routing_types { |
|---|
| 89 | 108 | /* TODO: set to bit flag used in IPA Command */ |
|---|
| 90 | 109 | NO_ROUTER = 0, |
|---|
| .. | .. |
|---|
| 212 | 231 | IPA_RC_LAN_OFFLINE = 0xe080, |
|---|
| 213 | 232 | IPA_RC_VEPA_TO_VEB_TRANSITION = 0xe090, |
|---|
| 214 | 233 | IPA_RC_INVALID_IP_VERSION2 = 0xf001, |
|---|
| 215 | | - IPA_RC_ENOMEM = 0xfffe, |
|---|
| 216 | 234 | IPA_RC_FFFF = 0xffff |
|---|
| 217 | 235 | }; |
|---|
| 218 | 236 | /* for VNIC Characteristics */ |
|---|
| .. | .. |
|---|
| 332 | 350 | CARD_INFO_PORTS_100M = 0x00000006, |
|---|
| 333 | 351 | CARD_INFO_PORTS_1G = 0x00000007, |
|---|
| 334 | 352 | CARD_INFO_PORTS_10G = 0x00000008, |
|---|
| 353 | + CARD_INFO_PORTS_25G = 0x0000000A, |
|---|
| 335 | 354 | }; |
|---|
| 336 | 355 | |
|---|
| 337 | 356 | /* (SET)DELIP(M) IPA stuff ***************************************************/ |
|---|
| 338 | 357 | struct qeth_ipacmd_setdelip4 { |
|---|
| 339 | | - __u8 ip_addr[4]; |
|---|
| 340 | | - __u8 mask[4]; |
|---|
| 358 | + __be32 addr; |
|---|
| 359 | + __be32 mask; |
|---|
| 341 | 360 | __u32 flags; |
|---|
| 342 | 361 | } __attribute__ ((packed)); |
|---|
| 343 | 362 | |
|---|
| 344 | 363 | struct qeth_ipacmd_setdelip6 { |
|---|
| 345 | | - __u8 ip_addr[16]; |
|---|
| 346 | | - __u8 mask[16]; |
|---|
| 364 | + struct in6_addr addr; |
|---|
| 365 | + struct in6_addr prefix; |
|---|
| 347 | 366 | __u32 flags; |
|---|
| 348 | 367 | } __attribute__ ((packed)); |
|---|
| 349 | 368 | |
|---|
| 350 | 369 | struct qeth_ipacmd_setdelipm { |
|---|
| 351 | 370 | __u8 mac[6]; |
|---|
| 352 | 371 | __u8 padding[2]; |
|---|
| 353 | | - __u8 ip6[12]; |
|---|
| 354 | | - __u8 ip4[4]; |
|---|
| 372 | + struct in6_addr ip; |
|---|
| 355 | 373 | } __attribute__ ((packed)); |
|---|
| 356 | 374 | |
|---|
| 357 | 375 | struct qeth_ipacmd_layer2setdelmac { |
|---|
| .. | .. |
|---|
| 363 | 381 | __u16 vlan_id; |
|---|
| 364 | 382 | } __attribute__ ((packed)); |
|---|
| 365 | 383 | |
|---|
| 366 | | - |
|---|
| 367 | 384 | struct qeth_ipacmd_setassparms_hdr { |
|---|
| 368 | | - __u32 assist_no; |
|---|
| 369 | 385 | __u16 length; |
|---|
| 370 | 386 | __u16 command_code; |
|---|
| 371 | 387 | __u16 return_code; |
|---|
| .. | .. |
|---|
| 399 | 415 | QETH_IPA_CHECKSUM_LP2LP = 0x0020 |
|---|
| 400 | 416 | }; |
|---|
| 401 | 417 | |
|---|
| 402 | | -/* IPA Assist checksum offload reply layout. */ |
|---|
| 403 | | -struct qeth_checksum_cmd { |
|---|
| 404 | | - __u32 supported; |
|---|
| 405 | | - __u32 enabled; |
|---|
| 406 | | -} __packed; |
|---|
| 418 | +enum qeth_ipa_large_send_caps { |
|---|
| 419 | + QETH_IPA_LARGE_SEND_TCP = 0x00000001, |
|---|
| 420 | +}; |
|---|
| 421 | + |
|---|
| 422 | +struct qeth_tso_start_data { |
|---|
| 423 | + u32 mss; |
|---|
| 424 | + u32 supported; |
|---|
| 425 | +}; |
|---|
| 407 | 426 | |
|---|
| 408 | 427 | /* SETASSPARMS IPA Command: */ |
|---|
| 409 | 428 | struct qeth_ipacmd_setassparms { |
|---|
| 429 | + u32 assist_no; |
|---|
| 410 | 430 | struct qeth_ipacmd_setassparms_hdr hdr; |
|---|
| 411 | 431 | union { |
|---|
| 412 | 432 | __u32 flags_32bit; |
|---|
| 413 | | - struct qeth_checksum_cmd chksum; |
|---|
| 414 | | - struct qeth_arp_cache_entry add_arp_entry; |
|---|
| 433 | + struct qeth_ipa_caps caps; |
|---|
| 434 | + struct qeth_arp_cache_entry arp_entry; |
|---|
| 415 | 435 | struct qeth_arp_query_data query_arp; |
|---|
| 416 | | - __u8 ip[16]; |
|---|
| 436 | + struct qeth_tso_start_data tso; |
|---|
| 417 | 437 | } data; |
|---|
| 418 | 438 | } __attribute__ ((packed)); |
|---|
| 419 | 439 | |
|---|
| 440 | +#define SETASS_DATA_SIZEOF(field) sizeof_field(struct qeth_ipacmd_setassparms,\ |
|---|
| 441 | + data.field) |
|---|
| 420 | 442 | |
|---|
| 421 | 443 | /* SETRTG IPA Command: ****************************************************/ |
|---|
| 422 | 444 | struct qeth_set_routing { |
|---|
| .. | .. |
|---|
| 501 | 523 | __u8 reserved3[8]; |
|---|
| 502 | 524 | }; |
|---|
| 503 | 525 | |
|---|
| 526 | +#define QETH_SETADP_FLAGS_VIRTUAL_MAC 0x80 /* for CHANGE_ADDR_READ_MAC */ |
|---|
| 527 | + |
|---|
| 504 | 528 | struct qeth_ipacmd_setadpparms_hdr { |
|---|
| 505 | | - __u32 supp_hw_cmds; |
|---|
| 506 | | - __u32 reserved1; |
|---|
| 507 | | - __u16 cmdlength; |
|---|
| 508 | | - __u16 reserved2; |
|---|
| 509 | | - __u32 command_code; |
|---|
| 510 | | - __u16 return_code; |
|---|
| 511 | | - __u8 used_total; |
|---|
| 512 | | - __u8 seq_no; |
|---|
| 513 | | - __u32 reserved3; |
|---|
| 514 | | -} __attribute__ ((packed)); |
|---|
| 529 | + u16 cmdlength; |
|---|
| 530 | + u16 reserved2; |
|---|
| 531 | + u32 command_code; |
|---|
| 532 | + u16 return_code; |
|---|
| 533 | + u8 used_total; |
|---|
| 534 | + u8 seq_no; |
|---|
| 535 | + u8 flags; |
|---|
| 536 | + u8 reserved3[3]; |
|---|
| 537 | +}; |
|---|
| 515 | 538 | |
|---|
| 516 | 539 | struct qeth_ipacmd_setadpparms { |
|---|
| 540 | + struct qeth_ipa_caps hw_cmds; |
|---|
| 517 | 541 | struct qeth_ipacmd_setadpparms_hdr hdr; |
|---|
| 518 | 542 | union { |
|---|
| 519 | 543 | struct qeth_query_cmds_supp query_cmds_supp; |
|---|
| .. | .. |
|---|
| 527 | 551 | } data; |
|---|
| 528 | 552 | } __attribute__ ((packed)); |
|---|
| 529 | 553 | |
|---|
| 554 | +#define SETADP_DATA_SIZEOF(field) sizeof_field(struct qeth_ipacmd_setadpparms,\ |
|---|
| 555 | + data.field) |
|---|
| 556 | + |
|---|
| 530 | 557 | /* CREATE_ADDR IPA Command: ***********************************************/ |
|---|
| 531 | 558 | struct qeth_create_destroy_address { |
|---|
| 532 | | - __u8 unique_id[8]; |
|---|
| 533 | | -} __attribute__ ((packed)); |
|---|
| 559 | + u8 mac_addr[ETH_ALEN]; |
|---|
| 560 | + u16 uid; |
|---|
| 561 | +}; |
|---|
| 534 | 562 | |
|---|
| 535 | 563 | /* SET DIAGNOSTIC ASSIST IPA Command: *************************************/ |
|---|
| 536 | 564 | |
|---|
| .. | .. |
|---|
| 573 | 601 | __u8 cdata[64]; |
|---|
| 574 | 602 | } __attribute__ ((packed)); |
|---|
| 575 | 603 | |
|---|
| 604 | +#define DIAG_HDR_LEN offsetofend(struct qeth_ipacmd_diagass, ext) |
|---|
| 605 | +#define DIAG_SUB_HDR_LEN (offsetofend(struct qeth_ipacmd_diagass, ext) -\ |
|---|
| 606 | + offsetof(struct qeth_ipacmd_diagass, \ |
|---|
| 607 | + subcmd_len)) |
|---|
| 608 | + |
|---|
| 576 | 609 | /* VNIC Characteristics IPA Command: *****************************************/ |
|---|
| 577 | 610 | /* IPA commands/sub commands for VNICC */ |
|---|
| 578 | 611 | #define IPA_VNICC_QUERY_CHARS 0x00000000L |
|---|
| .. | .. |
|---|
| 599 | 632 | |
|---|
| 600 | 633 | /* VNICC header */ |
|---|
| 601 | 634 | struct qeth_ipacmd_vnicc_hdr { |
|---|
| 602 | | - u32 sup; |
|---|
| 603 | | - u32 cur; |
|---|
| 604 | | -}; |
|---|
| 605 | | - |
|---|
| 606 | | -/* VNICC sub command header */ |
|---|
| 607 | | -struct qeth_vnicc_sub_hdr { |
|---|
| 608 | 635 | u16 data_length; |
|---|
| 609 | 636 | u16 reserved; |
|---|
| 610 | 637 | u32 sub_command; |
|---|
| .. | .. |
|---|
| 629 | 656 | |
|---|
| 630 | 657 | /* complete VNICC IPA command message */ |
|---|
| 631 | 658 | struct qeth_ipacmd_vnicc { |
|---|
| 659 | + struct qeth_ipa_caps vnicc_cmds; |
|---|
| 632 | 660 | struct qeth_ipacmd_vnicc_hdr hdr; |
|---|
| 633 | | - struct qeth_vnicc_sub_hdr sub_hdr; |
|---|
| 634 | 661 | union { |
|---|
| 635 | 662 | struct qeth_vnicc_query_cmds query_cmds; |
|---|
| 636 | 663 | struct qeth_vnicc_set_char set_char; |
|---|
| 637 | 664 | struct qeth_vnicc_getset_timeout getset_timeout; |
|---|
| 638 | | - }; |
|---|
| 665 | + } data; |
|---|
| 639 | 666 | }; |
|---|
| 667 | + |
|---|
| 668 | +#define VNICC_DATA_SIZEOF(field) sizeof_field(struct qeth_ipacmd_vnicc,\ |
|---|
| 669 | + data.field) |
|---|
| 640 | 670 | |
|---|
| 641 | 671 | /* SETBRIDGEPORT IPA Command: *********************************************/ |
|---|
| 642 | 672 | enum qeth_ipa_sbp_cmd { |
|---|
| .. | .. |
|---|
| 663 | 693 | } __packed; |
|---|
| 664 | 694 | |
|---|
| 665 | 695 | struct qeth_ipacmd_sbp_hdr { |
|---|
| 666 | | - __u32 supported_sbp_cmds; |
|---|
| 667 | | - __u32 enabled_sbp_cmds; |
|---|
| 668 | 696 | __u16 cmdlength; |
|---|
| 669 | 697 | __u16 reserved1; |
|---|
| 670 | 698 | __u32 command_code; |
|---|
| .. | .. |
|---|
| 679 | 707 | __u32 reserved; |
|---|
| 680 | 708 | } __packed; |
|---|
| 681 | 709 | |
|---|
| 682 | | -struct qeth_sbp_reset_role { |
|---|
| 683 | | -} __packed; |
|---|
| 684 | | - |
|---|
| 685 | 710 | struct qeth_sbp_set_primary { |
|---|
| 686 | 711 | struct net_if_token token; |
|---|
| 687 | | -} __packed; |
|---|
| 688 | | - |
|---|
| 689 | | -struct qeth_sbp_set_secondary { |
|---|
| 690 | 712 | } __packed; |
|---|
| 691 | 713 | |
|---|
| 692 | 714 | struct qeth_sbp_port_entry { |
|---|
| .. | .. |
|---|
| 697 | 719 | struct net_if_token token; |
|---|
| 698 | 720 | } __packed; |
|---|
| 699 | 721 | |
|---|
| 700 | | -struct qeth_sbp_query_ports { |
|---|
| 701 | | - __u8 primary_bp_supported; |
|---|
| 702 | | - __u8 secondary_bp_supported; |
|---|
| 703 | | - __u8 num_entries; |
|---|
| 704 | | - __u8 entry_length; |
|---|
| 705 | | - struct qeth_sbp_port_entry entry[]; |
|---|
| 706 | | -} __packed; |
|---|
| 707 | | - |
|---|
| 708 | | -struct qeth_sbp_state_change { |
|---|
| 722 | +/* For IPA_SBP_QUERY_BRIDGE_PORTS, IPA_SBP_BRIDGE_PORT_STATE_CHANGE */ |
|---|
| 723 | +struct qeth_sbp_port_data { |
|---|
| 709 | 724 | __u8 primary_bp_supported; |
|---|
| 710 | 725 | __u8 secondary_bp_supported; |
|---|
| 711 | 726 | __u8 num_entries; |
|---|
| .. | .. |
|---|
| 714 | 729 | } __packed; |
|---|
| 715 | 730 | |
|---|
| 716 | 731 | struct qeth_ipacmd_setbridgeport { |
|---|
| 732 | + struct qeth_ipa_caps sbp_cmds; |
|---|
| 717 | 733 | struct qeth_ipacmd_sbp_hdr hdr; |
|---|
| 718 | 734 | union { |
|---|
| 719 | 735 | struct qeth_sbp_query_cmds_supp query_cmds_supp; |
|---|
| 720 | | - struct qeth_sbp_reset_role reset_role; |
|---|
| 721 | 736 | struct qeth_sbp_set_primary set_primary; |
|---|
| 722 | | - struct qeth_sbp_set_secondary set_secondary; |
|---|
| 723 | | - struct qeth_sbp_query_ports query_ports; |
|---|
| 724 | | - struct qeth_sbp_state_change state_change; |
|---|
| 737 | + struct qeth_sbp_port_data port_data; |
|---|
| 725 | 738 | } data; |
|---|
| 726 | 739 | } __packed; |
|---|
| 740 | + |
|---|
| 741 | +#define SBP_DATA_SIZEOF(field) sizeof_field(struct qeth_ipacmd_setbridgeport,\ |
|---|
| 742 | + data.field) |
|---|
| 727 | 743 | |
|---|
| 728 | 744 | /* ADDRESS_CHANGE_NOTIFICATION adapter-initiated "command" *******************/ |
|---|
| 729 | 745 | /* Bitmask for entry->change_code. Both bits may be raised. */ |
|---|
| .. | .. |
|---|
| 748 | 764 | struct qeth_ipacmd_addr_change_entry entry[]; |
|---|
| 749 | 765 | } __packed; |
|---|
| 750 | 766 | |
|---|
| 767 | +/* [UN]REGISTER_LOCAL_ADDRESS notifications */ |
|---|
| 768 | +struct qeth_ipacmd_local_addr4 { |
|---|
| 769 | + __be32 addr; |
|---|
| 770 | + u32 flags; |
|---|
| 771 | +}; |
|---|
| 772 | + |
|---|
| 773 | +struct qeth_ipacmd_local_addrs4 { |
|---|
| 774 | + u32 count; |
|---|
| 775 | + u32 addr_length; |
|---|
| 776 | + struct qeth_ipacmd_local_addr4 addrs[]; |
|---|
| 777 | +}; |
|---|
| 778 | + |
|---|
| 779 | +struct qeth_ipacmd_local_addr6 { |
|---|
| 780 | + struct in6_addr addr; |
|---|
| 781 | + u32 flags; |
|---|
| 782 | +}; |
|---|
| 783 | + |
|---|
| 784 | +struct qeth_ipacmd_local_addrs6 { |
|---|
| 785 | + u32 count; |
|---|
| 786 | + u32 addr_length; |
|---|
| 787 | + struct qeth_ipacmd_local_addr6 addrs[]; |
|---|
| 788 | +}; |
|---|
| 789 | + |
|---|
| 751 | 790 | /* Header for each IPA command */ |
|---|
| 752 | 791 | struct qeth_ipacmd_hdr { |
|---|
| 753 | 792 | __u8 command; |
|---|
| .. | .. |
|---|
| 759 | 798 | __u8 prim_version_no; |
|---|
| 760 | 799 | __u8 param_count; |
|---|
| 761 | 800 | __u16 prot_version; |
|---|
| 762 | | - __u32 ipa_supported; |
|---|
| 763 | | - __u32 ipa_enabled; |
|---|
| 801 | + struct qeth_ipa_caps assists; |
|---|
| 764 | 802 | } __attribute__ ((packed)); |
|---|
| 765 | 803 | |
|---|
| 766 | 804 | /* The IPA command itself */ |
|---|
| .. | .. |
|---|
| 780 | 818 | struct qeth_ipacmd_setbridgeport sbp; |
|---|
| 781 | 819 | struct qeth_ipacmd_addr_change addrchange; |
|---|
| 782 | 820 | struct qeth_ipacmd_vnicc vnicc; |
|---|
| 821 | + struct qeth_ipacmd_local_addrs4 local_addrs4; |
|---|
| 822 | + struct qeth_ipacmd_local_addrs6 local_addrs6; |
|---|
| 783 | 823 | } data; |
|---|
| 784 | 824 | } __attribute__ ((packed)); |
|---|
| 825 | + |
|---|
| 826 | +#define IPA_DATA_SIZEOF(field) sizeof_field(struct qeth_ipa_cmd, data.field) |
|---|
| 785 | 827 | |
|---|
| 786 | 828 | /* |
|---|
| 787 | 829 | * special command for ARP processing. |
|---|
| .. | .. |
|---|
| 800 | 842 | extern const char *qeth_get_ipa_msg(enum qeth_ipa_return_codes rc); |
|---|
| 801 | 843 | extern const char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd); |
|---|
| 802 | 844 | |
|---|
| 803 | | -#define QETH_SETASS_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \ |
|---|
| 804 | | - sizeof(struct qeth_ipacmd_setassparms_hdr)) |
|---|
| 805 | | -#define QETH_IPA_ARP_DATA_POS(buffer) (buffer + IPA_PDU_HEADER_SIZE + \ |
|---|
| 806 | | - QETH_SETASS_BASE_LEN) |
|---|
| 807 | | -#define QETH_SETADP_BASE_LEN (sizeof(struct qeth_ipacmd_hdr) + \ |
|---|
| 808 | | - sizeof(struct qeth_ipacmd_setadpparms_hdr)) |
|---|
| 809 | | -#define QETH_SNMP_SETADP_CMDLENGTH 16 |
|---|
| 810 | | - |
|---|
| 811 | | -#define QETH_ARP_DATA_SIZE 3968 |
|---|
| 812 | | -#define QETH_ARP_CMD_LEN (QETH_ARP_DATA_SIZE + 8) |
|---|
| 813 | 845 | /* Helper functions */ |
|---|
| 814 | 846 | #define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ |
|---|
| 815 | 847 | (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) |
|---|
| .. | .. |
|---|
| 818 | 850 | /* END OF IP Assist related definitions */ |
|---|
| 819 | 851 | /*****************************************************************************/ |
|---|
| 820 | 852 | |
|---|
| 821 | | -extern unsigned char CM_ENABLE[]; |
|---|
| 853 | +extern const unsigned char CM_ENABLE[]; |
|---|
| 822 | 854 | #define CM_ENABLE_SIZE 0x63 |
|---|
| 823 | 855 | #define QETH_CM_ENABLE_ISSUER_RM_TOKEN(buffer) (buffer + 0x2c) |
|---|
| 824 | 856 | #define QETH_CM_ENABLE_FILTER_TOKEN(buffer) (buffer + 0x53) |
|---|
| .. | .. |
|---|
| 828 | 860 | (PDU_ENCAPSULATION(buffer) + 0x13) |
|---|
| 829 | 861 | |
|---|
| 830 | 862 | |
|---|
| 831 | | -extern unsigned char CM_SETUP[]; |
|---|
| 863 | +extern const unsigned char CM_SETUP[]; |
|---|
| 832 | 864 | #define CM_SETUP_SIZE 0x64 |
|---|
| 833 | 865 | #define QETH_CM_SETUP_DEST_ADDR(buffer) (buffer + 0x2c) |
|---|
| 834 | 866 | #define QETH_CM_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51) |
|---|
| .. | .. |
|---|
| 837 | 869 | #define QETH_CM_SETUP_RESP_DEST_ADDR(buffer) \ |
|---|
| 838 | 870 | (PDU_ENCAPSULATION(buffer) + 0x1a) |
|---|
| 839 | 871 | |
|---|
| 840 | | -extern unsigned char ULP_ENABLE[]; |
|---|
| 872 | +extern const unsigned char ULP_ENABLE[]; |
|---|
| 841 | 873 | #define ULP_ENABLE_SIZE 0x6b |
|---|
| 842 | 874 | #define QETH_ULP_ENABLE_LINKNUM(buffer) (buffer + 0x61) |
|---|
| 843 | 875 | #define QETH_ULP_ENABLE_DEST_ADDR(buffer) (buffer + 0x2c) |
|---|
| .. | .. |
|---|
| 858 | 890 | #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer + 0x50) |
|---|
| 859 | 891 | #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer + 0x19) |
|---|
| 860 | 892 | |
|---|
| 861 | | -extern unsigned char ULP_SETUP[]; |
|---|
| 893 | +extern const unsigned char ULP_SETUP[]; |
|---|
| 862 | 894 | #define ULP_SETUP_SIZE 0x6c |
|---|
| 863 | 895 | #define QETH_ULP_SETUP_DEST_ADDR(buffer) (buffer + 0x2c) |
|---|
| 864 | 896 | #define QETH_ULP_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51) |
|---|
| .. | .. |
|---|
| 870 | 902 | (PDU_ENCAPSULATION(buffer) + 0x1a) |
|---|
| 871 | 903 | |
|---|
| 872 | 904 | |
|---|
| 873 | | -extern unsigned char DM_ACT[]; |
|---|
| 905 | +extern const unsigned char DM_ACT[]; |
|---|
| 874 | 906 | #define DM_ACT_SIZE 0x55 |
|---|
| 875 | 907 | #define QETH_DM_ACT_DEST_ADDR(buffer) (buffer + 0x2c) |
|---|
| 876 | 908 | #define QETH_DM_ACT_CONNECTION_TOKEN(buffer) (buffer + 0x51) |
|---|
| .. | .. |
|---|
| 881 | 913 | #define QETH_PDU_HEADER_SEQ_NO(buffer) (buffer + 0x1c) |
|---|
| 882 | 914 | #define QETH_PDU_HEADER_ACK_SEQ_NO(buffer) (buffer + 0x20) |
|---|
| 883 | 915 | |
|---|
| 884 | | -extern unsigned char IDX_ACTIVATE_READ[]; |
|---|
| 885 | | -extern unsigned char IDX_ACTIVATE_WRITE[]; |
|---|
| 886 | | - |
|---|
| 916 | +extern const unsigned char IDX_ACTIVATE_READ[]; |
|---|
| 917 | +extern const unsigned char IDX_ACTIVATE_WRITE[]; |
|---|
| 887 | 918 | #define IDX_ACTIVATE_SIZE 0x22 |
|---|
| 888 | 919 | #define QETH_IDX_ACT_PNO(buffer) (buffer+0x0b) |
|---|
| 889 | 920 | #define QETH_IDX_ACT_ISSUER_RM_TOKEN(buffer) (buffer + 0x0c) |
|---|
| 921 | +#define QETH_IDX_ACT_INVAL_FRAME 0x40 |
|---|
| 890 | 922 | #define QETH_IDX_NO_PORTNAME_REQUIRED(buffer) ((buffer)[0x0b] & 0x80) |
|---|
| 891 | 923 | #define QETH_IDX_ACT_FUNC_LEVEL(buffer) (buffer + 0x10) |
|---|
| 892 | 924 | #define QETH_IDX_ACT_DATASET_NAME(buffer) (buffer + 0x16) |
|---|
| .. | .. |
|---|
| 899 | 931 | #define QETH_IDX_ACT_ERR_AUTH 0x1E |
|---|
| 900 | 932 | #define QETH_IDX_ACT_ERR_AUTH_USER 0x20 |
|---|
| 901 | 933 | |
|---|
| 934 | +#define QETH_IDX_TERMINATE 0xc0 |
|---|
| 935 | +#define QETH_IDX_TERMINATE_MASK 0xc0 |
|---|
| 936 | +#define QETH_IDX_TERM_BAD_TRANSPORT 0x41 |
|---|
| 937 | +#define QETH_IDX_TERM_BAD_TRANSPORT_VM 0xf6 |
|---|
| 938 | + |
|---|
| 902 | 939 | #define PDU_ENCAPSULATION(buffer) \ |
|---|
| 903 | 940 | (buffer + *(buffer + (*(buffer + 0x0b)) + \ |
|---|
| 904 | 941 | *(buffer + *(buffer + 0x0b) + 0x11) + 0x07)) |
|---|