• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/drivers/char/rtl8365mb/
1/*
2 * Copyright(c) Realtek Semiconductor Corporation, 2008
3 * All rights reserved.
4 *
5 * $Revision: 49203 $
6 * $Date: 2014-07-15 11:28:36 +0800 (������, 15 ������ 2014) $
7 *
8 * Purpose : Definition function prototype of RTK switch API.
9 *
10 * Feature : Function prototype definition
11 *
12 */
13
14#ifndef __RTK_SWITCH_H__
15#define __RTK_SWITCH_H__
16
17#include <rtk_types.h>
18#ifdef _CFE_
19#include "lib_types.h"
20#include "lib_printf.h"
21#include "lib_physio.h"
22#include "cfe.h"
23#include "cfe_error.h"
24#include "cfe_iocb.h"
25#include "cfe_device.h"
26#include "cfe_timer.h"
27#endif
28
29#define UNDEFINE_PHY_PORT   (0xFF)
30#define RTK_SWITCH_PORT_NUM (32)
31
32#define MAXPKTLEN_CFG_ID_MAX (1)
33
34#define RTK_SWITCH_MAX_PKTLEN (0x3FFF)
35
36typedef enum init_state_e
37{
38    INIT_NOT_COMPLETED = 0,
39    INIT_COMPLETED,
40    INIT_STATE_END
41} init_state_t;
42
43typedef enum switch_chip_e
44{
45    CHIP_RTL8367C = 0,
46    CHIP_RTL8370B,
47    CHIP_END
48}switch_chip_t;
49
50typedef enum port_type_e
51{
52    UTP_PORT = 0,
53    EXT_PORT,
54    UNKNOWN_PORT = 0xFF,
55    PORT_TYPE_END
56}port_type_t;
57
58typedef struct rtk_switch_halCtrl_s
59{
60    switch_chip_t   switch_type;
61    rtk_uint32      l2p_port[RTK_SWITCH_PORT_NUM];
62    rtk_uint32      p2l_port[RTK_SWITCH_PORT_NUM];
63    port_type_t     log_port_type[RTK_SWITCH_PORT_NUM];
64    rtk_uint32      ptp_port[RTK_SWITCH_PORT_NUM];
65    rtk_uint32      valid_portmask;
66    rtk_uint32      valid_utp_portmask;
67    rtk_uint32      valid_ext_portmask;
68    rtk_uint32      min_phy_port;
69    rtk_uint32      max_phy_port;
70    rtk_uint32      phy_portmask;
71    rtk_uint32      combo_logical_port;
72    rtk_uint32      hsg_logical_port;
73    rtk_uint32      max_meter_id;
74    rtk_uint32      max_lut_addr_num;
75    rtk_uint32      max_trunk_id;
76
77}rtk_switch_halCtrl_t;
78
79typedef enum rtk_switch_maxPktLen_linkSpeed_e {
80     MAXPKTLEN_LINK_SPEED_FE = 0,
81     MAXPKTLEN_LINK_SPEED_GE,
82     MAXPKTLEN_LINK_SPEED_END,
83} rtk_switch_maxPktLen_linkSpeed_t;
84
85#define RTK_SWITCH_CMDS {			\
86     CASEID(INIT_SWITCH),			\
87     CASEID(POWERUP_LANPORTS),			\
88     CASEID(BAD_ADDR_X),			\
89     CASEID(POWERDOWN_LANPORTS),		\
90     CASEID(SOFT_RESET),			\
91     CASEID(GET_REG),				\
92     CASEID(SET_REG),				\
93     CASEID(TEST_REG),				\
94     CASEID(RESET_PORT),			\
95     CASEID(GET_LANPORTS_LINK_STATUS),		\
96     CASEID(GET_PORT_STAT),			\
97     CASEID(GET_PORT_SPEED),			\
98     CASEID(SET_EXT_TXDELAY),			\
99     CASEID(SET_EXT_RXDELAY),			\
100     CASEID(SET_EXT_MODE),			\
101     CASEID(GET_CPU),				\
102     CASEID(SET_CPU),				\
103     CASEID(GET_RTK_PHYSTATES),			\
104     CASEID(MAX_REQ),				\
105}
106
107#define CASEID(a)	a
108typedef enum RTK_SWITCH_CMDS rtk_switch_cmds_e;
109#undef CASEID
110
111typedef struct rtk_asic_s {
112    rtk_uint32      rtk_reg;
113    rtk_uint32      rtk_val;
114} rtk_asic_t;
115
116typedef enum stb_LANWAN_config_e {
117     LLLLW,	/* default mode (if rtk_switch is the main switch)*/
118     LLLWW,
119     LLWLW,
120     LWLLW,
121     WLLLW,
122     LLWWW,
123     ALL_LAN = 100,	/* wan port is as lan port */
124     NO_WAN_PORT = 101
125} stb_config_t;
126
127/* UTIL MACRO */
128#define RTK_CHK_INIT_STATE()                                \
129    do                                                      \
130    {                                                       \
131        if(rtk_switch_initialState_get() != INIT_COMPLETED) \
132        {                                                   \
133            return RT_ERR_NOT_INIT;                         \
134        }                                                   \
135    }while(0)
136
137#define RTK_CHK_PORT_VALID(__port__)                            \
138    do                                                          \
139    {                                                           \
140        if(rtk_switch_logicalPortCheck(__port__) != RT_ERR_OK)  \
141        {                                                       \
142            return RT_ERR_PORT_ID;                              \
143        }                                                       \
144    }while(0)
145
146#define RTK_CHK_PORT_IS_UTP(__port__)                           \
147    do                                                          \
148    {                                                           \
149        if(rtk_switch_isUtpPort(__port__) != RT_ERR_OK)         \
150        {                                                       \
151            return RT_ERR_PORT_ID;                              \
152        }                                                       \
153    }while(0)
154
155#define RTK_CHK_PORT_IS_EXT(__port__)                           \
156    do                                                          \
157    {                                                           \
158        if(rtk_switch_isExtPort(__port__) != RT_ERR_OK)         \
159        {                                                       \
160            return RT_ERR_PORT_ID;                              \
161        }                                                       \
162    }while(0)
163
164#define RTK_CHK_PORT_IS_COMBO(__port__)                           \
165    do                                                          \
166    {                                                           \
167        if(rtk_switch_isComboPort(__port__) != RT_ERR_OK)         \
168        {                                                       \
169            return RT_ERR_PORT_ID;                              \
170        }                                                       \
171    }while(0)
172
173#define RTK_CHK_PORT_IS_PTP(__port__)                           \
174    do                                                          \
175    {                                                           \
176        if(rtk_switch_isPtpPort(__port__) != RT_ERR_OK)         \
177        {                                                       \
178            return RT_ERR_PORT_ID;                              \
179        }                                                       \
180    }while(0)
181
182#define RTK_CHK_PORTMASK_VALID(__portmask__)                        \
183    do                                                              \
184    {                                                               \
185        if(rtk_switch_isPortMaskValid(__portmask__) != RT_ERR_OK)   \
186        {                                                           \
187            return RT_ERR_PORT_MASK;                                  \
188        }                                                           \
189    }while(0)
190
191#define RTK_CHK_PORTMASK_VALID_ONLY_UTP(__portmask__)               \
192    do                                                              \
193    {                                                               \
194        if(rtk_switch_isPortMaskUtp(__portmask__) != RT_ERR_OK)   \
195        {                                                           \
196            return RT_ERR_PORT_MASK;                                  \
197        }                                                           \
198    }while(0)
199
200#define RTK_CHK_PORTMASK_VALID_ONLY_EXT(__portmask__)               \
201    do                                                              \
202    {                                                               \
203        if(rtk_switch_isPortMaskExt(__portmask__) != RT_ERR_OK)   \
204        {                                                           \
205            return RT_ERR_PORT_MASK;                                  \
206        }                                                           \
207    }while(0)
208
209#define RTK_PORTMASK_IS_PORT_SET(__portmask__, __port__)    (((__portmask__).bits[0] & (0x00000001 << __port__)) ? 1 : 0)
210#define RTK_PORTMASK_IS_EMPTY(__portmask__)                 (((__portmask__).bits[0] == 0) ? 1 : 0)
211#define RTK_PORTMASK_CLEAR(__portmask__)                    ((__portmask__).bits[0] = 0)
212#define RTK_PORTMASK_PORT_SET(__portmask__, __port__)       ((__portmask__).bits[0] |= (0x00000001 << __port__))
213#define RTK_PORTMASK_PORT_CLEAR(__portmask__, __port__)     ((__portmask__).bits[0] &= ~(0x00000001 << __port__))
214#define RTK_PORTMASK_ALLPORT_SET(__portmask__)              (rtk_switch_logPortMask_get(&__portmask__))
215#define RTK_PORTMASK_SCAN(__portmask__, __port__)           for(__port__ = 0; __port__ < RTK_SWITCH_PORT_NUM; __port__++)  if(RTK_PORTMASK_IS_PORT_SET(__portmask__, __port__))
216#define RTK_PORTMASK_COMPARE(__portmask_A__, __portmask_B__)    ((__portmask_A__).bits[0] - (__portmask_B__).bits[0])
217
218#define RTK_SCAN_ALL_PHY_PORTMASK(__port__)                 for(__port__ = 0; __port__ < RTK_SWITCH_PORT_NUM; __port__++)  if( (rtk_switch_phyPortMask_get() & (0x00000001 << __port__)))
219#define RTK_SCAN_ALL_LOG_PORT(__port__)                     for(__port__ = 0; __port__ < RTK_SWITCH_PORT_NUM; __port__++)  if( rtk_switch_logicalPortCheck(__port__) == RT_ERR_OK)
220#define RTK_SCAN_ALL_LOG_PORTMASK(__portmask__)             for((__portmask__).bits[0] = 0; (__portmask__).bits[0] < 0x7FFFF; (__portmask__).bits[0]++)  if( rtk_switch_isPortMaskValid(&__portmask__) == RT_ERR_OK)
221
222/* Port mask defination */
223#define RTK_PHY_PORTMASK_ALL                                (rtk_switch_phyPortMask_get())
224
225/* Port defination*/
226#define RTK_MAX_LOGICAL_PORT_ID                             (rtk_switch_maxLogicalPort_get())
227
228/* Trunk ID defination*/
229#define RTK_MAX_TRUNK_GROUP_ID                              (rtk_switch_maxTrunkId_get())
230
231/* Function Name:
232 *      rtk_switch_probe
233 * Description:
234 *      Probe switch
235 * Input:
236 *      None
237 * Output:
238 *      None
239 * Return:
240 *      RT_ERR_OK       - Switch probed
241 *      RT_ERR_FAILED   - Switch Unprobed.
242 * Note:
243 *
244 */
245extern rtk_api_ret_t rtk_switch_probe(switch_chip_t *pSwitchChip);
246
247/* Function Name:
248 *      rtk_switch_initialState_set
249 * Description:
250 *      Set initial status
251 * Input:
252 *      state   - Initial state;
253 * Output:
254 *      None
255 * Return:
256 *      RT_ERR_OK       - Initialized
257 *      RT_ERR_FAILED   - Uninitialized
258 * Note:
259 *
260 */
261extern rtk_api_ret_t rtk_switch_initialState_set(init_state_t state);
262
263/* Function Name:
264 *      rtk_switch_initialState_get
265 * Description:
266 *      Get initial status
267 * Input:
268 *      None
269 * Output:
270 *      None
271 * Return:
272 *      INIT_COMPLETED     - Initialized
273 *      INIT_NOT_COMPLETED - Uninitialized
274 * Note:
275 *
276 */
277extern init_state_t rtk_switch_initialState_get(void);
278
279/* Function Name:
280 *      rtk_switch_logicalPortCheck
281 * Description:
282 *      Check logical port ID.
283 * Input:
284 *      logicalPort     - logical port ID
285 * Output:
286 *      None
287 * Return:
288 *      RT_ERR_OK       - Port ID is correct
289 *      RT_ERR_FAILED   - Port ID is not correct
290 *      RT_ERR_NOT_INIT - Not Initialize
291 * Note:
292 *
293 */
294extern rtk_api_ret_t rtk_switch_logicalPortCheck(rtk_port_t logicalPort);
295
296/* Function Name:
297 *      rtk_switch_isUtpPort
298 * Description:
299 *      Check is logical port a UTP port
300 * Input:
301 *      logicalPort     - logical port ID
302 * Output:
303 *      None
304 * Return:
305 *      RT_ERR_OK       - Port ID is a UTP port
306 *      RT_ERR_FAILED   - Port ID is not a UTP port
307 *      RT_ERR_NOT_INIT - Not Initialize
308 * Note:
309 *
310 */
311extern rtk_api_ret_t rtk_switch_isUtpPort(rtk_port_t logicalPort);
312
313/* Function Name:
314 *      rtk_switch_isExtPort
315 * Description:
316 *      Check is logical port a Extension port
317 * Input:
318 *      logicalPort     - logical port ID
319 * Output:
320 *      None
321 * Return:
322 *      RT_ERR_OK       - Port ID is a EXT port
323 *      RT_ERR_FAILED   - Port ID is not a EXT port
324 *      RT_ERR_NOT_INIT - Not Initialize
325 * Note:
326 *
327 */
328extern rtk_api_ret_t rtk_switch_isExtPort(rtk_port_t logicalPort);
329
330/* Function Name:
331 *      rtk_switch_isHsgPort
332 * Description:
333 *      Check is logical port a HSG port
334 * Input:
335 *      logicalPort     - logical port ID
336 * Output:
337 *      None
338 * Return:
339 *      RT_ERR_OK       - Port ID is a HSG port
340 *      RT_ERR_FAILED   - Port ID is not a HSG port
341 *      RT_ERR_NOT_INIT - Not Initialize
342 * Note:
343 *
344 */
345extern rtk_api_ret_t rtk_switch_isHsgPort(rtk_port_t logicalPort);
346
347/* Function Name:
348 *      rtk_switch_isComboPort
349 * Description:
350 *      Check is logical port a Combo port
351 * Input:
352 *      logicalPort     - logical port ID
353 * Output:
354 *      None
355 * Return:
356 *      RT_ERR_OK       - Port ID is a combo port
357 *      RT_ERR_FAILED   - Port ID is not a combo port
358 *      RT_ERR_NOT_INIT - Not Initialize
359 * Note:
360 *
361 */
362extern rtk_api_ret_t rtk_switch_isComboPort(rtk_port_t logicalPort);
363
364/* Function Name:
365 *      rtk_switch_ComboPort_get
366 * Description:
367 *      Get Combo port ID
368 * Input:
369 *      None
370 * Output:
371 *      None
372 * Return:
373 *      Port ID of combo port
374 * Note:
375 *
376 */
377extern rtk_uint32 rtk_switch_ComboPort_get(void);
378
379/* Function Name:
380 *      rtk_switch_isPtpPort
381 * Description:
382 *      Check is logical port a PTP port
383 * Input:
384 *      logicalPort     - logical port ID
385 * Output:
386 *      None
387 * Return:
388 *      RT_ERR_OK       - Port ID is a PTP port
389 *      RT_ERR_FAILED   - Port ID is not a PTP port
390 *      RT_ERR_NOT_INIT - Not Initialize
391 * Note:
392 *
393 */
394extern rtk_api_ret_t rtk_switch_isPtpPort(rtk_port_t logicalPort);
395
396/* Function Name:
397 *      rtk_switch_port_L2P_get
398 * Description:
399 *      Get physical port ID
400 * Input:
401 *      logicalPort       - logical port ID
402 * Output:
403 *      None
404 * Return:
405 *      Physical port ID
406 * Note:
407 *
408 */
409extern rtk_uint32 rtk_switch_port_L2P_get(rtk_port_t logicalPort);
410
411/* Function Name:
412 *      rtk_switch_port_P2L_get
413 * Description:
414 *      Get logical port ID
415 * Input:
416 *      physicalPort       - physical port ID
417 * Output:
418 *      None
419 * Return:
420 *      logical port ID
421 * Note:
422 *
423 */
424extern rtk_port_t rtk_switch_port_P2L_get(rtk_uint32 physicalPort);
425
426/* Function Name:
427 *      rtk_switch_isPortMaskValid
428 * Description:
429 *      Check portmask is valid or not
430 * Input:
431 *      pPmask       - logical port mask
432 * Output:
433 *      None
434 * Return:
435 *      RT_ERR_OK           - port mask is valid
436 *      RT_ERR_FAILED       - port mask is not valid
437 *      RT_ERR_NOT_INIT     - Not Initialize
438 *      RT_ERR_NULL_POINTER - Null pointer
439 * Note:
440 *
441 */
442extern rtk_api_ret_t rtk_switch_isPortMaskValid(rtk_portmask_t *pPmask);
443
444/* Function Name:
445 *      rtk_switch_isPortMaskUtp
446 * Description:
447 *      Check all ports in portmask are only UTP port
448 * Input:
449 *      pPmask       - logical port mask
450 * Output:
451 *      None
452 * Return:
453 *      RT_ERR_OK           - Only UTP port in port mask
454 *      RT_ERR_FAILED       - Not only UTP port in port mask
455 *      RT_ERR_NOT_INIT     - Not Initialize
456 *      RT_ERR_NULL_POINTER - Null pointer
457 * Note:
458 *
459 */
460extern rtk_api_ret_t rtk_switch_isPortMaskUtp(rtk_portmask_t *pPmask);
461
462/* Function Name:
463 *      rtk_switch_isPortMaskExt
464 * Description:
465 *      Check all ports in portmask are only EXT port
466 * Input:
467 *      pPmask       - logical port mask
468 * Output:
469 *      None
470 * Return:
471 *      RT_ERR_OK           - Only EXT port in port mask
472 *      RT_ERR_FAILED       - Not only EXT port in port mask
473 *      RT_ERR_NOT_INIT     - Not Initialize
474 *      RT_ERR_NULL_POINTER - Null pointer
475 * Note:
476 *
477 */
478extern rtk_api_ret_t rtk_switch_isPortMaskExt(rtk_portmask_t *pPmask);
479
480/* Function Name:
481 *      rtk_switch_portmask_L2P_get
482 * Description:
483 *      Get physicl portmask from logical portmask
484 * Input:
485 *      pLogicalPmask       - logical port mask
486 * Output:
487 *      pPhysicalPortmask   - physical port mask
488 * Return:
489 *      RT_ERR_OK           - OK
490 *      RT_ERR_NOT_INIT     - Not Initialize
491 *      RT_ERR_NULL_POINTER - Null pointer
492 *      RT_ERR_PORT_MASK    - Error port mask
493 * Note:
494 *
495 */
496extern rtk_api_ret_t rtk_switch_portmask_L2P_get(rtk_portmask_t *pLogicalPmask, rtk_uint32 *pPhysicalPortmask);
497
498/* Function Name:
499 *      rtk_switch_portmask_P2L_get
500 * Description:
501 *      Get logical portmask from physical portmask
502 * Input:
503 *      physicalPortmask    - physical port mask
504 * Output:
505 *      pLogicalPmask       - logical port mask
506 * Return:
507 *      RT_ERR_OK           - OK
508 *      RT_ERR_NOT_INIT     - Not Initialize
509 *      RT_ERR_NULL_POINTER - Null pointer
510 *      RT_ERR_PORT_MASK    - Error port mask
511 * Note:
512 *
513 */
514extern rtk_api_ret_t rtk_switch_portmask_P2L_get(rtk_uint32 physicalPortmask, rtk_portmask_t *pLogicalPmask);
515
516/* Function Name:
517 *      rtk_switch_phyPortMask_get
518 * Description:
519 *      Get physical portmask
520 * Input:
521 *      None
522 * Output:
523 *      None
524 * Return:
525 *      0x00                - Not Initialize
526 *      Other value         - Physical port mask
527 * Note:
528 *
529 */
530rtk_uint32 rtk_switch_phyPortMask_get(void);
531
532/* Function Name:
533 *      rtk_switch_logPortMask_get
534 * Description:
535 *      Get Logical portmask
536 * Input:
537 *      None
538 * Output:
539 *      None
540 * Return:
541 *      RT_ERR_OK           - OK
542 *      RT_ERR_NOT_INIT     - Not Initialize
543 *      RT_ERR_NULL_POINTER - Null pointer
544 * Note:
545 *
546 */
547rtk_api_ret_t rtk_switch_logPortMask_get(rtk_portmask_t *pPortmask);
548
549/* Function Name:
550 *      rtk_switch_init
551 * Description:
552 *      Set chip to default configuration enviroment
553 * Input:
554 *      None
555 * Output:
556 *      None
557 * Return:
558 *      RT_ERR_OK           - OK
559 *      RT_ERR_FAILED       - Failed
560 *      RT_ERR_SMI          - SMI access error
561 * Note:
562 *      The API can set chip registers to default configuration for different release chip model.
563 */
564extern rtk_api_ret_t rtk_switch_init(void);
565
566/* Function Name:
567 *      rtk_switch_portMaxPktLen_set
568 * Description:
569 *      Set Max packet length
570 * Input:
571 *      port    - Port ID
572 *      speed   - Speed
573 *      cfgId   - Configuration ID
574 * Output:
575 *      None.
576 * Return:
577 *      RT_ERR_OK           - OK
578 *      RT_ERR_FAILED       - Failed
579 *      RT_ERR_SMI          - SMI access error
580 *      RT_ERR_INPUT        - Error Input
581 * Note:
582 */
583extern rtk_api_ret_t rtk_switch_portMaxPktLen_set(rtk_port_t port, rtk_switch_maxPktLen_linkSpeed_t speed, rtk_uint32 cfgId);
584
585/* Function Name:
586 *      rtk_switch_portMaxPktLen_get
587 * Description:
588 *      Get Max packet length
589 * Input:
590 *      port    - Port ID
591 *      speed   - Speed
592 * Output:
593 *      pCfgId  - Configuration ID
594 * Return:
595 *      RT_ERR_OK           - OK
596 *      RT_ERR_FAILED       - Failed
597 *      RT_ERR_SMI          - SMI access error
598 *      RT_ERR_INPUT        - Error Input
599 * Note:
600 */
601extern rtk_api_ret_t rtk_switch_portMaxPktLen_get(rtk_port_t port, rtk_switch_maxPktLen_linkSpeed_t speed, rtk_uint32 *pCfgId);
602
603/* Function Name:
604 *      rtk_switch_maxPktLenCfg_set
605 * Description:
606 *      Set Max packet length configuration
607 * Input:
608 *      cfgId   - Configuration ID
609 *      pktLen  - Max packet length
610 * Output:
611 *      None.
612 * Return:
613 *      RT_ERR_OK           - OK
614 *      RT_ERR_FAILED       - Failed
615 *      RT_ERR_SMI          - SMI access error
616 *      RT_ERR_INPUT        - Error Input
617 * Note:
618 */
619extern rtk_api_ret_t rtk_switch_maxPktLenCfg_set(rtk_uint32 cfgId, rtk_uint32 pktLen);
620
621/* Function Name:
622 *      rtk_switch_maxPktLenCfg_get
623 * Description:
624 *      Get Max packet length configuration
625 * Input:
626 *      cfgId   - Configuration ID
627 *      pPktLen - Max packet length
628 * Output:
629 *      None.
630 * Return:
631 *      RT_ERR_OK           - OK
632 *      RT_ERR_FAILED       - Failed
633 *      RT_ERR_SMI          - SMI access error
634 *      RT_ERR_INPUT        - Error Input
635 * Note:
636 */
637extern rtk_api_ret_t rtk_switch_maxPktLenCfg_get(rtk_uint32 cfgId, rtk_uint32 *pPktLen);
638
639/* Function Name:
640 *      rtk_switch_greenEthernet_set
641 * Description:
642 *      Set all Ports Green Ethernet state.
643 * Input:
644 *      enable - Green Ethernet state.
645 * Output:
646 *      None
647 * Return:
648 *      RT_ERR_OK       - OK
649 *      RT_ERR_FAILED   - Failed
650 *      RT_ERR_SMI      - SMI access error
651 *      RT_ERR_ENABLE   - Invalid enable input.
652 * Note:
653 *      This API can set all Ports Green Ethernet state.
654 *      The configuration is as following:
655 *      - DISABLE
656 *      - ENABLE
657 */
658extern rtk_api_ret_t rtk_switch_greenEthernet_set(rtk_enable_t enable);
659
660/* Function Name:
661 *      rtk_switch_greenEthernet_get
662 * Description:
663 *      Get all Ports Green Ethernet state.
664 * Input:
665 *      None
666 * Output:
667 *      pEnable - Green Ethernet state.
668 * Return:
669 *      RT_ERR_OK              - OK
670 *      RT_ERR_FAILED          - Failed
671 *      RT_ERR_SMI             - SMI access error
672 * Note:
673 *      This API can get Green Ethernet state.
674 */
675extern rtk_api_ret_t rtk_switch_greenEthernet_get(rtk_enable_t *pEnable);
676
677/* Function Name:
678 *      rtk_switch_maxLogicalPort_get
679 * Description:
680 *      Get Max logical port ID
681 * Input:
682 *      None
683 * Output:
684 *      None
685 * Return:
686 *      Max logical port
687 * Note:
688 *      This API can get max logical port
689 */
690extern rtk_port_t rtk_switch_maxLogicalPort_get(void);
691
692/* Function Name:
693 *      rtk_switch_maxMeterId_get
694 * Description:
695 *      Get Max Meter ID
696 * Input:
697 *      None
698 * Output:
699 *      None
700 * Return:
701 *      0x00                - Not Initialize
702 *      Other value         - Max Meter ID
703 * Note:
704 *
705 */
706extern rtk_uint32 rtk_switch_maxMeterId_get(void);
707
708/* Function Name:
709 *      rtk_switch_maxLutAddrNumber_get
710 * Description:
711 *      Get Max LUT Address number
712 * Input:
713 *      None
714 * Output:
715 *      None
716 * Return:
717 *      0x00                - Not Initialize
718 *      Other value         - Max LUT Address number
719 * Note:
720 *
721 */
722extern rtk_uint32 rtk_switch_maxLutAddrNumber_get(void);
723
724/* Function Name:
725 *      rtk_switch_maxTrunkId_get
726 * Description:
727 *      Get Max Trunk ID
728 * Input:
729 *      None
730 * Output:
731 *      None
732 * Return:
733 *      0x00                - Not Initialize
734 *      Other value         - Max Trunk ID
735 * Note:
736 *
737 */
738extern rtk_uint32 rtk_switch_maxTrunkId_get(void);
739
740#endif
741