- initial import

This commit is contained in:
Fritz Elfert 2002-08-19 05:50:13 +00:00
commit fb3b2eb440
219 changed files with 52246 additions and 0 deletions

39
contacts.shtml Normal file
View File

@ -0,0 +1,39 @@
<HTML>
<HEAD><TITLE>Contact developers</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
<CENTER>
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<!--#set var="alt" value="Contact developers" -->
<TD VALIGN=MIDDLE ALIGN=CENTER><IMG SRC="/pics/contacts_hdr.gif" BORDER=0 <!--#include virtual="/ssi/calt.shtml" -->></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_mail.shtml" --></TD>
</TR>
<TR><TD ALIGN=CENTER COLSPAN=3><!--#include virtual="/ssi/rule.shtml" --></TD>
</TR>
</TABLE><P>
The following eMail addresses are available for contacting authors:<P>
<TABLE>
<TR><TD><A HREF="mailto:keil@isdn4linux.de">keil@isdn4linux.de</A><BR>
General maintainer, author of HiSax.</TD></TR>
<TR><TD><A HREF="mailto:fritz@isdn4linux.de">fritz@isdn4linux.de</A><BR>
Author of linklevel, icn, act2000,<BR>list-maintainer, webmaster.</TD></TR>
<TR><TD><A HREF="mailto:vbox@isdn4linux.de">vbox@isdn4linux.de</A><BR>
Role-account, author of vbox answering machine.</TD></TR>
<TR><TD><A HREF="mailto:akool@isdn4linux.de">akool@isdn4linux.de</A><BR>
Author of isdnlog.</TD></TR>
<TR><TD><A HREF="mailto:paul@isdn4linux.de">paul@isdn4linux.de</A><BR>
Debian Maintainer, misc. utility stuff.</TD></TR>
<TR><TD><A HREF="mailto:faq@isdn4linux.de">faq@isdn4linux.de</A><BR>
Maintainers of english FAQ.</TD></TR>
<TR><TD><A HREF="mailto:i4lfaq-de@isdn4linux.de">i4lfaq-de@isdn4linux.de</A><BR>
Maintainer of german FAQ.</TD></TR>
</TABLE>
</CENTER>
<P>
<!--#include virtual="/ssi/i4lfooter.shtml" -->
</BODY>
</HTML>

33
download.shtml Normal file
View File

@ -0,0 +1,33 @@
<HTML>
<HEAD><TITLE>Download</TITLE></HEAD>
<BODY BGCOLOR="#ffffff">
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
<CENTER>
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<!--#set var="alt" value="Download" -->
<TD VALIGN=MIDDLE ALIGN=CENTER><IMG SRC="pics/download_hdr.gif" WIDTH=255 HEIGTH=48 BORDER=0 <!--#include virtual="/ssi/calt.shtml" -->></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_mail.shtml" --></TD>
</TR>
<TR><TD ALIGN=CENTER COLSPAN=3><!--#include virtual="/ssi/rule.shtml" --></TD>
</TR>
</TABLE>
<TABLE WITH="70%">
<TR><TD>You can get latest Utility package from the following sites:</TD></TR>
<TR><TD><A HREF="ftp://ftp.isdn4linux.de/pub/isdn4linux/">ftp.isdn4linux.de</A></TD></TR>
<TR><TD><A HREF="ftp://ftp.gwdg.de:/pub/linux/isdn/isdn4linux/">ftp.gwdg.de</A></TD></TR>
<TR><TD><A HREF="ftp://ftp.cs.tu-berlin.de/pub/net/isdn/isdn4linux/">ftp.cs.tu-berlin.de</A></TD></TR>
<TR><TD><A HREF="ftp://ftp.leo.org/pub/comp/os/unix/linux/isdn/isdn4linux/">ftp.leo.org</A></TD></TR>
<TR><TD><A HREF="ftp://linux.mathematik.tu-darmstadt.de/pub/linux/mirrors/misc/isdn4linux/">linux.mathematik.tu-darmstadt.de</A></TD></TR>
<TR><TD><A HREF="ftp://ftp.nvg.unit.no/pub/linux/isdn/">ftp.nvg.unit.no</A></TD></TR>
<TR><TD><A HREF="ftp://ftp.pop.de/pub/linux/isdn4linux/">ftp.pop.de</A></TD></TR>
<TR><TD><A HREF="ftp://ftp.xlink.net/pub/mirror.ftp.franken.de/isdn4linux/">ftp.xlink.net</A></TD></TR>
<TR><TD>Snapshots of the CVS development tree are available at:</TD></TR>
<TR><TD><A HREF="ftp://ftp.suse.com/pub/isdn4linux/">ftp.suse.com</A></TD></TR>
</TABLE>
</CENTER>
<!--#include virtual="/ssi/i4lfooter.shtml" -->
</BODY>
</HTML>

3
faq/README Normal file
View File

@ -0,0 +1,3 @@
This directory will not be updated from this CVS repository.
To create the FAQ, commit changes to the FAQ subdir of the
repository isdn4k-utils.

112
index.shtml Normal file
View File

@ -0,0 +1,112 @@
<HTML>
<HEAD><TITLE>ISDN4Linux</TITLE></HEAD>
<META name="description" content="Official ISDN4Linux Homepage">
<META name="keywords" content="isdn4linux, ISDN, Linux, ISDN with Linux, Mailinglist, list archive, download">
<BODY BGCOLOR="#ffffff">
<!--#include virtual="/ssi/js.shtml" -->
<!--#set var="picnam" value="cvs" -->
<!--#set var="picstr" value="ISDN4Linux CVS Access" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<!--#set var="picnam" value="faq" -->
<!--#set var="picstr" value="The ISDN4Linux FAQ" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<!--#set var="picnam" value="listarch" -->
<!--#set var="picstr" value="Mailinglist Archive" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<!--#set var="picnam" value="devmeet" -->
<!--#set var="picstr" value="About the Developer Meeting 1998" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<!--#set var="picnam" value="links" -->
<!--#set var="picstr" value="A small collection of ISDN related links" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<!--#set var="picnam" value="workshop" -->
<!--#set var="picstr" value="ISDN workshop at Linux Congress 98" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<!--#set var="picnam" value="contacts" -->
<!--#set var="picvar" value="_pics_contacts_gif" -->
<!--#set var="picstr" value="Contact authors" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<!--#set var="picnam" value="download" -->
<!--#set var="picstr" value="Download software" -->
<!--#include virtual="/ssi/jbdef.shtml" -->
<CENTER>
<TABLE>
<TR><TD COLSPAN="3" HEIGHT=20> </TD></TR
><!--#set var="alt" value="ISDN 4 Linux" --><TR><TD><IMG
SRC="/pics/ISDN.gif" WIDTH=188 HEIGHT=60
<!--#include virtual="/ssi/calt.shtml" -->></TD><TD> </TD><TD> </TD></TR>
<TR><TD COLSPAN="3" HEIGHT=20> </TD></TR>
<TR><TD></TD><TD
><!--#set var="alt" value="" --><IMG
SRC="/pics/4.gif" WIDTH=47 HEIGHT=58
<!--#include virtual="/ssi/calt.shtml" -->></TD><TD> </TD></TR>
<TR><TD COLSPAN="3" HEIGHT=20> </TD></TR>
<TR><TD>
<TABLE>
<TR><TD
><!--#set var="href" value="workshop/" -->
<!--#set var="picnam" value="workshop" -->
<!--#set var="alt" value="ISDN workshop at Linux Congress 98" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=222 HEIGHT=34></A></TD></TR
><!--
<!--#set var="href" value="devmeeting/" -->
<!--#set var="picnam" value="devmeet" -->
<!--#set var="alt" value="2. Developer Meeting" -->
<TR><TD><!--#include virtual="/ssi/jbref.shtml" --> WIDTH=242 HEIGHT=34></A><BR CLEAR="ALL">March 6 - 8, 1998 in W&uuml;rzburg</TD></TR>
--><TR><TD
><!--#set var="href" value="listarch/" -->
<!--#set var="picnam" value="listarch" -->
<!--#set var="alt" value="Mailinglist Archive" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=136 HEIGHT=34></A></TD></TR
><TR><TD
><!--#set var="href" value="faq/" -->
<!--#set var="picnam" value="faq" -->
<!--#set var="alt" value="FAQ" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=56 HEIGHT=32></A></TD></TR
><TR><TD
><!--#set var="href" value="/cgi-bin/cvsweb.cgi" -->
<!--#set var="picnam" value="cvs" -->
<!--#set var="alt" value="CVS" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=52 HEIGHT=28></A></TD></TR
><!--
<TR><TD
><!--#set var="href" value="leafsite/" -->
<!--#set var="picnam" value="leafsite" -->
<!--#set var="alt" value="Leafsite FAQ" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=145 HEIGHT=32></A></TD></TR
>
-->
<TR><TD
><!--#set var="href" value="download.shtml" -->
<!--#set var="picnam" value="download" -->
<!--#set var="alt" value="Download software" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=122 HEIGHT=29></A></TD></TR
><TR><TD
><!--#set var="href" value="contacts.shtml" -->
<!--#set var="picnam" value="contacts" -->
<!--#set var="alt" value="Contact authors" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=105 HEIGHT=28></A></TD></TR
><TR><TD
><!--#set var="href" value="links.shtml" -->
<!--#set var="picnam" value="links" -->
<!--#set var="alt" value="ISDN related links" -->
<!--#include virtual="/ssi/jbref.shtml" --> WIDTH=67 HEIGHT=29></A></TD></TR
></TABLE></TD><TD> </TD><TD VALIGN="TOP"
><!--#set var="alt" value="" --><IMG
SRC="/pics/penguin-t.gif" WIDTH=128 HEIGHT=150
<!--#include virtual="/ssi/calt.shtml" -->></TD></TR>
<TR><TD COLSPAN="3" HEIGHT=20> </TD></TR>
</TABLE>
</CENTER>
<!--#include virtual="/ssi/i4lfooter.shtml" -->
</BODY>
</HTML>

45
links.shtml Normal file
View File

@ -0,0 +1,45 @@
<HTML>
<HEAD><TITLE>ISDN-related links</TITLE></HEAD>
<BODY BGCOLOR="#ffffff">
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
<CENTER>
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<!--#set var="alt" value="ISDN related links" -->
<TD VALIGN=MIDDLE ALIGN=CENTER><IMG SRC="pics/linkshdr.gif" WIDTH=320 BORDER=0
<!--#include virtual="/ssi/calt.shtml" -->></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_mail.shtml" --></TD>
</TR>
<TR><TD ALIGN=CENTER COLSPAN=3><!--#include virtual="/ssi/rule.shtml" --></TD>
</TR>
</TABLE>
<TABLE>
<TR><TD><A HREF="http://www.linux-france.org/article/connex/ISDN">ISDN4Linux in France.</A></TD></TR>
<TR><TD><A HREF="http://www.franken.de/users/klaus/">The ISDN4Linux HOWTO by Klaus Franken.</A></TD></TR>
<TR><TD><A HREF="http://www.bjoern.net/vbox2www/">The Vbox2WWW Homepage.</A></TD></TR>
<TR><TD><A HREF="http://w1.2667.telia.com/~u266700740/linux/i4lfax/index.html">Homepage of the i4lfax project.</A></TD></TR>
<TR><TD><A HREF="http://www.digitalprojects.com/rates">Tarif-Datenbank f&uuml;r isdnlog.</A></TD></TR>
<TR><TD><A HREF="http://www-ti.informatik.uni-tuebingen.de/~hippm/isdn.html">Michael Hipp's ISDN stuff.</A></TD></TR>
<TR><TD><A HREF="http://jw.nttam.com/OLD/ST/ISDN/isdn_intro.html">Japanese ISDN specification.</A></TD></TR>
<TR><TD><A HREF="http://www.uni-mannheim.de/rum/netze/isdn/">ISDN-page at Mannheim university.</A></TD></TR>
<TR><TD><A HREF="http://www.weinheim.de/isdn/index.html">I4L page at www.weinheim.de.</A></TD></TR>
<TR><TD><A HREF="http://www.lrz.de/~isdn/traces.htm">Interesting D-Channel traces.</A></TD></TR>
<TR><TD><A HREF="http://www.rosat.mpe-garching.mpg.de/~web/ISDN.html">A collection of I4L configurations.</A></TD></TR>
<TR><TD><A HREF="http://www.provi.de/~gvz/chargeint.html">The ChargeInt Homepage.</A></TD></TR>
<TR><TD><A HREF="http://www.isdn4linux.de/leafsite/">The original I4L FAQ.</A></TD></TR>
<TR><TD><A HREF="http://alumni.caltech.edu/~dank/isdn/">The first of all ISDN pages - Dan Kegel's collection.</A></TD></TR>
<TR><TD><A HREF="http://www.avm.de/">Manufacturer of ISDN-Cards: AVM</A></TD></TR>
<TR><TD><A HREF="http://www.creatix.de/">Manufacturer of ISDN-Cards: Creatix</A></TD></TR>
<TR><TD><A HREF="http://www.eicon.de/">Manufacturer of ISDN-Cards: Eicon Diehl</A></TD></TR>
<TR><TD><A HREF="http://www.elsa.de/">Manufacturer of ISDN-Cards: Elsa</A></TD></TR>
<TR><TD><A HREF="http://www.itk.de/">Manufacturer of ISDN-Cards: ITK</A></TD></TR>
<TR><TD><A HREF="http://www.spellcast.com/">Manufacturer of ISDN-Cards: Spellcaster</A></TD></TR>
<TR><TD><A HREF="http://www.teles.de/">Manufacturer of ISDN-Cards: Teles</A></TD></TR>
<TR><TD><A HREF="http://www.3com.com/products/isdn.html">Manufacturer of ISDN-Cards: 3com (former US Robotics)</A></TD></TR>
</TABLE>
</CENTER>
<!--#include virtual="/ssi/i4lfooter.shtml" -->
</BODY>
</HTML>

27
listarch/index.shtml Normal file
View File

@ -0,0 +1,27 @@
<HTML>
<HEAD><TITLE>ISDN4Linux Mailinglists</TITLE></HEAD>
<BODY BGCOLOR="#ffffff">
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
<CENTER>
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<!--#set var="alt" value="ISDN4Linux Mailinglists" -->
<TD VALIGN=MIDDLE ALIGN=CENTER><IMG SRC="/pics/listarch_hdr.gif" WIDTH=320 BORDER=0 <!--#include virtual="/ssi/calt.shtml" -->></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_mail.shtml" --></TD>
</TR>
<TR><TD ALIGN=CENTER COLSPAN=3><!--#include virtual="/ssi/rule.shtml" --></TD>
</TR>
</TABLE>
<TABLE WIDTH=60%>
<TR><TD>
This is the complete Archive of the ISDN4Linux Mailinglist at listserv.isdn4linux.de.
This mailinglist is bidirectionally gated with the newsgroup de.alt.comm.isdn4linux.<BR>
Note: Thread- and date-views are <STRONG>reverse</STRONG> sorted (<I>i.e. most recent message first</I>).
</TD></TR></TABLE>
<!--#include virtual="/cgi-bin/mlindex.cgi?list=isdn4linux" -->
</CENTER>
<!--#include virtual="/ssi/i4lfooter.shtml" -->
</BODY>
</HTML>

View File

@ -0,0 +1,2 @@
This directory will not be updated from this CVS repository.
The mail archive is always updated automatically.

179
listarch/s1.html Normal file
View File

@ -0,0 +1,179 @@
<HTML>
<HEAD>
<title>Search by subdirectory on archive ISDN4Linux Mailinglist </title>
</head>
<body><center>
<FORM method=post ACTION="/cgi-bin/webglimpse.cgi">
<table border><tr><td>
<table>
<tr><td align=center valign=middle>
<a href="http://webglimpse.net" target="_blank"><img src="/cgi-bin/showimg.cgi" border=0 alt="Webglimpse Logo" align=middle height=34 width=60></A>
</td>
<td align=center valign=middle>
<font size=+3>
<a href="http://webglimpse.net" target="_blank">WebGlimpse</a>
Search<br></font>
</td>
</tr>
<!-- Admins - local copy pointers have been eliminated in v1.6. If this bothers you, e-mail gberns@tucson.com -->
<tr><td colspan=2 align=center>
<INPUT TYPE=HIDDEN NAME="ID" VALUE="1">
Search archive ISDN4Linux Mailinglist by directory
</td></tr>
<tr><td>
String to search for:</td><td><INPUT NAME=query size=30>
<INPUT TYPE=submit VALUE=Submit>
</td></tr>
<tr><td>
Search Directory:</td><td><SELECT NAME="filter">
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux">All
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995">1995
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995/06">1995/06
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995/07">1995/07
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995/08">1995/08
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995/09">1995/09
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995/10">1995/10
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995/11">1995/11
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1995/12">1995/12
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996">1996
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/01">1996/01
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/02">1996/02
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/03">1996/03
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/04">1996/04
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/05">1996/05
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/06">1996/06
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/07">1996/07
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/08">1996/08
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/09">1996/09
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/10">1996/10
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/11">1996/11
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1996/12">1996/12
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997">1997
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/01">1997/01
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/02">1997/02
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/03">1997/03
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/04">1997/04
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/05">1997/05
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/06">1997/06
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/07">1997/07
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/08">1997/08
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/09">1997/09
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/10">1997/10
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/11">1997/11
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1997/12">1997/12
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998">1998
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/01">1998/01
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/02">1998/02
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/03">1998/03
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/04">1998/04
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/05">1998/05
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/06">1998/06
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/07">1998/07
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/08">1998/08
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/09">1998/09
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/10">1998/10
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/11">1998/11
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1998/12">1998/12
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999">1999
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/01">1999/01
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/02">1999/02
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/03">1999/03
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/04">1999/04
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/05">1999/05
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/06">1999/06
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/07">1999/07
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/08">1999/08
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/09">1999/09
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/10">1999/10
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/11">1999/11
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/1999/12">1999/12
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000">2000
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/01">2000/01
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/02">2000/02
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/03">2000/03
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/04">2000/04
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/05">2000/05
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/06">2000/06
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/07">2000/07
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/08">2000/08
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/09">2000/09
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/10">2000/10
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/11">2000/11
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2000/12">2000/12
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001">2001
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001/01">2001/01
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001/02">2001/02
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001/03">2001/03
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001/04">2001/04
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001/05">2001/05
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001/06">2001/06
<OPTION VALUE="^/home/httpd/html/www.isdn4linux.de/htdocs/listarch/isdn4linux/2001/07">2001/07
</SELECT>
</td></tr>
<tr><td colspan=2 align=center>
<INPUT NAME=case TYPE=checkbox>Case&#160;sensitive
<!-- SPACES -->&#160;&#160;&#160;
<INPUT NAME=whole TYPE=checkbox>Partial&#160;match
<!-- SPACES -->&#160;&#160;&#160;
<INPUT NAME=lines TYPE=checkbox>Jump&#160;to&#160;line
</td></tr>
</table>
<table>
<tr><td>
Misspellings&#160;allowed:
</td><td><SELECT NAME=errors>
<OPTION>0
<OPTION>1
<OPTION>2
</SELECT>
</td></tr>
<tr><td>
Return only files modified within the last
</td><td><INPUT NAME=age size=5 VALUE="60">
days.
</td></tr>
<tr><td>Maximum number of files returned:
</td><td><SELECT NAME=maxfiles>
<OPTION>10
<OPTION selected>50
<OPTION>100
<OPTION>1000
</SELECT>
</td></tr>
<tr><td>Maximum number of matches per file returned:
</td><td><SELECT NAME=maxlines>
<OPTION>10
<OPTION selected>30
<OPTION>50
<OPTION>500
</SELECT>
</td></tr>
<tr><td>Maximum number of characters output per file:
</td><td><INPUT NAME="maxchars" VALUE=10000 SIZE=7>
</td></tr>
<tr><td colspan=2>
<!-- Admins - remove this line to stop caching next hits -->
<INPUT NAME="cache" VALUE="yes" TYPE="HIDDEN">
</td></tr>
<tr><td colspan=2 align=center>
<font size=-2>
<a href="http://webglimpse.org" target="_blank">Glimpse</a> and
<a href="http://webglimpse.net" target="_blank">WebGlimpse</a>,
Copyright &copy; 1996,
University of Arizona
</font></td></tr>
</table>
</td></tr></table>
</FORM>
</center>
</body>
</html>

94
listarch/s2.html Normal file
View File

@ -0,0 +1,94 @@
<HTML>
<HEAD>
<title>Full search on archive ISDN4Linux Mailinglist </title>
</head>
<body bgcolor="#ffffdd"><center>
<table border=5 bgcolor="#ffffff">
<tr><td align=center valign=middle>
<a href="http://webglimpse.net"><img src="/cgi-bin/showimg.cgi" alt="Webglimpse Logo" align=middle height=34 width=60></A>
</td>
<td align=center valign=middle>
<font size=+3>
<a href="http://webglimpse.net">WebGlimpse</a>
Search<br></font>
</td>
</tr>
<!-- Admins - local copy pointers have been eliminated as of v1.6. If this bothers you e-mail gberns@tucson.com and complain -->
<tr><td colspan=2 align=center>
<FORM method=get ACTION="/cgi-bin/webglimpse.cgi">
<INPUT TYPE=HIDDEN NAME="ID" VALUE="1">
Search the full archive: ISDN4Linux Mailinglist
</td></tr>
<tr><td colspan=2>
String to search for: <INPUT NAME=query size=30>
<INPUT TYPE=submit VALUE=Submit>
<br>
<INPUT NAME=case TYPE=checkbox>Case&#160;sensitive
<!-- SPACES -->&#160;&#160;&#160;
<INPUT NAME=whole TYPE=checkbox>Partial&#160;match
<!-- SPACES -->&#160;&#160;&#160;
<INPUT NAME=lines TYPE=checkbox>Jump&#160;to&#160;line
<br>
<SELECT NAME=errors align=right>
<OPTION>0
<OPTION>1
<OPTION>2
</SELECT>
misspellings&#160;allowed
<!-- Admins - field based searching requires use of parsefields.pl. See
http://webglimpse.net/docs/howto_fieldsearches.html for more details. If not using,
you may want to remove the next checkbox. -->
<!-- SPACES-->&#160;&#160;&#160;&#160;&#160;&#160;
<INPUT NAME=nonascii TYPE=checkbox>Use filters
<br>
</center>
Return only files modified within the last <INPUT NAME=age size=5>
days.
<br>
Maximum number of files returned:
<SELECT NAME=maxfiles>
<OPTION>10
<OPTION selected>50
<OPTION>100
<OPTION>1000
</SELECT>
<br>Maximum number of matches per file returned:
<SELECT NAME=maxlines>
<OPTION>10
<OPTION selected>30
<OPTION>50
<OPTION>500
</SELECT>
<br>Maximum number of characters output per file:
<INPUT NAME="maxchars" VALUE=10000>
<br>
<!-- Admins - remove this line to stop caching next hits -->
<INPUT NAME="cache" VALUE="yes" TYPE="HIDDEN">
</FORM>
</td></tr>
<tr><td colspan=2>
<center>
<font size=-2>
<a href="http://webglimpse.org">Glimpse</a> and
<a href="http://webglimpse.net">WebGlimpse</a>,
Copyright &copy; 1996,
University of Arizona
</center>
</font></td></tr>
</table>
</body>
</html>

BIN
pics/4.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 B

BIN
pics/FAQ-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pics/FAQ.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pics/ISDN.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
pics/abstract.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pics/contacts-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pics/contacts.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pics/contacts_hdr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
pics/cvs-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

BIN
pics/cvs.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

BIN
pics/devmeet-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
pics/devmeet.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
pics/download-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
pics/download.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
pics/download_hdr-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
pics/download_hdr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
pics/faq-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

BIN
pics/faq.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

BIN
pics/gef_logo_klein.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
pics/guuglogo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
pics/home-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

BIN
pics/home.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

BIN
pics/hrule.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
pics/hrule1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

BIN
pics/leafsite-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
pics/leafsite.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
pics/links-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

BIN
pics/links.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 B

BIN
pics/linkshdr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
pics/listarch-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pics/listarch.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
pics/listarch_hdr-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
pics/listarch_hdr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
pics/livepict-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pics/livepict.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
pics/mail-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

BIN
pics/mail.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

BIN
pics/meethead.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
pics/next-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

BIN
pics/next.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

BIN
pics/pdslogo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
pics/penguin-t.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
pics/prev-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pics/prev.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
pics/sit3-shine-tran.1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
pics/sponsors.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
pics/suse_150.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

BIN
pics/tologo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
pics/up-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

BIN
pics/up.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

BIN
pics/workshop-ovr.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
pics/workshop.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

4
robots.txt Normal file
View File

@ -0,0 +1,4 @@
User-agent: *
Disallow: /listarch/isdn4linux
User-agent: i4ldig
Disallow:

6
ssi/b_home.shtml Normal file
View File

@ -0,0 +1,6 @@
<!--#set var="alt" value="Home" --><A
HREF="/" onmouseover="js_moveover('_pics_home_gif')"
onmouseout="js_moveaway('_pics_home_gif')"><IMG
SRC="/pics/home.gif" name="_pics_home_gif"
<!--#include virtual="/ssi/calt.shtml" -->
BORDER=0 HEIGHT=28 WIDTH=76></A>

1
ssi/b_index.shtml Normal file
View File

@ -0,0 +1 @@
<!--#set var="alt" value="up" --><A HREF="index.shtml" onmouseover="js_moveover('_pics_up_gif')" onmouseout="js_moveaway('_pics_up_gif')"><IMG SRC="/pics/up.gif" name="_pics_up_gif" <!--#include virtual="/ssi/calt.shtml" --> BORDER=0 HEIGHT=33 WIDTH=43></A>

7
ssi/b_mail.shtml Normal file
View File

@ -0,0 +1,7 @@
<!--#set var="alt" value="send mail" --><A
HREF="mailto:<!--#echo var="SERVER_ADMIN" -->?subject=<!--#echo var="SCRIPT_NAME" -->"
onmouseover="js_moveover('_pics_mail_gif')"
onmouseout="js_moveaway('_pics_mail_gif')"><IMG
SRC="/pics/mail.gif" name="_pics_mail_gif"
<!--#include virtual="/ssi/calt.shtml" -->
BORDER=0 WIDTH=58 HEIGHT=29></A>

1
ssi/b_up.shtml Normal file
View File

@ -0,0 +1 @@
<!--#set var="alt" value="up" --><A HREF="../" onmouseover="js_moveover('_pics_up_gif')" onmouseout="js_moveaway('_pics_up_gif')"><IMG SRC="/pics/up.gif" name="_pics_up_gif" <!--#include virtual="/ssi/calt.shtml" --> BORDER=0 HEIGHT=33 WIDTH=43></A>

7
ssi/buttondefs.shtml Normal file
View File

@ -0,0 +1,7 @@
<SCRIPT LANGUAGE="JavaScript">
<!--
js_but["_pics_home_gif"] = new js_button("/pics/home.gif", "Back to the ISDN4Linux Homepage");
js_but["_pics_up_gif"] = new js_button("/pics/up.gif", "Go up one level");
js_but["_pics_mail_gif"] = new js_button("/pics/mail.gif", "Send mail to webmaster about this page");
// -->
</SCRIPT>

1
ssi/calt.shtml Normal file
View File

@ -0,0 +1 @@
<!--#if expr="! ${NETSCAPE}" -->ALT="<!--#echo var="alt" -->"<!--#endif -->

5
ssi/checkframe.shtml Normal file
View File

@ -0,0 +1,5 @@
<SCRIPT LANGUAGE="JavaScript">
<!--
check_frame();
// -->
</SCRIPT>

9
ssi/i4lfooter.shtml Normal file
View File

@ -0,0 +1,9 @@
<TABLE WIDTH=100%><TR><TD COLSPAN=2 ALIGN=CENTER
><!--#include virtual="/ssi/rule.shtml" --><BR></TD></TR
>
<TR><!--#config timefmt="%d.%m.%Y %H:%M" --><TD ALIGN="LEFT"
><SMALL>Last change: <!--#echo var="LAST_MODIFIED" --></SMALL></TD
><TD ALIGN="RIGHT" NOBREAK><SMALL
>&copy; 1998 Fritz Elfert <A
HREF="mailto:<!--#echo var="SERVER_ADMIN" -->?subject=ISDN4Linux-Website"
><!--#echo var="SERVER_ADMIN" --></A></SMALL></TD></TR></TABLE>

5
ssi/jbdef.shtml Normal file
View File

@ -0,0 +1,5 @@
<SCRIPT LANGUAGE="JavaScript">
<!--
js_but["_pics_<!--#echo var="picnam" -->_gif"] = new js_button("/pics/<!--#echo var="picnam" -->.gif", "<!--#echo var="picstr" -->");
// -->
</SCRIPT>

1
ssi/jbref.shtml Normal file
View File

@ -0,0 +1 @@
<A HREF="<!--#echo var="href" -->" onmouseover="js_moveover('_pics_<!--#echo var="picnam" -->_gif')" onmouseout="js_moveaway('_pics_<!--#echo var="picnam" -->_gif')"><IMG SRC="/pics/<!--#echo var="picnam" -->.gif" name="_pics_<!--#echo var="picnam" -->_gif" BORDER=0 <!--#include virtual="/ssi/calt.shtml" -->

47
ssi/js.shtml Normal file
View File

@ -0,0 +1,47 @@
<SCRIPT LANGUAGE="JavaScript">
<!--
if (window.name == "bannerframe") {
top.location = "http://www.isdn4linux.de";
}
var js_ok = false;
js_but = new Array();
if ( navigator.appName.substring(0,9) == "Microsoft" &&
parseInt(navigator.appVersion) >= 4 )
js_ok = true;
if ( navigator.appName.substring(0,8) == "Netscape" &&
parseInt(navigator.appVersion) >= 3 )
js_ok = true;
function js_button(pic, desc) {
if (js_ok) {
this.pic = new Image();
this.pic.src = pic;
this.pic_active = new Image();
this.pic_active.src = pic.substring(0, pic.length - 4) + "-ovr.gif";
this.text = desc;
}
}
function js_moveover(id) {
if (js_ok) {
document[id].src = js_but[id].pic_active.src;
window.status = js_but[id].text;
}
}
function js_moveaway(id) {
if (js_ok) {
document[id].src = js_but[id].pic.src;
window.status = "";
}
}
function check_frame() {
if (window != parent) {
document.writeln('<BR>This Document has been put into a frame by some foreign document.<BR>');
document.writeln('If you don\'t like frames, go directly to <A HREF=\"http://www.isdn4linux.de\" TARGET=\"_top\">www.isdn4linux.de</A>, the original site.<BR>');
}
}
// -->
</SCRIPT>

28
ssi/jswin.shtml Normal file
View File

@ -0,0 +1,28 @@
<SCRIPT LANGUAGE="JavaScript">
<!--
function nw(e, loc, w, h) {
x = e.screenX + 20;
y = e.screenY + 20;
w = window.open("", "popUp", "dependent,scrollbars=yes"
+ ",screenX=" + x + ",screenY=" + y
+ ",width=" + w + ",height=" + h);
w.location = loc;
}
function hl(name) {
if (NS4) {
document.layers[name].visibility = "hide";
} else {
document.all[name].style.visibility = "hidden";
}
}
function sl(name) {
if (NS4) {
document.layers[name].visibility = "show";
} else {
document.all[name].style.visibility = "visible";
}
}
// -->
</SCRIPT>

5
ssi/rule.shtml Normal file
View File

@ -0,0 +1,5 @@
<IMG SRC="/pics/hrule.gif" WIDTH=579 HEIGHT=17 BORDER=0
<!--#if expr="! ${NETSCAPE}" -->
ALT="---------------------------------------------------------"
<!--#endif -->
>

View File

