blob: 70fc52cd94802b8e0a3d4207f96fe01603f16d30 [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001/*
2<:copyright-BRCM:2016:DUAL/GPL:standard
3
4 Broadcom Proprietary and Confidential.(c) 2016 Broadcom
5 All Rights Reserved
6
7Unless you and Broadcom execute a separate written software license
8agreement governing use of this software, this software is licensed
9to you under the terms of the GNU General Public License version 2
10(the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
11with the following added to such license:
12
13 As a special exception, the copyright holders of this software give
14 you permission to link this software with independent modules, and
15 to copy and distribute the resulting executable under terms of your
16 choice, provided that you also meet, for each linked independent
17 module, the terms and conditions of the license of that module.
18 An independent module is a module which is not derived from this
19 software. The special exception does not apply to any modifications
20 of the software.
21
22Not withstanding the above, under no circumstances may you combine
23this software in any way with any other Broadcom software provided
24under a license other than the GPL, without Broadcom's express prior
25written consent.
26
27:>
28 */
29
30#include "bcmolt_coop_dba.h"
31
32module_param(bcmos_sys_trace_level, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
33MODULE_PARM_DESC(bcmos_sys_trace_level, "trace_level");
34
35static void bcmolt_coop_dba_unregister_registered_devices(bcmolt_devid max_devid, bcmtrmux_channel channel)
36{
37 bcmolt_devid devid;
38
39 for (devid = 0; devid < max_devid; devid++)
40 {
41 bcmolt_coop_dba_exit(devid, channel);
42 }
43}
44static void bcmolt_coop_dba_module_exit(void)
45{
46 bcmolt_coop_dba_unregister_registered_devices(BCMTR_MAX_OLTS, URGENT_CHANNEL);
47
48 printk("%s\n", __FUNCTION__);
49}
50
51static int bcmolt_coop_dba_module_init(void)
52{
53 bcmos_errno rc;
54 bcmolt_devid devid;
55 bcmtrmux_channel channel = URGENT_CHANNEL;
56
57 printk("%s\n", __FUNCTION__);
58
59#if 0
60 bcmos_trace_level_set(BCMOS_TRACE_LEVEL_DEBUG);
61#endif
62
63 for (devid = 0; devid < BCMTR_MAX_OLTS; devid++)
64 {
65 rc = bcmolt_coop_dba_init(devid, &channel, bcmolt_coop_dba_rx, NULL);
66 if (rc != BCM_ERR_OK)
67 {
68 printk("error in bcmolt_coop_dba_init rc=%d\n", rc);
69 bcmolt_coop_dba_unregister_registered_devices(devid, channel);
70 break;
71 }
72 }
73
74 return rc ? -EINVAL : 0;
75}
76
77module_init(bcmolt_coop_dba_module_init);
78module_exit(bcmolt_coop_dba_module_exit);
79
80MODULE_DESCRIPTION("Cooperative DBA");
81MODULE_LICENSE("Dual BSD/GPL");