.. | .. |
---|
1 | | -/* |
---|
2 | | - * Copyright (c) 2015-2016 Quantenna Communications, Inc. |
---|
3 | | - * All rights reserved. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or |
---|
6 | | - * modify it under the terms of the GNU General Public License |
---|
7 | | - * as published by the Free Software Foundation; either version 2 |
---|
8 | | - * of the License, or (at your option) any later version. |
---|
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 | | - */ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
| 2 | +/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ |
---|
16 | 3 | |
---|
17 | 4 | #include <linux/types.h> |
---|
18 | 5 | #include <linux/io.h> |
---|
.. | .. |
---|
42 | 29 | if (unlikely(size == 0 || size > QTN_IPC_MAX_DATA_SZ)) { |
---|
43 | 30 | pr_err("wrong rx packet size: %zu\n", size); |
---|
44 | 31 | rx_buff_ok = false; |
---|
45 | | - } else { |
---|
46 | | - memcpy_fromio(ipc->rx_data, ipc->shm_region->data, size); |
---|
| 32 | + } |
---|
| 33 | + |
---|
| 34 | + if (likely(rx_buff_ok)) { |
---|
| 35 | + ipc->rx_packet_count++; |
---|
| 36 | + ipc->rx_callback.fn(ipc->rx_callback.arg, |
---|
| 37 | + ipc->shm_region->data, size); |
---|
47 | 38 | } |
---|
48 | 39 | |
---|
49 | 40 | writel(QTNF_SHM_IPC_ACK, &shm_reg_hdr->flags); |
---|
50 | 41 | readl(&shm_reg_hdr->flags); /* flush PCIe write */ |
---|
51 | 42 | |
---|
52 | 43 | ipc->interrupt.fn(ipc->interrupt.arg); |
---|
53 | | - |
---|
54 | | - if (likely(rx_buff_ok)) { |
---|
55 | | - ipc->rx_packet_count++; |
---|
56 | | - ipc->rx_callback.fn(ipc->rx_callback.arg, ipc->rx_data, size); |
---|
57 | | - } |
---|
58 | 44 | } |
---|
59 | 45 | |
---|
60 | 46 | static void qtnf_shm_ipc_irq_work(struct work_struct *work) |
---|