@ -0,0 +1,790 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>amd7930.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>amd7930.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
*
* HiSax ISDN driver - chip specific routines for AMD 7930
*
* Author Brent Baccala (baccala@FreeSoft.org)
*
*
*
* $Log$
* Revision 1.2 1998/02/12 23:07:10 keil
* change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb()
*
* Revision 1.1 1998/02/03 23:20:51 keil
* New files for SPARC isdn support
*
* Revision 1.1 1998/01/08 04:17:12 baccala
* ISDN comes to the Sparc. Key points:
*
* - Existing ISDN HiSax driver provides all the smarts
* - it compiles, runs, talks to an isolated phone switch, connects
* to a Cisco, pings go through
* - AMD 7930 support only (no DBRI yet)
* - no US NI-1 support (may not work on US phone system - untested)
* - periodic packet loss, apparently due to lost interrupts
* - ISDN sometimes freezes, requiring reboot before it will work again
*
* The code is unreliable enough to be consider alpha
*
*
* Advanced Micro Devices' Am79C30A is an ISDN/audio chip used in the
* SparcStation 1+. The chip provides microphone and speaker interfaces
* which provide mono-channel audio at 8K samples per second via either
* 8-bit A-law or 8-bit mu-law encoding. Also, the chip features an
* ISDN BRI Line Interface Unit (LIU), I.430 S/T physical interface,
* which performs basic D channel LAPD processing and provides raw
* B channel data. The digital audio channel, the two ISDN B channels,
* and two 64 Kbps channels to the microprocessor are all interconnected
* via a multiplexer.
*
* This driver interfaces to the Linux HiSax ISDN driver, which performs
* all high-level Q.921 and Q.931 ISDN functions. The file is not
* itself a hardware driver; rather it uses functions exported by
* the AMD7930 driver in the sparcaudio subsystem (drivers/sbus/audio),
* allowing the chip to be simultaneously used for both audio and ISDN data.
* The hardware driver does _no_ buffering, but provides several callbacks
* which are called during interrupt service and should therefore run quickly.
*
* D channel transmission is performed by passing the hardware driver the
* address and size of an skb's data area, then waiting for a callback
* to signal successful transmission of the packet. A task is then
* queued to notify the HiSax driver that another packet may be transmitted.
*
* D channel reception is quite simple, mainly because of:
* 1) the slow speed of the D channel - 16 kbps, and
* 2) the presence of an 8- or 32-byte (depending on chip version) FIFO
* to buffer the D channel data on the chip
* Worst case scenario of back-to-back packets with the 8 byte buffer
* at 16 kbps yields an service time of 4 ms - long enough to preclude
* the need for fancy buffering. We queue a background task that copies
* data out of the receive buffer into an skb, and the hardware driver
* simply does nothing until we're done with the receive buffer and
* reset it for a new packet.
*
* B channel processing is more complex, because of:
* 1) the faster speed - 64 kbps,
* 2) the lack of any on-chip buffering (it interrupts for every byte), and
* 3) the lack of any chip support for HDLC encapsulation
*
* The HiSax driver can put each B channel into one of three modes -
* L1_MODE_NULL (channel disabled), L1_MODE_TRANS (transparent data relay),
* and L1_MODE_HDLC (HDLC encapsulation by low-level driver).
* L1_MODE_HDLC is the most common, used for almost all "pure" digital
* data sessions. L1_MODE_TRANS is used for ISDN audio.
*
* HDLC B channel transmission is performed via a large buffer into
* which the skb is copied while performing HDLC bit-stuffing. A CRC
* is computed and attached to the end of the buffer, which is then
* passed to the low-level routines for raw transmission. Once
* transmission is complete, the hardware driver is set to enter HDLC
* idle by successive transmission of mark (all 1) bytes, waiting for
* the ISDN driver to prepare another packet for transmission and
* deliver it.
*
* HDLC B channel reception is performed via an X-byte ring buffer
* divided into N sections of X/N bytes each. Defaults: X=256 bytes, N=4.
* As the hardware driver notifies us that each section is full, we
* hand it the next section and schedule a background task to peruse
* the received section, bit-by-bit, with an HDLC decoder. As
* packets are detected, they are copied into a large buffer while
* decoding HDLC bit-stuffing. The ending CRC is verified, and if
* it is correct, we alloc a new skb of the correct length (which we
* now know), copy the packet into it, and hand it to the upper layers.
* Optimization: for large packets, we hand the buffer (which also
* happens to be an skb) directly to the upper layer after an skb_trim,
* and alloc a new large buffer for future packets, thus avoiding a copy.
* Then we return to HDLC processing; state is saved between calls.
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"../../sbus/audio/amd7930.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isac.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isdnl1.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"rawhdlc.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/interrupt.h&gt;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *amd7930_revision = <FONT COLOR="#FF0000">"$Revision$"</FONT>;
<FONT COLOR=#A521F7>#define</FONT> RCV_BUFSIZE 1024 <FONT COLOR=#0000FF>/* Size of raw receive buffer in bytes */</FONT>
<FONT COLOR=#A521F7>#define</FONT> RCV_BUFBLKS 4 <FONT COLOR=#0000FF>/* Number of blocks to divide buffer into
* (must divide RCV_BUFSIZE) */</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT> Bchan_fill_fifo(<FONT COLOR="#298C52">struct</FONT> BCState *, <FONT COLOR="#298C52">struct</FONT> sk_buff *);
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_xmt_bh(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.amd7930.tx_skb != NULL) {
dev_kfree_skb(bcs-&gt;hw.amd7930.tx_skb);
bcs-&gt;hw.amd7930.tx_skb = NULL;
}
<FONT COLOR="#298C52">if</FONT> ((skb = skb_dequeue(&amp;bcs-&gt;squeue))) {
Bchan_fill_fifo(bcs, skb);
} <FONT COLOR="#298C52">else</FONT> {
clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
bcs-&gt;event |= 1 &lt;&lt; <A HREF="isdnl1.h.shtml#B_XMTBUFREADY">B_XMTBUFREADY</A>;
queue_task(&amp;bcs-&gt;tqueue, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_xmit_callback(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
queue_task(&amp;bcs-&gt;hw.amd7930.tq_xmt, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
<FONT COLOR=#0000FF>/* B channel transmission: two modes (three, if you count L1_MODE_NULL)
*
* L1_MODE_HDLC - We need to do HDLC encapsulation before transmiting
* the packet (i.e. make_raw_hdlc_data). Since this can be a
* time-consuming operation, our completion callback just schedules
* a bottom half to do encapsulation for the next packet. In between,
* the link will just idle
*
* L1_MODE_TRANS - Data goes through, well, transparent. No HDLC encap,
* and we can't just let the link idle, so the "bottom half" actually
* gets called during the top half (it's our callback routine in this case),
* but it's a lot faster now since we don't call make_raw_hdlc_data
*/</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_fill_fifo(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">struct</FONT> sk_buff *skb)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">int</FONT> len;
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) || (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>)) {
<FONT COLOR="#298C52">char</FONT> tmp[1024];
<FONT COLOR="#298C52">char</FONT> *t = tmp;
t += sprintf(t, <FONT COLOR="#FF0000">"amd7930_fill_fifo %c cnt %d"</FONT>,
bcs-&gt;channel ? <FONT COLOR="#FF0000">'B'</FONT> : <FONT COLOR="#FF0000">'A'</FONT>, skb-&gt;len);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>)
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(t, skb-&gt;data, skb-&gt;len);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode == <A HREF="hisax.h.shtml#L1_MODE_HDLC">L1_MODE_HDLC</A>) {
len = make_raw_hdlc_data(skb-&gt;data, skb-&gt;len,
bcs-&gt;hw.amd7930.tx_buff, <A HREF="hisax.h.shtml#RAW_BUFMAX">RAW_BUFMAX</A>);
<FONT COLOR="#298C52">if</FONT> (len &gt; 0)
amd7930_bxmit(0, bcs-&gt;channel,
bcs-&gt;hw.amd7930.tx_buff, len,
(<FONT COLOR="#298C52">void</FONT> *) &amp;Bchan_xmit_callback,
(<FONT COLOR="#298C52">void</FONT> *) bcs);
dev_kfree_skb(skb);
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode == <A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>) {
amd7930_bxmit(0, bcs-&gt;channel,
bcs-&gt;hw.amd7930.tx_buff, skb-&gt;len,
(<FONT COLOR="#298C52">void</FONT> *) &amp;Bchan_xmt_bh,
(<FONT COLOR="#298C52">void</FONT> *) bcs);
bcs-&gt;hw.amd7930.tx_skb = skb;
} <FONT COLOR="#298C52">else</FONT> {
dev_kfree_skb(skb);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_mode(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> mode, <FONT COLOR="#298C52">int</FONT> bc)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[40];
sprintf(tmp, <FONT COLOR="#FF0000">"AMD 7930 mode %d bchan %d/%d"</FONT>,
mode, bc, bcs-&gt;channel);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
bcs-&gt;mode = mode;
}
<FONT COLOR=#0000FF>/* Bchan_l2l1 is the entry point for upper layer routines that want to
* transmit on the B channel. PH_DATA_REQ is a normal packet that
* we either start transmitting (if idle) or queue (if busy).
* PH_PULL_REQ can be called to request a callback message (PH_PULL_CNF)
* once the link is idle. After a "pull" callback, the upper layer
* routines can use PH_PULL_IND to send data.
*/</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_l2l1(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">int</FONT> pr, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb = arg;
<FONT COLOR="#298C52">switch</FONT> (pr) {
<FONT COLOR="#298C52">case</FONT> (PH_DATA_REQ):
<FONT COLOR="#298C52">if</FONT> (test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag)) {
skb_queue_tail(&amp;st-&gt;l1.bcs-&gt;squeue, skb);
} <FONT COLOR="#298C52">else</FONT> {
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
Bchan_fill_fifo(st-&gt;l1.bcs, skb);
}
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (PH_PULL_IND):
<FONT COLOR="#298C52">if</FONT> (test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag)) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"amd7930: this shouldn't happen\n"</FONT>);
<FONT COLOR="#298C52">break</FONT>;
}
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
Bchan_fill_fifo(st-&gt;l1.bcs, skb);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (PH_PULL_REQ):
<FONT COLOR="#298C52">if</FONT> (!test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag)) {
clear_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
st-&gt;l1.l1l2(st, PH_PULL_CNF, NULL);
} <FONT COLOR="#298C52">else</FONT>
set_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR=#0000FF>/* Receiver callback and bottom half - decodes HDLC at leisure (if
* L1_MODE_HDLC) and passes newly received skb on via bcs-&gt;rqueue. If
* a large packet is received, stick rv_skb (the buffer that the
* packet has been decoded into) on the receive queue and alloc a new
* (large) skb to act as buffer for future receives. If a small
* packet is received, leave rv_skb alone, alloc a new skb of the
* correct size, and copy the packet into it
*/</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_recv_callback(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> amd7930_hw *hw = &amp;bcs-&gt;hw.amd7930;
hw-&gt;rv_buff_in += RCV_BUFSIZE/RCV_BUFBLKS;
hw-&gt;rv_buff_in %= RCV_BUFSIZE;
<FONT COLOR="#298C52">if</FONT> (hw-&gt;rv_buff_in != hw-&gt;rv_buff_out) {
amd7930_brecv(0, bcs-&gt;channel,
hw-&gt;rv_buff + hw-&gt;rv_buff_in,
RCV_BUFSIZE/RCV_BUFBLKS,
(<FONT COLOR="#298C52">void</FONT> *) &amp;Bchan_recv_callback, (<FONT COLOR="#298C52">void</FONT> *) bcs);
}
queue_task(&amp;hw-&gt;tq_rcv, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_rcv_bh(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">struct</FONT> amd7930_hw *hw = &amp;bcs-&gt;hw.amd7930;
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR="#298C52">int</FONT> len;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[1024];
sprintf(tmp, <FONT COLOR="#FF0000">"amd7930_Bchan_rcv (%d/%d)"</FONT>,
hw-&gt;rv_buff_in, hw-&gt;rv_buff_out);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(tmp, hw-&gt;rv_buff + hw-&gt;rv_buff_out,
RCV_BUFSIZE/RCV_BUFBLKS);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">do</FONT> {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode == <A HREF="hisax.h.shtml#L1_MODE_HDLC">L1_MODE_HDLC</A>) {
<FONT COLOR="#298C52">while</FONT> ((len = read_raw_hdlc_data(hw-&gt;hdlc_state,
hw-&gt;rv_buff + hw-&gt;rv_buff_out, RCV_BUFSIZE/RCV_BUFBLKS,
hw-&gt;rv_skb-&gt;tail, <A HREF="hisax.h.shtml#HSCX_BUFMAX">HSCX_BUFMAX</A>))) {
<FONT COLOR="#298C52">if</FONT> (len &gt; 0 &amp;&amp; (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>)) {
<FONT COLOR="#298C52">char</FONT> tmp[1024];
<FONT COLOR="#298C52">char</FONT> *t = tmp;
t += sprintf(t, <FONT COLOR="#FF0000">"amd7930_Bchan_rcv %c cnt %d"</FONT>, bcs-&gt;channel ? <FONT COLOR="#FF0000">'B'</FONT> : <FONT COLOR="#FF0000">'A'</FONT>, len);
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(t, hw-&gt;rv_skb-&gt;tail, len);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (len &gt; <A HREF="hisax.h.shtml#HSCX_BUFMAX">HSCX_BUFMAX</A>/2) {
<FONT COLOR=#0000FF>/* Large packet received */</FONT>
<FONT COLOR="#298C52">if</FONT> (!(skb = dev_alloc_skb(<A HREF="hisax.h.shtml#HSCX_BUFMAX">HSCX_BUFMAX</A>))) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"amd7930: receive out of memory"</FONT>);
} <FONT COLOR="#298C52">else</FONT> {
skb_put(hw-&gt;rv_skb, len);
skb_queue_tail(&amp;bcs-&gt;rqueue, hw-&gt;rv_skb);
hw-&gt;rv_skb = skb;
bcs-&gt;event |= 1 &lt;&lt; <A HREF="isdnl1.h.shtml#B_RCVBUFREADY">B_RCVBUFREADY</A>;
queue_task(&amp;bcs-&gt;tqueue, &amp;tq_immediate);
}
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (len &gt; 0) {
<FONT COLOR=#0000FF>/* Small packet received */</FONT>
<FONT COLOR="#298C52">if</FONT> (!(skb = dev_alloc_skb(len))) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"amd7930: receive out of memory\n"</FONT>);
} <FONT COLOR="#298C52">else</FONT> {
memcpy(skb_put(skb, len), hw-&gt;rv_skb-&gt;tail, len);
skb_queue_tail(&amp;bcs-&gt;rqueue, skb);
bcs-&gt;event |= 1 &lt;&lt; <A HREF="isdnl1.h.shtml#B_RCVBUFREADY">B_RCVBUFREADY</A>;
queue_task(&amp;bcs-&gt;tqueue, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR=#0000FF>/* Reception Error */</FONT>
<FONT COLOR=#0000FF>/* printk("amd7930: B channel receive error\n"); */</FONT>
}
}
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode == <A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>) {
<FONT COLOR="#298C52">if</FONT> (!(skb = dev_alloc_skb(RCV_BUFSIZE/RCV_BUFBLKS))) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"amd7930: receive out of memory\n"</FONT>);
} <FONT COLOR="#298C52">else</FONT> {
memcpy(skb_put(skb, RCV_BUFSIZE/RCV_BUFBLKS),
hw-&gt;rv_buff + hw-&gt;rv_buff_out,
RCV_BUFSIZE/RCV_BUFBLKS);
skb_queue_tail(&amp;bcs-&gt;rqueue, skb);
bcs-&gt;event |= 1 &lt;&lt; <A HREF="isdnl1.h.shtml#B_RCVBUFREADY">B_RCVBUFREADY</A>;
queue_task(&amp;bcs-&gt;tqueue, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
}
<FONT COLOR="#298C52">if</FONT> (hw-&gt;rv_buff_in == hw-&gt;rv_buff_out) {
<FONT COLOR=#0000FF>/* Buffer was filled up - need to restart receiver */</FONT>
amd7930_brecv(0, bcs-&gt;channel,
hw-&gt;rv_buff + hw-&gt;rv_buff_in,
RCV_BUFSIZE/RCV_BUFBLKS,
(<FONT COLOR="#298C52">void</FONT> *) &amp;Bchan_recv_callback,
(<FONT COLOR="#298C52">void</FONT> *) bcs);
}
hw-&gt;rv_buff_out += RCV_BUFSIZE/RCV_BUFBLKS;
hw-&gt;rv_buff_out %= RCV_BUFSIZE;
} <FONT COLOR="#298C52">while</FONT> (hw-&gt;rv_buff_in != hw-&gt;rv_buff_out);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_close(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
Bchan_mode(bcs, 0, 0);
amd7930_bclose(0, bcs-&gt;channel);
<FONT COLOR="#298C52">if</FONT> (test_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
<FONT COLOR="#298C52">while</FONT> ((skb = skb_dequeue(&amp;bcs-&gt;rqueue))) {
dev_kfree_skb(skb);
}
<FONT COLOR="#298C52">while</FONT> ((skb = skb_dequeue(&amp;bcs-&gt;squeue))) {
dev_kfree_skb(skb);
}
}
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT>
Bchan_open(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> amd7930_hw *hw = &amp;bcs-&gt;hw.amd7930;
<FONT COLOR="#298C52">if</FONT> (!test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
skb_queue_head_init(&amp;bcs-&gt;rqueue);
skb_queue_head_init(&amp;bcs-&gt;squeue);
}
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
amd7930_bopen(0, bcs-&gt;channel, 0xff);
hw-&gt;rv_buff_in = 0;
hw-&gt;rv_buff_out = 0;
hw-&gt;tx_skb = NULL;
init_hdlc_state(hw-&gt;hdlc_state, 0);
amd7930_brecv(0, bcs-&gt;channel,
hw-&gt;rv_buff + hw-&gt;rv_buff_in, RCV_BUFSIZE/RCV_BUFBLKS,
(<FONT COLOR="#298C52">void</FONT> *) &amp;Bchan_recv_callback, (<FONT COLOR="#298C52">void</FONT> *) bcs);
bcs-&gt;event = 0;
bcs-&gt;tx_cnt = 0;
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_init(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">if</FONT> (!(bcs-&gt;hw.amd7930.tx_buff = kmalloc(<A HREF="hisax.h.shtml#RAW_BUFMAX">RAW_BUFMAX</A>, GFP_ATOMIC))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: No memory for amd7930.tx_buff\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">if</FONT> (!(bcs-&gt;hw.amd7930.rv_buff = kmalloc(RCV_BUFSIZE, GFP_ATOMIC))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: No memory for amd7930.rv_buff\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">if</FONT> (!(bcs-&gt;hw.amd7930.rv_skb = dev_alloc_skb(<A HREF="hisax.h.shtml#HSCX_BUFMAX">HSCX_BUFMAX</A>))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: No memory for amd7930.rv_skb\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">if</FONT> (!(bcs-&gt;hw.amd7930.hdlc_state = kmalloc(<FONT COLOR="#298C52">sizeof</FONT>(<FONT COLOR="#298C52">struct</FONT> hdlc_state),
GFP_ATOMIC))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: No memory for amd7930.hdlc_state\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
bcs-&gt;hw.amd7930.tq_rcv.sync = 0;
bcs-&gt;hw.amd7930.tq_rcv.routine = (<FONT COLOR="#298C52">void</FONT> (*)(<FONT COLOR="#298C52">void</FONT> *)) &amp;Bchan_rcv_bh;
bcs-&gt;hw.amd7930.tq_rcv.data = (<FONT COLOR="#298C52">void</FONT> *) bcs;
bcs-&gt;hw.amd7930.tq_xmt.sync = 0;
bcs-&gt;hw.amd7930.tq_xmt.routine = (<FONT COLOR="#298C52">void</FONT> (*)(<FONT COLOR="#298C52">void</FONT> *)) &amp;Bchan_xmt_bh;
bcs-&gt;hw.amd7930.tq_xmt.data = (<FONT COLOR="#298C52">void</FONT> *) bcs;
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
Bchan_manl1(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">int</FONT> pr,
<FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">switch</FONT> (pr) {
<FONT COLOR="#298C52">case</FONT> (PH_ACTIVATE_REQ):
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
Bchan_mode(st-&gt;l1.bcs, st-&gt;l1.mode, st-&gt;l1.bc);
st-&gt;l1.l1man(st, PH_ACTIVATE_CNF, NULL);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (PH_DEACTIVATE_REQ):
<FONT COLOR="#298C52">if</FONT> (!test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag))
Bchan_mode(st-&gt;l1.bcs, 0, 0);
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR="#298C52">int</FONT>
setstack_amd7930(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">if</FONT> (Bchan_open(bcs))
<FONT COLOR="#298C52">return</FONT> (-1);
st-&gt;l1.bcs = bcs;
st-&gt;l2.l2l1 = Bchan_l2l1;
st-&gt;ma.manl1 = Bchan_manl1;
<A HREF="lmgr.c.shtml#setstack_manager">setstack_manager</A>(st);
bcs-&gt;st = st;
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
amd7930_drecv_callback(<FONT COLOR="#298C52">void</FONT> *arg, <FONT COLOR="#298C52">int</FONT> error, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> count)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = (<FONT COLOR="#298C52">struct</FONT> IsdnCardState *) arg;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">struct</FONT> tq_struct task;
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR=#0000FF>/* NOTE: This function is called directly from an interrupt handler */</FONT>
<FONT COLOR="#298C52">if</FONT> (1) {
<FONT COLOR="#298C52">if</FONT> (!(skb = alloc_skb(count, GFP_ATOMIC)))
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: D receive out of memory\n"</FONT>);
<FONT COLOR="#298C52">else</FONT> {
memcpy(skb_put(skb, count), cs-&gt;rcvbuf, count);
skb_queue_tail(&amp;cs-&gt;rq, skb);
}
task.routine = (<FONT COLOR="#298C52">void</FONT> *) <A HREF="isdnl1.c.shtml#DChannel_proc_rcv">DChannel_proc_rcv</A>;
task.data = (<FONT COLOR="#298C52">void</FONT> *) cs;
queue_task(&amp;task, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_ISAC_FIFO">L1_DEB_ISAC_FIFO</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[128];
<FONT COLOR="#298C52">char</FONT> *t = tmp;
t += sprintf(t, <FONT COLOR="#FF0000">"amd7930 Drecv cnt %d"</FONT>, count);
<FONT COLOR="#298C52">if</FONT> (error) t += sprintf(t, <FONT COLOR="#FF0000">" ERR %x"</FONT>, error);
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(t, cs-&gt;rcvbuf, count);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
amd7930_drecv(0, cs-&gt;rcvbuf, <A HREF="hisax.h.shtml#MAX_DFRAME_LEN">MAX_DFRAME_LEN</A>,
&amp;amd7930_drecv_callback, cs);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
amd7930_dxmit_callback(<FONT COLOR="#298C52">void</FONT> *arg, <FONT COLOR="#298C52">int</FONT> error)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = (<FONT COLOR="#298C52">struct</FONT> IsdnCardState *) arg;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">struct</FONT> tq_struct task;
<FONT COLOR=#0000FF>/* NOTE: This function is called directly from an interrupt handler */</FONT>
<FONT COLOR=#0000FF>/* may wish to do retransmission here, if error indicates collision */</FONT>
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_ISAC_FIFO">L1_DEB_ISAC_FIFO</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[128];
<FONT COLOR="#298C52">char</FONT> *t = tmp;
t += sprintf(t, <FONT COLOR="#FF0000">"amd7930 Dxmit cnt %d"</FONT>, cs-&gt;tx_skb-&gt;len);
<FONT COLOR="#298C52">if</FONT> (error) t += sprintf(t, <FONT COLOR="#FF0000">" ERR %x"</FONT>, error);
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(t, cs-&gt;tx_skb-&gt;data, cs-&gt;tx_skb-&gt;len);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
cs-&gt;tx_skb = NULL;
task.routine = (<FONT COLOR="#298C52">void</FONT> *) <A HREF="isdnl1.c.shtml#DChannel_proc_xmt">DChannel_proc_xmt</A>;
task.data = (<FONT COLOR="#298C52">void</FONT> *) cs;
queue_task(&amp;task, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
amd7930_Dchan_l2l1(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">int</FONT> pr, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = (<FONT COLOR="#298C52">struct</FONT> IsdnCardState *) st-&gt;l1.hardware;
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb = arg;
<FONT COLOR="#298C52">char</FONT> str[64];
<FONT COLOR="#298C52">switch</FONT> (pr) {
<FONT COLOR="#298C52">case</FONT> (PH_DATA_REQ):
<FONT COLOR="#298C52">if</FONT> (cs-&gt;tx_skb) {
skb_queue_tail(&amp;cs-&gt;sq, skb);
<FONT COLOR=#A521F7>#ifdef</FONT> <A HREF="isdnl1.h.shtml#L2FRAME_DEBUG">L2FRAME_DEBUG</A> <FONT COLOR=#0000FF>/* psa */</FONT>
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_LAPD">L1_DEB_LAPD</A>)
<A HREF="isdnl1.c.shtml#Logl2Frame">Logl2Frame</A>(cs, skb, <FONT COLOR="#FF0000">"PH_DATA Queued"</FONT>, 0);
<FONT COLOR=#A521F7>#endif</FONT>
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;dlogflag) &amp;&amp; (!(skb-&gt;data[2] &amp; 1))) {
<FONT COLOR=#0000FF>/* I-FRAME */</FONT>
<A HREF="q931.c.shtml#LogFrame">LogFrame</A>(cs, skb-&gt;data, skb-&gt;len);
sprintf(str, <FONT COLOR="#FF0000">"Q.931 frame user-&gt;network tei %d"</FONT>, st-&gt;l2.tei);
<A HREF="q931.c.shtml#dlogframe">dlogframe</A>(cs, skb-&gt;data+4, skb-&gt;len-4,
str);
}
cs-&gt;tx_skb = skb;
cs-&gt;tx_cnt = 0;
<FONT COLOR=#A521F7>#ifdef</FONT> <A HREF="isdnl1.h.shtml#L2FRAME_DEBUG">L2FRAME_DEBUG</A> <FONT COLOR=#0000FF>/* psa */</FONT>
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_LAPD">L1_DEB_LAPD</A>)
<A HREF="isdnl1.c.shtml#Logl2Frame">Logl2Frame</A>(cs, skb, <FONT COLOR="#FF0000">"PH_DATA"</FONT>, 0);
<FONT COLOR=#A521F7>#endif</FONT>
amd7930_dxmit(0, skb-&gt;data, skb-&gt;len,
&amp;amd7930_dxmit_callback, cs);
}
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (PH_PULL_IND):
<FONT COLOR="#298C52">if</FONT> (cs-&gt;tx_skb) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">" l2l1 tx_skb exist this shouldn't happen"</FONT>);
skb_queue_tail(&amp;cs-&gt;sq, skb);
<FONT COLOR="#298C52">break</FONT>;
}
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;dlogflag) &amp;&amp; (!(skb-&gt;data[2] &amp; 1))) { <FONT COLOR=#0000FF>/* I-FRAME */</FONT>
<A HREF="q931.c.shtml#LogFrame">LogFrame</A>(cs, skb-&gt;data, skb-&gt;len);
sprintf(str, <FONT COLOR="#FF0000">"Q.931 frame user-&gt;network tei %d"</FONT>, st-&gt;l2.tei);
<A HREF="q931.c.shtml#dlogframe">dlogframe</A>(cs, skb-&gt;data + 4, skb-&gt;len - 4,
str);
}
cs-&gt;tx_skb = skb;
cs-&gt;tx_cnt = 0;
<FONT COLOR=#A521F7>#ifdef</FONT> <A HREF="isdnl1.h.shtml#L2FRAME_DEBUG">L2FRAME_DEBUG</A> <FONT COLOR=#0000FF>/* psa */</FONT>
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_LAPD">L1_DEB_LAPD</A>)
<A HREF="isdnl1.c.shtml#Logl2Frame">Logl2Frame</A>(cs, skb, <FONT COLOR="#FF0000">"PH_DATA_PULLED"</FONT>, 0);
<FONT COLOR=#A521F7>#endif</FONT>
amd7930_dxmit(0, cs-&gt;tx_skb-&gt;data, cs-&gt;tx_skb-&gt;len,
&amp;amd7930_dxmit_callback, cs);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (PH_PULL_REQ):
<FONT COLOR=#A521F7>#ifdef</FONT> <A HREF="isdnl1.h.shtml#L2FRAME_DEBUG">L2FRAME_DEBUG</A> <FONT COLOR=#0000FF>/* psa */</FONT>
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_LAPD">L1_DEB_LAPD</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"-&gt; PH_REQUEST_PULL"</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (!cs-&gt;tx_skb) {
test_and_clear_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
st-&gt;l1.l1l2(st, PH_PULL_CNF, NULL);
} <FONT COLOR="#298C52">else</FONT>
test_and_set_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR="#298C52">int</FONT>
setDstack_amd7930(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
st-&gt;l2.l2l1 = amd7930_Dchan_l2l1;
<FONT COLOR="#298C52">if</FONT> (! cs-&gt;rcvbuf) {
printk(<FONT COLOR="#FF0000">"setDstack_amd7930: No cs-&gt;rcvbuf!\n"</FONT>);
} <FONT COLOR="#298C52">else</FONT> {
amd7930_drecv(0, cs-&gt;rcvbuf, <A HREF="hisax.h.shtml#MAX_DFRAME_LEN">MAX_DFRAME_LEN</A>,
&amp;amd7930_drecv_callback, cs);
}
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
manl1_msg(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> msg, <FONT COLOR="#298C52">void</FONT> *arg) {
<FONT COLOR="#298C52">struct</FONT> PStack *st;
st = cs-&gt;stlist;
<FONT COLOR="#298C52">while</FONT> (st) {
st-&gt;ma.manl1(st, msg, arg);
st = st-&gt;next;
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
amd7930_new_ph(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">switch</FONT> (amd7930_get_liu_state(0)) {
<FONT COLOR="#298C52">case</FONT> 3:
manl1_msg(cs, PH_POWERUP_CNF, NULL);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> 7:
manl1_msg(cs, PH_I4_P8_IND, NULL);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> 8:
manl1_msg(cs, PH_RSYNC_IND, NULL);
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR=#0000FF>/* amd7930 LIU state change callback */</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
amd7930_liu_callback(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">struct</FONT> tq_struct task;
<FONT COLOR="#298C52">if</FONT> (!cs)
<FONT COLOR="#298C52">return</FONT>;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_ISAC">L1_DEB_ISAC</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[32];
sprintf(tmp, <FONT COLOR="#FF0000">"amd7930_liu state %d"</FONT>, amd7930_get_liu_state(0));
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
task.sync = 0;
task.routine = (<FONT COLOR="#298C52">void</FONT> *) &amp;amd7930_new_ph;
task.data = (<FONT COLOR="#298C52">void</FONT> *) cs;
queue_task(&amp;task, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
<FONT COLOR="#298C52">void</FONT>
amd7930_l1cmd(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> msg, <FONT COLOR="#298C52">void</FONT> *arg)
{
u_char val;
<FONT COLOR="#298C52">char</FONT> tmp[32];
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_ISAC">L1_DEB_ISAC</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[32];
sprintf(tmp, <FONT COLOR="#FF0000">"amd7930_l1cmd msg %x"</FONT>, msg);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">switch</FONT>(msg) {
<FONT COLOR="#298C52">case</FONT> PH_RESET_REQ:
<FONT COLOR="#298C52">if</FONT> (amd7930_get_liu_state(0) &lt;= 3)
amd7930_liu_activate(0,0);
<FONT COLOR="#298C52">else</FONT>
amd7930_liu_deactivate(0);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> PH_ENABLE_REQ:
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> PH_INFO3_REQ:
amd7930_liu_activate(0,0);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> PH_TESTLOOP_REQ:
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">default</FONT>:
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"amd7930_l1cmd unknown %4x"</FONT>, msg);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT> init_amd7930(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
Bchan_init(&amp;cs-&gt;bcs[0]);
Bchan_init(&amp;cs-&gt;bcs[1]);
cs-&gt;bcs[0].BC_SetStack = setstack_amd7930;
cs-&gt;bcs[1].BC_SetStack = setstack_amd7930;
cs-&gt;bcs[0].BC_Close = Bchan_close;
cs-&gt;bcs[1].BC_Close = Bchan_close;
Bchan_mode(cs-&gt;bcs, 0, 0);
Bchan_mode(cs-&gt;bcs + 1, 0, 0);
}
<FONT COLOR="#298C52">void</FONT>
release_amd7930(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT>
amd7930_card_msg(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> mt, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">switch</FONT> (mt) {
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RESET">CARD_RESET</A>:
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RELEASE">CARD_RELEASE</A>:
release_amd7930(cs);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_SETIRQ">CARD_SETIRQ</A>:
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_INIT">CARD_INIT</A>:
cs-&gt;l1cmd = amd7930_l1cmd;
amd7930_liu_init(0, &amp;amd7930_liu_callback, (<FONT COLOR="#298C52">void</FONT> *)cs);
init_amd7930(cs);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_TEST">CARD_TEST</A>:
<FONT COLOR="#298C52">return</FONT>(0);
}
<FONT COLOR="#298C52">return</FONT>(0);
}
<A HREF="asuscom.c.shtml#__initfunc">__initfunc</A>(<FONT COLOR="#298C52">int</FONT>
setup_amd7930(<FONT COLOR="#298C52">struct</FONT> IsdnCard *card))
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = card-&gt;cs;
<FONT COLOR="#298C52">char</FONT> tmp[64];
strcpy(tmp, amd7930_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: AMD7930 driver Rev. %s\n"</FONT>, HiSax_getrev(tmp));
<FONT COLOR="#298C52">if</FONT> (cs-&gt;typ != <A HREF="hisax.h.shtml#ISDN_CTYPE_AMD7930">ISDN_CTYPE_AMD7930</A>)
<FONT COLOR="#298C52">return</FONT> (0);
cs-&gt;irq = amd7930_get_irqnum(0);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;irq == 0)
<FONT COLOR="#298C52">return</FONT> (0);
cs-&gt;cardmsg = &amp;amd7930_card_msg;
<FONT COLOR="#298C52">return</FONT> (1);
}
</BODY>
</HTML>

View File

@ -0,0 +1,97 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>arcofi.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>arcofi.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* arcofi.h Ansteuerung ARCOFI 2165
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
*
* $Log$
* Revision 1.3 1998/05/25 12:57:38 keil
* HiSax golden code from certification, Don't use !!!
* No leased lines, no X75, but many changes.
*
* Revision 1.2 1998/04/15 16:47:16 keil
* new interface
*
* Revision 1.1 1997/10/29 18:51:20 keil
* New files
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isdnl1.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isac.h"</FONT>
<FONT COLOR="#298C52">int</FONT>
send_arcofi(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">const</FONT> u_char *msg, <FONT COLOR="#298C52">int</FONT> bc, <FONT COLOR="#298C52">int</FONT> receive) {
u_char val;
<FONT COLOR="#298C52">char</FONT> tmp[32];
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">int</FONT> cnt=50;
cs-&gt;mon_txp = 0;
cs-&gt;mon_txc = msg[0];
memcpy(cs-&gt;mon_tx, &amp;msg[1], cs-&gt;mon_txc);
<FONT COLOR="#298C52">switch</FONT>(bc) {
<FONT COLOR="#298C52">case</FONT> 0: <FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> 1: cs-&gt;mon_tx[1] |= 0x40;
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">default</FONT>: <FONT COLOR="#298C52">break</FONT>;
}
cs-&gt;mocr &amp;= 0x0f;
cs-&gt;mocr |= 0xa0;
test_and_clear_bit(<A HREF="hisax.h.shtml#HW_MON1_TX_END">HW_MON1_TX_END</A>, &amp;cs-&gt;HW_Flags);
<FONT COLOR="#298C52">if</FONT> (receive)
test_and_clear_bit(<A HREF="hisax.h.shtml#HW_MON1_RX_END">HW_MON1_RX_END</A>, &amp;cs-&gt;HW_Flags);
cs-&gt;writeisac(cs, <A HREF="isac.h.shtml#ISAC_MOCR">ISAC_MOCR</A>, cs-&gt;mocr);
val = cs-&gt;readisac(cs, <A HREF="isac.h.shtml#ISAC_MOSR">ISAC_MOSR</A>);
cs-&gt;writeisac(cs, <A HREF="isac.h.shtml#ISAC_MOX1">ISAC_MOX1</A>, cs-&gt;mon_tx[cs-&gt;mon_txp++]);
cs-&gt;mocr |= 0x10;
cs-&gt;writeisac(cs, <A HREF="isac.h.shtml#ISAC_MOCR">ISAC_MOCR</A>, cs-&gt;mocr);
save_flags(flags);
sti();
<FONT COLOR="#298C52">while</FONT> (cnt &amp;&amp; !test_bit(<A HREF="hisax.h.shtml#HW_MON1_TX_END">HW_MON1_TX_END</A>, &amp;cs-&gt;HW_Flags)) {
cnt--;
udelay(500);
<FONT COLOR=#A521F7>#if</FONT> 0
current-&gt;state = TASK_INTERRUPTIBLE;
current-&gt;timeout = jiffies + (10 * HZ) / 1000; <FONT COLOR=#0000FF>/* Timeout 10ms */</FONT>
schedule();
<FONT COLOR=#A521F7>#endif</FONT>
}
<FONT COLOR="#298C52">if</FONT> (receive) {
<FONT COLOR="#298C52">while</FONT> (cnt &amp;&amp; !test_bit(<A HREF="hisax.h.shtml#HW_MON1_RX_END">HW_MON1_RX_END</A>, &amp;cs-&gt;HW_Flags)) {
cnt--;
udelay(500);
}
}
restore_flags(flags);
sprintf(tmp, <FONT COLOR="#FF0000">"arcofi tout %d"</FONT>, cnt);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
<FONT COLOR="#298C52">return</FONT>(cnt);
}
</BODY>
</HTML>

View File

@ -0,0 +1,46 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>arcofi.h</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>arcofi.h</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* arcofi.h Ansteuerung ARCOFI 2165
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
*
* $Log$
* Revision 1.3 1998/05/25 12:57:39 keil
* HiSax golden code from certification, Don't use !!!
* No leased lines, no X75, but many changes.
*
* Revision 1.2 1998/04/15 16:47:17 keil
* new interface
*
* Revision 1.1 1997/10/29 18:51:20 keil
* New files
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="isac.c.shtml#ARCOFI_USE">ARCOFI_USE</A> 1
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">int</FONT> send_arcofi(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">const</FONT> u_char *msg, <FONT COLOR="#298C52">int</FONT> bc, <FONT COLOR="#298C52">int</FONT> receive);
</BODY>
</HTML>

View File

@ -0,0 +1,314 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>asuscom.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>asuscom.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* asuscom.c low level stuff for ASUSCOM NETWORK INC. ISDNLink cards
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
* Thanks to ASUSCOM NETWORK INC. Taiwan and Dynalink NL for informations
*
*
* $Log$
* Revision 1.3 1998/04/15 16:46:53 keil
* new init code
*
* Revision 1.2 1998/02/02 13:27:06 keil
* New
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A NAME="__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isac.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hscx.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isdnl1.h"</FONT>
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *CardType[];
<FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *Asuscom_revision = <FONT COLOR="#FF0000">"$Revision$"</FONT>;
<FONT COLOR=#A521F7>#define</FONT> <A NAME="byteout">byteout</A>(addr,val) outb(val,addr)
<FONT COLOR=#A521F7>#define</FONT> <A NAME="bytein">bytein</A>(addr) inb(addr)
<FONT COLOR=#A521F7>#define</FONT> <A NAME="ASUS_ISAC">ASUS_ISAC</A> 0
<FONT COLOR=#A521F7>#define</FONT> <A NAME="ASUS_HSCX">ASUS_HSCX</A> 1
<FONT COLOR=#A521F7>#define</FONT> <A NAME="ASUS_ADR">ASUS_ADR</A> 2
<FONT COLOR=#A521F7>#define</FONT> <A NAME="ASUS_CTRL_U7">ASUS_CTRL_U7</A> 3
<FONT COLOR=#A521F7>#define</FONT> <A NAME="ASUS_CTRL_POTS">ASUS_CTRL_POTS</A> 5
<FONT COLOR=#0000FF>/* CARD_ADR (Write) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A NAME="ASUS_RESET">ASUS_RESET</A> 0x80 <FONT COLOR=#0000FF>/* Bit 7 Reset-Leitung */</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> u_char
<A HREF="#readreg">readreg</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off)
{
<FONT COLOR="#298C52">register</FONT> u_char ret;
<FONT COLOR="#298C52">long</FONT> flags;
save_flags(flags);
cli();
<A HREF="#byteout">byteout</A>(ale, off);
ret = <A HREF="#bytein">bytein</A>(adr);
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT> (ret);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#readfifo">readfifo</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
<FONT COLOR=#0000FF>/* fifo read without cli because it's allready done */</FONT>
<A HREF="#byteout">byteout</A>(ale, off);
insb(adr, data, size);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#writereg">writereg</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off, u_char data)
{
<FONT COLOR="#298C52">long</FONT> flags;
save_flags(flags);
cli();
<A HREF="#byteout">byteout</A>(ale, off);
<A HREF="#byteout">byteout</A>(adr, data);
restore_flags(flags);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#writefifo">writefifo</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
<FONT COLOR=#0000FF>/* fifo write without cli because it's allready done */</FONT>
<A HREF="#byteout">byteout</A>(ale, off);
outsb(adr, data, size);
}
<FONT COLOR=#0000FF>/* Interface functions */</FONT>
<FONT COLOR="#298C52">static</FONT> u_char
<A NAME="ReadISAC">ReadISAC</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char offset)
{
<FONT COLOR="#298C52">return</FONT> (<A HREF="#readreg">readreg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, offset));
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#WriteISAC">WriteISAC</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char offset, u_char value)
{
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, offset, value);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#ReadISACfifo">ReadISACfifo</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
<A HREF="#readfifo">readfifo</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, 0, data, size);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#WriteISACfifo">WriteISACfifo</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
<A HREF="#writefifo">writefifo</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, 0, data, size);
}
<FONT COLOR="#298C52">static</FONT> u_char
<A HREF="#ReadHSCX">ReadHSCX</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx, u_char offset)
{
<FONT COLOR="#298C52">return</FONT> (<A HREF="#readreg">readreg</A>(cs-&gt;hw.asus.adr,
cs-&gt;hw.asus.hscx, offset + (hscx ? 0x40 : 0)));
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#WriteHSCX">WriteHSCX</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx, u_char offset, u_char value)
{
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr,
cs-&gt;hw.asus.hscx, offset + (hscx ? 0x40 : 0), value);
}
<FONT COLOR=#0000FF>/*
* fast interrupt HSCX stuff goes here
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#READHSCX">READHSCX</A>(cs, nr, reg) <A HREF="#readreg">readreg</A>(cs-&gt;hw.asus.adr, \
cs-&gt;hw.asus.hscx, reg + (nr ? 0x40 : 0))
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#WRITEHSCX">WRITEHSCX</A>(cs, nr, reg, data) <A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, \
cs-&gt;hw.asus.hscx, reg + (nr ? 0x40 : 0), data)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#READHSCXFIFO" NAME="READHSCXFIFO">READHSCXFIFO</A>(cs, nr, ptr, cnt) <A HREF="#readfifo">readfifo</A>(cs-&gt;hw.asus.adr, \
cs-&gt;hw.asus.hscx, (nr ? 0x40 : 0), ptr, cnt)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#WRITEHSCXFIFO">WRITEHSCXFIFO</A>(cs, nr, ptr, cnt) <A HREF="#writefifo">writefifo</A>(cs-&gt;hw.asus.adr, \
cs-&gt;hw.asus.hscx, (nr ? 0x40 : 0), ptr, cnt)
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hscx_irq.c"</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#asuscom_interrupt" NAME="asuscom_interrupt">asuscom_interrupt</A>(<FONT COLOR="#298C52">int</FONT> intno, <FONT COLOR="#298C52">void</FONT> *dev_id, <FONT COLOR="#298C52">struct</FONT> pt_regs *regs)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = dev_id;
u_char val, stat = 0;
<FONT COLOR="#298C52">if</FONT> (!cs) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"ISDNLink: Spurious interrupt!\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
val = <A HREF="#readreg">readreg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.hscx, <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A> + 0x40);
Start_HSCX:
<FONT COLOR="#298C52">if</FONT> (val) {
<A HREF="hscx_irq.c.shtml#hscx_int_main">hscx_int_main</A>(cs, val);
stat |= 1;
}
val = <A HREF="#readreg">readreg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, <A HREF="isac.h.shtml#ISAC_ISTA">ISAC_ISTA</A>);
Start_ISAC:
<FONT COLOR="#298C52">if</FONT> (val) {
<A HREF="isac.c.shtml#isac_interrupt">isac_interrupt</A>(cs, val);
stat |= 2;
}
val = <A HREF="#readreg">readreg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.hscx, <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A> + 0x40);
<FONT COLOR="#298C52">if</FONT> (val) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"HSCX IntStat after IntRoutine"</FONT>);
<FONT COLOR="#298C52">goto</FONT> Start_HSCX;
}
val = <A HREF="#readreg">readreg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, <A HREF="isac.h.shtml#ISAC_ISTA">ISAC_ISTA</A>);
<FONT COLOR="#298C52">if</FONT> (val) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_ISAC">L1_DEB_ISAC</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"ISAC IntStat after IntRoutine"</FONT>);
<FONT COLOR="#298C52">goto</FONT> Start_ISAC;
}
<FONT COLOR="#298C52">if</FONT> (stat &amp; 1) {
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0xFF);
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A> + 0x40, 0xFF);
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0x0);
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A> + 0x40, 0x0);
}
<FONT COLOR="#298C52">if</FONT> (stat &amp; 2) {
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, <A HREF="isac.h.shtml#ISAC_MASK">ISAC_MASK</A>, 0xFF);
<A HREF="#writereg">writereg</A>(cs-&gt;hw.asus.adr, cs-&gt;hw.asus.isac, <A HREF="isac.h.shtml#ISAC_MASK">ISAC_MASK</A>, 0x0);
}
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="release_io_asuscom">release_io_asuscom</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">int</FONT> bytecnt = 8;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.asus.cfg_reg)
release_region(cs-&gt;hw.asus.cfg_reg, bytecnt);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A NAME="reset_asuscom">reset_asuscom</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">long</FONT> flags;
<A HREF="#byteout">byteout</A>(cs-&gt;hw.asus.adr, <A HREF="#ASUS_RESET">ASUS_RESET</A>); <FONT COLOR=#0000FF>/* Reset On */</FONT>
save_flags(flags);
sti();
current-&gt;state = TASK_INTERRUPTIBLE;
current-&gt;timeout = jiffies + 1;
schedule();
<A HREF="#byteout">byteout</A>(cs-&gt;hw.asus.adr, 0); <FONT COLOR=#0000FF>/* Reset Off */</FONT>
current-&gt;state = TASK_INTERRUPTIBLE;
current-&gt;timeout = jiffies + 1;
schedule();
restore_flags(flags);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT>
<A HREF="#Asus_card_msg" NAME="Asus_card_msg">Asus_card_msg</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> mt, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">switch</FONT> (mt) {
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RESET">CARD_RESET</A>:
<A HREF="#reset_asuscom">reset_asuscom</A>(cs);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RELEASE">CARD_RELEASE</A>:
<A HREF="#release_io_asuscom">release_io_asuscom</A>(cs);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_SETIRQ">CARD_SETIRQ</A>:
<FONT COLOR="#298C52">return</FONT>(request_irq(cs-&gt;irq, &amp;<A HREF="#asuscom_interrupt">asuscom_interrupt</A>,
<A HREF="hisax.h.shtml#I4L_IRQ_FLAG">I4L_IRQ_FLAG</A>, <FONT COLOR="#FF0000">"HiSax"</FONT>, cs));
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_INIT">CARD_INIT</A>:
inithscxisac(cs, 3);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_TEST">CARD_TEST</A>:
<FONT COLOR="#298C52">return</FONT>(0);
}
<FONT COLOR="#298C52">return</FONT>(0);
}
<A NAME="__initfunc">__initfunc</A>(<FONT COLOR="#298C52">int</FONT>
setup_asuscom(<FONT COLOR="#298C52">struct</FONT> IsdnCard *card))
{
<FONT COLOR="#298C52">int</FONT> bytecnt;
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = card-&gt;cs;
<FONT COLOR="#298C52">char</FONT> tmp[64];
strcpy(tmp, Asuscom_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: Asuscom ISDNLink driver Rev. %s\n"</FONT>, HiSax_getrev(tmp));
<FONT COLOR="#298C52">if</FONT> (cs-&gt;typ != <A HREF="hisax.h.shtml#ISDN_CTYPE_ASUSCOM">ISDN_CTYPE_ASUSCOM</A>)
<FONT COLOR="#298C52">return</FONT> (0);
bytecnt = 8;
cs-&gt;hw.asus.cfg_reg = card-&gt;para[1];
cs-&gt;irq = card-&gt;para[0];
cs-&gt;hw.asus.adr = cs-&gt;hw.asus.cfg_reg + <A HREF="#ASUS_ADR">ASUS_ADR</A>;
cs-&gt;hw.asus.isac = cs-&gt;hw.asus.cfg_reg + <A HREF="#ASUS_ISAC">ASUS_ISAC</A>;
cs-&gt;hw.asus.hscx = cs-&gt;hw.asus.cfg_reg + <A HREF="#ASUS_HSCX">ASUS_HSCX</A>;
cs-&gt;hw.asus.u7 = cs-&gt;hw.asus.cfg_reg + <A HREF="#ASUS_CTRL_U7">ASUS_CTRL_U7</A>;
cs-&gt;hw.asus.pots = cs-&gt;hw.asus.cfg_reg + <A HREF="#ASUS_CTRL_POTS">ASUS_CTRL_POTS</A>;
<FONT COLOR="#298C52">if</FONT> (check_region((cs-&gt;hw.asus.cfg_reg), bytecnt)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s config port %x-%x already in use\n"</FONT>,
CardType[card-&gt;typ],
cs-&gt;hw.asus.cfg_reg,
cs-&gt;hw.asus.cfg_reg + bytecnt);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.asus.cfg_reg, bytecnt, <FONT COLOR="#FF0000">"asuscom isdn"</FONT>);
}
printk(KERN_INFO
<FONT COLOR="#FF0000">"ISDNLink: defined at 0x%x IRQ %d\n"</FONT>,
cs-&gt;hw.asus.cfg_reg,
cs-&gt;irq);
printk(KERN_INFO <FONT COLOR="#FF0000">"ISDNLink: resetting card\n"</FONT>);
<A HREF="#reset_asuscom">reset_asuscom</A>(cs);
cs-&gt;readisac = &amp;<A HREF="#ReadISAC">ReadISAC</A>;
cs-&gt;writeisac = &amp;<A HREF="#WriteISAC">WriteISAC</A>;
cs-&gt;readisacfifo = &amp;<A HREF="#ReadISACfifo">ReadISACfifo</A>;
cs-&gt;writeisacfifo = &amp;<A HREF="#WriteISACfifo">WriteISACfifo</A>;
cs-&gt;BC_Read_Reg = &amp;<A HREF="#ReadHSCX">ReadHSCX</A>;
cs-&gt;BC_Write_Reg = &amp;<A HREF="#WriteHSCX">WriteHSCX</A>;
cs-&gt;BC_Send_Data = &amp;<A HREF="hscx_irq.c.shtml#hscx_fill_fifo">hscx_fill_fifo</A>;
cs-&gt;cardmsg = &amp;<A HREF="#Asus_card_msg">Asus_card_msg</A>;
<A HREF="isac.c.shtml#ISACVersion">ISACVersion</A>(cs, <FONT COLOR="#FF0000">"ISDNLink:"</FONT>);
<FONT COLOR="#298C52">if</FONT> (HscxVersion(cs, <FONT COLOR="#FF0000">"ISDNLink:"</FONT>)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"ISDNLink: wrong HSCX versions check IO address\n"</FONT>);
<A HREF="#release_io_asuscom">release_io_asuscom</A>(cs);
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">return</FONT> (1);
}
</BODY>
</HTML>

