Commit 03a60580 authored by David S. Miller's avatar David S. Miller

Merge branch 's390'

Ursula Braun says:

====================
s390/qeth patches for net

here are two s390/qeth patches built for net.
One patch is quite large, but we would like to fix the locking warning
seen in recent kernels as soon as possible. But if you want me to submit
these patches for net-next, I will do.
Or Gerlitz says:
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b0a1ba59 1aec42bc
...@@ -1784,6 +1784,8 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel, ...@@ -1784,6 +1784,8 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel,
QETH_DBF_TEXT(SETUP, 2, "idxanswr"); QETH_DBF_TEXT(SETUP, 2, "idxanswr");
card = CARD_FROM_CDEV(channel->ccwdev); card = CARD_FROM_CDEV(channel->ccwdev);
iob = qeth_get_buffer(channel); iob = qeth_get_buffer(channel);
if (!iob)
return -ENOMEM;
iob->callback = idx_reply_cb; iob->callback = idx_reply_cb;
memcpy(&channel->ccw, READ_CCW, sizeof(struct ccw1)); memcpy(&channel->ccw, READ_CCW, sizeof(struct ccw1));
channel->ccw.count = QETH_BUFSIZE; channel->ccw.count = QETH_BUFSIZE;
...@@ -1834,6 +1836,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel, ...@@ -1834,6 +1836,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel,
QETH_DBF_TEXT(SETUP, 2, "idxactch"); QETH_DBF_TEXT(SETUP, 2, "idxactch");
iob = qeth_get_buffer(channel); iob = qeth_get_buffer(channel);
if (!iob)
return -ENOMEM;
iob->callback = idx_reply_cb; iob->callback = idx_reply_cb;
memcpy(&channel->ccw, WRITE_CCW, sizeof(struct ccw1)); memcpy(&channel->ccw, WRITE_CCW, sizeof(struct ccw1));
channel->ccw.count = IDX_ACTIVATE_SIZE; channel->ccw.count = IDX_ACTIVATE_SIZE;
...@@ -2021,10 +2025,36 @@ void qeth_prepare_control_data(struct qeth_card *card, int len, ...@@ -2021,10 +2025,36 @@ void qeth_prepare_control_data(struct qeth_card *card, int len,
} }
EXPORT_SYMBOL_GPL(qeth_prepare_control_data); EXPORT_SYMBOL_GPL(qeth_prepare_control_data);
/**
* qeth_send_control_data() - send control command to the card
* @card: qeth_card structure pointer
* @len: size of the command buffer
* @iob: qeth_cmd_buffer pointer
* @reply_cb: callback function pointer
* @cb_card: pointer to the qeth_card structure
* @cb_reply: pointer to the qeth_reply structure
* @cb_cmd: pointer to the original iob for non-IPA
* commands, or to the qeth_ipa_cmd structure
* for the IPA commands.
* @reply_param: private pointer passed to the callback
*
* Returns the value of the `return_code' field of the response
* block returned from the hardware, or other error indication.
* Value of zero indicates successful execution of the command.
*
* Callback function gets called one or more times, with cb_cmd
* pointing to the response returned by the hardware. Callback
* function must return non-zero if more reply blocks are expected,
* and zero if the last or only reply block is received. Callback
* function can get the value of the reply_param pointer from the
* field 'param' of the structure qeth_reply.
*/
int qeth_send_control_data(struct qeth_card *card, int len, int qeth_send_control_data(struct qeth_card *card, int len,
struct qeth_cmd_buffer *iob, struct qeth_cmd_buffer *iob,
int (*reply_cb)(struct qeth_card *, struct qeth_reply *, int (*reply_cb)(struct qeth_card *cb_card,
unsigned long), struct qeth_reply *cb_reply,
unsigned long cb_cmd),
void *reply_param) void *reply_param)
{ {
int rc; int rc;
...@@ -2914,9 +2944,16 @@ struct qeth_cmd_buffer *qeth_get_ipacmd_buffer(struct qeth_card *card, ...@@ -2914,9 +2944,16 @@ struct qeth_cmd_buffer *qeth_get_ipacmd_buffer(struct qeth_card *card,
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
struct qeth_ipa_cmd *cmd; struct qeth_ipa_cmd *cmd;
iob = qeth_wait_for_buffer(&card->write); iob = qeth_get_buffer(&card->write);
if (iob) {
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
qeth_fill_ipacmd_header(card, cmd, ipacmd, prot); qeth_fill_ipacmd_header(card, cmd, ipacmd, prot);
} else {
dev_warn(&card->gdev->dev,
"The qeth driver ran out of channel command buffers\n");
QETH_DBF_MESSAGE(1, "%s The qeth driver ran out of channel command buffers",
dev_name(&card->gdev->dev));
}
return iob; return iob;
} }
...@@ -2932,6 +2969,12 @@ void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, ...@@ -2932,6 +2969,12 @@ void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
} }
EXPORT_SYMBOL_GPL(qeth_prepare_ipa_cmd); EXPORT_SYMBOL_GPL(qeth_prepare_ipa_cmd);
/**
* qeth_send_ipa_cmd() - send an IPA command
*
* See qeth_send_control_data() for explanation of the arguments.
*/
int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
int (*reply_cb)(struct qeth_card *, struct qeth_reply*, int (*reply_cb)(struct qeth_card *, struct qeth_reply*,
unsigned long), unsigned long),
...@@ -2968,6 +3011,8 @@ int qeth_send_startlan(struct qeth_card *card) ...@@ -2968,6 +3011,8 @@ int qeth_send_startlan(struct qeth_card *card)
QETH_DBF_TEXT(SETUP, 2, "strtlan"); QETH_DBF_TEXT(SETUP, 2, "strtlan");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_STARTLAN, 0); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_STARTLAN, 0);
if (!iob)
return -ENOMEM;
rc = qeth_send_ipa_cmd(card, iob, NULL, NULL); rc = qeth_send_ipa_cmd(card, iob, NULL, NULL);
return rc; return rc;
} }
...@@ -3013,11 +3058,13 @@ static struct qeth_cmd_buffer *qeth_get_adapter_cmd(struct qeth_card *card, ...@@ -3013,11 +3058,13 @@ static struct qeth_cmd_buffer *qeth_get_adapter_cmd(struct qeth_card *card,
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETADAPTERPARMS, iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETADAPTERPARMS,
QETH_PROT_IPV4); QETH_PROT_IPV4);
if (iob) {
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.setadapterparms.hdr.cmdlength = cmdlen; cmd->data.setadapterparms.hdr.cmdlength = cmdlen;
cmd->data.setadapterparms.hdr.command_code = command; cmd->data.setadapterparms.hdr.command_code = command;
cmd->data.setadapterparms.hdr.used_total = 1; cmd->data.setadapterparms.hdr.used_total = 1;
cmd->data.setadapterparms.hdr.seq_no = 1; cmd->data.setadapterparms.hdr.seq_no = 1;
}
return iob; return iob;
} }
...@@ -3030,6 +3077,8 @@ int qeth_query_setadapterparms(struct qeth_card *card) ...@@ -3030,6 +3077,8 @@ int qeth_query_setadapterparms(struct qeth_card *card)
QETH_CARD_TEXT(card, 3, "queryadp"); QETH_CARD_TEXT(card, 3, "queryadp");
iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_COMMANDS_SUPPORTED, iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_COMMANDS_SUPPORTED,
sizeof(struct qeth_ipacmd_setadpparms)); sizeof(struct qeth_ipacmd_setadpparms));
if (!iob)
return -ENOMEM;
rc = qeth_send_ipa_cmd(card, iob, qeth_query_setadapterparms_cb, NULL); rc = qeth_send_ipa_cmd(card, iob, qeth_query_setadapterparms_cb, NULL);
return rc; return rc;
} }
...@@ -3080,6 +3129,8 @@ int qeth_query_ipassists(struct qeth_card *card, enum qeth_prot_versions prot) ...@@ -3080,6 +3129,8 @@ int qeth_query_ipassists(struct qeth_card *card, enum qeth_prot_versions prot)
QETH_DBF_TEXT_(SETUP, 2, "qipassi%i", prot); QETH_DBF_TEXT_(SETUP, 2, "qipassi%i", prot);
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_QIPASSIST, prot); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_QIPASSIST, prot);
if (!iob)
return -ENOMEM;
rc = qeth_send_ipa_cmd(card, iob, qeth_query_ipassists_cb, NULL); rc = qeth_send_ipa_cmd(card, iob, qeth_query_ipassists_cb, NULL);
return rc; return rc;
} }
...@@ -3119,6 +3170,8 @@ int qeth_query_switch_attributes(struct qeth_card *card, ...@@ -3119,6 +3170,8 @@ int qeth_query_switch_attributes(struct qeth_card *card,
return -ENOMEDIUM; return -ENOMEDIUM;
iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_SWITCH_ATTRIBUTES, iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_SWITCH_ATTRIBUTES,
sizeof(struct qeth_ipacmd_setadpparms_hdr)); sizeof(struct qeth_ipacmd_setadpparms_hdr));
if (!iob)
return -ENOMEM;
return qeth_send_ipa_cmd(card, iob, return qeth_send_ipa_cmd(card, iob,
qeth_query_switch_attributes_cb, sw_info); qeth_query_switch_attributes_cb, sw_info);
} }
...@@ -3146,6 +3199,8 @@ static int qeth_query_setdiagass(struct qeth_card *card) ...@@ -3146,6 +3199,8 @@ static int qeth_query_setdiagass(struct qeth_card *card)
QETH_DBF_TEXT(SETUP, 2, "qdiagass"); QETH_DBF_TEXT(SETUP, 2, "qdiagass");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.diagass.subcmd_len = 16; cmd->data.diagass.subcmd_len = 16;
cmd->data.diagass.subcmd = QETH_DIAGS_CMD_QUERY; cmd->data.diagass.subcmd = QETH_DIAGS_CMD_QUERY;
...@@ -3197,6 +3252,8 @@ int qeth_hw_trap(struct qeth_card *card, enum qeth_diags_trap_action action) ...@@ -3197,6 +3252,8 @@ int qeth_hw_trap(struct qeth_card *card, enum qeth_diags_trap_action action)
QETH_DBF_TEXT(SETUP, 2, "diagtrap"); QETH_DBF_TEXT(SETUP, 2, "diagtrap");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.diagass.subcmd_len = 80; cmd->data.diagass.subcmd_len = 80;
cmd->data.diagass.subcmd = QETH_DIAGS_CMD_TRAP; cmd->data.diagass.subcmd = QETH_DIAGS_CMD_TRAP;
...@@ -4162,6 +4219,8 @@ void qeth_setadp_promisc_mode(struct qeth_card *card) ...@@ -4162,6 +4219,8 @@ void qeth_setadp_promisc_mode(struct qeth_card *card)
iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_PROMISC_MODE, iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_PROMISC_MODE,
sizeof(struct qeth_ipacmd_setadpparms)); sizeof(struct qeth_ipacmd_setadpparms));
if (!iob)
return;
cmd = (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data + IPA_PDU_HEADER_SIZE);
cmd->data.setadapterparms.data.mode = mode; cmd->data.setadapterparms.data.mode = mode;
qeth_send_ipa_cmd(card, iob, qeth_setadp_promisc_mode_cb, NULL); qeth_send_ipa_cmd(card, iob, qeth_setadp_promisc_mode_cb, NULL);
...@@ -4232,6 +4291,8 @@ int qeth_setadpparms_change_macaddr(struct qeth_card *card) ...@@ -4232,6 +4291,8 @@ int qeth_setadpparms_change_macaddr(struct qeth_card *card)
iob = qeth_get_adapter_cmd(card, IPA_SETADP_ALTER_MAC_ADDRESS, iob = qeth_get_adapter_cmd(card, IPA_SETADP_ALTER_MAC_ADDRESS,
sizeof(struct qeth_ipacmd_setadpparms)); sizeof(struct qeth_ipacmd_setadpparms));
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.setadapterparms.data.change_addr.cmd = CHANGE_ADDR_READ_MAC; cmd->data.setadapterparms.data.change_addr.cmd = CHANGE_ADDR_READ_MAC;
cmd->data.setadapterparms.data.change_addr.addr_size = OSA_ADDR_LEN; cmd->data.setadapterparms.data.change_addr.addr_size = OSA_ADDR_LEN;
...@@ -4345,6 +4406,8 @@ static int qeth_setadpparms_set_access_ctrl(struct qeth_card *card, ...@@ -4345,6 +4406,8 @@ static int qeth_setadpparms_set_access_ctrl(struct qeth_card *card,
iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_ACCESS_CONTROL, iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_ACCESS_CONTROL,
sizeof(struct qeth_ipacmd_setadpparms_hdr) + sizeof(struct qeth_ipacmd_setadpparms_hdr) +
sizeof(struct qeth_set_access_ctrl)); sizeof(struct qeth_set_access_ctrl));
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
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 = isolation;
...@@ -4588,6 +4651,10 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata) ...@@ -4588,6 +4651,10 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_SNMP_CONTROL, iob = qeth_get_adapter_cmd(card, IPA_SETADP_SET_SNMP_CONTROL,
QETH_SNMP_SETADP_CMDLENGTH + req_len); QETH_SNMP_SETADP_CMDLENGTH + req_len);
if (!iob) {
rc = -ENOMEM;
goto out;
}
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
memcpy(&cmd->data.setadapterparms.data.snmp, &ureq->cmd, req_len); memcpy(&cmd->data.setadapterparms.data.snmp, &ureq->cmd, req_len);
rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len, rc = qeth_send_ipa_snmp_cmd(card, iob, QETH_SETADP_BASE_LEN + req_len,
...@@ -4599,7 +4666,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata) ...@@ -4599,7 +4666,7 @@ int qeth_snmp_command(struct qeth_card *card, char __user *udata)
if (copy_to_user(udata, qinfo.udata, qinfo.udata_len)) if (copy_to_user(udata, qinfo.udata, qinfo.udata_len))
rc = -EFAULT; rc = -EFAULT;
} }
out:
kfree(ureq); kfree(ureq);
kfree(qinfo.udata); kfree(qinfo.udata);
return rc; return rc;
...@@ -4670,6 +4737,10 @@ int qeth_query_oat_command(struct qeth_card *card, char __user *udata) ...@@ -4670,6 +4737,10 @@ int qeth_query_oat_command(struct qeth_card *card, char __user *udata)
iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_OAT, iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_OAT,
sizeof(struct qeth_ipacmd_setadpparms_hdr) + sizeof(struct qeth_ipacmd_setadpparms_hdr) +
sizeof(struct qeth_query_oat)); sizeof(struct qeth_query_oat));
if (!iob) {
rc = -ENOMEM;
goto out_free;
}
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
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;
...@@ -4735,6 +4806,8 @@ static int qeth_query_card_info(struct qeth_card *card, ...@@ -4735,6 +4806,8 @@ static int qeth_query_card_info(struct qeth_card *card,
return -EOPNOTSUPP; return -EOPNOTSUPP;
iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_CARD_INFO, iob = qeth_get_adapter_cmd(card, IPA_SETADP_QUERY_CARD_INFO,
sizeof(struct qeth_ipacmd_setadpparms_hdr)); sizeof(struct qeth_ipacmd_setadpparms_hdr));
if (!iob)
return -ENOMEM;
return qeth_send_ipa_cmd(card, iob, qeth_query_card_info_cb, return qeth_send_ipa_cmd(card, iob, qeth_query_card_info_cb,
(void *)carrier_info); (void *)carrier_info);
} }
...@@ -5060,11 +5133,23 @@ int qeth_core_hardsetup_card(struct qeth_card *card) ...@@ -5060,11 +5133,23 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
card->options.adp.supported_funcs = 0; card->options.adp.supported_funcs = 0;
card->options.sbp.supported_funcs = 0; card->options.sbp.supported_funcs = 0;
card->info.diagass_support = 0; card->info.diagass_support = 0;
qeth_query_ipassists(card, QETH_PROT_IPV4); rc = qeth_query_ipassists(card, QETH_PROT_IPV4);
if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) if (rc == -ENOMEM)
qeth_query_setadapterparms(card); goto out;
if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST)) if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) {
qeth_query_setdiagass(card); rc = qeth_query_setadapterparms(card);
if (rc < 0) {
QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
goto out;
}
}
if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST)) {
rc = qeth_query_setdiagass(card);
if (rc < 0) {
QETH_DBF_TEXT_(SETUP, 2, "7err%d", rc);
goto out;
}
}
return 0; return 0;
out: out:
dev_warn(&card->gdev->dev, "The qeth device driver failed to recover " dev_warn(&card->gdev->dev, "The qeth device driver failed to recover "
......
This diff is collapsed.
...@@ -549,6 +549,8 @@ static int qeth_l3_send_setdelmc(struct qeth_card *card, ...@@ -549,6 +549,8 @@ static int qeth_l3_send_setdelmc(struct qeth_card *card,
QETH_CARD_TEXT(card, 4, "setdelmc"); QETH_CARD_TEXT(card, 4, "setdelmc");
iob = qeth_get_ipacmd_buffer(card, ipacmd, addr->proto); iob = qeth_get_ipacmd_buffer(card, ipacmd, addr->proto);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
memcpy(&cmd->data.setdelipm.mac, addr->mac, OSA_ADDR_LEN); memcpy(&cmd->data.setdelipm.mac, addr->mac, OSA_ADDR_LEN);
if (addr->proto == QETH_PROT_IPV6) if (addr->proto == QETH_PROT_IPV6)
...@@ -588,6 +590,8 @@ static int qeth_l3_send_setdelip(struct qeth_card *card, ...@@ -588,6 +590,8 @@ static int qeth_l3_send_setdelip(struct qeth_card *card,
QETH_CARD_TEXT_(card, 4, "flags%02X", flags); QETH_CARD_TEXT_(card, 4, "flags%02X", flags);
iob = qeth_get_ipacmd_buffer(card, ipacmd, addr->proto); iob = qeth_get_ipacmd_buffer(card, ipacmd, addr->proto);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
if (addr->proto == QETH_PROT_IPV6) { if (addr->proto == QETH_PROT_IPV6) {
memcpy(cmd->data.setdelip6.ip_addr, &addr->u.a6.addr, memcpy(cmd->data.setdelip6.ip_addr, &addr->u.a6.addr,
...@@ -616,6 +620,8 @@ static int qeth_l3_send_setrouting(struct qeth_card *card, ...@@ -616,6 +620,8 @@ static int qeth_l3_send_setrouting(struct qeth_card *card,
QETH_CARD_TEXT(card, 4, "setroutg"); QETH_CARD_TEXT(card, 4, "setroutg");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETRTG, prot); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETRTG, prot);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.setrtg.type = (type); cmd->data.setrtg.type = (type);
rc = qeth_send_ipa_cmd(card, iob, NULL, NULL); rc = qeth_send_ipa_cmd(card, iob, NULL, NULL);
...@@ -1049,12 +1055,14 @@ static struct qeth_cmd_buffer *qeth_l3_get_setassparms_cmd( ...@@ -1049,12 +1055,14 @@ static struct qeth_cmd_buffer *qeth_l3_get_setassparms_cmd(
QETH_CARD_TEXT(card, 4, "getasscm"); QETH_CARD_TEXT(card, 4, "getasscm");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETASSPARMS, prot); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETASSPARMS, prot);
if (iob) {
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.setassparms.hdr.assist_no = ipa_func; cmd->data.setassparms.hdr.assist_no = ipa_func;
cmd->data.setassparms.hdr.length = 8 + len; cmd->data.setassparms.hdr.length = 8 + len;
cmd->data.setassparms.hdr.command_code = cmd_code; cmd->data.setassparms.hdr.command_code = cmd_code;
cmd->data.setassparms.hdr.return_code = 0; cmd->data.setassparms.hdr.return_code = 0;
cmd->data.setassparms.hdr.seq_no = 0; cmd->data.setassparms.hdr.seq_no = 0;
}
return iob; return iob;
} }
...@@ -1090,6 +1098,8 @@ static int qeth_l3_send_simple_setassparms_ipv6(struct qeth_card *card, ...@@ -1090,6 +1098,8 @@ static int qeth_l3_send_simple_setassparms_ipv6(struct qeth_card *card,
QETH_CARD_TEXT(card, 4, "simassp6"); QETH_CARD_TEXT(card, 4, "simassp6");
iob = qeth_l3_get_setassparms_cmd(card, ipa_func, cmd_code, iob = qeth_l3_get_setassparms_cmd(card, ipa_func, cmd_code,
0, QETH_PROT_IPV6); 0, QETH_PROT_IPV6);
if (!iob)
return -ENOMEM;
rc = qeth_l3_send_setassparms(card, iob, 0, 0, rc = qeth_l3_send_setassparms(card, iob, 0, 0,
qeth_l3_default_setassparms_cb, NULL); qeth_l3_default_setassparms_cb, NULL);
return rc; return rc;
...@@ -1108,6 +1118,8 @@ static int qeth_l3_send_simple_setassparms(struct qeth_card *card, ...@@ -1108,6 +1118,8 @@ static int qeth_l3_send_simple_setassparms(struct qeth_card *card,
length = sizeof(__u32); length = sizeof(__u32);
iob = qeth_l3_get_setassparms_cmd(card, ipa_func, cmd_code, iob = qeth_l3_get_setassparms_cmd(card, ipa_func, cmd_code,
length, QETH_PROT_IPV4); length, QETH_PROT_IPV4);
if (!iob)
return -ENOMEM;
rc = qeth_l3_send_setassparms(card, iob, length, data, rc = qeth_l3_send_setassparms(card, iob, length, data,
qeth_l3_default_setassparms_cb, NULL); qeth_l3_default_setassparms_cb, NULL);
return rc; return rc;
...@@ -1494,6 +1506,8 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card) ...@@ -1494,6 +1506,8 @@ static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card)
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR, iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR,
QETH_PROT_IPV6); QETH_PROT_IPV6);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
*((__u16 *) &cmd->data.create_destroy_addr.unique_id[6]) = *((__u16 *) &cmd->data.create_destroy_addr.unique_id[6]) =
card->info.unique_id; card->info.unique_id;
...@@ -1537,6 +1551,8 @@ static int qeth_l3_get_unique_id(struct qeth_card *card) ...@@ -1537,6 +1551,8 @@ static int qeth_l3_get_unique_id(struct qeth_card *card)
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR, iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR,
QETH_PROT_IPV6); QETH_PROT_IPV6);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
*((__u16 *) &cmd->data.create_destroy_addr.unique_id[6]) = *((__u16 *) &cmd->data.create_destroy_addr.unique_id[6]) =
card->info.unique_id; card->info.unique_id;
...@@ -1611,6 +1627,8 @@ qeth_diags_trace(struct qeth_card *card, enum qeth_diags_trace_cmds diags_cmd) ...@@ -1611,6 +1627,8 @@ qeth_diags_trace(struct qeth_card *card, enum qeth_diags_trace_cmds diags_cmd)
QETH_DBF_TEXT(SETUP, 2, "diagtrac"); QETH_DBF_TEXT(SETUP, 2, "diagtrac");
iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0); iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.diagass.subcmd_len = 16; cmd->data.diagass.subcmd_len = 16;
cmd->data.diagass.subcmd = QETH_DIAGS_CMD_TRACE; cmd->data.diagass.subcmd = QETH_DIAGS_CMD_TRACE;
...@@ -2442,6 +2460,8 @@ static int qeth_l3_query_arp_cache_info(struct qeth_card *card, ...@@ -2442,6 +2460,8 @@ static int qeth_l3_query_arp_cache_info(struct qeth_card *card,
IPA_CMD_ASS_ARP_QUERY_INFO, IPA_CMD_ASS_ARP_QUERY_INFO,
sizeof(struct qeth_arp_query_data) - sizeof(char), sizeof(struct qeth_arp_query_data) - sizeof(char),
prot); prot);
if (!iob)
return -ENOMEM;
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.setassparms.data.query_arp.request_bits = 0x000F; cmd->data.setassparms.data.query_arp.request_bits = 0x000F;
cmd->data.setassparms.data.query_arp.reply_bits = 0; cmd->data.setassparms.data.query_arp.reply_bits = 0;
...@@ -2535,6 +2555,8 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card, ...@@ -2535,6 +2555,8 @@ static int qeth_l3_arp_add_entry(struct qeth_card *card,
IPA_CMD_ASS_ARP_ADD_ENTRY, IPA_CMD_ASS_ARP_ADD_ENTRY,
sizeof(struct qeth_arp_cache_entry), sizeof(struct qeth_arp_cache_entry),
QETH_PROT_IPV4); QETH_PROT_IPV4);
if (!iob)
return -ENOMEM;
rc = qeth_l3_send_setassparms(card, iob, rc = qeth_l3_send_setassparms(card, iob,
sizeof(struct qeth_arp_cache_entry), sizeof(struct qeth_arp_cache_entry),
(unsigned long) entry, (unsigned long) entry,
...@@ -2574,6 +2596,8 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card, ...@@ -2574,6 +2596,8 @@ static int qeth_l3_arp_remove_entry(struct qeth_card *card,
IPA_CMD_ASS_ARP_REMOVE_ENTRY, IPA_CMD_ASS_ARP_REMOVE_ENTRY,
12, 12,
QETH_PROT_IPV4); QETH_PROT_IPV4);
if (!iob)
return -ENOMEM;
rc = qeth_l3_send_setassparms(card, iob, rc = qeth_l3_send_setassparms(card, iob,
12, (unsigned long)buf, 12, (unsigned long)buf,
qeth_l3_default_setassparms_cb, NULL); qeth_l3_default_setassparms_cb, NULL);
...@@ -3262,6 +3286,8 @@ static const struct net_device_ops qeth_l3_osa_netdev_ops = { ...@@ -3262,6 +3286,8 @@ static const struct net_device_ops qeth_l3_osa_netdev_ops = {
static int qeth_l3_setup_netdev(struct qeth_card *card) static int qeth_l3_setup_netdev(struct qeth_card *card)
{ {
int rc;
if (card->info.type == QETH_CARD_TYPE_OSD || if (card->info.type == QETH_CARD_TYPE_OSD ||
card->info.type == QETH_CARD_TYPE_OSX) { card->info.type == QETH_CARD_TYPE_OSX) {
if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) || if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) ||
...@@ -3293,7 +3319,9 @@ static int qeth_l3_setup_netdev(struct qeth_card *card) ...@@ -3293,7 +3319,9 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
return -ENODEV; return -ENODEV;
card->dev->flags |= IFF_NOARP; card->dev->flags |= IFF_NOARP;
card->dev->netdev_ops = &qeth_l3_netdev_ops; card->dev->netdev_ops = &qeth_l3_netdev_ops;
qeth_l3_iqd_read_initial_mac(card); rc = qeth_l3_iqd_read_initial_mac(card);
if (rc)
return rc;
if (card->options.hsuid[0]) if (card->options.hsuid[0])
memcpy(card->dev->perm_addr, card->options.hsuid, 9); memcpy(card->dev->perm_addr, card->options.hsuid, 9);
} else } else
...@@ -3360,7 +3388,7 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) ...@@ -3360,7 +3388,7 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
recover_flag = card->state; recover_flag = card->state;
rc = qeth_core_hardsetup_card(card); rc = qeth_core_hardsetup_card(card);
if (rc) { if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc);
rc = -ENODEV; rc = -ENODEV;
goto out_remove; goto out_remove;
} }
...@@ -3401,7 +3429,7 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) ...@@ -3401,7 +3429,7 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
contin: contin:
rc = qeth_l3_setadapter_parms(card); rc = qeth_l3_setadapter_parms(card);
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc);
if (!card->options.sniffer) { if (!card->options.sniffer) {
rc = qeth_l3_start_ipassists(card); rc = qeth_l3_start_ipassists(card);
if (rc) { if (rc) {
...@@ -3410,10 +3438,10 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) ...@@ -3410,10 +3438,10 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
} }
rc = qeth_l3_setrouting_v4(card); rc = qeth_l3_setrouting_v4(card);
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "4err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "4err%04x", rc);
rc = qeth_l3_setrouting_v6(card); rc = qeth_l3_setrouting_v6(card);
if (rc) if (rc)
QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc); QETH_DBF_TEXT_(SETUP, 2, "5err%04x", rc);
} }
netif_tx_disable(card->dev); netif_tx_disable(card->dev);
......
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