Commit 1c696c89 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: clarify parameter for simple assist cmds

For code that uses qeth_send_simple_setassparms_prot(), we currently
can't differentiate whether the cmd should contain (1) no parameter, or
(2) a 4-byte parameter with value 0.
At the moment this doesn't cause any trouble. But when using dynamically
allocated cmds, we need to know whether to allocate & transmit an
additional 4 bytes of zeroes.
So instead of the raw parameter value, pass a parameter pointer
(or NULL) to qeth_send_simple_setassparms_prot().
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a59d121d
...@@ -940,12 +940,12 @@ static inline int qeth_is_diagass_supported(struct qeth_card *card, ...@@ -940,12 +940,12 @@ static inline int qeth_is_diagass_supported(struct qeth_card *card,
int qeth_send_simple_setassparms_prot(struct qeth_card *card, int qeth_send_simple_setassparms_prot(struct qeth_card *card,
enum qeth_ipa_funcs ipa_func, enum qeth_ipa_funcs ipa_func,
u16 cmd_code, long data, u16 cmd_code, u32 *data,
enum qeth_prot_versions prot); enum qeth_prot_versions prot);
/* IPv4 variant */ /* IPv4 variant */
static inline int qeth_send_simple_setassparms(struct qeth_card *card, static inline int qeth_send_simple_setassparms(struct qeth_card *card,
enum qeth_ipa_funcs ipa_func, enum qeth_ipa_funcs ipa_func,
u16 cmd_code, long data) u16 cmd_code, u32 *data)
{ {
return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code, return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code,
data, QETH_PROT_IPV4); data, QETH_PROT_IPV4);
...@@ -953,7 +953,7 @@ static inline int qeth_send_simple_setassparms(struct qeth_card *card, ...@@ -953,7 +953,7 @@ static inline int qeth_send_simple_setassparms(struct qeth_card *card,
static inline int qeth_send_simple_setassparms_v6(struct qeth_card *card, static inline int qeth_send_simple_setassparms_v6(struct qeth_card *card,
enum qeth_ipa_funcs ipa_func, enum qeth_ipa_funcs ipa_func,
u16 cmd_code, long data) u16 cmd_code, u32 *data)
{ {
return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code, return qeth_send_simple_setassparms_prot(card, ipa_func, cmd_code,
data, QETH_PROT_IPV6); data, QETH_PROT_IPV6);
......
...@@ -5355,20 +5355,19 @@ EXPORT_SYMBOL_GPL(qeth_get_setassparms_cmd); ...@@ -5355,20 +5355,19 @@ EXPORT_SYMBOL_GPL(qeth_get_setassparms_cmd);
int qeth_send_simple_setassparms_prot(struct qeth_card *card, int qeth_send_simple_setassparms_prot(struct qeth_card *card,
enum qeth_ipa_funcs ipa_func, enum qeth_ipa_funcs ipa_func,
u16 cmd_code, long data, u16 cmd_code, u32 *data,
enum qeth_prot_versions prot) enum qeth_prot_versions prot)
{ {
int length = 0; unsigned int length = data ? SETASS_DATA_SIZEOF(flags_32bit) : 0;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
QETH_CARD_TEXT_(card, 4, "simassp%i", prot); QETH_CARD_TEXT_(card, 4, "simassp%i", prot);
if (data)
length = sizeof(__u32);
iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code, length, prot); iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code, length, prot);
if (!iob) if (!iob)
return -ENOMEM; return -ENOMEM;
__ipa_cmd(iob)->data.setassparms.data.flags_32bit = (__u32) data; if (data)
__ipa_cmd(iob)->data.setassparms.data.flags_32bit = *data;
return qeth_send_ipa_cmd(card, iob, qeth_setassparms_cb, NULL); return qeth_send_ipa_cmd(card, iob, qeth_setassparms_cb, NULL);
} }
EXPORT_SYMBOL_GPL(qeth_send_simple_setassparms_prot); EXPORT_SYMBOL_GPL(qeth_send_simple_setassparms_prot);
...@@ -5885,8 +5884,8 @@ static int qeth_start_csum_cb(struct qeth_card *card, struct qeth_reply *reply, ...@@ -5885,8 +5884,8 @@ static int qeth_start_csum_cb(struct qeth_card *card, struct qeth_reply *reply,
static int qeth_set_csum_off(struct qeth_card *card, enum qeth_ipa_funcs cstype, static int qeth_set_csum_off(struct qeth_card *card, enum qeth_ipa_funcs cstype,
enum qeth_prot_versions prot) enum qeth_prot_versions prot)
{ {
return qeth_send_simple_setassparms_prot(card, cstype, return qeth_send_simple_setassparms_prot(card, cstype, IPA_CMD_ASS_STOP,
IPA_CMD_ASS_STOP, 0, prot); NULL, prot);
} }
static int qeth_set_csum_on(struct qeth_card *card, enum qeth_ipa_funcs cstype, static int qeth_set_csum_on(struct qeth_card *card, enum qeth_ipa_funcs cstype,
...@@ -5974,7 +5973,7 @@ static int qeth_set_tso_off(struct qeth_card *card, ...@@ -5974,7 +5973,7 @@ static int qeth_set_tso_off(struct qeth_card *card,
enum qeth_prot_versions prot) enum qeth_prot_versions prot)
{ {
return qeth_send_simple_setassparms_prot(card, IPA_OUTBOUND_TSO, return qeth_send_simple_setassparms_prot(card, IPA_OUTBOUND_TSO,
IPA_CMD_ASS_STOP, 0, prot); IPA_CMD_ASS_STOP, NULL, prot);
} }
static int qeth_set_tso_on(struct qeth_card *card, static int qeth_set_tso_on(struct qeth_card *card,
......
...@@ -437,6 +437,8 @@ struct qeth_ipacmd_setassparms { ...@@ -437,6 +437,8 @@ struct qeth_ipacmd_setassparms {
} data; } data;
} __attribute__ ((packed)); } __attribute__ ((packed));
#define SETASS_DATA_SIZEOF(field) FIELD_SIZEOF(struct qeth_ipacmd_setassparms,\
data.field)
/* SETRTG IPA Command: ****************************************************/ /* SETRTG IPA Command: ****************************************************/
struct qeth_set_routing { struct qeth_set_routing {
......
...@@ -770,7 +770,7 @@ static int qeth_l3_start_ipa_arp_processing(struct qeth_card *card) ...@@ -770,7 +770,7 @@ static int qeth_l3_start_ipa_arp_processing(struct qeth_card *card)
return 0; return 0;
} }
rc = qeth_send_simple_setassparms(card, IPA_ARP_PROCESSING, rc = qeth_send_simple_setassparms(card, IPA_ARP_PROCESSING,
IPA_CMD_ASS_START, 0); IPA_CMD_ASS_START, NULL);
if (rc) { if (rc) {
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"Starting ARP processing support for %s failed\n", "Starting ARP processing support for %s failed\n",
...@@ -793,7 +793,7 @@ static int qeth_l3_start_ipa_source_mac(struct qeth_card *card) ...@@ -793,7 +793,7 @@ static int qeth_l3_start_ipa_source_mac(struct qeth_card *card)
} }
rc = qeth_send_simple_setassparms(card, IPA_SOURCE_MAC, rc = qeth_send_simple_setassparms(card, IPA_SOURCE_MAC,
IPA_CMD_ASS_START, 0); IPA_CMD_ASS_START, NULL);
if (rc) if (rc)
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"Starting source MAC-address support for %s failed\n", "Starting source MAC-address support for %s failed\n",
...@@ -814,7 +814,7 @@ static int qeth_l3_start_ipa_vlan(struct qeth_card *card) ...@@ -814,7 +814,7 @@ static int qeth_l3_start_ipa_vlan(struct qeth_card *card)
} }
rc = qeth_send_simple_setassparms(card, IPA_VLAN_PRIO, rc = qeth_send_simple_setassparms(card, IPA_VLAN_PRIO,
IPA_CMD_ASS_START, 0); IPA_CMD_ASS_START, NULL);
if (rc) { if (rc) {
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"Starting VLAN support for %s failed\n", "Starting VLAN support for %s failed\n",
...@@ -839,7 +839,7 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card) ...@@ -839,7 +839,7 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card)
} }
rc = qeth_send_simple_setassparms(card, IPA_MULTICASTING, rc = qeth_send_simple_setassparms(card, IPA_MULTICASTING,
IPA_CMD_ASS_START, 0); IPA_CMD_ASS_START, NULL);
if (rc) { if (rc) {
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"Starting multicast support for %s failed\n", "Starting multicast support for %s failed\n",
...@@ -853,6 +853,7 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card) ...@@ -853,6 +853,7 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card)
static int qeth_l3_softsetup_ipv6(struct qeth_card *card) static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
{ {
u32 ipv6_data = 3;
int rc; int rc;
QETH_CARD_TEXT(card, 3, "softipv6"); QETH_CARD_TEXT(card, 3, "softipv6");
...@@ -860,16 +861,16 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card) ...@@ -860,16 +861,16 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
if (IS_IQD(card)) if (IS_IQD(card))
goto out; goto out;
rc = qeth_send_simple_setassparms(card, IPA_IPV6, rc = qeth_send_simple_setassparms(card, IPA_IPV6, IPA_CMD_ASS_START,
IPA_CMD_ASS_START, 3); &ipv6_data);
if (rc) { if (rc) {
dev_err(&card->gdev->dev, dev_err(&card->gdev->dev,
"Activating IPv6 support for %s failed\n", "Activating IPv6 support for %s failed\n",
QETH_CARD_IFNAME(card)); QETH_CARD_IFNAME(card));
return rc; return rc;
} }
rc = qeth_send_simple_setassparms_v6(card, IPA_IPV6, rc = qeth_send_simple_setassparms_v6(card, IPA_IPV6, IPA_CMD_ASS_START,
IPA_CMD_ASS_START, 0); NULL);
if (rc) { if (rc) {
dev_err(&card->gdev->dev, dev_err(&card->gdev->dev,
"Activating IPv6 support for %s failed\n", "Activating IPv6 support for %s failed\n",
...@@ -877,7 +878,7 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card) ...@@ -877,7 +878,7 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
return rc; return rc;
} }
rc = qeth_send_simple_setassparms_v6(card, IPA_PASSTHRU, rc = qeth_send_simple_setassparms_v6(card, IPA_PASSTHRU,
IPA_CMD_ASS_START, 0); IPA_CMD_ASS_START, NULL);
if (rc) { if (rc) {
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"Enabling the passthrough mode for %s failed\n", "Enabling the passthrough mode for %s failed\n",
...@@ -903,6 +904,7 @@ static int qeth_l3_start_ipa_ipv6(struct qeth_card *card) ...@@ -903,6 +904,7 @@ static int qeth_l3_start_ipa_ipv6(struct qeth_card *card)
static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) static int qeth_l3_start_ipa_broadcast(struct qeth_card *card)
{ {
u32 filter_data = 1;
int rc; int rc;
QETH_CARD_TEXT(card, 3, "stbrdcst"); QETH_CARD_TEXT(card, 3, "stbrdcst");
...@@ -915,7 +917,7 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) ...@@ -915,7 +917,7 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card)
goto out; goto out;
} }
rc = qeth_send_simple_setassparms(card, IPA_FILTERING, rc = qeth_send_simple_setassparms(card, IPA_FILTERING,
IPA_CMD_ASS_START, 0); IPA_CMD_ASS_START, NULL);
if (rc) { if (rc) {
dev_warn(&card->gdev->dev, "Enabling broadcast filtering for " dev_warn(&card->gdev->dev, "Enabling broadcast filtering for "
"%s failed\n", QETH_CARD_IFNAME(card)); "%s failed\n", QETH_CARD_IFNAME(card));
...@@ -923,7 +925,7 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) ...@@ -923,7 +925,7 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card)
} }
rc = qeth_send_simple_setassparms(card, IPA_FILTERING, rc = qeth_send_simple_setassparms(card, IPA_FILTERING,
IPA_CMD_ASS_CONFIGURE, 1); IPA_CMD_ASS_CONFIGURE, &filter_data);
if (rc) { if (rc) {
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"Setting up broadcast filtering for %s failed\n", "Setting up broadcast filtering for %s failed\n",
...@@ -933,7 +935,7 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) ...@@ -933,7 +935,7 @@ static int qeth_l3_start_ipa_broadcast(struct qeth_card *card)
card->info.broadcast_capable = QETH_BROADCAST_WITH_ECHO; card->info.broadcast_capable = QETH_BROADCAST_WITH_ECHO;
dev_info(&card->gdev->dev, "Broadcast enabled\n"); dev_info(&card->gdev->dev, "Broadcast enabled\n");
rc = qeth_send_simple_setassparms(card, IPA_FILTERING, rc = qeth_send_simple_setassparms(card, IPA_FILTERING,
IPA_CMD_ASS_ENABLE, 1); IPA_CMD_ASS_ENABLE, &filter_data);
if (rc) { if (rc) {
dev_warn(&card->gdev->dev, "Setting up broadcast echo " dev_warn(&card->gdev->dev, "Setting up broadcast echo "
"filtering for %s failed\n", QETH_CARD_IFNAME(card)); "filtering for %s failed\n", QETH_CARD_IFNAME(card));
......
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