[Linux1394-cvslog] rev 736 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <dm...@li...> - 2003-02-01 13:59:45
|
Author: dmaas Date: 2003-01-05 23:03:02 -0500 (Sun, 05 Jan 2003) New Revision: 736 Modified: trunk/ohci1394.c trunk/ohci1394.h Log: back out previous commit - don't drop the legacy API just yet Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2003-02-01 08:59:12.000000000 -0500 @@ -515,6 +515,12 @@ /* Don't accept phy packets into AR request context */ reg_write(ohci, OHCI1394_LinkControlClear, 0x00000400); + /* Set bufferFill, isochHeader, multichannel for IR context */ + reg_write(ohci, OHCI1394_IsoRcvContextControlSet, 0xd0000000); + + /* Set the context match register to match on all tags */ + reg_write(ohci, OHCI1394_IsoRcvContextMatch, 0xf0000000); + /* Clear the interrupt mask */ reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, 0xffffffff); reg_write(ohci, OHCI1394_IsoRecvIntEventClear, 0xffffffff); @@ -535,6 +541,9 @@ initialize_dma_trm_ctx(&ohci->at_req_context); initialize_dma_trm_ctx(&ohci->at_resp_context); + /* Initialize IR dma */ + initialize_dma_rcv_ctx(&ohci->ir_context, 1); + /* Initialize IT dma */ initialize_dma_trm_ctx(&ohci->it_context); @@ -2739,7 +2748,10 @@ ohci1394_stop_context(d->ohci, d->ctrlClear, NULL); - tasklet_kill(&d->task); + if (d->type == DMA_CTX_ISO) + ohci1394_unregister_iso_tasklet(d->ohci, &d->ohci->ir_tasklet); + else + tasklet_kill(&d->task); if (d->buf_cpu) { for (i=0; i<d->num_desc; i++) @@ -2776,12 +2788,6 @@ { int i; - if(type == DMA_CTX_ISO) { - PRINT(KERN_ERR, ohci->id, - "Obsolete ISO reception API removed; use hpsb_iso interface"); - return -EINVAL; - } - d->ohci = ohci; d->type = type; d->ctx = ctx; @@ -2859,7 +2865,18 @@ spin_lock_init(&d->lock); - tasklet_init (&d->task, dma_rcv_tasklet, (unsigned long) d); + if (type == DMA_CTX_ISO) { + ohci1394_init_iso_tasklet(&ohci->ir_tasklet, OHCI_ISO_MULTICHANNEL_RECEIVE, + dma_rcv_tasklet, (unsigned long) d); + if (ohci1394_register_iso_tasklet(ohci, + &ohci->ir_tasklet) < 0) { + PRINT(KERN_ERR, ohci->id, "No IR DMA context available"); + free_dma_rcv_ctx(d); + return -EBUSY; + } + } + else + tasklet_init (&d->task, dma_rcv_tasklet, (unsigned long) d); return 0; } @@ -3309,6 +3326,14 @@ ohci->ISO_channel_usage = 0; spin_lock_init(&ohci->IR_channel_lock); + /* IR DMA context */ + if (alloc_dma_rcv_ctx(ohci, &ohci->ir_context, + DMA_CTX_ISO, 0, IR_NUM_DESC, + IR_BUF_SIZE, IR_SPLIT_BUF_SIZE, + OHCI1394_IsoRcvContextBase) < 0) + FAIL(-ENOMEM, "Failed to allocate IR context"); + + /* IT DMA context allocation */ if (alloc_dma_trm_ctx(ohci, &ohci->it_context, DMA_CTX_ISO, 0, IT_NUM_DESC, @@ -3357,6 +3382,9 @@ free_dma_trm_ctx(&ohci->at_req_context); free_dma_trm_ctx(&ohci->at_resp_context); + /* Free IR dma */ + free_dma_rcv_ctx(&ohci->ir_context); + /* Free IT dma */ free_dma_trm_ctx(&ohci->it_context); Modified: trunk/ohci1394.h ============================================================================== --- trunk/ohci1394.h (original) +++ trunk/ohci1394.h 2003-02-01 08:59:13.000000000 -0500 @@ -188,6 +188,8 @@ struct dma_trm_ctx at_req_context; /* iso receive */ + struct dma_rcv_ctx ir_context; + struct ohci1394_iso_tasklet ir_tasklet; spinlock_t IR_channel_lock; int nb_iso_rcv_ctx; unsigned long ir_ctx_usage; /* use test_and_set_bit() for atomicity */ |