Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cpsw_ale.c File Reference
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/stat.h>
#include <linux/sysfs.h>
#include "cpsw_ale.h"

Go to the source code of this file.

Data Structures

struct  ale_control_info
 

Macros

#define BITMASK(bits)   (BIT(bits) - 1)
 
#define ALE_ENTRY_BITS   68
 
#define ALE_ENTRY_WORDS   DIV_ROUND_UP(ALE_ENTRY_BITS, 32)
 
#define ALE_VERSION_MAJOR(rev)   ((rev >> 8) & 0xff)
 
#define ALE_VERSION_MINOR(rev)   (rev & 0xff)
 
#define ALE_IDVER   0x00
 
#define ALE_CONTROL   0x08
 
#define ALE_PRESCALE   0x10
 
#define ALE_UNKNOWNVLAN   0x18
 
#define ALE_TABLE_CONTROL   0x20
 
#define ALE_TABLE   0x34
 
#define ALE_PORTCTL   0x40
 
#define ALE_TABLE_WRITE   BIT(31)
 
#define ALE_TYPE_FREE   0
 
#define ALE_TYPE_ADDR   1
 
#define ALE_TYPE_VLAN   2
 
#define ALE_TYPE_VLAN_ADDR   3
 
#define ALE_UCAST_PERSISTANT   0
 
#define ALE_UCAST_UNTOUCHED   1
 
#define ALE_UCAST_OUI   2
 
#define ALE_UCAST_TOUCHED   3
 
#define DEFINE_ALE_FIELD(name, start, bits)
 

Functions

int cpsw_ale_flush (struct cpsw_ale *ale, int port_mask)
 
int cpsw_ale_add_ucast (struct cpsw_ale *ale, u8 *addr, int port, int flags)
 
int cpsw_ale_del_ucast (struct cpsw_ale *ale, u8 *addr, int port)
 
int cpsw_ale_add_mcast (struct cpsw_ale *ale, u8 *addr, int port_mask, int super, int mcast_state)
 
int cpsw_ale_del_mcast (struct cpsw_ale *ale, u8 *addr, int port_mask)
 
int cpsw_ale_control_set (struct cpsw_ale *ale, int port, int control, int value)
 
int cpsw_ale_control_get (struct cpsw_ale *ale, int port, int control)
 
int cpsw_ale_set_ageout (struct cpsw_ale *ale, int ageout)
 
void cpsw_ale_start (struct cpsw_ale *ale)
 
void cpsw_ale_stop (struct cpsw_ale *ale)
 
struct cpsw_alecpsw_ale_create (struct cpsw_ale_params *params)
 
int cpsw_ale_destroy (struct cpsw_ale *ale)
 

Macro Definition Documentation

#define ALE_CONTROL   0x08

Definition at line 35 of file cpsw_ale.c.

#define ALE_ENTRY_BITS   68

Definition at line 27 of file cpsw_ale.c.

#define ALE_ENTRY_WORDS   DIV_ROUND_UP(ALE_ENTRY_BITS, 32)

Definition at line 28 of file cpsw_ale.c.

#define ALE_IDVER   0x00

Definition at line 34 of file cpsw_ale.c.

#define ALE_PORTCTL   0x40

Definition at line 40 of file cpsw_ale.c.

#define ALE_PRESCALE   0x10

Definition at line 36 of file cpsw_ale.c.

#define ALE_TABLE   0x34

Definition at line 39 of file cpsw_ale.c.

#define ALE_TABLE_CONTROL   0x20

Definition at line 38 of file cpsw_ale.c.

#define ALE_TABLE_WRITE   BIT(31)

Definition at line 42 of file cpsw_ale.c.

#define ALE_TYPE_ADDR   1

Definition at line 45 of file cpsw_ale.c.

#define ALE_TYPE_FREE   0

Definition at line 44 of file cpsw_ale.c.

#define ALE_TYPE_VLAN   2

Definition at line 46 of file cpsw_ale.c.

#define ALE_TYPE_VLAN_ADDR   3

Definition at line 47 of file cpsw_ale.c.

#define ALE_UCAST_OUI   2

Definition at line 51 of file cpsw_ale.c.

#define ALE_UCAST_PERSISTANT   0

Definition at line 49 of file cpsw_ale.c.

#define ALE_UCAST_TOUCHED   3

Definition at line 52 of file cpsw_ale.c.

#define ALE_UCAST_UNTOUCHED   1

Definition at line 50 of file cpsw_ale.c.

#define ALE_UNKNOWNVLAN   0x18

Definition at line 37 of file cpsw_ale.c.

#define ALE_VERSION_MAJOR (   rev)    ((rev >> 8) & 0xff)

Definition at line 30 of file cpsw_ale.c.

#define ALE_VERSION_MINOR (   rev)    (rev & 0xff)

Definition at line 31 of file cpsw_ale.c.

#define BITMASK (   bits)    (BIT(bits) - 1)

Definition at line 26 of file cpsw_ale.c.

#define DEFINE_ALE_FIELD (   name,
  start,
  bits 
)
Value:
static inline int cpsw_ale_get_##name(u32 *ale_entry) \
{ \
return cpsw_ale_get_field(ale_entry, start, bits); \
} \
static inline void cpsw_ale_set_##name(u32 *ale_entry, u32 value) \
{ \
cpsw_ale_set_field(ale_entry, start, bits, value); \
}

Definition at line 77 of file cpsw_ale.c.

Function Documentation

int cpsw_ale_add_mcast ( struct cpsw_ale ale,
u8 addr,
int  port_mask,
int  super,
int  mcast_state 
)

Definition at line 290 of file cpsw_ale.c.

int cpsw_ale_add_ucast ( struct cpsw_ale ale,
u8 addr,
int  port,
int  flags 
)

Definition at line 252 of file cpsw_ale.c.

int cpsw_ale_control_get ( struct cpsw_ale ale,
int  port,
int  control 
)

Definition at line 549 of file cpsw_ale.c.

int cpsw_ale_control_set ( struct cpsw_ale ale,
int  port,
int  control,
int  value 
)

Definition at line 518 of file cpsw_ale.c.

struct cpsw_ale* cpsw_ale_create ( struct cpsw_ale_params params)
read

Definition at line 619 of file cpsw_ale.c.

int cpsw_ale_del_mcast ( struct cpsw_ale ale,
u8 addr,
int  port_mask 
)

Definition at line 320 of file cpsw_ale.c.

int cpsw_ale_del_ucast ( struct cpsw_ale ale,
u8 addr,
int  port 
)

Definition at line 276 of file cpsw_ale.c.

int cpsw_ale_destroy ( struct cpsw_ale ale)

Definition at line 633 of file cpsw_ale.c.

int cpsw_ale_flush ( struct cpsw_ale ale,
int  port_mask 
)

Definition at line 231 of file cpsw_ale.c.

int cpsw_ale_set_ageout ( struct cpsw_ale ale,
int  ageout 
)

Definition at line 584 of file cpsw_ale.c.

void cpsw_ale_start ( struct cpsw_ale ale)

Definition at line 595 of file cpsw_ale.c.

void cpsw_ale_stop ( struct cpsw_ale ale)

Definition at line 614 of file cpsw_ale.c.