Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/12339 ) Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. sysmobts_mgr: Prepare code for gpsd < 2.96 support API prior to that version allocates the pointer internally. Let's change current code to always use a pointer and in current supported code (gpsd >= 2.96) point it to a user-allocated struct. Follow-up patch will introduce necessary ifdefs to support older gpsd. Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f --- M src/osmo-bts-sysmo/misc/sysmobts_mgr.h M src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c 2 files changed, 10 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Stefan Sperling: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.h b/src/osmo-bts-sysmo/misc/sysmobts_mgr.h index 88f4e24..b62707c 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.h +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.h @@ -96,7 +96,8 @@ /* gps structure to see if there is a fix */ int gps_open; struct osmo_fd gpsfd; - struct gps_data_t gpsdata; + struct gps_data_t *gpsdata; + struct gps_data_t gpsdata_buf; struct osmo_timer_list fix_timeout; /* Loop/Re-try control */ diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c index b0b5edd..c3e821e 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c @@ -86,14 +86,14 @@ osmo_timer_del(>calib.fix_timeout); osmo_fd_unregister(>calib.gpsfd); - gps_close(>calib.gpsdata); - memset(>calib.gpsdata, 0, sizeof(mgr->calib.gpsdata)); + gps_close(mgr->calib.gpsdata); + memset(mgr->calib.gpsdata, 0, sizeof(*(mgr->calib.gpsdata))); mgr->calib.gps_open = 0; } static void mgr_gps_checkfix(struct sysmobts_mgr_instance *mgr) { - struct gps_data_t *data = >calib.gpsdata; + struct gps_data_t *data = mgr->calib.gpsdata; /* No 2D fix yet */ if (data->fix.mode < MODE_2D) { @@ -119,7 +119,7 @@ { int rc; struct sysmobts_mgr_instance *mgr = fd->data; - rc = compat_gps_read(>calib.gpsdata); + rc = compat_gps_read(mgr->calib.gpsdata); if (rc == -1) { LOGP(DCALIB, LOGL_ERROR, "gpsd vanished during read.\n"); calib_state_reset(mgr, CALIB_FAIL_GPS); @@ -143,7 +143,8 @@ { int rc; - rc = gps_open("localhost", DEFAULT_GPSD_PORT, >calib.gpsdata); + mgr->calib.gpsdata = >calib.gpsdata_buf; + rc = gps_open("localhost", DEFAULT_GPSD_PORT, mgr->calib.gpsdata); if (rc != 0) { LOGP(DCALIB, LOGL_ERROR, "Failed to connect to GPS %d\n", rc); calib_state_reset(mgr, CALIB_FAIL_GPS); @@ -151,12 +152,12 @@ } mgr->calib.gps_open = 1; - gps_stream(>calib.gpsdata, WATCH_ENABLE, NULL); + gps_stream(mgr->calib.gpsdata, WATCH_ENABLE, NULL); mgr->calib.gpsfd.data = mgr; mgr->calib.gpsfd.cb = mgr_gps_read; mgr->calib.gpsfd.when = BSC_FD_READ | BSC_FD_EXCEPT; - mgr->calib.gpsfd.fd = mgr->calib.gpsdata.gps_fd; + mgr->calib.gpsfd.fd = mgr->calib.gpsdata->gps_fd; if (osmo_fd_register(>calib.gpsfd) < 0) { LOGP(DCALIB, LOGL_ERROR, "Failed to register GPSD fd\n"); calib_state_reset(mgr, CALIB_FAIL_GPS); -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling
Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/12339 ) Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Tue, 18 Dec 2018 20:27:23 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12339 ) Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Tue, 18 Dec 2018 20:25:50 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/12339 ) Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Tue, 18 Dec 2018 17:27:31 + Gerrit-HasComments: No Gerrit-HasLabels: Yes
Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/12339 to look at the new patch set (#2). Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. sysmobts_mgr: Prepare code for gpsd < 2.96 support API prior to that version allocates the pointer internally. Let's change current code to always use a pointer and in current supported code (gpsd >= 2.96) point it to a user-allocated struct. Follow-up patch will introduce necessary ifdefs to support older gpsd. Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f --- M src/osmo-bts-sysmo/misc/sysmobts_mgr.h M src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c 2 files changed, 10 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/39/12339/2 -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr
Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12339 ) Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/12339/1/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c File src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c: https://gerrit.osmocom.org/#/c/12339/1/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c@145 PS1, Line 145: here should be gpsdata = _buf or this would be a segfault, right? -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (102) Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 18 Dec 2018 13:52:12 + Gerrit-HasComments: Yes Gerrit-HasLabels: Yes
Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12339 ) Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. Patch Set 1: I don't see the line putting gpsdata = _buf -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder (102) Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Tue, 18 Dec 2018 13:50:50 + Gerrit-HasComments: No Gerrit-HasLabels: No
Change in osmo-bts[master]: sysmobts_mgr: Prepare code for gpsd < 2.96 support
Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/12339 Change subject: sysmobts_mgr: Prepare code for gpsd < 2.96 support .. sysmobts_mgr: Prepare code for gpsd < 2.96 support API prior to that version allocates the pointer internally. Let's change current code to always use a pointer and in current supported code (gpsd >= 2.96) point it to a user-allocated struct. Follow-up patch will introduce necessary ifdefs to support older gpsd. Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f --- M src/osmo-bts-sysmo/misc/sysmobts_mgr.h M src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c 2 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/39/12339/1 diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.h b/src/osmo-bts-sysmo/misc/sysmobts_mgr.h index 88f4e24..b62707c 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.h +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.h @@ -96,7 +96,8 @@ /* gps structure to see if there is a fix */ int gps_open; struct osmo_fd gpsfd; - struct gps_data_t gpsdata; + struct gps_data_t *gpsdata; + struct gps_data_t gpsdata_buf; struct osmo_timer_list fix_timeout; /* Loop/Re-try control */ diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c index b0b5edd..ec8cb93 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c @@ -86,14 +86,14 @@ osmo_timer_del(>calib.fix_timeout); osmo_fd_unregister(>calib.gpsfd); - gps_close(>calib.gpsdata); - memset(>calib.gpsdata, 0, sizeof(mgr->calib.gpsdata)); + gps_close(mgr->calib.gpsdata); + memset(mgr->calib.gpsdata, 0, sizeof(*(mgr->calib.gpsdata))); mgr->calib.gps_open = 0; } static void mgr_gps_checkfix(struct sysmobts_mgr_instance *mgr) { - struct gps_data_t *data = >calib.gpsdata; + struct gps_data_t *data = mgr->calib.gpsdata; /* No 2D fix yet */ if (data->fix.mode < MODE_2D) { @@ -119,7 +119,7 @@ { int rc; struct sysmobts_mgr_instance *mgr = fd->data; - rc = compat_gps_read(>calib.gpsdata); + rc = compat_gps_read(mgr->calib.gpsdata); if (rc == -1) { LOGP(DCALIB, LOGL_ERROR, "gpsd vanished during read.\n"); calib_state_reset(mgr, CALIB_FAIL_GPS); @@ -143,7 +143,7 @@ { int rc; - rc = gps_open("localhost", DEFAULT_GPSD_PORT, >calib.gpsdata); + rc = gps_open("localhost", DEFAULT_GPSD_PORT, mgr->calib.gpsdata); if (rc != 0) { LOGP(DCALIB, LOGL_ERROR, "Failed to connect to GPS %d\n", rc); calib_state_reset(mgr, CALIB_FAIL_GPS); @@ -151,12 +151,12 @@ } mgr->calib.gps_open = 1; - gps_stream(>calib.gpsdata, WATCH_ENABLE, NULL); + gps_stream(mgr->calib.gpsdata, WATCH_ENABLE, NULL); mgr->calib.gpsfd.data = mgr; mgr->calib.gpsfd.cb = mgr_gps_read; mgr->calib.gpsfd.when = BSC_FD_READ | BSC_FD_EXCEPT; - mgr->calib.gpsfd.fd = mgr->calib.gpsdata.gps_fd; + mgr->calib.gpsfd.fd = mgr->calib.gpsdata->gps_fd; if (osmo_fd_register(>calib.gpsfd) < 0) { LOGP(DCALIB, LOGL_ERROR, "Failed to register GPSD fd\n"); calib_state_reset(mgr, CALIB_FAIL_GPS); -- To view, visit https://gerrit.osmocom.org/12339 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f Gerrit-Change-Number: 12339 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol