2 * Copyright (C) 2013 Realtek Semiconductor Corp.
5 * Unless you and Realtek execute a separate written software license
6 * agreement governing use of this software, this software is licensed
7 * to you under the terms of the GNU General Public License version 2,
8 * available at https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
11 * $Date: 2017-03-08 15:13:58 +0800 (週三, 08 三月 2017) $
13 * Purpose : RTL8367C switch high-level API for RTL8367C
14 * Feature : Port isolation related functions
18 #include <rtl8367c_asicdrv_portIsolation.h>
20 * rtl8367c_setAsicPortIsolationPermittedPortmask
22 * Set permitted port isolation portmask
24 * port - Physical port number (0~10)
25 * permitPortmask - port mask
30 * RT_ERR_SMI - SMI access error
31 * RT_ERR_PORT_ID - Invalid port number
32 * RT_ERR_PORT_MASK - Invalid portmask
36 ret_t
rtl8367c_setAsicPortIsolationPermittedPortmask(rtk_uint32 port
, rtk_uint32 permitPortmask
)
38 if(port
>= RTL8367C_PORTNO
)
39 return RT_ERR_PORT_ID
;
41 if( permitPortmask
> RTL8367C_PORTMASK
)
42 return RT_ERR_PORT_MASK
;
44 return rtl8367c_setAsicReg(RTL8367C_PORT_ISOLATION_PORT_MASK_REG(port
), permitPortmask
);
47 * rtl8367c_getAsicPortIsolationPermittedPortmask
49 * Get permitted port isolation portmask
51 * port - Physical port number (0~10)
52 * pPermitPortmask - port mask
57 * RT_ERR_SMI - SMI access error
58 * RT_ERR_PORT_ID - Invalid port number
62 ret_t
rtl8367c_getAsicPortIsolationPermittedPortmask(rtk_uint32 port
, rtk_uint32
*pPermitPortmask
)
64 if(port
>= RTL8367C_PORTNO
)
65 return RT_ERR_PORT_ID
;
67 return rtl8367c_getAsicReg(RTL8367C_PORT_ISOLATION_PORT_MASK_REG(port
), pPermitPortmask
);
70 * rtl8367c_setAsicPortIsolationEfid
72 * Set port isolation EFID
74 * port - Physical port number (0~10)
80 * RT_ERR_SMI - SMI access error
81 * RT_ERR_PORT_ID - Invalid port number
82 * RT_ERR_OUT_OF_RANGE - Input parameter out of range
84 * EFID is used in individual learning in filtering database
86 ret_t
rtl8367c_setAsicPortIsolationEfid(rtk_uint32 port
, rtk_uint32 efid
)
88 if(port
>= RTL8367C_PORTNO
)
89 return RT_ERR_PORT_ID
;
91 if( efid
> RTL8367C_EFIDMAX
)
92 return RT_ERR_OUT_OF_RANGE
;
94 return rtl8367c_setAsicRegBits(RTL8367C_PORT_EFID_REG(port
), RTL8367C_PORT_EFID_MASK(port
), efid
);
97 * rtl8367c_getAsicPortIsolationEfid
99 * Get port isolation EFID
101 * port - Physical port number (0~10)
106 * RT_ERR_OK - Success
107 * RT_ERR_SMI - SMI access error
108 * RT_ERR_PORT_ID - Invalid port number
112 ret_t
rtl8367c_getAsicPortIsolationEfid(rtk_uint32 port
, rtk_uint32
*pEfid
)
114 if(port
>= RTL8367C_PORTNO
)
115 return RT_ERR_PORT_ID
;
117 return rtl8367c_getAsicRegBits(RTL8367C_PORT_EFID_REG(port
), RTL8367C_PORT_EFID_MASK(port
), pEfid
);