summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/xpp_dahdi.c
AgeCommit message (Collapse)Author
2011-05-23xpp: Now each Astribank (xbus) is a dahdi device and each xpd is a span:Oron Peled
- This is a minimal patch - More work should be done (e.g: auto_registration etc.)
2011-05-23xpp: Remove obsolete and unused OLD_PROC codeTzafrir Cohen
OLD_PROC marked old and unused code that was used for writing to procfs. It has long ago been replaced with different sysfs interfaces. Time to remove it. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9916 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-05-23Revert "remove OLD_PROC code (leave only informative proc files)"Oron Peled
This reverts commit bab264ce3cb81098ff5b450f7c94a44a10f95dec.
2011-05-08remove OLD_PROC code (leave only informative proc files)Oron Peled
2011-04-15dahdi: Move irq/irqmisses from dahdi_span into dahdi_device.Shaun Ruffell
These fields do not have anything to do with the span. Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2011-04-15dahdi: register/unregister devices as opposed to individual spans.Shaun Ruffell
Increasingly, spans are implemented by devices that support more than a single span. Introduce a 'struct dahdi_device' object which explicitly contains multiple spans. This will also allow a cleaner representation of spans and devices in sysfs since order of arrival will not determine the layout of the devices. This also gives the core of dahdi a way to know the relationship between spans. Signed-off-by: Shaun Ruffell <sruffell@digium.com>
2011-01-31xpp: Missing lock release in xpp_dahdi_unregisterTzafrir Cohen
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9727 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: Remove few extra leading spacesOron Peled
Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9713 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: Use our KZALLOC/KZFREEOron Peled
Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9712 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: use phonedev_cleanup() instead of inline codeOron Peled
Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9711 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: phonedev: Cleanup method macrosOron Peled
* Caller to CALL_XMETHOD() no longer need to explicitly pass xbus (calculate xpd->xbus) * Create CALL_PHONE_METHOD() similar to CALL_XMETHOD() -- inlining the extra parameters (more readable) * Reverse parameter order in PHONE_METHOD() and CALL_PHONE_METHOD() to be consistent with XMETHOD() and CALL_XMETHOD() * Rename XPD_STATE phonedev method to card_state: - Consistency with other phonedev methods. - These calls now Wrap internal calls to XPD_STATE protocol HOSTCMD in PRI, BRI, FXS, FXO Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9706 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: More adaptations for non-PHONEDEV XPDsOron Peled
* Add IS_PHONEDEV(xpd) macro * Reject dahdi_register_xpd()/dahdi_unregister_xpd() for non-PHONEDEV * Make sysfs 'offhook' attribute contain '\n' if empty (no channels) * Skip PHONEDEV related xbus_tick() parts -- we still want to process the end of it for the card_tick() calls. * Remove BUG_ON() for missing phoneops (also remove old duplicate test for XBUS_IS...) * Call XPD_STATE method only for PHONEDEV XPD's Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9705 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2011-01-30xpp: prepare for phonedev refactorOron Peled
* Allow having XPDs that represent a device that is not a span. * Refactor all span related data from 'struct xpd' to 'struct phonedev' * Refactor span related methods into 'phonedev->phoneops' * Refactor phone related initialization into phonedev_init()/phonedev_cleanup() Signed-off-by: Oron Peled <oron@actcom.co.il> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9704 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-08dahdi: Removing loopstop maint functionRuss Meyerriecks
DAHDI_MAINT_LOOPSTOP is being removed due to the redundancy with DAHDI_MAINT_NONE. Also removing some timing logic, as amount of time a loopup or loopdown signal is held on the line, is now defined in userspace with dahdi_maint. Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com> Acked-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9515 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-12-08dahdi: Clean up an unused waitqueueRuss Meyerriecks
The dahdi_span->maintq wait queue was very old and not being used so it has been removed. Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com> Acked-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom..com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9514 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26dahdi: Move the 'owner' field from dahdi_span to dahdi_span_ops.Shaun Ruffell
One more thing that can be moved out of the per-span structure. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8986 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26dahdi: Move the callbacks in dahdi_span into its own structure.Shaun Ruffell
Part of preparation for adding additional callbacks to allow board drivers to advertise and support gathering pre-echocan data from hardware echocans. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8985 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-26dahdi: Remove the 'pvt' member from dahdi_span.Shaun Ruffell
The vast majority of board drivers already keep the dahdi_span structure in a driver specific structure. The others were easily converted. This way board drivers can use the container_of macro to find what was previously pointed to by the "pvt" member of the span. One less thing to think about in the span structure. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8984 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13start migrating from xbus_num() to get_xbus()/put_xbus()Tzafrir Cohen
* Now get_xbus() receive and xbus number (not poiner) and uses xbus_num() internally to map it to an xbus pointer + refcount increment. (this is atomic) * Migrate all obvious places that used xbus_num() to map bus number into a pointer, so now they use get_xbus() + put_xbus() to aquire and release an xbus. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8913 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13PRI Astribanks always sync AB (and independent)Tzafrir Cohen
* PRI devices always get SYNC-AB (never PLL, not even for NT) * Fix Timing priority calculation accordingly. * On PRI layer1 changes, elect_syncer() is called, so we have re-election. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8909 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13Keep SYSFS objects after disconnectTzafrir Cohen
* Astribanks no longer live directly under the USB devices in the device tree. * The 'transport' link does point there as before, however. * When the USB device disconnects, we keep references to them to make sure they don't disappear. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8900 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13Basic support for DAHDI_VMWI_CONFIGTzafrir Cohen
* Supports only our current NEON notification. * No more global 'vmwineon' parameter: - We expect asterisk to tell us by channel. - If 'vmwi_ioctl' is not set (it is by default), that we revert to FSK searching (expensive) and call directly our NEON code (as before). git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8887 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13put xbus->worker in xbus; wake_up_interruptible_all()Tzafrir Cohen
* The worker member of 'struct xbus' is now an embedded struct xbus_workqueue. * Replace wake_up() to wake_up_interruptible_all(). git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8882 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13Cleanup: refcount_xpd()Tzafrir Cohen
* Change refcount_xpd(): instead of returning a pointer to the atomic counter, return directly its value (just like refcount_xbus()) * Add a refcount_xbus and refcount_xpd attributes to sysfs (for debugging) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8878 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2010-07-13Fix building without CONFIG_PROC_FS definedTzafrir Cohen
This changeset should have no functional changes. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8877 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-12-14xpp: replace i with j to avoid overridingTzafrir Cohen
Fix a place where an inner declaration of a local 'i' shadows the declaration of an outer one. Just rename the inner one to 'j'. Reported by sparse. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7690 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-10-12headers: sched.h was also removed from interrupts.hShaun Ruffell
Commit d43c36 made it necessary to add sched.h to more of the board drivers. http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d43c36 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7392 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-09-29xpp: make card_hooksig an optional card method.Tzafrir Cohen
Done in preperation for T1 CAS support, as the PRI module will use RBS instead. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7244 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-08-12xpp: Don't check for the 'owner' field too soonTzafrir Cohen
The owner field should only tested after the low-level driver pre-registration method is called. xpp rev: 7287 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6967 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-06-29dahdi-base: Enable DAHDI to manage the reference counts for the board drivers.Shaun Ruffell
Adds a struct module 'owner' member to the dahdi_span structure and updates all the board drivers to set this member before registering the span. This allows the core of dahdi to maintain the reference counts on the channels itself. (closes issue #10601) Reported by: Matti git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6794 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-05-19xpp: 'owner' property of procfs was dropped in 2.6.30.Tzafrir Cohen
This adds a compatibility macro for older versions that is a noop for kernels >= 2.6.30. (closes issue #14964) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6642 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-04-20xpp: Do use information about number of ports the Astribank providesTzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6408 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-03-01New XPP code: xpp rev 6795:Tzafrir Cohen
* Fix cases where the command_queue overflowed during initialization. - Also add a 'command_queue_length' parameter to xpp.ko * More migrations to sysfs: - Add a 'transport' attribute to our astribank devices which points to the usb device we use. E.g: /sys/bus/astribanks/devices/xbus-00/transport is symlinked to ../../../../../../devices/pci0000:00/0000:00:10.4/usb5/5-4 - Move /proc/xpp/XBUS-??/XPD-??/span to /sys/bus/xpds/devices/??:?:?/span - Migrate from /proc/xpp/sync to: /sys/bus/astribanks/drivers/xppdrv/sync - New 'offhook' attribute in: /sys/bus/xpds/devices/??:?:?/offhook * PRI: change the "timing" priority to match the convention used by other PRI cards -- I.e: lower numbers (not 0) have higher priority. * FXO: - Power denial: create two module parameters instead of hard-coded constants (power_denial_safezone, power_denial_minlen). For sites that get non-standard power-denial signals from central office on offhook. - Don't hangup on power-denial, just notify Dahdi and wait for - Fix caller-id detection for the case central office sends it before first ring without any indication before. Asterisk's desicion. * USB_FW.hex: - Fixes cases where firmware loading would fail. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@6046 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2009-01-18xpp.r6616: More sysfs migration, FXO enhancements, BRI fixesTzafrir Cohen
* Fix cases where the command_queue overflowed during initialization. * More migrations to sysfs: - Add a 'transport' attribute to our astribank devices which points to the usb device we use. E.g: /sys/bus/astribanks/devices/xbus-00/transport is symlinked to ../../../../../../devices/pci0000:00/0000:00:10.4/usb5/5-4 - Move /proc/xpp/XBUS-??/XPD-??/span to /sys/bus/xpds/devices/??:?:?/span - Migrate from /proc/xpp/sync to: /sys/bus/astribanks/drivers/xppdrv/sync * PRI: change the "timing" priority to match the convention used by other PRI cards -- I.e: lower numbers (not 0) have higher priority. * FXO: - Power denial: create two module parameters instead of hard-coded constants (power_denial_safezone, power_denial_minlen). For sites that get non-standard power-denial signals from central office on offhook. - Don't hangup on power-denial, just notify Dahdi and wait for - Fix caller-id detection for the case central office sends it before first ring without any indication before. Asterisk's desicion. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5663 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-27xpp: remove an unused manual reference count field.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5132 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-27xpp: Make some definitions static, as per sparse.Tzafrir Cohen
Fixes the xpp warnings of #13763 (except some false alarms). git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5131 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-10-16xpp: start migration from procfs to sysfs.Tzafrir Cohen
* Sysfs representation for XPDs: /sys/bus/xpds/devices/<bus>:<unit>:<subunit> * Astribanks sysfs directories now include the XPDs as subdirectories: e.g. /sys/bus/astribanks/devices/xbus-00/00:3:0 * procfs control interface deprecated: conditioned by OLD_PROC (defaults to off). Control functionality moved to sysfs: * xbus attributes: cls connector label status timing waitfor_xpds xbus_state * XPDs can have driver-specific attributes. Common attriubtes: blink chipregs span * PRI-specific attributes: pri_clocking pri_dchan pri_cas pri_alarms pri_layer1 pri_localloop pri_protocol * The Astribank attribute "xbus_state" is read/write. Reading it shows the current state of the Astribank. Writing "start" or "stop" allows a software equivalent of connect or disconnect respectively. * When an Astribank is ready it sends an "online" event. Whenever its not ready (e.g. at the time of disconnect) it sends an "offline" event. Use astribank_hook.sample to handle those. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5097 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-11xpp_blink is a bit mask of ports, and not boolean anymore.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4758 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-04Firmware update: 5959 (FTMF and BRI ID)Tzafrir Cohen
* Fix some cases of double digits. * Fix some rare cases of a BRI unit providing incorrect directionality. * Extra debugging code in card_fxs.c to trace future DTMF issues. * Properly note Zaptel (as opposed to DAHDI) ioctls. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4695 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Do use printk-s without a priority when continuing previous printk.Tzafrir Cohen
Also remove a small duplication in dahdi-base.c, as I'm too lazy to fix in two separate places. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4688 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Change all instances of printk in DAHDI to include a priorityRussell Bryant
(closes issue #11504) Reported by: tzafrir Patches: 20080717__issue11504_dahdi_printk_without_priority.diff uploaded by bbryant (license 36) git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4685 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Get rid of dahdi_rxsig_t typedefRussell Bryant
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4682 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-08-03Rework the table of signalling bits for signalling types and hook statesRussell Bryant
in dahdi_rbs_sethook() to a much more readable and less error prone format. In passing, get rid of the dahdi_txsig_t typedef, and fix uses of it throughout the tree. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4679 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-06Fix yet another surviving place with CONFIG_ZAPATA_BRI_DCHANS .Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4548 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-02Minor fixes following r4513:Tzafrir Cohen
* Convert card_bri as well. * memset each channel separately. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4517 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-02break up large memory allocations made by digital span drivers into smaller ↵Kevin P. Fleming
ones (one allocation for each dahdi_chan structure, separate from any private structures used by the driver) (closes issue #12657) Reported by: tzafrir git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4513 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-07-02Remove unneeded case for #ifdef DAHDI_SPANSTAT_V2 - Tzafrir Cohen
this is always the case for dahdi. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4509 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-06-25Removed some old, unused XPP code.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4457 a0bf4364-ded3-4de4-8d8a-66a801d63aff
2008-06-19Yet another zaptel->dahdi rename. XPP file names this time.Tzafrir Cohen
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4418 a0bf4364-ded3-4de4-8d8a-66a801d63aff