]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
mISDN: Add E-Channel logging features
authorMartin Bachem <m.bachem@gmx.de>
Wed, 3 Sep 2008 13:17:45 +0000 (15:17 +0200)
committerKarsten Keil <kkeil@suse.de>
Fri, 9 Jan 2009 21:44:25 +0000 (22:44 +0100)
New prim PH_DATA_E_IND.

 - all E-ch frames are indicated by recv_Echannel(), which pushes E-Channel
   frames into dch's rqueue
 - if dchannel is opened with channel nr 0, no E-Channel logging
   is requested
 - if dchannel is opened with channel nr 1, E-Channel logging
   is requested. if layer1 does not support that, -EINVAL
   in return is appropriate

Signed-off-by: Martin Bachem <m.bachem@gmx.de>
Signed-off-by: Karsten Keil <kkeil@suse.de>
drivers/isdn/mISDN/hwchannel.c
drivers/isdn/mISDN/stack.c
include/linux/mISDNhw.h
include/linux/mISDNif.h

index 535ceacc05b9300f9096e2fd82ebf2ab004e992d..ab1168a110ae96104c7db2ea8ea12ae214d83fe1 100644 (file)
@@ -165,6 +165,25 @@ recv_Dchannel(struct dchannel *dch)
 }
 EXPORT_SYMBOL(recv_Dchannel);
 
+void
+recv_Echannel(struct dchannel *ech, struct dchannel *dch)
+{
+       struct mISDNhead *hh;
+
+       if (ech->rx_skb->len < 2) { /* at least 2 for sapi / tei */
+               dev_kfree_skb(ech->rx_skb);
+               ech->rx_skb = NULL;
+               return;
+       }
+       hh = mISDN_HEAD_P(ech->rx_skb);
+       hh->prim = PH_DATA_E_IND;
+       hh->id = get_sapi_tei(ech->rx_skb->data);
+       skb_queue_tail(&dch->rqueue, ech->rx_skb);
+       ech->rx_skb = NULL;
+       schedule_event(dch, FLG_RECVQUEUE);
+}
+EXPORT_SYMBOL(recv_Echannel);
+
 void
 recv_Bchannel(struct bchannel *bch)
 {
index 9b9fab47cb2b688cb716ecf675ee5d69d09d006e..8cff570bb8df58bf2a8f929a5ea900a06c009789 100644 (file)
@@ -453,7 +453,7 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch,
                ch->peer = &dev->D.st->own;
                ch->st = dev->D.st;
                rq.protocol = protocol;
-               rq.adr.channel = 0;
+               rq.adr.channel = adr->channel;
                err = dev->D.ctrl(&dev->D, OPEN_CHANNEL, &rq);
                printk(KERN_DEBUG "%s: ret 1 %d\n", __func__, err);
                if (err)
index 9384b92dfc65eb176312b081d8af927052716aea..97ffdc1d344245c99085fbc2d1007188a50091b0 100644 (file)
@@ -184,6 +184,7 @@ extern void queue_ch_frame(struct mISDNchannel *, u_int,
 extern int     dchannel_senddata(struct dchannel *, struct sk_buff *);
 extern int     bchannel_senddata(struct bchannel *, struct sk_buff *);
 extern void    recv_Dchannel(struct dchannel *);
+extern void    recv_Echannel(struct dchannel *, struct dchannel *);
 extern void    recv_Bchannel(struct bchannel *);
 extern void    recv_Dchannel_skb(struct dchannel *, struct sk_buff *);
 extern void    recv_Bchannel_skb(struct bchannel *, struct sk_buff *);
index a59febb6143a8fdcc1acf6f72a538c3f6a0bf812..f75d596c5316232d1641a90df33008408d0c1063 100644 (file)
@@ -80,6 +80,7 @@
 #define PH_DEACTIVATE_IND      0x0202
 #define PH_DEACTIVATE_CNF      0x4202
 #define PH_DATA_IND            0x2002
+#define PH_DATA_E_IND          0x3002
 #define MPH_ACTIVATE_IND       0x0502
 #define MPH_DEACTIVATE_IND     0x0602
 #define MPH_INFORMATION_IND    0x0702