summaryrefslogtreecommitdiffstats
path: root/hdlcutil
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2015-05-02 00:19:09 +0200
committerRalf Baechle <ralf@linux-mips.org>2015-05-02 00:19:09 +0200
commit56e847dae8f585254c6b336ea557bd75a0574711 (patch)
tree7e775ea62e06caa505e7ad017e17bbc0800d8ab3 /hdlcutil
parent62ceba5818d888041adbd466e8c67a8104bcf4fa (diff)
parent67d85b3d5cf145a5bf0a1431d6052473b017daa9 (diff)
Merge branch 'master' of git://git.linux-ax25.org/pub/scm/ralf/ax25-tools
Conflicts: ax25/axspawn.c
Diffstat (limited to 'hdlcutil')
-rw-r--r--hdlcutil/Makefile.am7
-rw-r--r--hdlcutil/baycom.910
-rw-r--r--hdlcutil/fl/xfhdlcchpar_main.cxx6
-rw-r--r--hdlcutil/fl/xfhdlcst_main.cxx10
-rw-r--r--hdlcutil/fl/xfsmdiag.cxx40
-rw-r--r--hdlcutil/fl/xfsmdiag_main.cxx44
-rw-r--r--hdlcutil/fl/xfsmmixer.cxx202
-rw-r--r--hdlcutil/fl/xfsmmixer_main.cxx24
-rw-r--r--hdlcutil/hdlcdrv.936
-rw-r--r--hdlcutil/hdrvcomm.c54
-rw-r--r--hdlcutil/hdrvcomm.h26
-rw-r--r--hdlcutil/sethdlc.816
-rw-r--r--hdlcutil/sethdlc.c122
-rw-r--r--hdlcutil/smdiag.84
-rw-r--r--hdlcutil/smdiag.c198
-rw-r--r--hdlcutil/smmixer.c132
-rw-r--r--hdlcutil/soundmodem.98
-rw-r--r--hdlcutil/soundmodem.h2
-rw-r--r--hdlcutil/usersmdiag.h6
19 files changed, 465 insertions, 482 deletions
diff --git a/hdlcutil/Makefile.am b/hdlcutil/Makefile.am
index b200566..fd94b2a 100644
--- a/hdlcutil/Makefile.am
+++ b/hdlcutil/Makefile.am
@@ -14,12 +14,9 @@ smdiag_SOURCES = smdiag.c hdrvcomm.c hdrvcomm.h usersmdiag.h soundmodem.h
smdiag_LDADD = $(X_LIBS) -lX11 $(X_EXTRA_LIBS)
INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \
- -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\"
+ -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\"
AX25_SYSCONFDIR=$(sysconfdir)/ax25/
AX25_LOCALSTATEDIR=$(localstatedir)/ax25/
-man_MANS = sethdlc.8 smmixer.8 baycom.9 hdlcdrv.9 soundmodem.9 smdiag.8
-
-EXTRA_DIST = $(man_MANS)
-
+dist_man_MANS = sethdlc.8 smmixer.8 baycom.9 hdlcdrv.9 soundmodem.9 smdiag.8
diff --git a/hdlcutil/baycom.9 b/hdlcutil/baycom.9
index 3e2c740..893a20d 100644
--- a/hdlcutil/baycom.9
+++ b/hdlcutil/baycom.9
@@ -17,10 +17,10 @@ par97.
.SS ser12
This is a very simple 1200 baud AFSK modem. The modem consists only
of a modulator/demodulator chip, usually a TI TCM3105. The computer
-is responsible for regenerating the receiver bit clock. The modem
+is responsible for regenerating the receiver bit clock. The modem
connects to a serial port, hence the name. Since the serial port is
not used as an async serial port, the kernel driver for serial ports
-cannot be used, and this driver only supports standard serial
+cannot be used, and this driver only supports standard serial
hardware (8250, 16450, 16550).
.SS par96
This is a modem for 9600 baud FSK compatible to the G3RUH standard.
@@ -40,7 +40,7 @@ The \fBioctl\fP calls follow the implementation in the \fIhdlcdrv\fP.
.TP
.B BAYCOMCTL_GETMODEMTYPE
-returns the modem type (i.e. \fIser12\fP or \fIpar96\fP) and the
+returns the modem type (i.e. \fIser12\fP or \fIpar96\fP) and the
options in effect (currently only the source of the DCD signal)
.TP
.B BAYCOMCTL_SETMODEMTYPE
@@ -56,7 +56,3 @@ linux/drivers/net/hdlcdrv.c,
.SH AUTHOR
baycom was written by Thomas Sailer, HB9JNX/AE4WA, (t.sailer@alumni.ethz.ch).
-
-
-
-
diff --git a/hdlcutil/fl/xfhdlcchpar_main.cxx b/hdlcutil/fl/xfhdlcchpar_main.cxx
index 8ebee3d..4b01138 100644
--- a/hdlcutil/fl/xfhdlcchpar_main.cxx
+++ b/hdlcutil/fl/xfhdlcchpar_main.cxx
@@ -58,7 +58,7 @@ void cb_update(Fl_Widget *widget, void *udata)
cp.ppersist = (int)(ppersist->value());
cp.fulldup = !!fulldup->value();
ret = hdrvc_set_channel_access_param(cp);
- if (ret < 0)
+ if (ret < 0)
perror("hdrvc_set_channel_access_param");
}
@@ -71,7 +71,7 @@ void cb_quit(Fl_Button *, long)
/* ---------------------------------------------------------------------- */
-static const char *usage_str =
+static const char *usage_str =
"[-i smif]\n"
" -i: specify the name of the baycom kernel driver interface\n\n";
@@ -79,7 +79,7 @@ static const char *usage_str =
int main(int argc, char *argv[])
{
- int c, i;
+ int c, i;
int ret;
struct hdrvc_channel_params cp;
diff --git a/hdlcutil/fl/xfhdlcst_main.cxx b/hdlcutil/fl/xfhdlcst_main.cxx
index a17e546..85a66db 100644
--- a/hdlcutil/fl/xfhdlcst_main.cxx
+++ b/hdlcutil/fl/xfhdlcst_main.cxx
@@ -62,7 +62,7 @@ void cb_timer(void *)
/* ---------------------------------------------------------------------- */
-static const char *usage_str =
+static const char *usage_str =
"[-i smif]\n"
" -i: specify the name of the baycom kernel driver interface\n\n";
@@ -70,7 +70,7 @@ static const char *usage_str =
int main(int argc, char *argv[])
{
- int c, i;
+ int c, i;
int ret;
struct hdrvc_channel_state cs;
#ifdef HDRVC_KERNEL
@@ -112,13 +112,13 @@ int main(int argc, char *argv[])
if (ret < 0) {
perror("hdrvc_get_mode_name");
modename->hide();
- } else
+ } else
modename->value(name);
ret = hdrvc_get_driver_name(name, sizeof(name));
if (ret < 0) {
perror("hdrvc_get_driver_name");
drivername->hide();
- } else
+ } else
drivername->value(name);
/*
* check for soundmodem driver
@@ -171,7 +171,7 @@ int main(int argc, char *argv[])
demodcyc->value(buf);
sprintf(buf, "%d", smi.data.dbg.dma_residue);
dmares->value(buf);
- }
+ }
}
exit (0);
}
diff --git a/hdlcutil/fl/xfsmdiag.cxx b/hdlcutil/fl/xfsmdiag.cxx
index 84c4bac..7232cfa 100644
--- a/hdlcutil/fl/xfsmdiag.cxx
+++ b/hdlcutil/fl/xfsmdiag.cxx
@@ -52,36 +52,36 @@ Fl_Window* create_the_forms() {
{ Fl_Group* o = scopemode = new Fl_Group(550, 10, 140, 130);
o->align(FL_ALIGN_CENTER);
{ Fl_Box* o = new Fl_Box(550, 10, 140, 130);
- o->box(FL_DOWN_BOX);
+ o->box(FL_DOWN_BOX);
}
{ Fl_Check_Button* o = sm_off = new Fl_Check_Button(560, 20, 120, 20, "Off");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)cb_mode, (void*)(0));
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)cb_mode, (void*)(0));
}
{ Fl_Check_Button* o = sm_input = new Fl_Check_Button(560, 40, 120, 20, "Input");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)cb_mode, (void*)(1));
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)cb_mode, (void*)(1));
}
{ Fl_Check_Button* o = sm_demod = new Fl_Check_Button(560, 60, 120, 20, "Demodulator");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)cb_mode, (void*)(2));
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)cb_mode, (void*)(2));
}
{ Fl_Check_Button* o = sm_constell = new Fl_Check_Button(560, 80, 120, 20, "Constellation");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)cb_mode, (void*)(3));
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)cb_mode, (void*)(3));
}
{ Fl_Check_Button* o = sm_dcd = new Fl_Check_Button(560, 110, 120, 20, "Gated with DCD");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)cb_mode, (void*)(256));
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)cb_mode, (void*)(256));
}
o->end();
}
diff --git a/hdlcutil/fl/xfsmdiag_main.cxx b/hdlcutil/fl/xfsmdiag_main.cxx
index 695d98f..dce7029 100644
--- a/hdlcutil/fl/xfsmdiag_main.cxx
+++ b/hdlcutil/fl/xfsmdiag_main.cxx
@@ -53,12 +53,12 @@
/* ---------------------------------------------------------------------- */
static char *progname;
-static unsigned int drawflags = 0;
+static unsigned int drawflags;
/* ---------------------------------------------------------------------- */
scope::scope(int x, int y, int w, int h, const char *l)
- : Fl_Box(x, y, w, h, l)
+ : Fl_Box(x, y, w, h, l)
{
box(FL_DOWN_FRAME);
X = x+3;
@@ -94,7 +94,7 @@ void scope::resize(int xx, int yy, int ww, int hh)
void scope::draw()
{
GC gc;
- XGCValues gcv;
+ XGCValues gcv;
/* cannot use draw_box(); as it clears the whole window -> flicker */
/* from fl_boxtype.C, fl_down_frame */
@@ -178,17 +178,17 @@ void scope::mode(int dmode)
void scope::clear(void)
{
GC gc;
- XGCValues gcv;
+ XGCValues gcv;
if (!pixmalloc)
return;
gcv.line_width = 1;
- gcv.line_style = LineSolid;
+ gcv.line_style = LineSolid;
gcv.fill_style = FillSolid;
- gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle | GCFillStyle, &gcv);
- XSetState(fl_display, gc, col_background, col_background, GXcopy, AllPlanes);
+ gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle | GCFillStyle, &gcv);
+ XSetState(fl_display, gc, col_background, col_background, GXcopy, AllPlanes);
XFillRectangle(fl_display, pixmap, gc, 0, 0, W, H);
- XFreeGC(fl_display, gc);
+ XFreeGC(fl_display, gc);
redraw();
}
@@ -201,17 +201,17 @@ void scope::clear(void)
void scope::drawdata(short data[], int len, int xm)
{
int cnt;
- GC gc;
- XGCValues gcv;
+ GC gc;
+ XGCValues gcv;
mode();
- if (!pixmalloc || (drawmode != HDRVC_DIAGMODE_CONSTELLATION &&
- drawmode != HDRVC_DIAGMODE_INPUT &&
+ if (!pixmalloc || (drawmode != HDRVC_DIAGMODE_CONSTELLATION &&
+ drawmode != HDRVC_DIAGMODE_INPUT &&
drawmode != HDRVC_DIAGMODE_DEMOD))
return;
gcv.line_width = 1;
- gcv.line_style = LineSolid;
- gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle, &gcv);
+ gcv.line_style = LineSolid;
+ gc = XCreateGC(fl_display, pixmap, GCLineWidth | GCLineStyle, &gcv);
if (drawmode == HDRVC_DIAGMODE_CONSTELLATION) {
#define XCOORD(x) ((SHRT_MAX - (int)(x)) * W / USHRT_MAX)
#define YCOORD(y) ((SHRT_MAX - (int)(y)) * H / USHRT_MAX)
@@ -241,7 +241,7 @@ void scope::drawdata(short data[], int len, int xm)
#undef XCOORD
#undef YCOORD
}
- XFreeGC(fl_display, gc);
+ XFreeGC(fl_display, gc);
redraw();
}
@@ -268,7 +268,7 @@ void cb_mode(Fl_Check_Button *, long which)
case 256:
drawflags ^= HDRVC_DIAGFLAG_DCDGATE;
break;
-
+
case 0:
scdisp->mode(HDRVC_DIAGMODE_OFF);
drawflags = 0;
@@ -298,7 +298,7 @@ void cb_quit(Fl_Button *, long)
{
struct sm_diag_data diag;
short data;
-
+
diag.mode = HDRVC_DIAGMODE_OFF;
diag.flags = 0;
diag.datalen = 1;
@@ -330,7 +330,7 @@ void cb_timer(void *)
/*
* draw scope
*/
- if ((ret = hdrvc_diag2(scdisp->mode(), drawflags, data, sizeof(data) / sizeof(short),
+ if ((ret = hdrvc_diag2(scdisp->mode(), drawflags, data, sizeof(data) / sizeof(short),
&samplesperbit)) < 0) {
perror("hdrvc_diag2");
exit(1);
@@ -341,7 +341,7 @@ void cb_timer(void *)
/* ---------------------------------------------------------------------- */
-static const char *usage_str =
+static const char *usage_str =
"[-i smif]\n"
" -i: specify the name of the baycom kernel driver interface\n\n";
@@ -349,7 +349,7 @@ static const char *usage_str =
int main(int argc, char *argv[])
{
- int c, i;
+ int c, i;
int ret;
unsigned int ifflags;
char name[64];
@@ -396,13 +396,13 @@ int main(int argc, char *argv[])
if (ret < 0) {
perror("hdrvc_get_mode_name");
modename->hide();
- } else
+ } else
modename->value(name);
ret = hdrvc_get_driver_name(name, sizeof(name));
if (ret < 0) {
perror("hdrvc_get_driver_name");
drivername->hide();
- } else
+ } else
drivername->value(name);
Fl::add_timeout(0.1, cb_timer);
scopewindow->show();
diff --git a/hdlcutil/fl/xfsmmixer.cxx b/hdlcutil/fl/xfsmmixer.cxx
index 57b5306..b5ba9b1 100644
--- a/hdlcutil/fl/xfsmmixer.cxx
+++ b/hdlcutil/fl/xfsmmixer.cxx
@@ -71,70 +71,70 @@ Fl_Window* create_form_ad1848() {
{ Fl_Group* o = ad1848_srcr = new Fl_Group(180, 150, 100, 120);
o->align(FL_ALIGN_CENTER);
{ Fl_Box* o = new Fl_Box(180, 150, 100, 120);
- o->box(FL_DOWN_BOX);
+ o->box(FL_DOWN_BOX);
}
{ Fl_Check_Button* o = ad1848_srcr_line = new Fl_Check_Button(190, 180, 60, 20, "Line");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
{ Fl_Check_Button* o = ad1848_srcr_aux1 = new Fl_Check_Button(190, 200, 60, 20, "Aux1");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
{ Fl_Check_Button* o = ad1848_srcr_mic = new Fl_Check_Button(190, 220, 60, 20, "Mic");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
{ Fl_Check_Button* o = ad1848_srcr_dac = new Fl_Check_Button(190, 240, 60, 20, "DAC");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
{ Fl_Box* o = new Fl_Box(190, 160, 60, 20, "Right source");
- o->box(FL_FLAT_BOX);
- o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ o->box(FL_FLAT_BOX);
+ o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
o->end();
}
{ Fl_Group* o = ad1848_srcl = new Fl_Group(180, 20, 100, 120);
o->align(FL_ALIGN_CENTER);
{ Fl_Box* o = new Fl_Box(180, 20, 100, 120);
- o->box(FL_DOWN_BOX);
+ o->box(FL_DOWN_BOX);
}
{ Fl_Box* o = new Fl_Box(190, 30, 60, 20, "Left source");
- o->box(FL_FLAT_BOX);
- o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ o->box(FL_FLAT_BOX);
+ o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{ Fl_Check_Button* o = ad1848_srcl_line = new Fl_Check_Button(190, 50, 60, 20, "Line");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
{ Fl_Check_Button* o = ad1848_srcl_aux1 = new Fl_Check_Button(190, 70, 60, 20, "Aux1");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
{ Fl_Check_Button* o = ad1848_srcl_mic = new Fl_Check_Button(190, 90, 60, 20, "Mic");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
{ Fl_Check_Button* o = ad1848_srcl_dac = new Fl_Check_Button(190, 110, 60, 20, "DAC");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ad1848);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ad1848);
}
o->end();
}
@@ -216,29 +216,29 @@ Fl_Window* create_form_ct1345() {
{ Fl_Group* o = ct1345_src = new Fl_Group(100, 20, 70, 100);
o->align(FL_ALIGN_CENTER);
{ Fl_Box* o = new Fl_Box(100, 20, 70, 100);
- o->box(FL_DOWN_BOX);
+ o->box(FL_DOWN_BOX);
}
{ Fl_Check_Button* o = ct1345_src_mic = new Fl_Check_Button(110, 50, 50, 20, "Mic");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1345);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1345);
}
{ Fl_Check_Button* o = ct1345_src_cd = new Fl_Check_Button(110, 70, 50, 20, "CD");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1345);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1345);
}
{ Fl_Check_Button* o = ct1345_src_line = new Fl_Check_Button(110, 90, 50, 20, "Line");
- o->type(102);
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1345);
+ o->type(102);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1345);
}
{ Fl_Box* o = new Fl_Box(110, 30, 50, 20, "Source");
- o->box(FL_FLAT_BOX);
- o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ o->box(FL_FLAT_BOX);
+ o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
o->end();
}
@@ -342,92 +342,92 @@ Fl_Window* create_form_ct1745() {
{ Fl_Group* o = ct1745_srcl = new Fl_Group(180, 20, 110, 180);
o->align(FL_ALIGN_CENTER);
{ Fl_Box* o = new Fl_Box(180, 20, 110, 180);
- o->box(FL_DOWN_BOX);
+ o->box(FL_DOWN_BOX);
}
{ Fl_Box* o = new Fl_Box(191, 29, 89, 18, "Left source");
- o->box(FL_FLAT_BOX);
- o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ o->box(FL_FLAT_BOX);
+ o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{ Fl_Check_Button* o = ct1745_srcl_mic = new Fl_Check_Button(190, 50, 90, 20, "Mic");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcl_cdl = new Fl_Check_Button(190, 70, 90, 20, "CD left");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcl_cdr = new Fl_Check_Button(190, 90, 90, 20, "CD right");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcl_linel = new Fl_Check_Button(190, 110, 90, 20, "Line left");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcl_midil = new Fl_Check_Button(190, 150, 90, 20, "MIDI left");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcl_midir = new Fl_Check_Button(190, 170, 90, 20, "MIDI right");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcl_liner = new Fl_Check_Button(190, 130, 90, 20, "Line right");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
o->end();
}
{ Fl_Group* o = ct1745_srcr = new Fl_Group(300, 20, 110, 180);
o->align(FL_ALIGN_CENTER);
{ Fl_Box* o = new Fl_Box(300, 20, 110, 180);
- o->box(FL_DOWN_BOX);
+ o->box(FL_DOWN_BOX);
}
{ Fl_Box* o = new Fl_Box(311, 29, 89, 18, "Right source");
- o->box(FL_FLAT_BOX);
- o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ o->box(FL_FLAT_BOX);
+ o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
}
{ Fl_Check_Button* o = ct1745_srcr_mic = new Fl_Check_Button(310, 50, 90, 20, "Mic");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcr_cdl = new Fl_Check_Button(310, 70, 90, 20, "CD left");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcr_cdr = new Fl_Check_Button(310, 90, 90, 20, "CD right");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcr_linel = new Fl_Check_Button(310, 110, 90, 20, "Line left");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcr_midil = new Fl_Check_Button(310, 150, 90, 20, "MIDI left");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcr_midir = new Fl_Check_Button(310, 170, 90, 20, "MIDI right");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
{ Fl_Check_Button* o = ct1745_srcr_liner = new Fl_Check_Button(310, 130, 90, 20, "Line right");
- o->down_box(FL_DIAMOND_DOWN_BOX);
- o->selection_color(3);
- o->callback((Fl_Callback*)update_ct1745);
+ o->down_box(FL_DIAMOND_DOWN_BOX);
+ o->selection_color(3);
+ o->callback((Fl_Callback*)update_ct1745);
}
o->end();
}
diff --git a/hdlcutil/fl/xfsmmixer_main.cxx b/hdlcutil/fl/xfsmmixer_main.cxx
index 5569e7c..b33533f 100644
--- a/hdlcutil/fl/xfsmmixer_main.cxx
+++ b/hdlcutil/fl/xfsmmixer_main.cxx
@@ -50,9 +50,9 @@ static unsigned int mixdevice;
static int do_mix_ioctl(int cmd, struct sm_mixer_data *mixdat)
{
- struct sm_ioctl par;
+ struct sm_ioctl par;
int i;
-
+
par.cmd = cmd;
par.data.mix = *mixdat;
i = hdrvc_sm_ioctl(cmd, &par);
@@ -120,7 +120,7 @@ void update_ad1848(Fl_Widget *widget, void *udata)
mdata |= 0x20;
}
mval *= 0.666666;
- if (mval > 15)
+ if (mval > 15)
mval = 15;
mdata |= (int)mval;
set_mixer_reg(0x00, mdata);
@@ -139,7 +139,7 @@ void update_ad1848(Fl_Widget *widget, void *udata)
mdata |= 0x20;
}
mval *= 0.666666;
- if (mval > 15)
+ if (mval > 15)
mval = 15;
mdata |= (int)mval;
set_mixer_reg(0x01, mdata);
@@ -150,12 +150,12 @@ void update_ad1848(Fl_Widget *widget, void *udata)
mval = ad1848_outl->value();
if (mval < -95)
set_mixer_reg(0x06, 0x80);
- else
+ else
set_mixer_reg(0x06, (unsigned char)(mval * (-0.66666666)));
mval = ad1848_outr->value();
if (mval < -95)
set_mixer_reg(0x07, 0x80);
- else
+ else
set_mixer_reg(0x07, (unsigned char)(mval * (-0.66666666)));
set_mixer_reg(0x0d, 0x00);
}
@@ -272,7 +272,7 @@ void update_ct1745(Fl_Widget *widget, void *udata)
if (ct1745_srcl_midil->value())
mdata |= 0x40;
if (ct1745_srcl_midir->value())
- mdata |= 0x20;
+ mdata |= 0x20;
set_mixer_reg(0x3d, mdata); /* input sources left */
mdata = 0;
if (ct1745_srcr_mic->value())
@@ -288,7 +288,7 @@ void update_ct1745(Fl_Widget *widget, void *udata)
if (ct1745_srcr_midil->value())
mdata |= 0x40;
if (ct1745_srcr_midir->value())
- mdata |= 0x20;
+ mdata |= 0x20;
set_mixer_reg(0x3e, mdata); /* input sources right*/
}
@@ -301,7 +301,7 @@ void cb_quit(Fl_Button *, long)
/* ---------------------------------------------------------------------- */
-static const char *usage_str =
+static const char *usage_str =
"[-i smif]\n"
" -i: specify the name of the soundmodem kernel driver interface\n\n";
@@ -309,10 +309,10 @@ static const char *usage_str =
int main(int argc, char *argv[])
{
- int c, i;
+ int c, i;
struct sm_mixer_data mixdat;
unsigned char mdata;
-
+
progname = *argv;
printf("%s: Version 0.3; (C) 1996,1997,2000 by Thomas Sailer HB9JNX/AE4WA\n", progname);
hdrvc_args(&argc, argv, "sm0");
@@ -352,7 +352,7 @@ int main(int argc, char *argv[])
case SM_MIXER_AD1848:
case SM_MIXER_CRYSTAL:
- printf("Mixer device: %s\n", mixdevice == SM_MIXER_CRYSTAL ?
+ printf("Mixer device: %s\n", mixdevice == SM_MIXER_CRYSTAL ?
"CS423x" : "AD1848");
create_form_ad1848();
mdata = get_mixer_reg(0);
diff --git a/hdlcutil/hdlcdrv.9 b/hdlcutil/hdlcdrv.9
index d0182ff..e76c391 100644
--- a/hdlcutil/hdlcdrv.9
+++ b/hdlcutil/hdlcdrv.9
@@ -33,8 +33,8 @@ hdlcdrv \- HDLC amateur (AX.25) packet radio network driver
.SH DESCRIPTION
This driver should ease the implementation of simple AX.25 packet radio
modems where the software is responsible for the HDLC encoding and decoding.
-Examples of such modems include the \fIbaycom\fP family and the
-\fIsoundcard\fP modems.
+Examples of such modems include the \fIbaycom\fP family and the
+\fIsoundcard\fP modems.
This driver provides a standard Linux network driver interface.
It can even be compiled if Kernel AX.25 is not enabled in the Linux
@@ -118,11 +118,11 @@ the HDLC driver:
.nf
struct hdlcdrv_ops {
- const char *\fIdrvname\fP;
- const char *\fIdrvinfo\fP;
- int (*\fIopen\fP)(struct device *);
- int (*\fIclose\fP)(struct device *);
- int (*\fIioctl\fP)(struct device *, struct ifreq *, int);
+ const char *\fIdrvname\fP;
+ const char *\fIdrvinfo\fP;
+ int (*\fIopen\fP)(struct device *);
+ int (*\fIclose\fP)(struct device *);
+ int (*\fIioctl\fP)(struct device *, struct ifreq *, int);
};
.fi
@@ -140,7 +140,7 @@ which then gets invoked by the hardware.
\fBifconfig\ \fP\fIifname\fP\fB\ down\fP and should undo all actions done
by \fBopen\fP, i.e. release io regions and irqs.
-\fBioctl\fP may be provided to implement device specific ioctl's.
+\fBioctl\fP may be provided to implement device specific ioctl's.
.SH "IOCTL CALLS"
@@ -149,14 +149,14 @@ from and to the driver using the following struct:
.nf
struct hdlcdrv_ioctl {
- int cmd;
- union {
- struct hdlcdrv_params mp;
- struct hdlcdrv_channel_params cp;
- struct hdlcdrv_channel_state cs;
- unsigned int calibrate;
- unsigned char bits;
- } data;
+ int cmd;
+ union {
+ struct hdlcdrv_params mp;
+ struct hdlcdrv_channel_params cp;
+ struct hdlcdrv_channel_state cs;
+ unsigned int calibrate;
+ unsigned char bits;
+ } data;
};
.fi
@@ -214,7 +214,3 @@ linux/drivers/net/hdlcdrv.c,
.SH AUTHOR
hdlcdrv was written by Thomas Sailer, HB9JNX/AE4WA, (t.sailer@alumni.ethz.ch).
-
-
-
-
diff --git a/hdlcutil/hdrvcomm.c b/hdlcutil/hdrvcomm.c
index 6b4335e..c362c1b 100644
--- a/hdlcutil/hdrvcomm.c
+++ b/hdlcutil/hdrvcomm.c
@@ -69,7 +69,7 @@ static const char *if_name = "bcsf0";
static char *prg_name;
static int fd = -1;
static struct ifreq ifr_h;
-static int promisc = 0;
+static int promisc;
static int afpacket = 1;
static int msqid = -1;
@@ -130,7 +130,7 @@ int hdrvc_recvpacket(char *pkt, int maxlen)
}
} else {
struct sockaddr sa;
-
+
strcpy(sa.sa_data, if_name);
sa.sa_family = AF_INET;
if (bind(fd, &sa, sizeof(sa)) < 0) {
@@ -196,7 +196,7 @@ void hdrvc_args(int *argc, char *argv[], const char *def_if)
if (i < ac)
memmove(argv+i, argv+i+2, (ac-i) * sizeof(void *));
i--;
- } else
+ } else
#endif /* HDRVC_KERNEL */
if (!strcmp(argv[i], "-u")) {
#ifdef HDRVC_KERNEL
@@ -229,24 +229,24 @@ void hdrvc_init(void)
close(fd);
afpacket = 0;
if ((fd = socket(PF_INET, SOCK_PACKET, htons(ETH_P_AX25))) < 0) {
- fprintf(stderr, "%s: Error %s (%i), cannot open %s\n", prg_name,
+ fprintf(stderr, "%s: Error %s (%i), cannot open %s\n", prg_name,
strerror(errno), errno, if_name);
exit(-1);
}
if (ioctl(fd, SIOCGIFFLAGS, &ifr_h) < 0) {
- fprintf(stderr, "%s: Error %s (%i), cannot ioctl SIOCGIFFLAGS %s\n", prg_name,
+ fprintf(stderr, "%s: Error %s (%i), cannot ioctl SIOCGIFFLAGS %s\n", prg_name,
strerror(errno), errno, if_name);
exit(-1);
}
}
strcpy(ifr.ifr_name, if_name);
if (ioctl(fd, SIOCGIFHWADDR, &ifr) < 0 ) {
- fprintf(stderr, "%s: Error %s (%i), cannot ioctl SIOCGIFHWADDR %s\n", prg_name,
+ fprintf(stderr, "%s: Error %s (%i), cannot ioctl SIOCGIFHWADDR %s\n", prg_name,
strerror(errno), errno, if_name);
exit(-1);
- }
+ }
if (ifr.ifr_hwaddr.sa_family != ARPHRD_AX25) {
- fprintf(stderr, "%s: Error, interface %s not AX25 (%i)\n", prg_name,
+ fprintf(stderr, "%s: Error, interface %s not AX25 (%i)\n", prg_name,
if_name, ifr.ifr_hwaddr.sa_family);
exit(-1);
}
@@ -255,12 +255,12 @@ void hdrvc_init(void)
#endif /* HDRVC_KERNEL */
k = ftok(if_name, USERSM_KEY_PROJ);
if (k == (key_t)-1) {
- fprintf(stderr, "%s: Error %s (%i), cannot ftok on %s\n", prg_name,
+ fprintf(stderr, "%s: Error %s (%i), cannot ftok on %s\n", prg_name,
strerror(errno), errno, if_name);
exit(-1);
}
if ((msqid = msgget(k, 0700)) < 0) {
- fprintf(stderr, "%s: Error %s (%i), cannot msgget %d\n", prg_name,
+ fprintf(stderr, "%s: Error %s (%i), cannot msgget %d\n", prg_name,
strerror(errno), errno, k);
exit(-1);
}
@@ -276,7 +276,7 @@ void hdrvc_sendmsg(struct usersmmsg *msg, int len)
}
}
-int hdrvc_recvmsg(struct usersmmsg *msg, int maxlen, long type)
+int hdrvc_recvmsg(struct usersmmsg *msg, int maxlen, long type)
{
int len;
@@ -286,15 +286,15 @@ int hdrvc_recvmsg(struct usersmmsg *msg, int maxlen, long type)
}
#if 0
for (;;) {
- if ((len = msgrcv(msqid, (struct msgbuf *)msg, maxlen-sizeof(long), type, IPC_NOWAIT|MSG_NOERROR)) >= 0)
+ if ((len = msgrcv(msqid, (struct msgbuf *)msg, maxlen-sizeof(long), type, IPC_NOWAIT|MSG_NOERROR)) >= 0)
return len+sizeof(long);
- if (errno != ENOMSG) {
+ if (errno != ENOMSG) {
perror("msgrcv");
exit(1);
}
usleep(250000);
}
-#endif
+#endif
return len+sizeof(long);
}
@@ -305,7 +305,7 @@ int hdrvc_recvmsg(struct usersmmsg *msg, int maxlen, long type)
int hdrvc_hdlcdrv_ioctl(int cmd, struct hdlcdrv_ioctl *par)
{
struct ifreq ifr = ifr_h;
-
+
if (!kernel_mode) {
errno = EINVAL;
return -1;
@@ -320,7 +320,7 @@ int hdrvc_hdlcdrv_ioctl(int cmd, struct hdlcdrv_ioctl *par)
int hdrvc_sm_ioctl(int cmd, struct sm_ioctl *par)
{
struct ifreq ifr = ifr_h;
-
+
if (!kernel_mode) {
errno = EINVAL;
return -1;
@@ -335,7 +335,7 @@ int hdrvc_sm_ioctl(int cmd, struct sm_ioctl *par)
int hdrvc_baycom_ioctl(int cmd, struct baycom_ioctl *par)
{
struct ifreq ifr = ifr_h;
-
+
if (!kernel_mode) {
errno = EINVAL;
return -1;
@@ -410,11 +410,11 @@ int hdrvc_get_samples(void)
{
int ret;
struct hdlcdrv_ioctl bi;
-
+
#ifdef HDRVC_KERNEL
if (kernel_mode) {
ret = hdrvc_hdlcdrv_ioctl(HDLCDRVCTL_GETSAMPLES, &bi);
- if (ret < 0)
+ if (ret < 0)
return ret;
return bi.data.bits & 0xff;
}
@@ -429,11 +429,11 @@ int hdrvc_get_bits(void)
{
int ret;
struct hdlcdrv_ioctl bi;
-
+
#ifdef HDRVC_KERNEL
if (kernel_mode) {
ret = hdrvc_hdlcdrv_ioctl(HDLCDRVCTL_GETBITS, &bi);
- if (ret < 0)
+ if (ret < 0)
return ret;
return bi.data.bits & 0xff;
}
@@ -490,11 +490,11 @@ int hdrvc_set_channel_access_param(struct hdrvc_channel_params par)
{
int ret;
struct usersmmsg msg;
-
+
#ifdef HDRVC_KERNEL
if (kernel_mode) {
struct hdlcdrv_ioctl hi;
-
+
hi.data.cp.tx_delay = par.tx_delay;
hi.data.cp.tx_tail = par.tx_tail;
hi.data.cp.slottime = par.slottime;
@@ -513,7 +513,7 @@ int hdrvc_set_channel_access_param(struct hdrvc_channel_params par)
msg.data.cp.ppersist = par.ppersist;
msg.data.cp.fulldup = par.fulldup;
hdrvc_sendmsg(&msg, sizeof(msg.data.cp));
- return 0;
+ return 0;
}
/* ---------------------------------------------------------------------- */
@@ -585,16 +585,16 @@ int hdrvc_get_channel_state(struct hdrvc_channel_state *st)
/* ---------------------------------------------------------------------- */
-int hdrvc_diag2(unsigned int mode, unsigned int flags, short *data,
+int hdrvc_diag2(unsigned int mode, unsigned int flags, short *data,
unsigned int maxdatalen, unsigned int *samplesperbit)
{
int ret;
struct usersmmsg msg;
static unsigned int modeconvusersm[4] = {
- USERSM_DIAGMODE_OFF, USERSM_DIAGMODE_INPUT, USERSM_DIAGMODE_DEMOD,
+ USERSM_DIAGMODE_OFF, USERSM_DIAGMODE_INPUT, USERSM_DIAGMODE_DEMOD,
USERSM_DIAGMODE_CONSTELLATION
};
-
+
if (mode > HDRVC_DIAGMODE_CONSTELLATION) {
errno = EINVAL;
return -1;
diff --git a/hdlcutil/hdrvcomm.h b/hdlcutil/hdrvcomm.h
index fbb4965..520f2d9 100644
--- a/hdlcutil/hdrvcomm.h
+++ b/hdlcutil/hdrvcomm.h
@@ -49,22 +49,22 @@ extern "C" {
/* ---------------------------------------------------------------------- */
struct hdrvc_channel_params {
- int tx_delay; /* the transmitter keyup delay in 10ms units */
- int tx_tail; /* the transmitter keyoff delay in 10ms units */
- int slottime; /* the slottime in 10ms; usually 10 = 100ms */
- int ppersist; /* the p-persistence 0..255 */
- int fulldup; /* some driver do not support full duplex, setting */
- /* this just makes them send even if DCD is on */
+ int tx_delay; /* the transmitter keyup delay in 10ms units */
+ int tx_tail; /* the transmitter keyoff delay in 10ms units */
+ int slottime; /* the slottime in 10ms; usually 10 = 100ms */
+ int ppersist; /* the p-persistence 0..255 */
+ int fulldup; /* some driver do not support full duplex, setting */
+ /* this just makes them send even if DCD is on */
};
struct hdrvc_channel_state {
- int ptt;
- int dcd;
- int ptt_keyed;
- unsigned long tx_packets;
- unsigned long tx_errors;
- unsigned long rx_packets;
- unsigned long rx_errors;
+ int ptt;
+ int dcd;
+ int ptt_keyed;
+ unsigned long tx_packets;
+ unsigned long tx_errors;
+ unsigned long rx_packets;
+ unsigned long rx_errors;
};
/* ---------------------------------------------------------------------- */
diff --git a/hdlcutil/sethdlc.8 b/hdlcutil/sethdlc.8
index 0d784f3..bfbf8a2 100644
--- a/hdlcutil/sethdlc.8
+++ b/hdlcutil/sethdlc.8
@@ -66,7 +66,7 @@ instructs the driver to send a calibration pattern for
.I cal
seconds.
-Without the
+Without the
.B \-p,
.B \-a
and
@@ -76,7 +76,7 @@ option,
will stay in the foreground and display received packets. The AX.25 header
and eventually a FlexNet compressed header are decoded. CTRL-C terminates
.B sethdlc.
-Specifying additional options,
+Specifying additional options,
.B sethdlc
may display additional information.
@@ -87,7 +87,7 @@ accepts the following options:
.TP
.B \-b
-Trace the bits at the output of the demodulator, after RX clock recovery.
+Trace the bits at the output of the demodulator, after RX clock recovery.
This option is only available if \fBsethdlc\fP
and the soundcard modem kernel driver is compiled with debugging support on.
This is useful for driver debugging.
@@ -110,7 +110,7 @@ interrogated. It will usually have the following form:
.B \-s
Trace the bits at the demodulator output, \fIbefore\fP
the RX clock recovery, to stdout. This option is only available the modem driver
-is compiled with debugging support on. It may not be available on some modem, such
+is compiled with debugging support on. It may not be available on some modem, such
as the \fIpar96\fP.
.SH PARAMETERS
@@ -161,14 +161,14 @@ The
.B seriobase
parameter optionally sets the address of a serial port, where
the driver will output a PTT signal at the TxD and RTS pins, and a DCD
-signal at the DTR pin. As Baycom modems do have their own PTT pin, this
+signal at the DTR pin. As Baycom modems do have their own PTT pin, this
parameter is not used by the Baycom modem driver.
The
.B pariobase
parameter optionally sets the address of a LPT port where
the driver will output a PTT signal on the DATA0 line and a DCD signal
-on the DATA1 line. As Baycom modems do have their own PTT pin, this
+on the DATA1 line. As Baycom modems do have their own PTT pin, this
parameter is not used by the Baycom modem driver.
The
@@ -198,7 +198,7 @@ time to actually clock the last bits out to the transmitter.
The
.B slottime
parameter specifies how often the channel access algorithm is executed.
-Unlike \fIkissparms\fP, the unit is \fItens of ms\fP. Unless you have very
+Unlike \fIkissparms\fP, the unit is \fItens of ms\fP. Unless you have very
specific requirements, set this to 100ms (i.e. 10).
The
@@ -220,7 +220,7 @@ sets the modem to half duplex mode.
.SH CONSIDERATIONS OF CONFIGURING BAYCOM PORTS
It is important to note that sethdlc merely tells the Linux kernel
where it should expect to find the I/O port and IRQ lines of a
-particular serial port. It does
+particular serial port. It does
.I not
configure the hardware to use a
particular I/O port. In order to do that, you will need to physically
diff --git a/hdlcutil/sethdlc.c b/hdlcutil/sethdlc.c
index 34e1467..657eed6 100644
--- a/hdlcutil/sethdlc.c
+++ b/hdlcutil/sethdlc.c
@@ -47,19 +47,19 @@
/* ---------------------------------------------------------------------- */
-static unsigned char trace_stat = 0;
+static unsigned char trace_stat;
static char *progname;
/* ---------------------------------------------------------------------- */
-static void display_packet(unsigned char *bp, unsigned int len)
+static void display_packet(unsigned char *bp, unsigned int len)
{
unsigned char v1=1,cmd=0;
unsigned char i,j;
- if (!bp || !len)
+ if (!bp || !len)
return;
- if (len < 8)
+ if (len < 8)
return;
if (bp[1] & 1) {
/*
@@ -69,24 +69,24 @@ static void display_packet(unsigned char *bp, unsigned int len)
cmd = (bp[1] & 2) != 0;
printf("fm ? to ");
i = (bp[2] >> 2) & 0x3f;
- if (i)
+ if (i)
printf("%c",i+0x20);
i = ((bp[2] << 4) | ((bp[3] >> 4) & 0xf)) & 0x3f;
- if (i)
+ if (i)
printf("%c",i+0x20);
i = ((bp[3] << 2) | ((bp[4] >> 6) & 3)) & 0x3f;
- if (i)
+ if (i)
printf("%c",i+0x20);
i = bp[4] & 0x3f;
- if (i)
+ if (i)
printf("%c",i+0x20);
i = (bp[5] >> 2) & 0x3f;
- if (i)
+ if (i)
printf("%c",i+0x20);
i = ((bp[5] << 4) | ((bp[6] >> 4) & 0xf)) & 0x3f;
- if (i)
+ if (i)
printf("%c",i+0x20);
- printf("-%u QSO Nr %u", bp[6] & 0xf, (bp[0] << 6) |
+ printf("-%u QSO Nr %u", bp[6] & 0xf, (bp[0] << 6) |
(bp[1] >> 2));
bp += 7;
len -= 7;
@@ -94,41 +94,41 @@ static void display_packet(unsigned char *bp, unsigned int len)
/*
* normal header
*/
- if (len < 15)
+ if (len < 15)
return;
if ((bp[6] & 0x80) != (bp[13] & 0x80)) {
v1 = 0;
cmd = (bp[6] & 0x80);
}
printf("fm ");
- for(i = 7; i < 13; i++)
- if ((bp[i] &0xfe) != 0x40)
+ for (i = 7; i < 13; i++)
+ if ((bp[i] &0xfe) != 0x40)
printf("%c",bp[i] >> 1);
printf("-%u to ",(bp[13] >> 1) & 0xf);
- for(i = 0; i < 6; i++)
- if ((bp[i] &0xfe) != 0x40)
+ for (i = 0; i < 6; i++)
+ if ((bp[i] &0xfe) != 0x40)
printf("%c", bp[i] >> 1);
printf("-%u", (bp[6] >> 1) & 0xf);
bp += 14;
len -= 14;
- if ((!(bp[-1] & 1)) && (len >= 7))
+ if ((!(bp[-1] & 1)) && (len >= 7))
printf(" via ");
while ((!(bp[-1] & 1)) && (len >= 7)) {
- for(i = 0; i < 6; i++)
- if ((bp[i] &0xfe) != 0x40)
+ for (i = 0; i < 6; i++)
+ if ((bp[i] &0xfe) != 0x40)
printf("%c",bp[i] >> 1);
printf("-%u",(bp[6] >> 1) & 0xf);
bp += 7;
len -= 7;
- if ((!(bp[-1] & 1)) && (len >= 7))
+ if ((!(bp[-1] & 1)) && (len >= 7))
printf(",");
}
}
- if(!len)
+ if (!len)
return;
i = *bp++;
len--;
- j = v1 ? ((i & 0x10) ? '!' : ' ') :
+ j = v1 ? ((i & 0x10) ? '!' : ' ') :
((i & 0x10) ? (cmd ? '+' : '-') : (cmd ? '^' : 'v'));
if (!(i & 1)) {
/*
@@ -177,7 +177,7 @@ static void display_packet(unsigned char *bp, unsigned int len)
printf(" REJ%u%c",(i >> 5) & 7,j);
break;
default:
- printf(" unknown S (0x%x)%u%c", i & 0xf,
+ printf(" unknown S (0x%x)%u%c", i & 0xf,
(i >> 5) & 7, j);
break;
}
@@ -191,19 +191,19 @@ static void display_packet(unsigned char *bp, unsigned int len)
j = 0;
while (len) {
i = *bp++;
- if ((i >= 32) && (i < 128))
+ if ((i >= 32) && (i < 128))
printf("%c",i);
else if (i == 13) {
- if (j)
+ if (j)
printf("\n");
j = 0;
- } else
+ } else
printf(".");
- if (i >= 32)
+ if (i >= 32)
j = 1;
len--;
}
- if (j)
+ if (j)
printf("\n");
}
@@ -215,18 +215,18 @@ static void print_bits(int (*bitproc)(void))
int i;
char str[9];
char *cp;
-
- for(;;) {
+
+ for (;;) {
ret = bitproc();
if (ret < 0) {
if (errno == EAGAIN)
return;
fprintf(stderr, "%s: Error %s (%i), cannot ioctl\n",
- progname, strerror(errno), errno);
+ progname, strerror(errno), errno);
return;
}
strcpy(cp = str, "00000000");
- for(i = 0; i < 8; i++, cp++, ret >>= 1)
+ for (i = 0; i < 8; i++, cp++, ret >>= 1)
*cp += (ret & 1);
printf("%s", str);
}
@@ -236,7 +236,7 @@ static void print_bits(int (*bitproc)(void))
#ifdef HDRVC_KERNEL
-static void do_set_params(int argc, char **argv)
+static void do_set_params(int argc, char **argv)
{
struct hdlcdrv_ioctl drvname, curm, newm, mlist, curp, newp, mpmask;
char set = 0;
@@ -268,7 +268,7 @@ static void do_set_params(int argc, char **argv)
newp = curp;
while (argc >= 2) {
if (!strcasecmp(argv[0], "mode")) {
- strncpy(newm.data.modename, argv[1],
+ strncpy(newm.data.modename, argv[1],
sizeof(newm.data.modename));
set |= 1;
} else if (!strcasecmp(argv[0], "io") && mask & HDLCDRV_PARMASK_IOBASE) {
@@ -291,17 +291,17 @@ static void do_set_params(int argc, char **argv)
set |= 2;
} else if (!strcasecmp(argv[0], "midiio") && mask & HDLCDRV_PARMASK_MIDIIOBASE) {
newp.data.mp.midiiobase = strtol(argv[1], NULL, 0);
- set |= 2;
+ set |= 2;
} else {
fprintf(stderr, "%s: invalid parameter type '%s', "
"valid: mode%s%s%s%s%s%s%s\n",
- progname, argv[0],
- (mask & HDLCDRV_PARMASK_IOBASE) ? " io" : "",
- (mask & HDLCDRV_PARMASK_IRQ) ? " irq" : "",
- (mask & HDLCDRV_PARMASK_DMA) ? " dma" : "",
- (mask & HDLCDRV_PARMASK_DMA2) ? " dma2" : "",
- (mask & HDLCDRV_PARMASK_SERIOBASE) ? " serio" : "",
- (mask & HDLCDRV_PARMASK_PARIOBASE) ? " pario" : "",
+ progname, argv[0],
+ (mask & HDLCDRV_PARMASK_IOBASE) ? " io" : "",
+ (mask & HDLCDRV_PARMASK_IRQ) ? " irq" : "",
+ (mask & HDLCDRV_PARMASK_DMA) ? " dma" : "",
+ (mask & HDLCDRV_PARMASK_DMA2) ? " dma2" : "",
+ (mask & HDLCDRV_PARMASK_SERIOBASE) ? " serio" : "",
+ (mask & HDLCDRV_PARMASK_PARIOBASE) ? " pario" : "",
(mask & HDLCDRV_PARMASK_MIDIIOBASE) ? " midiio" : "");
}
argv += 2;
@@ -327,7 +327,7 @@ static void do_set_params(int argc, char **argv)
printf(" midiio 0x%x", curp.data.mp.midiiobase);
printf("\n");
- if (set & 1)
+ if (set & 1)
ret = hdrvc_hdlcdrv_ioctl(HDLCDRVCTL_SETMODE, &newm);
if (ret < 0) {
perror("ioctl (HDLCDRVCTL_SETMODE)");
@@ -336,7 +336,7 @@ static void do_set_params(int argc, char **argv)
perror("ioctl (HDLCDRVCTL_MODELIST)");
exit(1);
}
- printf("driver supported modes: %s\n",
+ printf("driver supported modes: %s\n",
mlist.data.modename);
exit(1);
}
@@ -347,7 +347,7 @@ static void do_set_params(int argc, char **argv)
fprintf(stderr, "%s: trying to restore old "
"parameters\n", progname);
ret = hdrvc_hdlcdrv_ioctl(HDLCDRVCTL_SETMODEMPAR, &curp);
- if (ret < 0)
+ if (ret < 0)
perror("ioctl (HDLCDRVCTL_SETMODEMPAR)");
exit(1);
}
@@ -377,17 +377,17 @@ static void do_set_params(int argc, char **argv)
/* ---------------------------------------------------------------------- */
-static void display_channel_params(const struct hdrvc_channel_params *par)
+static void display_channel_params(const struct hdrvc_channel_params *par)
{
printf("TX delay %ums, TX tail %ums, slottime %ums, p-persistence "
" %u/256, %s duplex\n", 10*par->tx_delay, 10*par->tx_tail,
- 10*par->slottime, par->ppersist,
+ 10*par->slottime, par->ppersist,
par->fulldup ? "Full" : "Half");
}
/* ---------------------------------------------------------------------- */
-static void do_set_channel_params(int argc, char **argv)
+static void do_set_channel_params(int argc, char **argv)
{
struct hdrvc_channel_params par1, par2;
char set = 0;
@@ -452,13 +452,13 @@ static void do_set_channel_params(int argc, char **argv)
/* ---------------------------------------------------------------------- */
-static const char *usage_str =
+static const char *usage_str =
"[-b] [-i] [-d] [-i <baycomif>] [-h] [-c <cal>]\n"
"[-p] [hw <hw>] [type <type>] [io <iobase>] [irq <irq>] [dma <dma>]\n"
" [options <opt>] [serio <serio>] [pario <pario>] [midiio <midiio>]\n"
"[-a] [txd <txdelay>] [txtail <txtail>] [slot <slottime>]\n"
" [ppersist <ppersistence>] [full] [half]\n"
-" -a: set or display channel access parameters\n"
+" -a: set or display channel access parameters\n"
" -b: trace demodulated bits\n"
" -s: trace sampled input from tcm3105 (ser12 only)\n"
" -d: trace dcd and ptt status on stdout\n"
@@ -531,7 +531,7 @@ int main(int argc, char *argv[])
perror("hdrvc_calibrate");
exit(1);
}
- fprintf(stdout, "%s: calibrating for %i seconds\n", *argv,
+ fprintf(stdout, "%s: calibrating for %i seconds\n", *argv,
cal_val);
exit(0);
}
@@ -543,24 +543,24 @@ int main(int argc, char *argv[])
ret = hdrvc_get_channel_state(&chst);
if (ret < 0)
perror("hdrvc_get_channel_state");
- printf("%c%c rx: %lu tx: %lu rxerr: %lu txerr: %lu",
+ printf("%c%c rx: %lu tx: %lu rxerr: %lu txerr: %lu",
chst.dcd ? 'D' : '-', chst.ptt ? 'P' : '-',
- chst.rx_packets, chst.tx_packets, chst.rx_errors,
+ chst.rx_packets, chst.tx_packets, chst.rx_errors,
chst.tx_errors);
#ifdef HDRVC_KERNEL
if (hdrvc_sm_ioctl(SMCTL_GETDEBUG, &bsi) >= 0) {
printf(" intrate: %u modcyc: %u "
- "demodcyc: %u dmares: %u",
- bsi.data.dbg.int_rate,
- bsi.data.dbg.mod_cycles,
+ "demodcyc: %u dmares: %u",
+ bsi.data.dbg.int_rate,
+ bsi.data.dbg.mod_cycles,
bsi.data.dbg.demod_cycles,
bsi.data.dbg.dma_residue);
- }
+ }
if (hdrvc_baycom_ioctl(BAYCOMCTL_GETDEBUG, &bbi) >= 0) {
- printf(" dbg1: %lu dbg2: %lu dbg3: %li",
- bbi.data.dbg.debug1, bbi.data.dbg.debug2,
+ printf(" dbg1: %lu dbg2: %lu dbg3: %li",
+ bbi.data.dbg.debug1, bbi.data.dbg.debug2,
bbi.data.dbg.debug3);
- }
+ }
#endif /* HDRVC_KERNEL */
printf("\n");
break;
@@ -582,7 +582,7 @@ int main(int argc, char *argv[])
FD_ZERO(&fds_write);
FD_SET(hdrvc_getfd(), &fds_read);
ret = select(hdrvc_getfd()+1, &fds_read, &fds_write, NULL, &tm);
- } else
+ } else
ret = select(0, NULL, NULL, NULL, &tm);
if (ret < 0) {
fprintf(stderr, "%s: Error %s (%i) in select\n", *argv,
diff --git a/hdlcutil/smdiag.8 b/hdlcutil/smdiag.8
index abc960f..996ec9a 100644
--- a/hdlcutil/smdiag.8
+++ b/hdlcutil/smdiag.8
@@ -64,7 +64,7 @@ quits
.SH BUGS
.B smdiag
Reacts sluggishly to keypresses. The window size is fixed. For speed reasons,
-two square root operations per sample are not implemented in the AFSK 1200
+two square root operations per sample are not implemented in the AFSK 1200
baud modes. The eye diagram for the AFSK 1200 baud mode is therefore
distorted.
@@ -74,5 +74,3 @@ linux/drivers/net/soundmodem.c
.SH AUTHOR
smdiag was written by Thomas Sailer (t.sailer@alumni.ethz.ch).
-
-
diff --git a/hdlcutil/smdiag.c b/hdlcutil/smdiag.c
index e9b615d..16d34f0 100644
--- a/hdlcutil/smdiag.c
+++ b/hdlcutil/smdiag.c
@@ -51,7 +51,7 @@
/* ---------------------------------------------------------------------- */
static char *progname;
-static Display *display = NULL;
+static Display *display;
static Window window;
static Pixmap pixmap;
static unsigned long col_zeroline;
@@ -69,11 +69,11 @@ static int x_error_handler(Display *disp, XErrorEvent *evt)
XGetErrorText(disp, evt->error_code, err_buf, sizeof(err_buf));
fprintf(stderr, "X Error: %s\n", err_buf);
- XGetErrorDatabaseText(disp, mtype, "MajorCode", "Request Major code %d",
+ XGetErrorDatabaseText(disp, mtype, "MajorCode", "Request Major code %d",
mesg, sizeof(mesg));
fprintf(stderr, mesg, evt->request_code);
sprintf(number, "%d", evt->request_code);
- XGetErrorDatabaseText(disp, "XRequest", number, "", err_buf,
+ XGetErrorDatabaseText(disp, "XRequest", number, "", err_buf,
sizeof(err_buf));
fprintf(stderr, " (%s)\n", err_buf);
abort();
@@ -86,23 +86,23 @@ static int x_error_handler(Display *disp, XErrorEvent *evt)
static int openwindow(char *disp, int constell, int samplesperbit)
{
- XSetWindowAttributes attr;
- XGCValues gr_values;
- XColor color, dummy;
- XSizeHints sizehints;
-
- if (!(display = XOpenDisplay(NULL)))
- return -1;
- XSetErrorHandler(x_error_handler);
- XAllocNamedColor(display, DefaultColormap(display, 0), "red",
- &color, &dummy);
+ XSetWindowAttributes attr;
+ XGCValues gr_values;
+ XColor color, dummy;
+ XSizeHints sizehints;
+
+ if (!(display = XOpenDisplay(NULL)))
+ return -1;
+ XSetErrorHandler(x_error_handler);
+ XAllocNamedColor(display, DefaultColormap(display, 0), "red",
+ &color, &dummy);
col_zeroline = color.pixel;
col_background = WhitePixel(display, 0);
col_trace = BlackPixel(display, 0);
- attr.background_pixel = col_background;
- if (!(window = XCreateWindow(display, XRootWindow(display, 0),
- 200, 200, WIDTH, HEIGHT, 5,
- DefaultDepth(display, 0),
+ attr.background_pixel = col_background;
+ if (!(window = XCreateWindow(display, XRootWindow(display, 0),
+ 200, 200, WIDTH, HEIGHT, 5,
+ DefaultDepth(display, 0),
InputOutput, DefaultVisual(display, 0),
CWBackPixel, &attr))) {
fprintf(stderr, "smdiag: unable to open X window\n");
@@ -113,28 +113,28 @@ static int openwindow(char *disp, int constell, int samplesperbit)
fprintf(stderr, "smdiag: unable to open offscreen pixmap\n");
exit(1);
}
- xmul = WIDTH / (2*(samplesperbit > 0 ? samplesperbit : 1));
- XSelectInput(display, window, KeyPressMask | StructureNotifyMask
+ xmul = WIDTH / (2*(samplesperbit > 0 ? samplesperbit : 1));
+ XSelectInput(display, window, KeyPressMask | StructureNotifyMask
| ExposureMask) ;
- XAllocNamedColor(display, DefaultColormap(display, 0), "red",
- &color, &dummy);
- gr_values.foreground = col_trace;
- gr_values.line_width = 1;
- gr_values.line_style = LineSolid;
- gr_context = XCreateGC(display, window, GCForeground | GCLineWidth |
- GCLineStyle, &gr_values);
- XStoreName(display, window, "diagnostics");
- /*
- * Do not allow the window to be resized
- */
- memset(&sizehints, 0, sizeof(sizehints));
- sizehints.min_width = sizehints.max_width = WIDTH;
- sizehints.min_height = sizehints.max_height = HEIGHT;
- sizehints.flags = PMinSize | PMaxSize;
- XSetWMNormalHints(display, window, &sizehints);
- XMapWindow(display, window);
- XSynchronize(display, 1);
- return 0;
+ XAllocNamedColor(display, DefaultColormap(display, 0), "red",
+ &color, &dummy);
+ gr_values.foreground = col_trace;
+ gr_values.line_width = 1;
+ gr_values.line_style = LineSolid;
+ gr_context = XCreateGC(display, window, GCForeground | GCLineWidth |
+ GCLineStyle, &gr_values);
+ XStoreName(display, window, "diagnostics");
+ /*
+ * Do not allow the window to be resized
+ */
+ memset(&sizehints, 0, sizeof(sizehints));
+ sizehints.min_width = sizehints.max_width = WIDTH;
+ sizehints.min_height = sizehints.max_height = HEIGHT;
+ sizehints.flags = PMinSize | PMaxSize;
+ XSetWMNormalHints(display, window, &sizehints);
+ XMapWindow(display, window);
+ XSynchronize(display, 1);
+ return 0;
}
#undef WIDTH
@@ -144,11 +144,11 @@ static int openwindow(char *disp, int constell, int samplesperbit)
static void closewindow(void)
{
- if (!display)
- return;
- XDestroyWindow(display, window);
- XCloseDisplay(display);
- display = NULL;
+ if (!display)
+ return;
+ XDestroyWindow(display, window);
+ XCloseDisplay(display);
+ display = NULL;
}
/* ---------------------------------------------------------------------- */
@@ -159,34 +159,34 @@ static void closewindow(void)
static void drawdata(short *data, int len, int replace, int xm)
{
int cnt;
- GC gc;
- XGCValues gcv;
- XWindowAttributes winattrs;
+ GC gc;
+ XGCValues gcv;
+ XWindowAttributes winattrs;
- if (!display || !pixmap)
- return;
- XGetWindowAttributes(display, window, &winattrs);
+ if (!display || !pixmap)
+ return;
+ XGetWindowAttributes(display, window, &winattrs);
gcv.line_width = 1;
- gcv.line_style = LineSolid;
- gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
- XSetState(display, gc, col_background, col_background, GXcopy,
+ gcv.line_style = LineSolid;
+ gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
+ XSetState(display, gc, col_background, col_background, GXcopy,
AllPlanes);
if (replace)
- XFillRectangle(display, pixmap, gc, 0, 0,
+ XFillRectangle(display, pixmap, gc, 0, 0,
winattrs.width, winattrs.height);
else
- XCopyArea(display, window, pixmap, gr_context, 0, 0,
+ XCopyArea(display, window, pixmap, gr_context, 0, 0,
winattrs.width, winattrs.height, 0, 0);
- XSetForeground(display, gc, col_trace);
+ XSetForeground(display, gc, col_trace);
for (cnt = 0; cnt < len-1; cnt++)
XDrawLine(display, pixmap, gc, XCOORD(cnt), YCOORD(data[cnt]),
XCOORD(cnt+1), YCOORD(data[cnt+1]));
- XSetForeground(display, gc, col_zeroline);
+ XSetForeground(display, gc, col_zeroline);
XDrawLine(display, pixmap, gc, 0, YCOORD(0), winattrs.width,
YCOORD(0));
XCopyArea(display, pixmap, window, gr_context, 0, 0, winattrs.width,
- winattrs.height, 0, 0);
- XFreeGC(display, gc);
+ winattrs.height, 0, 0);
+ XFreeGC(display, gc);
XSync(display, 0);
}
@@ -201,30 +201,30 @@ static void drawdata(short *data, int len, int replace, int xm)
static void drawconstell(short *data, int len)
{
int cnt;
- GC gc;
- XGCValues gcv;
- XWindowAttributes winattrs;
+ GC gc;
+ XGCValues gcv;
+ XWindowAttributes winattrs;
- if (!display || !pixmap)
- return;
- XGetWindowAttributes(display, window, &winattrs);
+ if (!display || !pixmap)
+ return;
+ XGetWindowAttributes(display, window, &winattrs);
gcv.line_width = 1;
- gcv.line_style = LineSolid;
- gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
- XSetState(display, gc, col_background, col_background, GXcopy,
+ gcv.line_style = LineSolid;
+ gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
+ XSetState(display, gc, col_background, col_background, GXcopy,
AllPlanes);
- XCopyArea(display, window, pixmap, gr_context, 0, 0,
+ XCopyArea(display, window, pixmap, gr_context, 0, 0,
winattrs.width, winattrs.height, 0, 0);
- XSetForeground(display, gc, col_trace);
+ XSetForeground(display, gc, col_trace);
for (cnt = 0; cnt < len-1; cnt += 2)
- XDrawPoint(display, pixmap, gc,
+ XDrawPoint(display, pixmap, gc,
XCOORD(data[cnt]), YCOORD(data[cnt+1]));
- XSetForeground(display, gc, col_zeroline);
+ XSetForeground(display, gc, col_zeroline);
XDrawLine(display, pixmap, gc, 0, YCOORD(0), winattrs.width, YCOORD(0));
XDrawLine(display, pixmap, gc, XCOORD(0), 0, XCOORD(0), winattrs.height);
XCopyArea(display, pixmap, window, gr_context, 0, 0, winattrs.width,
- winattrs.height, 0, 0);
- XFreeGC(display, gc);
+ winattrs.height, 0, 0);
+ XFreeGC(display, gc);
XSync(display, 0);
}
@@ -235,50 +235,50 @@ static void drawconstell(short *data, int len)
static void clearwindow(void)
{
- XWindowAttributes winattrs;
+ XWindowAttributes winattrs;
GC gc;
- XGCValues gcv;
+ XGCValues gcv;
- if (!display || !pixmap)
- return;
- XGetWindowAttributes(display, window, &winattrs);
+ if (!display || !pixmap)
+ return;
+ XGetWindowAttributes(display, window, &winattrs);
gcv.line_width = 1;
- gcv.line_style = LineSolid;
- gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
- XSetState(display, gc, col_background, col_background, GXcopy,
+ gcv.line_style = LineSolid;
+ gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
+ XSetState(display, gc, col_background, col_background, GXcopy,
AllPlanes);
- XFillRectangle(display, pixmap, gc, 0, 0,
+ XFillRectangle(display, pixmap, gc, 0, 0,
winattrs.width, winattrs.height);
- XSetForeground(display, gc, col_zeroline);
- XClearArea(display, window, 0, 0, 0, 0, False);
+ XSetForeground(display, gc, col_zeroline);
+ XClearArea(display, window, 0, 0, 0, 0, False);
XCopyArea(display, pixmap, window, gr_context, 0, 0, winattrs.width,
- winattrs.height, 0, 0);
- XFreeGC(display, gc);
+ winattrs.height, 0, 0);
+ XFreeGC(display, gc);
}
/* ---------------------------------------------------------------------- */
static Bool predicate(Display *display, XEvent *event, char *arg)
{
- return True;
+ return True;
}
/* ---------------------------------------------------------------------- */
static char *getkey(void)
{
- XWindowAttributes winattrs;
- XEvent evt;
- static char kbuf[32];
- int i;
+ XWindowAttributes winattrs;
+ XEvent evt;
+ static char kbuf[32];
+ int i;
- if (!display)
- return NULL;
+ if (!display)
+ return NULL;
XSync(display, 0);
- while (XCheckIfEvent(display, &evt, predicate, NULL)) {
+ while (XCheckIfEvent(display, &evt, predicate, NULL)) {
switch (evt.type) {
case KeyPress:
- i = XLookupString((XKeyEvent *)&evt, kbuf, sizeof(kbuf)-1,
+ i = XLookupString((XKeyEvent *)&evt, kbuf, sizeof(kbuf)-1,
NULL, NULL);
if (!i)
return NULL;
@@ -290,14 +290,14 @@ static char *getkey(void)
return NULL;
case Expose:
XGetWindowAttributes(display, window, &winattrs);
- XCopyArea(display, pixmap, window, gr_context, 0, 0,
+ XCopyArea(display, pixmap, window, gr_context, 0, 0,
winattrs.width, winattrs.height, 0, 0);
break;
default:
break;
}
- }
- return NULL;
+ }
+ return NULL;
}
/* ---------------------------------------------------------------------- */
@@ -311,7 +311,7 @@ static void printmode(unsigned int mode, unsigned int trigger)
/* ---------------------------------------------------------------------- */
-static const char *usage_str =
+static const char *usage_str =
"[-d display] [-i smif] [-c] [-e]\n"
" -d: display host\n"
" -i: specify the name of the baycom kernel driver interface\n"
diff --git a/hdlcutil/smmixer.c b/hdlcutil/smmixer.c
index 8adca7f..8efeac8 100644
--- a/hdlcutil/smmixer.c
+++ b/hdlcutil/smmixer.c
@@ -105,7 +105,7 @@ static void display_mixer_ad1848(void)
{
static const char *src[4] = { "Line", "Aux1", "Mic", "Dac" };
unsigned char data;
-
+
data = get_mixer_reg(0);
printf("Left input: Source: %-4s Gain: %3ddB\n", src[(data>>6)&3],
(((data & 0xe0) == 0xa0) ? 20 : 0) + (data & 0xf) * 3 / 2);
@@ -114,31 +114,31 @@ static void display_mixer_ad1848(void)
(((data & 0xe0) == 0xa0) ? 20 : 0) + (data & 0xf) * 3 / 2);
data = get_mixer_reg(2);
if (!(data & 0x80))
- printf("Left Aux1 mixing: Gain: %3ddB\n",
+ printf("Left Aux1 mixing: Gain: %3ddB\n",
(8 - (int)(data & 0x1f)) * 3 / 2);
data = get_mixer_reg(3);
if (!(data & 0x80))
- printf("Right Aux1 mixing: Gain: %3ddB\n",
+ printf("Right Aux1 mixing: Gain: %3ddB\n",
(8 - (int)(data & 0x1f)) * 3 / 2);
data = get_mixer_reg(4);
if (!(data & 0x80))
- printf("Left Aux2 mixing: Gain: %3ddB\n",
+ printf("Left Aux2 mixing: Gain: %3ddB\n",
(8 - (int)(data & 0x1f)) * 3 / 2);
data = get_mixer_reg(5);
if (!(data & 0x80))
- printf("Right Aux2 mixing: Gain: %3ddB\n",
+ printf("Right Aux2 mixing: Gain: %3ddB\n",
(8 - (int)(data & 0x1f)) * 3 / 2);
data = get_mixer_reg(6);
- if (data & 0x80)
+ if (data & 0x80)
printf("Left output: muted\n");
- else
- printf("Left output: Gain: %3ddB\n",
+ else
+ printf("Left output: Gain: %3ddB\n",
((int)(data & 0x3f)) * (-3) / 2);
data = get_mixer_reg(7);
- if (data & 0x80)
+ if (data & 0x80)
printf("Right output: muted\n");
- else
- printf("Right output: Gain: %3ddB\n",
+ else
+ printf("Right output: Gain: %3ddB\n",
((int)(data & 0x3f)) * (-3) / 2);
data = get_mixer_reg(13);
if (data & 1)
@@ -154,24 +154,24 @@ static void display_mixer_cs423x(void)
display_mixer_ad1848();
data = get_mixer_reg(26);
- printf("Mono: %s%s%s Gain: %3ddB\n",
+ printf("Mono: %s%s%s Gain: %3ddB\n",
(data & 0x80) ? "input muted, " : "",
(data & 0x40) ? "output muted, " : "",
(data & 0x20) ? "bypass, " : "",
(int)(data & 0xf) * (-3));
- data = get_mixer_reg(27);
- if (data & 0x80)
+ data = get_mixer_reg(27);
+ if (data & 0x80)
printf("Left output: muted\n");
- else
- printf("Left output: Gain: %3ddB\n",
+ else
+ printf("Left output: Gain: %3ddB\n",
((int)(data & 0xf)) * (-2));
data = get_mixer_reg(29);
- if (data & 0x80)
+ if (data & 0x80)
printf("Right output: muted\n");
- else
- printf("Right output: Gain: %3ddB\n",
+ else
+ printf("Right output: Gain: %3ddB\n",
((int)(data & 0xf)) * (-2));
-
+
}
/* ---------------------------------------------------------------------- */
@@ -179,73 +179,73 @@ static void display_mixer_cs423x(void)
static void display_mixer_ct1335(void)
{
unsigned char data;
-
+
data = get_mixer_reg(0x2);
- printf("Master volume: %3ddB\n",
+ printf("Master volume: %3ddB\n",
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
data = get_mixer_reg(0xa);
- printf("Voice volume: %3ddB\n",
+ printf("Voice volume: %3ddB\n",
(((int)((data >> 1) & 3)) - 3) * 46 / 3);
data = get_mixer_reg(0x6);
- printf("MIDI volume: %3ddB\n",
+ printf("MIDI volume: %3ddB\n",
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
data = get_mixer_reg(0x8);
- printf("CD volume: %3ddB\n",
+ printf("CD volume: %3ddB\n",
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
}
/* ---------------------------------------------------------------------- */
static void display_mixer_ct1345(void)
-{
+{
static const char *src[4] = { "Mic", "CD", "Mic", "Line" };
unsigned char data, data2;
-
+
data = get_mixer_reg(0xc);
data2 = get_mixer_reg(0xe);
printf("Input source: %s\n", src[(data >> 1) & 3]);
- if (!(data & data2 & 0x20)) {
- printf("Filter: Low pass %s kHz: ", (data & 0x8) ?
+ if (!(data & data2 & 0x20)) {
+ printf("Filter: Low pass %s kHz: ", (data & 0x8) ?
"8.8" : "3.2");
if (data & 0x20)
printf("output\n");
- else
+ else
printf("input%s\n", (data2 & 0x20) ? "" : ", output");
}
if (data2 & 2)
printf("stereo\n");
-
+
data = get_mixer_reg(0x22);
- printf("Master volume: Left: %3ddB Right: %3ddB\n",
+ printf("Master volume: Left: %3ddB Right: %3ddB\n",
(((int)((data >> 5) & 7)) - 7) * 46 / 7,
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
data = get_mixer_reg(0x4);
- printf("Voice volume: Left: %3ddB Right: %3ddB\n",
+ printf("Voice volume: Left: %3ddB Right: %3ddB\n",
(((int)((data >> 5) & 7)) - 7) * 46 / 7,
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
data = get_mixer_reg(0x26);
- printf("MIDI volume: Left: %3ddB Right: %3ddB\n",
+ printf("MIDI volume: Left: %3ddB Right: %3ddB\n",
(((int)((data >> 5) & 7)) - 7) * 46 / 7,
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
data = get_mixer_reg(0x28);
- printf("CD volume: Left: %3ddB Right: %3ddB\n",
+ printf("CD volume: Left: %3ddB Right: %3ddB\n",
(((int)((data >> 5) & 7)) - 7) * 46 / 7,
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
data = get_mixer_reg(0x2e);
- printf("Line volume: Left: %3ddB Right: %3ddB\n",
+ printf("Line volume: Left: %3ddB Right: %3ddB\n",
(((int)((data >> 5) & 7)) - 7) * 46 / 7,
(((int)((data >> 1) & 7)) - 7) * 46 / 7);
data = get_mixer_reg(0x0a);
- printf("Mic mixing volume: %3ddB\n",
+ printf("Mic mixing volume: %3ddB\n",
(((int)((data >> 1) & 3)) - 3) * 46 / 3);
}
/* ---------------------------------------------------------------------- */
static void display_mixer_ct1745(void)
-{
+{
unsigned char data, data2;
-
+
printf("Master volume: Left: %3ddB Right: %3ddB\n",
((int)((get_mixer_reg(0x30) >> 3) & 0x1f) - 31) * 2,
((int)((get_mixer_reg(0x31) >> 3) & 0x1f) - 31) * 2);
@@ -265,7 +265,7 @@ static void display_mixer_ct1745(void)
((int)((get_mixer_reg(0x3a) >> 3) & 0x1f) - 31) * 2);
printf("PC speaker volume: %3ddB\n",
((int)((get_mixer_reg(0x3b) >> 6) & 0x3) - 3) * 6);
- printf("Mic gain: %s\n",
+ printf("Mic gain: %s\n",
(get_mixer_reg(0x43) & 1) ? "fixed 20dB" : "AGC");
printf("Output gain: Left: %3ddB Right: %3ddB\n",
((int)((get_mixer_reg(0x41) >> 6) & 3)) * 6,
@@ -298,14 +298,14 @@ static void display_mixer_ct1745(void)
(data & 8) ? " Line.R" : "");
data = get_mixer_reg(0x3d);
printf("Input sources left: %s%s%s%s%s%s%s\n",
- (data & 1) ? " Mic" : "", (data & 2) ? " CD.R" : "",
- (data & 4) ? " CD.L" : "", (data & 8) ? " Line.R" : "",
+ (data & 1) ? " Mic" : "", (data & 2) ? " CD.R" : "",
+ (data & 4) ? " CD.L" : "", (data & 8) ? " Line.R" : "",
(data & 0x10) ? " Line.L" : "", (data & 0x20) ? " Midi.R" : "",
(data & 0x40) ? " Midi.L" : "");
data = get_mixer_reg(0x3e);
printf("Input sources right: %s%s%s%s%s%s%s\n",
- (data & 1) ? " Mic" : "", (data & 2) ? " CD.R" : "",
- (data & 4) ? " CD.L" : "", (data & 8) ? " Line.R" : "",
+ (data & 1) ? " Mic" : "", (data & 2) ? " CD.R" : "",
+ (data & 4) ? " CD.L" : "", (data & 8) ? " Line.R" : "",
(data & 0x10) ? " Line.L" : "", (data & 0x20) ? " Midi.R" : "",
(data & 0x40) ? " Midi.L" : "");
}
@@ -314,15 +314,15 @@ static void display_mixer_ct1745(void)
static int parse_ad_src(const char *cp)
{
- if (!strcasecmp(cp, "line"))
- return 0;
- if (!strcasecmp(cp, "aux1"))
- return 1;
- if (!strcasecmp(cp, "mic"))
- return 2;
- if (!strcasecmp(cp, "dac"))
- return 3;
- return -1;
+ if (!strcasecmp(cp, "line"))
+ return 0;
+ if (!strcasecmp(cp, "aux1"))
+ return 1;
+ if (!strcasecmp(cp, "mic"))
+ return 2;
+ if (!strcasecmp(cp, "dac"))
+ return 3;
+ return -1;
}
/* ---------------------------------------------------------------------- */
@@ -445,13 +445,13 @@ static int set_mixer_ad1848(int argc, char *argv[])
if (mask & 1) {
if (olvll < -95)
set_mixer_reg(0x06, 0x80);
- else
+ else
set_mixer_reg(0x06, (olvll * (-2) / 3));
}
if (mask & 2) {
if (olvlr < -95)
set_mixer_reg(0x07, 0x80);
- else
+ else
set_mixer_reg(0x07, (olvlr * (-2) / 3));
}
set_mixer_reg(0x0d, 0x00);
@@ -620,25 +620,25 @@ static int set_mixer_ct1745(int argc, char *argv[])
}
} else if (!strncasecmp(argv[0], "s=", 2)) {
mask |= 16;
- if (!strcasecmp(argv[0]+2, "mic"))
+ if (!strcasecmp(argv[0]+2, "mic"))
insrc |= 1;
- else if (!strcasecmp(argv[0]+2, "cd.r"))
+ else if (!strcasecmp(argv[0]+2, "cd.r"))
insrc |= 2;
- else if (!strcasecmp(argv[0]+2, "cd.l"))
+ else if (!strcasecmp(argv[0]+2, "cd.l"))
insrc |= 4;
- else if (!strcasecmp(argv[0]+2, "cd"))
+ else if (!strcasecmp(argv[0]+2, "cd"))
insrc |= 6;
- else if (!strcasecmp(argv[0]+2, "line.r"))
+ else if (!strcasecmp(argv[0]+2, "line.r"))
insrc |= 0x08;
- else if (!strcasecmp(argv[0]+2, "line.l"))
+ else if (!strcasecmp(argv[0]+2, "line.l"))
insrc |= 0x10;
- else if (!strcasecmp(argv[0]+2, "line"))
+ else if (!strcasecmp(argv[0]+2, "line"))
insrc |= 0x18;
- else if (!strcasecmp(argv[0]+2, "midi.r"))
+ else if (!strcasecmp(argv[0]+2, "midi.r"))
insrc |= 0x20;
- else if (!strcasecmp(argv[0]+2, "midi.l"))
+ else if (!strcasecmp(argv[0]+2, "midi.l"))
insrc |= 0x40;
- else if (!strcasecmp(argv[0]+2, "midi"))
+ else if (!strcasecmp(argv[0]+2, "midi"))
insrc |= 0x60;
else {
fprintf(stderr, "invalid input source, must "
@@ -715,7 +715,7 @@ static int set_mixer_ct1745(int argc, char *argv[])
/* ---------------------------------------------------------------------- */
-static const char *usage_str =
+static const char *usage_str =
"[-i smif]\n\n";
int main(int argc, char *argv[])
diff --git a/hdlcutil/soundmodem.9 b/hdlcutil/soundmodem.9
index c3faf9a..277e293 100644
--- a/hdlcutil/soundmodem.9
+++ b/hdlcutil/soundmodem.9
@@ -13,7 +13,7 @@ soundmodem \- amateur (AX.25) packet radio network driver for soundcards
.SH DESCRIPTION
The driver currently supports both 1200 baud AFSK and 9600 baud FSK
-(G3RUH compatible) using a standard SoundBlaster compatible or
+(G3RUH compatible) using a standard SoundBlaster compatible or
WindowsSoundSystem compatible soundcard. The whole decoding is done
in software, so you definitely do not want to use it on a 386SX class
machine.
@@ -59,7 +59,7 @@ mixer register.
.TP
.B SMCTL_SETMIXER
sets the specified mixer register, if the specified
-mixer type matches the mixer type of the soundcard. Only
+mixer type matches the mixer type of the soundcard. Only
superuser can do this.
.TP
.B SMCTL_DIAGNOSE
@@ -76,7 +76,3 @@ linux/drivers/net/hdlcdrv.c,
.SH AUTHOR
soundmodem was written by Thomas Sailer, HB9JNX/AE4WA, (t.sailer@alumni.ethz.ch).
-
-
-
-
diff --git a/hdlcutil/soundmodem.h b/hdlcutil/soundmodem.h
index 10d0799..3caa850 100644
--- a/hdlcutil/soundmodem.h
+++ b/hdlcutil/soundmodem.h
@@ -43,7 +43,7 @@ struct sm_ioctl {
int cmd;
union {
struct sm_config cfg;
- struct sm_diag_data diag;
+ struct sm_diag_data diag;
struct sm_mixer_data mix;
struct sm_debug_data dbg;
} data;
diff --git a/hdlcutil/usersmdiag.h b/hdlcutil/usersmdiag.h
index 0fe829d..e40f889 100644
--- a/hdlcutil/usersmdiag.h
+++ b/hdlcutil/usersmdiag.h
@@ -25,7 +25,7 @@
*/
/*****************************************************************************/
-
+
#ifndef _USERSMDIAG_H
#define _USERSMDIAG_H
@@ -85,7 +85,7 @@ struct usersmmsg {
int fulldup; /* some driver do not support full duplex, setting */
/* this just makes them send even if DCD is on */
} cp;
-
+
int calib;
struct usersm_channel_state {
@@ -97,7 +97,7 @@ struct usersmmsg {
unsigned long rx_packets;
unsigned long rx_errors;
} cs;
-
+
struct usersm_diag {
unsigned int mode;
unsigned int flags;