Added ISAR firmware support

This commit is contained in:
keil 1998-10-13 23:07:31 +00:00
parent e3a1cf85c0
commit 835bb26785
3 changed files with 68 additions and 15 deletions

BIN
teles/ISAR.BIN Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
.\" $Id: hisaxctrl.man.in,v 1.1 1997/10/23 22:43:24 fritz Exp $
.\" $Id: hisaxctrl.man.in,v 1.2 1998/10/13 23:07:33 keil Exp $
.\"
.\" CHECKIN $Date: 1997/10/23 22:43:24 $
.\" CHECKIN $Date: 1998/10/13 23:07:33 $
.\"
.\" Process this file with
.\" groff -man -Tascii hisaxctrl.1 for ASCII output, or
@ -8,14 +8,14 @@
.\"
.TH HISAXCTRL 8 "@MANDATE@" isdn4k-utils-@I4LVERSION@ "Linux System Administration"
.SH NAME
hisaxctrl \- configure HiSax-Module-logging
hisaxctrl \- configure HiSax-Module
.SH SYNOPSIS
.B hisaxctrl
.I DriverId DebugCmd DebugFlags
.I DriverId command parameters
.SH DESCRIPTION
.B hisaxctrl
is used to setup the logging-level of the HiSax-ISDN devicedriver. All
logging-output is sent to the device /dev/isdnctrl. So you can show it
is used to setup the HiSax-ISDN device driver.
All logging-output is sent to the device /dev/isdnctrl. So you can show it
by executing
.BR "cat /dev/isdnctrl" .
.LP
@ -34,11 +34,13 @@ the DriverId is set by appending
to the commandline.
.LP
.TP
.I DebugCmd
is an integer selecting the debug category. The following values are
defined:
.I command
is an integer selecting the setup category. The following values are
defined for setting the logging-level of the HiSax-ISDN device driver:
.LP
.RS
.BR " 0" " reports card status infos."
.br
.BR " 1" " selects generic debugging."
.br
.BR 11 " selects layer 1 developement debugging."
@ -46,11 +48,29 @@ defined:
.BR 13 " selects layer 3 developement debugging."
.br
.RE
.LP
the following commands are used to enable special features during runtime
of the HiSax-ISDN device driver.
.LP
.RS
.BR " 2" " set B-channel ON delay to parameter (in ms)"
.br
.BR " 5" " set B-channel in leased mode"
.br
.BR " 6" " set B-channel in TESTLOOP mode"
.br
.BR " 7" " set/reset card in Point To Point mode"
.br
.BR " 8" " set card in FIXED TEI mode "
.br
.BR " 9" " load firmware for DSP cards"
.br
.RE
.TP
.I DebugFlag
is an integer representing a bitmask. Every bit in this mask switches
a debug facility on or off. Depending on the selected category,
the following values are defined:
.I parameter
For debug setings this is an integer representing a bitmask. Every bit in
this mask switches a debug facility on or off. Depending on the selected
category, the following values are defined:
.LP
.RS
.RB With " generic debugging " selected:
@ -114,7 +134,7 @@ the following values are defined:
.BI hisaxctrl " HiSax 1 0x3ff"
enables full generic debugging.
.SH AUTHOR
\(co 1997 by Karten Keil <keil@temic-ech.spacenet.de>
\(co 1997 by Karsten Keil <keil@temic-ech.spacenet.de>
.LP
.SH SEE ALSO
.BR isdnctrl "(8), " telesctrl "(8), " isdn_cause "(7), " isdninfo (4).

View File

@ -8,6 +8,33 @@
#include <linux/isdn.h>
char *progname;
unsigned char *buffer = NULL;
#define MAX_SIZE 0x10000
unsigned char *
read_firmware(unsigned char *fname)
{
FILE *infile;
int *p, cnt;
if (!(infile = fopen(fname, "rb"))) {
fprintf(stderr, "cannot open file %s\n", fname);
exit(-1);
}
p = (int *) buffer = (unsigned char *) malloc(MAX_SIZE+4);
if (!buffer) {
fprintf(stderr, "cannot get %d byte memory\n", MAX_SIZE+4);
exit(-1);
}
cnt = fread(buffer + 4, 1, MAX_SIZE, infile);
fclose(infile);
if (cnt==MAX_SIZE) {
fprintf(stderr, "wrong filesize\n");
exit(-1);
}
*p = cnt;
return(buffer);
}
void
usage()
@ -32,8 +59,12 @@ main(int argc, char *argv[])
if (argc != 4)
usage();
strcpy(ioctl_s.drvid, argv[1]);
ioctl_s.arg = strtol(argv[3], NULL, 0);
cmd = strtol(argv[2], NULL, 0);
if (cmd == 9) {
ioctl_s.arg = (ulong) read_firmware(argv[3]);
} else {
ioctl_s.arg = strtol(argv[3], NULL, 0);
}
} else {
ioctl_s.drvid[0] = '\0';
ioctl_s.arg = 0;
@ -47,5 +78,7 @@ main(int argc, char *argv[])
if (ioctl(fd, IIOCDRVCTL + cmd, &ioctl_s) < 0)
perror(argv[1]);
close(fd);
if (buffer)
free(buffer);
return 0;
}