netiucv.c (459a98ed881802dee55897441bc7f77af614368e) | netiucv.c (27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26) |
---|---|
1/* 2 * IUCV network driver 3 * 4 * Copyright 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Author(s): Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com) 6 * 7 * Sysfs integration and all bugs therein by Cornelia Huck 8 * (cornelia.huck@de.ibm.com) --- 675 unchanged lines hidden (view full) --- 684 iucv_message_reject(conn->path, msg); 685 privptr->stats.rx_dropped++; 686 PRINT_WARN("msglen %d > max_buffsize %d\n", 687 msg->length, conn->max_buffsize); 688 IUCV_DBF_TEXT_(data, 2, "msglen %d > max_buffsize %d\n", 689 msg->length, conn->max_buffsize); 690 return; 691 } | 1/* 2 * IUCV network driver 3 * 4 * Copyright 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Author(s): Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com) 6 * 7 * Sysfs integration and all bugs therein by Cornelia Huck 8 * (cornelia.huck@de.ibm.com) --- 675 unchanged lines hidden (view full) --- 684 iucv_message_reject(conn->path, msg); 685 privptr->stats.rx_dropped++; 686 PRINT_WARN("msglen %d > max_buffsize %d\n", 687 msg->length, conn->max_buffsize); 688 IUCV_DBF_TEXT_(data, 2, "msglen %d > max_buffsize %d\n", 689 msg->length, conn->max_buffsize); 690 return; 691 } |
692 conn->rx_buff->data = conn->rx_buff->tail = conn->rx_buff->head; | 692 conn->rx_buff->data = conn->rx_buff->head; 693 skb_reset_tail_pointer(conn->rx_buff); |
693 conn->rx_buff->len = 0; 694 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data, 695 msg->length, NULL); 696 if (rc || msg->length < 5) { 697 privptr->stats.rx_errors++; 698 PRINT_WARN("iucv_receive returned %08x\n", rc); 699 IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_receive\n", rc); 700 return; --- 29 unchanged lines hidden (view full) --- 730 if (privptr) { 731 privptr->stats.tx_packets++; 732 privptr->stats.tx_bytes += 733 (skb->len - NETIUCV_HDRLEN 734 - NETIUCV_HDRLEN); 735 } 736 } 737 } | 694 conn->rx_buff->len = 0; 695 rc = iucv_message_receive(conn->path, msg, 0, conn->rx_buff->data, 696 msg->length, NULL); 697 if (rc || msg->length < 5) { 698 privptr->stats.rx_errors++; 699 PRINT_WARN("iucv_receive returned %08x\n", rc); 700 IUCV_DBF_TEXT_(data, 2, "rc %d from iucv_receive\n", rc); 701 return; --- 29 unchanged lines hidden (view full) --- 731 if (privptr) { 732 privptr->stats.tx_packets++; 733 privptr->stats.tx_bytes += 734 (skb->len - NETIUCV_HDRLEN 735 - NETIUCV_HDRLEN); 736 } 737 } 738 } |
738 conn->tx_buff->data = conn->tx_buff->tail = conn->tx_buff->head; | 739 conn->tx_buff->data = conn->tx_buff->head; 740 skb_reset_tail_pointer(conn->tx_buff); |
739 conn->tx_buff->len = 0; 740 spin_lock_irqsave(&conn->collect_lock, saveflags); 741 while ((skb = skb_dequeue(&conn->collect_queue))) { 742 header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; 743 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, 744 NETIUCV_HDRLEN); 745 memcpy(skb_put(conn->tx_buff, skb->len), skb->data, skb->len); 746 txbytes += skb->len; --- 412 unchanged lines hidden (view full) --- 1159 } 1160 spin_unlock_irqrestore(&conn->collect_lock, saveflags); 1161 } else { 1162 struct sk_buff *nskb = skb; 1163 /** 1164 * Copy the skb to a new allocated skb in lowmem only if the 1165 * data is located above 2G in memory or tailroom is < 2. 1166 */ | 741 conn->tx_buff->len = 0; 742 spin_lock_irqsave(&conn->collect_lock, saveflags); 743 while ((skb = skb_dequeue(&conn->collect_queue))) { 744 header.next = conn->tx_buff->len + skb->len + NETIUCV_HDRLEN; 745 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, 746 NETIUCV_HDRLEN); 747 memcpy(skb_put(conn->tx_buff, skb->len), skb->data, skb->len); 748 txbytes += skb->len; --- 412 unchanged lines hidden (view full) --- 1161 } 1162 spin_unlock_irqrestore(&conn->collect_lock, saveflags); 1163 } else { 1164 struct sk_buff *nskb = skb; 1165 /** 1166 * Copy the skb to a new allocated skb in lowmem only if the 1167 * data is located above 2G in memory or tailroom is < 2. 1168 */ |
1167 unsigned long hi = 1168 ((unsigned long)(skb->tail + NETIUCV_HDRLEN)) >> 31; | 1169 unsigned long hi = ((unsigned long)(skb_tail_pointer(skb) + 1170 NETIUCV_HDRLEN)) >> 31; |
1169 int copied = 0; 1170 if (hi || (skb_tailroom(skb) < 2)) { 1171 nskb = alloc_skb(skb->len + NETIUCV_HDRLEN + 1172 NETIUCV_HDRLEN, GFP_ATOMIC | GFP_DMA); 1173 if (!nskb) { 1174 PRINT_WARN("%s: Could not allocate tx_skb\n", 1175 conn->netdev->name); 1176 IUCV_DBF_TEXT(data, 2, "alloc_skb failed\n"); --- 995 unchanged lines hidden --- | 1171 int copied = 0; 1172 if (hi || (skb_tailroom(skb) < 2)) { 1173 nskb = alloc_skb(skb->len + NETIUCV_HDRLEN + 1174 NETIUCV_HDRLEN, GFP_ATOMIC | GFP_DMA); 1175 if (!nskb) { 1176 PRINT_WARN("%s: Could not allocate tx_skb\n", 1177 conn->netdev->name); 1178 IUCV_DBF_TEXT(data, 2, "alloc_skb failed\n"); --- 995 unchanged lines hidden --- |