Forum Discussion
Altera_Forum
Honored Contributor
15 years agofor(tse_ptr->chain_loop = 0; tse_ptr->chain_loop < ALTERA_TSE_SGDMA_RX_DESC_CHAIN_SIZE; tse_ptr->chain_loop++)
{ tse_ptr->pkt_array[tse_ptr->chain_loop] = pk_alloc(ALTERA_TSE_PKT_INIT_LEN+4); if (!tse_ptr->pkt_array[tse_ptr->chain_loop]) /* couldn't get a free buffer for rx */ { dprintf("[tse_sgdma_read_init] Fatal error: No free packet buffers for RX\n"); tse_ptr->netp->n_mib->ifInDiscards++; return ENP_NOBUFFER; } // ensure bit-31 of tse_ptr->pkt_array[tse_ptr->chain_loop]->nb_buff is clear before passing // to SGDMA Driver uncached_packet_payload = (alt_u32 *)alt_remap_cached ((volatile void*) tse_ptr->pkt_array[tse_ptr->chain_loop]->nb_buff, 4); alt_avalon_sgdma_construct_stream_to_mem_desc( (alt_sgdma_descriptor *) &tse_ptr->desc[tse_ptr->chain_loop+ALTERA_TSE_FIRST_RX_SGDMA_DESC_OFST], // descriptor I want to work with (alt_sgdma_descriptor *) &tse_ptr->desc[tse_ptr->chain_loop+ALTERA_TSE_SECOND_RX_SGDMA_DESC_OFST], // pointer to "next" uncached_packet_payload, // tse_ptr->pkt_array[tse_ptr->chain_loop]->nb_buff, // starting write_address 0, // read until EOP 0); // don't write to constant address } I find the code in the TSE MAC IP.