View File

@ -0,0 +1,408 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>avm_a1.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>avm_a1.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* avm_a1.c low level stuff for AVM A1 (Fritz) isdn cards
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
* $Log$
* Revision 2.8 1998/04/15 16:44:27 keil
* new init code
*
* Revision 2.7 1998/02/02 13:29:37 keil
* fast io
*
* Revision 2.6 1998/01/13 23:09:46 keil
* really disable timer
*
* Revision 2.5 1998/01/02 06:50:29 calle
* Perodic timer of A1 now disabled, no need for linux driver.
*
* Revision 2.4 1997/11/08 21:35:42 keil
* new l1 init
*
* Revision 2.3 1997/11/06 17:13:32 keil
* New 2.1 init code
*
* Revision 2.2 1997/10/29 18:55:48 keil
* changes for 2.1.60 (irq2dev_map)
*
* Revision 2.1 1997/07/27 21:47:13 keil
* new interface structures
*
* Revision 2.0 1997/06/26 11:02:48 keil
* New Layer and card interface
*
* Revision 1.6 1997/04/13 19:54:07 keil
* Change in IRQ check delay for SMP
*
* Revision 1.5 1997/04/06 22:54:10 keil
* Using SKB's
*
* Revision 1.4 1997/01/27 15:50:21 keil
* SMP proof,cosmetics
*
* Revision 1.3 1997/01/21 22:14:20 keil
* cleanups
*
* Revision 1.2 1996/10/27 22:07:31 keil
* cosmetic changes
*
* Revision 1.1 1996/10/13 20:04:49 keil
* Initial revision
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isac.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hscx.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isdnl1.h"</FONT>
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *CardType[];
<FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *avm_revision = <FONT COLOR="#FF0000">"$Revision$"</FONT>;
<FONT COLOR=#A521F7>#define</FONT> AVM_A1_STAT_ISAC 0x01
<FONT COLOR=#A521F7>#define</FONT> AVM_A1_STAT_HSCX 0x02
<FONT COLOR=#A521F7>#define</FONT> AVM_A1_STAT_TIMER 0x04
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#byteout">byteout</A>(addr,val) outb(val,addr)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#bytein">bytein</A>(addr) inb(addr)
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> u_char
<A HREF="asuscom.c.shtml#readreg">readreg</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off)
{
<FONT COLOR="#298C52">return</FONT> (<A HREF="asuscom.c.shtml#bytein">bytein</A>(adr + off));
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#writereg">writereg</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off, u_char data)
{
<A HREF="asuscom.c.shtml#byteout">byteout</A>(adr + off, data);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
read_fifo(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
insb(adr, data, size);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
write_fifo(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
outsb(adr, data, size);
}
<FONT COLOR=#0000FF>/* Interface functions */</FONT>
<FONT COLOR="#298C52">static</FONT> u_char
<A HREF="asuscom.c.shtml#ReadISAC">ReadISAC</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char offset)
{
<FONT COLOR="#298C52">return</FONT> (<A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.avm.isac, offset));
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#WriteISAC">WriteISAC</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char offset, u_char value)
{
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.isac, offset, value);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#ReadISACfifo">ReadISACfifo</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
read_fifo(cs-&gt;hw.avm.isacfifo, data, size);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#WriteISACfifo">WriteISACfifo</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
write_fifo(cs-&gt;hw.avm.isacfifo, data, size);
}
<FONT COLOR="#298C52">static</FONT> u_char
<A HREF="asuscom.c.shtml#ReadHSCX">ReadHSCX</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx, u_char offset)
{
<FONT COLOR="#298C52">return</FONT> (<A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.avm.hscx[hscx], offset));
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#WriteHSCX">WriteHSCX</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx, u_char offset, u_char value)
{
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.hscx[hscx], offset, value);
}
<FONT COLOR=#0000FF>/*
* fast interrupt HSCX stuff goes here
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, nr, reg) <A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.avm.hscx[nr], reg)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#WRITEHSCX">WRITEHSCX</A>(cs, nr, reg, data) <A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.hscx[nr], reg, data)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#READHSCXFIFO">READHSCXFIFO</A>(cs, nr, ptr, cnt) read_fifo(cs-&gt;hw.avm.hscxfifo[nr], ptr, cnt)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#WRITEHSCXFIFO">WRITEHSCXFIFO</A>(cs, nr, ptr, cnt) write_fifo(cs-&gt;hw.avm.hscxfifo[nr], ptr, cnt)
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hscx_irq.c"</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
avm_a1_interrupt(<FONT COLOR="#298C52">int</FONT> intno, <FONT COLOR="#298C52">void</FONT> *dev_id, <FONT COLOR="#298C52">struct</FONT> pt_regs *regs)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = dev_id;
u_char val, sval, stat = 0;
<FONT COLOR="#298C52">char</FONT> tmp[32];
<FONT COLOR="#298C52">if</FONT> (!cs) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"AVM A1: Spurious interrupt!\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">while</FONT> (((sval = <A HREF="asuscom.c.shtml#bytein">bytein</A>(cs-&gt;hw.avm.cfg_reg)) &amp; 0xf) != 0x7) {
<FONT COLOR="#298C52">if</FONT> (!(sval &amp; AVM_A1_STAT_TIMER)) {
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg, 0x1E);
sval = <A HREF="asuscom.c.shtml#bytein">bytein</A>(cs-&gt;hw.avm.cfg_reg);
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_INTSTAT">L1_DEB_INTSTAT</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"avm IntStatus %x"</FONT>, sval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (!(sval &amp; AVM_A1_STAT_HSCX)) {
val = <A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.avm.hscx[1], <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A>);
<FONT COLOR="#298C52">if</FONT> (val) {
<A HREF="hscx_irq.c.shtml#hscx_int_main">hscx_int_main</A>(cs, val);
stat |= 1;
}
}
<FONT COLOR="#298C52">if</FONT> (!(sval &amp; AVM_A1_STAT_ISAC)) {
val = <A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.avm.isac, <A HREF="isac.h.shtml#ISAC_ISTA">ISAC_ISTA</A>);
<FONT COLOR="#298C52">if</FONT> (val) {
<A HREF="isac.c.shtml#isac_interrupt">isac_interrupt</A>(cs, val);
stat |= 2;
}
}
}
<FONT COLOR="#298C52">if</FONT> (stat &amp; 1) {
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.hscx[0], <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0xFF);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.hscx[1], <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0xFF);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.hscx[0], <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0x0);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.hscx[1], <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0x0);
}
<FONT COLOR="#298C52">if</FONT> (stat &amp; 2) {
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.isac, <A HREF="isac.h.shtml#ISAC_MASK">ISAC_MASK</A>, 0xFF);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.avm.isac, <A HREF="isac.h.shtml#ISAC_MASK">ISAC_MASK</A>, 0x0);
}
}
<FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
release_ioregs(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> mask)
{
release_region(cs-&gt;hw.avm.cfg_reg, 8);
<FONT COLOR="#298C52">if</FONT> (mask &amp; 1)
release_region(cs-&gt;hw.avm.isac + 32, 32);
<FONT COLOR="#298C52">if</FONT> (mask &amp; 2)
release_region(cs-&gt;hw.avm.isacfifo, 1);
<FONT COLOR="#298C52">if</FONT> (mask &amp; 4)
release_region(cs-&gt;hw.avm.hscx[0] + 32, 32);
<FONT COLOR="#298C52">if</FONT> (mask &amp; 8)
release_region(cs-&gt;hw.avm.hscxfifo[0], 1);
<FONT COLOR="#298C52">if</FONT> (mask &amp; 0x10)
release_region(cs-&gt;hw.avm.hscx[1] + 32, 32);
<FONT COLOR="#298C52">if</FONT> (mask &amp; 0x20)
release_region(cs-&gt;hw.avm.hscxfifo[1], 1);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT>
AVM_card_msg(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> mt, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">switch</FONT> (mt) {
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RESET">CARD_RESET</A>:
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RELEASE">CARD_RELEASE</A>:
release_ioregs(cs, 0x3f);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_SETIRQ">CARD_SETIRQ</A>:
<FONT COLOR="#298C52">return</FONT>(request_irq(cs-&gt;irq, &amp;avm_a1_interrupt,
<A HREF="hisax.h.shtml#I4L_IRQ_FLAG">I4L_IRQ_FLAG</A>, <FONT COLOR="#FF0000">"HiSax"</FONT>, cs));
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_INIT">CARD_INIT</A>:
inithscxisac(cs, 1);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg, 0x16);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg, 0x1E);
inithscxisac(cs, 2);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_TEST">CARD_TEST</A>:
<FONT COLOR="#298C52">return</FONT>(0);
}
<FONT COLOR="#298C52">return</FONT>(0);
}
<A HREF="asuscom.c.shtml#__initfunc">__initfunc</A>(<FONT COLOR="#298C52">int</FONT>
setup_avm_a1(<FONT COLOR="#298C52">struct</FONT> IsdnCard *card))
{
u_char val;
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = card-&gt;cs;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">char</FONT> tmp[64];
strcpy(tmp, avm_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: AVM driver Rev. %s\n"</FONT>, HiSax_getrev(tmp));
<FONT COLOR="#298C52">if</FONT> (cs-&gt;typ != <A HREF="hisax.h.shtml#ISDN_CTYPE_A1">ISDN_CTYPE_A1</A>)
<FONT COLOR="#298C52">return</FONT> (0);
cs-&gt;hw.avm.cfg_reg = card-&gt;para[1] + 0x1800;
cs-&gt;hw.avm.isac = card-&gt;para[1] + 0x1400 - 0x20;
cs-&gt;hw.avm.hscx[0] = card-&gt;para[1] + 0x400 - 0x20;
cs-&gt;hw.avm.hscx[1] = card-&gt;para[1] + 0xc00 - 0x20;
cs-&gt;hw.avm.isacfifo = card-&gt;para[1] + 0x1000;
cs-&gt;hw.avm.hscxfifo[0] = card-&gt;para[1];
cs-&gt;hw.avm.hscxfifo[1] = card-&gt;para[1] + 0x800;
cs-&gt;irq = card-&gt;para[0];
<FONT COLOR="#298C52">if</FONT> (check_region((cs-&gt;hw.avm.cfg_reg), 8)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s config port %x-%x already in use\n"</FONT>,
CardType[card-&gt;typ],
cs-&gt;hw.avm.cfg_reg,
cs-&gt;hw.avm.cfg_reg + 8);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.avm.cfg_reg, 8, <FONT COLOR="#FF0000">"avm cfg"</FONT>);
}
<FONT COLOR="#298C52">if</FONT> (check_region((cs-&gt;hw.avm.isac + 32), 32)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s isac ports %x-%x already in use\n"</FONT>,
CardType[cs-&gt;typ],
cs-&gt;hw.avm.isac + 32,
cs-&gt;hw.avm.isac + 64);
release_ioregs(cs, 0);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.avm.isac + 32, 32, <FONT COLOR="#FF0000">"HiSax isac"</FONT>);
}
<FONT COLOR="#298C52">if</FONT> (check_region((cs-&gt;hw.avm.isacfifo), 1)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s isac fifo port %x already in use\n"</FONT>,
CardType[cs-&gt;typ],
cs-&gt;hw.avm.isacfifo);
release_ioregs(cs, 1);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.avm.isacfifo, 1, <FONT COLOR="#FF0000">"HiSax isac fifo"</FONT>);
}
<FONT COLOR="#298C52">if</FONT> (check_region((cs-&gt;hw.avm.hscx[0]) + 32, 32)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s hscx A ports %x-%x already in use\n"</FONT>,
CardType[cs-&gt;typ],
cs-&gt;hw.avm.hscx[0] + 32,
cs-&gt;hw.avm.hscx[0] + 64);
release_ioregs(cs, 3);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.avm.hscx[0] + 32, 32, <FONT COLOR="#FF0000">"HiSax hscx A"</FONT>);
}
<FONT COLOR="#298C52">if</FONT> (check_region(cs-&gt;hw.avm.hscxfifo[0], 1)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s hscx A fifo port %x already in use\n"</FONT>,
CardType[cs-&gt;typ],
cs-&gt;hw.avm.hscxfifo[0]);
release_ioregs(cs, 7);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.avm.hscxfifo[0], 1, <FONT COLOR="#FF0000">"HiSax hscx A fifo"</FONT>);
}
<FONT COLOR="#298C52">if</FONT> (check_region(cs-&gt;hw.avm.hscx[1] + 32, 32)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s hscx B ports %x-%x already in use\n"</FONT>,
CardType[cs-&gt;typ],
cs-&gt;hw.avm.hscx[1] + 32,
cs-&gt;hw.avm.hscx[1] + 64);
release_ioregs(cs, 0xf);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.avm.hscx[1] + 32, 32, <FONT COLOR="#FF0000">"HiSax hscx B"</FONT>);
}
<FONT COLOR="#298C52">if</FONT> (check_region(cs-&gt;hw.avm.hscxfifo[1], 1)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s hscx B fifo port %x already in use\n"</FONT>,
CardType[cs-&gt;typ],
cs-&gt;hw.avm.hscxfifo[1]);
release_ioregs(cs, 0x1f);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.avm.hscxfifo[1], 1, <FONT COLOR="#FF0000">"HiSax hscx B fifo"</FONT>);
}
save_flags(flags);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg, 0x0);
sti();
<A HREF="hisax.h.shtml#HZDELAY">HZDELAY</A>(HZ / 5 + 1);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg, 0x1);
<A HREF="hisax.h.shtml#HZDELAY">HZDELAY</A>(HZ / 5 + 1);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg, 0x0);
<A HREF="hisax.h.shtml#HZDELAY">HZDELAY</A>(HZ / 5 + 1);
val = cs-&gt;irq;
<FONT COLOR="#298C52">if</FONT> (val == 9)
val = 2;
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg + 1, val);
<A HREF="hisax.h.shtml#HZDELAY">HZDELAY</A>(HZ / 5 + 1);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.avm.cfg_reg, 0x0);
<A HREF="hisax.h.shtml#HZDELAY">HZDELAY</A>(HZ / 5 + 1);
restore_flags(flags);
val = <A HREF="asuscom.c.shtml#bytein">bytein</A>(cs-&gt;hw.avm.cfg_reg);
printk(KERN_INFO <FONT COLOR="#FF0000">"AVM A1: Byte at %x is %x\n"</FONT>,
cs-&gt;hw.avm.cfg_reg, val);
val = <A HREF="asuscom.c.shtml#bytein">bytein</A>(cs-&gt;hw.avm.cfg_reg + 3);
printk(KERN_INFO <FONT COLOR="#FF0000">"AVM A1: Byte at %x is %x\n"</FONT>,
cs-&gt;hw.avm.cfg_reg + 3, val);
val = <A HREF="asuscom.c.shtml#bytein">bytein</A>(cs-&gt;hw.avm.cfg_reg + 2);
printk(KERN_INFO <FONT COLOR="#FF0000">"AVM A1: Byte at %x is %x\n"</FONT>,
cs-&gt;hw.avm.cfg_reg + 2, val);
val = <A HREF="asuscom.c.shtml#bytein">bytein</A>(cs-&gt;hw.avm.cfg_reg);
printk(KERN_INFO <FONT COLOR="#FF0000">"AVM A1: Byte at %x is %x\n"</FONT>,
cs-&gt;hw.avm.cfg_reg, val);
printk(KERN_INFO
<FONT COLOR="#FF0000">"HiSax: %s config irq:%d cfg:0x%X\n"</FONT>,
CardType[cs-&gt;typ], cs-&gt;irq,
cs-&gt;hw.avm.cfg_reg);
printk(KERN_INFO
<FONT COLOR="#FF0000">"HiSax: isac:0x%X/0x%X\n"</FONT>,
cs-&gt;hw.avm.isac + 32, cs-&gt;hw.avm.isacfifo);
printk(KERN_INFO
<FONT COLOR="#FF0000">"HiSax: hscx A:0x%X/0x%X hscx B:0x%X/0x%X\n"</FONT>,
cs-&gt;hw.avm.hscx[0] + 32, cs-&gt;hw.avm.hscxfifo[0],
cs-&gt;hw.avm.hscx[1] + 32, cs-&gt;hw.avm.hscxfifo[1]);
cs-&gt;readisac = &amp;<A HREF="asuscom.c.shtml#ReadISAC">ReadISAC</A>;
cs-&gt;writeisac = &amp;<A HREF="asuscom.c.shtml#WriteISAC">WriteISAC</A>;
cs-&gt;readisacfifo = &amp;<A HREF="asuscom.c.shtml#ReadISACfifo">ReadISACfifo</A>;
cs-&gt;writeisacfifo = &amp;<A HREF="asuscom.c.shtml#WriteISACfifo">WriteISACfifo</A>;
cs-&gt;BC_Read_Reg = &amp;<A HREF="asuscom.c.shtml#ReadHSCX">ReadHSCX</A>;
cs-&gt;BC_Write_Reg = &amp;<A HREF="asuscom.c.shtml#WriteHSCX">WriteHSCX</A>;
cs-&gt;BC_Send_Data = &amp;<A HREF="hscx_irq.c.shtml#hscx_fill_fifo">hscx_fill_fifo</A>;
cs-&gt;cardmsg = &amp;AVM_card_msg;
<A HREF="isac.c.shtml#ISACVersion">ISACVersion</A>(cs, <FONT COLOR="#FF0000">"AVM A1:"</FONT>);
<FONT COLOR="#298C52">if</FONT> (HscxVersion(cs, <FONT COLOR="#FF0000">"AVM A1:"</FONT>)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"AVM A1: wrong HSCX versions check IO address\n"</FONT>);
release_ioregs(cs, 0x3f);
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">return</FONT> (1);
}
</BODY>
</HTML>

