diff options
author | Roman Yeryomin <roman@advem.lv> | 2013-02-06 02:59:31 +0200 |
---|---|---|
committer | Roman Yeryomin <roman@advem.lv> | 2013-02-06 02:59:31 +0200 |
commit | 691cc9529efe8ea7abaab170c452ae4470bf3ac2 (patch) | |
tree | 8d18d131720975fc63c8c2abc7bd933efe503e5f /target/linux/realtek/files/include/net/rtl/features | |
parent | 62da0fe6152d0025e570ca41a6f9ae68df7da89b (diff) |
Rebase files to rsdk 3.2 and refresh patches. Compilable (not by humans).
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target/linux/realtek/files/include/net/rtl/features')
3 files changed, 135 insertions, 0 deletions
diff --git a/target/linux/realtek/files/include/net/rtl/features/fast_bridge.h b/target/linux/realtek/files/include/net/rtl/features/fast_bridge.h new file mode 100644 index 000000000..0586179c9 --- /dev/null +++ b/target/linux/realtek/files/include/net/rtl/features/fast_bridge.h @@ -0,0 +1,81 @@ +#if !defined(FAST_BRIDGE_H)
+#define FAST_BRIDGE_H
+
+#define CONFIG_RTL_FASTBRIDGE 1
+
+#define RTL_FB_ENTRY_NUM 16
+#define RTL_FB_HASH_SIZE 16 /* must be 2s order */
+
+#if !defined(__KERNEL__)
+struct hlist_node {
+ struct hlist_node *next, **pprev; +};
+struct hlist_head { + struct hlist_node *first; +};
+#endif
+
+typedef struct _rtl_fb_para
+{
+ uint32 enable_fb_filter:1;
+ uint32 enable_fb_fwd:1;
+ uint32 entry_num;
+} rtl_fb_para;
+
+typedef struct _rtl_fb_head
+{
+ struct hlist_head in_used_list[RTL_FB_HASH_SIZE];
+ struct hlist_head free_list;
+ uint32 used_cnt;
+} rtl_fb_head;
+
+typedef struct _rtl_fb_entry
+{
+ /* hlist MUST be the first filed */
+ struct hlist_node hlist; /* belongs to the same hash entry */
+ void* dev_matchKey;
+ int32 (*ndo_start_xmit) (struct sk_buff *skb,
+ struct net_device *dev);
+ unsigned long last_used;
+ uint8 mac_addr[ETHER_ADDR_LEN];
+} rtl_fb_entry;
+
+int32 rtl_fb_process_in_nic(struct sk_buff *pskb, struct net_device *dev);
+void rtl_fb_del_entry(const uint8 *mac);
+void rtl_fb_flush(void);
+void rtl_fb_flush_by_dev(void* key);
+unsigned long rtl_fb_get_entry_lastused(const uint8 *mac);
+
+#define RTL_FB_RETURN_SUCCESS 0
+#define RTL_FB_RETURN_FAILED -1
+
+/*****************************************************/
+/* netlink */
+#define FB_CMD_NO_CMD -1
+#define FB_CMD_SET_FWD 0
+#define FB_CMD_SET_FILTER 1
+#define FB_CMD_SET_ENTRY_NUM 2
+#define FB_CMD_GET_STATUS 3
+#define FB_CMD_GET_USED_NUM 4
+#define FB_CMD_DUMP_ENTRYS 5
+
+typedef struct _rtl_fb_nl_entry {
+ uint8 name[IFNAMSIZ];
+ uint8 mac_addr[ETHER_ADDR_LEN];
+ unsigned long last_used;
+} rtl_fb_nl_entry;
+
+typedef struct fb_data_info {
+ rtl_fb_para data; /* status/flags/counter/etc */
+ rtl_fb_nl_entry *entry; /* for get entry list */
+ uint32 in_used; /* inused count */
+} fb_data_info_s, *fb_data_info_p;
+
+typedef struct fb_cmd_info {
+ int action; /* set/get items */
+ fb_data_info_s info;
+}fb_cmd_info_s, *fb_cmd_info_p;
+
+/*****************************************************/
+
+#endif
diff --git a/target/linux/realtek/files/include/net/rtl/features/lan_restrict.h b/target/linux/realtek/files/include/net/rtl/features/lan_restrict.h new file mode 100644 index 000000000..0ad313b47 --- /dev/null +++ b/target/linux/realtek/files/include/net/rtl/features/lan_restrict.h @@ -0,0 +1,10 @@ +//#include <common/rtl865x_common.h>
+#include <net/rtl/rtl_types.h>
+#include <net/rtl/rtl_queue.h>
+#include <net/rtl/rtl_nic.h>
+#include <net/rtl/rtl865x_fdb_api.h>
+
+int32 lan_restrict_getBlockAddr(int32 port , const unsigned char *swap_addr);
+extern int __init lan_restrict_init(void);
+extern int lan_restrict_rcv(struct sk_buff *skb, struct net_device *dev);
+extern int32 lan_restrict_CheckStatusByport(int32 port);
diff --git a/target/linux/realtek/files/include/net/rtl/features/rtl_ps_log.h b/target/linux/realtek/files/include/net/rtl/features/rtl_ps_log.h new file mode 100644 index 000000000..3c306722a --- /dev/null +++ b/target/linux/realtek/files/include/net/rtl/features/rtl_ps_log.h @@ -0,0 +1,44 @@ +#ifndef RTL_PS_LOG_H
+#define RTL_PS_LOG_H
+
+#if defined(CONFIG_RTL_LOG_DEBUG)
+
+ #if defined(LOG_ERROR)
+ #undef LOG_ERROR
+ #define LOG_ERROR(fmt, args...) do{ \
+ if(RTL_LogTypeMask.ERROR&&RTL_LogModuleMask.PROSTACK&&LOG_LIMIT)scrlog_printk("PS-ERROR:"fmt, ## args); \
+ }while(0)
+ #endif
+
+ #if defined(LOG_MEM_ERROR)
+ #undef LOG_MEM_ERROR
+ #define LOG_MEM_ERROR(fmt, args...) do{ \
+ if(RTL_LogTypeMask.ERROR&&RTL_LogErrorMask.MEM&&RTL_LogModuleMask.PROSTACK&&LOG_LIMIT)scrlog_printk("PS-MEM-ERROR:"fmt, ## args); \
+ }while(0)
+ #endif
+
+ #if defined(LOG_SKB_ERROR)
+ #undef LOG_SKB_ERROR
+ #define LOG_SKB_ERROR(fmt, args...) do{ \
+ if(RTL_LogTypeMask.ERROR&&RTL_LogErrorMask.SKB&&RTL_LogModuleMask.PROSTACK&&LOG_LIMIT)scrlog_printk("PS-SKB-ERROR:"fmt, ## args); \
+ }while(0)
+ #endif
+
+ #if defined(LOG_WARN)
+ #undef LOG_WARN
+ #define LOG_WARN(fmt, args...) do{ \
+ if(RTL_LogTypeMask.WARN&&RTL_LogModuleMask.PROSTACK&&LOG_LIMIT)scrlog_printk("PS-WARN:"fmt, ## args); \
+ }while(0)
+ #endif
+
+ #if defined(LOG_INFO)
+ #undef LOG_INFO
+ #define LOG_INFO(fmt, args...) do{ \
+ if(RTL_LogTypeMask.INFO&&RTL_LogModuleMask.PROSTACK&&LOG_LIMIT)scrlog_printk("PS-INFO:"fmt, ## args); \
+ }while(0)
+ #endif
+
+#endif
+
+#endif
+
|