- Main Page
- Data Structures
- Files

- File List
- Globals

# software/wrsw_rtud/rtu_drv.h

Go to the documentation of this file.

    00001 /*
    00002  * White Rabbit RTU (Routing Table Unit)
    00003  * Copyright (C) 2010, CERN.
    00004  *
    00005  * Version:     wrsw_rtud v1.0
    00006  *
    00007  * Authors:     Juan Luis Manas (juan.manas@integrasys.es)
    00008  *              Miguel Baizan   (miguel.baizan@integrasys.es)
    00009  *              Maciej Lipinski (maciej.lipinski@cern.ch)
    00010  *
    00011  * Description: RTU driver module in user space.
    00012  *
    00013  * Fixes:
    00014  *
    00015  *
    00016  * This program is free software; you can redistribute it and/or
    00017  * modify it under the terms of the GNU General Public License
    00018  * as published by the Free Software Foundation; either version
    00019  * 2 of the License, or (at your option) any later version.
    00020  *
    00021  * This program is distributed in the hope that it will be useful,
    00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00024  * GNU General Public License for more details.
    00025  *
    00026  * You should have received a copy of the GNU General Public License
    00027  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    00028  */
    00029
    00030
    00031 #ifndef __WHITERABBIT_RTU_DRV_H
    00032 #define __WHITERABBIT_RTU_DRV_H
    00033
    00034 #include "rtu.h"
    00035
    00036 // HW RTU (should be given by wrsw_rtu_wb.h)
    00037 #define RTU_HCAM                0x4000
    00038 #define RTU_ARAM_MAIN           0x8000
    00039 #define RTU_VLAN_TAB            0xc000
    00040
    00041 #define RTU_MFIFO_R0_DATA_SEL   0x00000000
    00042 #define RTU_MFIFO_R1_ADDR_MASK  0x0007FFFF
    00043
    00044 #define RTU_DEVNAME             "/dev/wr_rtu"
    00045
    00046 int rtu_init(void)
    00047         __attribute__((warn_unused_result));
    00048 void rtu_exit(void);
    00049
    00050 // UFIFO
    00051
    00052 int rtu_ufifo_is_empty(void);
    00053 int rtu_read_learning_queue_cnt(void);
    00054 int rtu_read_learning_queue(struct rtu_request *req);
    00055
    00056 // MFIFO
    00057
    00058 int rtu_read_mfifo_cnt(void);
    00059 int rtu_mfifo_is_full(void);
    00060 int rtu_mfifo_is_empty(void);
    00061 void rtu_clean_mfifo(void);
    00062 void rtu_write_htab_entry(uint16_t zbt_addr, struct filtering_entry *ent);
    00063 void rtu_clean_htab_entry(uint16_t zbt_addr);
    00064 void rtu_clean_htab(void);
    00065
    00066 // HCAM
    00067
    00068 void rtu_read_hcam_entry(uint16_t cam_addr, struct filtering_entry *ent);
    00069 void rtu_write_hcam_entry(uint16_t cam_addr, struct filtering_entry *ent);
    00070 void rtu_clean_hcam_entry(uint8_t cam_addr);
    00071 void rtu_clean_hcam(void);
    00072
    00073 // AGING - HTAB
    00074
    00075 uint32_t rtu_read_agr_htab(uint32_t addr);
    00076 void rtu_clean_agr_htab(void);
    00077
    00078 // AGING - HCAM
    00079
    00080 uint32_t rtu_read_agr_hcam(void);
    00081 void rtu_clean_agr_hcam(void);
    00082
    00083 // VLAN TABLE
    00084
    00085 void rtu_write_vlan_entry(uint32_t addr, struct vlan_table_entry *ent);
    00086 void rtu_clean_vlan_entry(uint32_t addr);
    00087 void rtu_clean_vlan(void);
    00088
    00089 // GLOBAL CONTROL REGISTER
    00090
    00091 void rtu_enable(void);
    00092 void rtu_disable(void);
    00093 void rtu_write_hash_poly(uint16_t hash_poly);
    00094 uint16_t rtu_read_hash_poly(void);
    00095 void rtu_set_active_htab_bank(uint8_t bank);
    00096 void rtu_set_active_hcam_bank(uint8_t bank);
    00097 void rtu_set_active_bank(uint8_t bank);
    00098
    00099 // PORT SETTINGS
    00100
    00101 int rtu_set_fixed_prio_on_port(int port, uint8_t prio)
    00102         __attribute__((warn_unused_result));
    00103 int rtu_unset_fixed_prio_on_port(int port)
    00104         __attribute__((warn_unused_result));
    00105 int rtu_learn_enable_on_port(int port, int flag)
    00106         __attribute__((warn_unused_result));
    00107 int rtu_pass_bpdu_on_port(int port, int flag)
    00108         __attribute__((warn_unused_result));
    00109 int rtu_pass_all_on_port(int port, int pass_all)
    00110         __attribute__((warn_unused_result));
    00111 int rtu_set_unrecognised_behaviour_on_port(int port, int flag)
    00112         __attribute__((warn_unused_result));
    00113
    00114 // IRQs
    00115
    00116 void rtu_enable_irq(void);
    00117 void rtu_disable_irq(void);
    00118 void rtu_clear_irq(void);
    00119
    00120
    00121 #endif /*__WHITERABBIT_RTU_DRV_H*/

All Data Structures Files Functions Variables Defines