2075
workshop/hisax/callc.c.shtml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,685 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>config.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>config.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* Author Karsten Keil (keil@temic-ech.spacenet.de)
* based on the teles driver from Jan den Ouden
*
*
* $Log$
* Revision 2.16 1998/05/25 14:10:03 keil
* HiSax 3.0
* X.75 and leased are working again.
*
* Revision 2.15 1998/05/25 12:57:43 keil
* HiSax golden code from certification, Don't use !!!
* No leased lines, no X75, but many changes.
*
* Revision 2.14 1998/04/15 16:38:25 keil
* Add S0Box and Teles PCI support
*
* Revision 2.13 1998/03/09 23:19:23 keil
* Changes for PCMCIA
*
* Revision 2.12 1998/02/11 17:28:02 keil
* Niccy PnP/PCI support
*
* Revision 2.11 1998/02/09 21:26:13 keil
* fix export module for 2.1
*
* Revision 2.10 1998/02/09 18:46:05 keil
* Support for Sedlbauer PCMCIA (Marcus Niemann)
*
* Revision 2.9 1998/02/03 23:31:28 keil
* add AMD7930 support
*
* Revision 2.8 1998/02/02 13:32:59 keil
* New card support
*
* Revision 2.7 1998/01/31 21:41:44 keil
* changes for newer 2.1 kernels
*
* Revision 2.6 1997/11/08 21:35:43 keil
* new l1 init
*
* Revision 2.5 1997/11/06 17:15:08 keil
* New 2.1 init; PCMCIA wrapper changes
*
* Revision 2.4 1997/10/29 19:07:52 keil
* changes for 2.1
*
* Revision 2.3 1997/10/01 09:21:33 fritz
* Removed old compatibility stuff for 2.0.X kernels.
* From now on, this code is for 2.1.X ONLY!
* Old stuff is still in the separate branch.
*
* Revision 2.2 1997/09/11 17:24:46 keil
* Add new cards
*
* Revision 2.1 1997/07/27 21:41:35 keil
* version change
*
* Revision 2.0 1997/06/26 11:06:28 keil
* New card and L1 interface.
* Eicon.Diehl Diva and Dynalink IS64PH support
*
* old changes removed /KKe
*
*/</FONT>
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/types.h&gt;
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/stddef.h&gt;
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/timer.h&gt;
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/config.h&gt;
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#0000FF>/*
* This structure array contains one entry per card. An entry looks
* like this:
*
* { type, protocol, p0, p1, p2, NULL }
*
* type
* 1 Teles 16.0 p0=irq p1=membase p2=iobase
* 2 Teles 8.0 p0=irq p1=membase
* 3 Teles 16.3 p0=irq p1=iobase
* 4 Creatix PNP p0=irq p1=IO0 (ISAC) p2=IO1 (HSCX)
* 5 AVM A1 (Fritz) p0=irq p1=iobase
* 6 ELSA PC [p0=iobase] or nothing (autodetect)
* 7 ELSA Quickstep p0=irq p1=iobase
* 8 Teles PCMCIA p0=irq p1=iobase
* 9 ITK ix1-micro p0=irq p1=iobase
* 10 ELSA PCMCIA p0=irq p1=iobase
* 11 Eicon.Diehl Diva p0=irq p1=iobase
* 12 Asuscom ISDNLink p0=irq p1=iobase
* 13 Teleint p0=irq p1=iobase
* 14 Teles 16.3c p0=irq p1=iobase
* 15 Sedlbauer speed p0=irq p1=iobase
* 16 USR Sportster internal p0=irq p1=iobase
* 17 MIC card p0=irq p1=iobase
* 18 ELSA Quickstep 1000PCI no parameter
* 19 Compaq ISDN S0 ISA card p0=irq p1=IO0 (HSCX) p2=IO1 (ISAC) p3=IO2
* 20 Travers Technologies NETjet PCI card
* 21 reserved TELES PCI
* 22 Sedlbauer Speed Star p0=irq p1=iobase
* 23 reserved
* 24 Dr Neuhaus Niccy PnP/PCI card p0=irq p1=IO0 p2=IO1 (PnP only)
*
*
* protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1
*
*
*/</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_ELSA
<FONT COLOR=#A521F7>#define</FONT> <A NAME="DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_ELSA">ISDN_CTYPE_ELSA</A>
<FONT COLOR=#A521F7>#define</FONT> <A NAME="DEFAULT_CFG">DEFAULT_CFG</A> {0,0,0,0}
<FONT COLOR="#298C52">int</FONT> <A HREF="#elsa_init_pcmcia">elsa_init_pcmcia</A>(<FONT COLOR="#298C52">void</FONT>*, <FONT COLOR="#298C52">int</FONT>, <FONT COLOR="#298C52">int</FONT>*, <FONT COLOR="#298C52">int</FONT>);
EXPORT_SYMBOL(<A HREF="#elsa_init_pcmcia">elsa_init_pcmcia</A>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_AVM_A1
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_A1">ISDN_CTYPE_A1</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {10,0x340,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_16_3
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_16_3">ISDN_CTYPE_16_3</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {15,0x180,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_S0BOX
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_S0BOX">ISDN_CTYPE_S0BOX</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {7,0x378,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_16_0
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_16_0">ISDN_CTYPE_16_0</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {15,0xd0000,0xd80,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_TELESPCI
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_TELESPCI">ISDN_CTYPE_TELESPCI</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {0,0,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_IX1MICROR2
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_IX1MICROR2">ISDN_CTYPE_IX1MICROR2</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {5,0x390,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_DIEHLDIVA
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_DIEHLDIVA">ISDN_CTYPE_DIEHLDIVA</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {0,0x0,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_ASUSCOM
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_ASUSCOM">ISDN_CTYPE_ASUSCOM</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {5,0x200,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_TELEINT
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_TELEINT">ISDN_CTYPE_TELEINT</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {5,0x300,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_SEDLBAUER
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_SEDLBAUER">ISDN_CTYPE_SEDLBAUER</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {11,0x270,0,0}
<FONT COLOR="#298C52">int</FONT> <A HREF="#sedl_init_pcmcia">sedl_init_pcmcia</A>(<FONT COLOR="#298C52">void</FONT>*, <FONT COLOR="#298C52">int</FONT>, <FONT COLOR="#298C52">int</FONT>*, <FONT COLOR="#298C52">int</FONT>);
EXPORT_SYMBOL(<A HREF="#sedl_init_pcmcia">sedl_init_pcmcia</A>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_SPORTSTER
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_SPORTSTER">ISDN_CTYPE_SPORTSTER</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {7,0x268,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_MIC
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_MIC">ISDN_CTYPE_MIC</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {12,0x3e0,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_NETJET
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_NETJET">ISDN_CTYPE_NETJET</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {0,0,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_TELES3C
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_TELES3C">ISDN_CTYPE_TELES3C</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {5,0x500,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_AMD7930
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_AMD7930">ISDN_CTYPE_AMD7930</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {12,0x3e0,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_NICCY
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A> <A HREF="hisax.h.shtml#ISDN_CTYPE_NICCY">ISDN_CTYPE_NICCY</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_CFG">DEFAULT_CFG</A> {0,0x0,0,0}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_1TR6
<FONT COLOR=#A521F7>#define</FONT> <A NAME="DEFAULT_PROTO">DEFAULT_PROTO</A> ISDN_PTYPE_1TR6
<FONT COLOR=#A521F7>#define</FONT> <A NAME="DEFAULT_PROTO_NAME">DEFAULT_PROTO_NAME</A> <FONT COLOR="#FF0000">"1TR6"</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_EURO
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A> ISDN_PTYPE_EURO
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_PROTO_NAME">DEFAULT_PROTO_NAME</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_PROTO_NAME">DEFAULT_PROTO_NAME</A> <FONT COLOR="#FF0000">"EURO"</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_NI1
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A> ISDN_PTYPE_NI1
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#DEFAULT_PROTO_NAME">DEFAULT_PROTO_NAME</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_PROTO_NAME">DEFAULT_PROTO_NAME</A> <FONT COLOR="#FF0000">"NI1"</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifndef</FONT> <A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A> ISDN_PTYPE_UNKNOWN
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#DEFAULT_PROTO_NAME">DEFAULT_PROTO_NAME</A> <FONT COLOR="#FF0000">"UNKNOWN"</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifndef</FONT> <A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>
<FONT COLOR=#A521F7>#error</FONT> <FONT COLOR="#FF0000">"HiSax: No cards configured"</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A NAME="FIRST_CARD">FIRST_CARD</A> { \
<A HREF="#DEFAULT_CARD">DEFAULT_CARD</A>, \
<A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A>, \
<A HREF="#DEFAULT_CFG">DEFAULT_CFG</A>, \
NULL, \
}
<FONT COLOR=#A521F7>#define</FONT> <A NAME="EMPTY_CARD">EMPTY_CARD</A> {0, <A HREF="#DEFAULT_PROTO">DEFAULT_PROTO</A>, {0, 0, 0, 0}, NULL}
<FONT COLOR="#298C52">struct</FONT> IsdnCard cards[] =
{
<A HREF="#FIRST_CARD">FIRST_CARD</A>,
<A HREF="#EMPTY_CARD">EMPTY_CARD</A>,
<A HREF="#EMPTY_CARD">EMPTY_CARD</A>,
<A HREF="#EMPTY_CARD">EMPTY_CARD</A>,
<A HREF="#EMPTY_CARD">EMPTY_CARD</A>,
<A HREF="#EMPTY_CARD">EMPTY_CARD</A>,
<A HREF="#EMPTY_CARD">EMPTY_CARD</A>,
<A HREF="#EMPTY_CARD">EMPTY_CARD</A>,
};
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">char</FONT> HiSaxID[64] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> = <FONT COLOR="#FF0000">"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"</FONT> \
<FONT COLOR="#FF0000">"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"</FONT> \
<FONT COLOR="#FF0000">"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"</FONT>;
<FONT COLOR="#298C52">char</FONT> *HiSax_id <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> = HiSaxID;
<FONT COLOR=#A521F7>#ifdef</FONT> MODULE
<FONT COLOR=#0000FF>/* Variables for insmod */</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> type[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{0, 0, 0, 0, 0, 0, 0, 0};
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> protocol[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{0, 0, 0, 0, 0, 0, 0, 0};
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> io[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{0, 0, 0, 0, 0, 0, 0, 0};
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#IO0_IO1">IO0_IO1</A>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_16_3
<FONT COLOR=#A521F7>#define</FONT> <A NAME="IO0_IO1">IO0_IO1</A>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_NICCY
<FONT COLOR=#A521F7>#undef</FONT> <A HREF="#IO0_IO1">IO0_IO1</A>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="#IO0_IO1">IO0_IO1</A>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> <A HREF="#IO0_IO1">IO0_IO1</A>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> io0[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{0, 0, 0, 0, 0, 0, 0, 0};
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> io1[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{0, 0, 0, 0, 0, 0, 0, 0};
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> irq[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{0, 0, 0, 0, 0, 0, 0, 0};
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> mem[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{0, 0, 0, 0, 0, 0, 0, 0};
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">char</FONT> *id <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> = HiSaxID;
MODULE_AUTHOR(<FONT COLOR="#FF0000">"Karsten Keil"</FONT>);
MODULE_PARM(type, <FONT COLOR="#FF0000">"1-8i"</FONT>);
MODULE_PARM(protocol, <FONT COLOR="#FF0000">"1-8i"</FONT>);
MODULE_PARM(io, <FONT COLOR="#FF0000">"1-8i"</FONT>);
MODULE_PARM(irq, <FONT COLOR="#FF0000">"1-8i"</FONT>);
MODULE_PARM(mem, <FONT COLOR="#FF0000">"1-8i"</FONT>);
MODULE_PARM(id, <FONT COLOR="#FF0000">"s"</FONT>);
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_16_3 <FONT COLOR=#0000FF>/* For Creatix/Teles PnP */</FONT>
MODULE_PARM(io0, <FONT COLOR="#FF0000">"1-8i"</FONT>);
MODULE_PARM(io1, <FONT COLOR="#FF0000">"1-8i"</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">int</FONT> nrcards;
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">char</FONT> *l1_revision;
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">char</FONT> *l2_revision;
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">char</FONT> *l3_revision;
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">char</FONT> *lli_revision;
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">char</FONT> *tei_revision;
<A HREF="callc.c.shtml#HISAX_INITFUNC">HISAX_INITFUNC</A>(<FONT COLOR="#298C52">char</FONT> *
HiSax_getrev(<FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *revision))
{
<FONT COLOR="#298C52">char</FONT> *rev;
<FONT COLOR="#298C52">char</FONT> *p;
<FONT COLOR="#298C52">if</FONT> ((p = strchr(revision, <FONT COLOR="#FF0000">':'</FONT>))) {
rev = p + 2;
p = strchr(rev, <FONT COLOR="#FF0000">'$'</FONT>);
*--p = 0;
} <FONT COLOR="#298C52">else</FONT>
rev = <FONT COLOR="#FF0000">"???"</FONT>;
<FONT COLOR="#298C52">return</FONT> rev;
}
<A HREF="callc.c.shtml#HISAX_INITFUNC">HISAX_INITFUNC</A>(<FONT COLOR="#298C52">void</FONT>
HiSaxVersion(<FONT COLOR="#298C52">void</FONT>))
{
<FONT COLOR="#298C52">char</FONT> tmp[64];
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: Linux Driver for passive ISDN cards\n"</FONT>);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: Version 3.0\n"</FONT>);
strcpy(tmp, l1_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: Layer1 Revision %s\n"</FONT>, HiSax_getrev(tmp));
strcpy(tmp, l2_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: Layer2 Revision %s\n"</FONT>, HiSax_getrev(tmp));
strcpy(tmp, tei_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: TeiMgr Revision %s\n"</FONT>, HiSax_getrev(tmp));
strcpy(tmp, l3_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: Layer3 Revision %s\n"</FONT>, HiSax_getrev(tmp));
strcpy(tmp, lli_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: LinkLayer Revision %s\n"</FONT>, HiSax_getrev(tmp));
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="HiSax_mod_dec_use_count">HiSax_mod_dec_use_count</A>(<FONT COLOR="#298C52">void</FONT>)
{
MOD_DEC_USE_COUNT;
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="HiSax_mod_inc_use_count">HiSax_mod_inc_use_count</A>(<FONT COLOR="#298C52">void</FONT>)
{
MOD_INC_USE_COUNT;
}
<FONT COLOR=#A521F7>#ifdef</FONT> MODULE
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HiSax_init">HiSax_init</A> init_module
<FONT COLOR=#A521F7>#else</FONT>
<A HREF="asuscom.c.shtml#__initfunc">__initfunc</A>(<FONT COLOR="#298C52">void</FONT>
HiSax_setup(<FONT COLOR="#298C52">char</FONT> *str, <FONT COLOR="#298C52">int</FONT> *ints))
{
<FONT COLOR="#298C52">int</FONT> i, j, argc;
argc = ints[0];
i = 0;
j = 1;
<FONT COLOR="#298C52">while</FONT> (argc &amp;&amp; (i &lt; <A HREF="hisax.h.shtml#HISAX_MAX_CARDS">HISAX_MAX_CARDS</A>)) {
<FONT COLOR="#298C52">if</FONT> (argc) {
cards[i].typ = ints[j];
j++;
argc--;
}
<FONT COLOR="#298C52">if</FONT> (argc) {
cards[i].protocol = ints[j];
j++;
argc--;
}
<FONT COLOR="#298C52">if</FONT> (argc) {
cards[i].para[0] = ints[j];
j++;
argc--;
}
<FONT COLOR="#298C52">if</FONT> (argc) {
cards[i].para[1] = ints[j];
j++;
argc--;
}
<FONT COLOR="#298C52">if</FONT> (argc) {
cards[i].para[2] = ints[j];
j++;
argc--;
}
i++;
}
<FONT COLOR="#298C52">if</FONT> (strlen(str)) {
strcpy(HiSaxID, str);
HiSax_id = HiSaxID;
} <FONT COLOR="#298C52">else</FONT> {
strcpy(HiSaxID, <FONT COLOR="#FF0000">"HiSax"</FONT>);
HiSax_id = HiSaxID;
}
}
<FONT COLOR=#A521F7>#endif</FONT>
<A HREF="asuscom.c.shtml#__initfunc">__initfunc</A>(<FONT COLOR="#298C52">int</FONT>
<A HREF="#HiSax_init">HiSax_init</A>(<FONT COLOR="#298C52">void</FONT>))
{
<FONT COLOR="#298C52">int</FONT> i;
<FONT COLOR=#A521F7>#ifdef</FONT> MODULE
<FONT COLOR="#298C52">int</FONT> nzproto = 0;
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_ELSA
<FONT COLOR="#298C52">if</FONT> (type[0] == <A HREF="hisax.h.shtml#ISDN_CTYPE_ELSA_PCMCIA">ISDN_CTYPE_ELSA_PCMCIA</A>) {
<FONT COLOR=#0000FF>/* we have exported and return in this case */</FONT>
<FONT COLOR="#298C52">return</FONT> 0;
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_SEDLBAUER
<FONT COLOR="#298C52">if</FONT> (type[0] == <A HREF="hisax.h.shtml#ISDN_CTYPE_SEDLBAUER_PCMCIA">ISDN_CTYPE_SEDLBAUER_PCMCIA</A>) {
<FONT COLOR=#0000FF>/* we have to export and return in this case */</FONT>
<FONT COLOR="#298C52">return</FONT> 0;
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
nrcards = 0;
HiSaxVersion();
<FONT COLOR=#A521F7>#ifdef</FONT> MODULE
<FONT COLOR="#298C52">if</FONT> (id) <FONT COLOR=#0000FF>/* If id= string used */</FONT>
HiSax_id = id;
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; <A HREF="hisax.h.shtml#HISAX_MAX_CARDS">HISAX_MAX_CARDS</A>; i++) {
cards[i].typ = type[i];
<FONT COLOR="#298C52">if</FONT> (protocol[i]) {
cards[i].protocol = protocol[i];
nzproto++;
}
<FONT COLOR="#298C52">switch</FONT> (type[i]) {
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_16_0">ISDN_CTYPE_16_0</A>:
cards[i].para[0] = irq[i];
cards[i].para[1] = mem[i];
cards[i].para[2] = io[i];
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_8_0">ISDN_CTYPE_8_0</A>:
cards[i].para[0] = irq[i];
cards[i].para[1] = mem[i];
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR=#A521F7>#ifdef</FONT> <A HREF="#IO0_IO1">IO0_IO1</A>
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_PNP">ISDN_CTYPE_PNP</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_NICCY">ISDN_CTYPE_NICCY</A>:
cards[i].para[0] = irq[i];
cards[i].para[1] = io0[i];
cards[i].para[2] = io1[i];
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_COMPAQ_ISA">ISDN_CTYPE_COMPAQ_ISA</A>:
cards[i].para[0] = irq[i];
cards[i].para[1] = io0[i];
cards[i].para[2] = io1[i];
cards[i].para[3] = io[i];
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_ELSA">ISDN_CTYPE_ELSA</A>:
cards[i].para[0] = io[i];
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_16_3">ISDN_CTYPE_16_3</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_TELESPCMCIA">ISDN_CTYPE_TELESPCMCIA</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_A1">ISDN_CTYPE_A1</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_ELSA_PNP">ISDN_CTYPE_ELSA_PNP</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_ELSA_PCMCIA">ISDN_CTYPE_ELSA_PCMCIA</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_IX1MICROR2">ISDN_CTYPE_IX1MICROR2</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_DIEHLDIVA">ISDN_CTYPE_DIEHLDIVA</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_ASUSCOM">ISDN_CTYPE_ASUSCOM</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_TELEINT">ISDN_CTYPE_TELEINT</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_SEDLBAUER">ISDN_CTYPE_SEDLBAUER</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_SEDLBAUER_PCMCIA">ISDN_CTYPE_SEDLBAUER_PCMCIA</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_SPORTSTER">ISDN_CTYPE_SPORTSTER</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_MIC">ISDN_CTYPE_MIC</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_TELES3C">ISDN_CTYPE_TELES3C</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_S0BOX">ISDN_CTYPE_S0BOX</A>:
cards[i].para[0] = irq[i];
cards[i].para[1] = io[i];
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_ELSA_PCI">ISDN_CTYPE_ELSA_PCI</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_NETJET">ISDN_CTYPE_NETJET</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_AMD7930">ISDN_CTYPE_AMD7930</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#ISDN_CTYPE_TELESPCI">ISDN_CTYPE_TELESPCI</A>:
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR="#298C52">if</FONT> (!nzproto) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: Warning - no protocol specified\n"</FONT>);
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: Note! module load syntax has changed.\n"</FONT>);
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: using protocol %s\n"</FONT>, <A HREF="#DEFAULT_PROTO_NAME">DEFAULT_PROTO_NAME</A>);
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (!HiSax_id)
HiSax_id = HiSaxID;
<FONT COLOR="#298C52">if</FONT> (!HiSaxID[0])
strcpy(HiSaxID, <FONT COLOR="#FF0000">"HiSax"</FONT>);
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; <A HREF="hisax.h.shtml#HISAX_MAX_CARDS">HISAX_MAX_CARDS</A>; i++)
<FONT COLOR="#298C52">if</FONT> (cards[i].typ &gt; 0)
nrcards++;
printk(KERN_DEBUG <FONT COLOR="#FF0000">"HiSax: Total %d card%s defined\n"</FONT>,
nrcards, (nrcards &gt; 1) ? <FONT COLOR="#FF0000">"s"</FONT> : <FONT COLOR="#FF0000">""</FONT>);
CallcNew();
Isdnl3New();
Isdnl2New();
TeiNew();
Isdnl1New();
<FONT COLOR="#298C52">if</FONT> (HiSax_inithardware(NULL)) {
<FONT COLOR=#0000FF>/* Install only, if at least one card found */</FONT>
<FONT COLOR=#0000FF>/* No symbols to export, hide all symbols */</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> MODULE
EXPORT_NO_SYMBOLS;
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: module installed\n"</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
<A HREF="isdnl1.c.shtml#Isdnl1Free">Isdnl1Free</A>();
<A HREF="tei.c.shtml#TeiFree">TeiFree</A>();
<A HREF="isdnl2.c.shtml#Isdnl2Free">Isdnl2Free</A>();
<A HREF="isdnl3.c.shtml#Isdnl3Free">Isdnl3Free</A>();
<A HREF="callc.c.shtml#CallcFree">CallcFree</A>();
<FONT COLOR="#298C52">return</FONT> -EIO;
}
}
<FONT COLOR=#A521F7>#ifdef</FONT> MODULE
<FONT COLOR="#298C52">void</FONT>
<A NAME="cleanup_module">cleanup_module</A>(<FONT COLOR="#298C52">void</FONT>)
{
<FONT COLOR="#298C52">int</FONT> cardnr = nrcards -1;
<FONT COLOR="#298C52">long</FONT> flags;
save_flags(flags);
cli();
<FONT COLOR="#298C52">while</FONT>(cardnr&gt;=0)
<A HREF="isdnl1.c.shtml#HiSax_closecard">HiSax_closecard</A>(cardnr--);
<A HREF="isdnl1.c.shtml#Isdnl1Free">Isdnl1Free</A>();
<A HREF="tei.c.shtml#TeiFree">TeiFree</A>();
<A HREF="isdnl2.c.shtml#Isdnl2Free">Isdnl2Free</A>();
<A HREF="isdnl3.c.shtml#Isdnl3Free">Isdnl3Free</A>();
<A HREF="callc.c.shtml#CallcFree">CallcFree</A>();
restore_flags(flags);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax module removed\n"</FONT>);
}
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_ELSA
<FONT COLOR="#298C52">int</FONT> <A HREF="#elsa_init_pcmcia">elsa_init_pcmcia</A>(<FONT COLOR="#298C52">void</FONT> *pcm_iob, <FONT COLOR="#298C52">int</FONT> pcm_irq, <FONT COLOR="#298C52">int</FONT> *busy_flag, <FONT COLOR="#298C52">int</FONT> prot)
{
<FONT COLOR="#298C52">int</FONT> i;
<FONT COLOR="#298C52">int</FONT> nzproto = 0;
nrcards = 0;
HiSaxVersion();
<FONT COLOR="#298C52">if</FONT> (id) <FONT COLOR=#0000FF>/* If id= string used */</FONT>
HiSax_id = id;
<FONT COLOR=#0000FF>/* Initialize all 8 structs, even though we only accept
two pcmcia cards
*/</FONT>
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; <A HREF="hisax.h.shtml#HISAX_MAX_CARDS">HISAX_MAX_CARDS</A>; i++) {
cards[i].para[0] = irq[i];
cards[i].para[1] = io[i];
cards[i].typ = type[i];
<FONT COLOR="#298C52">if</FONT> (protocol[i]) {
cards[i].protocol = protocol[i];
nzproto++;
}
}
cards[0].para[0] = pcm_irq;
cards[0].para[1] = (<FONT COLOR="#298C52">int</FONT>)pcm_iob;
cards[0].protocol = prot;
cards[0].typ = 10;
nzproto = 1;
<FONT COLOR="#298C52">if</FONT> (!HiSax_id)
HiSax_id = HiSaxID;
<FONT COLOR="#298C52">if</FONT> (!HiSaxID[0])
strcpy(HiSaxID, <FONT COLOR="#FF0000">"HiSax"</FONT>);
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; <A HREF="hisax.h.shtml#HISAX_MAX_CARDS">HISAX_MAX_CARDS</A>; i++)
<FONT COLOR="#298C52">if</FONT> (cards[i].typ &gt; 0)
nrcards++;
printk(KERN_DEBUG <FONT COLOR="#FF0000">"HiSax: Total %d card%s defined\n"</FONT>,
nrcards, (nrcards &gt; 1) ? <FONT COLOR="#FF0000">"s"</FONT> : <FONT COLOR="#FF0000">""</FONT>);
Isdnl1New();
CallcNew();
Isdnl3New();
Isdnl2New();
TeiNew();
HiSax_inithardware(busy_flag);
printk(KERN_NOTICE <FONT COLOR="#FF0000">"HiSax: module installed\n"</FONT>);
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_HISAX_SEDLBAUER
<FONT COLOR="#298C52">int</FONT> <A HREF="#sedl_init_pcmcia">sedl_init_pcmcia</A>(<FONT COLOR="#298C52">void</FONT> *pcm_iob, <FONT COLOR="#298C52">int</FONT> pcm_irq, <FONT COLOR="#298C52">int</FONT> *busy_flag, <FONT COLOR="#298C52">int</FONT> prot)
{
<FONT COLOR="#298C52">int</FONT> i;
<FONT COLOR="#298C52">int</FONT> nzproto = 0;
nrcards = 0;
HiSaxVersion();
<FONT COLOR="#298C52">if</FONT> (id) <FONT COLOR=#0000FF>/* If id= string used */</FONT>
HiSax_id = id;
<FONT COLOR=#0000FF>/* Initialize all 8 structs, even though we only accept
two pcmcia cards
*/</FONT>
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; <A HREF="hisax.h.shtml#HISAX_MAX_CARDS">HISAX_MAX_CARDS</A>; i++) {
cards[i].para[0] = irq[i];
cards[i].para[1] = io[i];
cards[i].typ = type[i];
<FONT COLOR="#298C52">if</FONT> (protocol[i]) {
cards[i].protocol = protocol[i];
nzproto++;
}
}
cards[0].para[0] = pcm_irq;
cards[0].para[1] = (<FONT COLOR="#298C52">int</FONT>)pcm_iob;
cards[0].protocol = prot;
cards[0].typ = <A HREF="hisax.h.shtml#ISDN_CTYPE_SEDLBAUER_PCMCIA">ISDN_CTYPE_SEDLBAUER_PCMCIA</A>;
nzproto = 1;
<FONT COLOR="#298C52">if</FONT> (!HiSax_id)
HiSax_id = HiSaxID;
<FONT COLOR="#298C52">if</FONT> (!HiSaxID[0])
strcpy(HiSaxID, <FONT COLOR="#FF0000">"HiSax"</FONT>);
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; <A HREF="hisax.h.shtml#HISAX_MAX_CARDS">HISAX_MAX_CARDS</A>; i++)
<FONT COLOR="#298C52">if</FONT> (cards[i].typ &gt; 0)
nrcards++;
printk(KERN_DEBUG <FONT COLOR="#FF0000">"HiSax: Total %d card%s defined\n"</FONT>,
nrcards, (nrcards &gt; 1) ? <FONT COLOR="#FF0000">"s"</FONT> : <FONT COLOR="#FF0000">""</FONT>);
Isdnl1New();
CallcNew();
Isdnl3New();
Isdnl2New();
TeiNew();
HiSax_inithardware(busy_flag);
printk(KERN_NOTICE <FONT COLOR="#FF0000">"HiSax: module installed\n"</FONT>);
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
</BODY>
</HTML>

488
workshop/hisax/diva.c.shtml Normal file
View File

@ -0,0 +1,488 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>diva.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>diva.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* diva.c low level stuff for Eicon.Diehl Diva Family ISDN cards
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
* Thanks to Eicon Technology Diehl GmbH &amp; Co. oHG for documents and informations
*
*
* $Log$
* Revision 1.8 1998/05/25 12:57:46 keil
* HiSax golden code from certification, Don't use !!!
* No leased lines, no X75, but many changes.
*
* Revision 1.7 1998/04/15 16:42:36 keil
* new init code
* new PCI init (2.1.94)
*
* Revision 1.6 1998/03/07 22:56:57 tsbogend
* made HiSax working on Linux/Alpha
*
* Revision 1.5 1998/02/02 13:29:38 keil
* fast io
*
* Revision 1.4 1997/11/08 21:35:44 keil
* new l1 init
*
* Revision 1.3 1997/11/06 17:13:33 keil
* New 2.1 init code
*
* Revision 1.2 1997/10/29 18:55:55 keil
* changes for 2.1.60 (irq2dev_map)
*
* Revision 1.1 1997/09/18 17:11:20 keil
* first version
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/config.h&gt;
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isac.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hscx.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isdnl1.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/pci.h&gt;
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *CardType[];
<FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *Diva_revision = <FONT COLOR="#FF0000">"$Revision$"</FONT>;
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#byteout">byteout</A>(addr,val) outb(val,addr)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#bytein">bytein</A>(addr) inb(addr)
<FONT COLOR=#A521F7>#define</FONT> DIVA_HSCX_DATA 0
<FONT COLOR=#A521F7>#define</FONT> DIVA_HSCX_ADR 4
<FONT COLOR=#A521F7>#define</FONT> DIVA_ISA_ISAC_DATA 2
<FONT COLOR=#A521F7>#define</FONT> DIVA_ISA_ISAC_ADR 6
<FONT COLOR=#A521F7>#define</FONT> DIVA_ISA_CTRL 7
<FONT COLOR=#A521F7>#define</FONT> DIVA_PCI_ISAC_DATA 8
<FONT COLOR=#A521F7>#define</FONT> DIVA_PCI_ISAC_ADR 0xc
<FONT COLOR=#A521F7>#define</FONT> DIVA_PCI_CTRL 0x10
<FONT COLOR=#0000FF>/* SUB Types */</FONT>
<FONT COLOR=#A521F7>#define</FONT> DIVA_ISA 1
<FONT COLOR=#A521F7>#define</FONT> DIVA_PCI 2
<FONT COLOR=#0000FF>/* PCI stuff */</FONT>
<FONT COLOR=#A521F7>#define</FONT> PCI_VENDOR_EICON_DIEHL 0x1133
<FONT COLOR=#A521F7>#define</FONT> PCI_DIVA20PRO_ID 0xe001
<FONT COLOR=#A521F7>#define</FONT> PCI_DIVA20_ID 0xe002
<FONT COLOR=#A521F7>#define</FONT> PCI_DIVA20PRO_U_ID 0xe003
<FONT COLOR=#A521F7>#define</FONT> PCI_DIVA20_U_ID 0xe004
<FONT COLOR=#0000FF>/* CTRL (Read) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> DIVA_IRQ_STAT 0x01
<FONT COLOR=#A521F7>#define</FONT> DIVA_EEPROM_SDA 0x02
<FONT COLOR=#0000FF>/* CTRL (Write) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> DIVA_IRQ_REQ 0x01
<FONT COLOR=#A521F7>#define</FONT> DIVA_RESET 0x08
<FONT COLOR=#A521F7>#define</FONT> DIVA_EEPROM_CLK 0x40
<FONT COLOR=#A521F7>#define</FONT> DIVA_PCI_LED_A 0x10
<FONT COLOR=#A521F7>#define</FONT> DIVA_PCI_LED_B 0x20
<FONT COLOR=#A521F7>#define</FONT> DIVA_ISA_LED_A 0x20
<FONT COLOR=#A521F7>#define</FONT> DIVA_ISA_LED_B 0x40
<FONT COLOR=#A521F7>#define</FONT> DIVA_IRQ_CLR 0x80
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> u_char
<A HREF="asuscom.c.shtml#readreg">readreg</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off)
{
<FONT COLOR="#298C52">register</FONT> u_char ret;
<FONT COLOR="#298C52">long</FONT> flags;
save_flags(flags);
cli();
<A HREF="asuscom.c.shtml#byteout">byteout</A>(ale, off);
ret = <A HREF="asuscom.c.shtml#bytein">bytein</A>(adr);
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT> (ret);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#readfifo">readfifo</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off, u_char * data, <FONT COLOR="#298C52">int</FONT> size)
{
<FONT COLOR=#0000FF>/* fifo read without cli because it's allready done */</FONT>
<A HREF="asuscom.c.shtml#byteout">byteout</A>(ale, off);
insb(adr, data, size);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#writereg">writereg</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off, u_char data)
{
<FONT COLOR="#298C52">long</FONT> flags;
save_flags(flags);
cli();
<A HREF="asuscom.c.shtml#byteout">byteout</A>(ale, off);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(adr, data);
restore_flags(flags);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#writefifo">writefifo</A>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> ale, <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> adr, u_char off, u_char *data, <FONT COLOR="#298C52">int</FONT> size)
{
<FONT COLOR=#0000FF>/* fifo write without cli because it's allready done */</FONT>
<A HREF="asuscom.c.shtml#byteout">byteout</A>(ale, off);
outsb(adr, data, size);
}
<FONT COLOR=#0000FF>/* Interface functions */</FONT>
<FONT COLOR="#298C52">static</FONT> u_char
<A HREF="asuscom.c.shtml#ReadISAC">ReadISAC</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char offset)
{
<FONT COLOR="#298C52">return</FONT>(<A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.diva.isac_adr, cs-&gt;hw.diva.isac, offset));
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#WriteISAC">WriteISAC</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char offset, u_char value)
{
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.isac_adr, cs-&gt;hw.diva.isac, offset, value);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#ReadISACfifo">ReadISACfifo</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char *data, <FONT COLOR="#298C52">int</FONT> size)
{
<A HREF="asuscom.c.shtml#readfifo">readfifo</A>(cs-&gt;hw.diva.isac_adr, cs-&gt;hw.diva.isac, 0, data, size);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#WriteISACfifo">WriteISACfifo</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char *data, <FONT COLOR="#298C52">int</FONT> size)
{
<A HREF="asuscom.c.shtml#writefifo">writefifo</A>(cs-&gt;hw.diva.isac_adr, cs-&gt;hw.diva.isac, 0, data, size);
}
<FONT COLOR="#298C52">static</FONT> u_char
<A HREF="asuscom.c.shtml#ReadHSCX">ReadHSCX</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx, u_char offset)
{
<FONT COLOR="#298C52">return</FONT>(<A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.diva.hscx_adr,
cs-&gt;hw.diva.hscx, offset + (hscx ? 0x40 : 0)));
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="asuscom.c.shtml#WriteHSCX">WriteHSCX</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx, u_char offset, u_char value)
{
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.hscx_adr,
cs-&gt;hw.diva.hscx, offset + (hscx ? 0x40 : 0), value);
}
<FONT COLOR=#0000FF>/*
* fast interrupt HSCX stuff goes here
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, nr, reg) <A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.diva.hscx_adr, \
cs-&gt;hw.diva.hscx, reg + (nr ? 0x40 : 0))
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#WRITEHSCX">WRITEHSCX</A>(cs, nr, reg, data) <A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.hscx_adr, \
cs-&gt;hw.diva.hscx, reg + (nr ? 0x40 : 0), data)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#READHSCXFIFO">READHSCXFIFO</A>(cs, nr, ptr, cnt) <A HREF="asuscom.c.shtml#readfifo">readfifo</A>(cs-&gt;hw.diva.hscx_adr, \
cs-&gt;hw.diva.hscx, (nr ? 0x40 : 0), ptr, cnt)
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#WRITEHSCXFIFO">WRITEHSCXFIFO</A>(cs, nr, ptr, cnt) <A HREF="asuscom.c.shtml#writefifo">writefifo</A>(cs-&gt;hw.diva.hscx_adr, \
cs-&gt;hw.diva.hscx, (nr ? 0x40 : 0), ptr, cnt)
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hscx_irq.c"</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
diva_interrupt(<FONT COLOR="#298C52">int</FONT> intno, <FONT COLOR="#298C52">void</FONT> *dev_id, <FONT COLOR="#298C52">struct</FONT> pt_regs *regs)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = dev_id;
u_char val, sval, stat = 0;
<FONT COLOR="#298C52">int</FONT> cnt=8;
<FONT COLOR="#298C52">if</FONT> (!cs) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"Diva: Spurious interrupt!\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">while</FONT> (((sval = <A HREF="asuscom.c.shtml#bytein">bytein</A>(cs-&gt;hw.diva.ctrl)) &amp; DIVA_IRQ_REQ) &amp;&amp; cnt) {
val = <A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.diva.hscx_adr, cs-&gt;hw.diva.hscx, <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A> + 0x40);
<FONT COLOR="#298C52">if</FONT> (val) {
<A HREF="hscx_irq.c.shtml#hscx_int_main">hscx_int_main</A>(cs, val);
stat |= 1;
}
val = <A HREF="asuscom.c.shtml#readreg">readreg</A>(cs-&gt;hw.diva.isac_adr, cs-&gt;hw.diva.isac, <A HREF="isac.h.shtml#ISAC_ISTA">ISAC_ISTA</A>);
<FONT COLOR="#298C52">if</FONT> (val) {
<A HREF="isac.c.shtml#isac_interrupt">isac_interrupt</A>(cs, val);
stat |= 2;
}
cnt--;
}
<FONT COLOR="#298C52">if</FONT> (!cnt)
printk(KERN_WARNING <FONT COLOR="#FF0000">"Diva: IRQ LOOP\n"</FONT>);
<FONT COLOR="#298C52">if</FONT> (stat &amp; 1) {
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.hscx_adr, cs-&gt;hw.diva.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0xFF);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.hscx_adr, cs-&gt;hw.diva.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A> + 0x40, 0xFF);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.hscx_adr, cs-&gt;hw.diva.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0x0);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.hscx_adr, cs-&gt;hw.diva.hscx, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A> + 0x40, 0x0);
}
<FONT COLOR="#298C52">if</FONT> (stat &amp; 2) {
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.isac_adr, cs-&gt;hw.diva.isac, <A HREF="isac.h.shtml#ISAC_MASK">ISAC_MASK</A>, 0xFF);
<A HREF="asuscom.c.shtml#writereg">writereg</A>(cs-&gt;hw.diva.isac_adr, cs-&gt;hw.diva.isac, <A HREF="isac.h.shtml#ISAC_MASK">ISAC_MASK</A>, 0x0);
}
}
<FONT COLOR="#298C52">void</FONT>
release_io_diva(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">int</FONT> bytecnt;
del_timer(&amp;cs-&gt;hw.diva.tl);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;subtyp == DIVA_ISA)
bytecnt = 8;
<FONT COLOR="#298C52">else</FONT>
bytecnt = 32;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.diva.cfg_reg) {
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.diva.ctrl, 0); <FONT COLOR=#0000FF>/* LED off, Reset */</FONT>
release_region(cs-&gt;hw.diva.cfg_reg, bytecnt);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
reset_diva(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">long</FONT> flags;
save_flags(flags);
sti();
cs-&gt;hw.diva.ctrl_reg = 0; <FONT COLOR=#0000FF>/* Reset On */</FONT>
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.diva.ctrl, cs-&gt;hw.diva.ctrl_reg);
current-&gt;state = TASK_INTERRUPTIBLE;
current-&gt;timeout = jiffies + (10 * HZ) / 1000; <FONT COLOR=#0000FF>/* Timeout 10ms */</FONT>
schedule();
cs-&gt;hw.diva.ctrl_reg |= DIVA_RESET; <FONT COLOR=#0000FF>/* Reset Off */</FONT>
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.diva.ctrl, cs-&gt;hw.diva.ctrl_reg);
current-&gt;state = TASK_INTERRUPTIBLE;
current-&gt;timeout = jiffies + (10 * HZ) / 1000; <FONT COLOR=#0000FF>/* Timeout 10ms */</FONT>
schedule();
<FONT COLOR="#298C52">if</FONT> (cs-&gt;subtyp == DIVA_ISA)
cs-&gt;hw.diva.ctrl_reg |= DIVA_ISA_LED_A;
<FONT COLOR="#298C52">else</FONT>
cs-&gt;hw.diva.ctrl_reg |= DIVA_PCI_LED_A;
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.diva.ctrl, cs-&gt;hw.diva.ctrl_reg);
}
<FONT COLOR=#A521F7>#define</FONT> DIVA_ASSIGN 1
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
diva_led_handler(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">int</FONT> blink = 0;
del_timer(&amp;cs-&gt;hw.diva.tl);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.diva.status &amp; DIVA_ASSIGN)
cs-&gt;hw.diva.ctrl_reg |= (DIVA_ISA == cs-&gt;subtyp) ?
DIVA_ISA_LED_A : DIVA_PCI_LED_A;
<FONT COLOR="#298C52">else</FONT> {
cs-&gt;hw.diva.ctrl_reg ^= (DIVA_ISA == cs-&gt;subtyp) ?
DIVA_ISA_LED_A : DIVA_PCI_LED_A;
blink = 250;
}
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.diva.status &amp; 0xf000)
cs-&gt;hw.diva.ctrl_reg |= (DIVA_ISA == cs-&gt;subtyp) ?
DIVA_ISA_LED_B : DIVA_PCI_LED_B;
<FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.diva.status &amp; 0x0f00) {
cs-&gt;hw.diva.ctrl_reg ^= (DIVA_ISA == cs-&gt;subtyp) ?
DIVA_ISA_LED_B : DIVA_PCI_LED_B;
blink = 500;
} <FONT COLOR="#298C52">else</FONT>
cs-&gt;hw.diva.ctrl_reg &amp;= ~((DIVA_ISA == cs-&gt;subtyp) ?
DIVA_ISA_LED_B : DIVA_PCI_LED_B);
<A HREF="asuscom.c.shtml#byteout">byteout</A>(cs-&gt;hw.diva.ctrl, cs-&gt;hw.diva.ctrl_reg);
<FONT COLOR="#298C52">if</FONT> (blink) {
init_timer(&amp;cs-&gt;hw.diva.tl);
cs-&gt;hw.diva.tl.expires = jiffies + ((blink * HZ) / 1000);
add_timer(&amp;cs-&gt;hw.diva.tl);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT>
Diva_card_msg(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> mt, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">switch</FONT> (mt) {
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RESET">CARD_RESET</A>:
reset_diva(cs);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_RELEASE">CARD_RELEASE</A>:
release_io_diva(cs);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_SETIRQ">CARD_SETIRQ</A>:
<FONT COLOR="#298C52">return</FONT>(request_irq(cs-&gt;irq, &amp;diva_interrupt,
<A HREF="hisax.h.shtml#I4L_IRQ_FLAG">I4L_IRQ_FLAG</A>, <FONT COLOR="#FF0000">"HiSax"</FONT>, cs));
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_INIT">CARD_INIT</A>:
inithscxisac(cs, 3);
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#CARD_TEST">CARD_TEST</A>:
<FONT COLOR="#298C52">return</FONT>(0);
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#MDL_REMOVE">MDL_REMOVE</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
cs-&gt;hw.diva.status = 0;
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#MDL_ASSIGN">MDL_ASSIGN</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
cs-&gt;hw.diva.status |= DIVA_ASSIGN;
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#MDL_INFO_SETUP">MDL_INFO_SETUP</A>:
<FONT COLOR="#298C52">if</FONT> ((<FONT COLOR="#298C52">long</FONT>)arg)
cs-&gt;hw.diva.status |= 0x0200;
<FONT COLOR="#298C52">else</FONT>
cs-&gt;hw.diva.status |= 0x0100;
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#MDL_INFO_CONN">MDL_INFO_CONN</A>:
<FONT COLOR="#298C52">if</FONT> ((<FONT COLOR="#298C52">long</FONT>)arg)
cs-&gt;hw.diva.status |= 0x2000;
<FONT COLOR="#298C52">else</FONT>
cs-&gt;hw.diva.status |= 0x1000;
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#MDL_INFO_REL">MDL_INFO_REL</A>:
<FONT COLOR="#298C52">if</FONT> ((<FONT COLOR="#298C52">long</FONT>)arg) {
cs-&gt;hw.diva.status &amp;= ~0x2000;
cs-&gt;hw.diva.status &amp;= ~0x0200;
} <FONT COLOR="#298C52">else</FONT> {
cs-&gt;hw.diva.status &amp;= ~0x1000;
cs-&gt;hw.diva.status &amp;= ~0x0100;
}
<FONT COLOR="#298C52">break</FONT>;
}
diva_led_handler(cs);
<FONT COLOR="#298C52">return</FONT>(0);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">struct</FONT> pci_dev *dev_diva __initdata = NULL;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">struct</FONT> pci_dev *dev_diva_u __initdata = NULL;
<A HREF="asuscom.c.shtml#__initfunc">__initfunc</A>(<FONT COLOR="#298C52">int</FONT>
setup_diva(<FONT COLOR="#298C52">struct</FONT> IsdnCard *card))
{
<FONT COLOR="#298C52">int</FONT> bytecnt;
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = card-&gt;cs;
<FONT COLOR="#298C52">char</FONT> tmp[64];
strcpy(tmp, Diva_revision);
printk(KERN_INFO <FONT COLOR="#FF0000">"HiSax: Eicon.Diehl Diva driver Rev. %s\n"</FONT>, HiSax_getrev(tmp));
<FONT COLOR="#298C52">if</FONT> (cs-&gt;typ != <A HREF="hisax.h.shtml#ISDN_CTYPE_DIEHLDIVA">ISDN_CTYPE_DIEHLDIVA</A>)
<FONT COLOR="#298C52">return</FONT>(0);
cs-&gt;hw.diva.status = 0;
<FONT COLOR="#298C52">if</FONT> (card-&gt;para[1]) {
cs-&gt;subtyp = DIVA_ISA;
cs-&gt;hw.diva.ctrl_reg = 0;
cs-&gt;hw.diva.cfg_reg = card-&gt;para[1];
cs-&gt;hw.diva.ctrl = card-&gt;para[1] + DIVA_ISA_CTRL;
cs-&gt;hw.diva.isac = card-&gt;para[1] + DIVA_ISA_ISAC_DATA;
cs-&gt;hw.diva.hscx = card-&gt;para[1] + DIVA_HSCX_DATA;
cs-&gt;hw.diva.isac_adr = card-&gt;para[1] + DIVA_ISA_ISAC_ADR;
cs-&gt;hw.diva.hscx_adr = card-&gt;para[1] + DIVA_HSCX_ADR;
cs-&gt;irq = card-&gt;para[0];
bytecnt = 8;
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR=#A521F7>#if</FONT> CONFIG_PCI
<FONT COLOR="#298C52">if</FONT> (!pci_present()) {
printk(KERN_ERR <FONT COLOR="#FF0000">"Diva: no PCI bus present\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>(0);
}
cs-&gt;subtyp = 0;
<FONT COLOR="#298C52">if</FONT> ((dev_diva = pci_find_device(PCI_VENDOR_EICON_DIEHL,
PCI_DIVA20_ID, dev_diva))) {
cs-&gt;subtyp = DIVA_PCI;
<FONT COLOR=#0000FF>/* get IRQ */</FONT>
cs-&gt;irq = dev_diva-&gt;irq;
<FONT COLOR=#0000FF>/* get IO address */</FONT>
cs-&gt;hw.diva.cfg_reg = dev_diva-&gt;base_address[2]
&amp; PCI_BASE_ADDRESS_IO_MASK;
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> ((dev_diva_u = pci_find_device(PCI_VENDOR_EICON_DIEHL,
PCI_DIVA20_U_ID, dev_diva_u))) {
cs-&gt;subtyp = DIVA_PCI;
<FONT COLOR=#0000FF>/* get IRQ */</FONT>
cs-&gt;irq = dev_diva_u-&gt;irq;
<FONT COLOR=#0000FF>/* get IO address */</FONT>
cs-&gt;hw.diva.cfg_reg = dev_diva_u-&gt;base_address[2]
&amp; PCI_BASE_ADDRESS_IO_MASK;
} <FONT COLOR="#298C52">else</FONT> {
printk(KERN_WARNING <FONT COLOR="#FF0000">"Diva: No PCI card found\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>(0);
}
<FONT COLOR="#298C52">if</FONT> (!cs-&gt;irq) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"Diva: No IRQ for PCI card found\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>(0);
}
<FONT COLOR="#298C52">if</FONT> (!cs-&gt;hw.diva.cfg_reg) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"Diva: No IO-Adr for PCI card found\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>(0);
}
cs-&gt;hw.diva.ctrl = cs-&gt;hw.diva.cfg_reg + DIVA_PCI_CTRL;
cs-&gt;hw.diva.isac = cs-&gt;hw.diva.cfg_reg + DIVA_PCI_ISAC_DATA;
cs-&gt;hw.diva.hscx = cs-&gt;hw.diva.cfg_reg + DIVA_HSCX_DATA;
cs-&gt;hw.diva.isac_adr = cs-&gt;hw.diva.cfg_reg + DIVA_PCI_ISAC_ADR;
cs-&gt;hw.diva.hscx_adr = cs-&gt;hw.diva.cfg_reg + DIVA_HSCX_ADR;
bytecnt = 32;
<FONT COLOR=#A521F7>#else</FONT>
printk(KERN_WARNING <FONT COLOR="#FF0000">"Diva: cfgreg 0 and NO_PCI_BIOS\n"</FONT>);
printk(KERN_WARNING <FONT COLOR="#FF0000">"Diva: unable to config DIVA PCI\n"</FONT>);
<FONT COLOR="#298C52">return</FONT> (0);
<FONT COLOR=#A521F7>#endif</FONT> <FONT COLOR=#0000FF>/* CONFIG_PCI */</FONT>
}
printk(KERN_INFO
<FONT COLOR="#FF0000">"Diva: %s card configured at 0x%x IRQ %d\n"</FONT>,
(cs-&gt;subtyp == DIVA_ISA) ? <FONT COLOR="#FF0000">"ISA"</FONT> : <FONT COLOR="#FF0000">"PCI"</FONT>,
cs-&gt;hw.diva.cfg_reg, cs-&gt;irq);
<FONT COLOR="#298C52">if</FONT> (check_region(cs-&gt;hw.diva.cfg_reg, bytecnt)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: %s config port %x-%x already in use\n"</FONT>,
CardType[card-&gt;typ],
cs-&gt;hw.diva.cfg_reg,
cs-&gt;hw.diva.cfg_reg + bytecnt);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
request_region(cs-&gt;hw.diva.cfg_reg, bytecnt, <FONT COLOR="#FF0000">"diva isdn"</FONT>);
}
reset_diva(cs);
cs-&gt;hw.diva.tl.function = (<FONT COLOR="#298C52">void</FONT> *) diva_led_handler;
cs-&gt;hw.diva.tl.data = (<FONT COLOR="#298C52">long</FONT>) cs;
init_timer(&amp;cs-&gt;hw.diva.tl);
cs-&gt;readisac = &amp;<A HREF="asuscom.c.shtml#ReadISAC">ReadISAC</A>;
cs-&gt;writeisac = &amp;<A HREF="asuscom.c.shtml#WriteISAC">WriteISAC</A>;
cs-&gt;readisacfifo = &amp;<A HREF="asuscom.c.shtml#ReadISACfifo">ReadISACfifo</A>;
cs-&gt;writeisacfifo = &amp;<A HREF="asuscom.c.shtml#WriteISACfifo">WriteISACfifo</A>;
cs-&gt;BC_Read_Reg = &amp;<A HREF="asuscom.c.shtml#ReadHSCX">ReadHSCX</A>;
cs-&gt;BC_Write_Reg = &amp;<A HREF="asuscom.c.shtml#WriteHSCX">WriteHSCX</A>;
cs-&gt;BC_Send_Data = &amp;<A HREF="hscx_irq.c.shtml#hscx_fill_fifo">hscx_fill_fifo</A>;
cs-&gt;cardmsg = &amp;Diva_card_msg;
<A HREF="isac.c.shtml#ISACVersion">ISACVersion</A>(cs, <FONT COLOR="#FF0000">"Diva:"</FONT>);
<FONT COLOR="#298C52">if</FONT> (HscxVersion(cs, <FONT COLOR="#FF0000">"Diva:"</FONT>)) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"Diva: wrong HSCX versions check IO address\n"</FONT>);
release_io_diva(cs);
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">return</FONT> (1);
}
</BODY>
</HTML>

