Commit 2e9542b1 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Alessandro Rubini

userspace/wrsw_rtud: re-done register layout for N-port generic RTU

parent 00ce398d
......@@ -39,16 +39,13 @@
#include "mac.h"
#define RTU_BANKS 2
#define RTU_ENTRIES 2048
#define RTU_BUCKETS 4
#define LAST_RTU_BUCKET ((RTU_BUCKETS)-1)
#define RTU_ENTRIES (16384/(RTU_BANKS))
#define HTAB_ENTRIES ((RTU_ENTRIES)/(RTU_BUCKETS))
#define LAST_HTAB_ENTRY ((HTAB_ENTRIES)-1)
#define LAST_RTU_BUCKET (RTU_BUCKETS-1)
#define ENTRY_WORDS 8
#define CAM_ENTRIES (((RTU_HCAM_WORDS)/(ENTRY_WORDS))/(RTU_BANKS))
#define LAST_CAM_ENTRY ((CAM_ENTRIES)-1)
#define MIN_PORT 0
#define MAX_PORT 9
......
This diff is collapsed.
......@@ -33,11 +33,6 @@
#include "rtu.h"
// HW RTU (should be given by wrsw_rtu_wb.h)
#define RTU_HCAM 0x4000
#define RTU_ARAM_MAIN 0x8000
#define RTU_VLAN_TAB 0xc000
#define RTU_MFIFO_R0_DATA_SEL 0x00000000
#define RTU_MFIFO_R1_ADDR_MASK 0x0007FFFF
......
This diff is collapsed.
......@@ -28,6 +28,8 @@
*/
#include <hw/trace.h>
#include "rtu.h"
#include "rtu_hash.h"
......@@ -53,7 +55,7 @@ uint16_t rtu_hash(uint8_t mac[ETH_ALEN], uint8_t fid)
hash = crc16(hash, ((uint16_t)mac[2] << 8) | mac[3]);
hash = crc16(hash, ((uint16_t)mac[4] << 8) | mac[5]);
return hash & 0x7FF; // trim to fit in ZBT SRAM addr
return hash & (HTAB_ENTRIES - 1); /* warning: assumes that HTAB_ENTRIES is a power of 2 */
}
/*
......
......@@ -122,7 +122,7 @@ static void *rtu_daemon_wripc_process(void *arg)
{
while(1){
rtud_handle_wripc();
sleep(1);
usleep(10000);
}
return NULL;
}
......@@ -195,7 +195,6 @@ static int rtu_daemon_init(uint16_t poly, unsigned long aging_time)
TRACE(TRACE_INFO, "init port config.");
for(i = MIN_PORT; i <= MAX_PORT; i++) {
// MIN_PORT <= port <= MAX_PORT, thus no err returned
fprintf(stderr,"**4**");
err = rtu_learn_enable_on_port(i,1);
err = rtu_pass_all_on_port(i,1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment