\hypertarget{scc__if_8m_source}{}\doxysection{scc\+\_\+if.\+m}
\label{scc__if_8m_source}\index{dev/scc/scc\_if.m@{dev/scc/scc\_if.m}}
\mbox{\hyperlink{scc__if_8m}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00001}00001 \textcolor{preprocessor}{\#-\/}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00002}00002 \textcolor{preprocessor}{\# Copyright (c) 2004-\/2006 Marcel Moolenaar}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00003}00003 \textcolor{preprocessor}{\# All rights reserved.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00004}00004 \textcolor{preprocessor}{\#}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00005}00005 \textcolor{preprocessor}{\# Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00006}00006 \textcolor{preprocessor}{\# modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00007}00007 \textcolor{preprocessor}{\# are met:}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00008}00008 \textcolor{preprocessor}{\#}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00009}00009 \textcolor{preprocessor}{\# 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00010}00010 \textcolor{preprocessor}{\#    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00011}00011 \textcolor{preprocessor}{\# 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00012}00012 \textcolor{preprocessor}{\#    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00013}00013 \textcolor{preprocessor}{\#    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00014}00014 \textcolor{preprocessor}{\#}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00015}00015 \textcolor{preprocessor}{\# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00016}00016 \textcolor{preprocessor}{\# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00017}00017 \textcolor{preprocessor}{\# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00018}00018 \textcolor{preprocessor}{\# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00019}00019 \textcolor{preprocessor}{\# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00020}00020 \textcolor{preprocessor}{\# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00021}00021 \textcolor{preprocessor}{\# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00022}00022 \textcolor{preprocessor}{\# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00023}00023 \textcolor{preprocessor}{\# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00024}00024 \textcolor{preprocessor}{\# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00025}00025 \textcolor{preprocessor}{\#}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00026}00026 \textcolor{preprocessor}{\# \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00028}00028 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00030}00030 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scc__bfe_8h}{dev/scc/scc\_bfe.h}}>}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00036}00036 \textcolor{preprocessor}{\# The SCC hardware interface. The core SCC code is hardware independent.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00037}00037 \textcolor{preprocessor}{\# The details of the hardware are abstracted by the SCC hardware interface.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00039}\mbox{\hyperlink{scc__if_8m_a6ffa625fec608cb82cd3ba5f0874192a}{00039}} INTERFACE \mbox{\hyperlink{scc__if_8m_a6ffa625fec608cb82cd3ba5f0874192a}{scc}};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00041}00041 \textcolor{preprocessor}{\# Default implementations of some methods.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00042}\mbox{\hyperlink{scc__if_8m_ab10338e29c30e470019afad1d8f9a5ff}{00042}} \mbox{\hyperlink{scc__if_8m_ab10338e29c30e470019afad1d8f9a5ff}{CODE}} \{}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00043}00043         \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00044}00044         \mbox{\hyperlink{scc__if_8m_a03f6e31e820d8103d2bcb1a475da47c0}{default\_enabled}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscc__softc}{scc\_softc}} *\textcolor{keyword}{this}, \textcolor{keyword}{struct} \mbox{\hyperlink{structscc__chan}{scc\_chan}} *ch)}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00045}00045         \{}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00046}00046                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00047}00047         \}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00048}00048 \}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00050}00050 \textcolor{preprocessor}{\# attach() -\/ attach hardware.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00051}00051 \textcolor{preprocessor}{\# This method is called when the device is being attached. All resources}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00052}00052 \textcolor{preprocessor}{\# have been allocated. The intend of this method is to setup the hardware}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00053}00053 \textcolor{preprocessor}{\# for normal operation.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00054}00054 \textcolor{preprocessor}{\# The reset parameter informs the hardware driver whether a full device}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00055}00055 \textcolor{preprocessor}{\# reset is allowed or not. This is important when one of the channels can}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00056}00056 \textcolor{preprocessor}{\# be used as system console and a hardware reset would disrupt output.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00057}00057 METHOD \textcolor{keywordtype}{int} attach \{}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00058}00058         \textcolor{keyword}{struct }\mbox{\hyperlink{structscc__softc}{scc\_softc}} *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00059}00059         \textcolor{keywordtype}{int} reset;}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00060}00060 \};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00062}00062 \textcolor{preprocessor}{\# enabled()}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00063}\mbox{\hyperlink{scc__if_8m_a9ef10b92f78efd088c05c9f1a8f0b6f7}{00063}} METHOD \textcolor{keywordtype}{int} \mbox{\hyperlink{scc__if_8m_a9ef10b92f78efd088c05c9f1a8f0b6f7}{enabled}} \{}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00064}00064         \textcolor{keyword}{struct }\mbox{\hyperlink{structscc__softc}{scc\_softc}} *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00065}\mbox{\hyperlink{scc__if_8m_a5f4a43ef040a5406244e317b4711fa91}{00065}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structscc__chan}{scc\_chan}} *\mbox{\hyperlink{scc__if_8m_a5f4a43ef040a5406244e317b4711fa91}{chan}};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00066}\mbox{\hyperlink{scc__if_8m_a03f6e31e820d8103d2bcb1a475da47c0}{00066}} \} DEFAULT \mbox{\hyperlink{scc__if_8m_a03f6e31e820d8103d2bcb1a475da47c0}{default\_enabled}};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00068}00068 \textcolor{preprocessor}{\# iclear()}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00069}\mbox{\hyperlink{scc__if_8m_a858a5b1d4f7ee26f5a2c9ee00638eedb}{00069}} METHOD \textcolor{keywordtype}{int} \mbox{\hyperlink{scc__if_8m_a858a5b1d4f7ee26f5a2c9ee00638eedb}{iclear}} \{}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00070}00070         \textcolor{keyword}{struct }\mbox{\hyperlink{structscc__softc}{scc\_softc}} *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00071}00071         \textcolor{keyword}{struct }\mbox{\hyperlink{structscc__chan}{scc\_chan}} *\mbox{\hyperlink{scc__if_8m_a5f4a43ef040a5406244e317b4711fa91}{chan}};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00072}00072 \};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00074}00074 \textcolor{preprocessor}{\# ipend() -\/ query SCC for pending interrupts.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00075}00075 \textcolor{preprocessor}{\# When an interrupt is signalled, the handler will call this method to find}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00076}00076 \textcolor{preprocessor}{\# out which of the interrupt sources needs attention. The handler will use}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00077}00077 \textcolor{preprocessor}{\# this information to dispatch service routines that deal with each of the}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00078}00078 \textcolor{preprocessor}{\# interrupt sources. An advantage of this approach is that it allows multi-\/}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00079}00079 \textcolor{preprocessor}{\# port drivers (like puc(4)) to query multiple devices concurrently and}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00080}00080 \textcolor{preprocessor}{\# service them on an interrupt priority basis. If the hardware cannot provide}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00081}00081 \textcolor{preprocessor}{\# the information reliably, it is free to service the interrupt and return 0,}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00082}00082 \textcolor{preprocessor}{\# meaning that no attention is required.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00083}\mbox{\hyperlink{scc__if_8m_a2bbb3fdc727fb30472c66cc1fb3dcc40}{00083}} METHOD \textcolor{keywordtype}{int} \mbox{\hyperlink{scc__if_8m_a2bbb3fdc727fb30472c66cc1fb3dcc40}{ipend}} \{}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00084}00084         \textcolor{keyword}{struct }\mbox{\hyperlink{structscc__softc}{scc\_softc}} *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00085}00085 \}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00087}00087 \textcolor{preprocessor}{\# probe() -\/ detect hardware.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00088}00088 \textcolor{preprocessor}{\# This method is called as part of the bus probe to make sure the}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00089}00089 \textcolor{preprocessor}{\# hardware exists. This function should also set the device description}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00090}00090 \textcolor{preprocessor}{\# to something that represents the hardware.}}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00091}\mbox{\hyperlink{scc__if_8m_a54a77b26466d6439404f7203d7f51e80}{00091}} METHOD \textcolor{keywordtype}{int} \mbox{\hyperlink{scc__if_8m_a54a77b26466d6439404f7203d7f51e80}{probe}} \{}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00092}00092         \textcolor{keyword}{struct }\mbox{\hyperlink{structscc__softc}{scc\_softc}} *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{scc__if_8m_source_l00093}00093 \};}

\end{DoxyCode}