1193
workshop/hisax/elsa.c.shtml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,706 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>elsa_ser.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>elsa_ser.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/serial.h&gt;
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/serial_reg.h&gt;
<FONT COLOR=#A521F7>#define</FONT> MAX_MODEM_BUF 256
<FONT COLOR=#A521F7>#define</FONT> WAKEUP_CHARS (MAX_MODEM_BUF/2)
<FONT COLOR=#A521F7>#define</FONT> RS_ISR_PASS_LIMIT 256
<FONT COLOR=#A521F7>#define</FONT> BASE_BAUD ( 1843200 / 16 )
<FONT COLOR=#A521F7>#ifndef</FONT> MIN
<FONT COLOR=#A521F7>#define</FONT> MIN(a,b) ((a) &lt; (b) ? (a) : (b))
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#define</FONT> SERIAL_DEBUG_OPEN 1
<FONT COLOR=#A521F7>#define</FONT> SERIAL_DEBUG_INTR 1
<FONT COLOR=#A521F7>#define</FONT> SERIAL_DEBUG_FLOW 1
<FONT COLOR=#A521F7>#undef</FONT> SERIAL_DEBUG_REG
<FONT COLOR=#0000FF>//#define SERIAL_DEBUG_REG</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_REG
<FONT COLOR="#298C52">static</FONT> u_char deb[32];
<FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *ModemIn[] = {<FONT COLOR="#FF0000">"RBR"</FONT>,<FONT COLOR="#FF0000">"IER"</FONT>,<FONT COLOR="#FF0000">"IIR"</FONT>,<FONT COLOR="#FF0000">"LCR"</FONT>,<FONT COLOR="#FF0000">"MCR"</FONT>,<FONT COLOR="#FF0000">"LSR"</FONT>,<FONT COLOR="#FF0000">"MSR"</FONT>,<FONT COLOR="#FF0000">"SCR"</FONT>};
<FONT COLOR="#298C52">const</FONT> <FONT COLOR="#298C52">char</FONT> *ModemOut[] = {<FONT COLOR="#FF0000">"THR"</FONT>,<FONT COLOR="#FF0000">"IER"</FONT>,<FONT COLOR="#FF0000">"FCR"</FONT>,<FONT COLOR="#FF0000">"LCR"</FONT>,<FONT COLOR="#FF0000">"MCR"</FONT>,<FONT COLOR="#FF0000">"LSR"</FONT>,<FONT COLOR="#FF0000">"MSR"</FONT>,<FONT COLOR="#FF0000">"SCR"</FONT>};
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">char</FONT> *MInit_1 = <FONT COLOR="#FF0000">"AT &amp;F &amp;C1 E0 &amp;D2 L2 M1 S64=13\n\0"</FONT>;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">char</FONT> *MInit_2 = <FONT COLOR="#FF0000">"AT+FCLASS=0 V1 S2=128 X1 \\V8\n\0"</FONT>;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">char</FONT> *MInit_3 = <FONT COLOR="#FF0000">"AT %G0 %B2400 L0 M0 &amp;G0 %E1 %L1 %M0 %C3 \\N3\n\0"</FONT>;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> serial_in(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> offset)
{
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_REG
u_int val = inb(cs-&gt;hw.elsa.base + 8 + offset);
sprintf(deb,<FONT COLOR="#FF0000">"in %s %02x"</FONT>,ModemIn[offset], val);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, deb);
<FONT COLOR="#298C52">return</FONT>(val);
<FONT COLOR=#A521F7>#else</FONT>
<FONT COLOR="#298C52">return</FONT> inb(cs-&gt;hw.elsa.base + 8 + offset);
<FONT COLOR=#A521F7>#endif</FONT>
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT> serial_inp(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> offset)
{
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_REG
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_SERIAL_NOPAUSE_IO
u_int val = inb(cs-&gt;hw.elsa.base + 8 + offset);
sprintf(deb,<FONT COLOR="#FF0000">"inp %s %02x"</FONT>,ModemIn[offset], val);
<FONT COLOR=#A521F7>#else</FONT>
u_int val = inb_p(cs-&gt;hw.elsa.base + 8 + offset);
sprintf(deb,<FONT COLOR="#FF0000">"inP %s %02x"</FONT>,ModemIn[offset], val);
<FONT COLOR=#A521F7>#endif</FONT>
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, deb);
<FONT COLOR="#298C52">return</FONT>(val);
<FONT COLOR=#A521F7>#else</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_SERIAL_NOPAUSE_IO
<FONT COLOR="#298C52">return</FONT> inb(cs-&gt;hw.elsa.base + 8 + offset);
<FONT COLOR=#A521F7>#else</FONT>
<FONT COLOR="#298C52">return</FONT> inb_p(cs-&gt;hw.elsa.base + 8 + offset);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#endif</FONT>
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT> serial_out(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> offset, <FONT COLOR="#298C52">int</FONT> value)
{
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_REG
sprintf(deb,<FONT COLOR="#FF0000">"out %s %02x"</FONT>,ModemOut[offset], value);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, deb);
<FONT COLOR=#A521F7>#endif</FONT>
outb(value, cs-&gt;hw.elsa.base + 8 + offset);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT> serial_outp(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> offset,
<FONT COLOR="#298C52">int</FONT> value)
{
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_REG
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_SERIAL_NOPAUSE_IO
sprintf(deb,<FONT COLOR="#FF0000">"outp %s %02x"</FONT>,ModemOut[offset], value);
<FONT COLOR=#A521F7>#else</FONT>
sprintf(deb,<FONT COLOR="#FF0000">"outP %s %02x"</FONT>,ModemOut[offset], value);
<FONT COLOR=#A521F7>#endif</FONT>
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, deb);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR=#A521F7>#ifdef</FONT> CONFIG_SERIAL_NOPAUSE_IO
outb(value, cs-&gt;hw.elsa.base + 8 + offset);
<FONT COLOR=#A521F7>#else</FONT>
outb_p(value, cs-&gt;hw.elsa.base + 8 + offset);
<FONT COLOR=#A521F7>#endif</FONT>
}
<FONT COLOR=#0000FF>/*
* This routine is called to set the UART divisor registers to match
* the specified baud rate for a serial port.
*/</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT> change_speed(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> baud)
{
<FONT COLOR="#298C52">int</FONT> quot = 0, baud_base;
<FONT COLOR="#298C52">unsigned</FONT> cval, fcr = 0;
<FONT COLOR="#298C52">int</FONT> bits;
<FONT COLOR="#298C52">char</FONT> tmp[32];
<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR=#0000FF>/* byte size and parity */</FONT>
cval = 0x03; bits = 10;
<FONT COLOR=#0000FF>/* Determine divisor based on baud rate */</FONT>
baud_base = BASE_BAUD;
quot = baud_base / baud;
<FONT COLOR=#0000FF>/* If the quotient is ever zero, default to 9600 bps */</FONT>
<FONT COLOR="#298C52">if</FONT> (!quot)
quot = baud_base / 9600;
<FONT COLOR=#0000FF>/* Set up FIFO's */</FONT>
<FONT COLOR="#298C52">if</FONT> ((baud_base / quot) &lt; 2400)
fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;
<FONT COLOR="#298C52">else</FONT>
fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_8;
serial_outp(cs, UART_FCR, fcr);
<FONT COLOR=#0000FF>/* CTS flow control flag and modem status interrupts */</FONT>
cs-&gt;hw.elsa.IER &amp;= ~UART_IER_MSI;
cs-&gt;hw.elsa.IER |= UART_IER_MSI;
serial_outp(cs, UART_IER, cs-&gt;hw.elsa.IER);
sprintf(tmp,<FONT COLOR="#FF0000">"modem quot=0x%x"</FONT>, quot);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
save_flags(flags); cli();
serial_outp(cs, UART_LCR, cval | UART_LCR_DLAB);<FONT COLOR=#0000FF>/* set DLAB */</FONT>
serial_outp(cs, UART_DLL, quot &amp; 0xff); <FONT COLOR=#0000FF>/* LS of divisor */</FONT>
serial_outp(cs, UART_DLM, quot &gt;&gt; 8); <FONT COLOR=#0000FF>/* MS of divisor */</FONT>
serial_outp(cs, UART_LCR, cval); <FONT COLOR=#0000FF>/* reset DLAB */</FONT>
restore_flags(flags);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT> mstartup(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">int</FONT> retval=0;
save_flags(flags); cli();
<FONT COLOR=#0000FF>/*
* Clear the FIFO buffers and disable them
* (they will be reenabled in change_speed())
*/</FONT>
serial_outp(cs, UART_FCR, (UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT));
<FONT COLOR=#0000FF>/*
* At this point there's no way the LSR could still be 0xFF;
* if it is, then bail out, because there's likely no UART
* here.
*/</FONT>
<FONT COLOR="#298C52">if</FONT> (serial_inp(cs, UART_LSR) == 0xff) {
retval = -ENODEV;
<FONT COLOR="#298C52">goto</FONT> errout;
}
<FONT COLOR=#0000FF>/*
* Clear the interrupt registers.
*/</FONT>
(<FONT COLOR="#298C52">void</FONT>) serial_inp(cs, UART_RX);
(<FONT COLOR="#298C52">void</FONT>) serial_inp(cs, UART_IIR);
(<FONT COLOR="#298C52">void</FONT>) serial_inp(cs, UART_MSR);
<FONT COLOR=#0000FF>/*
* Now, initialize the UART
*/</FONT>
serial_outp(cs, UART_LCR, UART_LCR_WLEN8); <FONT COLOR=#0000FF>/* reset DLAB */</FONT>
cs-&gt;hw.elsa.MCR = 0;
cs-&gt;hw.elsa.MCR = UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2;
serial_outp(cs, UART_MCR, cs-&gt;hw.elsa.MCR);
<FONT COLOR=#0000FF>/*
* Finally, enable interrupts
*/</FONT>
cs-&gt;hw.elsa.IER = UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI;
serial_outp(cs, UART_IER, cs-&gt;hw.elsa.IER); <FONT COLOR=#0000FF>/* enable interrupts */</FONT>
<FONT COLOR=#0000FF>/*
* And clear the interrupt registers again for luck.
*/</FONT>
(<FONT COLOR="#298C52">void</FONT>)serial_inp(cs, UART_LSR);
(<FONT COLOR="#298C52">void</FONT>)serial_inp(cs, UART_RX);
(<FONT COLOR="#298C52">void</FONT>)serial_inp(cs, UART_IIR);
(<FONT COLOR="#298C52">void</FONT>)serial_inp(cs, UART_MSR);
cs-&gt;hw.elsa.transcnt = cs-&gt;hw.elsa.transp = 0;
cs-&gt;hw.elsa.rcvcnt = cs-&gt;hw.elsa.rcvp =0;
<FONT COLOR=#0000FF>/*
* and set the speed of the serial port
*/</FONT>
change_speed(cs, 57600*2);
cs-&gt;hw.elsa.MFlag = 1;
errout:
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT> retval;
}
<FONT COLOR=#0000FF>/*
* This routine will shutdown a serial port; interrupts are disabled, and
* DTR is dropped if the hangup on close termio flag is on.
*/</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT> mshutdown(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_OPEN
printk(<FONT COLOR="#FF0000">"Shutting down serial ...."</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
save_flags(flags); cli(); <FONT COLOR=#0000FF>/* Disable interrupts */</FONT>
<FONT COLOR=#0000FF>/*
* clear delta_msr_wait queue to avoid mem leaks: we may free the irq
* here so the queue might never be waken up
*/</FONT>
cs-&gt;hw.elsa.IER = 0;
serial_outp(cs, UART_IER, 0x00); <FONT COLOR=#0000FF>/* disable all intrs */</FONT>
cs-&gt;hw.elsa.MCR &amp;= ~UART_MCR_OUT2;
<FONT COLOR=#0000FF>/* disable break condition */</FONT>
serial_outp(cs, UART_LCR, serial_inp(cs, UART_LCR) &amp; ~UART_LCR_SBC);
cs-&gt;hw.elsa.MCR &amp;= ~(UART_MCR_DTR|UART_MCR_RTS);
serial_outp(cs, UART_MCR, cs-&gt;hw.elsa.MCR);
<FONT COLOR=#0000FF>/* disable FIFO's */</FONT>
serial_outp(cs, UART_FCR, (UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT));
serial_inp(cs, UART_RX); <FONT COLOR=#0000FF>/* read data port to reset things */</FONT>
restore_flags(flags);
}
<FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">int</FONT>
write_modem(<FONT COLOR="#298C52">struct</FONT> BCState *bcs) {
<FONT COLOR="#298C52">int</FONT> ret=0;
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">int</FONT> count, len, fp, buflen;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">if</FONT> (!bcs-&gt;hw.hscx.tx_skb)
<FONT COLOR="#298C52">return</FONT> 0;
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb-&gt;len &lt;= 0)
<FONT COLOR="#298C52">return</FONT> 0;
save_flags(flags);
cli();
buflen = MAX_MODEM_BUF - cs-&gt;hw.elsa.transcnt;
len = MIN(buflen, bcs-&gt;hw.hscx.tx_skb-&gt;len);
fp = cs-&gt;hw.elsa.transcnt + cs-&gt;hw.elsa.transp;
fp &amp;= (MAX_MODEM_BUF -1);
count = MIN(len, MAX_MODEM_BUF - fp);
<FONT COLOR="#298C52">if</FONT> (count &lt; len) {
memcpy(cs-&gt;hw.elsa.transbuf + fp, skb_pull(bcs-&gt;hw.hscx.tx_skb, count), count);
cs-&gt;hw.elsa.transcnt += count;
ret = count;
count = len - count;
fp = 0;
}
memcpy(cs-&gt;hw.elsa.transbuf + fp, skb_pull(bcs-&gt;hw.hscx.tx_skb, count), count);
cs-&gt;hw.elsa.transcnt += count;
ret += count;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.transcnt &amp;&amp;
!(cs-&gt;hw.elsa.IER &amp; UART_IER_THRI)) {
cs-&gt;hw.elsa.IER |= UART_IER_THRI;
serial_outp(cs, UART_IER, cs-&gt;hw.elsa.IER);
}
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT>(ret);
}
<FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
modem_fill(<FONT COLOR="#298C52">struct</FONT> BCState *bcs) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb-&gt;len) {
write_modem(bcs);
<FONT COLOR="#298C52">return</FONT>;
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;st-&gt;lli.l1writewakeup &amp;&amp;
(<A HREF="hisax.h.shtml#PACKET_NOACK">PACKET_NOACK</A> != bcs-&gt;hw.hscx.tx_skb-&gt;pkt_type))
bcs-&gt;st-&gt;lli.l1writewakeup(bcs-&gt;st,
bcs-&gt;hw.hscx.count);
dev_kfree_skb(bcs-&gt;hw.hscx.tx_skb);
bcs-&gt;hw.hscx.tx_skb = NULL;
}
}
<FONT COLOR="#298C52">if</FONT> ((bcs-&gt;hw.hscx.tx_skb = skb_dequeue(&amp;bcs-&gt;squeue))) {
bcs-&gt;hw.hscx.count = 0;
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
write_modem(bcs);
} <FONT COLOR="#298C52">else</FONT> {
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
<A HREF="hscx.c.shtml#hscx_sched_event">hscx_sched_event</A>(bcs, <A HREF="isdnl1.h.shtml#B_XMTBUFREADY">B_XMTBUFREADY</A>);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT> receive_chars(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs,
<FONT COLOR="#298C52">int</FONT> *status)
{
<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">char</FONT> ch;
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR="#298C52">do</FONT> {
ch = serial_in(cs, UART_RX);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.rcvcnt &gt;= MAX_MODEM_BUF)
<FONT COLOR="#298C52">break</FONT>;
cs-&gt;hw.elsa.rcvbuf[cs-&gt;hw.elsa.rcvcnt++] = ch;
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_INTR
printk(<FONT COLOR="#FF0000">"DR%02x:%02x..."</FONT>, ch, *status);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (*status &amp; (UART_LSR_BI | UART_LSR_PE |
UART_LSR_FE | UART_LSR_OE)) {
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_INTR
printk(<FONT COLOR="#FF0000">"handling exept...."</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
}
*status = serial_inp(cs, UART_LSR);
} <FONT COLOR="#298C52">while</FONT> (*status &amp; UART_LSR_DR);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.MFlag == 2) {
<FONT COLOR="#298C52">if</FONT> (!(skb = dev_alloc_skb(cs-&gt;hw.elsa.rcvcnt)))
printk(KERN_WARNING <FONT COLOR="#FF0000">"ElsaSER: receive out of memory\n"</FONT>);
<FONT COLOR="#298C52">else</FONT> {
memcpy(skb_put(skb, cs-&gt;hw.elsa.rcvcnt), cs-&gt;hw.elsa.rcvbuf,
cs-&gt;hw.elsa.rcvcnt);
skb_queue_tail(&amp; cs-&gt;hw.elsa.bcs-&gt;rqueue, skb);
}
<A HREF="hscx.c.shtml#hscx_sched_event">hscx_sched_event</A>(cs-&gt;hw.elsa.bcs, <A HREF="isdnl1.h.shtml#B_RCVBUFREADY">B_RCVBUFREADY</A>);
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR="#298C52">char</FONT> tmp[128];
<FONT COLOR="#298C52">char</FONT> *t = tmp;
t += sprintf(t, <FONT COLOR="#FF0000">"modem read cnt %d"</FONT>, cs-&gt;hw.elsa.rcvcnt);
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(t, cs-&gt;hw.elsa.rcvbuf, cs-&gt;hw.elsa.rcvcnt);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
cs-&gt;hw.elsa.rcvcnt = 0;
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT> transmit_chars(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> *intr_done)
{
<FONT COLOR="#298C52">int</FONT> count;
<FONT COLOR="#298C52">char</FONT> tmp[64];
sprintf(tmp, <FONT COLOR="#FF0000">"transmit_chars: p(%x) cnt(%x)"</FONT>, cs-&gt;hw.elsa.transp,
cs-&gt;hw.elsa.transcnt);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.transcnt &lt;= 0) {
cs-&gt;hw.elsa.IER &amp;= ~UART_IER_THRI;
serial_out(cs, UART_IER, cs-&gt;hw.elsa.IER);
<FONT COLOR="#298C52">return</FONT>;
}
count = 16;
<FONT COLOR="#298C52">do</FONT> {
serial_outp(cs, UART_TX, cs-&gt;hw.elsa.transbuf[cs-&gt;hw.elsa.transp++]);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.transp &gt;= MAX_MODEM_BUF)
cs-&gt;hw.elsa.transp=0;
<FONT COLOR="#298C52">if</FONT> (--cs-&gt;hw.elsa.transcnt &lt;= 0)
<FONT COLOR="#298C52">break</FONT>;
} <FONT COLOR="#298C52">while</FONT> (--count &gt; 0);
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;hw.elsa.transcnt &lt; WAKEUP_CHARS) &amp;&amp; (cs-&gt;hw.elsa.MFlag==2))
modem_fill(cs-&gt;hw.elsa.bcs);
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_INTR
printk(<FONT COLOR="#FF0000">"THRE..."</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (intr_done)
*intr_done = 0;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.transcnt &lt;= 0) {
cs-&gt;hw.elsa.IER &amp;= ~UART_IER_THRI;
serial_outp(cs, UART_IER, cs-&gt;hw.elsa.IER);
}
}
<FONT COLOR=#A521F7>#if</FONT> 0
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT> check_modem_status(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">int</FONT> status;
<FONT COLOR="#298C52">struct</FONT> async_struct *info = cs-&gt;hw.elsa.info;
<FONT COLOR="#298C52">struct</FONT> async_icount *icount;
status = serial_inp(info, UART_MSR);
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_MSR_ANY_DELTA) {
icount = &amp;info-&gt;state-&gt;icount;
<FONT COLOR=#0000FF>/* update input line counters */</FONT>
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_MSR_TERI)
icount-&gt;rng++;
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_MSR_DDSR)
icount-&gt;dsr++;
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_MSR_DDCD) {
icount-&gt;dcd++;
}
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_MSR_DCTS)
icount-&gt;cts++;
<FONT COLOR=#0000FF>// wake_up_interruptible(&amp;info-&gt;delta_msr_wait);</FONT>
}
<FONT COLOR="#298C52">if</FONT> ((info-&gt;flags &amp; ASYNC_CHECK_CD) &amp;&amp; (status &amp; UART_MSR_DDCD)) {
<FONT COLOR=#A521F7>#if</FONT> (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
printk(<FONT COLOR="#FF0000">"ttys%d CD now %s..."</FONT>, info-&gt;line,
(status &amp; UART_MSR_DCD) ? <FONT COLOR="#FF0000">"on"</FONT> : <FONT COLOR="#FF0000">"off"</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_MSR_DCD)
<FONT COLOR=#0000FF>// wake_up_interruptible(&amp;info-&gt;open_wait);</FONT>
;
<FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (!((info-&gt;flags &amp; ASYNC_CALLOUT_ACTIVE) &amp;&amp;
(info-&gt;flags &amp; ASYNC_CALLOUT_NOHUP))) {
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_OPEN
printk(<FONT COLOR="#FF0000">"doing serial hangup..."</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (info-&gt;tty)
tty_hangup(info-&gt;tty);
}
}
<FONT COLOR=#A521F7>#if</FONT> 0
<FONT COLOR="#298C52">if</FONT> (info-&gt;flags &amp; ASYNC_CTS_FLOW) {
<FONT COLOR="#298C52">if</FONT> (info-&gt;tty-&gt;hw_stopped) {
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_MSR_CTS) {
<FONT COLOR=#A521F7>#if</FONT> (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk(<FONT COLOR="#FF0000">"CTS tx start..."</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
info-&gt;tty-&gt;hw_stopped = 0;
info-&gt;IER |= UART_IER_THRI;
serial_outp(info, UART_IER, info-&gt;IER);
<FONT COLOR=#0000FF>// rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);</FONT>
<FONT COLOR="#298C52">return</FONT>;
}
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR="#298C52">if</FONT> (!(status &amp; UART_MSR_CTS)) {
<FONT COLOR=#A521F7>#if</FONT> (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk(<FONT COLOR="#FF0000">"CTS tx stop..."</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
info-&gt;tty-&gt;hw_stopped = 1;
info-&gt;IER &amp;= ~UART_IER_THRI;
serial_outp(info, UART_IER, info-&gt;IER);
}
}
}
<FONT COLOR=#A521F7>#endif</FONT> 0
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT> rs_interrupt_elsa(<FONT COLOR="#298C52">int</FONT> irq, <FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">int</FONT> status, iir, msr;
<FONT COLOR="#298C52">int</FONT> pass_counter = 0;
u_char tmp[64];
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_INTR
printk(<FONT COLOR="#FF0000">"rs_interrupt_single(%d)..."</FONT>, irq);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">do</FONT> {
status = serial_inp(cs, UART_LSR);
sprintf(tmp,<FONT COLOR="#FF0000">"rs LSR %02x"</FONT>, status);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_INTR
printk(<FONT COLOR="#FF0000">"status = %x..."</FONT>, status);
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_LSR_DR)
receive_chars(cs, &amp;status);
<FONT COLOR="#298C52">if</FONT> (status &amp; UART_LSR_THRE)
transmit_chars(cs, 0);
<FONT COLOR="#298C52">if</FONT> (pass_counter++ &gt; RS_ISR_PASS_LIMIT) {
printk(<FONT COLOR="#FF0000">"rs_single loop break.\n"</FONT>);
<FONT COLOR="#298C52">break</FONT>;
}
iir = serial_inp(cs, UART_IIR);
sprintf(tmp,<FONT COLOR="#FF0000">"rs IIR %02x"</FONT>, iir);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
<FONT COLOR="#298C52">if</FONT> ((iir &amp; 0xf) == 0) {
msr = serial_inp(cs, UART_MSR);
sprintf(tmp,<FONT COLOR="#FF0000">"rs MSR %02x"</FONT>, msr);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
} <FONT COLOR="#298C52">while</FONT> (!(iir &amp; UART_IIR_NO_INT));
<FONT COLOR=#A521F7>#ifdef</FONT> SERIAL_DEBUG_INTR
printk(<FONT COLOR="#FF0000">"end.\n"</FONT>);
<FONT COLOR=#A521F7>#endif</FONT>
}
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">int</FONT> <A HREF="hscx.c.shtml#open_hscxstate">open_hscxstate</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> bc);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> <A HREF="hscx.c.shtml#modehscx">modehscx</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> mode, <FONT COLOR="#298C52">int</FONT> bc);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> <A HREF="hscx.c.shtml#hscx_l2l1">hscx_l2l1</A>(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">int</FONT> pr, <FONT COLOR="#298C52">void</FONT> *arg);
<FONT COLOR="#298C52">void</FONT>
close_elsastate(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR=#0000FF>// modehscx(bcs, 0, 0);</FONT>
<FONT COLOR="#298C52">if</FONT> (test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.rcvbuf) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode != <A HREF="hisax.h.shtml#L1_MODE_MODEM">L1_MODE_MODEM</A>)
kfree(bcs-&gt;hw.hscx.rcvbuf);
bcs-&gt;hw.hscx.rcvbuf = NULL;
}
<FONT COLOR="#298C52">while</FONT> ((skb = skb_dequeue(&amp;bcs-&gt;rqueue))) {
dev_kfree_skb(skb);
}
<FONT COLOR="#298C52">while</FONT> ((skb = skb_dequeue(&amp;bcs-&gt;squeue))) {
dev_kfree_skb(skb);
}
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb) {
dev_kfree_skb(bcs-&gt;hw.hscx.tx_skb);
bcs-&gt;hw.hscx.tx_skb = NULL;
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
}
}
}
<FONT COLOR="#298C52">void</FONT>
modem_l2l1(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">int</FONT> pr, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb = arg;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">if</FONT> (pr == (<A HREF="hisax.h.shtml#PH_DATA">PH_DATA</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>)) {
save_flags(flags);
cli();
<FONT COLOR="#298C52">if</FONT> (st-&gt;l1.bcs-&gt;hw.hscx.tx_skb) {
skb_queue_tail(&amp;st-&gt;l1.bcs-&gt;squeue, skb);
restore_flags(flags);
} <FONT COLOR="#298C52">else</FONT> {
st-&gt;l1.bcs-&gt;hw.hscx.tx_skb = skb;
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
st-&gt;l1.bcs-&gt;hw.hscx.count = 0;
restore_flags(flags);
write_modem(st-&gt;l1.bcs);
}
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (pr == (<A HREF="hisax.h.shtml#PH_ACTIVATE">PH_ACTIVATE</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>)) {
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
st-&gt;l1.l1l2(st, <A HREF="hisax.h.shtml#PH_ACTIVATE">PH_ACTIVATE</A> | <A HREF="hisax.h.shtml#CONFIRM">CONFIRM</A>, NULL);
set_arcofi(st-&gt;l1.bcs-&gt;cs, st-&gt;l1.bc);
st-&gt;l1.bcs-&gt;cs-&gt;hw.elsa.MFlag=2;
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (pr == (<A HREF="hisax.h.shtml#PH_DEACTIVATE">PH_DEACTIVATE</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>)) {
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
send_arcofi(st-&gt;l1.bcs-&gt;cs, ARCOFI_XOP_0, st-&gt;l1.bc, 0);
st-&gt;l1.bcs-&gt;cs-&gt;hw.elsa.MFlag=1;
} <FONT COLOR="#298C52">else</FONT> {
printk(KERN_WARNING"ElsaSer: unknown pr %x\n", pr);
}
}
<FONT COLOR="#298C52">void</FONT>
modem_write_cmd(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char *buf, <FONT COLOR="#298C52">int</FONT> len) {
<FONT COLOR="#298C52">int</FONT> count, fp;
u_char *msg = buf;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">if</FONT> (!len)
<FONT COLOR="#298C52">return</FONT>;
save_flags(flags);
cli();
<FONT COLOR="#298C52">if</FONT> (len &gt; (MAX_MODEM_BUF - cs-&gt;hw.elsa.transcnt)) {
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT>;
}
fp = cs-&gt;hw.elsa.transcnt + cs-&gt;hw.elsa.transp;
fp &amp;= (MAX_MODEM_BUF -1);
count = MIN(len, MAX_MODEM_BUF - fp);
<FONT COLOR="#298C52">if</FONT> (count &lt; len) {
memcpy(cs-&gt;hw.elsa.transbuf + fp, msg, count);
cs-&gt;hw.elsa.transcnt += count;
msg += count;
count = len - count;
fp = 0;
}
memcpy(cs-&gt;hw.elsa.transbuf + fp, msg, count);
cs-&gt;hw.elsa.transcnt += count;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.transcnt &amp;&amp;
!(cs-&gt;hw.elsa.IER &amp; UART_IER_THRI)) {
cs-&gt;hw.elsa.IER |= UART_IER_THRI;
serial_outp(cs, UART_IER, cs-&gt;hw.elsa.IER);
}
restore_flags(flags);
}
<FONT COLOR="#298C52">void</FONT>
modem_set_init(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs) {
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">int</FONT> timeout;
save_flags(flags);
sti();
modem_write_cmd(cs, MInit_1, strlen(MInit_1));
timeout = 1000;
<FONT COLOR="#298C52">while</FONT>(timeout-- &amp;&amp; cs-&gt;hw.elsa.transcnt)
udelay(1000);
udelay(50000);
modem_write_cmd(cs, MInit_2, strlen(MInit_2));
timeout = 1000;
<FONT COLOR="#298C52">while</FONT>(timeout-- &amp;&amp; cs-&gt;hw.elsa.transcnt)
udelay(1000);
udelay(50000);
modem_write_cmd(cs, MInit_3, strlen(MInit_3));
timeout = 1000;
<FONT COLOR="#298C52">while</FONT>(timeout-- &amp;&amp; cs-&gt;hw.elsa.transcnt)
udelay(1000);
udelay(50000);
restore_flags(flags);
}
<FONT COLOR="#298C52">int</FONT>
setstack_elsa(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">switch</FONT> (st-&gt;l1.mode) {
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#L1_MODE_HDLC">L1_MODE_HDLC</A>:
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>:
<FONT COLOR="#298C52">if</FONT> (<A HREF="hscx.c.shtml#open_hscxstate">open_hscxstate</A>(st-&gt;l1.hardware, bcs-&gt;channel))
<FONT COLOR="#298C52">return</FONT> (-1);
st-&gt;l2.l2l1 = <A HREF="hscx.c.shtml#hscx_l2l1">hscx_l2l1</A>;
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> <A HREF="hisax.h.shtml#L1_MODE_MODEM">L1_MODE_MODEM</A>:
bcs-&gt;mode = <A HREF="hisax.h.shtml#L1_MODE_MODEM">L1_MODE_MODEM</A>;
<FONT COLOR="#298C52">if</FONT> (!test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
bcs-&gt;hw.hscx.rcvbuf = bcs-&gt;cs-&gt;hw.elsa.rcvbuf;
skb_queue_head_init(&amp;bcs-&gt;rqueue);
skb_queue_head_init(&amp;bcs-&gt;squeue);
}
bcs-&gt;hw.hscx.tx_skb = NULL;
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
bcs-&gt;event = 0;
bcs-&gt;hw.hscx.rcvidx = 0;
bcs-&gt;tx_cnt = 0;
bcs-&gt;cs-&gt;hw.elsa.bcs = bcs;
st-&gt;l2.l2l1 = modem_l2l1;
<FONT COLOR="#298C52">break</FONT>;
}
st-&gt;l1.bcs = bcs;
<A HREF="lmgr.c.shtml#setstack_manager">setstack_manager</A>(st);
bcs-&gt;st = st;
<A HREF="isdnl1.c.shtml#setstack_l1_B">setstack_l1_B</A>(st);
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">void</FONT>
init_modem(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs) {
cs-&gt;bcs[0].BC_SetStack = setstack_elsa;
cs-&gt;bcs[1].BC_SetStack = setstack_elsa;
cs-&gt;bcs[0].BC_Close = close_elsastate;
cs-&gt;bcs[1].BC_Close = close_elsastate;
<FONT COLOR="#298C52">if</FONT> (!(cs-&gt;hw.elsa.rcvbuf = kmalloc(MAX_MODEM_BUF,
GFP_ATOMIC))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"Elsa: No modem mem hw.elsa.rcvbuf\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">if</FONT> (!(cs-&gt;hw.elsa.transbuf = kmalloc(MAX_MODEM_BUF,
GFP_ATOMIC))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"Elsa: No modem mem hw.elsa.transbuf\n"</FONT>);
kfree(cs-&gt;hw.elsa.rcvbuf);
cs-&gt;hw.elsa.rcvbuf = NULL;
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">if</FONT> (mstartup(cs)) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"Elsa: problem startup modem\n"</FONT>);
}
<FONT COLOR=#0000FF>// modem_set_init(cs);</FONT>
}
<FONT COLOR="#298C52">void</FONT>
release_modem(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs) {
cs-&gt;hw.elsa.MFlag = 0;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.transbuf) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;hw.elsa.rcvbuf) {
mshutdown(cs);
kfree(cs-&gt;hw.elsa.rcvbuf);
cs-&gt;hw.elsa.rcvbuf = NULL;
}
kfree(cs-&gt;hw.elsa.transbuf);
cs-&gt;hw.elsa.transbuf = NULL;
}
}
</BODY>
</HTML>

