Commit 3fa1dbd9 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 3d12e50f 94ae20f7
...@@ -721,7 +721,6 @@ struct qeth_card_options { ...@@ -721,7 +721,6 @@ struct qeth_card_options {
struct qeth_vnicc_info vnicc; /* VNICC options */ struct qeth_vnicc_info vnicc; /* VNICC options */
enum qeth_discipline_id layer; enum qeth_discipline_id layer;
enum qeth_ipa_isolation_modes isolation; enum qeth_ipa_isolation_modes isolation;
enum qeth_ipa_isolation_modes prev_isolation;
int sniffer; int sniffer;
enum qeth_cq cq; enum qeth_cq cq;
char hsuid[9]; char hsuid[9];
...@@ -804,14 +803,13 @@ struct qeth_card { ...@@ -804,14 +803,13 @@ struct qeth_card {
struct workqueue_struct *event_wq; struct workqueue_struct *event_wq;
struct workqueue_struct *cmd_wq; struct workqueue_struct *cmd_wq;
wait_queue_head_t wait_q; wait_queue_head_t wait_q;
DECLARE_HASHTABLE(mac_htable, 4);
DECLARE_HASHTABLE(ip_htable, 4); DECLARE_HASHTABLE(ip_htable, 4);
DECLARE_HASHTABLE(local_addrs4, 4); DECLARE_HASHTABLE(local_addrs4, 4);
DECLARE_HASHTABLE(local_addrs6, 4); DECLARE_HASHTABLE(local_addrs6, 4);
spinlock_t local_addrs4_lock; spinlock_t local_addrs4_lock;
spinlock_t local_addrs6_lock; spinlock_t local_addrs6_lock;
struct mutex ip_lock; struct mutex ip_lock;
DECLARE_HASHTABLE(ip_mc_htable, 4); DECLARE_HASHTABLE(rx_mode_addrs, 4);
struct work_struct rx_mode_work; struct work_struct rx_mode_work;
struct work_struct kernel_thread_starter; struct work_struct kernel_thread_starter;
spinlock_t thread_mask_lock; spinlock_t thread_mask_lock;
...@@ -1071,6 +1069,9 @@ int qeth_query_switch_attributes(struct qeth_card *card, ...@@ -1071,6 +1069,9 @@ int qeth_query_switch_attributes(struct qeth_card *card,
struct qeth_switch_info *sw_info); struct qeth_switch_info *sw_info);
int qeth_query_card_info(struct qeth_card *card, int qeth_query_card_info(struct qeth_card *card,
struct carrier_info *carrier_info); struct carrier_info *carrier_info);
int qeth_setadpparms_set_access_ctrl(struct qeth_card *card,
enum qeth_ipa_isolation_modes mode);
unsigned int qeth_count_elements(struct sk_buff *skb, unsigned int data_offset); unsigned int qeth_count_elements(struct sk_buff *skb, unsigned int data_offset);
int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue, int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
struct sk_buff *skb, struct qeth_hdr *hdr, struct sk_buff *skb, struct qeth_hdr *hdr,
...@@ -1078,7 +1079,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue, ...@@ -1078,7 +1079,6 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
int elements_needed); int elements_needed);
int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int qeth_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...); void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...);
int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback);
int qeth_configure_cq(struct qeth_card *, enum qeth_cq); int qeth_configure_cq(struct qeth_card *, enum qeth_cq);
int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action); int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action);
void qeth_trace_features(struct qeth_card *); void qeth_trace_features(struct qeth_card *);
......
...@@ -969,7 +969,7 @@ void qeth_clear_ipacmd_list(struct qeth_card *card) ...@@ -969,7 +969,7 @@ void qeth_clear_ipacmd_list(struct qeth_card *card)
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
list_for_each_entry(iob, &card->cmd_waiter_list, list) list_for_each_entry(iob, &card->cmd_waiter_list, list)
qeth_notify_cmd(iob, -EIO); qeth_notify_cmd(iob, -ECANCELED);
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
} }
EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list); EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list);
...@@ -1647,6 +1647,7 @@ static void qeth_setup_card(struct qeth_card *card) ...@@ -1647,6 +1647,7 @@ static void qeth_setup_card(struct qeth_card *card)
qeth_init_qdio_info(card); qeth_init_qdio_info(card);
INIT_DELAYED_WORK(&card->buffer_reclaim_work, qeth_buffer_reclaim_work); INIT_DELAYED_WORK(&card->buffer_reclaim_work, qeth_buffer_reclaim_work);
INIT_WORK(&card->close_dev_work, qeth_close_dev_handler); INIT_WORK(&card->close_dev_work, qeth_close_dev_handler);
hash_init(card->rx_mode_addrs);
hash_init(card->local_addrs4); hash_init(card->local_addrs4);
hash_init(card->local_addrs6); hash_init(card->local_addrs6);
spin_lock_init(&card->local_addrs4_lock); spin_lock_init(&card->local_addrs4_lock);
...@@ -2025,7 +2026,7 @@ static bool qeth_mpc_match_reply(struct qeth_cmd_buffer *iob, ...@@ -2025,7 +2026,7 @@ static bool qeth_mpc_match_reply(struct qeth_cmd_buffer *iob,
} }
static struct qeth_cmd_buffer *qeth_mpc_alloc_cmd(struct qeth_card *card, static struct qeth_cmd_buffer *qeth_mpc_alloc_cmd(struct qeth_card *card,
void *data, const void *data,
unsigned int data_length) unsigned int data_length)
{ {
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
...@@ -2436,6 +2437,17 @@ static int qeth_cm_setup(struct qeth_card *card) ...@@ -2436,6 +2437,17 @@ static int qeth_cm_setup(struct qeth_card *card)
return qeth_send_control_data(card, iob, qeth_cm_setup_cb, NULL); return qeth_send_control_data(card, iob, qeth_cm_setup_cb, NULL);
} }
static bool qeth_is_supported_link_type(struct qeth_card *card, u8 link_type)
{
if (link_type == QETH_LINK_TYPE_LANE_TR ||
link_type == QETH_LINK_TYPE_HSTR) {
dev_err(&card->gdev->dev, "Unsupported Token Ring device\n");
return false;
}
return true;
}
static int qeth_update_max_mtu(struct qeth_card *card, unsigned int max_mtu) static int qeth_update_max_mtu(struct qeth_card *card, unsigned int max_mtu)
{ {
struct net_device *dev = card->dev; struct net_device *dev = card->dev;
...@@ -2495,8 +2507,8 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply, ...@@ -2495,8 +2507,8 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply,
{ {
__u16 mtu, framesize; __u16 mtu, framesize;
__u16 len; __u16 len;
__u8 link_type;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
u8 link_type = 0;
QETH_CARD_TEXT(card, 2, "ulpenacb"); QETH_CARD_TEXT(card, 2, "ulpenacb");
...@@ -2516,9 +2528,11 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply, ...@@ -2516,9 +2528,11 @@ static int qeth_ulp_enable_cb(struct qeth_card *card, struct qeth_reply *reply,
if (len >= QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE) { if (len >= QETH_MPC_DIFINFO_LEN_INDICATES_LINK_TYPE) {
memcpy(&link_type, memcpy(&link_type,
QETH_ULP_ENABLE_RESP_LINK_TYPE(iob->data), 1); QETH_ULP_ENABLE_RESP_LINK_TYPE(iob->data), 1);
if (!qeth_is_supported_link_type(card, link_type))
return -EPROTONOSUPPORT;
}
card->info.link_type = link_type; card->info.link_type = link_type;
} else
card->info.link_type = 0;
QETH_CARD_TEXT_(card, 2, "link%d", card->info.link_type); QETH_CARD_TEXT_(card, 2, "link%d", card->info.link_type);
return 0; return 0;
} }
...@@ -3100,7 +3114,6 @@ struct qeth_cmd_buffer *qeth_ipa_alloc_cmd(struct qeth_card *card, ...@@ -3100,7 +3114,6 @@ struct qeth_cmd_buffer *qeth_ipa_alloc_cmd(struct qeth_card *card,
enum qeth_prot_versions prot, enum qeth_prot_versions prot,
unsigned int data_length) unsigned int data_length)
{ {
enum qeth_link_types link_type = card->info.link_type;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipacmd_hdr *hdr; struct qeth_ipacmd_hdr *hdr;
...@@ -3116,7 +3129,7 @@ struct qeth_cmd_buffer *qeth_ipa_alloc_cmd(struct qeth_card *card, ...@@ -3116,7 +3129,7 @@ struct qeth_cmd_buffer *qeth_ipa_alloc_cmd(struct qeth_card *card,
hdr->command = cmd_code; hdr->command = cmd_code;
hdr->initiator = IPA_CMD_INITIATOR_HOST; hdr->initiator = IPA_CMD_INITIATOR_HOST;
/* hdr->seqno is set by qeth_send_control_data() */ /* hdr->seqno is set by qeth_send_control_data() */
hdr->adapter_type = (link_type == QETH_LINK_TYPE_HSTR) ? 2 : 1; hdr->adapter_type = QETH_LINK_TYPE_FAST_ETH;
hdr->rel_adapter_no = (u8) card->dev->dev_port; hdr->rel_adapter_no = (u8) card->dev->dev_port;
hdr->prim_version_no = IS_LAYER2(card) ? 2 : 1; hdr->prim_version_no = IS_LAYER2(card) ? 2 : 1;
hdr->param_count = 1; hdr->param_count = 1;
...@@ -3199,18 +3212,22 @@ static int qeth_query_setadapterparms_cb(struct qeth_card *card, ...@@ -3199,18 +3212,22 @@ static int qeth_query_setadapterparms_cb(struct qeth_card *card,
struct qeth_reply *reply, unsigned long data) struct qeth_reply *reply, unsigned long data)
{ {
struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
struct qeth_query_cmds_supp *query_cmd;
QETH_CARD_TEXT(card, 3, "quyadpcb"); QETH_CARD_TEXT(card, 3, "quyadpcb");
if (qeth_setadpparms_inspect_rc(cmd)) if (qeth_setadpparms_inspect_rc(cmd))
return -EIO; return -EIO;
if (cmd->data.setadapterparms.data.query_cmds_supp.lan_type & 0x7f) { query_cmd = &cmd->data.setadapterparms.data.query_cmds_supp;
card->info.link_type = if (query_cmd->lan_type & 0x7f) {
cmd->data.setadapterparms.data.query_cmds_supp.lan_type; if (!qeth_is_supported_link_type(card, query_cmd->lan_type))
return -EPROTONOSUPPORT;
card->info.link_type = query_cmd->lan_type;
QETH_CARD_TEXT_(card, 2, "lnk %d", card->info.link_type); QETH_CARD_TEXT_(card, 2, "lnk %d", card->info.link_type);
} }
card->options.adp.supported =
cmd->data.setadapterparms.data.query_cmds_supp.supported_cmds; card->options.adp.supported = query_cmd->supported_cmds;
return 0; return 0;
} }
...@@ -4541,7 +4558,6 @@ static int qeth_setadpparms_set_access_ctrl_cb(struct qeth_card *card, ...@@ -4541,7 +4558,6 @@ static int qeth_setadpparms_set_access_ctrl_cb(struct qeth_card *card,
{ {
struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
struct qeth_set_access_ctrl *access_ctrl_req; struct qeth_set_access_ctrl *access_ctrl_req;
int fallback = *(int *)reply->param;
QETH_CARD_TEXT(card, 4, "setaccb"); QETH_CARD_TEXT(card, 4, "setaccb");
...@@ -4555,70 +4571,54 @@ static int qeth_setadpparms_set_access_ctrl_cb(struct qeth_card *card, ...@@ -4555,70 +4571,54 @@ static int qeth_setadpparms_set_access_ctrl_cb(struct qeth_card *card,
cmd->data.setadapterparms.hdr.return_code); cmd->data.setadapterparms.hdr.return_code);
switch (qeth_setadpparms_inspect_rc(cmd)) { switch (qeth_setadpparms_inspect_rc(cmd)) {
case SET_ACCESS_CTRL_RC_SUCCESS: case SET_ACCESS_CTRL_RC_SUCCESS:
if (card->options.isolation == ISOLATION_MODE_NONE) { if (access_ctrl_req->subcmd_code == ISOLATION_MODE_NONE)
dev_info(&card->gdev->dev, dev_info(&card->gdev->dev,
"QDIO data connection isolation is deactivated\n"); "QDIO data connection isolation is deactivated\n");
} else { else
dev_info(&card->gdev->dev, dev_info(&card->gdev->dev,
"QDIO data connection isolation is activated\n"); "QDIO data connection isolation is activated\n");
} return 0;
break;
case SET_ACCESS_CTRL_RC_ALREADY_NOT_ISOLATED: case SET_ACCESS_CTRL_RC_ALREADY_NOT_ISOLATED:
QETH_DBF_MESSAGE(2, "QDIO data connection isolation on device %x already deactivated\n", QETH_DBF_MESSAGE(2, "QDIO data connection isolation on device %x already deactivated\n",
CARD_DEVID(card)); CARD_DEVID(card));
if (fallback) return 0;
card->options.isolation = card->options.prev_isolation;
break;
case SET_ACCESS_CTRL_RC_ALREADY_ISOLATED: case SET_ACCESS_CTRL_RC_ALREADY_ISOLATED:
QETH_DBF_MESSAGE(2, "QDIO data connection isolation on device %x already activated\n", QETH_DBF_MESSAGE(2, "QDIO data connection isolation on device %x already activated\n",
CARD_DEVID(card)); CARD_DEVID(card));
if (fallback) return 0;
card->options.isolation = card->options.prev_isolation;
break;
case SET_ACCESS_CTRL_RC_NOT_SUPPORTED: case SET_ACCESS_CTRL_RC_NOT_SUPPORTED:
dev_err(&card->gdev->dev, "Adapter does not " dev_err(&card->gdev->dev, "Adapter does not "
"support QDIO data connection isolation\n"); "support QDIO data connection isolation\n");
break; return -EOPNOTSUPP;
case SET_ACCESS_CTRL_RC_NONE_SHARED_ADAPTER: case SET_ACCESS_CTRL_RC_NONE_SHARED_ADAPTER:
dev_err(&card->gdev->dev, dev_err(&card->gdev->dev,
"Adapter is dedicated. " "Adapter is dedicated. "
"QDIO data connection isolation not supported\n"); "QDIO data connection isolation not supported\n");
if (fallback) return -EOPNOTSUPP;
card->options.isolation = card->options.prev_isolation;
break;
case SET_ACCESS_CTRL_RC_ACTIVE_CHECKSUM_OFF: case SET_ACCESS_CTRL_RC_ACTIVE_CHECKSUM_OFF:
dev_err(&card->gdev->dev, dev_err(&card->gdev->dev,
"TSO does not permit QDIO data connection isolation\n"); "TSO does not permit QDIO data connection isolation\n");
if (fallback) return -EPERM;
card->options.isolation = card->options.prev_isolation;
break;
case SET_ACCESS_CTRL_RC_REFLREL_UNSUPPORTED: case SET_ACCESS_CTRL_RC_REFLREL_UNSUPPORTED:
dev_err(&card->gdev->dev, "The adjacent switch port does not " dev_err(&card->gdev->dev, "The adjacent switch port does not "
"support reflective relay mode\n"); "support reflective relay mode\n");
if (fallback) return -EOPNOTSUPP;
card->options.isolation = card->options.prev_isolation;
break;
case SET_ACCESS_CTRL_RC_REFLREL_FAILED: case SET_ACCESS_CTRL_RC_REFLREL_FAILED:
dev_err(&card->gdev->dev, "The reflective relay mode cannot be " dev_err(&card->gdev->dev, "The reflective relay mode cannot be "
"enabled at the adjacent switch port"); "enabled at the adjacent switch port");
if (fallback) return -EREMOTEIO;
card->options.isolation = card->options.prev_isolation;
break;
case SET_ACCESS_CTRL_RC_REFLREL_DEACT_FAILED: case SET_ACCESS_CTRL_RC_REFLREL_DEACT_FAILED:
dev_warn(&card->gdev->dev, "Turning off reflective relay mode " dev_warn(&card->gdev->dev, "Turning off reflective relay mode "
"at the adjacent switch failed\n"); "at the adjacent switch failed\n");
break; /* benign error while disabling ISOLATION_MODE_FWD */
return 0;
default: default:
/* this should never happen */ return -EIO;
if (fallback)
card->options.isolation = card->options.prev_isolation;
break;
} }
return (cmd->hdr.return_code) ? -EIO : 0;
} }
static int qeth_setadpparms_set_access_ctrl(struct qeth_card *card, int qeth_setadpparms_set_access_ctrl(struct qeth_card *card,
enum qeth_ipa_isolation_modes isolation, int fallback) enum qeth_ipa_isolation_modes mode)
{ {
int rc; int rc;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
...@@ -4627,42 +4627,28 @@ static int qeth_setadpparms_set_access_ctrl(struct qeth_card *card, ...@@ -4627,42 +4627,28 @@ static int qeth_setadpparms_set_access_ctrl(struct qeth_card *card,
QETH_CARD_TEXT(card, 4, "setacctl"); QETH_CARD_TEXT(card, 4, "setacctl");
if (!qeth_adp_supported(card, IPA_SETADP_SET_ACCESS_CONTROL)) {
dev_err(&card->gdev->dev,
"Adapter does not support QDIO data connection isolation\n");
return -EOPNOTSUPP;
}
iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_ACCESS_CONTROL, iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_ACCESS_CONTROL,
SETADP_DATA_SIZEOF(set_access_ctrl)); SETADP_DATA_SIZEOF(set_access_ctrl));
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
cmd = __ipa_cmd(iob); cmd = __ipa_cmd(iob);
access_ctrl_req = &cmd->data.setadapterparms.data.set_access_ctrl; access_ctrl_req = &cmd->data.setadapterparms.data.set_access_ctrl;
access_ctrl_req->subcmd_code = isolation; access_ctrl_req->subcmd_code = mode;
rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_set_access_ctrl_cb, rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_set_access_ctrl_cb,
&fallback); NULL);
QETH_CARD_TEXT_(card, 2, "rc=%d", rc);
return rc;
}
int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback)
{
int rc = 0;
QETH_CARD_TEXT(card, 4, "setactlo");
if ((IS_OSD(card) || IS_OSX(card)) &&
qeth_adp_supported(card, IPA_SETADP_SET_ACCESS_CONTROL)) {
rc = qeth_setadpparms_set_access_ctrl(card,
card->options.isolation, fallback);
if (rc) { if (rc) {
QETH_CARD_TEXT_(card, 2, "rc=%d", rc);
QETH_DBF_MESSAGE(3, "IPA(SET_ACCESS_CTRL(%d) on device %x: sent failed\n", QETH_DBF_MESSAGE(3, "IPA(SET_ACCESS_CTRL(%d) on device %x: sent failed\n",
rc, CARD_DEVID(card)); rc, CARD_DEVID(card));
rc = -EOPNOTSUPP;
} }
} else if (card->options.isolation != ISOLATION_MODE_NONE) {
card->options.isolation = ISOLATION_MODE_NONE;
dev_err(&card->gdev->dev, "Adapter does not "
"support QDIO data connection isolation\n");
rc = -EOPNOTSUPP;
}
return rc; return rc;
} }
...@@ -4850,26 +4836,24 @@ static int qeth_snmp_command(struct qeth_card *card, char __user *udata) ...@@ -4850,26 +4836,24 @@ static int qeth_snmp_command(struct qeth_card *card, char __user *udata)
} }
static int qeth_setadpparms_query_oat_cb(struct qeth_card *card, static int qeth_setadpparms_query_oat_cb(struct qeth_card *card,
struct qeth_reply *reply, unsigned long data) struct qeth_reply *reply,
unsigned long data)
{ {
struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *)data; struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *)data;
struct qeth_qoat_priv *priv; struct qeth_qoat_priv *priv = reply->param;
char *resdata;
int resdatalen; int resdatalen;
QETH_CARD_TEXT(card, 3, "qoatcb"); QETH_CARD_TEXT(card, 3, "qoatcb");
if (qeth_setadpparms_inspect_rc(cmd)) if (qeth_setadpparms_inspect_rc(cmd))
return -EIO; return -EIO;
priv = (struct qeth_qoat_priv *)reply->param;
resdatalen = cmd->data.setadapterparms.hdr.cmdlength; resdatalen = cmd->data.setadapterparms.hdr.cmdlength;
resdata = (char *)data + 28;
if (resdatalen > (priv->buffer_len - priv->response_len)) if (resdatalen > (priv->buffer_len - priv->response_len))
return -ENOSPC; return -ENOSPC;
memcpy((priv->buffer + priv->response_len), resdata, memcpy(priv->buffer + priv->response_len,
resdatalen); &cmd->data.setadapterparms.hdr, resdatalen);
priv->response_len += resdatalen; priv->response_len += resdatalen;
if (cmd->data.setadapterparms.hdr.seq_no < if (cmd->data.setadapterparms.hdr.seq_no <
...@@ -4890,24 +4874,17 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata) ...@@ -4890,24 +4874,17 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata)
QETH_CARD_TEXT(card, 3, "qoatcmd"); QETH_CARD_TEXT(card, 3, "qoatcmd");
if (!qeth_adp_supported(card, IPA_SETADP_QUERY_OAT)) { if (!qeth_adp_supported(card, IPA_SETADP_QUERY_OAT))
rc = -EOPNOTSUPP; return -EOPNOTSUPP;
goto out;
}
if (copy_from_user(&oat_data, udata, if (copy_from_user(&oat_data, udata, sizeof(oat_data)))
sizeof(struct qeth_query_oat_data))) { return -EFAULT;
rc = -EFAULT;
goto out;
}
priv.buffer_len = oat_data.buffer_len; priv.buffer_len = oat_data.buffer_len;
priv.response_len = 0; priv.response_len = 0;
priv.buffer = vzalloc(oat_data.buffer_len); priv.buffer = vzalloc(oat_data.buffer_len);
if (!priv.buffer) { if (!priv.buffer)
rc = -ENOMEM; return -ENOMEM;
goto out;
}
iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_OAT, iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_OAT,
SETADP_DATA_SIZEOF(query_oat)); SETADP_DATA_SIZEOF(query_oat));
...@@ -4919,30 +4896,19 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata) ...@@ -4919,30 +4896,19 @@ static int qeth_query_oat_command(struct qeth_card *card, char __user *udata)
oat_req = &cmd->data.setadapterparms.data.query_oat; oat_req = &cmd->data.setadapterparms.data.query_oat;
oat_req->subcmd_code = oat_data.command; oat_req->subcmd_code = oat_data.command;
rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_query_oat_cb, rc = qeth_send_ipa_cmd(card, iob, qeth_setadpparms_query_oat_cb, &priv);
&priv);
if (!rc) { if (!rc) {
if (is_compat_task()) tmp = is_compat_task() ? compat_ptr(oat_data.ptr) :
tmp = compat_ptr(oat_data.ptr); u64_to_user_ptr(oat_data.ptr);
else
tmp = (void __user *)(unsigned long)oat_data.ptr;
if (copy_to_user(tmp, priv.buffer,
priv.response_len)) {
rc = -EFAULT;
goto out_free;
}
oat_data.response_len = priv.response_len; oat_data.response_len = priv.response_len;
if (copy_to_user(udata, &oat_data, if (copy_to_user(tmp, priv.buffer, priv.response_len) ||
sizeof(struct qeth_query_oat_data))) copy_to_user(udata, &oat_data, sizeof(oat_data)))
rc = -EFAULT; rc = -EFAULT;
} }
out_free: out_free:
vfree(priv.buffer); vfree(priv.buffer);
out:
return rc; return rc;
} }
...@@ -5331,9 +5297,12 @@ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok) ...@@ -5331,9 +5297,12 @@ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok)
(card->info.hwtrap && qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))) (card->info.hwtrap && qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM)))
card->info.hwtrap = 0; card->info.hwtrap = 0;
rc = qeth_set_access_ctrl_online(card, 0); if (card->options.isolation != ISOLATION_MODE_NONE) {
rc = qeth_setadpparms_set_access_ctrl(card,
card->options.isolation);
if (rc) if (rc)
goto out; goto out;
}
rc = qeth_init_qdio_queues(card); rc = qeth_init_qdio_queues(card);
if (rc) { if (rc) {
...@@ -6841,7 +6810,7 @@ netdev_features_t qeth_features_check(struct sk_buff *skb, ...@@ -6841,7 +6810,7 @@ netdev_features_t qeth_features_check(struct sk_buff *skb,
/* Traffic with local next-hop is not eligible for some offloads: */ /* Traffic with local next-hop is not eligible for some offloads: */
if (skb->ip_summed == CHECKSUM_PARTIAL && if (skb->ip_summed == CHECKSUM_PARTIAL &&
card->options.isolation != ISOLATION_MODE_FWD) { READ_ONCE(card->options.isolation) != ISOLATION_MODE_FWD) {
netdev_features_t restricted = 0; netdev_features_t restricted = 0;
if (skb_is_gso(skb) && !netif_needs_gso(skb, features)) if (skb_is_gso(skb) && !netif_needs_gso(skb, features))
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <asm/cio.h> #include <asm/cio.h>
#include "qeth_core_mpc.h" #include "qeth_core_mpc.h"
unsigned char IDX_ACTIVATE_READ[] = { const unsigned char IDX_ACTIVATE_READ[] = {
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x19, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x19, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc1,
...@@ -18,7 +18,7 @@ unsigned char IDX_ACTIVATE_READ[] = { ...@@ -18,7 +18,7 @@ unsigned char IDX_ACTIVATE_READ[] = {
0x00, 0x00 0x00, 0x00
}; };
unsigned char IDX_ACTIVATE_WRITE[] = { const unsigned char IDX_ACTIVATE_WRITE[] = {
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x15, 0x01, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc1, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc1,
...@@ -26,7 +26,7 @@ unsigned char IDX_ACTIVATE_WRITE[] = { ...@@ -26,7 +26,7 @@ unsigned char IDX_ACTIVATE_WRITE[] = {
0x00, 0x00 0x00, 0x00
}; };
unsigned char CM_ENABLE[] = { const unsigned char CM_ENABLE[] = {
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x63,
0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01,
...@@ -45,7 +45,7 @@ unsigned char CM_ENABLE[] = { ...@@ -45,7 +45,7 @@ unsigned char CM_ENABLE[] = {
0xff, 0xff, 0xff 0xff, 0xff, 0xff
}; };
unsigned char CM_SETUP[] = { const unsigned char CM_SETUP[] = {
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x64,
0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01,
...@@ -65,7 +65,7 @@ unsigned char CM_SETUP[] = { ...@@ -65,7 +65,7 @@ unsigned char CM_SETUP[] = {
0x04, 0x06, 0xc8, 0x00 0x04, 0x06, 0xc8, 0x00
}; };
unsigned char ULP_ENABLE[] = { const unsigned char ULP_ENABLE[] = {
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6b,
0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01,
...@@ -85,7 +85,7 @@ unsigned char ULP_ENABLE[] = { ...@@ -85,7 +85,7 @@ unsigned char ULP_ENABLE[] = {
0xf1, 0x00, 0x00 0xf1, 0x00, 0x00
}; };
unsigned char ULP_SETUP[] = { const unsigned char ULP_SETUP[] = {
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x6c,
0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01,
...@@ -107,7 +107,7 @@ unsigned char ULP_SETUP[] = { ...@@ -107,7 +107,7 @@ unsigned char ULP_SETUP[] = {
0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00
}; };
unsigned char DM_ACT[] = { const unsigned char DM_ACT[] = {
0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x55,
0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01,
...@@ -123,7 +123,7 @@ unsigned char DM_ACT[] = { ...@@ -123,7 +123,7 @@ unsigned char DM_ACT[] = {
0x05, 0x40, 0x01, 0x01, 0x00 0x05, 0x40, 0x01, 0x01, 0x00
}; };
unsigned char IPA_PDU_HEADER[] = { const unsigned char IPA_PDU_HEADER[] = {
0x00, 0xe0, 0x00, 0x00, 0x77, 0x77, 0x77, 0x77, 0x00, 0xe0, 0x00, 0x00, 0x77, 0x77, 0x77, 0x77,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
#include <uapi/linux/if_ether.h> #include <uapi/linux/if_ether.h>
#include <uapi/linux/in6.h> #include <uapi/linux/in6.h>
extern const unsigned char IPA_PDU_HEADER[];
#define IPA_PDU_HEADER_SIZE 0x40 #define IPA_PDU_HEADER_SIZE 0x40
#define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer + 0x0e) #define QETH_IPA_PDU_LEN_TOTAL(buffer) (buffer + 0x0e)
#define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer + 0x26) #define QETH_IPA_PDU_LEN_PDU1(buffer) (buffer + 0x26)
#define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer + 0x29) #define QETH_IPA_PDU_LEN_PDU2(buffer) (buffer + 0x29)
#define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer + 0x3a) #define QETH_IPA_PDU_LEN_PDU3(buffer) (buffer + 0x3a)
extern unsigned char IPA_PDU_HEADER[];
#define QETH_IPA_CMD_DEST_ADDR(buffer) (buffer + 0x2c) #define QETH_IPA_CMD_DEST_ADDR(buffer) (buffer + 0x2c)
#define QETH_SEQ_NO_LENGTH 4 #define QETH_SEQ_NO_LENGTH 4
...@@ -858,7 +858,7 @@ extern const char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd); ...@@ -858,7 +858,7 @@ extern const char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd);
/* END OF IP Assist related definitions */ /* END OF IP Assist related definitions */
/*****************************************************************************/ /*****************************************************************************/
extern unsigned char CM_ENABLE[]; extern const unsigned char CM_ENABLE[];
#define CM_ENABLE_SIZE 0x63 #define CM_ENABLE_SIZE 0x63
#define QETH_CM_ENABLE_ISSUER_RM_TOKEN(buffer) (buffer + 0x2c) #define QETH_CM_ENABLE_ISSUER_RM_TOKEN(buffer) (buffer + 0x2c)
#define QETH_CM_ENABLE_FILTER_TOKEN(buffer) (buffer + 0x53) #define QETH_CM_ENABLE_FILTER_TOKEN(buffer) (buffer + 0x53)
...@@ -868,7 +868,7 @@ extern unsigned char CM_ENABLE[]; ...@@ -868,7 +868,7 @@ extern unsigned char CM_ENABLE[];
(PDU_ENCAPSULATION(buffer) + 0x13) (PDU_ENCAPSULATION(buffer) + 0x13)
extern unsigned char CM_SETUP[]; extern const unsigned char CM_SETUP[];
#define CM_SETUP_SIZE 0x64 #define CM_SETUP_SIZE 0x64
#define QETH_CM_SETUP_DEST_ADDR(buffer) (buffer + 0x2c) #define QETH_CM_SETUP_DEST_ADDR(buffer) (buffer + 0x2c)
#define QETH_CM_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51) #define QETH_CM_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51)
...@@ -877,7 +877,7 @@ extern unsigned char CM_SETUP[]; ...@@ -877,7 +877,7 @@ extern unsigned char CM_SETUP[];
#define QETH_CM_SETUP_RESP_DEST_ADDR(buffer) \ #define QETH_CM_SETUP_RESP_DEST_ADDR(buffer) \
(PDU_ENCAPSULATION(buffer) + 0x1a) (PDU_ENCAPSULATION(buffer) + 0x1a)
extern unsigned char ULP_ENABLE[]; extern const unsigned char ULP_ENABLE[];
#define ULP_ENABLE_SIZE 0x6b #define ULP_ENABLE_SIZE 0x6b
#define QETH_ULP_ENABLE_LINKNUM(buffer) (buffer + 0x61) #define QETH_ULP_ENABLE_LINKNUM(buffer) (buffer + 0x61)
#define QETH_ULP_ENABLE_DEST_ADDR(buffer) (buffer + 0x2c) #define QETH_ULP_ENABLE_DEST_ADDR(buffer) (buffer + 0x2c)
...@@ -898,7 +898,7 @@ extern unsigned char ULP_ENABLE[]; ...@@ -898,7 +898,7 @@ extern unsigned char ULP_ENABLE[];
#define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer + 0x50) #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer + 0x50)
#define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer + 0x19) #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer + 0x19)
extern unsigned char ULP_SETUP[]; extern const unsigned char ULP_SETUP[];
#define ULP_SETUP_SIZE 0x6c #define ULP_SETUP_SIZE 0x6c
#define QETH_ULP_SETUP_DEST_ADDR(buffer) (buffer + 0x2c) #define QETH_ULP_SETUP_DEST_ADDR(buffer) (buffer + 0x2c)
#define QETH_ULP_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51) #define QETH_ULP_SETUP_CONNECTION_TOKEN(buffer) (buffer + 0x51)
...@@ -910,7 +910,7 @@ extern unsigned char ULP_SETUP[]; ...@@ -910,7 +910,7 @@ extern unsigned char ULP_SETUP[];
(PDU_ENCAPSULATION(buffer) + 0x1a) (PDU_ENCAPSULATION(buffer) + 0x1a)
extern unsigned char DM_ACT[]; extern const unsigned char DM_ACT[];
#define DM_ACT_SIZE 0x55 #define DM_ACT_SIZE 0x55
#define QETH_DM_ACT_DEST_ADDR(buffer) (buffer + 0x2c) #define QETH_DM_ACT_DEST_ADDR(buffer) (buffer + 0x2c)
#define QETH_DM_ACT_CONNECTION_TOKEN(buffer) (buffer + 0x51) #define QETH_DM_ACT_CONNECTION_TOKEN(buffer) (buffer + 0x51)
...@@ -921,9 +921,8 @@ extern unsigned char DM_ACT[]; ...@@ -921,9 +921,8 @@ extern unsigned char DM_ACT[];
#define QETH_PDU_HEADER_SEQ_NO(buffer) (buffer + 0x1c) #define QETH_PDU_HEADER_SEQ_NO(buffer) (buffer + 0x1c)
#define QETH_PDU_HEADER_ACK_SEQ_NO(buffer) (buffer + 0x20) #define QETH_PDU_HEADER_ACK_SEQ_NO(buffer) (buffer + 0x20)
extern unsigned char IDX_ACTIVATE_READ[]; extern const unsigned char IDX_ACTIVATE_READ[];
extern unsigned char IDX_ACTIVATE_WRITE[]; extern const unsigned char IDX_ACTIVATE_WRITE[];
#define IDX_ACTIVATE_SIZE 0x22 #define IDX_ACTIVATE_SIZE 0x22
#define QETH_IDX_ACT_PNO(buffer) (buffer+0x0b) #define QETH_IDX_ACT_PNO(buffer) (buffer+0x0b)
#define QETH_IDX_ACT_ISSUER_RM_TOKEN(buffer) (buffer + 0x0c) #define QETH_IDX_ACT_ISSUER_RM_TOKEN(buffer) (buffer + 0x0c)
......
...@@ -448,19 +448,17 @@ static ssize_t qeth_dev_isolation_store(struct device *dev, ...@@ -448,19 +448,17 @@ static ssize_t qeth_dev_isolation_store(struct device *dev,
rc = -EINVAL; rc = -EINVAL;
goto out; goto out;
} }
rc = count;
if (qeth_card_hw_is_reachable(card))
/* defer IP assist if device is offline (until discipline->set_online)*/ rc = qeth_setadpparms_set_access_ctrl(card, isolation);
card->options.prev_isolation = card->options.isolation;
card->options.isolation = isolation; if (!rc)
if (qeth_card_hw_is_reachable(card)) { WRITE_ONCE(card->options.isolation, isolation);
int ipa_rc = qeth_set_access_ctrl_online(card, 1);
if (ipa_rc != 0)
rc = ipa_rc;
}
out: out:
mutex_unlock(&card->conf_mutex); mutex_unlock(&card->conf_mutex);
return rc;
return rc ? rc : count;
} }
static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show, static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show,
......
...@@ -156,7 +156,7 @@ static void qeth_l2_drain_rx_mode_cache(struct qeth_card *card) ...@@ -156,7 +156,7 @@ static void qeth_l2_drain_rx_mode_cache(struct qeth_card *card)
struct hlist_node *tmp; struct hlist_node *tmp;
int i; int i;
hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) { hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) {
hash_del(&mac->hnode); hash_del(&mac->hnode);
kfree(mac); kfree(mac);
} }
...@@ -438,7 +438,7 @@ static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha) ...@@ -438,7 +438,7 @@ static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha)
u32 mac_hash = get_unaligned((u32 *)(&ha->addr[2])); u32 mac_hash = get_unaligned((u32 *)(&ha->addr[2]));
struct qeth_mac *mac; struct qeth_mac *mac;
hash_for_each_possible(card->mac_htable, mac, hnode, mac_hash) { hash_for_each_possible(card->rx_mode_addrs, mac, hnode, mac_hash) {
if (ether_addr_equal_64bits(ha->addr, mac->mac_addr)) { if (ether_addr_equal_64bits(ha->addr, mac->mac_addr)) {
mac->disp_flag = QETH_DISP_ADDR_DO_NOTHING; mac->disp_flag = QETH_DISP_ADDR_DO_NOTHING;
return; return;
...@@ -452,7 +452,7 @@ static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha) ...@@ -452,7 +452,7 @@ static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha)
ether_addr_copy(mac->mac_addr, ha->addr); ether_addr_copy(mac->mac_addr, ha->addr);
mac->disp_flag = QETH_DISP_ADDR_ADD; mac->disp_flag = QETH_DISP_ADDR_ADD;
hash_add(card->mac_htable, &mac->hnode, mac_hash); hash_add(card->rx_mode_addrs, &mac->hnode, mac_hash);
} }
static void qeth_l2_rx_mode_work(struct work_struct *work) static void qeth_l2_rx_mode_work(struct work_struct *work)
...@@ -475,7 +475,7 @@ static void qeth_l2_rx_mode_work(struct work_struct *work) ...@@ -475,7 +475,7 @@ static void qeth_l2_rx_mode_work(struct work_struct *work)
qeth_l2_add_mac(card, ha); qeth_l2_add_mac(card, ha);
netif_addr_unlock_bh(dev); netif_addr_unlock_bh(dev);
hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) { hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) {
switch (mac->disp_flag) { switch (mac->disp_flag) {
case QETH_DISP_ADDR_DELETE: case QETH_DISP_ADDR_DELETE:
qeth_l2_remove_mac(card, mac->mac_addr); qeth_l2_remove_mac(card, mac->mac_addr);
...@@ -601,7 +601,6 @@ static int qeth_l2_probe_device(struct ccwgroup_device *gdev) ...@@ -601,7 +601,6 @@ static int qeth_l2_probe_device(struct ccwgroup_device *gdev)
return rc; return rc;
} }
hash_init(card->mac_htable);
INIT_WORK(&card->rx_mode_work, qeth_l2_rx_mode_work); INIT_WORK(&card->rx_mode_work, qeth_l2_rx_mode_work);
return 0; return 0;
} }
......
...@@ -58,7 +58,7 @@ static struct qeth_ipaddr *qeth_l3_find_addr_by_ip(struct qeth_card *card, ...@@ -58,7 +58,7 @@ static struct qeth_ipaddr *qeth_l3_find_addr_by_ip(struct qeth_card *card,
struct qeth_ipaddr *addr; struct qeth_ipaddr *addr;
if (query->is_multicast) { if (query->is_multicast) {
hash_for_each_possible(card->ip_mc_htable, addr, hnode, key) hash_for_each_possible(card->rx_mode_addrs, addr, hnode, key)
if (qeth_l3_addr_match_ip(addr, query)) if (qeth_l3_addr_match_ip(addr, query))
return addr; return addr;
} else { } else {
...@@ -239,7 +239,7 @@ static void qeth_l3_drain_rx_mode_cache(struct qeth_card *card) ...@@ -239,7 +239,7 @@ static void qeth_l3_drain_rx_mode_cache(struct qeth_card *card)
struct hlist_node *tmp; struct hlist_node *tmp;
int i; int i;
hash_for_each_safe(card->ip_mc_htable, i, tmp, addr, hnode) { hash_for_each_safe(card->rx_mode_addrs, i, tmp, addr, hnode) {
hash_del(&addr->hnode); hash_del(&addr->hnode);
kfree(addr); kfree(addr);
} }
...@@ -1093,7 +1093,7 @@ static int qeth_l3_add_mcast_rtnl(struct net_device *dev, int vid, void *arg) ...@@ -1093,7 +1093,7 @@ static int qeth_l3_add_mcast_rtnl(struct net_device *dev, int vid, void *arg)
if (!ipm) if (!ipm)
continue; continue;
hash_add(card->ip_mc_htable, &ipm->hnode, hash_add(card->rx_mode_addrs, &ipm->hnode,
qeth_l3_ipaddr_hash(ipm)); qeth_l3_ipaddr_hash(ipm));
} }
...@@ -1124,8 +1124,8 @@ static int qeth_l3_add_mcast_rtnl(struct net_device *dev, int vid, void *arg) ...@@ -1124,8 +1124,8 @@ static int qeth_l3_add_mcast_rtnl(struct net_device *dev, int vid, void *arg)
if (!ipm) if (!ipm)
continue; continue;
hash_add(card->ip_mc_htable, hash_add(card->rx_mode_addrs, &ipm->hnode,
&ipm->hnode, qeth_l3_ipaddr_hash(ipm)); qeth_l3_ipaddr_hash(ipm));
} }
read_unlock_bh(&in6_dev->lock); read_unlock_bh(&in6_dev->lock);
...@@ -1219,7 +1219,7 @@ static void qeth_l3_rx_mode_work(struct work_struct *work) ...@@ -1219,7 +1219,7 @@ static void qeth_l3_rx_mode_work(struct work_struct *work)
vlan_for_each(card->dev, qeth_l3_add_mcast_rtnl, card); vlan_for_each(card->dev, qeth_l3_add_mcast_rtnl, card);
rtnl_unlock(); rtnl_unlock();
hash_for_each_safe(card->ip_mc_htable, i, tmp, addr, hnode) { hash_for_each_safe(card->rx_mode_addrs, i, tmp, addr, hnode) {
switch (addr->disp_flag) { switch (addr->disp_flag) {
case QETH_DISP_ADDR_DELETE: case QETH_DISP_ADDR_DELETE:
rc = qeth_l3_deregister_addr_entry(card, addr); rc = qeth_l3_deregister_addr_entry(card, addr);
...@@ -1919,12 +1919,6 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) ...@@ -1919,12 +1919,6 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
return rc; return rc;
if (IS_OSD(card) || IS_OSX(card)) { if (IS_OSD(card) || IS_OSX(card)) {
if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) ||
(card->info.link_type == QETH_LINK_TYPE_HSTR)) {
pr_info("qeth_l3: ignoring TR device\n");
return -ENODEV;
}
card->dev->netdev_ops = &qeth_l3_osa_netdev_ops; card->dev->netdev_ops = &qeth_l3_osa_netdev_ops;
/*IPv6 address autoconfiguration stuff*/ /*IPv6 address autoconfiguration stuff*/
...@@ -2004,7 +1998,6 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev) ...@@ -2004,7 +1998,6 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
} }
} }
hash_init(card->ip_mc_htable);
INIT_WORK(&card->rx_mode_work, qeth_l3_rx_mode_work); INIT_WORK(&card->rx_mode_work, qeth_l3_rx_mode_work);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment