summaryrefslogtreecommitdiffstats
path: root/main/dahdi-linux-grsec/dahdi-bri_dchan.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/dahdi-linux-grsec/dahdi-bri_dchan.patch')
-rw-r--r--main/dahdi-linux-grsec/dahdi-bri_dchan.patch70
1 files changed, 38 insertions, 32 deletions
diff --git a/main/dahdi-linux-grsec/dahdi-bri_dchan.patch b/main/dahdi-linux-grsec/dahdi-bri_dchan.patch
index d7a3fe859..8d2ba97fd 100644
--- a/main/dahdi-linux-grsec/dahdi-bri_dchan.patch
+++ b/main/dahdi-linux-grsec/dahdi-bri_dchan.patch
@@ -3,11 +3,13 @@
# Zaptel expects it as a standard channel with 1000 samples
# per second.
---- a/include/dahdi/kernel.h
-+++ b/include/dahdi/kernel.h
-@@ -132,6 +132,13 @@ struct dahdi_chan {
- int do_ppp_error;
- struct sk_buff_head ppp_rq;
+Index: dahdi-linux-2.5.0/include/dahdi/kernel.h
+===================================================================
+--- dahdi-linux-2.5.0.orig/include/dahdi/kernel.h 2011-06-29 18:32:40.000000000 +0300
++++ dahdi-linux-2.5.0/include/dahdi/kernel.h 2011-08-15 14:14:26.000000000 +0300
+@@ -413,6 +413,13 @@
+ int statcount;
+ int lastnumbufs;
#endif
+#ifdef CONFIG_DAHDI_BRI_DCHANS
+ int bytes2receive;
@@ -19,29 +21,31 @@
spinlock_t lock;
char name[40];
/* Specified by DAHDI */
-@@ -462,6 +469,9 @@ enum {
- DAHDI_FLAGBIT_LOOPED = 18, /*!< Loopback the receive data from the channel to the transmit */
- DAHDI_FLAGBIT_MTP2 = 19, /*!< Repeats last message in buffer and also discards repeating messages sent to us */
- DAHDI_FLAGBIT_HDLC56 = 20, /*!< Sets the given channel (if in HDLC mode) to use 56K HDLC instead of 64K */
+@@ -723,6 +730,9 @@
+ DAHDI_FLAGBIT_TXUNDERRUN = 22, /*!< Transmit underrun condition */
+ DAHDI_FLAGBIT_RXOVERRUN = 23, /*!< Receive overrun condition */
+ DAHDI_FLAGBIT_DEVFILE = 25, /*!< Channel has a sysfs dev file */
+#if defined(CONFIG_DAHDI_BRI_DCHANS)
-+ DAHDI_FLAGBIT_BRIDCHAN = 21, /*!< hardhdlc-like handling of the D channel */
++ DAHDI_FLAGBIT_BRIDCHAN = 26, /*!< hardhdlc-like handling of the D channel */
+#endif
};
- /* map flagbits to flag masks */
-@@ -500,6 +510,7 @@ enum {
- #define DAHDI_FLAG_LOOPED DAHDI_FLAG(LOOPED)
- #define DAHDI_FLAG_MTP2 DAHDI_FLAG(MTP2)
- #define DAHDI_FLAG_HDLC56 DAHDI_FLAG(HDLC56)
+ #ifdef CONFIG_DAHDI_NET
+@@ -789,6 +799,7 @@
+ #define DAHDI_FLAG_BUFEVENTS DAHDI_FLAG(BUFEVENTS)
+ #define DAHDI_FLAG_TXUNDERRUN DAHDI_FLAG(TXUNDERRUN)
+ #define DAHDI_FLAG_RXOVERRUN DAHDI_FLAG(RXOVERRUN)
+#define DAHDI_FLAG_BRIDCHAN DAHDI_FLAG(BRIDCHAN)
- struct dahdi_span {
- spinlock_t lock;
---- a/include/dahdi/dahdi_config.h
-+++ b/include/dahdi/dahdi_config.h
-@@ -174,4 +174,10 @@
+ struct file;
+
+Index: dahdi-linux-2.5.0/include/dahdi/dahdi_config.h
+===================================================================
+--- dahdi-linux-2.5.0.orig/include/dahdi/dahdi_config.h 2011-01-05 17:52:03.000000000 +0200
++++ dahdi-linux-2.5.0/include/dahdi/dahdi_config.h 2011-08-15 14:13:01.000000000 +0300
+@@ -195,4 +195,10 @@
*/
- /* #define OPTIMIZE_CHANMUTE */
+ /* #define CONFIG_DAHDI_MIRROR */
+/*
+ * Uncomment the following for BRI D channels
@@ -50,9 +54,11 @@
+#define CONFIG_DAHDI_BRI_DCHANS
+
#endif
---- a/drivers/dahdi/dahdi-base.c
-+++ b/drivers/dahdi/dahdi-base.c
-@@ -5907,11 +5907,40 @@ static inline void __dahdi_getbuf_chunk(
+Index: dahdi-linux-2.5.0/drivers/dahdi/dahdi-base.c
+===================================================================
+--- dahdi-linux-2.5.0.orig/drivers/dahdi/dahdi-base.c 2011-07-21 19:26:31.000000000 +0300
++++ dahdi-linux-2.5.0/drivers/dahdi/dahdi-base.c 2011-08-15 14:13:01.000000000 +0300
+@@ -7224,11 +7224,40 @@
*(txb++) = fasthdlc_tx_run_nocheck(&ms->txhdlc);
}
bytes -= left;
@@ -93,7 +99,7 @@
}
/* Check buffer status */
if (ms->writeidx[ms->outwritebuf] >= ms->writen[ms->outwritebuf]) {
-@@ -5968,6 +5997,17 @@ out in the later versions, and is put ba
+@@ -7285,6 +7314,17 @@
/* Transmit a flag if this is an HDLC channel */
if (ms->flags & DAHDI_FLAG_HDLC)
fasthdlc_tx_frame_nocheck(&ms->txhdlc);
@@ -109,11 +115,11 @@
+ }
+#endif
#ifdef CONFIG_DAHDI_NET
- if (ms->flags & DAHDI_FLAG_NETDEV)
- netif_wake_queue(ztchan_to_dev(ms));
-@@ -6028,6 +6068,12 @@ out in the later versions, and is put ba
- memset(txb, 0xFF, bytes);
+ if (dahdi_have_netdev(ms))
+ netif_wake_queue(chan_to_netdev(ms));
+@@ -7346,6 +7386,12 @@
}
+ needtxunderrun += bytes;
bytes = 0;
+#if defined(CONFIG_DAHDI_BRI_DCHANS)
+ } else if (test_bit(DAHDI_FLAGBIT_BRIDCHAN, &ms->flags)) {
@@ -123,8 +129,8 @@
+#endif
} else {
memset(txb, DAHDI_LIN2X(0, ms), bytes); /* Lastly we use silence on telephony channels */
- bytes = 0;
-@@ -6840,6 +6886,14 @@ static inline void __putbuf_chunk(struct
+ needtxunderrun += bytes;
+@@ -8267,6 +8313,14 @@
int res;
int left, x;
@@ -139,7 +145,7 @@
while(bytes) {
#if defined(CONFIG_DAHDI_NET) || defined(CONFIG_DAHDI_PPP)
skb = NULL;
-@@ -6897,6 +6951,19 @@ static inline void __putbuf_chunk(struct
+@@ -8324,6 +8378,19 @@
}
}
}