mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-20 00:21:35 +00:00
- Unbreak on non i386, this disables cw keying on non i386 platforms.
- Fixed another linuxism with hard coded serial device names.
This commit is contained in:
parent
2c493361b0
commit
9226281616
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=204446
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= hf
|
||||
PORTVERSION= 0.8
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= comms hamradio
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= hfterm
|
||||
@ -23,8 +23,6 @@ GNU_CONFIGURE= yes
|
||||
CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL}
|
||||
CONFIGURE_ARGS= --prefix=${PREFIX} --sysconfdir=${PREFIX}
|
||||
|
||||
ONLY_FOR_ARCHS= i386
|
||||
|
||||
MANLANG= "" "de.ISO8859-1"
|
||||
MAN1= hf.1 hfterm.1 hfkernel.1
|
||||
MAN1_EN= dcf77gen.1 dcf77rx.1
|
||||
|
63
comms/hf/files/patch-hfkernel_cw.c
Normal file
63
comms/hf/files/patch-hfkernel_cw.c
Normal file
@ -0,0 +1,63 @@
|
||||
--- hfkernel/cw/cw.c.orig 2007-12-24 08:38:46.000000000 -0500
|
||||
+++ hfkernel/cw/cw.c 2007-12-24 08:45:35.000000000 -0500
|
||||
@@ -39,11 +39,21 @@
|
||||
#ifdef __linux__
|
||||
#include <sys/io.h>
|
||||
#define IOPERM ioperm
|
||||
+#define TTY0 "/dev/ttyS0"
|
||||
+#define TTY1 "/dev/ttyS1"
|
||||
+#define TTY2 "/dev/ttyS2"
|
||||
+#define TTY3 "/dev/ttyS3"
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
#include <machine/cpufunc.h>
|
||||
#include <machine/sysarch.h>
|
||||
-#define IOPERM i386_set_ioperm
|
||||
+#define TTY0 "/dev/ttyd0"
|
||||
+#define TTY1 "/dev/ttyd1"
|
||||
+#define TTY2 "/dev/ttyd2"
|
||||
+#define TTY3 "/dev/ttyd3"
|
||||
+ #ifdef __i386__
|
||||
+ #define IOPERM i386_set_ioperm
|
||||
+ #endif
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
@@ -408,6 +418,7 @@
|
||||
|
||||
void *mode_cw_tx(void *dummy)
|
||||
{
|
||||
+#ifdef IOPERM
|
||||
/* duration of 1 dot, i suppose a word has 50 dots */
|
||||
/* ---> so i think 1 baud in cw is 50 * wpm / 60 */
|
||||
int i = 0, err = 0, pausecount = 0, idlewait, status, cts, dcd;
|
||||
@@ -416,16 +427,16 @@
|
||||
printf("%s", cable);
|
||||
|
||||
if (name_ptt) {
|
||||
- if (! strcmp (name_ptt, "/dev/ttyS0")) {
|
||||
+ if (! strcmp (name_ptt, TTY0)) {
|
||||
port = 0x3F8;
|
||||
}
|
||||
- if (! strcmp (name_ptt, "/dev/ttyS1")) {
|
||||
+ if (! strcmp (name_ptt, TTY1)) {
|
||||
port = 0x2F8;
|
||||
}
|
||||
- if (! strcmp (name_ptt, "/dev/ttyS2")) {
|
||||
+ if (! strcmp (name_ptt, TTY2)) {
|
||||
port = 0x3E8;
|
||||
}
|
||||
- if (! strcmp (name_ptt, "/dev/ttyS3")) {
|
||||
+ if (! strcmp (name_ptt, TTY3)) {
|
||||
port = 0x2E8;
|
||||
}
|
||||
}
|
||||
@@ -514,5 +525,8 @@
|
||||
decode(PAUSE);
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+ printf("Not on i386, elbug disabled\n");
|
||||
+#endif
|
||||
}
|
||||
|
28
comms/hf/files/patch-hfkernel_elbug.c
Normal file
28
comms/hf/files/patch-hfkernel_elbug.c
Normal file
@ -0,0 +1,28 @@
|
||||
--- hfkernel/cw/elbug.c.orig 2007-12-24 09:30:07.000000000 -0500
|
||||
+++ hfkernel/cw/elbug.c 2007-12-24 09:31:45.000000000 -0500
|
||||
@@ -37,7 +37,9 @@
|
||||
#include <machine/cpufunc.h>
|
||||
#include <machine/sysarch.h>
|
||||
#include <sys/kbio.h>
|
||||
+#ifdef __i386__
|
||||
#define IOPERM i386_set_ioperm
|
||||
+#endif
|
||||
#else
|
||||
#include <sys/kd.h> /* Linux, UnixWare */
|
||||
#endif
|
||||
@@ -328,10 +330,15 @@
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
+#ifdef IOPERM
|
||||
if ((err = IOPERM(port, 8, 1))) {
|
||||
printf("permission problem for serial port %04x: ioperm = %d\n", port, err);
|
||||
printf("This program has to be called with root permissions.\n");
|
||||
}
|
||||
+#else
|
||||
+ printf("No IOPERM non i386?\n");
|
||||
+ exit(-1);
|
||||
+#endif
|
||||
if ((fd_ptt = open(name_ptt, O_RDWR, 0)) < 0) {
|
||||
printf("error in opening ptt device %s - maybe try another one?\n",
|
||||
name_ptt);
|
12
comms/hf/files/patch-hfkernel_l1_refclock.c
Normal file
12
comms/hf/files/patch-hfkernel_l1_refclock.c
Normal file
@ -0,0 +1,12 @@
|
||||
--- hfkernel/l1/refclock.c.orig 2007-12-23 22:40:50.000000000 -0500
|
||||
+++ hfkernel/l1/refclock.c 2007-12-23 22:41:42.000000000 -0500
|
||||
@@ -225,7 +225,9 @@
|
||||
"So I use gettimeofday() as timing source, which has lowest accuracy.\n"
|
||||
"Let's hope you entered a good gettimeofday correction with -t %10.9f.\n",
|
||||
tv_corr);
|
||||
+#ifdef __i386__
|
||||
rdtsc_ok=0;
|
||||
+#endif
|
||||
}
|
||||
}
|
||||
return (lasttime = curtime);
|
Loading…
Reference in New Issue
Block a user