aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamachi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/hamachi.c')
-rw-r--r--drivers/net/hamachi.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index f7519a594945..ea85075a89a2 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -407,10 +407,9 @@ that case.
407/* A few values that may be tweaked. */ 407/* A few values that may be tweaked. */
408/* Size of each temporary Rx buffer, calculated as: 408/* Size of each temporary Rx buffer, calculated as:
409 * 1518 bytes (ethernet packet) + 2 bytes (to get 8 byte alignment for 409 * 1518 bytes (ethernet packet) + 2 bytes (to get 8 byte alignment for
410 * the card) + 8 bytes of status info + 8 bytes for the Rx Checksum + 410 * the card) + 8 bytes of status info + 8 bytes for the Rx Checksum
411 * 2 more because we use skb_reserve.
412 */ 411 */
413#define PKT_BUF_SZ 1538 412#define PKT_BUF_SZ 1536
414 413
415/* For now, this is going to be set to the maximum size of an ethernet 414/* For now, this is going to be set to the maximum size of an ethernet
416 * packet. Eventually, we may want to make it a variable that is 415 * packet. Eventually, we may want to make it a variable that is
@@ -873,7 +872,7 @@ static int hamachi_open(struct net_device *dev)
873 u32 rx_int_var, tx_int_var; 872 u32 rx_int_var, tx_int_var;
874 u16 fifo_info; 873 u16 fifo_info;
875 874
876 i = request_irq(dev->irq, &hamachi_interrupt, IRQF_SHARED, dev->name, dev); 875 i = request_irq(dev->irq, hamachi_interrupt, IRQF_SHARED, dev->name, dev);
877 if (i) 876 if (i)
878 return i; 877 return i;
879 878
@@ -1152,12 +1151,13 @@ static void hamachi_tx_timeout(struct net_device *dev)
1152 } 1151 }
1153 /* Fill in the Rx buffers. Handle allocation failure gracefully. */ 1152 /* Fill in the Rx buffers. Handle allocation failure gracefully. */
1154 for (i = 0; i < RX_RING_SIZE; i++) { 1153 for (i = 0; i < RX_RING_SIZE; i++) {
1155 struct sk_buff *skb = netdev_alloc_skb(dev, hmp->rx_buf_sz); 1154 struct sk_buff *skb;
1155
1156 skb = netdev_alloc_skb_ip_align(dev, hmp->rx_buf_sz);
1156 hmp->rx_skbuff[i] = skb; 1157 hmp->rx_skbuff[i] = skb;
1157 if (skb == NULL) 1158 if (skb == NULL)
1158 break; 1159 break;
1159 1160
1160 skb_reserve(skb, 2); /* 16 byte align the IP header. */
1161 hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, 1161 hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
1162 skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); 1162 skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE));
1163 hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn | 1163 hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn |
@@ -1196,7 +1196,7 @@ static void hamachi_init_ring(struct net_device *dev)
1196 * card. -KDU 1196 * card. -KDU
1197 */ 1197 */
1198 hmp->rx_buf_sz = (dev->mtu <= 1492 ? PKT_BUF_SZ : 1198 hmp->rx_buf_sz = (dev->mtu <= 1492 ? PKT_BUF_SZ :
1199 (((dev->mtu+26+7) & ~7) + 2 + 16)); 1199 (((dev->mtu+26+7) & ~7) + 16));
1200 1200
1201 /* Initialize all Rx descriptors. */ 1201 /* Initialize all Rx descriptors. */
1202 for (i = 0; i < RX_RING_SIZE; i++) { 1202 for (i = 0; i < RX_RING_SIZE; i++) {
@@ -1566,8 +1566,8 @@ static int hamachi_rx(struct net_device *dev)
1566#endif 1566#endif
1567 /* Check if the packet is long enough to accept without copying 1567 /* Check if the packet is long enough to accept without copying
1568 to a minimally-sized skbuff. */ 1568 to a minimally-sized skbuff. */
1569 if (pkt_len < rx_copybreak 1569 if (pkt_len < rx_copybreak &&
1570 && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { 1570 (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
1571#ifdef RX_CHECKSUM 1571#ifdef RX_CHECKSUM
1572 printk(KERN_ERR "%s: rx_copybreak non-zero " 1572 printk(KERN_ERR "%s: rx_copybreak non-zero "
1573 "not good with RX_CHECKSUM\n", dev->name); 1573 "not good with RX_CHECKSUM\n", dev->name);
@@ -1722,10 +1722,10 @@ static void hamachi_error(struct net_device *dev, int intr_status)
1722 readl(ioaddr + 0x370); 1722 readl(ioaddr + 0x370);
1723 readl(ioaddr + 0x3F0); 1723 readl(ioaddr + 0x3F0);
1724 } 1724 }
1725 if ((intr_status & ~(LinkChange|StatsMax|NegotiationChange|IntrRxDone|IntrTxDone)) 1725 if ((intr_status & ~(LinkChange|StatsMax|NegotiationChange|IntrRxDone|IntrTxDone)) &&
1726 && hamachi_debug) 1726 hamachi_debug)
1727 printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", 1727 printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n",
1728 dev->name, intr_status); 1728 dev->name, intr_status);
1729 /* Hmmmmm, it's not clear how to recover from PCI faults. */ 1729 /* Hmmmmm, it's not clear how to recover from PCI faults. */
1730 if (intr_status & (IntrTxPCIErr | IntrTxPCIFault)) 1730 if (intr_status & (IntrTxPCIErr | IntrTxPCIFault))
1731 hmp->stats.tx_fifo_errors++; 1731 hmp->stats.tx_fifo_errors++;