forked from ISDN4Linux/mISDN
-
Notifications
You must be signed in to change notification settings - Fork 2
Skeleton driver
colognechip edited this page Jun 7, 2017
·
1 revision
- hwskel is a base skeleton implementation of a layer1 mISDN driver.
- It can register several mISDN ports, and act like an S0 interface having a Cross connector plugged, so all data layer2 sends down to layer1 are looped back immediately.
- hwskel shows what it takes to register an mISDN interface, and how messaging with layer2 is done.
in mISDN/Makefile: uncomment line
CONFIGS+=CONFIG_MISDN_HWSKEL=m
and run:
make && make modules_install
modprobe mISDN_hwskel
with module parameter numports=n you can create more than one hwskel interface
using testlayer1, you can check if your virtual ISDN device is registered properly
testlayer1 --d --b1 --b2
- setup_instance() register mISDN interface at mISDN_core
- release_instance() release mISDN interface at mISDN_core
- ph_state(): handle a physical state change (S0 bus), such as ACTIVATE_INDICATION
- ph_state_te(): handle state changes for TE (Terminal Equipment)
- ph_state_nt(): handle state changes for NT (Network Terminator)
- layer2 entry callback entry points:
- hwskel_dctrl(): device control (open channel, etc)
- hwskel_bctrl(): Bchannel control (close channel, set PCM settings, etc)
- hwskel_l2l1D(): main layer2 D-Channel entry point for PH_DATA_REQ, PH_ACTIVATE_REQ, PH_DEACTIVATE_REQ
- hwskel_l2l1B(): main layer2 B-Channel entry point for PH_DATA_REQ, PH_ACTIVATE_REQ, PH_DEACTIVATE_REQ
- layer1 meta module callback
- hwskel_l1callback() receives callbacks from the layer1 helper instance created via create_l1(). This instance cares about common layer1 jobs, e.g. Activation Timers (T3/T4), etc.
- hwskel_ph_command(): wraps physical bus commands to perform e.g. S0 bus activation/deactivation