summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Briesenick <sbriesen@gentoo.org>2005-09-03 20:25:17 +0000
committerStefan Briesenick <sbriesen@gentoo.org>2005-09-03 20:25:17 +0000
commitd6a57995312fec256a63beac14aeca503e846e38 (patch)
tree672966509566a7b368dea044096ee177dfb8b768 /net-dialup/capi4k-utils/files
parentStable on ppc64 (diff)
downloadgentoo-2-d6a57995312fec256a63beac14aeca503e846e38.tar.gz
gentoo-2-d6a57995312fec256a63beac14aeca503e846e38.tar.bz2
gentoo-2-d6a57995312fec256a63beac14aeca503e846e38.zip
adding lots of USE flags, checking kernel options, reworked init- and hotplug-scripts, added pcmcia support for kernels < 2.6.13 (new pcmcia support will follow soon).
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'net-dialup/capi4k-utils/files')
-rw-r--r--net-dialup/capi4k-utils/files/capi.blacklist4
-rw-r--r--net-dialup/capi4k-utils/files/capi.conf4
-rw-r--r--net-dialup/capi4k-utils/files/capi.confd31
-rw-r--r--net-dialup/capi4k-utils/files/capi.hotplug28
-rw-r--r--net-dialup/capi4k-utils/files/capi.initd149
-rw-r--r--net-dialup/capi4k-utils/files/capi.pcmcia31
-rw-r--r--net-dialup/capi4k-utils/files/capi.pcmcia.conf36
-rw-r--r--net-dialup/capi4k-utils/files/capi.usermap4
-rw-r--r--net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r11
9 files changed, 218 insertions, 70 deletions
diff --git a/net-dialup/capi4k-utils/files/capi.blacklist b/net-dialup/capi4k-utils/files/capi.blacklist
index de70fcbcf39c..88e52a730062 100644
--- a/net-dialup/capi4k-utils/files/capi.blacklist
+++ b/net-dialup/capi4k-utils/files/capi.blacklist
@@ -1,6 +1,4 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.blacklist,v 1.3 2005/04/24 13:31:48 genstef Exp $
+# /etc/hotplug/blacklist.d/capi
# CAPI USB is handled via /etc/hotplug/usb/capi.usermap
fcusb
diff --git a/net-dialup/capi4k-utils/files/capi.conf b/net-dialup/capi4k-utils/files/capi.conf
index bb1b3e916d84..c2e3864e1691 100644
--- a/net-dialup/capi4k-utils/files/capi.conf
+++ b/net-dialup/capi4k-utils/files/capi.conf
@@ -1,6 +1,4 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.conf,v 1.4 2005/05/16 08:49:33 genstef Exp $
+# /etc/capi.conf - CAPI configuration file
# card file proto io irq mem cardnr options
#
diff --git a/net-dialup/capi4k-utils/files/capi.confd b/net-dialup/capi4k-utils/files/capi.confd
index edc9d953b9ea..d7e7af590cb1 100644
--- a/net-dialup/capi4k-utils/files/capi.confd
+++ b/net-dialup/capi4k-utils/files/capi.confd
@@ -1,6 +1,18 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.confd,v 1.4 2005/05/16 08:49:33 genstef Exp $
+# configuraton file for /etc/init.d/capi
+
+###
+### Common settings
+###
+
+# should 'capidrv' be loaded?
+CAPI_LOAD_CAPIDRV="no"
+
+# deactivate cards on stop (USB-Cards have to be re-plugged then)?
+CAPI_UNLOAD_CARDS="yes"
+
+###
+### USB Hotplug
+###
# do you want to use USB hotplug?
# if disabled, you have to configure your device in /etc/capi.conf
@@ -12,8 +24,13 @@ CAPI_HOTPLUG_BEEP="yes"
# should capi-usb handle hotplug-events for mISDN cards?
CAPI_HOTPLUG_MISDN="yes"
-# should CAPIDRV be loaded?
-CAPI_LOAD_CAPIDRV="yes"
+###
+### Bluetooth CIP
+###
+
+# blank-seperated list of CIP devices to connect. You need
+# started Bluez stack and already peered devices to make
+# this work. Bluetooth devices will be connected after
+# ISA/PCI/(USB) devices. Leave empty to disable feature.
+#CAPI_CIP_DEVICES="00:11:22:33:44:55 DE:AD:BE:EF:47:11"
-# deactivate cards on stop (USB-Cards have to be re-plugged then)?
-CAPI_UNLOAD_CARDS="yes"
diff --git a/net-dialup/capi4k-utils/files/capi.hotplug b/net-dialup/capi4k-utils/files/capi.hotplug
index 467abee14fd3..d0d2aec129ab 100644
--- a/net-dialup/capi4k-utils/files/capi.hotplug
+++ b/net-dialup/capi4k-utils/files/capi.hotplug
@@ -1,28 +1,30 @@
#!/bin/bash
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.9 2005/07/20 18:47:52 sbriesen Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.10 2005/09/03 20:25:17 sbriesen Exp $
. /etc/conf.d/capi
-[ "$CAPI_HOTPLUG_USB" = "yes" ] || exit 0
+[ "${CAPI_HOTPLUG_USB}" = "yes" ] || exit 0
# possible firmware locations (list and order taken from 'capiinit')
FWDIRS=(/lib/firmware/isdn /lib/firmware /usr/share/isdn /usr/lib/isdn /lib/isdn)
# Syslog output
syslog() { # <msg>
- /usr/bin/logger -t "capi-usb" "$1"
+ /usr/bin/logger -t "capi-usb" "$@"
}
# OK beep
beep_ok() {
- [ "$CAPI_HOTPLUG_BEEP" = "yes" ] && echo -en "\033[10;1200]\a\033[10;262]" > /dev/console
+ [ "${CAPI_HOTPLUG_BEEP}" = "yes" ] && \
+ echo -en "\033[10;1200]\a\033[10;262]" > /dev/console
}
# Error beep
beep_error() {
- [ "$CAPI_HOTPLUG_BEEP" = "yes" ] && echo -en "\033[10;300]\a\033[10;262]" > /dev/console
+ [ "${CAPI_HOTPLUG_BEEP}" = "yes" ] && \
+ echo -en "\033[10;300]\a\033[10;262]" > /dev/console
}
# Driver lookup
@@ -134,12 +136,12 @@ case "${VENDID}" in
exit 1;;
esac
-if [ "$DRIVER" = "hfcsusb" -a "$CAPI_HOTPLUG_MISDN" != "yes" ]; then
+if [ "${DRIVER}" = "hfcsusb" -a "${CAPI_HOTPLUG_MISDN}" != "yes" ]; then
syslog "ignore mISDN card: ${DRIVER} (${VENDID})"
exit 0
fi
-case "$ACTION" in
+case "${ACTION}" in
add)
# loading capi
if ! ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ); then
@@ -155,24 +157,24 @@ case "$ACTION" in
# loading firmware
if [ -n "${LOADER}" -a -n "${FIRMWARE}" ]; then
- CNT=0 # wait for udev
- while [ ! -e /dev/capi20 -a $CNT -lt 20 ]; do
- sleep 0.5; : $((CNT++))
+ CNT=0 # wait for udev (max 10s)
+ while [ ! -c /dev/capi20 -a ${CNT} -lt 40 ]; do
+ sleep 0.25; : $((CNT++))
done
FW=$(findfw "${FIRMWARE}")
if [ -n "${FW}" ]; then
- if ! $LOADER $DRIVER $USBDEV $FW; then
+ if ! ${LOADER} ${DRIVER} ${USBDEV} ${FW}; then
syslog "could not load firmware!"
beep_error; exit 1
fi
else
- syslog "firmware ${FIRMWARE} not found in ${FWDIRS[0]}"
+ syslog "firmware '${FIRMWARE}' not found in ${FWDIRS[0]}"
beep_error; exit 1
fi
fi
# loading capidrv (should be loaded *after* card driver)
- if ! ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" != "yes" ] \
+ if ! ( [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] \
|| /sbin/modprobe -sq capidrv ); then
syslog "could not load CAPIDRV!"
fi
diff --git a/net-dialup/capi4k-utils/files/capi.initd b/net-dialup/capi4k-utils/files/capi.initd
index de5364f47baa..007fb8b58bf6 100644
--- a/net-dialup/capi4k-utils/files/capi.initd
+++ b/net-dialup/capi4k-utils/files/capi.initd
@@ -1,38 +1,69 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.6 2005/04/24 13:31:48 genstef Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.7 2005/09/03 20:25:17 sbriesen Exp $
opts="info showconfig"
depend() {
- after hotplug isapnp pcmcia bluetooth
+ after isapnp pcmcia bluetooth hotplug
}
-drivers() { # detecting loaded drivers
+# possible firmware locations (list and order taken from 'capiinit')
+FWDIRS=(/lib/firmware/isdn /lib/firmware /usr/share/isdn /usr/lib/isdn /lib/isdn)
+
+# Firmware search
+findfw() { # <fw_name>
+ local DIR
+ for DIR in ${FWDIRS[*]}; do
+ if [ -f "${DIR}/${1}" ]; then
+ echo "${DIR}/${1}"; return 0
+ fi
+ done
+ return 1
+}
+
+# looking for 'detected' cards (currently only 'sedlfax')
+detected() { # <driver>
+ # /proc/capi/controller: <controller> <drivername> <state> <cardname> <controllerinfo>
+ /bin/sed -n "s:^\([1-9][0-9]*\) \+${1} \+detected \+.*:\1:p" \
+ /proc/capi/controller 2>/dev/null
+}
+
+# detecting loaded mISDN modules
+misdn_modules() {
+ /bin/sed -n "s:^mISDN_core \+[0-9]\+ \+[0-9]\+ \+\([^ ]\+\).*\$:\1:p" \
+ /proc/modules 2>/dev/null | /bin/tr "," " "
+}
+
+# detecting loaded CAPI drivers
+capi_drivers() {
local DRV MISDN=0
while read DRV; do
- case "$DRV" in
+ case "${DRV}" in
mISDN) MISDN=1;;
- ?*) echo "$DRV";;
+ ?*) echo "${DRV}";;
esac
done < <(/bin/sed 2>/dev/null -n "s:^[0-9]\+ \+\([^ ]\+\).*\$:\1:p" /proc/capi/controller)
- if [ $MISDN -gt 0 ]; then # dirty hack to find loaded mISDN modules
- local IFS=","
- for DRV in $(/bin/sed 2>/dev/null -n "s:^mISDN_core \+[0-9]\+ \+[0-9]\+ \+\([^ ]\+\).*\$:\1:p" /proc/modules); do
- case "$DRV" in
+ if [ ${MISDN} -gt 0 ]; then # dirty hack to find loaded mISDN modules
+ for DRV in $(misdn_modules); do
+ case "${DRV}" in
mISDN_*|l3udss1|faxl3) continue;;
- ?*) echo "$DRV";;
+ ?*) echo "${DRV}";;
esac
done
fi
}
-bluez_cip() { # detecting bluetooth CIP connections
- [ -x /usr/bin/ciptool ] && # net-wireless/bluez-utils \
- /bin/sed 2>/dev/null -n "s:[0-9]\+ \+cmtp \+[^ ]\+ \+\([0-9A-F:]\+\) \+.*\$:\1:p" /proc/capi/controller
+# detecting bluetooth CIP connections
+bluez_cip() {
+ [ -x /usr/bin/ciptool ] && \
+ /bin/sed -n "s:[0-9]\+ \+cmtp \+[^ ]\+ \+\([0-9A-F:]\+\) \+.*\$:\1:p" \
+ /proc/capi/controller 2>/dev/null
}
+
+
start() {
if [ ! -e /etc/capi.conf ] ; then
eerror "You're missing /etc/capi.conf (comes with a capi-driver)."
@@ -44,55 +75,91 @@ start() {
[ -f /proc/capi/capi20 ] || /sbin/modprobe -s capi
eend $? || return 1
- local CNT=0 # wait for udev
- while [ ! -e /dev/capi20 -a $CNT -lt 20 ]; do
- sleep 0.5; : $((CNT++))
+ local CNT=0 # wait for udev (max 10s)
+ while [ ! -c /dev/capi20 -a ${CNT} -lt 40 ]; do
+ sleep 0.25; : $((CNT++))
done
ebegin "Starting CAPI"
- if /usr/sbin/capiinit 2>/dev/null activate ; then
- [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" != "yes" ] || /sbin/modprobe -s capidrv
- # eindent -> waiting for new baselayout :-/
- local INFO
- while read INFO; do einfo " ${INFO}"; done < /proc/capi/controller
- # eoutdent
+ /usr/sbin/capiinit 2>/dev/null activate
+ if eend $?; then
+ local CIP MSG INFO FW CARD MISDN
+
+ # HACK: loading ISAR.BIN onto 'sedlfax' cards
+ # shouldn't be necessary, but mISDN is crappy
+ MISDN=$(detected "mISDN")
+ if [ -n "${MISDN}" ]; then
+ FW=$(findfw "ISAR.BIN")
+ if [ -n "${FW}" ]; then
+ for CARD in ${MISDN}; do
+ ebegin "Loading firmware '${FW##*/}' onto controller ${CARD}"
+ /usr/sbin/avmcapictrl &>/dev/null load "${FW}" "${CARD}"
+ eend $?
+ done
+ else
+ eerror "Firmware 'ISAR.BIN' not found in ${FWDIRS[0]}"
+ fi
+ fi
+
+ # connect to CIP devices
+ if [ -n "${CAPI_CIP_DEVICES}" -a -x /usr/bin/ciptool ]; then
+ for CIP in ${CAPI_CIP_DEVICES}; do
+ ebegin "CIP connect to ${CIP}"
+ INFO=$(/usr/bin/ciptool 2>&1 connect "${CIP}")
+ if ! eend $?; then
+ [ -n "${INFO}" ] && \
+ while read line MSG; do eerror " ${MSG}"; done < <(echo "${INFO}")
+ fi
+ done
+ sleep 0.3 # give subsystems time to initialize
+ fi
+
+ # load 'capidrv'
+ [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] || /sbin/modprobe -s capidrv
+
+ # show controllers
+ INFO=$(</proc/capi/controller)
+ if [ -n "${INFO}" ]; then
+ einfo "Available CAPI controllers:"
+ while read MSG; do einfo " ${MSG}"; done < <(echo "${INFO}")
+ fi
fi
- eend $?
+ return 0 # never fail
}
stop() {
- local DRV CIP RET FCNT=0 DRIVERS=$(/bin/sort -u <(drivers))
+ local DRV CIP RET FCNT=0 DRIVERS=$(/bin/sort -u <(capi_drivers))
# if some CAPI applications are still running, kill 'em
if /bin/fuser 2>/dev/null -s /dev/capi20; then
ebegin "Stopping CAPI applications"
/bin/fuser -ks /dev/capi20; RET=$?
- while [ $RET -eq 0 -a $FCNT -lt 10 ]; do
- echo -n "."; sleep 0.5; FCNT=$(($FCNT + 1))
- /bin/fuser -s /dev/capi20; RET=$?
+ while [ ${RET} -eq 0 -a ${FCNT} -lt 10 ]; do
+ : $((FCNT++)); sleep 0.5; /bin/fuser -s /dev/capi20; RET=$?
done
- [ $RET -eq 0 ] && eend 1 || eend 0
+ [ $RET -ne 0 ]
+ eend $?
fi
- # relase bluetooth CIP connections
+ # release bluetooth CIP connections
for CIP in $(bluez_cip); do
ebegin "Release CIP connection to ${CIP}"
- /usr/bin/ciptool release "$CIP"
+ /usr/bin/ciptool release "${CIP}"
eend
done
ebegin "Stopping CAPI"
- [ "$CAPI_LOAD_CAPIDRV" = "yes" ] && /sbin/modprobe -sqr capidrv
- [ "$CAPI_UNLOAD_CARDS" = "yes" ] && /usr/sbin/capiinit &>/dev/null stop
- for DRV in $DRIVERS; do /sbin/modprobe -sqr $DRV; done
+ [ "${CAPI_LOAD_CAPIDRV}" = "yes" ] && /sbin/modprobe -sqr capidrv
+ [ "${CAPI_UNLOAD_CARDS}" = "yes" ] && /usr/sbin/capiinit &>/dev/null stop
+ for DRV in ${DRIVERS}; do /sbin/modprobe -sqr "${DRV}"; done
/sbin/modprobe -sqr capi
- eend 0
+ eend 0 # ignore errors
}
info() {
- if [ -e /proc/capi/controller ]; then
- local INFO
- while read INFO; do einfo "${INFO}"; done < /proc/capi/controller
+ if [ -f /proc/capi/controller ]; then
+ local MSG
+ while read MSG; do einfo "${MSG}"; done < /proc/capi/controller
else
eerror "ERROR: CAPI not loaded"
return 1
@@ -100,11 +167,11 @@ info() {
}
showconfig() {
- local TEXT INFO
- if TEXT=$(/usr/sbin/capiinit 2>&1 show); then
- echo "$TEXT" | while read INFO; do einfo "${INFO}"; done
+ local MSG INFO
+ if INFO=$(/usr/sbin/capiinit 2>&1 show); then
+ while read MSG; do einfo "${MSG}"; done < <(echo "${INFO}")
return 0
fi
- echo "$TEXT" | while read INFO; do eerror "${INFO}"; done
+ while read MSG; do eerror "${MSG}"; done < <(echo "${INFO}")
return 1
}
diff --git a/net-dialup/capi4k-utils/files/capi.pcmcia b/net-dialup/capi4k-utils/files/capi.pcmcia
new file mode 100644
index 000000000000..941cee247cf6
--- /dev/null
+++ b/net-dialup/capi4k-utils/files/capi.pcmcia
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.pcmcia,v 1.1 2005/09/03 20:25:17 sbriesen Exp $
+
+. /etc/pcmcia/shared
+. /etc/conf.d/capi
+
+# Syslog output
+syslog() { # <msg>
+ /usr/bin/logger -t "capi-pcmcia" "$@"
+}
+
+case "${ACTION}" in
+ start)
+ # loading capi
+ if ! ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ); then
+ syslog "could not load CAPI!"
+ exit 1
+ fi
+
+ # loading capidrv (should be loaded *after* card driver)
+ if ! ( [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] \
+ || /sbin/modprobe -sq capidrv ); then
+ syslog "could not load CAPIDRV!"
+ fi
+ ;;
+ stop)
+ ;;
+esac
+exit 0
diff --git a/net-dialup/capi4k-utils/files/capi.pcmcia.conf b/net-dialup/capi4k-utils/files/capi.pcmcia.conf
new file mode 100644
index 000000000000..8a6072b2f729
--- /dev/null
+++ b/net-dialup/capi4k-utils/files/capi.pcmcia.conf
@@ -0,0 +1,36 @@
+###############################################################################
+# Device driver definitions for AVM cards (CAPI) #
+# Please read "man 5 pcmcia" for detailed informations. #
+###############################################################################
+
+# needs net-dialup/fritzcapi
+device "fcpcmcia_cs"
+ class "capi" module "fcpcmcia_cs"
+
+# active controller, driver included in kernel
+device "avm_cs"
+ class "capi" module "avm_cs"
+# class "capi" module "b1pcmcia" module "avm_cs"
+# class "capi" module "avm_cs" opts "irq_list=15,12,11,10,9,7"
+
+
+###############################################################################
+# Card definitions #
+###############################################################################
+
+card "AVM ISDN-Controller A1"
+ version "AVM", "ISDN A"
+ bind "fcpcmcia_cs"
+
+card "AVM ISDN-Controller B1"
+ version "AVM", "ISDN-Controller B1"
+ bind "avm_cs"
+
+card "AVM Mobile ISDN-Controller M1"
+ version "AVM", "Mobile ISDN-Controller M1"
+ bind "avm_cs"
+
+card "AVM Mobile ISDN-Controller M2"
+ version "AVM", "Mobile ISDN-Controller M2"
+ bind "avm_cs"
+
diff --git a/net-dialup/capi4k-utils/files/capi.usermap b/net-dialup/capi4k-utils/files/capi.usermap
index 7f362041d600..32adec7c791b 100644
--- a/net-dialup/capi4k-utils/files/capi.usermap
+++ b/net-dialup/capi4k-utils/files/capi.usermap
@@ -1,6 +1,4 @@
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.usermap,v 1.2 2005/05/16 08:49:33 genstef Exp $
+# /etc/hotplug/usb/capi.usermap
# AVM USB cards (ISDN/DSL)
capi 0x0003 0x057c 0x0c00 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
diff --git a/net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r1 b/net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r1
new file mode 100644
index 000000000000..5fa2e15e6748
--- /dev/null
+++ b/net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r1
@@ -0,0 +1 @@
+MD5 c745759b6b3d64e19763727176648cdf capi4k-utils-2005-07-18.tar.gz 862826