1 //============================================================================
3 //============================================================================
5 // Definition for this module used
6 #define MAX_USB_RX_BUFFER 4096 // This parameter must be 4096 931130.4.f
8 #define MAX_USB_RX_BUFFER_NUMBER ETHERNET_RX_DESCRIPTORS // Maximum 254, 255 is RESERVED ID
9 #define RX_INTERFACE 0 // Interface 1
10 #define RX_PIPE 2 // Pipe 3
11 #define MAX_PACKET_SIZE 1600 //1568 // 8 + 1532 + 4 + 24(IV EIV MIC ICV CRC) for check DMA data 931130.4.g
12 #define RX_END_TAG 0x0badbeef
15 //====================================
16 // Internal variable for module
17 //====================================
18 typedef struct _WB35RX
20 u32 ByteReceived;// For calculating throughput of BulkIn
21 atomic_t RxFireCounter;// Does Wb35Rx module fire?
23 u8 RxBuffer[ MAX_USB_RX_BUFFER_NUMBER ][ ((MAX_USB_RX_BUFFER+3) & ~0x03 ) ];
24 u16 RxBufferSize[ ((MAX_USB_RX_BUFFER_NUMBER+1) & ~0x01) ];
25 u8 RxOwner[ ((MAX_USB_RX_BUFFER_NUMBER+3) & ~0x03 ) ];//Ownership of buffer 0: SW 1:HW
27 u32 RxProcessIndex;//The next index to process
31 u32 rx_halt; // For VM stopping
36 u32 CurrentRxBufferId; // For complete routine usage
39 u32 LastR1; // For RSSI reporting
41 u32 Ep3ErrorCount2; // 20060625.1 Usbd for Rx DMA error count