diff options
author | Avik Sil <aviksil@linux.vnet.ibm.com> | 2013-09-23 14:07:36 +0530 |
---|---|---|
committer | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-10-04 12:00:47 +0530 |
commit | 46d3927f7a7407fe76d7256a8de4cbae0d566633 (patch) | |
tree | 01ad56022ce0708bf5386362d13a58e7e3dbe59a /clients/net-snk/kernel/modules.c | |
parent | 5f84bfe465818d9bfab537ac73d57c2e0d63a2dd (diff) | |
download | SLOF-46d3927f7a7407fe76d7256a8de4cbae0d566633.zip SLOF-46d3927f7a7407fe76d7256a8de4cbae0d566633.tar.gz SLOF-46d3927f7a7407fe76d7256a8de4cbae0d566633.tar.bz2 |
Remove lodable network driver modules and related functions
All network drivers have been moved to library
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'clients/net-snk/kernel/modules.c')
-rw-r--r-- | clients/net-snk/kernel/modules.c | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/clients/net-snk/kernel/modules.c b/clients/net-snk/kernel/modules.c index 398b246..e7b1894 100644 --- a/clients/net-snk/kernel/modules.c +++ b/clients/net-snk/kernel/modules.c @@ -30,15 +30,6 @@ extern char __client_start[]; typedef snk_module_t *(*module_init_t) (snk_kernel_t *, pci_config_t *); -typedef struct { - const char *name; - int type; -} mod_descriptor_t; - -static const mod_descriptor_t modules[] = { - { NULL, 0 } -}; - snk_module_t *snk_modules[MODULES_MAX]; extern snk_kernel_t snk_kernel_interface; @@ -48,77 +39,6 @@ extern snk_kernel_t snk_kernel_interface; Returns -1, if not responsible for device, 0 otherwise. */ -static int -load_module(const char *name) -{ - int len, i; - void *addr; - void *link_addr; - module_init_t module_init; - - // Load modules right after the SNK... - // FIXME: hard-coded offset! - link_addr = (void*)__client_start + 0x800000; - - // snk_kernel_interface.print("Loading Module '%s'\n", name); - - /* find module in module list and lookup link address */ - for(i=0; modules[i].name; ++i) { - if(strcmp(modules[i].name, name) == 0) - break; - } - if( modules[i].name == 0 ) { - /* module not in list */ - return -1; - } - - /* check if link address is used already */ - for(i=1; i<MODULES_MAX; ++i) { - if(snk_modules[i] /* && snk_modules[i]->link_addr == link_addr*/) { - // busy, can't load modules - return -2; - } - } - - /* find empty position in array of loaded modules */ - for(i=0; i<MODULES_MAX; ++i) { - if(snk_modules[i] == 0) { - break; - } - } - if(i == MODULES_MAX) { - // no space available! - return -3; - } - - /* Read module from FLASH */ - len = romfs_lookup(name, &addr); - if (len <= 0) { - /* file not found */ - return -4; - } - - /* Copy image from flash to RAM */ - if (elf_load_file_to_addr(addr, link_addr, (void*)&module_init, - NULL, flush_cache) != 2) { - snk_kernel_interface.print("ELF loading failed!\n"); - return -5; - } - - snk_modules[i] = module_init(&snk_kernel_interface, &snk_kernel_interface.pci_conf); - if(snk_modules[i] == 0) { - /* no device found that can be managed by this module */ - return -5; - } - - if(snk_modules[i]->type == MOD_TYPE_NETWORK) { - /* Get mac address from device tree */ - get_mac(snk_modules[i]->mac_addr); - } - - return i; -} - void modules_init(void) { @@ -134,11 +54,6 @@ modules_init(void) snk_modules[i] = 0; } - /* Load all modules */ - for(i=0; modules[i].name; ++i) { - load_module(modules[i].name); - } - /* Try to init client-interface module (it's built-in, not loadable) */ for(i=0; i<MODULES_MAX; ++i) { if(snk_modules[i] == 0) { @@ -183,14 +98,6 @@ get_module_by_type(int type) { */ snk_module_t * insmod_by_type(int type) { - int i, j; - for(i = 0; modules[i].name; ++i) { - if(modules[i].type != type) - continue; - j = load_module(modules[i].name); - if(j >= 0) - return snk_modules[j]; - } return 0; } |