Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cpsw_ale.h
Go to the documentation of this file.
1 /*
2  * Texas Instruments 3-Port Ethernet Switch Address Lookup Engine APIs
3  *
4  * Copyright (C) 2012 Texas Instruments
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation version 2.
9  *
10  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11  * kind, whether express or implied; without even the implied warranty
12  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  */
15 #ifndef __TI_CPSW_ALE_H__
16 #define __TI_CPSW_ALE_H__
17 
19  struct device *dev;
21  unsigned long ale_ageout; /* in secs */
22  unsigned long ale_entries;
23  unsigned long ale_ports;
24 };
25 
26 struct cpsw_ale {
28  struct timer_list timer;
29  unsigned long ageout;
30 };
31 
33  /* global */
45  /* port controls */
57 };
58 
64 };
65 
66 /* ALE unicast entry flags - passed into cpsw_ale_add_ucast() */
67 #define ALE_SECURE 1
68 #define ALE_BLOCKED 2
69 
70 #define ALE_MCAST_FWD 0
71 #define ALE_MCAST_BLOCK_LEARN_FWD 1
72 #define ALE_MCAST_FWD_LEARN 2
73 #define ALE_MCAST_FWD_2 3
74 
76 int cpsw_ale_destroy(struct cpsw_ale *ale);
77 
78 void cpsw_ale_start(struct cpsw_ale *ale);
79 void cpsw_ale_stop(struct cpsw_ale *ale);
80 
81 int cpsw_ale_set_ageout(struct cpsw_ale *ale, int ageout);
82 int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask);
83 int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, int flags);
84 int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port);
85 int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
86  int super, int mcast_state);
87 int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask);
88 
89 int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control);
90 int cpsw_ale_control_set(struct cpsw_ale *ale, int port,
91  int control, int value);
92 
93 #endif