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

s390/qeth: pass full data length to l2_fill_header()

For IQD we already need to fix up the qeth_hdr's length field, and
future changes will require more flexibility for OSA as well. The
device-specific path knows best what header length it requires, so just
pass it from there.
While at it, remove the unused qeth_card parameter.

No functional change.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7286384b
...@@ -259,13 +259,14 @@ static void qeth_l2_hdr_csum(struct qeth_card *card, struct qeth_hdr *hdr, ...@@ -259,13 +259,14 @@ static void qeth_l2_hdr_csum(struct qeth_card *card, struct qeth_hdr *hdr,
card->perf_stats.tx_csum++; card->perf_stats.tx_csum++;
} }
static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, static void qeth_l2_fill_header(struct qeth_hdr *hdr, struct sk_buff *skb,
struct sk_buff *skb, int cast_type) int cast_type, unsigned int data_len)
{ {
struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb_mac_header(skb); struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb_mac_header(skb);
memset(hdr, 0, sizeof(struct qeth_hdr)); memset(hdr, 0, sizeof(struct qeth_hdr));
hdr->hdr.l2.id = QETH_HEADER_TYPE_LAYER2; hdr->hdr.l2.id = QETH_HEADER_TYPE_LAYER2;
hdr->hdr.l2.pkt_length = data_len;
/* set byte byte 3 to casting flags */ /* set byte byte 3 to casting flags */
if (cast_type == RTN_MULTICAST) if (cast_type == RTN_MULTICAST)
...@@ -275,7 +276,6 @@ static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, ...@@ -275,7 +276,6 @@ static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
else else
hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_UNICAST; hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_UNICAST;
hdr->hdr.l2.pkt_length = skb->len - sizeof(struct qeth_hdr);
/* VSWITCH relies on the VLAN /* VSWITCH relies on the VLAN
* information to be present in * information to be present in
* the QDIO header */ * the QDIO header */
...@@ -686,8 +686,7 @@ static int qeth_l2_xmit_iqd(struct qeth_card *card, struct sk_buff *skb, ...@@ -686,8 +686,7 @@ static int qeth_l2_xmit_iqd(struct qeth_card *card, struct sk_buff *skb,
hdr = kmem_cache_alloc(qeth_core_header_cache, GFP_ATOMIC); hdr = kmem_cache_alloc(qeth_core_header_cache, GFP_ATOMIC);
if (!hdr) if (!hdr)
return -ENOMEM; return -ENOMEM;
qeth_l2_fill_header(card, hdr, skb, cast_type); qeth_l2_fill_header(hdr, skb, cast_type, skb->len);
hdr->hdr.l2.pkt_length = skb->len;
skb_copy_from_linear_data(skb, ((char *)hdr) + sizeof(*hdr), skb_copy_from_linear_data(skb, ((char *)hdr) + sizeof(*hdr),
data_offset); data_offset);
...@@ -733,7 +732,8 @@ static int qeth_l2_xmit_osa(struct qeth_card *card, struct sk_buff *skb, ...@@ -733,7 +732,8 @@ static int qeth_l2_xmit_osa(struct qeth_card *card, struct sk_buff *skb,
if (!skb_copy) if (!skb_copy)
return -ENOMEM; return -ENOMEM;
hdr = skb_push(skb_copy, sizeof(struct qeth_hdr)); hdr = skb_push(skb_copy, sizeof(struct qeth_hdr));
qeth_l2_fill_header(card, hdr, skb_copy, cast_type); qeth_l2_fill_header(hdr, skb_copy, cast_type,
skb_copy->len - sizeof(*hdr));
if (skb_copy->ip_summed == CHECKSUM_PARTIAL) if (skb_copy->ip_summed == CHECKSUM_PARTIAL)
qeth_l2_hdr_csum(card, hdr, skb_copy); qeth_l2_hdr_csum(card, hdr, skb_copy);
......
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