View File

@ -0,0 +1,72 @@
<HTML>
<HEAD>
<TITLE>Dateien des HiSax-Treibers</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER>
<H1>Dateien des HiSax-Treibers</H1>
<TABLE WIDTH="60%">
<TR><TD>
<A HREF="amd7930.c.shtml">amd7930.c.shtml</A><BR>
<A HREF="arcofi.c.shtml">arcofi.c.shtml</A><BR>
<A HREF="arcofi.h.shtml">arcofi.h.shtml</A><BR>
<A HREF="asuscom.c.shtml">asuscom.c.shtml</A><BR>
<A HREF="avm_a1.c.shtml">avm_a1.c.shtml</A><BR>
<A HREF="callc.c.shtml">callc.c.shtml</A><BR>
<A HREF="config.c.shtml">config.c.shtml</A><BR>
<A HREF="diva.c.shtml">diva.c.shtml</A><BR>
<A HREF="elsa.c.shtml">elsa.c.shtml</A><BR>
<A HREF="elsa_ser.c.shtml">elsa_ser.c.shtml</A><BR>
<A HREF="fsm.c.shtml">fsm.c.shtml</A><BR>
<A HREF="hfc_2bds0.c.shtml">hfc_2bds0.c.shtml</A><BR>
<A HREF="hfc_2bds0.h.shtml">hfc_2bds0.h.shtml</A><BR>
<A HREF="hfc_2bs0.c.shtml">hfc_2bs0.c.shtml</A><BR>
<A HREF="hfc_2bs0.h.shtml">hfc_2bs0.h.shtml</A><BR>
<A HREF="hisax.h.shtml">hisax.h.shtml</A><BR>
<A HREF="hscx.c.shtml">hscx.c.shtml</A><BR>
<A HREF="hscx.h.shtml">hscx.h.shtml</A><BR>
<A HREF="hscx_irq.c.shtml">hscx_irq.c.shtml</A><BR>
<A HREF="ipac.h.shtml">ipac.h.shtml</A><BR>
<A HREF="isac.c.shtml">isac.c.shtml</A><BR>
<A HREF="isac.h.shtml">isac.h.shtml</A><BR>
<A HREF="isdnl1.c.shtml">isdnl1.c.shtml</A><BR>
<A HREF="isdnl1.h.shtml">isdnl1.h.shtml</A><BR>
<A HREF="isdnl2.c.shtml">isdnl2.c.shtml</A><BR>
</TD><TD>
<A HREF="isdnl2.h.shtml">isdnl2.h.shtml</A><BR>
<A HREF="isdnl3.c.shtml">isdnl3.c.shtml</A><BR>
<A HREF="isdnl3.h.shtml">isdnl3.h.shtml</A><BR>
<A HREF="ix1_micro.c.shtml">ix1_micro.c.shtml</A><BR>
<A HREF="l3_1tr6.c.shtml">l3_1tr6.c.shtml</A><BR>
<A HREF="l3_1tr6.h.shtml">l3_1tr6.h.shtml</A><BR>
<A HREF="l3dss1.c.shtml">l3dss1.c.shtml</A><BR>
<A HREF="l3dss1.h.shtml">l3dss1.h.shtml</A><BR>
<A HREF="lmgr.c.shtml">lmgr.c.shtml</A><BR>
<A HREF="mic.c.shtml">mic.c.shtml</A><BR>
<A HREF="netjet.c.shtml">netjet.c.shtml</A><BR>
<A HREF="niccy.c.shtml">niccy.c.shtml</A><BR>
<A HREF="q931.c.shtml">q931.c.shtml</A><BR>
<A HREF="rawhdlc.c.shtml">rawhdlc.c.shtml</A><BR>
<A HREF="rawhdlc.h.shtml">rawhdlc.h.shtml</A><BR>
<A HREF="s0box.c.shtml">s0box.c.shtml</A><BR>
<A HREF="sedlbauer.c.shtml">sedlbauer.c.shtml</A><BR>
<A HREF="sportster.c.shtml">sportster.c.shtml</A><BR>
<A HREF="tei.c.shtml">tei.c.shtml</A><BR>
<A HREF="teleint.c.shtml">teleint.c.shtml</A><BR>
<A HREF="teles0.c.shtml">teles0.c.shtml</A><BR>
<A HREF="teles3.c.shtml">teles3.c.shtml</A><BR>
<A HREF="teles3c.c.shtml">teles3c.c.shtml</A><BR>
<A HREF="telespci.c.shtml">telespci.c.shtml</A><BR>
</TD></TR>
</TABLE>
</CENTER>
</BODY>
</HTML>

249
workshop/hisax/fsm.c.shtml Normal file
View File

