diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-04-16 19:37:38 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-05-22 14:12:40 -0400 |
commit | 8eb6013189e03aa21aa53fd72c092713fdb30e44 (patch) | |
tree | a17a8e9562decd7cb19653ec931b09f689a1c182 | |
parent | d27e7c3f6c82297611d1e1ee9476a2f31b3e89df (diff) |
hamachi: use netdev_alloc_skb
Use netdev_alloc_skb. This sets skb->dev and allows arch specific
allocation.
Remove dead code and dead comments.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/net/hamachi.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index e5c2380f50ca..3199526bcecb 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -1140,11 +1140,11 @@ static void hamachi_tx_timeout(struct net_device *dev) | |||
1140 | } | 1140 | } |
1141 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ | 1141 | /* Fill in the Rx buffers. Handle allocation failure gracefully. */ |
1142 | for (i = 0; i < RX_RING_SIZE; i++) { | 1142 | for (i = 0; i < RX_RING_SIZE; i++) { |
1143 | struct sk_buff *skb = dev_alloc_skb(hmp->rx_buf_sz); | 1143 | struct sk_buff *skb = netdev_alloc_skb(dev, hmp->rx_buf_sz); |
1144 | hmp->rx_skbuff[i] = skb; | 1144 | hmp->rx_skbuff[i] = skb; |
1145 | if (skb == NULL) | 1145 | if (skb == NULL) |
1146 | break; | 1146 | break; |
1147 | skb->dev = dev; /* Mark as being used by this device. */ | 1147 | |
1148 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ | 1148 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ |
1149 | hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, | 1149 | hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev, |
1150 | skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); | 1150 | skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE)); |
@@ -1178,14 +1178,6 @@ static void hamachi_init_ring(struct net_device *dev) | |||
1178 | hmp->cur_rx = hmp->cur_tx = 0; | 1178 | hmp->cur_rx = hmp->cur_tx = 0; |
1179 | hmp->dirty_rx = hmp->dirty_tx = 0; | 1179 | hmp->dirty_rx = hmp->dirty_tx = 0; |
1180 | 1180 | ||
1181 | #if 0 | ||
1182 | /* This is wrong. I'm not sure what the original plan was, but this | ||
1183 | * is wrong. An MTU of 1 gets you a buffer of 1536, while an MTU | ||
1184 | * of 1501 gets a buffer of 1533? -KDU | ||
1185 | */ | ||
1186 | hmp->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); | ||
1187 | #endif | ||
1188 | /* My attempt at a reasonable correction */ | ||
1189 | /* +26 gets the maximum ethernet encapsulation, +7 & ~7 because the | 1181 | /* +26 gets the maximum ethernet encapsulation, +7 & ~7 because the |
1190 | * card needs room to do 8 byte alignment, +2 so we can reserve | 1182 | * card needs room to do 8 byte alignment, +2 so we can reserve |
1191 | * the first 2 bytes, and +16 gets room for the status word from the | 1183 | * the first 2 bytes, and +16 gets room for the status word from the |