Skip to content

Commit

Permalink
[PATCH] s390: minor modification in qeth layer2 code
Browse files Browse the repository at this point in the history
[patch 2/7] s390: minor modification in qeth layer2 code

From: Frank Pavlic <fpavlic@de.ibm.com>
	- use qeth_layer2_send_setdelvlan_cb to check
	  return code of a SET/DELVLAN IP Assist command.
	  It fits better in qeth's design and mechanism of IP Assist
	  command handling.

Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>

diffstat:
 qeth_main.c |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Frank Pavlic authored and Jeff Garzik committed Nov 11, 2005
1 parent bd389b9 commit 508cc2b
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions drivers/s390/net/qeth_main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* linux/drivers/s390/net/qeth_main.c ($Revision: 1.224 $)
* linux/drivers/s390/net/qeth_main.c ($Revision: 1.235 $)
*
* Linux on zSeries OSA Express and HiperSockets support
*
Expand All @@ -12,7 +12,7 @@
* Frank Pavlic (pavlic@de.ibm.com) and
* Thomas Spatzier <tspat@de.ibm.com>
*
* $Revision: 1.224 $ $Date: 2005/05/04 20:19:18 $
* $Revision: 1.235 $ $Date: 2005/05/04 20:19:18 $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -72,7 +72,7 @@
#include "qeth_eddp.h"
#include "qeth_tso.h"

#define VERSION_QETH_C "$Revision: 1.224 $"
#define VERSION_QETH_C "$Revision: 1.235 $"
static const char *version = "qeth S/390 OSA-Express driver";

/**
Expand Down Expand Up @@ -5350,27 +5350,39 @@ qeth_free_vlan_addresses6(struct qeth_card *card, unsigned short vid)
#endif /* CONFIG_QETH_IPV6 */
}

static void
static int
qeth_layer2_send_setdelvlan_cb(struct qeth_card *card,
struct qeth_reply *reply,
unsigned long data)
{
struct qeth_ipa_cmd *cmd;

QETH_DBF_TEXT(trace, 2, "L2sdvcb");
cmd = (struct qeth_ipa_cmd *) data;
if (cmd->hdr.return_code) {
PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
"Continuing\n",cmd->data.setdelvlan.vlan_id,
QETH_CARD_IFNAME(card), cmd->hdr.return_code);
QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command);
QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
QETH_DBF_TEXT_(trace, 2, "err%d", cmd->hdr.return_code);
}
return 0;
}

static int
qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i,
enum qeth_ipa_cmds ipacmd)
{
int rc;
struct qeth_ipa_cmd *cmd;
struct qeth_cmd_buffer *iob;

QETH_DBF_TEXT_(trace, 4, "L2sdv%x",ipacmd);
iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4);
cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
cmd->data.setdelvlan.vlan_id = i;

rc = qeth_send_ipa_cmd(card, iob, NULL, NULL);
if (rc) {
PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. "
"Continuing\n",i, QETH_CARD_IFNAME(card), rc);
QETH_DBF_TEXT_(trace, 2, "L2VL%4x", ipacmd);
QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card));
QETH_DBF_TEXT_(trace, 2, "err%d", rc);
}
return qeth_send_ipa_cmd(card, iob,
qeth_layer2_send_setdelvlan_cb, NULL);
}

static void
Expand Down

0 comments on commit 508cc2b

Please sign in to comment.