#ifndef __portmgr_h__
#define __portmgr_h__

#define NUM_ALL_PORTS      (6)
#define NUM_OPTICAL_PORTS  (4)
#define FIRST_OPTICAL_PORT (0)
#define LAST_OPTICAL_PORT  (3)

#define PORT_STATUS_UNKNOWN    (0)
#define PORT_STATUS_UP         (1)
#define PORT_STATUS_DOWN       (2)
#define PORT_STATUS_FAILED     (3)

#define PORT_STATE_UP         (1)
#define PORT_STATE_DOWN       (2)

#define PHY_STATUS_UNKNOWN    (0)
#define PHY_STATUS_NORMAL     (1)
#define PHY_STATUS_POWERDOWN  (2)
#define PHY_STATUS_POWERUP    (3)

#define LHB_STATUS_UNKNOWN    (0)
#define LHB_STATUS_ENABLED    (1)
#define LHB_STATUS_DISABLED   (2)

#define PORT_EVENT_NO_EVENT   (0)
#define PORT_EVENT_LHB_DETECT (1)
#define PORT_EVENT_LHB_TMOUT  (2)
#define PORT_EVENT_PORT_UP    (3)
#define PORT_EVENT_PORT_DOWN  (4)

#define OPTICAL_STATUS_UNKNOWN   (0)
#define OPTICAL_STATUS_NO_SFP    (1)
#define OPTICAL_STATUS_NORMAL    (2)
#define OPTICAL_STATUS_TXDISABL  (3)
#define OPTICAL_STATUS_POWERDOWN (4)
#define OPTICAL_STATUS_NOT_OPTIC (5)
#define OPTICAL_STATUS_POWERUP   (6)

#define PORT_CONFIG_UPDOWN_MASK   (0x01)
#define PORT_CONFIG_UP            (0x01)
#define PORT_CONFIG_DOWN          (0x00)

#define PORT_CONFIG_FO_POWER_MASK (0x18)
#define PORT_CONFIG_FO_POWER_AUTO (0x08)
#define PORT_CONFIG_FO_POWER_ON   (0x10)
#define PORT_CONFIG_FO_POWER_OFF  (0x00)

#ifdef __cplusplus
extern "C" {
#endif

int portmgrInit(void);
int portmgrPortStatusRequest(int port, int state);
int portmgrPortStatusGet(int port, int *pState);

int portmgrOpticalStatusRequest(int port, int state);
int portmgrPhyStatusRequest(int port, int state);
int portmgrLhbStatusRequest(int port, int state);
int portmgrPortEnableCopper(void);
int portmgrPortEnableFiberConfig(void);

int portmgrPortEventNotify(int port, int event);

int portmgrPhyPowerSave(void);


#ifdef __cplusplus
}
#endif

#endif /* __portmgr_h__ */

