diff options
author | Stephen Hurd <shurd@FreeBSD.org> | 2019-06-18 02:29:26 +0000 |
---|---|---|
committer | Stephen Hurd <shurd@FreeBSD.org> | 2019-06-18 02:29:26 +0000 |
commit | 39b2bf2b262385e2cab29a55aa78681b14bc55c3 (patch) | |
tree | a644dc02569e0dfe9eeaecdec80f782d8187d50e /comms | |
parent | a315885c41b16163a9b9d1d759d1c2d7e929bf61 (diff) | |
download | freebsd-ports-39b2bf2b262385e2cab29a55aa78681b14bc55c3.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/Makefile | 1 | ||||
-rw-r--r-- | comms/quisk/files/patch-sdriqpkg_sdriq.c | 41 |
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 |