aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/dts/WLI-TX4-AG300N.dts
Commit message (Expand)AuthorAgeFilesLines
* ramips: fix WLI-TX4-AG300N boot and networkYo Abe2017-01-131-2/+11
* treewide: dts: use keycode defines from input dt-bindingMathias Kresin2016-11-131-3/+5
* ramips: DTS reworkStanislav Galabov2016-05-121-19/+17
* ramips: Change all '/include/' clauses to '#include' so preprocessing canStanislav Galabov2016-05-101-1/+1
* ralink: fixup devicetree files to work with new ethernet driverJohn Crispin2015-12-171-1/+1
* ramips: use consistent naming scheme for LEDsJohn Crispin2015-08-171-3/+3
* ramips: fix indentation and other mistakes in .dts{, i} filesJohn Crispin2015-08-171-2/+9
* ralink: drop old pinmux nodes from dts filesJohn Crispin2014-12-141-6/+0
* ramips: soc wmac eeprom cleanupJohn Crispin2014-07-171-0/+4
* ralink: add missing OF nodeJohn Crispin2014-03-181-2/+2
* ralink: set the mac addr via the dts fileJohn Crispin2013-11-251-0/+1
* ralink: add pinctrl driverJohn Crispin2013-09-171-4/+0
* ralink: update patchesJohn Crispin2013-06-231-1/+3
* ramips: unbreak rt2880 supportJohn Crispin2013-05-061-0/+101
r: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
\subsubsection{Using the network scripts}

To be able to access the network functions, you need to include
the necessary shell scripts by running:

\begin{Verbatim}
. /lib/functions.sh      # common functions
include /lib/network     # include /lib/network/*.sh
scan_interfaces          # read and parse the network config
\end{Verbatim}

Some protocols, such as PPP might change the configured interface names
at run time (e.g. \texttt{eth0} => \texttt{ppp0} for PPPoE). That's why you have to run
\texttt{scan\_interfaces} instead of reading the values from the config directly.
After running \texttt{scan\_interfaces}, the \texttt{'ifname'} option will always contain
the effective interface name (which is used for IP traffic) and if the
physical device name differs from it, it will be stored in the \texttt{'device'}
option.
That means that running \texttt{config\_get lan ifname}
after \texttt{scan\_interfaces} might not return the same result as running it before.

After running \texttt{scan\_interfaces}, the following functions are available:

\begin{itemize}
    \item{\texttt{find\_config \textit{interface}}} \\
        looks for a network configuration that includes
        the specified network interface.

    \item{\texttt{setup\_interface \textit{interface [config] [protocol]}}} \\
      will set up the specified interface, optionally overriding the network configuration
      name or the protocol that it uses.
\end{itemize}

\subsubsection{Writing protocol handlers}

You can add custom protocol handlers (e.g: PPPoE, PPPoA, ATM, PPTP ...)
by adding shell scripts to \texttt{/lib/network}. They provide the following
two shell functions:

\begin{Verbatim}
scan_<protocolname>() {
    local config="$1"
    # change the interface names if necessary
}

setup_interface_<protocolname>() {
    local interface="$1"
    local config="$2"
    # set up the interface
}
\end{Verbatim}

\texttt{scan\_\textit{protocolname}} is optional and only necessary if your protocol
uses a custom device, e.g. a tunnel or a PPP device.