@ -0,0 +1,249 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>fsm.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>fsm.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* Author Karsten Keil (keil@temic-ech.spacenet.de)
* based on the teles driver from Jan den Ouden
*
* Thanks to Jan den Ouden
* Fritz Elfert
*
* $Log$
* Revision 1.9 1998/03/26 07:10:02 paul
* The jumpmatrix table in struct Fsm was an array of "int". This is not
* large enough for pointers to functions on Linux/Alpha (instant crash
* on "insmod hisax). Now there is a typedef for the pointer to function.
* This also prevents warnings about "incompatible pointer types".
*
* Revision 1.8 1998/03/07 22:56:59 tsbogend
* made HiSax working on Linux/Alpha
*
* Revision 1.7 1997/11/06 17:09:13 keil
* New 2.1 init code
*
* Revision 1.6 1997/07/27 21:42:25 keil
* proof Fsm routines
*
* Revision 1.5 1997/06/26 11:10:05 keil
* Restart timer function added
*
* Revision 1.4 1997/04/06 22:56:42 keil
* Some cosmetic changes
*
* Revision 1.3 1997/02/16 01:04:08 fritz
* Bugfix: Changed timer handling caused hang with 2.1.X
*
* Revision 1.2 1997/01/09 20:57:27 keil
* cleanup &amp; FSM_TIMER_DEBUG
*
* Revision 1.1 1996/10/13 20:04:52 keil
* Initial revision
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A NAME="FSM_TIMER_DEBUG">FSM_TIMER_DEBUG</A> 0
<A HREF="callc.c.shtml#HISAX_INITFUNC">HISAX_INITFUNC</A>(<FONT COLOR="#298C52">void</FONT>
FsmNew(<FONT COLOR="#298C52">struct</FONT> Fsm *fsm,
<FONT COLOR="#298C52">struct</FONT> FsmNode *fnlist, <FONT COLOR="#298C52">int</FONT> fncount))
{
<FONT COLOR="#298C52">int</FONT> i;
fsm-&gt;jumpmatrix = (<A HREF="hisax.h.shtml#FSMFNPTR">FSMFNPTR</A> *)
kmalloc(<FONT COLOR="#298C52">sizeof</FONT> (<A HREF="hisax.h.shtml#FSMFNPTR">FSMFNPTR</A>) * fsm-&gt;state_count * fsm-&gt;event_count, GFP_KERNEL);
memset(fsm-&gt;jumpmatrix, 0, <FONT COLOR="#298C52">sizeof</FONT> (<A HREF="hisax.h.shtml#FSMFNPTR">FSMFNPTR</A>) * fsm-&gt;state_count * fsm-&gt;event_count);
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; fncount; i++)
<FONT COLOR="#298C52">if</FONT> ((fnlist[i].state&gt;=fsm-&gt;state_count) || (fnlist[i].event&gt;=fsm-&gt;event_count)) {
printk(KERN_ERR <FONT COLOR="#FF0000">"FsmNew Error line %d st(%ld/%ld) ev(%ld/%ld)\n"</FONT>,
i,(<FONT COLOR="#298C52">long</FONT>)fnlist[i].state,(<FONT COLOR="#298C52">long</FONT>)fsm-&gt;state_count,
(<FONT COLOR="#298C52">long</FONT>)fnlist[i].event,(<FONT COLOR="#298C52">long</FONT>)fsm-&gt;event_count);
} <FONT COLOR="#298C52">else</FONT>
fsm-&gt;jumpmatrix[fsm-&gt;state_count * fnlist[i].event +
fnlist[i].state] = (<A HREF="hisax.h.shtml#FSMFNPTR">FSMFNPTR</A>) fnlist[i].routine;
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="FsmFree">FsmFree</A>(<FONT COLOR="#298C52">struct</FONT> Fsm *fsm)
{
kfree((<FONT COLOR="#298C52">void</FONT> *) fsm-&gt;jumpmatrix);
}
<FONT COLOR="#298C52">int</FONT>
<A HREF="#FsmEvent">FsmEvent</A>(<FONT COLOR="#298C52">struct</FONT> FsmInst *fi, <FONT COLOR="#298C52">int</FONT> event, <FONT COLOR="#298C52">void</FONT> *arg)
{
<A HREF="hisax.h.shtml#FSMFNPTR">FSMFNPTR</A> r;
<FONT COLOR="#298C52">char</FONT> str[80];
<FONT COLOR="#298C52">if</FONT> ((fi-&gt;state&gt;=fi-&gt;fsm-&gt;state_count) || (event &gt;= fi-&gt;fsm-&gt;event_count)) {
printk(KERN_ERR <FONT COLOR="#FF0000">"FsmEvent Error st(%ld/%ld) ev(%d/%ld)\n"</FONT>,
(<FONT COLOR="#298C52">long</FONT>)fi-&gt;state,(<FONT COLOR="#298C52">long</FONT>)fi-&gt;fsm-&gt;state_count,event,(<FONT COLOR="#298C52">long</FONT>)fi-&gt;fsm-&gt;event_count);
<FONT COLOR="#298C52">return</FONT>(1);
}
r = fi-&gt;fsm-&gt;jumpmatrix[fi-&gt;fsm-&gt;state_count * event + fi-&gt;state];
<FONT COLOR="#298C52">if</FONT> (r) {
<FONT COLOR="#298C52">if</FONT> (fi-&gt;debug) {
sprintf(str, <FONT COLOR="#FF0000">"State %s Event %s"</FONT>,
fi-&gt;fsm-&gt;strState[fi-&gt;state],
fi-&gt;fsm-&gt;strEvent[event]);
fi-&gt;printdebug(fi, str);
}
r(fi, event, arg);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR="#298C52">if</FONT> (fi-&gt;debug) {
sprintf(str, <FONT COLOR="#FF0000">"State %s Event %s no routine"</FONT>,
fi-&gt;fsm-&gt;strState[fi-&gt;state],
fi-&gt;fsm-&gt;strEvent[event]);
fi-&gt;printdebug(fi, str);
}
<FONT COLOR="#298C52">return</FONT> (!0);
}
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="FsmChangeState">FsmChangeState</A>(<FONT COLOR="#298C52">struct</FONT> FsmInst *fi, <FONT COLOR="#298C52">int</FONT> newstate)
{
<FONT COLOR="#298C52">char</FONT> str[80];
fi-&gt;state = newstate;
<FONT COLOR="#298C52">if</FONT> (fi-&gt;debug) {
sprintf(str, <FONT COLOR="#FF0000">"ChangeState %s"</FONT>,
fi-&gt;fsm-&gt;strState[newstate]);
fi-&gt;printdebug(fi, str);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A NAME="FsmExpireTimer">FsmExpireTimer</A>(<FONT COLOR="#298C52">struct</FONT> FsmTimer *ft)
{
<FONT COLOR=#A521F7>#if</FONT> <A HREF="#FSM_TIMER_DEBUG">FSM_TIMER_DEBUG</A>
<FONT COLOR="#298C52">if</FONT> (ft-&gt;fi-&gt;debug) {
<FONT COLOR="#298C52">char</FONT> str[40];
sprintf(str, <FONT COLOR="#FF0000">"FsmExpireTimer %lx"</FONT>, (<FONT COLOR="#298C52">long</FONT>) ft);
ft-&gt;fi-&gt;printdebug(ft-&gt;fi, str);
}
<FONT COLOR=#A521F7>#endif</FONT>
<A HREF="#FsmEvent">FsmEvent</A>(ft-&gt;fi, ft-&gt;event, ft-&gt;arg);
}
<FONT COLOR="#298C52">void</FONT>
<A HREF="#FsmInitTimer">FsmInitTimer</A>(<FONT COLOR="#298C52">struct</FONT> FsmInst *fi, <FONT COLOR="#298C52">struct</FONT> FsmTimer *ft)
{
ft-&gt;fi = fi;
ft-&gt;tl.function = (<FONT COLOR="#298C52">void</FONT> *) <A HREF="#FsmExpireTimer">FsmExpireTimer</A>;
ft-&gt;tl.data = (<FONT COLOR="#298C52">long</FONT>) ft;
<FONT COLOR=#A521F7>#if</FONT> <A HREF="#FSM_TIMER_DEBUG">FSM_TIMER_DEBUG</A>
<FONT COLOR="#298C52">if</FONT> (ft-&gt;fi-&gt;debug) {
<FONT COLOR="#298C52">char</FONT> str[40];
sprintf(str, <FONT COLOR="#FF0000">"FsmInitTimer %lx"</FONT>, (<FONT COLOR="#298C52">long</FONT>) ft);
ft-&gt;fi-&gt;printdebug(ft-&gt;fi, str);
}
<FONT COLOR=#A521F7>#endif</FONT>
init_timer(&amp;ft-&gt;tl);
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="FsmDelTimer">FsmDelTimer</A>(<FONT COLOR="#298C52">struct</FONT> FsmTimer *ft, <FONT COLOR="#298C52">int</FONT> where)
{
<FONT COLOR=#A521F7>#if</FONT> <A HREF="#FSM_TIMER_DEBUG">FSM_TIMER_DEBUG</A>
<FONT COLOR="#298C52">if</FONT> (ft-&gt;fi-&gt;debug) {
<FONT COLOR="#298C52">char</FONT> str[40];
sprintf(str, <FONT COLOR="#FF0000">"FsmDelTimer %lx %d"</FONT>, (<FONT COLOR="#298C52">long</FONT>) ft, where);
ft-&gt;fi-&gt;printdebug(ft-&gt;fi, str);
}
<FONT COLOR=#A521F7>#endif</FONT>
del_timer(&amp;ft-&gt;tl);
}
<FONT COLOR="#298C52">int</FONT>
<A NAME="FsmAddTimer">FsmAddTimer</A>(<FONT COLOR="#298C52">struct</FONT> FsmTimer *ft,
<FONT COLOR="#298C52">int</FONT> millisec, <FONT COLOR="#298C52">int</FONT> event, <FONT COLOR="#298C52">void</FONT> *arg, <FONT COLOR="#298C52">int</FONT> where)
{
<FONT COLOR=#A521F7>#if</FONT> <A HREF="#FSM_TIMER_DEBUG">FSM_TIMER_DEBUG</A>
<FONT COLOR="#298C52">if</FONT> (ft-&gt;fi-&gt;debug) {
<FONT COLOR="#298C52">char</FONT> str[40];
sprintf(str, <FONT COLOR="#FF0000">"FsmAddTimer %lx %d %d"</FONT>, (<FONT COLOR="#298C52">long</FONT>) ft, millisec, where);
ft-&gt;fi-&gt;printdebug(ft-&gt;fi, str);
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (ft-&gt;tl.next || ft-&gt;tl.prev) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"FsmAddTimer: timer already active!\n"</FONT>);
ft-&gt;fi-&gt;printdebug(ft-&gt;fi, <FONT COLOR="#FF0000">"FsmAddTimer already active!"</FONT>);
<FONT COLOR="#298C52">return</FONT> -1;
}
init_timer(&amp;ft-&gt;tl);
ft-&gt;event = event;
ft-&gt;arg = arg;
ft-&gt;tl.expires = jiffies + (millisec * HZ) / 1000;
add_timer(&amp;ft-&gt;tl);
<FONT COLOR="#298C52">return</FONT> 0;
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="FsmRestartTimer">FsmRestartTimer</A>(<FONT COLOR="#298C52">struct</FONT> FsmTimer *ft,
<FONT COLOR="#298C52">int</FONT> millisec, <FONT COLOR="#298C52">int</FONT> event, <FONT COLOR="#298C52">void</FONT> *arg, <FONT COLOR="#298C52">int</FONT> where)
{
<FONT COLOR=#A521F7>#if</FONT> <A HREF="#FSM_TIMER_DEBUG">FSM_TIMER_DEBUG</A>
<FONT COLOR="#298C52">if</FONT> (ft-&gt;fi-&gt;debug) {
<FONT COLOR="#298C52">char</FONT> str[40];
sprintf(str, <FONT COLOR="#FF0000">"FsmRestartTimer %lx %d %d"</FONT>, (<FONT COLOR="#298C52">long</FONT>) ft, millisec, where);
ft-&gt;fi-&gt;printdebug(ft-&gt;fi, str);
}
<FONT COLOR=#A521F7>#endif</FONT>
<FONT COLOR="#298C52">if</FONT> (ft-&gt;tl.next || ft-&gt;tl.prev)
del_timer(&amp;ft-&gt;tl);
init_timer(&amp;ft-&gt;tl);
ft-&gt;event = event;
ft-&gt;arg = arg;
ft-&gt;tl.expires = jiffies + (millisec * HZ) / 1000;
add_timer(&amp;ft-&gt;tl);
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="jiftime">jiftime</A>(<FONT COLOR="#298C52">char</FONT> *s, <FONT COLOR="#298C52">long</FONT> mark)
{
s += 8;
*s-- = <FONT COLOR="#FF0000">'\0'</FONT>;
*s-- = mark % 10 + <FONT COLOR="#FF0000">'0'</FONT>;
mark /= 10;
*s-- = mark % 10 + <FONT COLOR="#FF0000">'0'</FONT>;
mark /= 10;
*s-- = <FONT COLOR="#FF0000">'.'</FONT>;
*s-- = mark % 10 + <FONT COLOR="#FF0000">'0'</FONT>;
mark /= 10;
*s-- = mark % 6 + <FONT COLOR="#FF0000">'0'</FONT>;
mark /= 6;
*s-- = <FONT COLOR="#FF0000">':'</FONT>;
*s-- = mark % 10 + <FONT COLOR="#FF0000">'0'</FONT>;
mark /= 10;
*s-- = mark % 10 + <FONT COLOR="#FF0000">'0'</FONT>;
}
</BODY>
</HTML>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,153 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>hfc_2bds0.h</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>hfc_2bds0.h</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* specific defines for CCD's HFC 2BDS0
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
* $Log$
* Revision 1.2 1998/02/02 13:26:15 keil
* New
*
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_CIRM 0x18
<FONT COLOR=#A521F7>#define</FONT> HFCD_CTMT 0x19
<FONT COLOR=#A521F7>#define</FONT> HFCD_INT_M1 0x1A
<FONT COLOR=#A521F7>#define</FONT> HFCD_INT_M2 0x1B
<FONT COLOR=#A521F7>#define</FONT> HFCD_INT_S1 0x1E
<FONT COLOR=#A521F7>#define</FONT> HFCD_STAT 0x1C
<FONT COLOR=#A521F7>#define</FONT> HFCD_STAT_DISB 0x1D
<FONT COLOR=#A521F7>#define</FONT> HFCD_STATES 0x30
<FONT COLOR=#A521F7>#define</FONT> HFCD_SCTRL 0x31
<FONT COLOR=#A521F7>#define</FONT> HFCD_TEST 0x32
<FONT COLOR=#A521F7>#define</FONT> HFCD_SQ 0x34
<FONT COLOR=#A521F7>#define</FONT> HFCD_CLKDEL 0x37
<FONT COLOR=#A521F7>#define</FONT> HFCD_MST_MODE 0x2E
<FONT COLOR=#A521F7>#define</FONT> HFCD_CONN 0x2F
<FONT COLOR=#A521F7>#define</FONT> HFCD_FIFO 0x80
<FONT COLOR=#A521F7>#define</FONT> HFCD_Z1 0x10
<FONT COLOR=#A521F7>#define</FONT> HFCD_Z2 0x18
<FONT COLOR=#A521F7>#define</FONT> HFCD_Z_LOW 0x00
<FONT COLOR=#A521F7>#define</FONT> HFCD_Z_HIGH 0x04
<FONT COLOR=#A521F7>#define</FONT> HFCD_F1_INC 0x12
<FONT COLOR=#A521F7>#define</FONT> HFCD_FIFO_IN 0x16
<FONT COLOR=#A521F7>#define</FONT> HFCD_F1 0x1a
<FONT COLOR=#A521F7>#define</FONT> HFCD_F2 0x1e
<FONT COLOR=#A521F7>#define</FONT> HFCD_F2_INC 0x22
<FONT COLOR=#A521F7>#define</FONT> HFCD_FIFO_OUT 0x26
<FONT COLOR=#A521F7>#define</FONT> HFCD_REC 0x01
<FONT COLOR=#A521F7>#define</FONT> HFCD_SEND 0x00
<FONT COLOR=#A521F7>#define</FONT> HFCB_FIFO 0x80
<FONT COLOR=#A521F7>#define</FONT> HFCB_Z1 0x00
<FONT COLOR=#A521F7>#define</FONT> HFCB_Z2 0x08
<FONT COLOR=#A521F7>#define</FONT> HFCB_Z_LOW 0x00
<FONT COLOR=#A521F7>#define</FONT> HFCB_Z_HIGH 0x04
<FONT COLOR=#A521F7>#define</FONT> HFCB_F1_INC 0x28
<FONT COLOR=#A521F7>#define</FONT> HFCB_FIFO_IN 0x2c
<FONT COLOR=#A521F7>#define</FONT> HFCB_F1 0x30
<FONT COLOR=#A521F7>#define</FONT> HFCB_F2 0x34
<FONT COLOR=#A521F7>#define</FONT> HFCB_F2_INC 0x38
<FONT COLOR=#A521F7>#define</FONT> HFCB_FIFO_OUT 0x3c
<FONT COLOR=#A521F7>#define</FONT> HFCB_REC 0x01
<FONT COLOR=#A521F7>#define</FONT> HFCB_SEND 0x00
<FONT COLOR=#A521F7>#define</FONT> HFCB_B1 0x00
<FONT COLOR=#A521F7>#define</FONT> HFCB_B2 0x02
<FONT COLOR=#A521F7>#define</FONT> HFCB_CHANNEL(ch) (ch ? HFCB_B2 : HFCB_B1)
<FONT COLOR=#A521F7>#define</FONT> HFCD_STATUS 0
<FONT COLOR=#A521F7>#define</FONT> HFCD_DATA 1
<FONT COLOR=#A521F7>#define</FONT> HFCD_DATA_NODEB 2
<FONT COLOR=#0000FF>/* Status (READ) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_BUSY 0x01
<FONT COLOR=#A521F7>#define</FONT> HFCD_BUSY_NBUSY 0x04
<FONT COLOR=#A521F7>#define</FONT> HFCD_TIMER_ELAP 0x10
<FONT COLOR=#A521F7>#define</FONT> HFCD_STATINT 0x20
<FONT COLOR=#A521F7>#define</FONT> HFCD_FRAMEINT 0x40
<FONT COLOR=#A521F7>#define</FONT> HFCD_ANYINT 0x80
<FONT COLOR=#0000FF>/* CTMT (Write) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_CLTIMER 0x80
<FONT COLOR=#A521F7>#define</FONT> HFCD_TIM25 0x00
<FONT COLOR=#A521F7>#define</FONT> HFCD_TIM50 0x08
<FONT COLOR=#A521F7>#define</FONT> HFCD_TIM400 0x10
<FONT COLOR=#A521F7>#define</FONT> HFCD_TIM800 0x18
<FONT COLOR=#A521F7>#define</FONT> HFCD_AUTO_TIMER 0x20
<FONT COLOR=#A521F7>#define</FONT> HFCD_TRANSB2 0x02
<FONT COLOR=#A521F7>#define</FONT> HFCD_TRANSB1 0x01
<FONT COLOR=#0000FF>/* CIRM (Write) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_RESET 0x08
<FONT COLOR=#A521F7>#define</FONT> HFCD_MEM8K 0x10
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTA 0x01
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTB 0x02
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTC 0x03
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTD 0x04
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTE 0x05
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTF 0x06
<FONT COLOR=#0000FF>/* INT_M1;INT_S1 */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_B1TRANS 0x01
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_B2TRANS 0x02
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_DTRANS 0x04
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_B1REC 0x08
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_B2REC 0x10
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_DREC 0x20
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_L1STATE 0x40
<FONT COLOR=#A521F7>#define</FONT> HFCD_INTS_TIMER 0x80
<FONT COLOR=#0000FF>/* INT_M2 */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_IRQ_ENABLE 0x08
<FONT COLOR=#0000FF>/* STATES */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_LOAD_STATE 0x10
<FONT COLOR=#A521F7>#define</FONT> HFCD_ACTIVATE 0x20
<FONT COLOR=#A521F7>#define</FONT> HFCD_DO_ACTION 0x40
<FONT COLOR=#0000FF>/* HFCD_MST_MODE */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_MASTER 0x01
<FONT COLOR=#0000FF>/* HFCD_SCTRL */</FONT>
<FONT COLOR=#A521F7>#define</FONT> SCTRL_B1_ENA 0x01
<FONT COLOR=#A521F7>#define</FONT> SCTRL_B2_ENA 0x02
<FONT COLOR=#A521F7>#define</FONT> SCTRL_LOW_PRIO 0x08
<FONT COLOR=#A521F7>#define</FONT> SCTRL_SQ_ENA 0x10
<FONT COLOR=#A521F7>#define</FONT> SCTRL_TEST 0x20
<FONT COLOR=#A521F7>#define</FONT> SCTRL_NONE_CAP 0x40
<FONT COLOR=#A521F7>#define</FONT> SCTRL_PWR_DOWN 0x80
<FONT COLOR=#0000FF>/* HFCD_TEST */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFCD_AUTO_AWAKE 0x01
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> main_irq_2bds0(<FONT COLOR="#298C52">struct</FONT> BCState *bcs);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> init2bds0(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> release2bds0(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> hfc2bds0_interrupt(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char val);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> set_cs_func(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs);
</BODY>
</HTML>

View File

@ -0,0 +1,627 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>hfc_2bs0.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>hfc_2bs0.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* specific routines for CCD's HFC 2BS0
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
* $Log$
* Revision 1.5 1998/05/25 12:57:54 keil
* HiSax golden code from certification, Don't use !!!
* No leased lines, no X75, but many changes.
*
* Revision 1.4 1998/02/12 23:07:29 keil
* change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb()
*
* Revision 1.3 1997/11/06 17:13:35 keil
* New 2.1 init code
*
* Revision 1.2 1997/10/29 19:04:47 keil
* changes for 2.1
*
* Revision 1.1 1997/09/11 17:31:33 keil
* Common part for HFC 2BS0 based cards
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hfc_2bs0.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isac.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isdnl1.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/interrupt.h&gt;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">int</FONT>
WaitForBusy(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">int</FONT> to = 130;
<FONT COLOR="#298C52">long</FONT> flags;
u_char val;
save_flags(flags);
cli();
<FONT COLOR="#298C52">while</FONT> (!(cs-&gt;BC_Read_Reg(cs, HFC_STATUS, 0) &amp; HFC_BUSY) &amp;&amp; to) {
val = cs-&gt;BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F2 |
(cs-&gt;hw.hfc.cip &amp; 3));
udelay(1);
to--;
}
restore_flags(flags);
<FONT COLOR="#298C52">if</FONT> (!to) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: waitforBusy timeout\n"</FONT>);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT>
<FONT COLOR="#298C52">return</FONT> (to);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">int</FONT>
WaitNoBusy(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">int</FONT> to = 125;
<FONT COLOR="#298C52">while</FONT> ((cs-&gt;BC_Read_Reg(cs, HFC_STATUS, 0) &amp; HFC_BUSY) &amp;&amp; to) {
udelay(1);
to--;
}
<FONT COLOR="#298C52">if</FONT> (!to) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: waitforBusy timeout\n"</FONT>);
<FONT COLOR="#298C52">return</FONT> (0);
} <FONT COLOR="#298C52">else</FONT>
<FONT COLOR="#298C52">return</FONT> (to);
}
<FONT COLOR="#298C52">int</FONT>
GetFreeFifoBytes(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">int</FONT> s;
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hfc.f1 == bcs-&gt;hw.hfc.f2)
<FONT COLOR="#298C52">return</FONT> (bcs-&gt;cs-&gt;hw.hfc.fifosize);
s = bcs-&gt;hw.hfc.send[bcs-&gt;hw.hfc.f1] - bcs-&gt;hw.hfc.send[bcs-&gt;hw.hfc.f2];
<FONT COLOR="#298C52">if</FONT> (s &lt;= 0)
s += bcs-&gt;cs-&gt;hw.hfc.fifosize;
s = bcs-&gt;cs-&gt;hw.hfc.fifosize - s;
<FONT COLOR="#298C52">return</FONT> (s);
}
<FONT COLOR="#298C52">int</FONT>
ReadZReg(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, u_char reg)
{
<FONT COLOR="#298C52">int</FONT> val;
WaitNoBusy(bcs-&gt;cs);
val = 256 * bcs-&gt;cs-&gt;BC_Read_Reg(bcs-&gt;cs, HFC_DATA, reg | HFC_CIP | HFC_Z_HIGH);
WaitNoBusy(bcs-&gt;cs);
val += bcs-&gt;cs-&gt;BC_Read_Reg(bcs-&gt;cs, HFC_DATA, reg | HFC_CIP | HFC_Z_LOW);
<FONT COLOR="#298C52">return</FONT> (val);
}
<FONT COLOR="#298C52">void</FONT>
hfc_sched_event(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> event)
{
bcs-&gt;event |= 1 &lt;&lt; event;
queue_task(&amp;bcs-&gt;tqueue, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
hfc_clear_fifo(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">int</FONT> idx, cnt;
<FONT COLOR="#298C52">int</FONT> rcnt, z1, z2;
u_char cip, f1, f2;
<FONT COLOR="#298C52">char</FONT> tmp[64];
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) &amp;&amp; !(cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>))
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hfc_clear_fifo"</FONT>);
save_flags(flags);
cli();
cip = HFC_CIP | HFC_F1 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
<FONT COLOR="#298C52">if</FONT> ((cip &amp; 0xc3) != (cs-&gt;hw.hfc.cip &amp; 0xc3)) {
cs-&gt;BC_Write_Reg(cs, HFC_STATUS, cip, cip);
WaitForBusy(cs);
}
WaitNoBusy(cs);
f1 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
cip = HFC_CIP | HFC_F2 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
WaitNoBusy(cs);
f2 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
z1 = ReadZReg(bcs, HFC_Z1 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel));
z2 = ReadZReg(bcs, HFC_Z2 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel));
cnt = 32;
<FONT COLOR="#298C52">while</FONT> (((f1 != f2) || (z1 != z2)) &amp;&amp; cnt--) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"hfc clear %d f1(%d) f2(%d)"</FONT>,
bcs-&gt;channel, f1, f2);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
rcnt = z1 - z2;
<FONT COLOR="#298C52">if</FONT> (rcnt &lt; 0)
rcnt += cs-&gt;hw.hfc.fifosize;
<FONT COLOR="#298C52">if</FONT> (rcnt)
rcnt++;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"hfc clear %d z1(%x) z2(%x) cnt(%d)"</FONT>,
bcs-&gt;channel, z1, z2, rcnt);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
cip = HFC_CIP | HFC_FIFO_OUT | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
idx = 0;
<FONT COLOR="#298C52">while</FONT> ((idx &lt; rcnt) &amp;&amp; WaitNoBusy(cs)) {
cs-&gt;BC_Read_Reg(cs, HFC_DATA_NODEB, cip);
idx++;
}
<FONT COLOR="#298C52">if</FONT> (f1 != f2) {
WaitNoBusy(cs);
cs-&gt;BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F2_INC | HFC_REC |
HFC_CHANNEL(bcs-&gt;channel));
WaitForBusy(cs);
}
cip = HFC_CIP | HFC_F1 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
WaitNoBusy(cs);
f1 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
cip = HFC_CIP | HFC_F2 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
WaitNoBusy(cs);
f2 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
z1 = ReadZReg(bcs, HFC_Z1 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel));
z2 = ReadZReg(bcs, HFC_Z2 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel));
}
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">struct</FONT> sk_buff
*
hfc_empty_fifo(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> count)
{
u_char *ptr;
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">int</FONT> idx;
<FONT COLOR="#298C52">int</FONT> chksum;
u_char stat, cip;
<FONT COLOR="#298C52">char</FONT> tmp[64];
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) &amp;&amp; !(cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>))
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hfc_empty_fifo"</FONT>);
idx = 0;
<FONT COLOR="#298C52">if</FONT> (count &gt; <A HREF="hisax.h.shtml#HSCX_BUFMAX">HSCX_BUFMAX</A> + 3) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hfc_empty_fifo: incoming packet too large"</FONT>);
cip = HFC_CIP | HFC_FIFO_OUT | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
<FONT COLOR="#298C52">while</FONT> ((idx++ &lt; count) &amp;&amp; WaitNoBusy(cs))
cs-&gt;BC_Read_Reg(cs, HFC_DATA_NODEB, cip);
WaitNoBusy(cs);
stat = cs-&gt;BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F2_INC | HFC_REC |
HFC_CHANNEL(bcs-&gt;channel));
WaitForBusy(cs);
<FONT COLOR="#298C52">return</FONT> (NULL);
}
<FONT COLOR="#298C52">if</FONT> (count &lt; 4) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hfc_empty_fifo: incoming packet too small"</FONT>);
cip = HFC_CIP | HFC_FIFO_OUT | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
<FONT COLOR="#298C52">while</FONT> ((idx++ &lt; count) &amp;&amp; WaitNoBusy(cs))
cs-&gt;BC_Read_Reg(cs, HFC_DATA_NODEB, cip);
WaitNoBusy(cs);
stat = cs-&gt;BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F2_INC | HFC_REC |
HFC_CHANNEL(bcs-&gt;channel));
WaitForBusy(cs);
<FONT COLOR="#298C52">return</FONT> (NULL);
}
<FONT COLOR="#298C52">if</FONT> (!(skb = dev_alloc_skb(count - 3)))
printk(KERN_WARNING <FONT COLOR="#FF0000">"HFC: receive out of memory\n"</FONT>);
<FONT COLOR="#298C52">else</FONT> {
ptr = skb_put(skb, count - 3);
idx = 0;
cip = HFC_CIP | HFC_FIFO_OUT | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
<FONT COLOR="#298C52">while</FONT> ((idx &lt; count - 3) &amp;&amp; WaitNoBusy(cs)) {
*ptr++ = cs-&gt;BC_Read_Reg(cs, HFC_DATA_NODEB, cip);
idx++;
}
<FONT COLOR="#298C52">if</FONT> (idx != count - 3) {
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"RFIFO BUSY error"</FONT>);
printk(KERN_WARNING <FONT COLOR="#FF0000">"HFC FIFO channel %d BUSY Error\n"</FONT>, bcs-&gt;channel);
dev_kfree_skb(skb);
WaitNoBusy(cs);
stat = cs-&gt;BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F2_INC | HFC_REC |
HFC_CHANNEL(bcs-&gt;channel));
WaitForBusy(cs);
<FONT COLOR="#298C52">return</FONT> (NULL);
}
WaitNoBusy(cs);
chksum = (cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip) &lt;&lt; 8);
WaitNoBusy(cs);
chksum += cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
WaitNoBusy(cs);
stat = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"hfc_empty_fifo %d chksum %x stat %x"</FONT>,
bcs-&gt;channel, chksum, stat);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (stat) {
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"FIFO CRC error"</FONT>);
dev_kfree_skb(skb);
skb = NULL;
}
WaitNoBusy(cs);
stat = cs-&gt;BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F2_INC | HFC_REC |
HFC_CHANNEL(bcs-&gt;channel));
WaitForBusy(cs);
}
<FONT COLOR="#298C52">return</FONT> (skb);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
hfc_fill_fifo(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">int</FONT> idx, fcnt;
<FONT COLOR="#298C52">int</FONT> count;
u_char cip;
<FONT COLOR="#298C52">char</FONT> tmp[64];
<FONT COLOR="#298C52">if</FONT> (!bcs-&gt;hw.hfc.tx_skb)
<FONT COLOR="#298C52">return</FONT>;
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hfc.tx_skb-&gt;len &lt;= 0)
<FONT COLOR="#298C52">return</FONT>;
save_flags(flags);
cli();
cip = HFC_CIP | HFC_F1 | HFC_SEND | HFC_CHANNEL(bcs-&gt;channel);
<FONT COLOR="#298C52">if</FONT> ((cip &amp; 0xc3) != (cs-&gt;hw.hfc.cip &amp; 0xc3)) {
cs-&gt;BC_Write_Reg(cs, HFC_STATUS, cip, cip);
WaitForBusy(cs);
}
WaitNoBusy(cs);
bcs-&gt;hw.hfc.f1 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
cip = HFC_CIP | HFC_F2 | HFC_SEND | HFC_CHANNEL(bcs-&gt;channel);
WaitNoBusy(cs);
bcs-&gt;hw.hfc.f2 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
bcs-&gt;hw.hfc.send[bcs-&gt;hw.hfc.f1] = ReadZReg(bcs, HFC_Z1 | HFC_SEND | HFC_CHANNEL(bcs-&gt;channel));
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"hfc_fill_fifo %d f1(%d) f2(%d) z1(%x)"</FONT>,
bcs-&gt;channel, bcs-&gt;hw.hfc.f1, bcs-&gt;hw.hfc.f2,
bcs-&gt;hw.hfc.send[bcs-&gt;hw.hfc.f1]);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
fcnt = bcs-&gt;hw.hfc.f1 - bcs-&gt;hw.hfc.f2;
<FONT COLOR="#298C52">if</FONT> (fcnt &lt; 0)
fcnt += 32;
<FONT COLOR="#298C52">if</FONT> (fcnt &gt; 30) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hfc_fill_fifo more as 30 frames"</FONT>);
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT>;
}
count = GetFreeFifoBytes(bcs);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"hfc_fill_fifo %d count(%d/%d)"</FONT>,
bcs-&gt;channel, bcs-&gt;hw.hfc.tx_skb-&gt;len,
count);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (count &lt; bcs-&gt;hw.hfc.tx_skb-&gt;len) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hfc_fill_fifo no fifo mem"</FONT>);
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT>;
}
cip = HFC_CIP | HFC_FIFO_IN | HFC_SEND | HFC_CHANNEL(bcs-&gt;channel);
idx = 0;
<FONT COLOR="#298C52">while</FONT> ((idx &lt; bcs-&gt;hw.hfc.tx_skb-&gt;len) &amp;&amp; WaitNoBusy(cs))
cs-&gt;BC_Write_Reg(cs, HFC_DATA_NODEB, cip, bcs-&gt;hw.hfc.tx_skb-&gt;data[idx++]);
<FONT COLOR="#298C52">if</FONT> (idx != bcs-&gt;hw.hfc.tx_skb-&gt;len) {
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"FIFO Send BUSY error"</FONT>);
printk(KERN_WARNING <FONT COLOR="#FF0000">"HFC S FIFO channel %d BUSY Error\n"</FONT>, bcs-&gt;channel);
} <FONT COLOR="#298C52">else</FONT> {
count = bcs-&gt;hw.hfc.tx_skb-&gt;len;
bcs-&gt;tx_cnt -= count;
<FONT COLOR="#298C52">if</FONT> (<A HREF="hisax.h.shtml#PACKET_NOACK">PACKET_NOACK</A> == bcs-&gt;hw.hfc.tx_skb-&gt;pkt_type)
count = -1;
dev_kfree_skb(bcs-&gt;hw.hfc.tx_skb);
bcs-&gt;hw.hfc.tx_skb = NULL;
WaitForBusy(cs);
WaitNoBusy(cs);
cs-&gt;BC_Read_Reg(cs, HFC_DATA, HFC_CIP | HFC_F1_INC | HFC_SEND | HFC_CHANNEL(bcs-&gt;channel));
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;st-&gt;lli.l1writewakeup &amp;&amp; (count &gt;= 0))
bcs-&gt;st-&gt;lli.l1writewakeup(bcs-&gt;st, count);
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
}
restore_flags(flags);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">void</FONT>
main_irq_hfc(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">int</FONT> z1, z2, rcnt;
u_char f1, f2, cip;
<FONT COLOR="#298C52">int</FONT> receive, transmit, count = 5;
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR="#298C52">char</FONT> tmp[64];
save_flags(flags);
Begin:
cli();
count--;
cip = HFC_CIP | HFC_F1 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
<FONT COLOR="#298C52">if</FONT> ((cip &amp; 0xc3) != (cs-&gt;hw.hfc.cip &amp; 0xc3)) {
cs-&gt;BC_Write_Reg(cs, HFC_STATUS, cip, cip);
WaitForBusy(cs);
}
WaitNoBusy(cs);
f1 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
cip = HFC_CIP | HFC_F2 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel);
WaitNoBusy(cs);
f2 = cs-&gt;BC_Read_Reg(cs, HFC_DATA, cip);
<FONT COLOR="#298C52">if</FONT> (f1 != f2) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"hfc rec %d f1(%d) f2(%d)"</FONT>,
bcs-&gt;channel, f1, f2);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
WaitForBusy(cs);
z1 = ReadZReg(bcs, HFC_Z1 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel));
z2 = ReadZReg(bcs, HFC_Z2 | HFC_REC | HFC_CHANNEL(bcs-&gt;channel));
rcnt = z1 - z2;
<FONT COLOR="#298C52">if</FONT> (rcnt &lt; 0)
rcnt += cs-&gt;hw.hfc.fifosize;
rcnt++;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"hfc rec %d z1(%x) z2(%x) cnt(%d)"</FONT>,
bcs-&gt;channel, z1, z2, rcnt);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR=#0000FF>/* sti(); */</FONT>
<FONT COLOR="#298C52">if</FONT> ((skb = hfc_empty_fifo(bcs, rcnt))) {
skb_queue_tail(&amp;bcs-&gt;rqueue, skb);
hfc_sched_event(bcs, <A HREF="isdnl1.h.shtml#B_RCVBUFREADY">B_RCVBUFREADY</A>);
}
receive = 1;
} <FONT COLOR="#298C52">else</FONT>
receive = 0;
restore_flags(flags);
udelay(1);
cli();
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hfc.tx_skb) {
transmit = 1;
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
hfc_fill_fifo(bcs);
<FONT COLOR="#298C52">if</FONT> (test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag))
transmit = 0;
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR="#298C52">if</FONT> ((bcs-&gt;hw.hfc.tx_skb = skb_dequeue(&amp;bcs-&gt;squeue))) {
transmit = 1;
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
hfc_fill_fifo(bcs);
<FONT COLOR="#298C52">if</FONT> (test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag))
transmit = 0;
} <FONT COLOR="#298C52">else</FONT> {
transmit = 0;
hfc_sched_event(bcs, <A HREF="isdnl1.h.shtml#B_XMTBUFREADY">B_XMTBUFREADY</A>);
}
}
restore_flags(flags);
<FONT COLOR="#298C52">if</FONT> ((receive || transmit) &amp;&amp; count)
<FONT COLOR="#298C52">goto</FONT> Begin;
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">void</FONT>
mode_hfc(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> mode, <FONT COLOR="#298C52">int</FONT> bc)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[40];
sprintf(tmp, <FONT COLOR="#FF0000">"HFC 2BS0 mode %d bchan %d/%d"</FONT>,
mode, bc, bcs-&gt;channel);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
bcs-&gt;mode = mode;
<FONT COLOR="#298C52">switch</FONT> (mode) {
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#L1_MODE_NULL">L1_MODE_NULL</A>):
<FONT COLOR="#298C52">if</FONT> (bc)
cs-&gt;hw.hfc.isac_spcr &amp;= ~0x03;
<FONT COLOR="#298C52">else</FONT>
cs-&gt;hw.hfc.isac_spcr &amp;= ~0x0c;
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>):
<FONT COLOR="#298C52">if</FONT> (bc) {
cs-&gt;hw.hfc.ctmt |= 1;
cs-&gt;hw.hfc.isac_spcr &amp;= ~0x03;
cs-&gt;hw.hfc.isac_spcr |= 0x02;
} <FONT COLOR="#298C52">else</FONT> {
cs-&gt;hw.hfc.ctmt |= 2;
cs-&gt;hw.hfc.isac_spcr &amp;= ~0x0c;
cs-&gt;hw.hfc.isac_spcr |= 0x08;
}
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#L1_MODE_HDLC">L1_MODE_HDLC</A>):
<FONT COLOR="#298C52">if</FONT> (bc) {
cs-&gt;hw.hfc.ctmt &amp;= ~1;
cs-&gt;hw.hfc.isac_spcr &amp;= ~0x03;
cs-&gt;hw.hfc.isac_spcr |= 0x02;
} <FONT COLOR="#298C52">else</FONT> {
cs-&gt;hw.hfc.ctmt &amp;= ~2;
cs-&gt;hw.hfc.isac_spcr &amp;= ~0x0c;
cs-&gt;hw.hfc.isac_spcr |= 0x08;
}
<FONT COLOR="#298C52">break</FONT>;
}
cs-&gt;BC_Write_Reg(cs, HFC_STATUS, cs-&gt;hw.hfc.ctmt, cs-&gt;hw.hfc.ctmt);
cs-&gt;writeisac(cs, <A HREF="isac.h.shtml#ISAC_SPCR">ISAC_SPCR</A>, cs-&gt;hw.hfc.isac_spcr);
<FONT COLOR="#298C52">if</FONT> (mode)
hfc_clear_fifo(bcs);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
hfc_l2l1(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">int</FONT> pr, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb = arg;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">switch</FONT> (pr) {
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_DATA">PH_DATA</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
save_flags(flags);
cli();
<FONT COLOR="#298C52">if</FONT> (st-&gt;l1.bcs-&gt;hw.hfc.tx_skb) {
skb_queue_tail(&amp;st-&gt;l1.bcs-&gt;squeue, skb);
restore_flags(flags);
} <FONT COLOR="#298C52">else</FONT> {
st-&gt;l1.bcs-&gt;hw.hfc.tx_skb = skb;
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
st-&gt;l1.bcs-&gt;cs-&gt;BC_Send_Data(st-&gt;l1.bcs);
restore_flags(flags);
}
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_PULL">PH_PULL</A> | <A HREF="hisax.h.shtml#INDICATION">INDICATION</A>):
<FONT COLOR="#298C52">if</FONT> (st-&gt;l1.bcs-&gt;hw.hfc.tx_skb) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"hfc_l2l1: this shouldn't happen\n"</FONT>);
<FONT COLOR="#298C52">break</FONT>;
}
save_flags(flags);
cli();
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
st-&gt;l1.bcs-&gt;hw.hfc.tx_skb = skb;
st-&gt;l1.bcs-&gt;cs-&gt;BC_Send_Data(st-&gt;l1.bcs);
restore_flags(flags);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_PULL">PH_PULL</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
<FONT COLOR="#298C52">if</FONT> (!st-&gt;l1.bcs-&gt;hw.hfc.tx_skb) {
test_and_clear_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
st-&gt;l1.l1l2(st, <A HREF="hisax.h.shtml#PH_PULL">PH_PULL</A> | <A HREF="hisax.h.shtml#CONFIRM">CONFIRM</A>, NULL);
} <FONT COLOR="#298C52">else</FONT>
test_and_set_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_ACTIVATE">PH_ACTIVATE</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
mode_hfc(st-&gt;l1.bcs, st-&gt;l1.mode, st-&gt;l1.bc);
st-&gt;l1.l1l2(st, <A HREF="hisax.h.shtml#PH_ACTIVATE">PH_ACTIVATE</A> | <A HREF="hisax.h.shtml#CONFIRM">CONFIRM</A>, NULL);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_DEACTIVATE">PH_DEACTIVATE</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
<FONT COLOR="#298C52">if</FONT> (!test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag))
mode_hfc(st-&gt;l1.bcs, 0, 0);
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR="#298C52">void</FONT>
close_hfcstate(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
mode_hfc(bcs, 0, 0);
<FONT COLOR="#298C52">if</FONT> (test_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
<A HREF="callc.c.shtml#discard_queue">discard_queue</A>(&amp;bcs-&gt;rqueue);
<A HREF="callc.c.shtml#discard_queue">discard_queue</A>(&amp;bcs-&gt;squeue);
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hfc.tx_skb) {
dev_kfree_skb(bcs-&gt;hw.hfc.tx_skb);
bcs-&gt;hw.hfc.tx_skb = NULL;
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
}
}
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">int</FONT>
open_hfcstate(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs,
<FONT COLOR="#298C52">int</FONT> bc)
{
<FONT COLOR="#298C52">struct</FONT> BCState *bcs = cs-&gt;bcs + bc;
<FONT COLOR="#298C52">if</FONT> (!test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
skb_queue_head_init(&amp;bcs-&gt;rqueue);
skb_queue_head_init(&amp;bcs-&gt;squeue);
}
bcs-&gt;hw.hfc.tx_skb = NULL;
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
bcs-&gt;event = 0;
bcs-&gt;tx_cnt = 0;
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">int</FONT>
setstack_hfc(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">if</FONT> (open_hfcstate(st-&gt;l1.hardware, bcs-&gt;channel))
<FONT COLOR="#298C52">return</FONT> (-1);
st-&gt;l1.bcs = bcs;
st-&gt;l2.l2l1 = hfc_l2l1;
<A HREF="lmgr.c.shtml#setstack_manager">setstack_manager</A>(st);
bcs-&gt;st = st;
<FONT COLOR="#298C52">return</FONT> (0);
}
<A HREF="asuscom.c.shtml#__initfunc">__initfunc</A>(<FONT COLOR="#298C52">void</FONT>
init_send(<FONT COLOR="#298C52">struct</FONT> BCState *bcs))
{
<FONT COLOR="#298C52">int</FONT> i;
<FONT COLOR="#298C52">if</FONT> (!(bcs-&gt;hw.hfc.send = kmalloc(32 * <FONT COLOR="#298C52">sizeof</FONT>(<FONT COLOR="#298C52">unsigned</FONT> <FONT COLOR="#298C52">int</FONT>), GFP_ATOMIC))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: No memory for hfc.send\n"</FONT>);
<FONT COLOR="#298C52">return</FONT>;
}
<FONT COLOR="#298C52">for</FONT> (i = 0; i &lt; 32; i++)
bcs-&gt;hw.hfc.send[i] = 0x1fff;
}
<A HREF="asuscom.c.shtml#__initfunc">__initfunc</A>(<FONT COLOR="#298C52">void</FONT>
inithfc(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs))
{
init_send(&amp;cs-&gt;bcs[0]);
init_send(&amp;cs-&gt;bcs[1]);
cs-&gt;BC_Send_Data = &amp;hfc_fill_fifo;
cs-&gt;bcs[0].BC_SetStack = setstack_hfc;
cs-&gt;bcs[1].BC_SetStack = setstack_hfc;
cs-&gt;bcs[0].BC_Close = close_hfcstate;
cs-&gt;bcs[1].BC_Close = close_hfcstate;
mode_hfc(cs-&gt;bcs, 0, 0);
mode_hfc(cs-&gt;bcs + 1, 0, 0);
}
<FONT COLOR="#298C52">void</FONT>
releasehfc(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs)
{
<FONT COLOR="#298C52">if</FONT> (cs-&gt;bcs[0].hw.hfc.send) {
kfree(cs-&gt;bcs[0].hw.hfc.send);
cs-&gt;bcs[0].hw.hfc.send = NULL;
}
<FONT COLOR="#298C52">if</FONT> (cs-&gt;bcs[1].hw.hfc.send) {
kfree(cs-&gt;bcs[1].hw.hfc.send);
cs-&gt;bcs[1].hw.hfc.send = NULL;
}
}
</BODY>
</HTML>

View File

@ -0,0 +1,84 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>hfc_2bs0.h</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>hfc_2bs0.h</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* specific defines for CCD's HFC 2BS0
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
* $Log$
* Revision 1.1 1997/09/11 17:31:34 keil
* Common part for HFC 2BS0 based cards
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFC_CTMT 0xe0
<FONT COLOR=#A521F7>#define</FONT> HFC_CIRM 0xc0
<FONT COLOR=#A521F7>#define</FONT> HFC_CIP 0x80
<FONT COLOR=#A521F7>#define</FONT> HFC_Z1 0x00
<FONT COLOR=#A521F7>#define</FONT> HFC_Z2 0x08
<FONT COLOR=#A521F7>#define</FONT> HFC_Z_LOW 0x00
<FONT COLOR=#A521F7>#define</FONT> HFC_Z_HIGH 0x04
<FONT COLOR=#A521F7>#define</FONT> HFC_F1_INC 0x28
<FONT COLOR=#A521F7>#define</FONT> HFC_FIFO_IN 0x2c
<FONT COLOR=#A521F7>#define</FONT> HFC_F1 0x30
<FONT COLOR=#A521F7>#define</FONT> HFC_F2 0x34
<FONT COLOR=#A521F7>#define</FONT> HFC_F2_INC 0x38
<FONT COLOR=#A521F7>#define</FONT> HFC_FIFO_OUT 0x3c
<FONT COLOR=#A521F7>#define</FONT> HFC_B1 0x00
<FONT COLOR=#A521F7>#define</FONT> HFC_B2 0x02
<FONT COLOR=#A521F7>#define</FONT> HFC_REC 0x01
<FONT COLOR=#A521F7>#define</FONT> HFC_SEND 0x00
<FONT COLOR=#A521F7>#define</FONT> HFC_CHANNEL(ch) (ch ? HFC_B2 : HFC_B1)
<FONT COLOR=#A521F7>#define</FONT> HFC_STATUS 0
<FONT COLOR=#A521F7>#define</FONT> HFC_DATA 1
<FONT COLOR=#A521F7>#define</FONT> HFC_DATA_NODEB 2
<FONT COLOR=#0000FF>/* Status (READ) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFC_BUSY 0x01
<FONT COLOR=#A521F7>#define</FONT> HFC_TIMINT 0x02
<FONT COLOR=#A521F7>#define</FONT> HFC_EXTINT 0x04
<FONT COLOR=#0000FF>/* CTMT (Write) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFC_CLTIMER 0x10
<FONT COLOR=#A521F7>#define</FONT> HFC_TIM50MS 0x08
<FONT COLOR=#A521F7>#define</FONT> HFC_TIMIRQE 0x04
<FONT COLOR=#A521F7>#define</FONT> HFC_TRANSB2 0x02
<FONT COLOR=#A521F7>#define</FONT> HFC_TRANSB1 0x01
<FONT COLOR=#0000FF>/* CIRM (Write) */</FONT>
<FONT COLOR=#A521F7>#define</FONT> HFC_RESET 0x08
<FONT COLOR=#A521F7>#define</FONT> HFC_MEM8K 0x10
<FONT COLOR=#A521F7>#define</FONT> HFC_INTA 0x01
<FONT COLOR=#A521F7>#define</FONT> HFC_INTB 0x02
<FONT COLOR=#A521F7>#define</FONT> HFC_INTC 0x03
<FONT COLOR=#A521F7>#define</FONT> HFC_INTD 0x04
<FONT COLOR=#A521F7>#define</FONT> HFC_INTE 0x05
<FONT COLOR=#A521F7>#define</FONT> HFC_INTF 0x06
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> main_irq_hfc(<FONT COLOR="#298C52">struct</FONT> BCState *bcs);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> inithfc(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> releasehfc(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs);
</BODY>
</HTML>

1004
workshop/hisax/hisax.h.shtml Normal file

File diff suppressed because it is too large Load Diff

BIN
workshop/hisax/hisax.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -0,0 +1,84 @@
Interface for new ISAC/HSCX based cards
u_char ReadISAC(struct IsdnCardState *cs, u_char offset)
Returns the value of a ISAC Register
void WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value)
Write to a ISAC Register
void ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size)
Read size bytes from the ISAC fifo
void WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)
Write size bytes to the ISAC fifo
u_char ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset)
Returns the value of a HSCX Register
void WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)
Write to a HSCX Register
For fast interupt handling, here are some quick inline functions in
"hscx_irq.c". These functions need the following macros for card specific
routines.
#define READHSCXFIFO(cs, nr, ptr, cnt)
#define WRITEHSCXFIFO(cs, nr, ptr, cnt)
void
card_interrupt(int intno, void *dev_id, struct pt_regs *regs)
this function is the main IRQ routine. It should contain tests and calls
for the different IRQ sources (ISAC/HSCX and card specific sources)
int card_msg(struct IsdnCardState *cs, int mt, void *arg)
This function controls various hardware related functions of the
specific card. It have to return 0, if no fatal error occours.
the following values for mt are defined (* optional) :
CARD_RESET - * reset the card
CARD_RELEASE - release all card resources
CARD_SETIRQ - set the irq function
CARD_INIT - init components (eg. ISAC, HSCX) and
should request at least one IRQ
CARD_TEST - * make some HW checks
These values are for LED status monitoring on some cards:
(MDL_REMOVE | REQUEST) - * action if a TEI is removed
(MDL_ASSIGN | REQUEST) - * action if a TEI is assigned
MDL_INFO_SETUP - * action if a incoming call is pending
MDL_INFO_CONN - * action if a connection is activ
MDL_INFO_REL - * action if a connection is released
CARD_AUX_IND - * This are for future extentions
(like a onboard modem)
if options are not implemented, it should return 0
setup_card(struct IsdnCard *card)
This function is called first and has to allocate resources
(IO addresses, memory) for the card and should set these
basic functions of the IsdnCardState structure.
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &card_msg;
cs->readisac = &ReadISAC;
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
if anything goes wrong, the function has to return 0.

327
workshop/hisax/hscx.c.shtml Normal file
View File

@ -0,0 +1,327 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>hscx.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>hscx.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* hscx.c HSCX specific routines
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
* $Log$
* Revision 1.11 1998/05/25 14:10:07 keil
* HiSax 3.0
* X.75 and leased are working again.
*
* Revision 1.10 1998/05/25 12:57:59 keil
* HiSax golden code from certification, Don't use !!!
* No leased lines, no X75, but many changes.
*
* Revision 1.9 1998/04/15 16:45:33 keil
* new init code
*
* Revision 1.8 1998/03/19 13:16:24 keil
* fix the correct release of the hscx
*
* Revision 1.7 1998/02/12 23:07:36 keil
* change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb()
*
* Revision 1.6 1998/02/02 13:41:12 keil
* new init
*
* Revision 1.5 1997/11/06 17:09:34 keil
* New 2.1 init code
*
* Revision 1.4 1997/10/29 19:01:06 keil
* changes for 2.1
*
* Revision 1.3 1997/07/27 21:38:34 keil
* new B-channel interface
*
* Revision 1.2 1997/06/26 11:16:17 keil
* first version
*
*
*/</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A HREF="asuscom.c.shtml#__NO_VERSION__">__NO_VERSION__</A>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hisax.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"hscx.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isac.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> <FONT COLOR="#FF0000">"isdnl1.h"</FONT>
<FONT COLOR=#A521F7>#include</FONT> &lt;linux/interrupt.h&gt;
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">char</FONT> *HSCXVer[] <A HREF="hisax.h.shtml#HISAX_INITDATA">HISAX_INITDATA</A> =
{<FONT COLOR="#FF0000">"A1"</FONT>, <FONT COLOR="#FF0000">"?1"</FONT>, <FONT COLOR="#FF0000">"A2"</FONT>, <FONT COLOR="#FF0000">"?3"</FONT>, <FONT COLOR="#FF0000">"A3"</FONT>, <FONT COLOR="#FF0000">"V2.1"</FONT>, <FONT COLOR="#FF0000">"?6"</FONT>, <FONT COLOR="#FF0000">"?7"</FONT>,
<FONT COLOR="#FF0000">"?8"</FONT>, <FONT COLOR="#FF0000">"?9"</FONT>, <FONT COLOR="#FF0000">"?10"</FONT>, <FONT COLOR="#FF0000">"?11"</FONT>, <FONT COLOR="#FF0000">"?12"</FONT>, <FONT COLOR="#FF0000">"?13"</FONT>, <FONT COLOR="#FF0000">"?14"</FONT>, <FONT COLOR="#FF0000">"???"</FONT>};
<A HREF="callc.c.shtml#HISAX_INITFUNC">HISAX_INITFUNC</A>(<FONT COLOR="#298C52">int</FONT>
HscxVersion(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">char</FONT> *s))
{
<FONT COLOR="#298C52">int</FONT> verA, verB;
verA = cs-&gt;BC_Read_Reg(cs, 0, <A HREF="hscx.h.shtml#HSCX_VSTR">HSCX_VSTR</A>) &amp; 0xf;
verB = cs-&gt;BC_Read_Reg(cs, 1, <A HREF="hscx.h.shtml#HSCX_VSTR">HSCX_VSTR</A>) &amp; 0xf;
printk(KERN_INFO <FONT COLOR="#FF0000">"%s HSCX version A: %s B: %s\n"</FONT>, s,
HSCXVer[verA], HSCXVer[verB]);
<FONT COLOR="#298C52">if</FONT> ((verA == 0) | (verA == 0xf) | (verB == 0) | (verB == 0xf))
<FONT COLOR="#298C52">return</FONT> (1);
<FONT COLOR="#298C52">else</FONT>
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="modehscx">modehscx</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> mode, <FONT COLOR="#298C52">int</FONT> bc)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">int</FONT> hscx = bcs-&gt;channel;
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[40];
sprintf(tmp, <FONT COLOR="#FF0000">"hscx %c mode %d ichan %d"</FONT>,
<FONT COLOR="#FF0000">'A'</FONT> + hscx, mode, bc);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
bcs-&gt;mode = mode;
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_CCR1">HSCX_CCR1</A>,
test_bit(<A HREF="hisax.h.shtml#HW_IPAC">HW_IPAC</A>, &amp;cs-&gt;HW_Flags) ? 0x82 : 0x85);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_XAD1">HSCX_XAD1</A>, 0xFF);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_XAD2">HSCX_XAD2</A>, 0xFF);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_RAH2">HSCX_RAH2</A>, 0xFF);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_XBCH">HSCX_XBCH</A>, 0x0);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_RLCR">HSCX_RLCR</A>, 0x0);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_CCR2">HSCX_CCR2</A>, 0x30);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_XCCR">HSCX_XCCR</A>, 7);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_RCCR">HSCX_RCCR</A>, 7);
<FONT COLOR=#0000FF>/* Switch IOM 1 SSI */</FONT>
<FONT COLOR="#298C52">if</FONT> (test_bit(<A HREF="hisax.h.shtml#HW_IOM1">HW_IOM1</A>, &amp;cs-&gt;HW_Flags) &amp;&amp; (hscx == 0))
bc = 1 - bc;
<FONT COLOR="#298C52">if</FONT> (bc == 0) {
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_TSAX">HSCX_TSAX</A>,
test_bit(<A HREF="hisax.h.shtml#HW_IOM1">HW_IOM1</A>, &amp;cs-&gt;HW_Flags) ? 0x7 : 0x2f);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_TSAR">HSCX_TSAR</A>,
test_bit(<A HREF="hisax.h.shtml#HW_IOM1">HW_IOM1</A>, &amp;cs-&gt;HW_Flags) ? 0x7 : 0x2f);
} <FONT COLOR="#298C52">else</FONT> {
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_TSAX">HSCX_TSAX</A>, 0x3);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_TSAR">HSCX_TSAR</A>, 0x3);
}
<FONT COLOR="#298C52">switch</FONT> (mode) {
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#L1_MODE_NULL">L1_MODE_NULL</A>):
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_TSAX">HSCX_TSAX</A>, 0xff);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_TSAR">HSCX_TSAR</A>, 0xff);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_MODE">HSCX_MODE</A>, 0x84);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>):
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_MODE">HSCX_MODE</A>, 0xe4);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#L1_MODE_HDLC">L1_MODE_HDLC</A>):
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_MODE">HSCX_MODE</A>, 0x8c);
<FONT COLOR="#298C52">break</FONT>;
}
<FONT COLOR="#298C52">if</FONT> (mode)
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_CMDR">HSCX_CMDR</A>, 0x41);
cs-&gt;BC_Write_Reg(cs, hscx, <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A>, 0x00);
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="hscx_sched_event">hscx_sched_event</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> event)
{
bcs-&gt;event |= 1 &lt;&lt; event;
queue_task(&amp;bcs-&gt;tqueue, &amp;tq_immediate);
mark_bh(IMMEDIATE_BH);
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="hscx_l2l1">hscx_l2l1</A>(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">int</FONT> pr, <FONT COLOR="#298C52">void</FONT> *arg)
{
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb = arg;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">switch</FONT> (pr) {
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_DATA">PH_DATA</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
save_flags(flags);
cli();
<FONT COLOR="#298C52">if</FONT> (st-&gt;l1.bcs-&gt;hw.hscx.tx_skb) {
skb_queue_tail(&amp;st-&gt;l1.bcs-&gt;squeue, skb);
restore_flags(flags);
} <FONT COLOR="#298C52">else</FONT> {
st-&gt;l1.bcs-&gt;hw.hscx.tx_skb = skb;
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
st-&gt;l1.bcs-&gt;hw.hscx.count = 0;
restore_flags(flags);
st-&gt;l1.bcs-&gt;cs-&gt;BC_Send_Data(st-&gt;l1.bcs);
}
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_PULL">PH_PULL</A> | <A HREF="hisax.h.shtml#INDICATION">INDICATION</A>):
<FONT COLOR="#298C52">if</FONT> (st-&gt;l1.bcs-&gt;hw.hscx.tx_skb) {
printk(KERN_WARNING <FONT COLOR="#FF0000">"hscx_l2l1: this shouldn't happen\n"</FONT>);
<FONT COLOR="#298C52">break</FONT>;
}
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
st-&gt;l1.bcs-&gt;hw.hscx.tx_skb = skb;
st-&gt;l1.bcs-&gt;hw.hscx.count = 0;
st-&gt;l1.bcs-&gt;cs-&gt;BC_Send_Data(st-&gt;l1.bcs);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_PULL">PH_PULL</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
<FONT COLOR="#298C52">if</FONT> (!st-&gt;l1.bcs-&gt;hw.hscx.tx_skb) {
test_and_clear_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
st-&gt;l1.l1l2(st, <A HREF="hisax.h.shtml#PH_PULL">PH_PULL</A> | <A HREF="hisax.h.shtml#CONFIRM">CONFIRM</A>, NULL);
} <FONT COLOR="#298C52">else</FONT>
test_and_set_bit(<A HREF="hisax.h.shtml#FLG_L1_PULL_REQ">FLG_L1_PULL_REQ</A>, &amp;st-&gt;l1.Flags);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_ACTIVATE">PH_ACTIVATE</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
<A HREF="#modehscx">modehscx</A>(st-&gt;l1.bcs, st-&gt;l1.mode, st-&gt;l1.bc);
<A HREF="isdnl1.c.shtml#l1_msg_b">l1_msg_b</A>(st, pr, arg);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_DEACTIVATE">PH_DEACTIVATE</A> | <A HREF="hisax.h.shtml#REQUEST">REQUEST</A>):
<A HREF="isdnl1.c.shtml#l1_msg_b">l1_msg_b</A>(st, pr, arg);
<FONT COLOR="#298C52">break</FONT>;
<FONT COLOR="#298C52">case</FONT> (<A HREF="hisax.h.shtml#PH_DEACTIVATE">PH_DEACTIVATE</A> | <A HREF="hisax.h.shtml#CONFIRM">CONFIRM</A>):
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_ACTIV">BC_FLG_ACTIV</A>, &amp;st-&gt;l1.bcs-&gt;Flag);
<FONT COLOR="#298C52">if</FONT> (!test_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;st-&gt;l1.bcs-&gt;Flag)) {
<A HREF="#modehscx">modehscx</A>(st-&gt;l1.bcs, 0, st-&gt;l1.bc);
st-&gt;l1.l1l2(st, <A HREF="hisax.h.shtml#PH_DEACTIVATE">PH_DEACTIVATE</A> | <A HREF="hisax.h.shtml#CONFIRM">CONFIRM</A>, NULL);
}
<FONT COLOR="#298C52">break</FONT>;
}
}
<FONT COLOR="#298C52">void</FONT>
<A NAME="close_hscxstate">close_hscxstate</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<A HREF="#modehscx">modehscx</A>(bcs, 0, 0);
<FONT COLOR="#298C52">if</FONT> (test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.rcvbuf) {
kfree(bcs-&gt;hw.hscx.rcvbuf);
bcs-&gt;hw.hscx.rcvbuf = NULL;
}
<A HREF="callc.c.shtml#discard_queue">discard_queue</A>(&amp;bcs-&gt;rqueue);
<A HREF="callc.c.shtml#discard_queue">discard_queue</A>(&amp;bcs-&gt;squeue);
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb) {
dev_kfree_skb(bcs-&gt;hw.hscx.tx_skb);
bcs-&gt;hw.hscx.tx_skb = NULL;
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
}
}
}
<FONT COLOR="#298C52">int</FONT>
<A NAME="open_hscxstate">open_hscxstate</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs,
<FONT COLOR="#298C52">int</FONT> bc)
{
<FONT COLOR="#298C52">struct</FONT> BCState *bcs = cs-&gt;bcs + bc;
<FONT COLOR="#298C52">if</FONT> (!test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag)) {
<FONT COLOR="#298C52">if</FONT> (!(bcs-&gt;hw.hscx.rcvbuf = kmalloc(<A HREF="hisax.h.shtml#HSCX_BUFMAX">HSCX_BUFMAX</A>, GFP_ATOMIC))) {
printk(KERN_WARNING
<FONT COLOR="#FF0000">"HiSax: No memory for hscx.rcvbuf\n"</FONT>);
<FONT COLOR="#298C52">return</FONT> (1);
}
skb_queue_head_init(&amp;bcs-&gt;rqueue);
skb_queue_head_init(&amp;bcs-&gt;squeue);
}
bcs-&gt;hw.hscx.tx_skb = NULL;
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
bcs-&gt;event = 0;
bcs-&gt;hw.hscx.rcvidx = 0;
bcs-&gt;tx_cnt = 0;
<FONT COLOR="#298C52">return</FONT> (0);
}
<FONT COLOR="#298C52">int</FONT>
<A HREF="#setstack_hscx">setstack_hscx</A>(<FONT COLOR="#298C52">struct</FONT> PStack *st, <FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">if</FONT> (<A HREF="#open_hscxstate">open_hscxstate</A>(st-&gt;l1.hardware, bcs-&gt;channel))
<FONT COLOR="#298C52">return</FONT> (-1);
st-&gt;l1.bcs = bcs;
st-&gt;l2.l2l1 = <A HREF="#hscx_l2l1">hscx_l2l1</A>;
<A HREF="lmgr.c.shtml#setstack_manager">setstack_manager</A>(st);
bcs-&gt;st = st;
<A HREF="isdnl1.c.shtml#setstack_l1_B">setstack_l1_B</A>(st);
<FONT COLOR="#298C52">return</FONT> (0);
}
<A HREF="callc.c.shtml#HISAX_INITFUNC">HISAX_INITFUNC</A>(<FONT COLOR="#298C52">void</FONT>
clear_pending_hscx_ints(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs))
{
<FONT COLOR="#298C52">int</FONT> val, eval;
<FONT COLOR="#298C52">char</FONT> tmp[64];
val = cs-&gt;BC_Read_Reg(cs, 1, <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A>);
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX B ISTA %x"</FONT>, val);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x01) {
eval = cs-&gt;BC_Read_Reg(cs, 1, <A HREF="hscx.h.shtml#HSCX_EXIR">HSCX_EXIR</A>);
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX B EXIR %x"</FONT>, eval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x02) {
eval = cs-&gt;BC_Read_Reg(cs, 0, <A HREF="hscx.h.shtml#HSCX_EXIR">HSCX_EXIR</A>);
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX A EXIR %x"</FONT>, eval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
val = cs-&gt;BC_Read_Reg(cs, 0, <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A>);
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX A ISTA %x"</FONT>, val);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
val = cs-&gt;BC_Read_Reg(cs, 1, <A HREF="hscx.h.shtml#HSCX_STAR">HSCX_STAR</A>);
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX B STAR %x"</FONT>, val);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
val = cs-&gt;BC_Read_Reg(cs, 0, <A HREF="hscx.h.shtml#HSCX_STAR">HSCX_STAR</A>);
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX A STAR %x"</FONT>, val);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
<FONT COLOR=#0000FF>/* disable all IRQ */</FONT>
cs-&gt;BC_Write_Reg(cs, 0, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0xFF);
cs-&gt;BC_Write_Reg(cs, 1, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0xFF);
}
<A HREF="callc.c.shtml#HISAX_INITFUNC">HISAX_INITFUNC</A>(<FONT COLOR="#298C52">void</FONT>
inithscx(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs))
{
cs-&gt;bcs[0].BC_SetStack = <A HREF="#setstack_hscx">setstack_hscx</A>;
cs-&gt;bcs[1].BC_SetStack = <A HREF="#setstack_hscx">setstack_hscx</A>;
cs-&gt;bcs[0].BC_Close = <A HREF="#close_hscxstate">close_hscxstate</A>;
cs-&gt;bcs[1].BC_Close = <A HREF="#close_hscxstate">close_hscxstate</A>;
<A HREF="#modehscx">modehscx</A>(cs-&gt;bcs, 0, 0);
<A HREF="#modehscx">modehscx</A>(cs-&gt;bcs + 1, 0, 0);
}
<A HREF="callc.c.shtml#HISAX_INITFUNC">HISAX_INITFUNC</A>(<FONT COLOR="#298C52">void</FONT>
inithscxisac(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> part))
{
<FONT COLOR="#298C52">if</FONT> (part &amp; 1) {
clear_pending_isac_ints(cs);
clear_pending_hscx_ints(cs);
initisac(cs);
inithscx(cs);
}
<FONT COLOR="#298C52">if</FONT> (part &amp; 2) {
<FONT COLOR=#0000FF>/* Reenable all IRQ */</FONT>
cs-&gt;writeisac(cs, <A HREF="isac.h.shtml#ISAC_MASK">ISAC_MASK</A>, 0);
cs-&gt;BC_Write_Reg(cs, 0, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0);
cs-&gt;BC_Write_Reg(cs, 1, <A HREF="hscx.h.shtml#HSCX_MASK">HSCX_MASK</A>, 0);
<FONT COLOR=#0000FF>/* RESET Receiver and Transmitter */</FONT>
cs-&gt;writeisac(cs, <A HREF="isac.h.shtml#ISAC_CMDR">ISAC_CMDR</A>, 0x41);
}
}
</BODY>
</HTML>

