Changed and added debug stuff.
Better data sending. (still problems with tty's flip buffer)
This commit is contained in:
parent
0e93112b81
commit
298105698f
|
@ -21,6 +21,10 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/01/10 18:46:04 armin
|
||||
* Bug with wrong values in HLC fixed.
|
||||
* Bytes to send are counted and limited now.
|
||||
*
|
||||
* Revision 1.1 1999/01/01 18:09:41 armin
|
||||
* First checkin of new eicon driver.
|
||||
* DIVA-Server BRI/PCI and PRI/PCI are supported.
|
||||
|
@ -44,6 +48,7 @@
|
|||
|
||||
#define DIEHL_IOCTL_MANIF 90
|
||||
|
||||
#define DIEHL_IOCTL_FREEIT 97
|
||||
#define DIEHL_IOCTL_TEST 98
|
||||
#define DIEHL_IOCTL_DEBUGVAR 99
|
||||
|
||||
|
@ -65,6 +70,7 @@
|
|||
#define DIEHL_CTYPE_MASK 0x0f
|
||||
#define DIEHL_CTYPE_QUADRO_NR(n) (n<<4)
|
||||
|
||||
#define MAX_HEADER_LEN 10
|
||||
|
||||
/* Struct for adding new cards */
|
||||
typedef struct diehl_cdef {
|
||||
|
@ -174,7 +180,13 @@ typedef struct {
|
|||
#include <linux/isdnif.h>
|
||||
#include "eicon_isa.h"
|
||||
|
||||
#endif
|
||||
/* Macro for delay via schedule() */
|
||||
#define SLEEP(j) { \
|
||||
current->state = TASK_INTERRUPTIBLE; \
|
||||
schedule_timeout(j); \
|
||||
}
|
||||
|
||||
#endif /* KERNEL */
|
||||
|
||||
|
||||
#define DSP_COMBIFILE_FORMAT_IDENTIFICATION_SIZE 48
|
||||
|
@ -308,6 +320,7 @@ typedef struct {
|
|||
unsigned short eazmask; /* EAZ-Mask for this Channel */
|
||||
unsigned int queued; /* User-Data Bytes in TX queue */
|
||||
unsigned int waitq; /* User-Data Bytes in wait queue */
|
||||
unsigned int waitpq; /* User-Data Bytes in packet queue */
|
||||
unsigned short plci;
|
||||
unsigned short ncci;
|
||||
unsigned char l2prot; /* Layer 2 protocol */
|
||||
|
@ -352,7 +365,7 @@ typedef struct {
|
|||
#define DIEHL_STATE_ICALLW 14
|
||||
#define DIEHL_STATE_LISTEN 15
|
||||
|
||||
#define DIEHL_MAX_QUEUED 8000 /* 2 * maxbuff */
|
||||
#define EICON_MAX_QUEUED 8000 /* 2 * maxbuff */
|
||||
|
||||
#define DIEHL_LOCK_TX 0
|
||||
#define DIEHL_LOCK_RX 1
|
||||
|
@ -453,6 +466,7 @@ extern __inline__ void diehl_schedule_ack(diehl_card *card)
|
|||
|
||||
extern char *diehl_find_eaz(diehl_card *, char);
|
||||
extern int diehl_addcard(int, int, int, char *);
|
||||
extern ulong DebugVar;
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,6 +21,11 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 1999/01/01 18:09:42 armin
|
||||
* First checkin of new eicon driver.
|
||||
* DIVA-Server BRI/PCI and PRI/PCI are supported.
|
||||
* Old diehl code is obsolete.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -55,6 +60,7 @@
|
|||
#define FAC_REG_ACK 19 /* fac registration acknowledge */
|
||||
#define FAC_REG_REJ 20 /* fac registration reject */
|
||||
#define CALL_COMPLETE 21/* send a CALL_PROC for incoming call */
|
||||
#define AOC_IND 26/* Advice of Charge */
|
||||
|
||||
#define IDI_N_MDATA (0x01)
|
||||
#define IDI_N_CONNECT (0x02)
|
||||
|
@ -89,8 +95,8 @@
|
|||
#define LLI 0x19 /* logical link id */
|
||||
#define CHA 0x1a /* charge advice */
|
||||
#define FTY 0x1c
|
||||
#define PI 0x1e
|
||||
#define NI 0x27
|
||||
#define PI 0x1e /* Progress Indicator */
|
||||
#define NI 0x27 /* Notification Indicator */
|
||||
#define DT 0x29 /* ETSI date/time */
|
||||
#define KEY 0x2c /* keypad information element */
|
||||
#define DSP 0x28 /* display */
|
||||
|
@ -98,6 +104,7 @@
|
|||
#define OSA 0x6d /* origination sub-address */
|
||||
#define CPN 0x70 /* called party number */
|
||||
#define DSA 0x71 /* destination sub-address */
|
||||
#define RDN 0x74 /* redirecting number */
|
||||
#define LLC 0x7c /* low layer compatibility */
|
||||
#define HLC 0x7d /* high layer compatibility */
|
||||
#define UUI 0x7e /* user user information */
|
||||
|
@ -132,6 +139,8 @@
|
|||
#define TIMER_INT 0xfe /* timer interrupt */
|
||||
#define OK 0xff /* command accepted */
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
|
||||
typedef struct {
|
||||
char cpn[32];
|
||||
char oad[32];
|
||||
|
@ -142,14 +151,17 @@ typedef struct {
|
|||
__u8 sin[4];
|
||||
__u8 chi[4];
|
||||
__u8 e_chi[4];
|
||||
__u8 bc[32];
|
||||
__u8 e_bc[8];
|
||||
__u8 llc[5];
|
||||
__u8 bc[12];
|
||||
__u8 e_bc[12];
|
||||
__u8 llc[18];
|
||||
__u8 hlc[5];
|
||||
__u8 cau[4];
|
||||
__u8 e_cau[2];
|
||||
__u8 e_mt;
|
||||
char dt[32];
|
||||
__u8 dt[6];
|
||||
char display[83];
|
||||
char keypad[35];
|
||||
char rdn[32];
|
||||
} idi_ind_message;
|
||||
|
||||
extern int idi_do_req(diehl_card *card, diehl_chan *chan, int cmd, int layer);
|
||||
|
|
|
@ -21,22 +21,17 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 1999/01/01 18:09:43 armin
|
||||
* First checkin of new eicon driver.
|
||||
* DIVA-Server BRI/PCI and PRI/PCI are supported.
|
||||
* Old diehl code is obsolete.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "eicon.h"
|
||||
#include "eicon_isa.h"
|
||||
|
||||
/* Macro for delay via schedule() */
|
||||
#define SLEEP(j) { \
|
||||
current->state = TASK_INTERRUPTIBLE; \
|
||||
schedule_timeout(j); \
|
||||
}
|
||||
|
||||
/* Hopefully, a separate resource-registration-scheme for shared-memory
|
||||
* will be introduced into the kernel. Until then, we use the normal
|
||||
* routines, designed for port-registration.
|
||||
*/
|
||||
#define check_shmem check_region
|
||||
#define release_shmem release_region
|
||||
#define request_shmem request_region
|
||||
|
@ -101,7 +96,7 @@ diehl_isa_irq(int irq, void *dev_id, struct pt_regs *regs) {
|
|||
}
|
||||
if ((tmp = readb(&com->Rc)) != 0) {
|
||||
diehl_ack *ack;
|
||||
|
||||
if (DebugVar & 64)
|
||||
printk("diehl_int: Rc=%d\n", tmp);
|
||||
skb = alloc_skb(sizeof(diehl_ack), GFP_ATOMIC);
|
||||
ack = (diehl_ack *)skb_put(skb, sizeof(diehl_ack));
|
||||
|
@ -118,6 +113,7 @@ diehl_isa_irq(int irq, void *dev_id, struct pt_regs *regs) {
|
|||
int len = readw(&com->RBuffer.len);
|
||||
diehl_indhdr *ind;
|
||||
|
||||
if (DebugVar & 16)
|
||||
printk(KERN_DEBUG "eicon_ind Ind=%d\n", tmp);
|
||||
skb = alloc_skb(len+sizeof(diehl_indhdr), GFP_ATOMIC);
|
||||
skb_reserve(skb, sizeof(diehl_indhdr));
|
||||
|
@ -200,6 +196,7 @@ diehl_isa_transmit(diehl_isa_card *card) {
|
|||
reqbuf = (diehl_req *)skb->data;
|
||||
skb_pull(skb, sizeof(diehl_req));
|
||||
if (skb->len > 269) {
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING "eicon_isa_transmit: skb > 269 bytes!!!\n");
|
||||
writeb(0, &com->XLock);
|
||||
return;
|
||||
|
|
|
@ -26,6 +26,11 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 1999/01/01 18:09:44 armin
|
||||
* First checkin of new eicon driver.
|
||||
* DIVA-Server BRI/PCI and PRI/PCI are supported.
|
||||
* Old diehl code is obsolete.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -42,6 +47,12 @@ extern char *diehl_pci_revision;
|
|||
extern char *diehl_isa_revision;
|
||||
extern char *diehl_idi_revision;
|
||||
|
||||
#ifdef MODULE
|
||||
#define MOD_USE_COUNT (GET_USE_COUNT (&__this_module))
|
||||
#endif
|
||||
|
||||
ulong DebugVar;
|
||||
|
||||
/* Parameters to be set by insmod */
|
||||
static int type = -1;
|
||||
static int membase = -1;
|
||||
|
@ -49,7 +60,7 @@ static int irq = -1;
|
|||
static char *id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
|
||||
MODULE_DESCRIPTION( "Driver for Eicon.Diehl active ISDN cards");
|
||||
MODULE_AUTHOR( "Armin Schindler / Fritz Elfert");
|
||||
MODULE_AUTHOR( "Armin Schindler");
|
||||
MODULE_SUPPORTED_DEVICE( "ISDN subsystem");
|
||||
MODULE_PARM_DESC(type, "Type of first card");
|
||||
MODULE_PARM_DESC(membase, "Base address, if ISA card");
|
||||
|
@ -92,6 +103,7 @@ find_channel(diehl_card *card, int channel)
|
|||
{
|
||||
if ((channel >= 0) && (channel < card->nchannels))
|
||||
return &(card->bch[channel]);
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING "eicon: Invalid channel %d\n", channel);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -192,6 +204,7 @@ diehl_set_msn(diehl_card *card, char *eazmsn)
|
|||
card->msn_list = p->next;
|
||||
restore_flags(flags);
|
||||
kfree(p);
|
||||
if (DebugVar & 8)
|
||||
printk(KERN_DEBUG
|
||||
"Mapping for EAZ %c deleted\n",
|
||||
eazmsn[0]);
|
||||
|
@ -210,6 +223,7 @@ diehl_set_msn(diehl_card *card, char *eazmsn)
|
|||
cli();
|
||||
strcpy(p->msn, &eazmsn[1]);
|
||||
restore_flags(flags);
|
||||
if (DebugVar & 8)
|
||||
printk(KERN_DEBUG
|
||||
"Mapping for EAZ %c changed to %s\n",
|
||||
eazmsn[0],
|
||||
|
@ -229,6 +243,7 @@ diehl_set_msn(diehl_card *card, char *eazmsn)
|
|||
cli();
|
||||
card->msn_list = p;
|
||||
restore_flags(flags);
|
||||
if (DebugVar & 8)
|
||||
printk(KERN_DEBUG
|
||||
"Mapping %c -> %s added\n",
|
||||
eazmsn[0],
|
||||
|
@ -250,6 +265,7 @@ diehl_rcv_dispatch(struct diehl_card *card)
|
|||
#endif
|
||||
case DIEHL_BUS_MCA:
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon_ack_dispatch: Illegal bustype %d\n", card->bus);
|
||||
}
|
||||
|
@ -268,6 +284,7 @@ diehl_ack_dispatch(struct diehl_card *card)
|
|||
#endif
|
||||
case DIEHL_BUS_MCA:
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon_ack_dispatch: Illegal bustype %d\n", card->bus);
|
||||
}
|
||||
|
@ -287,29 +304,12 @@ diehl_transmit(struct diehl_card *card)
|
|||
#endif
|
||||
case DIEHL_BUS_MCA:
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon_transmit: Illegal bustype %d\n", card->bus);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
diehl_receive(struct diehl_card *card)
|
||||
{
|
||||
switch (card->bus) {
|
||||
case DIEHL_BUS_ISA:
|
||||
break;
|
||||
case DIEHL_BUS_PCI:
|
||||
#if CONFIG_PCI
|
||||
#endif
|
||||
case DIEHL_BUS_MCA:
|
||||
default:
|
||||
printk(KERN_WARNING
|
||||
"eicon_receive: Illegal bustype %d\n", card->bus);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
diehl_command(diehl_card * card, isdn_ctrl * c)
|
||||
{
|
||||
|
@ -336,6 +336,7 @@ diehl_command(diehl_card * card, isdn_ctrl * c)
|
|||
return card->hwif.pci.irq;
|
||||
#endif
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon: Illegal BUS type %d\n",
|
||||
card->bus);
|
||||
|
@ -349,6 +350,7 @@ diehl_command(diehl_card * card, isdn_ctrl * c)
|
|||
card->hwif.isa.irq = a;
|
||||
return 0;
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon: Illegal BUS type %d\n",
|
||||
card->bus);
|
||||
|
@ -364,6 +366,7 @@ diehl_command(diehl_card * card, isdn_ctrl * c)
|
|||
card->flags |= DIEHL_FLAGS_LOADED;
|
||||
break;
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon: Illegal BUS type %d\n",
|
||||
card->bus);
|
||||
|
@ -423,6 +426,16 @@ diehl_command(diehl_card * card, isdn_ctrl * c)
|
|||
if (diehl_addcard(cdef.type, cdef.membase, cdef.irq, cdef.id))
|
||||
return -EIO;
|
||||
return 0;
|
||||
case DIEHL_IOCTL_DEBUGVAR:
|
||||
DebugVar = a;
|
||||
printk(KERN_DEBUG"eicon: Debug Value set to %ld\n", DebugVar);
|
||||
return 0;
|
||||
#ifdef MODULE
|
||||
case DIEHL_IOCTL_FREEIT:
|
||||
while (MOD_USE_COUNT > 0) MOD_DEC_USE_COUNT;
|
||||
MOD_INC_USE_COUNT;
|
||||
return 0;
|
||||
#endif
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -436,8 +449,9 @@ diehl_command(diehl_card * card, isdn_ctrl * c)
|
|||
cli();
|
||||
if ((chan->fsm_state != DIEHL_STATE_NULL) && (chan->fsm_state != DIEHL_STATE_LISTEN)) {
|
||||
restore_flags(flags);
|
||||
printk(KERN_WARNING "Dial on channel with state %d\n",
|
||||
chan->fsm_state);
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING "Dial on channel %d with state %d\n",
|
||||
chan->No, chan->fsm_state);
|
||||
return -EBUSY;
|
||||
}
|
||||
if (card->ptype == ISDN_PTYPE_EURO)
|
||||
|
@ -524,6 +538,7 @@ diehl_command(diehl_card * card, isdn_ctrl * c)
|
|||
if (!card->flags & DIEHL_FLAGS_RUNNING)
|
||||
return -ENODEV;
|
||||
if ((c->arg >> 8) != ISDN_PROTO_L3_TRANS) {
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING "L3 protocol unknown\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -540,16 +555,19 @@ diehl_command(diehl_card * card, isdn_ctrl * c)
|
|||
case ISDN_CMD_GETEAZ:
|
||||
if (!card->flags & DIEHL_FLAGS_RUNNING)
|
||||
return -ENODEV;
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_DEBUG "eicon CMD_GETEAZ not implemented\n");
|
||||
return 0;
|
||||
case ISDN_CMD_SETSIL:
|
||||
if (!card->flags & DIEHL_FLAGS_RUNNING)
|
||||
return -ENODEV;
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_DEBUG "eicon CMD_SETSIL not implemented\n");
|
||||
return 0;
|
||||
case ISDN_CMD_GETSIL:
|
||||
if (!card->flags & DIEHL_FLAGS_RUNNING)
|
||||
return -ENODEV;
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_DEBUG "eicon CMD_GETSIL not implemented\n");
|
||||
return 0;
|
||||
case ISDN_CMD_LOCK:
|
||||
|
@ -760,7 +778,8 @@ diehl_alloccard(int type, int membase, int irq, char *id)
|
|||
card->interface.features |=
|
||||
ISDN_FEATURE_L2_V11096 |
|
||||
ISDN_FEATURE_L2_V11019 |
|
||||
ISDN_FEATURE_L2_V11038;
|
||||
ISDN_FEATURE_L2_V11038 |
|
||||
ISDN_FEATURE_L2_MODEM;
|
||||
card->hwif.pci.card = (void *)card;
|
||||
card->hwif.pci.PCIreg = pcic->PCIreg;
|
||||
card->hwif.pci.PCIcfg = pcic->PCIcfg;
|
||||
|
@ -779,7 +798,8 @@ diehl_alloccard(int type, int membase, int irq, char *id)
|
|||
card->interface.features |=
|
||||
ISDN_FEATURE_L2_V11096 |
|
||||
ISDN_FEATURE_L2_V11019 |
|
||||
ISDN_FEATURE_L2_V11038;
|
||||
ISDN_FEATURE_L2_V11038 |
|
||||
ISDN_FEATURE_L2_MODEM;
|
||||
card->hwif.pci.card = (void *)card;
|
||||
card->hwif.pci.shmem = (diehl_pci_shmem *)pcic->shmem;
|
||||
card->hwif.pci.PCIreg = pcic->PCIreg;
|
||||
|
@ -842,6 +862,7 @@ diehl_registercard(diehl_card * card)
|
|||
#endif
|
||||
case DIEHL_BUS_MCA:
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon_registercard: Illegal BUS type %d\n",
|
||||
card->bus);
|
||||
|
@ -858,6 +879,7 @@ diehl_registercard(diehl_card * card)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef MODULE
|
||||
static void
|
||||
unregister_card(diehl_card * card)
|
||||
{
|
||||
|
@ -877,12 +899,14 @@ unregister_card(diehl_card * card)
|
|||
#endif
|
||||
case DIEHL_BUS_MCA:
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon: Invalid BUS type %d\n",
|
||||
card->bus);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif /* MODULE */
|
||||
|
||||
static void
|
||||
diehl_freecard(diehl_card *card) {
|
||||
|
@ -924,6 +948,7 @@ diehl_addcard(int type, int membase, int irq, char *id)
|
|||
#endif
|
||||
case DIEHL_BUS_MCA:
|
||||
default:
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING
|
||||
"eicon: addcard: Invalid BUS type %d\n",
|
||||
p->bus);
|
||||
|
@ -958,15 +983,17 @@ diehl_addcard(int type, int membase, int irq, char *id)
|
|||
#define DRIVERNAME "Eicon active ISDN driver"
|
||||
|
||||
#ifdef MODULE
|
||||
#define diehl_init init_module
|
||||
#define eicon_init init_module
|
||||
#endif
|
||||
|
||||
int
|
||||
diehl_init(void)
|
||||
eicon_init(void)
|
||||
{
|
||||
int tmp = 0;
|
||||
char tmprev[50];
|
||||
|
||||
DebugVar = 1;
|
||||
|
||||
printk(KERN_INFO "%s Rev: ", DRIVERNAME);
|
||||
strcpy(tmprev, diehl_revision);
|
||||
printk("%s/", diehl_getrev(tmprev));
|
||||
|
@ -987,7 +1014,9 @@ diehl_init(void)
|
|||
else
|
||||
printk(KERN_INFO "eicon: %d card%s added\n", tmp, (tmp>1)?"s":"");
|
||||
/* No symbols to export, hide all symbols */
|
||||
|
||||
EXPORT_NO_SYMBOLS;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1012,9 +1041,9 @@ cleanup_module(void)
|
|||
|
||||
#else
|
||||
void
|
||||
diehl_setup(char *str, int *ints)
|
||||
eicon_setup(char *str, int *ints)
|
||||
{
|
||||
int i, j, argc, membase, irq, type;
|
||||
int i, argc, membase, irq, type;
|
||||
|
||||
argc = ints[0];
|
||||
i = 1;
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1999/01/10 18:46:06 armin
|
||||
* Bug with wrong values in HLC fixed.
|
||||
* Bytes to send are counted and limited now.
|
||||
*
|
||||
* Revision 1.1 1999/01/01 18:09:45 armin
|
||||
* First checkin of new eicon driver.
|
||||
* DIVA-Server BRI/PCI and PRI/PCI are supported.
|
||||
|
@ -39,28 +43,18 @@
|
|||
#include "eicon.h"
|
||||
#include "eicon_pci.h"
|
||||
|
||||
/* Macro for delay via schedule() */
|
||||
#define SLEEP(j) { \
|
||||
current->state = TASK_INTERRUPTIBLE; \
|
||||
schedule_timeout(j); \
|
||||
}
|
||||
|
||||
char *diehl_pci_revision = "$Revision$";
|
||||
|
||||
|
||||
#if CONFIG_PCI /* intire stuff is only for PCI */
|
||||
|
||||
|
||||
|
||||
#undef DIEHL_PCI_DEBUG /* if you want diehl_pci more verbose */
|
||||
#undef DIEHL_PCI_DEBUG
|
||||
|
||||
|
||||
int diehl_pci_find_card(char *ID)
|
||||
{
|
||||
|
||||
if (pci_present()) {
|
||||
struct pci_dev *pdev = NULL;
|
||||
|
||||
int pci_nextindex=0, pci_cards=0, pci_akt=0;
|
||||
int pci_type = PCI_MAESTRA;
|
||||
int NoMorePCICards = FALSE;
|
||||
|
@ -78,7 +72,10 @@ int diehl_pci_find_card(char *ID)
|
|||
for (pci_cards = 0; pci_cards < 0x0f; pci_cards++)
|
||||
{
|
||||
do {
|
||||
if ((pdev = pci_find_device(PCI_VENDOR_EICON, pci_type, pdev))) {
|
||||
if ((pdev = pci_find_device(PCI_VENDOR_EICON,
|
||||
pci_type,
|
||||
pdev)))
|
||||
{
|
||||
pci_nextindex++;
|
||||
break;
|
||||
}
|
||||
|
@ -121,6 +118,7 @@ int diehl_pci_find_card(char *ID)
|
|||
case PCI_MAESTRA:
|
||||
printk(KERN_INFO "eicon_pci: DIVA Server BRI/PCI detected !\n");
|
||||
aparms->type = DIEHL_CTYPE_MAESTRA;
|
||||
|
||||
aparms->irq = pdev->irq;
|
||||
preg = pdev->base_address[2] & 0xfffffffc;
|
||||
pcfg = pdev->base_address[1] & 0xffffff80;
|
||||
|
@ -355,6 +353,7 @@ diehl_pci_rcv_dispatch(diehl_pci_card *card) {
|
|||
diehl_chan *chan;
|
||||
|
||||
if (!card) {
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING "eicon_pci_rcv_dispatch: NULL card!\n");
|
||||
return;
|
||||
}
|
||||
|
@ -363,7 +362,8 @@ diehl_pci_rcv_dispatch(diehl_pci_card *card) {
|
|||
ind = (diehl_pci_IND *)skb->data;
|
||||
|
||||
if ((chan = card->IdTable[ind->IndId]) == NULL) {
|
||||
printk(KERN_ERR "eicon_pci: Indication for unknown channel\n");
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_ERR "eicon_pci: Indication for unknown channel Ind=%d Id=%d\n", ind->Ind, ind->IndId);
|
||||
dev_kfree_skb(skb);
|
||||
continue;
|
||||
}
|
||||
|
@ -384,6 +384,7 @@ diehl_pci_rcv_dispatch(diehl_pci_card *card) {
|
|||
else {
|
||||
if (!(skb2 = skb_dequeue(&chan->e.R))) {
|
||||
chan->e.complete = 1;
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_ERR "eicon_pci: buffer incomplete, but 0 in queue\n");
|
||||
dev_kfree_skb(skb);
|
||||
dev_kfree_skb(skb2);
|
||||
|
@ -423,6 +424,7 @@ diehl_pci_ack_dispatch(diehl_pci_card *card) {
|
|||
struct sk_buff *skb;
|
||||
|
||||
if (!card) {
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING "eicon_pci_ack_dispatch: NULL card!\n");
|
||||
return;
|
||||
}
|
||||
|
@ -615,6 +617,7 @@ diehl_pci_transmit(diehl_pci_card *card) {
|
|||
int ReqCount;
|
||||
|
||||
if (!card) {
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_WARNING "eicon_pci_transmit: NULL card!\n");
|
||||
return;
|
||||
}
|
||||
|
@ -638,9 +641,8 @@ diehl_pci_transmit(diehl_pci_card *card) {
|
|||
if (!(ram_inb(card, &prram->ReqOutput) - ram_inb(card, &prram->ReqInput))) {
|
||||
restore_flags(flags);
|
||||
skb_queue_head(&((diehl_card *)card->card)->sndq, skb2);
|
||||
#ifdef DIEHL_PCI_DEBUG
|
||||
printk(KERN_INFO "eicon_pci: transmit: Not ready\n");
|
||||
#endif
|
||||
if (DebugVar & 32)
|
||||
printk(KERN_INFO "eicon_pci: transmit: Card not ready\n");
|
||||
return;
|
||||
}
|
||||
restore_flags(flags);
|
||||
|
@ -666,36 +668,37 @@ diehl_pci_transmit(diehl_pci_card *card) {
|
|||
else {
|
||||
ram_outb(card, &ReqOut->ReqId, chan->e.B2Id);
|
||||
chan->e.ReqCh = 1;
|
||||
if ((reqbuf->Req & 0x0f) == 0x08) /* Send Data */
|
||||
if (((reqbuf->Req & 0x0f) == 0x08) ||
|
||||
((reqbuf->Req & 0x0f) == 0x01)) { /* Send Data */
|
||||
chan->waitq = reqbuf->XBuffer.length;
|
||||
chan->waitpq += reqbuf->XBuffer.length;
|
||||
}
|
||||
}
|
||||
} else { /* It is an ASSIGN */
|
||||
ram_outb(card, &ReqOut->ReqId, reqbuf->ReqId);
|
||||
chan->e.ref = ram_inw(card, &ReqOut->Reference);
|
||||
if (!reqbuf->Reference)
|
||||
chan->e.ReqCh = 0;
|
||||
else
|
||||
chan->e.ReqCh = 1;
|
||||
}
|
||||
chan->e.ref = ram_inw(card, &ReqOut->Reference);
|
||||
chan->e.Req = reqbuf->Req;
|
||||
ReqCount++;
|
||||
ram_outw(card, &prram->NextReq, ram_inw(card, &ReqOut->next));
|
||||
chan->e.busy = 1;
|
||||
restore_flags(flags);
|
||||
#ifdef DIEHL_PCI_DEBUG
|
||||
if (DebugVar & 32)
|
||||
printk(KERN_DEBUG "eicon_pci: Req=%x,Id=%x,Ch=%x Len=%x\n", reqbuf->Req,
|
||||
ram_inb(card, &ReqOut->ReqId),
|
||||
reqbuf->ReqCh, reqbuf->XBuffer.length);
|
||||
#endif
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
dev_kfree_skb(skb2);
|
||||
}
|
||||
else {
|
||||
skb_queue_tail(&((diehl_card *)card->card)->sackq, skb2);
|
||||
#ifdef DIEHL_PCI_DEBUG
|
||||
if (DebugVar & 32)
|
||||
printk(KERN_INFO "eicon_pci: transmit: busy chan %d\n", chan->No);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
ram_outb(card, &prram->ReqInput, (__u8)(ram_inb(card, &prram->ReqInput) + ReqCount));
|
||||
|
@ -761,6 +764,7 @@ diehl_pci_irq(int irq, void *dev_id, struct pt_regs *regs) {
|
|||
switch(card->type) {
|
||||
case DIEHL_CTYPE_MAESTRAP:
|
||||
if (!(readb(&ram[0x3fe]))) { /* card did not interrupt */
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_DEBUG "eicon_pci: IRQ: card tells no interrupt!\n");
|
||||
return;
|
||||
}
|
||||
|
@ -768,6 +772,7 @@ diehl_pci_irq(int irq, void *dev_id, struct pt_regs *regs) {
|
|||
case DIEHL_CTYPE_MAESTRA:
|
||||
outw(0x3fe, card->PCIreg + M_ADDR);
|
||||
if (!(inb(card->PCIreg + M_DATA))) { /* card did not interrupt */
|
||||
if (DebugVar & 1)
|
||||
printk(KERN_DEBUG "eicon_pci: IRQ: card tells no interrupt!\n");
|
||||
return;
|
||||
}
|
||||
|
@ -789,10 +794,9 @@ diehl_pci_irq(int irq, void *dev_id, struct pt_regs *regs) {
|
|||
ack->RcId = ram_inb(card, &RcIn->RcId);
|
||||
ack->RcCh = ram_inb(card, &RcIn->RcCh);
|
||||
ack->Reference = ram_inw(card, &RcIn->Reference);
|
||||
#ifdef DIEHL_PCI_DEBUG
|
||||
if (DebugVar & 64)
|
||||
printk(KERN_INFO "eicon_pci: IRQ Rc=%d Id=%d Ch=%d Ref=%d\n",
|
||||
Rc,ack->RcId,ack->RcCh,ack->Reference);
|
||||
#endif
|
||||
ram_outb(card, &RcIn->Rc, 0);
|
||||
skb_queue_tail(&((diehl_card *)card->card)->rackq, skb);
|
||||
diehl_schedule_ack((diehl_card *)card->card);
|
||||
|
@ -821,10 +825,9 @@ diehl_pci_irq(int irq, void *dev_id, struct pt_regs *regs) {
|
|||
ind->MInd = ram_inb(card, &IndIn->MInd);
|
||||
ind->MLength = ram_inw(card, &IndIn->MLength);
|
||||
ind->RBuffer.length = len;
|
||||
#ifdef DIEHL_PCI_DEBUG
|
||||
if (DebugVar & 64)
|
||||
printk(KERN_INFO "eicon_pci: IRQ Ind=%d Id=%d Ch=%d MInd=%d MLen=%d Len=%d\n",
|
||||
Ind,ind->IndId,ind->IndCh,ind->MInd,ind->MLength,len);
|
||||
#endif
|
||||
ram_copyfromcard(card, &ind->RBuffer.P, &IndIn->RBuffer.P, len);
|
||||
skb_queue_tail(&((diehl_card *)card->card)->rcvq, skb);
|
||||
diehl_schedule_rx((diehl_card *)card->card);
|
||||
|
|
Loading…
Reference in New Issue