hc
2023-11-06 15ade055295d13f95d49e3d99b09f3bbfb4a43e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
 
#include <wcn_bus.h>
 
#include "bus_common.h"
#include "edma_engine.h"
#include "mchn.h"
#include "pcie.h"
 
static int pcie_preinit(void)
{
   return 0;
}
 
static void pcie_preexit(void)
{
}
 
static int pcie_buf_list_alloc(int chn, struct mbuf_t **head,
                  struct mbuf_t **tail, int *num)
{
   return mbuf_link_alloc(chn, head, tail, num);
}
 
static int pcie_buf_list_free(int chn, struct mbuf_t *head,
                 struct mbuf_t *tail, int num)
{
   return mbuf_link_free(chn, head, tail, num);
}
 
static int pcie_list_push(int chn, struct mbuf_t *head,
             struct mbuf_t *tail, int num)
{
   return mchn_push_link(chn, head, tail, num);
}
 
static int pcie_chn_init(struct mchn_ops_t *ops)
{
   return mchn_init(ops);
}
 
static int pcie_chn_deinit(struct mchn_ops_t *ops)
{
   return mchn_deinit(ops);
}
 
static struct sprdwcn_bus_ops pcie_bus_ops = {
   .preinit = pcie_preinit,
   .deinit = pcie_preexit,
   .chn_init = pcie_chn_init,
   .chn_deinit = pcie_chn_deinit,
   .list_alloc = pcie_buf_list_alloc,
   .list_free = pcie_buf_list_free,
   .push_list = pcie_list_push,
};
 
void module_bus_init(void)
{
   module_ops_register(&pcie_bus_ops);
}
EXPORT_SYMBOL(module_bus_init);
 
void module_bus_deinit(void)
{
   module_ops_unregister();
}
EXPORT_SYMBOL(module_bus_deinit);