View File

@ -0,0 +1,72 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>hscx.h</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>hscx.h</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* hscx.h HSCX specific defines
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
* $Log$
* Revision 1.4 1998/04/15 16:45:34 keil
* new init code
*
* Revision 1.3 1997/07/27 21:38:35 keil
* new B-channel interface
*
* Revision 1.2 1997/06/26 11:16:18 keil
* first version
*
*
*/</FONT>
<FONT COLOR=#0000FF>/* All Registers original Siemens Spec */</FONT>
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_ISTA">HSCX_ISTA</A> 0x20
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_CCR1">HSCX_CCR1</A> 0x2f
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_CCR2">HSCX_CCR2</A> 0x2c
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_TSAR">HSCX_TSAR</A> 0x31
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_TSAX">HSCX_TSAX</A> 0x30
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_XCCR">HSCX_XCCR</A> 0x32
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_RCCR">HSCX_RCCR</A> 0x33
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_MODE">HSCX_MODE</A> 0x22
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_CMDR">HSCX_CMDR</A> 0x21
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_EXIR">HSCX_EXIR</A> 0x24
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_XAD1">HSCX_XAD1</A> 0x24
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_XAD2">HSCX_XAD2</A> 0x25
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_RAH2">HSCX_RAH2</A> 0x27
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_RSTA">HSCX_RSTA</A> 0x27
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_TIMR">HSCX_TIMR</A> 0x23
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_STAR">HSCX_STAR</A> 0x21
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_RBCL">HSCX_RBCL</A> 0x25
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_XBCH">HSCX_XBCH</A> 0x2d
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_VSTR">HSCX_VSTR</A> 0x2e
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_RLCR">HSCX_RLCR</A> 0x2e
<FONT COLOR=#A521F7>#define</FONT> <A NAME="HSCX_MASK">HSCX_MASK</A> 0x20
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">int</FONT> HscxVersion(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">char</FONT> *s);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> <A HREF="hscx.c.shtml#hscx_sched_event">hscx_sched_event</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> event);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> <A HREF="hscx.c.shtml#modehscx">modehscx</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> mode, <FONT COLOR="#298C52">int</FONT> bc);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> clear_pending_hscx_ints(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> inithscx(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs);
<FONT COLOR="#298C52">extern</FONT> <FONT COLOR="#298C52">void</FONT> inithscxisac(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> part);
</BODY>
</HTML>

View File

@ -0,0 +1,346 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>hscx_irq.c</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>hscx_irq.c</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* hscx_irq.c low level b-channel stuff for Siemens HSCX
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
* This is an include file for fast inline IRQ stuff
*
* $Log$
* Revision 1.8 1998/04/10 10:35:22 paul
* fixed (silly?) warnings from egcs on Alpha.
*
* Revision 1.7 1998/02/12 23:07:37 keil
* change for 2.1.86 (removing FREE_READ/FREE_WRITE from [dev]_kfree_skb()
*
* Revision 1.6 1997/10/29 19:01:07 keil
* changes for 2.1
*
* Revision 1.5 1997/10/01 09:21:35 fritz
* Removed old compatibility stuff for 2.0.X kernels.
* From now on, this code is for 2.1.X ONLY!
* Old stuff is still in the separate branch.
*
* Revision 1.4 1997/08/15 17:48:02 keil
* cosmetic
*
* Revision 1.3 1997/07/27 21:38:36 keil
* new B-channel interface
*
* Revision 1.2 1997/06/26 11:16:19 keil
* first version
*
*
*/</FONT>
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A NAME="waitforCEC">waitforCEC</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx)
{
<FONT COLOR="#298C52">int</FONT> to = 50;
<FONT COLOR="#298C52">while</FONT> ((<A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, hscx, <A HREF="hscx.h.shtml#HSCX_STAR">HSCX_STAR</A>) &amp; 0x04) &amp;&amp; to) {
udelay(1);
to--;
}
<FONT COLOR="#298C52">if</FONT> (!to)
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: waitforCEC timeout\n"</FONT>);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A NAME="waitforXFW">waitforXFW</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx)
{
<FONT COLOR="#298C52">int</FONT> to = 50;
<FONT COLOR="#298C52">while</FONT> ((!(<A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, hscx, <A HREF="hscx.h.shtml#HSCX_STAR">HSCX_STAR</A>) &amp; 0x44) == 0x40) &amp;&amp; to) {
udelay(1);
to--;
}
<FONT COLOR="#298C52">if</FONT> (!to)
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: waitforXFW timeout\n"</FONT>);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#WriteHSCXCMDR">WriteHSCXCMDR</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, <FONT COLOR="#298C52">int</FONT> hscx, u_char data)
{
<FONT COLOR="#298C52">long</FONT> flags;
save_flags(flags);
cli();
<A HREF="#waitforCEC">waitforCEC</A>(cs, hscx);
<A HREF="asuscom.c.shtml#WRITEHSCX">WRITEHSCX</A>(cs, hscx, <A HREF="hscx.h.shtml#HSCX_CMDR">HSCX_CMDR</A>, data);
restore_flags(flags);
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A NAME="hscx_empty_fifo">hscx_empty_fifo</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs, <FONT COLOR="#298C52">int</FONT> count)
{
u_char *ptr;
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) &amp;&amp; !(cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>))
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hscx_empty_fifo"</FONT>);
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.rcvidx + count &gt; <A HREF="hisax.h.shtml#HSCX_BUFMAX">HSCX_BUFMAX</A>) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hscx_empty_fifo: incoming packet too large"</FONT>);
<A HREF="#WriteHSCXCMDR">WriteHSCXCMDR</A>(cs, bcs-&gt;channel, 0x80);
bcs-&gt;hw.hscx.rcvidx = 0;
<FONT COLOR="#298C52">return</FONT>;
}
ptr = bcs-&gt;hw.hscx.rcvbuf + bcs-&gt;hw.hscx.rcvidx;
bcs-&gt;hw.hscx.rcvidx += count;
save_flags(flags);
cli();
<A HREF="asuscom.c.shtml#READHSCXFIFO">READHSCXFIFO</A>(cs, bcs-&gt;channel, ptr, count);
<A HREF="#WriteHSCXCMDR">WriteHSCXCMDR</A>(cs, bcs-&gt;channel, 0x80);
restore_flags(flags);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[256];
<FONT COLOR="#298C52">char</FONT> *t = tmp;
t += sprintf(t, <FONT COLOR="#FF0000">"hscx_empty_fifo %c cnt %d"</FONT>,
bcs-&gt;channel ? <FONT COLOR="#FF0000">'B'</FONT> : <FONT COLOR="#FF0000">'A'</FONT>, count);
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(t, ptr, count);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">void</FONT>
<A NAME="hscx_fill_fifo">hscx_fill_fifo</A>(<FONT COLOR="#298C52">struct</FONT> BCState *bcs)
{
<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs = bcs-&gt;cs;
<FONT COLOR="#298C52">int</FONT> more, count;
<FONT COLOR="#298C52">int</FONT> fifo_size = test_bit(<A HREF="hisax.h.shtml#HW_IPAC">HW_IPAC</A>, &amp;cs-&gt;HW_Flags)? 64: 32;
u_char *ptr;
<FONT COLOR="#298C52">long</FONT> flags;
<FONT COLOR="#298C52">if</FONT> ((cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) &amp;&amp; !(cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>))
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"hscx_fill_fifo"</FONT>);
<FONT COLOR="#298C52">if</FONT> (!bcs-&gt;hw.hscx.tx_skb)
<FONT COLOR="#298C52">return</FONT>;
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb-&gt;len &lt;= 0)
<FONT COLOR="#298C52">return</FONT>;
more = (bcs-&gt;mode == <A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>) ? 1 : 0;
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb-&gt;len &gt; fifo_size) {
more = !0;
count = fifo_size;
} <FONT COLOR="#298C52">else</FONT>
count = bcs-&gt;hw.hscx.tx_skb-&gt;len;
<A HREF="#waitforXFW">waitforXFW</A>(cs, bcs-&gt;channel);
save_flags(flags);
cli();
ptr = bcs-&gt;hw.hscx.tx_skb-&gt;data;
skb_pull(bcs-&gt;hw.hscx.tx_skb, count);
bcs-&gt;tx_cnt -= count;
bcs-&gt;hw.hscx.count += count;
<A HREF="asuscom.c.shtml#WRITEHSCXFIFO">WRITEHSCXFIFO</A>(cs, bcs-&gt;channel, ptr, count);
<A HREF="#WriteHSCXCMDR">WriteHSCXCMDR</A>(cs, bcs-&gt;channel, more ? 0x8 : 0xa);
restore_flags(flags);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>) {
<FONT COLOR="#298C52">char</FONT> tmp[256];
<FONT COLOR="#298C52">char</FONT> *t = tmp;
t += sprintf(t, <FONT COLOR="#FF0000">"hscx_fill_fifo %c cnt %d"</FONT>,
bcs-&gt;channel ? <FONT COLOR="#FF0000">'B'</FONT> : <FONT COLOR="#FF0000">'A'</FONT>, count);
<A HREF="q931.c.shtml#QuickHex">QuickHex</A>(t, ptr, count);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#hscx_interrupt">hscx_interrupt</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char val, u_char hscx)
{
u_char r;
<FONT COLOR="#298C52">struct</FONT> BCState *bcs = cs-&gt;bcs + hscx;
<FONT COLOR="#298C52">struct</FONT> sk_buff *skb;
<FONT COLOR="#298C52">int</FONT> fifo_size = test_bit(<A HREF="hisax.h.shtml#HW_IPAC">HW_IPAC</A>, &amp;cs-&gt;HW_Flags)? 64: 32;
<FONT COLOR="#298C52">int</FONT> count;
<FONT COLOR="#298C52">char</FONT> tmp[32];
<FONT COLOR="#298C52">if</FONT> (!test_bit(<A HREF="hisax.h.shtml#BC_FLG_INIT">BC_FLG_INIT</A>, &amp;bcs-&gt;Flag))
<FONT COLOR="#298C52">return</FONT>;
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x80) { <FONT COLOR=#0000FF>/* RME */</FONT>
r = <A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, hscx, <A HREF="hscx.h.shtml#HSCX_RSTA">HSCX_RSTA</A>);
<FONT COLOR="#298C52">if</FONT> ((r &amp; 0xf0) != 0xa0) {
<FONT COLOR="#298C52">if</FONT> (!(r &amp; 0x80))
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"HSCX invalid frame"</FONT>);
<FONT COLOR="#298C52">if</FONT> ((r &amp; 0x40) &amp;&amp; bcs-&gt;mode)
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX RDO mode=%d"</FONT>,
bcs-&gt;mode);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (!(r &amp; 0x20))
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>)
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, <FONT COLOR="#FF0000">"HSCX CRC error"</FONT>);
<A HREF="#WriteHSCXCMDR">WriteHSCXCMDR</A>(cs, hscx, 0x80);
} <FONT COLOR="#298C52">else</FONT> {
count = <A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, hscx, <A HREF="hscx.h.shtml#HSCX_RBCL">HSCX_RBCL</A>) &amp; (
test_bit(<A HREF="hisax.h.shtml#HW_IPAC">HW_IPAC</A>, &amp;cs-&gt;HW_Flags)? 0x3f: 0x1f);
<FONT COLOR="#298C52">if</FONT> (count == 0)
count = fifo_size;
<A HREF="#hscx_empty_fifo">hscx_empty_fifo</A>(bcs, count);
<FONT COLOR="#298C52">if</FONT> ((count = bcs-&gt;hw.hscx.rcvidx - 1) &gt; 0) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX_FIFO">L1_DEB_HSCX_FIFO</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HX Frame %d"</FONT>, count);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<FONT COLOR="#298C52">if</FONT> (!(skb = dev_alloc_skb(count)))
printk(KERN_WARNING <FONT COLOR="#FF0000">"HSCX: receive out of memory\n"</FONT>);
<FONT COLOR="#298C52">else</FONT> {
memcpy(skb_put(skb, count), bcs-&gt;hw.hscx.rcvbuf, count);
skb_queue_tail(&amp;bcs-&gt;rqueue, skb);
}
}
}
bcs-&gt;hw.hscx.rcvidx = 0;
<A HREF="hscx.c.shtml#hscx_sched_event">hscx_sched_event</A>(bcs, <A HREF="isdnl1.h.shtml#B_RCVBUFREADY">B_RCVBUFREADY</A>);
}
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x40) { <FONT COLOR=#0000FF>/* RPF */</FONT>
<A HREF="#hscx_empty_fifo">hscx_empty_fifo</A>(bcs, fifo_size);
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode == <A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>) {
<FONT COLOR=#0000FF>/* receive audio data */</FONT>
<FONT COLOR="#298C52">if</FONT> (!(skb = dev_alloc_skb(fifo_size)))
printk(KERN_WARNING <FONT COLOR="#FF0000">"HiSax: receive out of memory\n"</FONT>);
<FONT COLOR="#298C52">else</FONT> {
memcpy(skb_put(skb, fifo_size), bcs-&gt;hw.hscx.rcvbuf, fifo_size);
skb_queue_tail(&amp;bcs-&gt;rqueue, skb);
}
bcs-&gt;hw.hscx.rcvidx = 0;
<A HREF="hscx.c.shtml#hscx_sched_event">hscx_sched_event</A>(bcs, <A HREF="isdnl1.h.shtml#B_RCVBUFREADY">B_RCVBUFREADY</A>);
}
}
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x10) { <FONT COLOR=#0000FF>/* XPR */</FONT>
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb-&gt;len) {
<A HREF="#hscx_fill_fifo">hscx_fill_fifo</A>(bcs);
<FONT COLOR="#298C52">return</FONT>;
} <FONT COLOR="#298C52">else</FONT> {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;st-&gt;lli.l1writewakeup &amp;&amp;
(<A HREF="hisax.h.shtml#PACKET_NOACK">PACKET_NOACK</A> != bcs-&gt;hw.hscx.tx_skb-&gt;pkt_type))
bcs-&gt;st-&gt;lli.l1writewakeup(bcs-&gt;st, bcs-&gt;hw.hscx.count);
dev_kfree_skb(bcs-&gt;hw.hscx.tx_skb);
bcs-&gt;hw.hscx.count = 0;
bcs-&gt;hw.hscx.tx_skb = NULL;
}
}
<FONT COLOR="#298C52">if</FONT> ((bcs-&gt;hw.hscx.tx_skb = skb_dequeue(&amp;bcs-&gt;squeue))) {
bcs-&gt;hw.hscx.count = 0;
test_and_set_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
<A HREF="#hscx_fill_fifo">hscx_fill_fifo</A>(bcs);
} <FONT COLOR="#298C52">else</FONT> {
test_and_clear_bit(<A HREF="hisax.h.shtml#BC_FLG_BUSY">BC_FLG_BUSY</A>, &amp;bcs-&gt;Flag);
<A HREF="hscx.c.shtml#hscx_sched_event">hscx_sched_event</A>(bcs, <A HREF="isdnl1.h.shtml#B_XMTBUFREADY">B_XMTBUFREADY</A>);
}
}
}
<FONT COLOR="#298C52">static</FONT> <FONT COLOR="#298C52">inline</FONT> <FONT COLOR="#298C52">void</FONT>
<A HREF="#hscx_int_main">hscx_int_main</A>(<FONT COLOR="#298C52">struct</FONT> IsdnCardState *cs, u_char val)
{
u_char exval;
<FONT COLOR="#298C52">struct</FONT> BCState *bcs;
<FONT COLOR="#298C52">char</FONT> tmp[32];
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x01) {
bcs = cs-&gt;bcs + 1;
exval = <A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, 1, <A HREF="hscx.h.shtml#HSCX_EXIR">HSCX_EXIR</A>);
<FONT COLOR="#298C52">if</FONT> (exval == 0x40) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode == 1)
<A HREF="#hscx_fill_fifo">hscx_fill_fifo</A>(bcs);
<FONT COLOR="#298C52">else</FONT> {
<FONT COLOR=#0000FF>/* Here we lost an TX interrupt, so
* restart transmitting the whole frame.
*/</FONT>
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb) {
skb_push(bcs-&gt;hw.hscx.tx_skb, bcs-&gt;hw.hscx.count);
bcs-&gt;tx_cnt += bcs-&gt;hw.hscx.count;
bcs-&gt;hw.hscx.count = 0;
}
<A HREF="#WriteHSCXCMDR">WriteHSCXCMDR</A>(cs, bcs-&gt;channel, 0x01);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX B EXIR %x Lost TX"</FONT>, exval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
}
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX B EXIR %x"</FONT>, exval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
}
<FONT COLOR="#298C52">if</FONT> (val &amp; 0xf8) {
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX B interrupt %x"</FONT>, val);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<A HREF="#hscx_interrupt">hscx_interrupt</A>(cs, val, 1);
}
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x02) {
bcs = cs-&gt;bcs;
exval = <A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, 0, <A HREF="hscx.h.shtml#HSCX_EXIR">HSCX_EXIR</A>);
<FONT COLOR="#298C52">if</FONT> (exval == 0x40) {
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;mode == <A HREF="hisax.h.shtml#L1_MODE_TRANS">L1_MODE_TRANS</A>)
<A HREF="#hscx_fill_fifo">hscx_fill_fifo</A>(bcs);
<FONT COLOR="#298C52">else</FONT> {
<FONT COLOR=#0000FF>/* Here we lost an TX interrupt, so
* restart transmitting the whole frame.
*/</FONT>
<FONT COLOR="#298C52">if</FONT> (bcs-&gt;hw.hscx.tx_skb) {
skb_push(bcs-&gt;hw.hscx.tx_skb, bcs-&gt;hw.hscx.count);
bcs-&gt;tx_cnt += bcs-&gt;hw.hscx.count;
bcs-&gt;hw.hscx.count = 0;
}
<A HREF="#WriteHSCXCMDR">WriteHSCXCMDR</A>(cs, bcs-&gt;channel, 0x01);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_WARN">L1_DEB_WARN</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX A EXIR %x Lost TX"</FONT>, exval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
}
} <FONT COLOR="#298C52">else</FONT> <FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX A EXIR %x"</FONT>, exval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
}
<FONT COLOR="#298C52">if</FONT> (val &amp; 0x04) {
exval = <A HREF="asuscom.c.shtml#READHSCX">READHSCX</A>(cs, 0, <A HREF="hscx.h.shtml#HSCX_ISTA">HSCX_ISTA</A>);
<FONT COLOR="#298C52">if</FONT> (cs-&gt;debug &amp; <A HREF="isdnl1.h.shtml#L1_DEB_HSCX">L1_DEB_HSCX</A>) {
sprintf(tmp, <FONT COLOR="#FF0000">"HSCX A interrupt %x"</FONT>, exval);
<A HREF="isdnl1.c.shtml#debugl1">debugl1</A>(cs, tmp);
}
<A HREF="#hscx_interrupt">hscx_interrupt</A>(cs, exval, 0);
}
}
</BODY>
</HTML>

View File

@ -0,0 +1,43 @@
<HTML>
<HEAD>
<TITLE>Hisax</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN="CENTER"><A HREF="files.shtml">Dateiliste</A></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_up.shtml" --></TD>
</TR>
</TABLE>
<CENTER>
<MAP NAME="hisax">
<AREA SHAPE="rect" HREF="../linklevel/" COORDS="5,70,486,126">
<AREA SHAPE="rect" HREF="hisax.h.shtml" COORDS="4,197,486,254">
<AREA SHAPE="rect" HREF="callc.c.shtml" COORDS="49,255,486,339">
<AREA SHAPE="rect" HREF="l3_1tr6.c.shtml" COORDS="89,340,217,424">
<AREA SHAPE="rect" HREF="l3dss1.c.shtml" COORDS="218,341,344,422">
<AREA SHAPE="rect" HREF="lmgr.c.shtml" COORDS="20,341,87,614">
<AREA SHAPE="rect" HREF="isdnl2.c.shtml" COORDS="90,425,484,508">
<AREA SHAPE="rect" HREF="isdnl1.c.shtml" COORDS="91,511,485,586">
<AREA SHAPE="rect" HREF="hscx.c.shtml" COORDS="91,589,218,657">
<AREA SHAPE="rect" HREF="isac.c.shtml" COORDS="220,590,357,657">
<AREA SHAPE="rect" HREF="asuscom.c.shtml" COORDS="359,591,485,656">
</MAP>
<TABLE><TR VALIGN="TOP"><TD>
<TABLE CELLPADDING="5"><TR>
<TD BGCOLOR="#C0C0FF" ALIGN="CENTER">
<A HREF="interface.shtml">
<STRONG>Neue Karte<BR>
zuf&uuml;gen</STRONG>
</A>
</TD></TR></TABLE>
</TD><TD>
<IMG SRC="hisax.jpeg" USEMAP="#hisax" BORDER="0">
</TD>
</TR></TABLE>
</CENTER>
</BODY></HTML>

View File

@ -0,0 +1,103 @@
<HTML>
<HEAD>
<TITLE>Interface for new ISAC/HSCX based cards</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN="CENTER"><A HREF="files.shtml">Dateiliste</A></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER>
<H2>Interface for new ISAC/HSCX based cards</H2>
</CENTER>
<PRE>
u_char <A HREF="asuscom.c.shtml#ReadISAC" TARGET="_code">ReadISAC(struct IsdnCardState *cs, u_char offset)</A>
Returns the value of a ISAC Register
void <A HREF="asuscom.c.shtml#ReadISAC" TARGET="_code">WriteISAC(struct IsdnCardState *cs, u_char offset, u_char value)</A>
Write to a ISAC Register
void <A HREF="asuscom.c.shtml#ReadISAC" TARGET="_code">ReadISACfifo(struct IsdnCardState *cs, u_char * data, int size)</A>
Read size bytes from the ISAC fifo
void <A HREF="asuscom.c.shtml#ReadISAC" TARGET="_code">WriteISACfifo(struct IsdnCardState *cs, u_char * data, int size)</A>
Write size bytes to the ISAC fifo
u_char <A HREF="asuscom.c.shtml#ReadISAC" TARGET="_code">ReadHSCX(struct IsdnCardState *cs, int hscx, u_char offset)</A>
Returns the value of a HSCX Register
void <A HREF="asuscom.c.shtml#ReadISAC" TARGET="_code">WriteHSCX(struct IsdnCardState *cs, int hscx, u_char offset, u_char value)</A>
Write to a HSCX Register
For fast interupt handling, here are some quick inline functions in
"hscx_irq.c". These functions need the following macros for card specific
routines.
#define <A HREF="asuscom.c.shtml#READHSCXFIFO" TARGET="_code">READHSCXFIFO(cs, nr, ptr, cnt)</A>
#define <A HREF="asuscom.c.shtml#READHSCXFIFO" TARGET="_code">WRITEHSCXFIFO(cs, nr, ptr, cnt)</A>
void
<A HREF="asuscom.c.shtml#asuscom_interrupt" TARGET="_code">card_interrupt(int intno, void *dev_id, struct pt_regs *regs)</A>
this function is the main IRQ routine. It should contain tests and calls
for the different IRQ sources (ISAC/HSCX and card specific sources)
int <A HREF="asuscom.c.shtml#Asus_card_msg" TARGET="_code">card_msg(struct IsdnCardState *cs, int mt, void *arg)</A>
This function controls various hardware related functions of the
specific card. It have to return 0, if no fatal error occours.
the following values for mt are defined (* optional) :
<A HREF="hisax.h.shtml#CARD_RESET" TARGET="_code">CARD_RESET</A> - * reset the card
<A HREF="hisax.h.shtml#CARD_RELEASE" TARGET="_code">CARD_RELEASE</A> - release all card resources
<A HREF="hisax.h.shtml#CARD_SETIRQ" TARGET="_code">CARD_SETIRQ</A> - set the irq function
<A HREF="hisax.h.shtml#CARD_INIT" TARGET="_code">CARD_INIT</A> - init components (eg. ISAC, HSCX) and
should request at least one IRQ
<A HREF="hisax.h.shtml#CARD_TEST" TARGET="_code">CARD_TEST</A> - * make some HW checks
These values are for LED status monitoring on some cards:
(<A HREF="hisax.h.shtml#MDL_REMOVE" TARGET="_code">MDL_REMOVE</A> | <A HREF="hisax.h.shtml#REQUEST" TARGET="_code">REQUEST</A>) - * action if a TEI is removed
(<A HREF="hisax.h.shtml#MDL_ASSIGN" TARGET="_code">MDL_ASSIGN</A> | <A HREF="hisax.h.shtml#REQUEST" TARGET="_code">REQUEST</A>) - * action if a TEI is assigned
<A HREF="hisax.h.shtml#MDL_INFO_SETUP" TARGET="_code">MDL_INFO_SETUP</A> - * action if a incoming call is pending
<A HREF="hisax.h.shtml#MDL_INFO_CONN" TARGET="_code">MDL_INFO_CONN</A> - * action if a connection is activ
<A HREF="hisax.h.shtml#MDL_INFO_REL" TARGET="_code">MDL_INFO_REL</A> - * action if a connection is released
<A HREF="hisax.h.shtml#CARD_AUX_IND" TARGET="_code">CARD_AUX_IND</A> - * This are for future extentions
(like a onboard modem)
if options are not implemented, it should return 0
<A HREF="asuscom.c.shtml#__initfunc" TARGET="_code">setup_card(struct IsdnCard *card)</A>
This function is called first and has to allocate resources
(IO addresses, memory) for the card and should set these
basic functions of the IsdnCardState structure.
cs->BC_Read_Reg = &ReadHSCX;
cs->BC_Write_Reg = &WriteHSCX;
cs->BC_Send_Data = &hscx_fill_fifo;
cs->cardmsg = &card_msg;
cs->readisac = &ReadISAC;
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
if anything goes wrong, the function has to return 0.
</PRE>
</HTML>

View File

@ -0,0 +1,61 @@
<HTML>
<!-- Generated by c2html-1.0, Copyright 1998 by Dave Whittington -->
<HEAD>
<TITLE>ipac.h</TITLE>
<!--#include virtual="/ssi/js.shtml" -->
<!--#include virtual="/ssi/buttondefs.shtml" -->
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE WIDTH="100%">
<TR>
<TD ALIGN=LEFT WIDTH="90"><!--#include virtual="/ssi/b_home.shtml" --></TD>
<TD ALIGN=RIGHT WIDTH="90"><!--#include virtual="/ssi/b_index.shtml" --></TD>
</TR>
</TABLE>
<CENTER><H1>ipac.h</H1></CENTER>
<HR>
<PRE>
<FONT COLOR=#0000FF>/* $Id$
* ipac.h IPAC specific defines
*
* Author Karsten Keil (keil@temic-ech.spacenet.de)
*
*
* $Log$
* Revision 1.3 1998/04/15 16:48:09 keil
* IPAC_ATX added
*
* Revision 1.2 1997/10/29 18:51:21 keil
* New files
*
* Revision 1.1.2.1 1997/10/17 22:10:48 keil
* new files on 2.0
*
*
*
*/</FONT>
<FONT COLOR=#0000FF>/* All Registers original Siemens Spec */</FONT>
<FONT COLOR=#A521F7>#define</FONT> IPAC_CONF 0xC0
<FONT COLOR=#A521F7>#define</FONT> IPAC_MASK 0xC1
<FONT COLOR=#A521F7>#define</FONT> IPAC_ISTA 0xC1
<FONT COLOR=#A521F7>#define</FONT> IPAC_ID 0xC2
<FONT COLOR=#A521F7>#define</FONT> IPAC_ACFG 0xC3
<FONT COLOR=#A521F7>#define</FONT> IPAC_AOE 0xC4
<FONT COLOR=#A521F7>#define</FONT> IPAC_ARX 0xC5
<FONT COLOR=#A521F7>#define</FONT> IPAC_ATX 0xC5
<FONT COLOR=#A521F7>#define</FONT> IPAC_PITA1 0xC6
<FONT COLOR=#A521F7>#define</FONT> IPAC_PITA2 0xC7
<FONT COLOR=#A521F7>#define</FONT> IPAC_POTA1 0xC8
<FONT COLOR=#A521F7>#define</FONT> IPAC_POTA2 0xC9
<FONT COLOR=#A521F7>#define</FONT> IPAC_PCFG 0xCA
<FONT COLOR=#A521F7>#define</FONT> IPAC_SCFG 0xCB
<FONT COLOR=#A521F7>#define</FONT> IPAC_TIMR2 0xCC
</BODY>
</HTML>

Some files were not shown because too many files have changed in this diff Show More