aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/net/qeth_main.c')
-rw-r--r--drivers/s390/net/qeth_main.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index d8a86f5af379..ad7792dc1a04 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -2278,7 +2278,7 @@ qeth_type_trans(struct sk_buff *skb, struct net_device *dev)
2278 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)) 2278 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))
2279 return tr_type_trans(skb,dev); 2279 return tr_type_trans(skb,dev);
2280#endif /* CONFIG_TR */ 2280#endif /* CONFIG_TR */
2281 skb->mac.raw = skb->data; 2281 skb_reset_mac_header(skb);
2282 skb_pull(skb, ETH_HLEN ); 2282 skb_pull(skb, ETH_HLEN );
2283 eth = eth_hdr(skb); 2283 eth = eth_hdr(skb);
2284 2284
@@ -2306,9 +2306,9 @@ qeth_rebuild_skb_fake_ll_tr(struct qeth_card *card, struct sk_buff *skb,
2306 struct iphdr *ip_hdr; 2306 struct iphdr *ip_hdr;
2307 2307
2308 QETH_DBF_TEXT(trace,5,"skbfktr"); 2308 QETH_DBF_TEXT(trace,5,"skbfktr");
2309 skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_TR; 2309 skb_set_mac_header(skb, -QETH_FAKE_LL_LEN_TR);
2310 /* this is a fake ethernet header */ 2310 /* this is a fake ethernet header */
2311 fake_hdr = (struct trh_hdr *) skb->mac.raw; 2311 fake_hdr = tr_hdr(skb);
2312 2312
2313 /* the destination MAC address */ 2313 /* the destination MAC address */
2314 switch (skb->pkt_type){ 2314 switch (skb->pkt_type){
@@ -2359,9 +2359,9 @@ qeth_rebuild_skb_fake_ll_eth(struct qeth_card *card, struct sk_buff *skb,
2359 struct iphdr *ip_hdr; 2359 struct iphdr *ip_hdr;
2360 2360
2361 QETH_DBF_TEXT(trace,5,"skbfketh"); 2361 QETH_DBF_TEXT(trace,5,"skbfketh");
2362 skb->mac.raw = skb->data - QETH_FAKE_LL_LEN_ETH; 2362 skb_set_mac_header(skb, -QETH_FAKE_LL_LEN_ETH);
2363 /* this is a fake ethernet header */ 2363 /* this is a fake ethernet header */
2364 fake_hdr = (struct ethhdr *) skb->mac.raw; 2364 fake_hdr = eth_hdr(skb);
2365 2365
2366 /* the destination MAC address */ 2366 /* the destination MAC address */
2367 switch (skb->pkt_type){ 2367 switch (skb->pkt_type){
@@ -2461,7 +2461,7 @@ qeth_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
2461 if (card->options.fake_ll) 2461 if (card->options.fake_ll)
2462 qeth_rebuild_skb_fake_ll(card, skb, hdr); 2462 qeth_rebuild_skb_fake_ll(card, skb, hdr);
2463 else 2463 else
2464 skb->mac.raw = skb->data; 2464 skb_reset_mac_header(skb);
2465 skb->ip_summed = card->options.checksum_type; 2465 skb->ip_summed = card->options.checksum_type;
2466 if (card->options.checksum_type == HW_CHECKSUMMING){ 2466 if (card->options.checksum_type == HW_CHECKSUMMING){
2467 if ( (hdr->hdr.l3.ext_flags & 2467 if ( (hdr->hdr.l3.ext_flags &
@@ -2501,7 +2501,8 @@ qeth_process_inbound_buffer(struct qeth_card *card,
2501 vlan_tag = qeth_rebuild_skb(card, skb, hdr); 2501 vlan_tag = qeth_rebuild_skb(card, skb, hdr);
2502 else { /*in case of OSN*/ 2502 else { /*in case of OSN*/
2503 skb_push(skb, sizeof(struct qeth_hdr)); 2503 skb_push(skb, sizeof(struct qeth_hdr));
2504 memcpy(skb->data, hdr, sizeof(struct qeth_hdr)); 2504 skb_copy_to_linear_data(skb, hdr,
2505 sizeof(struct qeth_hdr));
2505 } 2506 }
2506 /* is device UP ? */ 2507 /* is device UP ? */
2507 if (!(card->dev->flags & IFF_UP)){ 2508 if (!(card->dev->flags & IFF_UP)){
@@ -3778,9 +3779,11 @@ qeth_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
3778 } 3779 }
3779 /* try something else */ 3780 /* try something else */
3780 if (skb->protocol == ETH_P_IPV6) 3781 if (skb->protocol == ETH_P_IPV6)
3781 return (skb->nh.raw[24] == 0xff) ? RTN_MULTICAST : 0; 3782 return (skb_network_header(skb)[24] == 0xff) ?
3783 RTN_MULTICAST : 0;
3782 else if (skb->protocol == ETH_P_IP) 3784 else if (skb->protocol == ETH_P_IP)
3783 return ((skb->nh.raw[16] & 0xf0) == 0xe0) ? RTN_MULTICAST : 0; 3785 return ((skb_network_header(skb)[16] & 0xf0) == 0xe0) ?
3786 RTN_MULTICAST : 0;
3784 /* ... */ 3787 /* ... */
3785 if (!memcmp(skb->data, skb->dev->broadcast, 6)) 3788 if (!memcmp(skb->data, skb->dev->broadcast, 6))
3786 return RTN_BROADCAST; 3789 return RTN_BROADCAST;
@@ -3818,18 +3821,20 @@ qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
3818 return card->info.is_multicast_different & 3821 return card->info.is_multicast_different &
3819 (card->qdio.no_out_queues - 1); 3822 (card->qdio.no_out_queues - 1);
3820 if (card->qdio.do_prio_queueing && (ipv == 4)) { 3823 if (card->qdio.do_prio_queueing && (ipv == 4)) {
3824 const u8 tos = ip_hdr(skb)->tos;
3825
3821 if (card->qdio.do_prio_queueing==QETH_PRIO_Q_ING_TOS){ 3826 if (card->qdio.do_prio_queueing==QETH_PRIO_Q_ING_TOS){
3822 if (skb->nh.iph->tos & IP_TOS_NOTIMPORTANT) 3827 if (tos & IP_TOS_NOTIMPORTANT)
3823 return 3; 3828 return 3;
3824 if (skb->nh.iph->tos & IP_TOS_HIGHRELIABILITY) 3829 if (tos & IP_TOS_HIGHRELIABILITY)
3825 return 2; 3830 return 2;
3826 if (skb->nh.iph->tos & IP_TOS_HIGHTHROUGHPUT) 3831 if (tos & IP_TOS_HIGHTHROUGHPUT)
3827 return 1; 3832 return 1;
3828 if (skb->nh.iph->tos & IP_TOS_LOWDELAY) 3833 if (tos & IP_TOS_LOWDELAY)
3829 return 0; 3834 return 0;
3830 } 3835 }
3831 if (card->qdio.do_prio_queueing==QETH_PRIO_Q_ING_PREC) 3836 if (card->qdio.do_prio_queueing==QETH_PRIO_Q_ING_PREC)
3832 return 3 - (skb->nh.iph->tos >> 6); 3837 return 3 - (tos >> 6);
3833 } else if (card->qdio.do_prio_queueing && (ipv == 6)) { 3838 } else if (card->qdio.do_prio_queueing && (ipv == 6)) {
3834 /* TODO: IPv6!!! */ 3839 /* TODO: IPv6!!! */
3835 } 3840 }
@@ -3866,9 +3871,9 @@ __qeth_prepare_skb(struct qeth_card *card, struct sk_buff *skb, int ipv)
3866 * memcpys instead of one memmove to save cycles. 3871 * memcpys instead of one memmove to save cycles.
3867 */ 3872 */
3868 skb_push(skb, VLAN_HLEN); 3873 skb_push(skb, VLAN_HLEN);
3869 memcpy(skb->data, skb->data + 4, 4); 3874 skb_copy_to_linear_data(skb, skb->data + 4, 4);
3870 memcpy(skb->data + 4, skb->data + 8, 4); 3875 skb_copy_to_linear_data_offset(skb, 4, skb->data + 8, 4);
3871 memcpy(skb->data + 8, skb->data + 12, 4); 3876 skb_copy_to_linear_data_offset(skb, 8, skb->data + 12, 4);
3872 tag = (u16 *)(skb->data + 12); 3877 tag = (u16 *)(skb->data + 12);
3873 /* 3878 /*
3874 * first two bytes = ETH_P_8021Q (0x8100) 3879 * first two bytes = ETH_P_8021Q (0x8100)
@@ -4039,7 +4044,8 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
4039 *((u32 *) skb->dst->neighbour->primary_key); 4044 *((u32 *) skb->dst->neighbour->primary_key);
4040 } else { 4045 } else {
4041 /* fill in destination address used in ip header */ 4046 /* fill in destination address used in ip header */
4042 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) = skb->nh.iph->daddr; 4047 *((u32 *)(&hdr->hdr.l3.dest_addr[12])) =
4048 ip_hdr(skb)->daddr;
4043 } 4049 }
4044 } else if (ipv == 6) { /* IPv6 or passthru */ 4050 } else if (ipv == 6) { /* IPv6 or passthru */
4045 hdr->hdr.l3.flags = qeth_get_qeth_hdr_flags6(cast_type); 4051 hdr->hdr.l3.flags = qeth_get_qeth_hdr_flags6(cast_type);
@@ -4048,7 +4054,8 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
4048 skb->dst->neighbour->primary_key, 16); 4054 skb->dst->neighbour->primary_key, 16);
4049 } else { 4055 } else {
4050 /* fill in destination address used in ip header */ 4056 /* fill in destination address used in ip header */
4051 memcpy(hdr->hdr.l3.dest_addr, &skb->nh.ipv6h->daddr, 16); 4057 memcpy(hdr->hdr.l3.dest_addr,
4058 &ipv6_hdr(skb)->daddr, 16);
4052 } 4059 }
4053 } else { /* passthrough */ 4060 } else { /* passthrough */
4054 if((skb->dev->type == ARPHRD_IEEE802_TR) && 4061 if((skb->dev->type == ARPHRD_IEEE802_TR) &&