Author: anonymous
Date: 2002-12-20 02:58:27 -0500 (Fri, 20 Dec 2002)
New Revision: 715
Modified:
trunk/ohci1394.c
trunk/ohci1394.h
Log:
first little bit of multichannel ISO receive infrastructure
Modified: trunk/ohci1394.c
==============================================================================
--- trunk/ohci1394.c (original)
+++ trunk/ohci1394.c 2002-12-22 09:50:36.000000000 -0500
@@ -1780,7 +1780,7 @@
if (t->type == OHCI_ISO_TRANSMIT && tx_event & mask)
tasklet_schedule(&t->tasklet);
- if (t->type == OHCI_ISO_RECEIVE && rx_event & mask)
+ else if (rx_event & mask)
tasklet_schedule(&t->tasklet);
}
@@ -3025,7 +3025,7 @@
/* essentially the only purpose of this code is to allow another
module to hook into ohci's interrupt handler */
-void ohci1394_stop_context(struct ti_ohci *ohci, int reg, char *msg)
+int ohci1394_stop_context(struct ti_ohci *ohci, int reg, char *msg)
{
int i=0;
@@ -3037,11 +3037,15 @@
i++;
if (i>5000) {
PRINT(KERN_ERR, ohci->id,
- "Runaway loop while stopping context...");
- break;
+ "Runaway loop while stopping context: %s...", msg ? msg : "");
+ return 1;
}
+
+ mb();
+ udelay(10);
}
if (msg) PRINT(KERN_ERR, ohci->id, "%s: dma prg stopped", msg);
+ return 0;
}
void ohci1394_init_iso_tasklet(struct ohci1394_iso_tasklet *tasklet, int type,
@@ -3067,6 +3071,13 @@
else {
n = ohci->nb_iso_rcv_ctx;
usage = &ohci->ir_ctx_usage;
+
+ /* only one receive context can be multichannel (OHCI sec 10.4.1) */
+ if(tasklet->type == OHCI_ISO_MULTICHANNEL_RECEIVE) {
+ if(test_and_set_bit(0, &ohci->ir_multichannel_used)) {
+ return r;
+ }
+ }
}
spin_lock_irqsave(&ohci->iso_tasklet_list_lock, flags);
@@ -3095,9 +3106,14 @@
if (tasklet->type == OHCI_ISO_TRANSMIT)
clear_bit(tasklet->context, &ohci->it_ctx_usage);
- else
+ else {
clear_bit(tasklet->context, &ohci->ir_ctx_usage);
+ if(tasklet->type == OHCI_ISO_MULTICHANNEL_RECEIVE) {
+ clear_bit(0, &ohci->ir_multichannel_used);
+ }
+ }
+
list_del(&tasklet->link);
spin_unlock_irqrestore(&ohci->iso_tasklet_list_lock, flags);
Modified: trunk/ohci1394.h
==============================================================================
--- trunk/ohci1394.h (original)
+++ trunk/ohci1394.h 2002-12-22 09:50:36.000000000 -0500
@@ -145,7 +145,8 @@
struct tasklet_struct tasklet;
struct list_head link;
int context;
- enum { OHCI_ISO_TRANSMIT, OHCI_ISO_RECEIVE } type;
+ enum { OHCI_ISO_TRANSMIT, OHCI_ISO_RECEIVE,
+ OHCI_ISO_MULTICHANNEL_RECEIVE } type;
};
struct ti_ohci {
@@ -192,6 +193,7 @@
spinlock_t IR_channel_lock;
int nb_iso_rcv_ctx;
unsigned long ir_ctx_usage; /* use test_and_set_bit() for atomicity */
+ unsigned int ir_multichannel_used; /* ditto */
/* iso transmit */
struct dma_trm_ctx it_context;
@@ -416,8 +418,8 @@
void ohci1394_unregister_iso_tasklet(struct ti_ohci *ohci,
struct ohci1394_iso_tasklet *tasklet);
-void ohci1394_stop_context (struct ti_ohci *ohci, int reg, char *msg);
+/* returns zero if successful, one if DMA context is locked up */
+int ohci1394_stop_context (struct ti_ohci *ohci, int reg, char *msg);
struct ti_ohci *ohci1394_get_struct(int card_num);
#endif
-
|