aboutsummaryrefslogtreecommitdiffstats
path: root/comms
diff options
context:
space:
mode:
authorshurd <shurd@FreeBSD.org>2019-06-18 10:29:26 +0800
committershurd <shurd@FreeBSD.org>2019-06-18 10:29:26 +0800
commit1ec3ec05aacdf7d6102003a38cba8e6e5148ef5e (patch)
treea644dc02569e0dfe9eeaecdec80f782d8187d50e /comms
parent130fc6752ca0981cd5dcc3bfa8edc4a442ce8a28 (diff)
downloadfreebsd-ports-gnome-1ec3ec05aacdf7d6102003a38cba8e6e5148ef5e.tar.gz
freebsd-ports-gnome-1ec3ec05aacdf7d6102003a38cba8e6e5148ef5e.tar.zst
freebsd-ports-gnome-1ec3ec05aacdf7d6102003a38cba8e6e5148ef5e.zip
Fix SDR-IQ Support
Previously, only if the device name started with the literal string "/dev/ttyUSB" was the device treated as a tty. The new patch uses isatty() to decide if the device is a tty.
Diffstat (limited to 'comms')
-rw-r--r--comms/quisk/Makefile1
-rw-r--r--comms/quisk/files/patch-sdriqpkg_sdriq.c41
2 files changed, 42 insertions, 0 deletions
diff --git a/comms/quisk/Makefile b/comms/quisk/Makefile
index bf4d7bb2f466..6fb5d6b249b1 100644
--- a/comms/quisk/Makefile
+++ b/comms/quisk/Makefile
@@ -3,6 +3,7 @@
PORTNAME= quisk
DISTVERSION= 4.1.40
+PORTREVISION= 1
CATEGORIES= comms hamradio
MASTER_SITES= CHEESESHOP
diff --git a/comms/quisk/files/patch-sdriqpkg_sdriq.c b/comms/quisk/files/patch-sdriqpkg_sdriq.c
new file mode 100644
index 000000000000..63e3ee660350
--- /dev/null
+++ b/comms/quisk/files/patch-sdriqpkg_sdriq.c
@@ -0,0 +1,41 @@
+--- sdriqpkg/sdriq.c.orig 2018-08-02 14:01:30 UTC
++++ sdriqpkg/sdriq.c
+@@ -629,14 +658,14 @@ static void quisk_open_sdriq_dev(const c
+ {
+ struct termios newtio;
+
+- if (!strncmp(name, "/dev/ttyUSB", 11)) { // use ftdi_sio driver
+- quisk_sdriq_fd = open(name, O_RDWR | O_NOCTTY);
+- if (quisk_sdriq_fd < 0) {
+- strncpy(buf, "Open SDR-IQ : ", bufsize);
+- strncat(buf, strerror(errno), bufsize - strlen(buf) - 1);
+- quisk_sdriq_fd = INVALID_HANDLE_VALUE;
+- return;
+- }
++ quisk_sdriq_fd = open(name, O_RDWR | O_NOCTTY | O_NONBLOCK);
++ if (quisk_sdriq_fd < 0) {
++ strncpy(buf, "Open SDR-IQ : ", bufsize);
++ strncat(buf, strerror(errno), bufsize - strlen(buf) - 1);
++ quisk_sdriq_fd = INVALID_HANDLE_VALUE;
++ return;
++ }
++ if (isatty(quisk_sdriq_fd)) {
+ bzero(&newtio, sizeof(newtio));
+ newtio.c_cflag = CS8 | CLOCAL | CREAD;
+ newtio.c_iflag = IGNPAR;
+@@ -649,15 +678,6 @@ static void quisk_open_sdriq_dev(const c
+ tcflush(quisk_sdriq_fd, TCIFLUSH);
+ tcsetattr(quisk_sdriq_fd, TCSANOW, &newtio);
+ }
+- else { // use ft245 or similar driver
+- quisk_sdriq_fd = open(name, O_RDWR | O_NONBLOCK);
+- if (quisk_sdriq_fd < 0) {
+- strncpy(buf, "Open SDR-IQ: ", bufsize);
+- strncat(buf, strerror(errno), bufsize - strlen(buf) - 1);
+- quisk_sdriq_fd = INVALID_HANDLE_VALUE;
+- return;
+- }
+- }
+ return;
+ }
+ #endif