diff options
Diffstat (limited to 'drivers/net/atl1/atl1_main.c')
-rw-r--r-- | drivers/net/atl1/atl1_main.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index ef12dba85811..6c8cf986bee4 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -1344,21 +1344,21 @@ static void atl1_tx_map(struct atl1_adapter *adapter, | |||
1344 | 1344 | ||
1345 | if (first_buf_len > proto_hdr_len) { | 1345 | if (first_buf_len > proto_hdr_len) { |
1346 | len12 = first_buf_len - proto_hdr_len; | 1346 | len12 = first_buf_len - proto_hdr_len; |
1347 | m = (len12 + MAX_TX_BUF_LEN - 1) / MAX_TX_BUF_LEN; | 1347 | m = (len12 + ATL1_MAX_TX_BUF_LEN - 1) / ATL1_MAX_TX_BUF_LEN; |
1348 | for (i = 0; i < m; i++) { | 1348 | for (i = 0; i < m; i++) { |
1349 | buffer_info = | 1349 | buffer_info = |
1350 | &tpd_ring->buffer_info[tpd_next_to_use]; | 1350 | &tpd_ring->buffer_info[tpd_next_to_use]; |
1351 | buffer_info->skb = NULL; | 1351 | buffer_info->skb = NULL; |
1352 | buffer_info->length = | 1352 | buffer_info->length = |
1353 | (MAX_TX_BUF_LEN >= | 1353 | (ATL1_MAX_TX_BUF_LEN >= |
1354 | len12) ? MAX_TX_BUF_LEN : len12; | 1354 | len12) ? ATL1_MAX_TX_BUF_LEN : len12; |
1355 | len12 -= buffer_info->length; | 1355 | len12 -= buffer_info->length; |
1356 | page = virt_to_page(skb->data + | 1356 | page = virt_to_page(skb->data + |
1357 | (proto_hdr_len + | 1357 | (proto_hdr_len + |
1358 | i * MAX_TX_BUF_LEN)); | 1358 | i * ATL1_MAX_TX_BUF_LEN)); |
1359 | offset = (unsigned long)(skb->data + | 1359 | offset = (unsigned long)(skb->data + |
1360 | (proto_hdr_len + | 1360 | (proto_hdr_len + |
1361 | i * MAX_TX_BUF_LEN)) & | 1361 | i * ATL1_MAX_TX_BUF_LEN)) & |
1362 | ~PAGE_MASK; | 1362 | ~PAGE_MASK; |
1363 | buffer_info->dma = | 1363 | buffer_info->dma = |
1364 | pci_map_page(adapter->pdev, page, offset, | 1364 | pci_map_page(adapter->pdev, page, offset, |
@@ -1387,18 +1387,18 @@ static void atl1_tx_map(struct atl1_adapter *adapter, | |||
1387 | frag = &skb_shinfo(skb)->frags[f]; | 1387 | frag = &skb_shinfo(skb)->frags[f]; |
1388 | lenf = frag->size; | 1388 | lenf = frag->size; |
1389 | 1389 | ||
1390 | m = (lenf + MAX_TX_BUF_LEN - 1) / MAX_TX_BUF_LEN; | 1390 | m = (lenf + ATL1_MAX_TX_BUF_LEN - 1) / ATL1_MAX_TX_BUF_LEN; |
1391 | for (i = 0; i < m; i++) { | 1391 | for (i = 0; i < m; i++) { |
1392 | buffer_info = &tpd_ring->buffer_info[tpd_next_to_use]; | 1392 | buffer_info = &tpd_ring->buffer_info[tpd_next_to_use]; |
1393 | if (unlikely(buffer_info->skb)) | 1393 | if (unlikely(buffer_info->skb)) |
1394 | BUG(); | 1394 | BUG(); |
1395 | buffer_info->skb = NULL; | 1395 | buffer_info->skb = NULL; |
1396 | buffer_info->length = | 1396 | buffer_info->length = |
1397 | (lenf > MAX_TX_BUF_LEN) ? MAX_TX_BUF_LEN : lenf; | 1397 | (lenf > ATL1_MAX_TX_BUF_LEN) ? ATL1_MAX_TX_BUF_LEN : lenf; |
1398 | lenf -= buffer_info->length; | 1398 | lenf -= buffer_info->length; |
1399 | buffer_info->dma = | 1399 | buffer_info->dma = |
1400 | pci_map_page(adapter->pdev, frag->page, | 1400 | pci_map_page(adapter->pdev, frag->page, |
1401 | frag->page_offset + i * MAX_TX_BUF_LEN, | 1401 | frag->page_offset + i * ATL1_MAX_TX_BUF_LEN, |
1402 | buffer_info->length, PCI_DMA_TODEVICE); | 1402 | buffer_info->length, PCI_DMA_TODEVICE); |
1403 | 1403 | ||
1404 | if (++tpd_next_to_use == tpd_ring->count) | 1404 | if (++tpd_next_to_use == tpd_ring->count) |
@@ -1516,7 +1516,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1516 | frag_size = skb_shinfo(skb)->frags[f].size; | 1516 | frag_size = skb_shinfo(skb)->frags[f].size; |
1517 | if (frag_size) | 1517 | if (frag_size) |
1518 | count += | 1518 | count += |
1519 | (frag_size + MAX_TX_BUF_LEN - 1) / MAX_TX_BUF_LEN; | 1519 | (frag_size + ATL1_MAX_TX_BUF_LEN - 1) / ATL1_MAX_TX_BUF_LEN; |
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | /* mss will be nonzero if we're doing segment offload (TSO/GSO) */ | 1522 | /* mss will be nonzero if we're doing segment offload (TSO/GSO) */ |
@@ -1532,7 +1532,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1532 | /* need additional TPD ? */ | 1532 | /* need additional TPD ? */ |
1533 | if (proto_hdr_len != len) | 1533 | if (proto_hdr_len != len) |
1534 | count += (len - proto_hdr_len + | 1534 | count += (len - proto_hdr_len + |
1535 | MAX_TX_BUF_LEN - 1) / MAX_TX_BUF_LEN; | 1535 | ATL1_MAX_TX_BUF_LEN - 1) / ATL1_MAX_TX_BUF_LEN; |
1536 | } | 1536 | } |
1537 | } | 1537 | } |
1538 | 1538 | ||