Blame view

kernel/linux-rt-4.4.41/include/uapi/linux/net_switch_config.h 1.96 KB
5113f6f70   김현기   kernel add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  /*
   * Texas Instruments Ethernet Switch Driver
   *
   * Copyright (C) 2014 Texas Instruments
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
   * version 2 as published by the Free Software Foundation.
   *
   * This program is distributed "as is" WITHOUT ANY WARRANTY of any
   * kind, whether express or implied; without even the implied warranty
   * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   */
  
  /*
   * Userspace API for Switch Configuration
   */
  
  #ifndef __NET_CONFIG_SWITCH_H__
  #define __NET_CONFIG_SWITCH_H__
  
  enum {
  	CONFIG_SWITCH_INVALID,
  	CONFIG_SWITCH_ADD_MULTICAST,
  	CONFIG_SWITCH_DEL_MULTICAST,
  	CONFIG_SWITCH_ADD_VLAN,
  	CONFIG_SWITCH_DEL_VLAN,
  	CONFIG_SWITCH_SET_PORT_CONFIG,
  	CONFIG_SWITCH_GET_PORT_CONFIG,
  	CONFIG_SWITCH_ADD_UNKNOWN_VLAN_INFO,
  	CONFIG_SWITCH_GET_PORT_STATE,
  	CONFIG_SWITCH_SET_PORT_STATE,
  	CONFIG_SWITCH_GET_PORT_VLAN_CONFIG,
  	CONFIG_SWITCH_SET_PORT_VLAN_CONFIG,
  	CONFIG_SWITCH_RATELIMIT,
  };
  
  enum {
  	PORT_STATE_DISABLED = 0,
  	PORT_STATE_BLOCKED,
  	PORT_STATE_LEARN,
  	PORT_STATE_FORWARD,
  };
  
  /*
   * Pass all unused parameters as zero is recomented.
   */
  struct net_switch_config {
  	unsigned int cmd;	/* API to be invoked by the kernel driver */
  
  	unsigned int	port;
  	unsigned int	vid;		/* VLAN identifier */
  	unsigned char	unreg_multi;	/* unreg multicast Egress Ports */
  	unsigned char	reg_multi;	/* register multicast Egress ports */
  	unsigned char	untag_port;	/* Untag ports */
  	unsigned char	addr[6];
  	unsigned int	super;
  	unsigned char	unknown_vlan_member;
  	unsigned char	unknown_vlan_untag;
  	unsigned int	unknown_vlan_unreg_multi;
  	unsigned int	unknown_vlan_reg_multi;
  	unsigned int	port_state;
  	unsigned int	prio;
  	bool		vlan_cfi;
  	unsigned int	bcast_rate_limit;
  	unsigned int	mcast_rate_limit;
  	bool		direction;
  	struct ethtool_cmd ecmd;
  
  	unsigned int ret_type;   /* Return  Success/Failure */
  };
  
  #endif /* __NET_CONFIG_SWITCH_H__*/