#ifndef MAXIMUS_BRIDGEDMA_CTX_H_ #define MAXIMUS_BRIDGEDMA_CTX_H_ /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file hal/phy/maximus/inc/maximus_bridgedma_ctx.h * \brief HAL Bridge DMA context for Maximus. * \ingroup hal_phy_maximus */ #include "lib/crc.h" #include "hal/phy/bridgedma.h" #ifdef ECOS #include #endif /* ECOS */ #include "host/station.h" /** 1 byte is processed into 5ns, so 8 bytes per tick (40ns) */ #define BRIDGEDMA_BYTE_PER_TICK 8 /** max additionnal processing time is 10us, so 250 ticks */ #define BRIDGEDMA_ADD_MAX_TICK 250 #define HPAV_CRC32_GENERATOR 0x04c11db7 #define HPAV_CRC32_INIT 0xffffffff #define HPAV_CRC32_MAGIC 0x2144df1c typedef enum { PB_TO_MACFRAME, MACFRAME_TO_PB } bridgedma_copy_dir_t; struct phy_bridgedma_t { phy_bridgedma_status_t status; //phy_bridgedma_ctrl_t control; phy_bridgedma_job_t *job_first; phy_bridgedma_job_t *job_current; phy_bridgedma_job_t *job_last; uint32_t icv_substitution; uint32_t icv_current; crc_t crc_ctx; void *user_data; phy_bridgedma_cb_t bridgedma_cb; phy_deferred_cb_t deferred_cb; station_ctx_t *station; netclock_callback_t netclock_cb; #ifdef ECOS cyg_interrupt interrupt; cyg_handle_t interrupt_handle; #endif /* ECOS */ }; #ifndef ECOS int _pb_data_add(blk_t **pb_current, unsigned char **pb_data_ptr, unsigned int pb_size, unsigned char *mac_ptr, unsigned int mac_len, bridgedma_copy_dir_t direction); #endif /* ECOS */ #endif /*MAXIMUS_BRIDGEDMA_CTX_H_*/