forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/net/ethernet/pasemi/pasemi_mac.c
....@@ -1,19 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2006-2007 PA Semi, Inc
34 *
45 * Driver for the PA Semi PWRficient onchip 1G/10G Ethernet MACs
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
176 */
187
198 #include <linux/module.h>
....@@ -401,9 +390,9 @@
401390 if (pasemi_dma_alloc_ring(&ring->chan, RX_RING_SIZE))
402391 goto out_ring_desc;
403392
404
- ring->buffers = dma_zalloc_coherent(&mac->dma_pdev->dev,
405
- RX_RING_SIZE * sizeof(u64),
406
- &ring->buf_dma, GFP_KERNEL);
393
+ ring->buffers = dma_alloc_coherent(&mac->dma_pdev->dev,
394
+ RX_RING_SIZE * sizeof(u64),
395
+ &ring->buf_dma, GFP_KERNEL);
407396 if (!ring->buffers)
408397 goto out_ring_desc;
409398
....@@ -1359,7 +1348,7 @@
13591348 const int nh_off = skb_network_offset(skb);
13601349 const int nh_len = skb_network_header_len(skb);
13611350 const int nfrags = skb_shinfo(skb)->nr_frags;
1362
- int cs_size, i, fill, hdr, cpyhdr, evt;
1351
+ int cs_size, i, fill, hdr, evt;
13631352 dma_addr_t csdma;
13641353
13651354 fund = XCT_FUN_ST | XCT_FUN_RR_8BRES |
....@@ -1400,7 +1389,6 @@
14001389 fill++;
14011390
14021391 /* Copy the result into the TCP packet */
1403
- cpyhdr = fill;
14041392 CS_DESC(csring, fill++) = XCT_FUN_O | XCT_FUN_FUN(csring->fun) |
14051393 XCT_FUN_LLEN(2) | XCT_FUN_SE;
14061394 CS_DESC(csring, fill++) = XCT_PTR_LEN(2) | XCT_PTR_ADDR(cs_dest) | XCT_PTR_T;
....@@ -1720,6 +1708,7 @@
17201708 err = -ENODEV;
17211709 goto out;
17221710 }
1711
+ dma_set_mask(&mac->dma_pdev->dev, DMA_BIT_MASK(64));
17231712
17241713 mac->iob_pdev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL);
17251714 if (!mac->iob_pdev) {
....@@ -1842,7 +1831,7 @@
18421831 pci_unregister_driver(&pasemi_mac_driver);
18431832 }
18441833
1845
-int pasemi_mac_init_module(void)
1834
+static int pasemi_mac_init_module(void)
18461835 {
18471836 int err;
18481837