summaryrefslogtreecommitdiffstats
path: root/hdlcutil
diff options
context:
space:
mode:
Diffstat (limited to 'hdlcutil')
-rw-r--r--hdlcutil/Makefile.am2
-rw-r--r--hdlcutil/baycom.96
-rw-r--r--hdlcutil/fl/xfhdlcchpar_main.cxx4
-rw-r--r--hdlcutil/fl/xfhdlcst_main.cxx8
-rw-r--r--hdlcutil/fl/xfsmdiag_main.cxx18
-rw-r--r--hdlcutil/fl/xfsmmixer_main.cxx20
-rw-r--r--hdlcutil/hdlcdrv.96
-rw-r--r--hdlcutil/hdrvcomm.c50
-rw-r--r--hdlcutil/sethdlc.816
-rw-r--r--hdlcutil/sethdlc.c116
-rw-r--r--hdlcutil/smdiag.82
-rw-r--r--hdlcutil/smdiag.c42
-rw-r--r--hdlcutil/smmixer.c112
-rw-r--r--hdlcutil/soundmodem.94
-rw-r--r--hdlcutil/soundmodem.h2
-rw-r--r--hdlcutil/usersmdiag.h6
16 files changed, 207 insertions, 207 deletions
diff --git a/hdlcutil/Makefile.am b/hdlcutil/Makefile.am
index 24c25af..fd94b2a 100644
--- a/hdlcutil/Makefile.am
+++ b/hdlcutil/Makefile.am
@@ -14,7 +14,7 @@ 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/
diff --git a/hdlcutil/baycom.9 b/hdlcutil/baycom.9
index ad87253..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
diff --git a/hdlcutil/fl/xfhdlcchpar_main.cxx b/hdlcutil/fl/xfhdlcchpar_main.cxx
index 8ebee3d..7078d36 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";
diff --git a/hdlcutil/fl/xfhdlcst_main.cxx b/hdlcutil/fl/xfhdlcst_main.cxx
index a17e546..4542fe1 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";
@@ -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_main.cxx b/hdlcutil/fl/xfsmdiag_main.cxx
index 695d98f..1fd0dd8 100644
--- a/hdlcutil/fl/xfsmdiag_main.cxx
+++ b/hdlcutil/fl/xfsmdiag_main.cxx
@@ -58,7 +58,7 @@ static unsigned int drawflags = 0;
/* ---------------------------------------------------------------------- */
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;
@@ -205,8 +205,8 @@ void scope::drawdata(short data[], int len, int xm)
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;
@@ -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";
@@ -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_main.cxx b/hdlcutil/fl/xfsmmixer_main.cxx
index 5569e7c..83774a0 100644
--- a/hdlcutil/fl/xfsmmixer_main.cxx
+++ b/hdlcutil/fl/xfsmmixer_main.cxx
@@ -52,7 +52,7 @@ static int do_mix_ioctl(int cmd, struct sm_mixer_data *mixdat)
{
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";
@@ -312,7 +312,7 @@ int main(int argc, char *argv[])
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 6ec7be2..31b0e7e 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
@@ -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"
diff --git a/hdlcutil/hdrvcomm.c b/hdlcutil/hdrvcomm.c
index 6b4335e..9f387ee 100644
--- a/hdlcutil/hdrvcomm.c
+++ b/hdlcutil/hdrvcomm.c
@@ -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/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..faa4765 100644
--- a/hdlcutil/sethdlc.c
+++ b/hdlcutil/sethdlc.c
@@ -52,14 +52,14 @@ 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,7 +215,7 @@ static void print_bits(int (*bitproc)(void))
int i;
char str[9];
char *cp;
-
+
for(;;) {
ret = bitproc();
if (ret < 0) {
@@ -226,7 +226,7 @@ static void print_bits(int (*bitproc)(void))
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 f1c5478..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.
diff --git a/hdlcutil/smdiag.c b/hdlcutil/smdiag.c
index e9b615d..7dd9a00 100644
--- a/hdlcutil/smdiag.c
+++ b/hdlcutil/smdiag.c
@@ -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();
@@ -100,9 +100,9 @@ static int openwindow(char *disp, int constell, int samplesperbit)
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),
+ 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");
@@ -161,7 +161,7 @@ static void drawdata(short *data, int len, int replace, int xm)
int cnt;
GC gc;
XGCValues gcv;
- XWindowAttributes winattrs;
+ XWindowAttributes winattrs;
if (!display || !pixmap)
return;
@@ -169,13 +169,13 @@ static void drawdata(short *data, int len, int replace, int xm)
gcv.line_width = 1;
gcv.line_style = LineSolid;
gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
- XSetState(display, gc, col_background, col_background, GXcopy,
+ 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);
for (cnt = 0; cnt < len-1; cnt++)
@@ -203,7 +203,7 @@ static void drawconstell(short *data, int len)
int cnt;
GC gc;
XGCValues gcv;
- XWindowAttributes winattrs;
+ XWindowAttributes winattrs;
if (!display || !pixmap)
return;
@@ -211,13 +211,13 @@ static void drawconstell(short *data, int len)
gcv.line_width = 1;
gcv.line_style = LineSolid;
gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
- XSetState(display, gc, col_background, col_background, GXcopy,
+ 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);
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);
XDrawLine(display, pixmap, gc, 0, YCOORD(0), winattrs.width, YCOORD(0));
@@ -235,7 +235,7 @@ static void drawconstell(short *data, int len)
static void clearwindow(void)
{
- XWindowAttributes winattrs;
+ XWindowAttributes winattrs;
GC gc;
XGCValues gcv;
@@ -245,15 +245,15 @@ static void clearwindow(void)
gcv.line_width = 1;
gcv.line_style = LineSolid;
gc = XCreateGC(display, pixmap, GCLineWidth | GCLineStyle, &gcv);
- XSetState(display, gc, col_background, col_background, GXcopy,
+ 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);
XCopyArea(display, pixmap, window, gr_context, 0, 0, winattrs.width,
winattrs.height, 0, 0);
- XFreeGC(display, gc);
+ XFreeGC(display, gc);
}
/* ---------------------------------------------------------------------- */
@@ -267,7 +267,7 @@ static Bool predicate(Display *display, XEvent *event, char *arg)
static char *getkey(void)
{
- XWindowAttributes winattrs;
+ XWindowAttributes winattrs;
XEvent evt;
static char kbuf[32];
int i;
@@ -278,7 +278,7 @@ static char *getkey(void)
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,7 +290,7 @@ 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:
@@ -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..473b3a6 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)
+ 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" : "");
}
@@ -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 cbf6159..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
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;