kernels/linux-2.4.0/drivers/ieee1394/ohci1394.c
/* Generate the dma receive prgs and start the context */
Generate the dma receive prgs and start the context
Generate the dma receive prgs and start the context
static void initialize_dma_rcv_ctx(struct dma_rcv_ctx *d)
{
	struct ti_ohci *ohci = (struct ti_ohci*)(d->ohci);
	int i;
	ohci1394_stop_context(ohci, d->ctrlClear, NULL);
	for (i=0; i<d->num_desc; i++) {
		if ((i+1) < d->num_desc) {
			d->prg_cpu[i]->control = (0x283C << 16) | d->buf_size;
			d->prg_cpu[i]->branchAddress =
				(d->prg_bus[i+1] & 0xfffffff0) | 0x1;
		} else {
			d->prg_cpu[i]->control = (0x283C << 16) | d->buf_size;
			d->prg_cpu[i]->branchAddress =
				d->prg_bus[0] & 0xfffffff0;
		}
		d->prg_cpu[i]->address = d->buf_bus[i];
		d->prg_cpu[i]->status = d->buf_size;
	}
        d->buf_ind = 0;
        d->buf_offset = 0;
	reg_write(ohci, d->cmdPtr, d->prg_bus[0] | 0x1);
	reg_write(ohci, d->ctrlSet, 0x00008000);
	PRINT(KERN_INFO, ohci->id, "Receive DMA ctx=%d initialized", d->ctx);
}
static void initialize_dma_rcv_ctx ( struct dma_rcv_ctx * d ) { struct ti_ohci * ohci = ( struct ti_ohci * ) ( d -> ohci ) ; int i ; ohci1394_stop_context ( ohci , d -> ctrlClear , NULL ) ; for ( i = 0 ; i < d -> num_desc ; i ++ ) { if ( ( i + 1 ) < d -> num_desc ) { d -> prg_cpu [ i ] -> control = ( 0x283C << 16 ) | d -> buf_size ; d -> prg_cpu [ i ] -> branchAddress = ( d -> prg_bus [ i + 1 ] & 0xfffffff0 ) | 0x1 ; } else { d -> prg_cpu [ i ] -> control = ( 0x283C << 16 ) | d -> buf_size ; d -> prg_cpu [ i ] -> branchAddress = d -> prg_bus [ 0 ] & 0xfffffff0 ; } d -> prg_cpu [ i ] -> address = d -> buf_bus [ i ] ; d -> prg_cpu [ i ] -> status = d -> buf_size ; } d -> buf_ind = 0 ; d -> buf_offset = 0 ; reg_write ( ohci , d -> cmdPtr , d -> prg_bus [ 0 ] | 0x1 ) ; reg_write ( ohci , d -> ctrlSet , 0x00008000 ) ; PRINT ( KERN_INFO , ohci -> id , " " , d -> ctx ) ; }
Generate the dma receive prgs and start the context
Generate the dma receive prgs and start the context
/* end of descriptor list? */ /* Tell the controller where the first AR program is */ /* Run AR context */