#include #include #include #include #include #include #include #include "avm_hw_config_hw156.h" #include "avm_hw_config_hw171.h" /*------------------------------------------------------------------------------------------*\ * Für nicht mehr unterstützte Produkte \*------------------------------------------------------------------------------------------*/ struct _avm_hw_config avm_hardware_config_dummy[] = { { .name = NULL } }; EXPORT_SYMBOL(avm_hardware_config_dummy); /*------------------------------------------------------------------------------------------*\ \*------------------------------------------------------------------------------------------*/ struct _avm_hw_config_table avm_hw_config_tables[] = { { 150, avm_hardware_config_dummy }, /*--- FRITZ!Box Ikanos ---*/ { 152, avm_hardware_config_dummy }, /*--- Speedport W 722V ---*/ { 156, avm_hardware_config_hw156 }, /*--- FRITZ!Box Fon WLAN 7390 ---*/ { 165, avm_hardware_config_dummy }, /*--- FRITZ!Box Fon WLAN 7541 vDSL ---*/ { 171, avm_hardware_config_hw171 }, /*--- FRITZ!Box Fon WLAN 7340 ---*/ }; EXPORT_SYMBOL(avm_hw_config_tables); /*------------------------------------------------------------------------------------------*\ \*------------------------------------------------------------------------------------------*/ struct _avm_hw_config *avm_current_hw_config = NULL; EXPORT_SYMBOL(avm_current_hw_config); /*------------------------------------------------------------------------------------------*\ \*------------------------------------------------------------------------------------------*/ struct _avm_hw_config *avm_get_hw_config_table(void) { static struct _avm_hw_config *current_config_table = NULL; unsigned int hwrev, i; char *s; if(current_config_table) { return current_config_table; } s = prom_getenv("HWRevision"); if (s) { hwrev = simple_strtoul(s, NULL, 10); } if((s == NULL) || (hwrev < 0) || (hwrev > 255)) { printk("[%s] error: %s HWRevision detected in environment variables: %s\n", __FUNCTION__, (s ? "invalid" : "no"), s); BUG_ON(1); return NULL; } for(i = 0; i < sizeof(avm_hw_config_tables)/sizeof(struct _avm_hw_config_table); i++) { if(avm_hw_config_tables[i].hwrev == hwrev) { current_config_table = avm_hw_config_tables[i].table; return current_config_table; } } printk("[%s] error: No hardware configuration defined for HWRevision %d\n", __FUNCTION__, hwrev); BUG_ON(1); return NULL; } EXPORT_SYMBOL(avm_get_hw_config_table);