.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. |
---|
2 | | - * |
---|
3 | | - * This program is free software; you can redistribute it and/or modify |
---|
4 | | - * it under the terms of the GNU General Public License version 2 and |
---|
5 | | - * only version 2 as published by the Free Software Foundation. |
---|
6 | | - * |
---|
7 | | - * This program is distributed in the hope that it will be useful, |
---|
8 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
9 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
10 | | - * GNU General Public License for more details. |
---|
11 | 3 | */ |
---|
12 | 4 | |
---|
13 | 5 | /* Qualcomm Technologies, Inc. EMAC Ethernet Controller MAC layer support |
---|
.. | .. |
---|
776 | 768 | 8 + 2 * 8; /* 8 byte per one Tx and two Rx rings */ |
---|
777 | 769 | |
---|
778 | 770 | ring_header->used = 0; |
---|
779 | | - ring_header->v_addr = dma_zalloc_coherent(dev, ring_header->size, |
---|
| 771 | + ring_header->v_addr = dma_alloc_coherent(dev, ring_header->size, |
---|
780 | 772 | &ring_header->dma_addr, |
---|
781 | 773 | GFP_KERNEL); |
---|
782 | 774 | if (!ring_header->v_addr) |
---|
.. | .. |
---|
1204 | 1196 | if (tpbuf->skb) { |
---|
1205 | 1197 | pkts_compl++; |
---|
1206 | 1198 | bytes_compl += tpbuf->skb->len; |
---|
1207 | | - dev_kfree_skb_irq(tpbuf->skb); |
---|
| 1199 | + dev_consume_skb_irq(tpbuf->skb); |
---|
1208 | 1200 | tpbuf->skb = NULL; |
---|
1209 | 1201 | } |
---|
1210 | 1202 | |
---|
.. | .. |
---|
1296 | 1288 | memset(tpd, 0, sizeof(*tpd)); |
---|
1297 | 1289 | memset(&extra_tpd, 0, sizeof(extra_tpd)); |
---|
1298 | 1290 | |
---|
1299 | | - ipv6_hdr(skb)->payload_len = 0; |
---|
1300 | | - tcp_hdr(skb)->check = |
---|
1301 | | - ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr, |
---|
1302 | | - &ipv6_hdr(skb)->daddr, |
---|
1303 | | - 0, IPPROTO_TCP, 0); |
---|
| 1291 | + tcp_v6_gso_csum_prep(skb); |
---|
| 1292 | + |
---|
1304 | 1293 | TPD_PKT_LEN_SET(&extra_tpd, skb->len); |
---|
1305 | 1294 | TPD_LSO_SET(&extra_tpd, 1); |
---|
1306 | 1295 | TPD_LSOV_SET(&extra_tpd, 1); |
---|
.. | .. |
---|
1393 | 1382 | } |
---|
1394 | 1383 | |
---|
1395 | 1384 | for (i = 0; i < nr_frags; i++) { |
---|
1396 | | - struct skb_frag_struct *frag; |
---|
1397 | | - |
---|
1398 | | - frag = &skb_shinfo(skb)->frags[i]; |
---|
| 1385 | + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
---|
1399 | 1386 | |
---|
1400 | 1387 | tpbuf = GET_TPD_BUFFER(tx_q, tx_q->tpd.produce_idx); |
---|
1401 | | - tpbuf->length = frag->size; |
---|
1402 | | - tpbuf->dma_addr = dma_map_page(adpt->netdev->dev.parent, |
---|
1403 | | - frag->page.p, frag->page_offset, |
---|
1404 | | - tpbuf->length, DMA_TO_DEVICE); |
---|
| 1388 | + tpbuf->length = skb_frag_size(frag); |
---|
| 1389 | + tpbuf->dma_addr = skb_frag_dma_map(adpt->netdev->dev.parent, |
---|
| 1390 | + frag, 0, tpbuf->length, |
---|
| 1391 | + DMA_TO_DEVICE); |
---|
1405 | 1392 | ret = dma_mapping_error(adpt->netdev->dev.parent, |
---|
1406 | 1393 | tpbuf->dma_addr); |
---|
1407 | 1394 | if (ret) |
---|
.. | .. |
---|
1444 | 1431 | } |
---|
1445 | 1432 | |
---|
1446 | 1433 | /* Transmit the packet using specified transmit queue */ |
---|
1447 | | -int emac_mac_tx_buf_send(struct emac_adapter *adpt, struct emac_tx_queue *tx_q, |
---|
1448 | | - struct sk_buff *skb) |
---|
| 1434 | +netdev_tx_t emac_mac_tx_buf_send(struct emac_adapter *adpt, |
---|
| 1435 | + struct emac_tx_queue *tx_q, |
---|
| 1436 | + struct sk_buff *skb) |
---|
1449 | 1437 | { |
---|
1450 | 1438 | struct emac_tpd tpd; |
---|
1451 | 1439 | u32 prod_idx; |
---|