From 096ef211b2eb7231c64d06909c6eaebe9a6bd794 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 1/8] Revert "hardware_caps.cpp: Add hw ifdef for cs_get_chip_type()" This reverts commit 5b9c48fbf1dd53a1942f7f7e90b2d5f5b038374a because libcoolstream now is updated Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/83de4ba05575ce096ec1485cc8b447e108a53693 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 4a71d764c..fa4492ae7 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -18,6 +18,7 @@ hw_caps_t *get_hwcaps(void) { if (initialized) return ∩︀ int rev = cs_get_revision(); + int chip = cs_get_chip_type(); caps.has_fan = (rev < 8); caps.has_HDMI = 1; caps.has_SCART = (rev != 10); @@ -53,9 +54,8 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Zee"); caps.force_tuner_2G = 1; break; -#ifdef BOXMODEL_CS_HD2 case 11: - if (cs_get_chip_type() == CS_CHIP_SHINER) + if (chip == 33904 /*0x8470*/) { strcpy(caps.boxname, "Trinity"); strcpy(caps.boxarch, "Shiner"); @@ -78,7 +78,6 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "Trinity Duo"); strcpy(caps.boxarch, "Kronos"); break; -#endif default: strcpy(caps.boxname, "UNKNOWN_BOX"); strcpy(caps.boxarch, "Unknown"); From c3a4e426cad2fa920492ee2207324c0adcdbe24c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 2/8] hardware_caps: use define instead of value; better readability Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7cca1e02c344ed553064e54913ca94d02899d76e Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - hardware_caps: use define instead of value; better readability ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index fa4492ae7..48c0cb7a6 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -55,7 +55,7 @@ hw_caps_t *get_hwcaps(void) { caps.force_tuner_2G = 1; break; case 11: - if (chip == 33904 /*0x8470*/) + if (chip == CS_CHIP_SHINER) { strcpy(caps.boxname, "Trinity"); strcpy(caps.boxarch, "Shiner"); From 76ef7b2aefaedba9bfef221c03d42106c37ea8d6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 3/8] hardware_caps/Makefile: use @HWLIB_CFLAGS@ instead of defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/24b159f84c5b15af727d00f79f27e5b18d47acaa Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - hardware_caps/Makefile: use @HWLIB_CFLAGS@ instead of defines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/Makefile.am | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index d460837c3..b2a96b31e 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,12 +1,9 @@ -noinst_LIBRARIES = libhwcaps.a - AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing -if BOXMODEL_CS_HD2 -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd2/libcoolstream -else -AM_CPPFLAGS = -I$(top_srcdir)/lib/hardware/coolstream/hd1/libcoolstream -endif +AM_CPPFLAGS = \ + @HWLIB_CFLAGS@ + +noinst_LIBRARIES = libhwcaps.a libhwcaps_a_SOURCES = \ hardware_caps.cpp From bafdb8ba90c9ae39ea322d5795833bc1ad0075a8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 4/8] controlapi: /control/info => return right name Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e092059f32cd88e80ce52858bfe7d66712adc3a9 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - controlapi: /control/info => return right name ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 6f64faf4c..0059a8336 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -786,18 +786,18 @@ void CControlAPI::MessageCGI(CyhookHandler *hh) void CControlAPI::InfoCGI(CyhookHandler *hh) { if (hh->ParamList.empty()) - hh->Write("Neutrino HD\n"); + hh->Write("Tuxbox-Neutrino\n"); else { if (hh->ParamList["1"] == "streaminfo") // print streaminfo SendStreamInfo(hh); else if (hh->ParamList["1"] == "version") // send version file hh->SendFile(TARGET_PREFIX "/.version"); - else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (only ffor comptibility) + else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (just for compatibility) hh->Write("3"); else if (hh->ParamList["1"] == "nhttpd_version")// print nhttpd version hh->printf("%s\n", HTTPD_VERSION); - else if (hh->ParamList["1"] == "hwinfo")// print hwinfo + else if (hh->ParamList["1"] == "hwinfo") // print hwinfo HWInfoCGI(hh); else hh->SendError(); From aa974ec7f85c9c1d87d7004b31e9b1cd43390809 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 5/8] controlapi: use hw_caps in HWInfoCGI() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b902648b085afa20ef1eef437d67b7c8a0176620 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - controlapi: use hw_caps in HWInfoCGI() ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 0059a8336..733c5f2c3 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -806,14 +806,11 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) void CControlAPI::HWInfoCGI(CyhookHandler *hh) { - std::string boxname = NeutrinoAPI->NeutrinoYParser->func_get_boxtype(hh, ""); - std::string boxmodel = NeutrinoAPI->NeutrinoYParser->func_get_boxmodel(hh, ""); - static CNetAdapter netadapter; std::string eth_id = netadapter.getMacAddr(); std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); - hh->printf("%s (%s)\nMAC:%s\n", boxname.c_str(), boxmodel.c_str(), eth_id.c_str()); + hh->printf("%s %s (%s)\nMAC:%s\n", g_info.hw_caps->boxvendor, g_info.hw_caps->boxname, g_info.hw_caps->boxarch, eth_id.c_str()); } //----------------------------------------------------------------------------- void CControlAPI::ShutdownCGI(CyhookHandler *hh) From 734e15b5ff9d3910898b86e398cf4850bb23b389 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 6/8] neutrinoyparser: use hw_caps in func_get_boxtype() ... ... and func_get_boxmodel() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/305b1a6da5c731e235c2570d97c0bb289b82e4b6 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - neutrinoyparser: use hw_caps in func_get_boxtype() ... ... and func_get_boxmodel() ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/neutrinoyparser.cpp | 96 ++---------------------- 1 file changed, 7 insertions(+), 89 deletions(-) diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index 7b142a2ef..8692f5298 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -838,103 +838,21 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::str //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) { - unsigned int system_rev = cs_get_revision(); - std::string boxname = "CST "; + std::string boxvendor(g_info.hw_caps->boxvendor); + std::string boxname(g_info.hw_caps->boxname); -#if HAVE_TRIPLEDRAGON - boxname = "Armas "; -#endif + /* workaround for Neo2 */ + if ((boxname.compare("Neo") == 0) && (CFEManager::getInstance()->getFrontendCount() > 1)) + boxname += " Twin"; - switch(system_rev) - { - case 1: - if( boxname == "Armas ") - boxname += "TripleDragon"; - break; -#ifdef BOXMODEL_CS_HD1 - case 6: - boxname += "HD1"; - break; - case 7: - boxname += "BSE"; - break; - case 8: - boxname += "Neo"; - if (CFEManager::getInstance()->getFrontendCount() > 1) - boxname += " Twin"; - break; - case 10: - boxname += "Zee"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxname += "Tank"; - break; - case 11: - boxname += "Trinity"; - if (cs_get_chip_type() != 33904 /*0x8470*/) - boxname += " V2"; - break; - case 12: - boxname += "Zee2"; - break; - case 13: - boxname += "Link"; - break; - case 14: - boxname += "Trinity Duo"; - break; -#endif - default: - char buffer[10]; - snprintf(buffer, sizeof(buffer), "%u\n", system_rev); - boxname += "Unknown nr. "; - boxname += buffer; - break; - } - - return boxname; + return boxvendor + " " + boxname; } //------------------------------------------------------------------------- // y-func : get boxmodel //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) { - unsigned int system_rev = cs_get_revision(); - std::string boxmodel = "Unknown"; - - switch(system_rev) - { -#ifdef BOXMODEL_CS_HD1 - case 6: - case 7: - case 8: - case 10: - boxmodel = "Nevis"; - break; -#endif -#ifdef BOXMODEL_CS_HD2 - case 9: - boxmodel = "Apollo"; - break; - case 11: - if (cs_get_chip_type() == 33904 /*0x8470*/) - boxmodel = "Shiner"; - else - boxmodel = "Kronos"; - break; - case 12: - case 13: - case 14: - boxmodel = "Kronos"; - break; -#endif - default: - break; - } - - return boxmodel; + return g_info.hw_caps->boxarch; } //------------------------------------------------------------------------- // y-func : get stream info From 283c5857f53c557c85a92fd37b8519af556fc4c6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:07:52 +0100 Subject: [PATCH 7/8] hardware_caps: just changes in comments Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff6046bb5650b4237b3fd6f69e0b7b685185e8aa Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - hardware_caps: just changes in comments ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/hardware/coolstream/hardware_caps.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 48c0cb7a6..592202285 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -34,7 +34,6 @@ hw_caps_t *get_hwcaps(void) { caps.can_ps_14_9 = 1; caps.force_tuner_2G = 0; strcpy(caps.boxvendor, "Coolstream"); - /* list of boxnames from neutrinoyparser.cpp */ strcpy(caps.boxarch, "Nevis"); switch (rev) { case 6: @@ -42,7 +41,7 @@ hw_caps_t *get_hwcaps(void) { strcpy(caps.boxname, "HD1"); caps.force_tuner_2G = 1; break; - case 8: + case 8: // TODO: Neo2 - Twin strcpy(caps.boxname, "Neo"); caps.force_tuner_2G = 1; break; From 938e4c22f8da2464eca4165b0c5732517118c4ac Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 10 Mar 2017 15:36:13 +0100 Subject: [PATCH 8/8] controlapi: /control/info => return PACKAGE_NAME and PACKAGE_VERSION Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0203de264f6b4e03c512e88c5c08c5f8beb823f7 Author: vanhofen Date: 2017-03-10 (Fri, 10 Mar 2017) Origin message was: ------------------ - controlapi: /control/info => return PACKAGE_NAME and PACKAGE_VERSION ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/nhttpd/tuxboxapi/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 733c5f2c3..bb5eb829b 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -786,7 +786,7 @@ void CControlAPI::MessageCGI(CyhookHandler *hh) void CControlAPI::InfoCGI(CyhookHandler *hh) { if (hh->ParamList.empty()) - hh->Write("Tuxbox-Neutrino\n"); + hh->Write(PACKAGE_NAME " " PACKAGE_VERSION "\n"); else { if (hh->ParamList["1"] == "streaminfo") // print streaminfo