Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 's390-qeth-next'

Julian Wiedmann says:

====================
s390/qeth: updates 2020-07-14

please apply the following patch series for qeth to netdev's net-next tree.

This brings a mix of cleanups for various parts of the control code.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+119 -161
+4 -4
drivers/s390/net/qeth_core.h
··· 721 721 struct qeth_vnicc_info vnicc; /* VNICC options */ 722 722 enum qeth_discipline_id layer; 723 723 enum qeth_ipa_isolation_modes isolation; 724 - enum qeth_ipa_isolation_modes prev_isolation; 725 724 int sniffer; 726 725 enum qeth_cq cq; 727 726 char hsuid[9]; ··· 803 804 struct workqueue_struct *event_wq; 804 805 struct workqueue_struct *cmd_wq; 805 806 wait_queue_head_t wait_q; 806 - DECLARE_HASHTABLE(mac_htable, 4); 807 807 DECLARE_HASHTABLE(ip_htable, 4); 808 808 DECLARE_HASHTABLE(local_addrs4, 4); 809 809 DECLARE_HASHTABLE(local_addrs6, 4); 810 810 spinlock_t local_addrs4_lock; 811 811 spinlock_t local_addrs6_lock; 812 812 struct mutex ip_lock; 813 - DECLARE_HASHTABLE(ip_mc_htable, 4); 813 + DECLARE_HASHTABLE(rx_mode_addrs, 4); 814 814 struct work_struct rx_mode_work; 815 815 struct work_struct kernel_thread_starter; 816 816 spinlock_t thread_mask_lock; ··· 1069 1071 struct qeth_switch_info *sw_info); 1070 1072 int qeth_query_card_info(struct qeth_card *card, 1071 1073 struct carrier_info *carrier_info); 1074 + int qeth_setadpparms_set_access_ctrl(struct qeth_card *card, 1075 + enum qeth_ipa_isolation_modes mode); 1076 + 1072 1077 unsigned int qeth_count_elements(struct sk_buff *skb, unsigned int data_offset); 1073 1078 int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue, 1074 1079 struct sk_buff *skb, struct qeth_hdr *hdr, ··· 1079 1078 int elements_needed); 1080 1079 int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 1081 1080 void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...); 1082 - int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback); 1083 1081 int qeth_configure_cq(struct qeth_card *, enum qeth_cq); 1084 1082 int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action); 1085 1083 void qeth_trace_features(struct qeth_card *);
+81 -112
drivers/s390/net/qeth_core_main.c
··· 969 969 970 970 spin_lock_irqsave(&card->lock, flags); 971 971 list_for_each_entry(iob, &card->cmd_waiter_list, list) 972 - qeth_notify_cmd(iob, -EIO); 972 + qeth_notify_cmd(iob, -ECANCELED); 973 973 spin_unlock_irqrestore(&card->lock, flags); 974 974 } 975 975 EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list); ··· 1647 1647 qeth_init_qdio_info(card); 1648 1648 INIT_DELAYED_WORK(&card->buffer_reclaim_work, qeth_buffer_reclaim_work); 1649 1649 INIT_WORK(&card->close_dev_work, qeth_close_dev_handler); 1650 + hash_init(card->rx_mode_addrs); 1650 1651 hash_init(card->local_addrs4); 1651 1652 hash_init(card->local_addrs6); 1652 1653 spin_lock_init(&card->local_addrs4_lock); ··· 2026 2025 } 2027 2026 2028 2027 static struct qeth_cmd_buffer *qeth_mpc_alloc_cmd(struct qeth_card *card, 2029 - void *data, 2028 + const void *data, 2030 2029 unsigned int data_length) 2031 2030 { 2032 2031 struct qeth_cmd_buffer *iob; ··· 2437 2436 return qeth_send_control_data(card, iob, qeth_cm_setup_cb, NULL); 2438 2437 } 2439 2438 2439 + static bool qeth_is_supported_link_type(struct qeth_card *card, u8 link_type) 2440 + { 2441 + if (link_type == QETH_LINK_TYPE_LANE_TR || 2442 + link_type == QETH_LINK_TYPE_HSTR) { 2443 + dev_err(&card->gdev->dev, "Unsupported Token Ring device\n"); 2444 + return false; 2445 + } 2446 + 2447 + return true; 2448 + } 2449 + 2440 2450 static int qeth_update_max_mtu(struct qeth_card *card, unsigned int max_mtu) 2441 2451 { 2442 2452 struct net_device *dev = card->dev; ··· 2507 2495 { 2508 2496 __u16 mtu, framesize; 2509 2497 __u16 len; 2510 - __u8 link_type; 2511 2498 struct qeth_cmd_buffer *iob; 2499 + u8 link_type = 0; 2512 2500 2513 2501 QETH_CARD_TEXT(card, 2, "ulpenacb"); 2514 2502 ··· 2528 2516 if (len >= QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE) { 2529 2517 memcpy(&link_type, 2530 2518 QETH_ULP_ENABLE_RESP_LINK_TYPE(iob->data), 1); 2531 - card->info.link_type = link_type; 2532 - } else 2533 - card->info.link_type = 0; 2519 + if (!qeth_is_supported_link_type(card, link_type)) 2520 + return -EPROTONOSUPPORT; 2521 + } 2522 + 2523 + card->info.link_type = link_type; 2534 2524 QETH_CARD_TEXT_(card, 2, "link%d", card->info.link_type); 2535 2525 return 0; 2536 2526 } ··· 3114 3100 enum qeth_prot_versions prot, 3115 3101 unsigned int data_length) 3116 3102 { 3117 - enum qeth_link_types link_type = card->info.link_type; 3118 3103 struct qeth_cmd_buffer *iob; 3119 3104 struct qeth_ipacmd_hdr *hdr; 3120 3105 ··· 3129 3116 hdr->command = cmd_code; 3130 3117 hdr->initiator = IPA_CMD_INITIATOR_HOST; 3131 3118 /* hdr->seqno is set by qeth_send_control_data() */ 3132 - hdr->adapter_type = (link_type == QETH_LINK_TYPE_HSTR) ? 2 : 1; 3119 + hdr->adapter_type = QETH_LINK_TYPE_FAST_ETH; 3133 3120 hdr->rel_adapter_no = (u8) card->dev->dev_port; 3134 3121 hdr->prim_version_no = IS_LAYER2(card) ? 2 : 1; 3135 3122 hdr->param_count = 1; ··· 3212 3199 struct qeth_reply *reply, unsigned long data) 3213 3200 { 3214 3201 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; 3202 + struct qeth_query_cmds_supp *query_cmd; 3215 3203 3216 3204 QETH_CARD_TEXT(card, 3, "quyadpcb"); 3217 3205 if (qeth_setadpparms_inspect_rc(cmd)) 3218 3206 return -EIO; 3219 3207 3220 - if (cmd->data.setadapterparms.data.query_cmds_supp.lan_type & 0x7f) { 3221 - card->info.link_type = 3222 - cmd->data.setadapterparms.data.query_cmds_supp.lan_type; 3208 + query_cmd = &cmd->data.setadapterparms.data.query_cmds_supp; 3209 + if (query_cmd->lan_type & 0x7f) { 3210 + if (!qeth_is_supported_link_type(card, query_cmd->lan_type)) 3211 + return -EPROTONOSUPPORT; 3212 + 3213 + card->info.link_type = query_cmd->lan_type; 3223 3214 QETH_CARD_TEXT_(card, 2, "lnk %d", card->info.link_type); 3224 3215 } 3225 - card->options.adp.supported = 3226 - cmd->data.setadapterparms.data.query_cmds_supp.supported_cmds; 3216 + 3217 + card->options.adp.supported = query_cmd->supported_cmds; 3227 3218 return 0; 3228 3219 } 3229 3220 ··· 4558 4541 { 4559 4542 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; 4560 4543 struct qeth_set_access_ctrl *access_ctrl_req; 4561 - int fallback = *(int *)reply->param; 4562 4544 4563 4545 QETH_CARD_TEXT(card, 4, "setaccb"); 4564 4546 ··· 4571 4555 cmd->data.setadapterparms.hdr.return_code); 4572 4556 switch (qeth_setadpparms_inspect_rc(cmd)) { 4573 4557 case SET_ACCESS_CTRL_RC_SUCCESS: 4574 - if (card->options.isolation == ISOLATION_MODE_NONE) { 4558 + if (access_ctrl_req->subcmd_code == ISOLATION_MODE_NONE) 4575 4559 dev_info(&card->gdev->dev, 4576 4560 "QDIO data connection isolation is deactivated\n"); 4577 - } else { 4561 + else 4578 4562 dev_info(&card->gdev->dev, 4579 4563 "QDIO data connection isolation is activated\n"); 4580 - } 4581 - break; 4564 + return 0; 4582 4565 case SET_ACCESS_CTRL_RC_ALREADY_NOT_ISOLATED: 4583 4566 QETH_DBF_MESSAGE(2, "QDIO data connection isolation on device %x already deactivated\n", 4584 4567 CARD_DEVID(card)); 4585 - if (fallback) 4586 - card->options.isolation = card->options.prev_isolation; 4587 - break; 4568 + return 0; 4588 4569 case SET_ACCESS_CTRL_RC_ALREADY_ISOLATED: 4589 4570 QETH_DBF_MESSAGE(2, "QDIO data connection isolation on device %x already activated\n", 4590 4571 CARD_DEVID(card)); 4591 - if (fallback) 4592 - card->options.isolation = card->options.prev_isolation; 4593 - break; 4572 + return 0; 4594 4573 case SET_ACCESS_CTRL_RC_NOT_SUPPORTED: 4595 4574 dev_err(&card->gdev->dev, "Adapter does not " 4596 4575 "support QDIO data connection isolation\n"); 4597 - break; 4576 + return -EOPNOTSUPP; 4598 4577 case SET_ACCESS_CTRL_RC_NONE_SHARED_ADAPTER: 4599 4578 dev_err(&card->gdev->dev, 4600 4579 "Adapter is dedicated. " 4601 4580 "QDIO data connection isolation not supported\n"); 4602 - if (fallback) 4603 - card->options.isolation = card->options.prev_isolation; 4604 - break; 4581 + return -EOPNOTSUPP; 4605 4582 case SET_ACCESS_CTRL_RC_ACTIVE_CHECKSUM_OFF: 4606 4583 dev_err(&card->gdev->dev, 4607 4584 "TSO does not permit QDIO data connection isolation\n"); 4608 - if (fallback) 4609 - card->options.isolation = card->options.prev_isolation; 4610 - break; 4585 + return -EPERM; 4611 4586 case SET_ACCESS_CTRL_RC_REFLREL_UNSUPPORTED: 4612 4587 dev_err(&card->gdev->dev, "The adjacent switch port does not " 4613 4588 "support reflective relay mode\n"); 4614 - if (fallback) 4615 - card->options.isolation = card->options.prev_isolation; 4616 - break; 4589 + return -EOPNOTSUPP; 4617 4590 case SET_ACCESS_CTRL_RC_REFLREL_FAILED: 4618 4591 dev_err(&card->gdev->dev, "The reflective relay mode cannot be " 4619 4592 "enabled at the adjacent switch port"); 4620 - if (fallback) 4621 - card->options.isolation = card->options.prev_isolation; 4622 - break; 4593 + return -EREMOTEIO; 4623 4594 case SET_ACCESS_CTRL_RC_REFLREL_DEACT_FAILED: 4624 4595 dev_warn(&card->gdev->dev, "Turning off reflective relay mode " 4625 4596 "at the adjacent switch failed\n"); 4626 - break; 4597 + /* benign error while disabling ISOLATION_MODE_FWD */ 4598 + return 0; 4627 4599 default: 4628 - /* this should never happen */ 4629 - if (fallback) 4630 - card->options.isolation = card->options.prev_isolation; 4631 - break; 4600 + return -EIO; 4632 4601 } 4633 - return (cmd->hdr.return_code) ? -EIO : 0; 4634 4602 } 4635 4603 4636 - static int qeth_setadpparms_set_access_ctrl(struct qeth_card *card, 4637 - enum qeth_ipa_isolation_modes isolation, int fallback) 4604 + int qeth_setadpparms_set_access_ctrl(struct qeth_card *card, 4605 + enum qeth_ipa_isolation_modes mode) 4638 4606 { 4639 4607 int rc; 4640 4608 struct qeth_cmd_buffer *iob; ··· 4627 4627 4628 4628 QETH_CARD_TEXT(card, 4, "setacctl"); 4629 4629 4630 + if (!qeth_adp_supported(card, IPA_SETADP_SET_ACCESS_CONTROL)) { 4631 + dev_err(&card->gdev->dev, 4632 + "Adapter does not support QDIO data connection isolation\n"); 4633 + return -EOPNOTSUPP; 4634 + } 4635 + 4630 4636 iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_ACCESS_CONTROL, 4631 4637 SETADP_DATA_SIZEOF(set_access_ctrl)); 4632 4638 if (!iob) 4633 4639 return -ENOMEM; 4634 4640 cmd = __ipa_cmd(iob); 4635 4641 access_ctrl_req = &cmd->data.setadapterparms.data.set_access_ctrl; 4636 - access_ctrl_req->subcmd_code = isolation; 4642 + access_ctrl_req->subcmd_code = mode; 4637 4643 4638 4644 rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_set_access_ctrl_cb, 4639 - &fallback); 4640 - QETH_CARD_TEXT_(card, 2, "rc=%d", rc); 4641 - return rc; 4642 - } 4643 - 4644 - int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback) 4645 - { 4646 - int rc = 0; 4647 - 4648 - QETH_CARD_TEXT(card, 4, "setactlo"); 4649 - 4650 - if ((IS_OSD(card) || IS_OSX(card)) && 4651 - qeth_adp_supported(card, IPA_SETADP_SET_ACCESS_CONTROL)) { 4652 - rc = qeth_setadpparms_set_access_ctrl(card, 4653 - card->options.isolation, fallback); 4654 - if (rc) { 4655 - QETH_DBF_MESSAGE(3, "IPA(SET_ACCESS_CTRL(%d) on device %x: sent failed\n", 4656 - rc, CARD_DEVID(card)); 4657 - rc = -EOPNOTSUPP; 4658 - } 4659 - } else if (card->options.isolation != ISOLATION_MODE_NONE) { 4660 - card->options.isolation = ISOLATION_MODE_NONE; 4661 - 4662 - dev_err(&card->gdev->dev, "Adapter does not " 4663 - "support QDIO data connection isolation\n"); 4664 - rc = -EOPNOTSUPP; 4645 + NULL); 4646 + if (rc) { 4647 + QETH_CARD_TEXT_(card, 2, "rc=%d", rc); 4648 + QETH_DBF_MESSAGE(3, "IPA(SET_ACCESS_CTRL(%d) on device %x: sent failed\n", 4649 + rc, CARD_DEVID(card)); 4665 4650 } 4651 + 4666 4652 return rc; 4667 4653 } 4668 4654 ··· 4836 4850 } 4837 4851 4838 4852 static int qeth_setadpparms_query_oat_cb(struct qeth_card *card, 4839 - struct qeth_reply *reply, unsigned long data) 4853 + struct qeth_reply *reply, 4854 + unsigned long data) 4840 4855 { 4841 4856 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *)data; 4842 - struct qeth_qoat_priv *priv; 4843 - char *resdata; 4857 + struct qeth_qoat_priv *priv = reply->param; 4844 4858 int resdatalen; 4845 4859 4846 4860 QETH_CARD_TEXT(card, 3, "qoatcb"); 4847 4861 if (qeth_setadpparms_inspect_rc(cmd)) 4848 4862 return -EIO; 4849 4863 4850 - priv = (struct qeth_qoat_priv *)reply->param; 4851 4864 resdatalen = cmd->data.setadapterparms.hdr.cmdlength; 4852 - resdata = (char *)data + 28; 4853 4865 4854 4866 if (resdatalen > (priv->buffer_len - priv->response_len)) 4855 4867 return -ENOSPC; 4856 4868 4857 - memcpy((priv->buffer + priv->response_len), resdata, 4858 - resdatalen); 4869 + memcpy(priv->buffer + priv->response_len, 4870 + &cmd->data.setadapterparms.hdr, resdatalen); 4859 4871 priv->response_len += resdatalen; 4860 4872 4861 4873 if (cmd->data.setadapterparms.hdr.seq_no < ··· 4874 4890 4875 4891 QETH_CARD_TEXT(card, 3, "qoatcmd"); 4876 4892 4877 - if (!qeth_adp_supported(card, IPA_SETADP_QUERY_OAT)) { 4878 - rc = -EOPNOTSUPP; 4879 - goto out; 4880 - } 4893 + if (!qeth_adp_supported(card, IPA_SETADP_QUERY_OAT)) 4894 + return -EOPNOTSUPP; 4881 4895 4882 - if (copy_from_user(&oat_data, udata, 4883 - sizeof(struct qeth_query_oat_data))) { 4884 - rc = -EFAULT; 4885 - goto out; 4886 - } 4896 + if (copy_from_user(&oat_data, udata, sizeof(oat_data))) 4897 + return -EFAULT; 4887 4898 4888 4899 priv.buffer_len = oat_data.buffer_len; 4889 4900 priv.response_len = 0; 4890 4901 priv.buffer = vzalloc(oat_data.buffer_len); 4891 - if (!priv.buffer) { 4892 - rc = -ENOMEM; 4893 - goto out; 4894 - } 4902 + if (!priv.buffer) 4903 + return -ENOMEM; 4895 4904 4896 4905 iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_OAT, 4897 4906 SETADP_DATA_SIZEOF(query_oat)); ··· 4896 4919 oat_req = &cmd->data.setadapterparms.data.query_oat; 4897 4920 oat_req->subcmd_code = oat_data.command; 4898 4921 4899 - rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_query_oat_cb, 4900 - &priv); 4922 + rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_query_oat_cb, &priv); 4901 4923 if (!rc) { 4902 - if (is_compat_task()) 4903 - tmp = compat_ptr(oat_data.ptr); 4904 - else 4905 - tmp = (void __user *)(unsigned long)oat_data.ptr; 4906 - 4907 - if (copy_to_user(tmp, priv.buffer, 4908 - priv.response_len)) { 4909 - rc = -EFAULT; 4910 - goto out_free; 4911 - } 4912 - 4924 + tmp = is_compat_task() ? compat_ptr(oat_data.ptr) : 4925 + u64_to_user_ptr(oat_data.ptr); 4913 4926 oat_data.response_len = priv.response_len; 4914 4927 4915 - if (copy_to_user(udata, &oat_data, 4916 - sizeof(struct qeth_query_oat_data))) 4928 + if (copy_to_user(tmp, priv.buffer, priv.response_len) || 4929 + copy_to_user(udata, &oat_data, sizeof(oat_data))) 4917 4930 rc = -EFAULT; 4918 4931 } 4919 4932 4920 4933 out_free: 4921 4934 vfree(priv.buffer); 4922 - out: 4923 4935 return rc; 4924 4936 } 4925 4937 ··· 5297 5331 (card->info.hwtrap && qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))) 5298 5332 card->info.hwtrap = 0; 5299 5333 5300 - rc = qeth_set_access_ctrl_online(card, 0); 5301 - if (rc) 5302 - goto out; 5334 + if (card->options.isolation != ISOLATION_MODE_NONE) { 5335 + rc = qeth_setadpparms_set_access_ctrl(card, 5336 + card->options.isolation); 5337 + if (rc) 5338 + goto out; 5339 + } 5303 5340 5304 5341 rc = qeth_init_qdio_queues(card); 5305 5342 if (rc) { ··· 6810 6841 6811 6842 /* Traffic with local next-hop is not eligible for some offloads: */ 6812 6843 if (skb->ip_summed == CHECKSUM_PARTIAL && 6813 - card->options.isolation != ISOLATION_MODE_FWD) { 6844 + READ_ONCE(card->options.isolation) != ISOLATION_MODE_FWD) { 6814 6845 netdev_features_t restricted = 0; 6815 6846 6816 6847 if (skb_is_gso(skb) && !netif_needs_gso(skb, features))
+8 -8
drivers/s390/net/qeth_core_mpc.c
··· 10 10 #include <asm/cio.h> 11 11 #include "qeth_core_mpc.h" 12 12 13 - unsigned char IDX_ACTIVATE_READ[] = { 13 + const unsigned char IDX_ACTIVATE_READ[] = { 14 14 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 15 15 0x19, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 16 16 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc1, ··· 18 18 0x00, 0x00 19 19 }; 20 20 21 - unsigned char IDX_ACTIVATE_WRITE[] = { 21 + const unsigned char IDX_ACTIVATE_WRITE[] = { 22 22 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 23 23 0x15, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 24 24 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc1, ··· 26 26 0x00, 0x00 27 27 }; 28 28 29 - unsigned char CM_ENABLE[] = { 29 + const unsigned char CM_ENABLE[] = { 30 30 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 31 31 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x63, 32 32 0x10, 0x00, 0x00, 0x01, ··· 45 45 0xff, 0xff, 0xff 46 46 }; 47 47 48 - unsigned char CM_SETUP[] = { 48 + const unsigned char CM_SETUP[] = { 49 49 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 50 50 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x64, 51 51 0x10, 0x00, 0x00, 0x01, ··· 65 65 0x04, 0x06, 0xc8, 0x00 66 66 }; 67 67 68 - unsigned char ULP_ENABLE[] = { 68 + const unsigned char ULP_ENABLE[] = { 69 69 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 70 70 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6b, 71 71 0x10, 0x00, 0x00, 0x01, ··· 85 85 0xf1, 0x00, 0x00 86 86 }; 87 87 88 - unsigned char ULP_SETUP[] = { 88 + const unsigned char ULP_SETUP[] = { 89 89 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 90 90 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6c, 91 91 0x10, 0x00, 0x00, 0x01, ··· 107 107 0x00, 0x00, 0x00, 0x00 108 108 }; 109 109 110 - unsigned char DM_ACT[] = { 110 + const unsigned char DM_ACT[] = { 111 111 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 112 112 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x55, 113 113 0x10, 0x00, 0x00, 0x01, ··· 123 123 0x05, 0x40, 0x01, 0x01, 0x00 124 124 }; 125 125 126 - unsigned char IPA_PDU_HEADER[] = { 126 + const unsigned char IPA_PDU_HEADER[] = { 127 127 0x00, 0xe0, 0x00, 0x00, 0x77, 0x77, 0x77, 0x77, 128 128 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 129 129 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+8 -9
drivers/s390/net/qeth_core_mpc.h
··· 13 13 #include <uapi/linux/if_ether.h> 14 14 #include <uapi/linux/in6.h> 15 15 16 + extern const unsigned char IPA_PDU_HEADER[]; 16 17 #define IPA_PDU_HEADER_SIZE 0x40 17 18 #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer + 0x0e) 18 19 #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer + 0x26) 19 20 #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer + 0x29) 20 21 #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer + 0x3a) 21 22 22 - extern unsigned char IPA_PDU_HEADER[]; 23 23 #define QETH_IPA_CMD_DEST_ADDR(buffer) (buffer + 0x2c) 24 24 25 25 #define QETH_SEQ_NO_LENGTH 4 ··· 858 858 /* END OF IP Assist related definitions */ 859 859 /*****************************************************************************/ 860 860 861 - extern unsigned char CM_ENABLE[]; 861 + extern const unsigned char CM_ENABLE[]; 862 862 #define CM_ENABLE_SIZE 0x63 863 863 #define QETH_CM_ENABLE_ISSUER_RM_TOKEN(buffer) (buffer + 0x2c) 864 864 #define QETH_CM_ENABLE_FILTER_TOKEN(buffer) (buffer + 0x53) ··· 868 868 (PDU_ENCAPSULATION(buffer) + 0x13) 869 869 870 870 871 - extern unsigned char CM_SETUP[]; 871 + extern const unsigned char CM_SETUP[]; 872 872 #define CM_SETUP_SIZE 0x64 873 873 #define QETH_CM_SETUP_DEST_ADDR(buffer) (buffer + 0x2c) 874 874 #define QETH_CM_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51) ··· 877 877 #define QETH_CM_SETUP_RESP_DEST_ADDR(buffer) \ 878 878 (PDU_ENCAPSULATION(buffer) + 0x1a) 879 879 880 - extern unsigned char ULP_ENABLE[]; 880 + extern const unsigned char ULP_ENABLE[]; 881 881 #define ULP_ENABLE_SIZE 0x6b 882 882 #define QETH_ULP_ENABLE_LINKNUM(buffer) (buffer + 0x61) 883 883 #define QETH_ULP_ENABLE_DEST_ADDR(buffer) (buffer + 0x2c) ··· 898 898 #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer + 0x50) 899 899 #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer + 0x19) 900 900 901 - extern unsigned char ULP_SETUP[]; 901 + extern const unsigned char ULP_SETUP[]; 902 902 #define ULP_SETUP_SIZE 0x6c 903 903 #define QETH_ULP_SETUP_DEST_ADDR(buffer) (buffer + 0x2c) 904 904 #define QETH_ULP_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51) ··· 910 910 (PDU_ENCAPSULATION(buffer) + 0x1a) 911 911 912 912 913 - extern unsigned char DM_ACT[]; 913 + extern const unsigned char DM_ACT[]; 914 914 #define DM_ACT_SIZE 0x55 915 915 #define QETH_DM_ACT_DEST_ADDR(buffer) (buffer + 0x2c) 916 916 #define QETH_DM_ACT_CONNECTION_TOKEN(buffer) (buffer + 0x51) ··· 921 921 #define QETH_PDU_HEADER_SEQ_NO(buffer) (buffer + 0x1c) 922 922 #define QETH_PDU_HEADER_ACK_SEQ_NO(buffer) (buffer + 0x20) 923 923 924 - extern unsigned char IDX_ACTIVATE_READ[]; 925 - extern unsigned char IDX_ACTIVATE_WRITE[]; 926 - 924 + extern const unsigned char IDX_ACTIVATE_READ[]; 925 + extern const unsigned char IDX_ACTIVATE_WRITE[]; 927 926 #define IDX_ACTIVATE_SIZE 0x22 928 927 #define QETH_IDX_ACT_PNO(buffer) (buffer+0x0b) 929 928 #define QETH_IDX_ACT_ISSUER_RM_TOKEN(buffer) (buffer + 0x0c)
+8 -10
drivers/s390/net/qeth_core_sys.c
··· 448 448 rc = -EINVAL; 449 449 goto out; 450 450 } 451 - rc = count; 452 451 453 - /* defer IP assist if device is offline (until discipline->set_online)*/ 454 - card->options.prev_isolation = card->options.isolation; 455 - card->options.isolation = isolation; 456 - if (qeth_card_hw_is_reachable(card)) { 457 - int ipa_rc = qeth_set_access_ctrl_online(card, 1); 458 - if (ipa_rc != 0) 459 - rc = ipa_rc; 460 - } 452 + if (qeth_card_hw_is_reachable(card)) 453 + rc = qeth_setadpparms_set_access_ctrl(card, isolation); 454 + 455 + if (!rc) 456 + WRITE_ONCE(card->options.isolation, isolation); 457 + 461 458 out: 462 459 mutex_unlock(&card->conf_mutex); 463 - return rc; 460 + 461 + return rc ? rc : count; 464 462 } 465 463 466 464 static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show,
+4 -5
drivers/s390/net/qeth_l2_main.c
··· 156 156 struct hlist_node *tmp; 157 157 int i; 158 158 159 - hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) { 159 + hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) { 160 160 hash_del(&mac->hnode); 161 161 kfree(mac); 162 162 } ··· 438 438 u32 mac_hash = get_unaligned((u32 *)(&ha->addr[2])); 439 439 struct qeth_mac *mac; 440 440 441 - hash_for_each_possible(card->mac_htable, mac, hnode, mac_hash) { 441 + hash_for_each_possible(card->rx_mode_addrs, mac, hnode, mac_hash) { 442 442 if (ether_addr_equal_64bits(ha->addr, mac->mac_addr)) { 443 443 mac->disp_flag = QETH_DISP_ADDR_DO_NOTHING; 444 444 return; ··· 452 452 ether_addr_copy(mac->mac_addr, ha->addr); 453 453 mac->disp_flag = QETH_DISP_ADDR_ADD; 454 454 455 - hash_add(card->mac_htable, &mac->hnode, mac_hash); 455 + hash_add(card->rx_mode_addrs, &mac->hnode, mac_hash); 456 456 } 457 457 458 458 static void qeth_l2_rx_mode_work(struct work_struct *work) ··· 475 475 qeth_l2_add_mac(card, ha); 476 476 netif_addr_unlock_bh(dev); 477 477 478 - hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) { 478 + hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) { 479 479 switch (mac->disp_flag) { 480 480 case QETH_DISP_ADDR_DELETE: 481 481 qeth_l2_remove_mac(card, mac->mac_addr); ··· 601 601 return rc; 602 602 } 603 603 604 - hash_init(card->mac_htable); 605 604 INIT_WORK(&card->rx_mode_work, qeth_l2_rx_mode_work); 606 605 return 0; 607 606 }
+6 -13
drivers/s390/net/qeth_l3_main.c
··· 58 58 struct qeth_ipaddr *addr; 59 59 60 60 if (query->is_multicast) { 61 - hash_for_each_possible(card->ip_mc_htable, addr, hnode, key) 61 + hash_for_each_possible(card->rx_mode_addrs, addr, hnode, key) 62 62 if (qeth_l3_addr_match_ip(addr, query)) 63 63 return addr; 64 64 } else { ··· 239 239 struct hlist_node *tmp; 240 240 int i; 241 241 242 - hash_for_each_safe(card->ip_mc_htable, i, tmp, addr, hnode) { 242 + hash_for_each_safe(card->rx_mode_addrs, i, tmp, addr, hnode) { 243 243 hash_del(&addr->hnode); 244 244 kfree(addr); 245 245 } ··· 1093 1093 if (!ipm) 1094 1094 continue; 1095 1095 1096 - hash_add(card->ip_mc_htable, &ipm->hnode, 1096 + hash_add(card->rx_mode_addrs, &ipm->hnode, 1097 1097 qeth_l3_ipaddr_hash(ipm)); 1098 1098 } 1099 1099 ··· 1124 1124 if (!ipm) 1125 1125 continue; 1126 1126 1127 - hash_add(card->ip_mc_htable, 1128 - &ipm->hnode, qeth_l3_ipaddr_hash(ipm)); 1127 + hash_add(card->rx_mode_addrs, &ipm->hnode, 1128 + qeth_l3_ipaddr_hash(ipm)); 1129 1129 1130 1130 } 1131 1131 read_unlock_bh(&in6_dev->lock); ··· 1219 1219 vlan_for_each(card->dev, qeth_l3_add_mcast_rtnl, card); 1220 1220 rtnl_unlock(); 1221 1221 1222 - hash_for_each_safe(card->ip_mc_htable, i, tmp, addr, hnode) { 1222 + hash_for_each_safe(card->rx_mode_addrs, i, tmp, addr, hnode) { 1223 1223 switch (addr->disp_flag) { 1224 1224 case QETH_DISP_ADDR_DELETE: 1225 1225 rc = qeth_l3_deregister_addr_entry(card, addr); ··· 1919 1919 return rc; 1920 1920 1921 1921 if (IS_OSD(card) || IS_OSX(card)) { 1922 - if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) || 1923 - (card->info.link_type == QETH_LINK_TYPE_HSTR)) { 1924 - pr_info("qeth_l3: ignoring TR device\n"); 1925 - return -ENODEV; 1926 - } 1927 - 1928 1922 card->dev->netdev_ops = &qeth_l3_osa_netdev_ops; 1929 1923 1930 1924 /*IPv6 address autoconfiguration stuff*/ ··· 1998 2004 } 1999 2005 } 2000 2006 2001 - hash_init(card->ip_mc_htable); 2002 2007 INIT_WORK(&card->rx_mode_work, qeth_l3_rx_mode_work); 2003 2008 return 0; 2004 2009 }