summaryrefslogtreecommitdiffstats
path: root/yamdrv
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-06-05 00:57:38 +0200
committerRalf Baechle <ralf@linux-mips.org>2013-06-17 17:11:30 +0200
commit1245fbd2a8d60bab7b16b8a1d3c0122fee72f53f (patch)
tree6dcf938b1472a9b5cac35648ffb0f3d185c39590 /yamdrv
parent0b4425760be1f92a1f25daeb5d3dc91814a98622 (diff)
Nuke trailing whitespace.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'yamdrv')
-rw-r--r--yamdrv/README.yamdrv52
-rw-r--r--yamdrv/mcs2h.c30
2 files changed, 41 insertions, 41 deletions
diff --git a/yamdrv/README.yamdrv b/yamdrv/README.yamdrv
index f76ac10..280a3ce 100644
--- a/yamdrv/README.yamdrv
+++ b/yamdrv/README.yamdrv
@@ -11,23 +11,23 @@ yam3 default to COM4 0x3e8 irq3
----------
Added : bitrate/baudrate configuration.
-Added : mcs file may be loaded from yamcfg.
+Added : mcs file may be loaded from yamcfg.
One mcs file is affected to each bitrate.
-
+
mcs data for 1200 and 9600 bds are preloaded in the driver
but may be changed by yamcfg.
options of yamcfg :
- [iobase <iobase>]
- [irq <irq>]
- [bitrate <bitrate>]
+ [iobase <iobase>]
+ [irq <irq>]
+ [bitrate <bitrate>]
[baudrate <baudrate>]
- [duplex <mode>]
- [hold <delay>]
+ [duplex <mode>]
+ [hold <delay>]
[txdelay <txdelay>]
- [txtail <txtail>]
- [slottime <slottime>]
+ [txtail <txtail>]
+ [slottime <slottime>]
[persist <persistence>]
[load <bitrate> <filename.mcs>]
@@ -52,26 +52,26 @@ The program yamcfg get or set the parameters of the yam driver
yamcfg -h gives a minimum help
Example setup of yam0 for 1 serial port (com2) :
-
+
file /etc/ax25/axports :
- port0 F1OAT-9 9600 256 2 VHF (9600 bit/s)
+ port0 F1OAT-9 9600 256 2 VHF (9600 bit/s)
commands :
setserial /dev/cua0 port 0 # to avoid conflict with yam driver
insmod yam
yamcfg yam0 io 0x2f8 irq 3
- ifconfig yam0 hw ax25 f1oat-9 up
-
-
+ ifconfig yam0 hw ax25 f1oat-9 up
+
+
Example setup of yam0,3 for 4 serial port (com1->com4) :
-
+
file /etc/ax25/axports :
- port0 F1OAT-9 9600 256 2 VHF (9600 bit/s)
- port1 F1OAT-8 9600 256 2 UHF1 (9600 bit/s)
- port2 F1OAT-7 9600 256 2 UHF2 (9600 bit/s)
- port3 F1OAT-8 9600 256 2 UHF3 (9600 bit/s)
-
+ port0 F1OAT-9 9600 256 2 VHF (9600 bit/s)
+ port1 F1OAT-8 9600 256 2 UHF1 (9600 bit/s)
+ port2 F1OAT-7 9600 256 2 UHF2 (9600 bit/s)
+ port3 F1OAT-8 9600 256 2 UHF3 (9600 bit/s)
+
commands :
setserial /dev/cua0 port 0 # to avoid conflict with yam driver
setserial /dev/cua1 port 0 # to avoid conflict with yam driver
@@ -80,13 +80,13 @@ Example setup of yam0,3 for 4 serial port (com1->com4) :
insmod yam
yamcfg yam2 irq 5
yamcfg yam3 irq 7
- ifconfig yam0 hw ax25 f1oat-9 up
- ifconfig yam1 hw ax25 f1oat-8 up
- ifconfig yam2 hw ax25 f1oat-7 up
- ifconfig yam3 hw ax25 f1oat-6 up
-
+ ifconfig yam0 hw ax25 f1oat-9 up
+ ifconfig yam1 hw ax25 f1oat-8 up
+ ifconfig yam2 hw ax25 f1oat-7 up
+ ifconfig yam3 hw ax25 f1oat-6 up
+
+
-
Good test !!!
73's Frederic F1OAT and Jean-Paul F6FBB
diff --git a/yamdrv/mcs2h.c b/yamdrv/mcs2h.c
index 6914965..bf1ae72 100644
--- a/yamdrv/mcs2h.c
+++ b/yamdrv/mcs2h.c
@@ -6,12 +6,12 @@ int in2hex(char *ptr)
{
char str[3];
int val;
-
+
memcpy(str, ptr, 2);
str[2] = '\0';
-
+
sscanf(str, "%x", &val);
-
+
return val;
}
@@ -19,7 +19,7 @@ unsigned char swap(unsigned char c)
{
unsigned char r = 0;
int i;
-
+
for (i = 0 ; i < 8 ; i++)
{
r <<= 1;
@@ -34,12 +34,12 @@ int in4hex(char *ptr)
{
char str[5];
int val;
-
+
memcpy(str, ptr, 4);
str[4] = '\0';
-
+
sscanf(str, "%x", &val);
-
+
return val;
}
@@ -50,22 +50,22 @@ int main(int ac, char *av[])
time_t temps;
FILE *fptr;
char buf[256];
-
+
if (ac != 3)
{
fprintf(stderr, "format : mcs2h 1200|9600 filename\n");
return 1;
}
-
+
fptr = fopen(av[2], "r");
if (fptr == NULL)
{
fprintf(stderr, "file %s not found\n", av[2]);
return 1;
}
-
+
time(&temps);
-
+
printf( "/*\n"
" *\n"
" * File %s converted to h format by mcs2h\n"
@@ -84,10 +84,10 @@ int main(int ac, char *av[])
nb = in2hex(buf+1);
add = in4hex(buf+3);
type = in2hex(buf+7);
-
+
if (type != 0)
continue;
-
+
if (first)
first = 0;
else
@@ -98,9 +98,9 @@ int main(int ac, char *av[])
printf("0x%02x%s", swap(in2hex(buf+9+i*2)), (i < (nb-1)) ? "," : "");
}
}
-
+
printf(" };\n");
-
+
fclose(fptr);
return 0;
}