summaryrefslogtreecommitdiff
path: root/drivers/isdn/sc/event.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 02:20:36 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 02:20:36 +0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/isdn/sc/event.c
downloadlinux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.xz
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/isdn/sc/event.c')
-rw-r--r--drivers/isdn/sc/event.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/isdn/sc/event.c b/drivers/isdn/sc/event.c
new file mode 100644
index 000000000000..5b8c7c1a7663
--- /dev/null
+++ b/drivers/isdn/sc/event.c
@@ -0,0 +1,69 @@
+/* $Id: event.c,v 1.4.8.1 2001/09/23 22:24:59 kai Exp $
+ *
+ * Copyright (C) 1996 SpellCaster Telecommunications Inc.
+ *
+ * This software may be used and distributed according to the terms
+ * of the GNU General Public License, incorporated herein by reference.
+ *
+ * For more information, please contact gpl-info@spellcast.com or write:
+ *
+ * SpellCaster Telecommunications Inc.
+ * 5621 Finch Avenue East, Unit #3
+ * Scarborough, Ontario Canada
+ * M1B 2T9
+ * +1 (416) 297-8565
+ * +1 (416) 297-6433 Facsimile
+ */
+
+#include "includes.h"
+#include "hardware.h"
+#include "message.h"
+#include "card.h"
+
+extern int cinst;
+extern board *sc_adapter[];
+
+#ifdef DEBUG
+static char *events[] = { "ISDN_STAT_STAVAIL",
+ "ISDN_STAT_ICALL",
+ "ISDN_STAT_RUN",
+ "ISDN_STAT_STOP",
+ "ISDN_STAT_DCONN",
+ "ISDN_STAT_BCONN",
+ "ISDN_STAT_DHUP",
+ "ISDN_STAT_BHUP",
+ "ISDN_STAT_CINF",
+ "ISDN_STAT_LOAD",
+ "ISDN_STAT_UNLOAD",
+ "ISDN_STAT_BSENT",
+ "ISDN_STAT_NODCH",
+ "ISDN_STAT_ADDCH",
+ "ISDN_STAT_CAUSE" };
+#endif
+
+int indicate_status(int card, int event,ulong Channel,char *Data)
+{
+ isdn_ctrl cmd;
+
+ pr_debug("%s: Indicating event %s on Channel %d\n",
+ sc_adapter[card]->devicename, events[event-256], Channel);
+ if (Data != NULL){
+ pr_debug("%s: Event data: %s\n", sc_adapter[card]->devicename,
+ Data);
+ switch (event) {
+ case ISDN_STAT_BSENT:
+ memcpy(&cmd.parm.length, Data, sizeof(cmd.parm.length));
+ break;
+ case ISDN_STAT_ICALL:
+ memcpy(&cmd.parm.setup, Data, sizeof(cmd.parm.setup));
+ break;
+ default:
+ strcpy(cmd.parm.num, Data);
+ }
+ }
+
+ cmd.command = event;
+ cmd.driver = sc_adapter[card]->driverId;
+ cmd.arg = Channel;
+ return sc_adapter[card]->card->statcallb(&cmd);
+}