Altera_Forum
Honored Contributor
17 years agoHow to define the NULL descriptor in SGDMA
I use the SGDMA in TSE MAC.
As its document said, the last descriptor in the descriptor chain must be a NULL descriptor. But I wonder how to define the NULL descriptor. I define it in following way: /***************************************************/ alt_sgdma_descriptor* tx_descriptor = (alt_sgdma_descriptor*)DESCRIPTOR_MEN_BASE; alt_sgdma_descriptor* tx_descriptor_ = (alt_sgdma_descriptor*)(DESCRIPTOR_MEN_BASE + ALTERA_AVALON_SGDMA_DESCRIPTOR_SIZE); alt_avalon_sgdma_construct_mem_to_stream_desc(tx_descriptor, tx_descriptor_, read_buffer, 256, 0, 1, 1, 0); alt_avalon_sgdma_construct_mem_to_stream_desc(tx_descriptor_, (alt_sgdma_descriptor*)NULL, read_buffer, 256, 0, 1, 1, 0); /****************************************************/ where tx_descriptor is the first descriptor, and tx_descriptor_ is the second(also the last descriptor) descriptor,. I define the NULL descriptor use (alt_sgdma_descriptor*)NULL Is that right?