Пример #1
0
void
log_KeepLocal(int id, u_long *mask)
{
  if (id >= LogMIN && id <= LogMAXCONF) {
    LogMaskLocal |= MSK(id);
    *mask |= MSK(id);
  }
}
Пример #2
0
void hdmirx_phy_hw_reset(void)
{
    hdmirx_wr_bits_dwc(RA_SNPS_PHYG3_CTRL, MSK(2,0), 0x3);
    mdelay(1);
    hdmirx_wr_bits_dwc(RA_SNPS_PHYG3_CTRL, MSK(2,0), 0x2);
    mdelay(1);
    hdmirx_wr_bits_dwc(RA_SNPS_PHYG3_CTRL, MSK(2,0), 0x0);
}
Пример #3
0
static void
LogSetMaskLocal(void)
{
  struct prompt *p;

  LogMaskLocal = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
  for (p = promptlist; p; p = p->next)
    LogMaskLocal |= p->logmask;
}
Пример #4
0
int
log_IsKeptLocal(int id, u_long mask)
{
  if (id < LogMIN || id > LogMAX)
    return 0;
  if (id > LogMAXCONF)
    return LOG_KEPT_LOCAL | LOG_KEPT_SYSLOG;

  return ((mask & MSK(id)) ? LOG_KEPT_LOCAL : 0) |
    ((LogMask & MSK(id)) ? LOG_KEPT_SYSLOG : 0);
}
Пример #5
0
int
log_IsKept(int id)
{
  if (id == LogLOG)
    return LOG_KEPT_SYSLOG;
  if (id < LogMIN || id > LogMAX)
    return 0;
  if (id > LogMAXCONF)
    return LOG_KEPT_LOCAL | LOG_KEPT_SYSLOG;

  return ((LogMaskLocal & MSK(id)) ? LOG_KEPT_LOCAL : 0) |
    ((LogMask & MSK(id)) ? LOG_KEPT_SYSLOG : 0);
}
/**
 * PHY GEN 3 reset signal
 * @param[in,out] ctx context information
 * @param[in] enable enable/disable phy reset
 * @return error code
 */
int hdmi_rx_ctrl_phy_reset(struct hdmi_rx_ctrl *ctx, int enable)
{
	int error = 0;
	if (ctx == 0)
	{
		error = -EINVAL;
	}
	else
	{
		error = io_write(ctx, RA_SNPS_PHYG3_CTRL, MSK(1,0), enable);
	}
	return error;
}
Пример #7
0
void
log_Printf(int lev, const char *fmt,...)
{
  va_list ap;
  struct prompt *prompt;

  if (log_IsKept(lev)) {
    char nfmt[200];

    va_start(ap, fmt);
    if (promptlist && (log_IsKept(lev) & LOG_KEPT_LOCAL)) {
      if ((log_IsKept(LogTUN) & LOG_KEPT_LOCAL) && LogTunno != -1) {
        if (LogIfaceName)
          snprintf(nfmt, sizeof nfmt, "%s%d(%s): %s: %s", TUN_NAME,
	         LogTunno, LogIfaceName, log_Name(lev), fmt);
        else
          snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME,
	         LogTunno, log_Name(lev), fmt);
      } else
        snprintf(nfmt, sizeof nfmt, "%s: %s", log_Name(lev), fmt);

      if (log_PromptContext && lev == LogWARN)
        /* Warnings just go to the current prompt */
        prompt_vPrintf(log_PromptContext, nfmt, ap);
      else for (prompt = promptlist; prompt; prompt = prompt->next)
        if (lev > LogMAXCONF || (prompt->logmask & MSK(lev)))
          prompt_vPrintf(prompt, nfmt, ap);
    }
    va_end(ap);

    va_start(ap, fmt);
    if ((log_IsKept(lev) & LOG_KEPT_SYSLOG) &&
        (lev != LogWARN || !log_PromptContext)) {
      if ((log_IsKept(LogTUN) & LOG_KEPT_SYSLOG) && LogTunno != -1) {
        if (LogIfaceName)
          snprintf(nfmt, sizeof nfmt, "%s%d(%s): %s: %s", TUN_NAME,
	         LogTunno, LogIfaceName, log_Name(lev), fmt);
        else
          snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME,
	         LogTunno, log_Name(lev), fmt);
      } else
        snprintf(nfmt, sizeof nfmt, "%s: %s", log_Name(lev), fmt);
      vsyslog(syslogLevel(lev), nfmt, ap);
    }
    va_end(ap);
  }
}
Пример #8
0
void hdmirx_phy_pddq(int enable)
{
	hdmirx_wr_bits_dwc(RA_SNPS_PHYG3_CTRL, MSK(1,1), enable);
}
Пример #9
0
void hdmirx_phy_reset(bool enable)
{
	hdmirx_wr_bits_dwc(RA_SNPS_PHYG3_CTRL, MSK(1,0), enable);
}
Пример #10
0
static void phy_wrapper_svsretmode(int enable)
{
	hdmirx_wr_bits_dwc(RA_SNPS_PHYG3_CTRL, MSK(1,6), enable);
}
Пример #11
0
//#define PHY_GEN3_GLUE_I2C_SLAVE_ADDR	(0x48UL)
static void phy_set_cfgclk_freq(int cfgclk)
{
	hdmirx_wr_bits_dwc(RA_SNPS_PHYG3_CTRL, MSK(2,4), cfgclk);
}
Пример #12
0
void
log_DiscardAllLocal(u_long *mask)
{
  *mask = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
  LogSetMaskLocal();
}
Пример #13
0
void
log_Keep(int id)
{
  if (id >= LogMIN && id <= LogMAXCONF)
    LogMask |= MSK(id);
}
Пример #14
0
  "LQM",
  "Phase",
  "Physical",
  "Radius",
  "Sync",
  "TCP/IP",
  "Timer",
  "Tun",
  "Warning",
  "Error",
  "Alert"
};

#define MSK(n) (1<<((n)-1))

static u_long LogMask = MSK(LogPHASE);
static u_long LogMaskLocal = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
static int LogTunno = -1;
static const char *LogIfaceName;
static struct prompt *promptlist;	/* Where to log local stuff */
struct prompt *log_PromptContext;
int log_PromptListChanged;

struct prompt *
log_PromptList()
{
  return promptlist;
}

void
log_RegisterPrompt(struct prompt *prompt)