| /* |
| <:copyright-BRCM:2016:DUAL/GPL:standard |
| |
| Broadcom Proprietary and Confidential.(c) 2016 Broadcom |
| All Rights Reserved |
| |
| Unless you and Broadcom execute a separate written software license |
| agreement governing use of this software, this software is licensed |
| to you under the terms of the GNU General Public License version 2 |
| (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, |
| with the following added to such license: |
| |
| As a special exception, the copyright holders of this software give |
| you permission to link this software with independent modules, and |
| to copy and distribute the resulting executable under terms of your |
| choice, provided that you also meet, for each linked independent |
| module, the terms and conditions of the license of that module. |
| An independent module is a module which is not derived from this |
| software. The special exception does not apply to any modifications |
| of the software. |
| |
| Not withstanding the above, under no circumstances may you combine |
| this software in any way with any other Broadcom software provided |
| under a license other than the GPL, without Broadcom's express prior |
| written consent. |
| |
| :> |
| */ |
| |
| #include "bcmolt_coop_dba.h" |
| |
| module_param(bcmos_sys_trace_level, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); |
| MODULE_PARM_DESC(bcmos_sys_trace_level, "trace_level"); |
| |
| static void bcmolt_coop_dba_unregister_registered_devices(bcmolt_devid max_devid, bcmtrmux_channel channel) |
| { |
| bcmolt_devid devid; |
| |
| for (devid = 0; devid < max_devid; devid++) |
| { |
| bcmolt_coop_dba_exit(devid, channel); |
| } |
| } |
| static void bcmolt_coop_dba_module_exit(void) |
| { |
| bcmolt_coop_dba_unregister_registered_devices(BCMTR_MAX_OLTS, URGENT_CHANNEL); |
| |
| printk("%s\n", __FUNCTION__); |
| } |
| |
| static int bcmolt_coop_dba_module_init(void) |
| { |
| bcmos_errno rc; |
| bcmolt_devid devid; |
| bcmtrmux_channel channel = URGENT_CHANNEL; |
| |
| printk("%s\n", __FUNCTION__); |
| |
| #if 0 |
| bcmos_trace_level_set(BCMOS_TRACE_LEVEL_DEBUG); |
| #endif |
| |
| for (devid = 0; devid < BCMTR_MAX_OLTS; devid++) |
| { |
| rc = bcmolt_coop_dba_init(devid, &channel, bcmolt_coop_dba_rx, NULL); |
| if (rc != BCM_ERR_OK) |
| { |
| printk("error in bcmolt_coop_dba_init rc=%d\n", rc); |
| bcmolt_coop_dba_unregister_registered_devices(devid, channel); |
| break; |
| } |
| } |
| |
| return rc ? -EINVAL : 0; |
| } |
| |
| module_init(bcmolt_coop_dba_module_init); |
| module_exit(bcmolt_coop_dba_module_exit); |
| |
| MODULE_DESCRIPTION("Cooperative DBA"); |
| MODULE_LICENSE("Dual BSD/GPL"); |