summaryrefslogtreecommitdiff
path: root/drivers/dahdi/xpp/xproto.c
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-01-30 14:11:49 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2011-01-30 14:11:49 +0000
commit486c84923571900ad0f99f9db04b6dad3bdcb998 (patch)
tree97f044c12a12a4d36b363ec8a5e7c655f36e4520 /drivers/dahdi/xpp/xproto.c
parentcb9ca13edc842637833463569d37a13c22a931d4 (diff)
xpp: prepare for phonedev refactor
* 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
Diffstat (limited to 'drivers/dahdi/xpp/xproto.c')
-rw-r--r--drivers/dahdi/xpp/xproto.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/dahdi/xpp/xproto.c b/drivers/dahdi/xpp/xproto.c
index 4ae64f9..afc6be5 100644
--- a/drivers/dahdi/xpp/xproto.c
+++ b/drivers/dahdi/xpp/xproto.c
@@ -414,7 +414,7 @@ const char *xproto_name(xpd_type_t xpd_type)
return proto_table->name;
}
-#define CHECK_XOP(f) \
+#define CHECK_XOP(xops, f) \
if(!(xops)->f) { \
ERR("%s: missing xmethod %s [%s (%d)]\n", __FUNCTION__, #f, name, type); \
return -EINVAL; \
@@ -422,9 +422,9 @@ const char *xproto_name(xpd_type_t xpd_type)
int xproto_register(const xproto_table_t *proto_table)
{
- int type;
- const char *name;
- const xops_t *xops;
+ int type;
+ const char *name;
+ const struct xops *xops;
BUG_ON(!proto_table);
type = proto_table->type;
@@ -436,11 +436,13 @@ int xproto_register(const xproto_table_t *proto_table)
DBG(GENERAL, "%s (%d)\n", name, type);
if(xprotocol_tables[type])
NOTICE("%s: overriding registration of %s (%d)\n", __FUNCTION__, name, type);
- xops = &proto_table->xops;
- CHECK_XOP(card_new);
- CHECK_XOP(card_init);
- CHECK_XOP(card_remove);
- CHECK_XOP(card_tick);
+ xops = proto_table->xops;
+ CHECK_XOP(xops, card_new);
+ CHECK_XOP(xops, card_init);
+ CHECK_XOP(xops, card_remove);
+ CHECK_XOP(xops, card_tick);
+#if 0
+ /* FIXME: check PHONE_METHOD() */
CHECK_XOP(card_pcm_recompute);
CHECK_XOP(card_pcm_fromspan);
CHECK_XOP(card_pcm_tospan);
@@ -449,6 +451,7 @@ int xproto_register(const xproto_table_t *proto_table)
// CHECK_XOP(card_ioctl); // optional method -- call after testing
CHECK_XOP(card_register_reply);
CHECK_XOP(XPD_STATE);
+#endif
xprotocol_tables[type] = proto_table;
return 0;