summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/pcbit
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-28 22:00:09 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-28 22:00:09 +0000
commit1a1d77dd589de5a567fa95e36aa6999c704ceca4 (patch)
tree141e31f89f18b9fe0831f31852e0435ceaccafc5 /drivers/isdn/pcbit
parentfb9c690a18b3d66925a65b17441c37fa14d4370b (diff)
Merge with 2.4.0-test7.
Diffstat (limited to 'drivers/isdn/pcbit')
-rw-r--r--drivers/isdn/pcbit/capi.c9
-rw-r--r--drivers/isdn/pcbit/drv.c10
-rw-r--r--drivers/isdn/pcbit/layer2.c28
-rw-r--r--drivers/isdn/pcbit/layer2.h37
-rw-r--r--drivers/isdn/pcbit/module.c6
5 files changed, 49 insertions, 41 deletions
diff --git a/drivers/isdn/pcbit/capi.c b/drivers/isdn/pcbit/capi.c
index ed681f375..1a32c0825 100644
--- a/drivers/isdn/pcbit/capi.c
+++ b/drivers/isdn/pcbit/capi.c
@@ -304,7 +304,14 @@ int capi_tdata_req(struct pcbit_chan* chan, struct sk_buff *skb)
data_len = skb->len;
- skb_push(skb, 10);
+ if(skb_headroom(skb) < 10)
+ {
+ printk(KERN_CRIT "No headspace (%u) on headroom %p for capi header\n", skb_headroom(skb), skb);
+ }
+ else
+ {
+ skb_push(skb, 10);
+ }
*((u16 *) (skb->data)) = chan->callref;
skb->data[2] = chan->layer2link;
diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c
index 3c21adb9f..cd58e0d3b 100644
--- a/drivers/isdn/pcbit/drv.c
+++ b/drivers/isdn/pcbit/drv.c
@@ -162,7 +162,7 @@ int pcbit_init_dev(int board, int mem_base, int irq)
dev->send_seq = 0;
dev->unack_seq = 0;
- dev->hl_hdrlen = 10;
+ dev->hl_hdrlen = 16;
dev_if = kmalloc(sizeof(isdn_if), GFP_KERNEL);
@@ -186,7 +186,7 @@ int pcbit_init_dev(int board, int mem_base, int irq)
ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L2_TRANS );
dev_if->writebuf_skb = pcbit_xmit;
- dev_if->hl_hdrlen = 10;
+ dev_if->hl_hdrlen = 16;
dev_if->maxbufsize = MAXBUFSIZE;
dev_if->command = pcbit_command;
@@ -518,9 +518,6 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
struct callb_data cbdata;
int complete, err;
isdn_ctrl ictl;
-#ifdef DEBUG
- struct msg_fmt * fmsg;
-#endif
switch(msg) {
@@ -734,9 +731,6 @@ void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg,
default:
printk(KERN_DEBUG "pcbit_l3_receive: unknown message %08lx\n",
msg);
- fmsg = (struct msg_fmt *) &msg;
- printk(KERN_DEBUG "cmd=%02x sub=%02x\n",
- fmsg->cmd, fmsg->scmd);
break;
#endif
}
diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c
index 36bd6f8aa..98daf7558 100644
--- a/drivers/isdn/pcbit/layer2.c
+++ b/drivers/isdn/pcbit/layer2.c
@@ -8,6 +8,11 @@
*/
/*
+ * 19991203 - Fernando Carvalho - takion@superbofh.org
+ * Hacked to compile with egcs and run with current version of isdn modules
+*/
+
+/*
* PCBIT-D low-layer interface
*/
@@ -205,7 +210,7 @@ pcbit_transmit(struct pcbit_dev *dev)
/* Type 0 frame */
- struct msg_fmt *msg;
+ ulong msg;
if (frame->skb)
totlen = FRAME_HDR_LEN + PREHDR_LEN + frame->skb->len;
@@ -214,7 +219,7 @@ pcbit_transmit(struct pcbit_dev *dev)
flen = MIN(totlen, free);
- msg = (struct msg_fmt *) &(frame->msg);
+ msg = frame->msg;
/*
* Board level 2 header
@@ -222,9 +227,9 @@ pcbit_transmit(struct pcbit_dev *dev)
pcbit_writew(dev, flen - FRAME_HDR_LEN);
- pcbit_writeb(dev, msg->cpu);
+ pcbit_writeb(dev, GET_MSG_CPU(msg));
- pcbit_writeb(dev, msg->proc);
+ pcbit_writeb(dev, GET_MSG_PROC(msg));
/* TH */
pcbit_writew(dev, frame->hdr_len + PREHDR_LEN);
@@ -244,8 +249,8 @@ pcbit_transmit(struct pcbit_dev *dev)
pcbit_writew(dev, 0);
/* C + S */
- pcbit_writeb(dev, msg->cmd);
- pcbit_writeb(dev, msg->scmd);
+ pcbit_writeb(dev, GET_MSG_CMD(msg));
+ pcbit_writeb(dev, GET_MSG_SCMD(msg));
/* NUM */
pcbit_writew(dev, frame->refnum);
@@ -312,8 +317,7 @@ void
pcbit_deliver(void *data)
{
struct frame_buf *frame;
- unsigned long flags;
- struct msg_fmt msg;
+ unsigned long flags, msg;
struct pcbit_dev *dev = (struct pcbit_dev *) data;
save_flags(flags);
@@ -323,10 +327,10 @@ pcbit_deliver(void *data)
dev->read_queue = frame->next;
restore_flags(flags);
- msg.cpu = 0;
- msg.proc = 0;
- msg.cmd = frame->skb->data[2];
- msg.scmd = frame->skb->data[3];
+ SET_MSG_CPU(msg, 0);
+ SET_MSG_PROC(msg, 0);
+ SET_MSG_CMD(msg, frame->skb->data[2]);
+ SET_MSG_SCMD(msg, frame->skb->data[3]);
frame->refnum = *((ushort *) frame->skb->data + 4);
frame->msg = *((ulong *) & msg);
diff --git a/drivers/isdn/pcbit/layer2.h b/drivers/isdn/pcbit/layer2.h
index 2f56a5844..f8984f990 100644
--- a/drivers/isdn/pcbit/layer2.h
+++ b/drivers/isdn/pcbit/layer2.h
@@ -7,6 +7,11 @@
* the GNU Public License, incorporated herein by reference.
*/
+/*
+ * 19991203 - Fernando Carvalho - takion@superbofh.org
+ * Hacked to compile with egcs and run with current version of isdn modules
+*/
+
/*
* PCBIT-D low-layer interface definitions
*/
@@ -84,21 +89,20 @@
Intel 1 2 3 4
*/
-struct msg_fmt {
-#ifdef __LITTLE_ENDIAN /* Little Endian */
- u_char scmd;
- u_char cmd;
- u_char proc;
- u_char cpu;
+#ifdef __LITTLE_ENDIAN
+#define SET_MSG_SCMD(msg, ch) (msg = (msg & 0xffffff00) | (((ch) & 0xff)))
+#define SET_MSG_CMD(msg, ch) (msg = (msg & 0xffff00ff) | (((ch) & 0xff) << 8))
+#define SET_MSG_PROC(msg, ch) (msg = (msg & 0xff00ffff) | (((ch) & 0xff) << 16))
+#define SET_MSG_CPU(msg, ch) (msg = (msg & 0x00ffffff) | (((ch) & 0xff) << 24))
+
+#define GET_MSG_SCMD(msg) ((msg) & 0xFF)
+#define GET_MSG_CMD(msg) ((msg) >> 8 & 0xFF)
+#define GET_MSG_PROC(msg) ((msg) >> 16 & 0xFF)
+#define GET_MSG_CPU(msg) ((msg) >> 24)
+
#else
#error "Non-Intel CPU"
- u_char cpu;
- u_char proc;
- u_char cmd;
- u_char scmd;
#endif
-};
-
#define MAX_QUEUED 7
@@ -107,14 +111,13 @@ struct msg_fmt {
#define SET_RUN_TIMEOUT 2*HZ /* 2 seconds */
-
struct frame_buf {
ulong msg;
- unsigned short refnum;
- unsigned short dt_len;
- unsigned short hdr_len;
+ unsigned int refnum;
+ unsigned int dt_len;
+ unsigned int hdr_len;
struct sk_buff *skb;
- unsigned short copied;
+ unsigned int copied;
struct frame_buf * next;
};
diff --git a/drivers/isdn/pcbit/module.c b/drivers/isdn/pcbit/module.c
index 9d3aa8007..c85f68688 100644
--- a/drivers/isdn/pcbit/module.c
+++ b/drivers/isdn/pcbit/module.c
@@ -46,8 +46,8 @@ int pcbit_init(void)
num_boards = 0;
- printk(KERN_INFO
- "PCBIT-D device driver v 0.5 - "
+ printk(KERN_NOTICE
+ "PCBIT-D device driver v 0.5-fjpc0 19991204 - "
"Copyright (C) 1996 Universidade de Lisboa\n");
if (mem[0] || irq[0])
@@ -97,7 +97,7 @@ void cleanup_module(void)
for (board = 0; board < num_boards; board++)
pcbit_terminate(board);
- printk(KERN_INFO
+ printk(KERN_NOTICE
"PCBIT-D module unloaded\n");
}