示例#1
0
文件: max5478.c 项目: ariavie/bcm
STATIC int
max5478_ioctl(int unit, int devno,
              int request, void* data, int len)
{
    int rv = SOC_E_NONE;
    uint16 msg0;
    uint8  msg1;
    max5478_t *params;

    switch (request) {
    case I2C_POT_IOC_SET:
        params = (max5478_t *)data;
        switch (params->wiper) {
        case I2C_POT_MSG_WIPER_A:
             msg0 = MAX5478_CMD_WIPER_A_VREG;
             msg1 = MAX5478_CMD_WIPER_A_VREG_X_NVREG;
            break;

        case I2C_POT_MSG_WIPER_B:
            msg0 = MAX5478_CMD_WIPER_B_CMD;
            msg1 = MAX5478_CMD_WIPER_B_VREG_X_NVREG;
            break;

        default:
            LOG_VERBOSE(BSL_LS_SOC_COMMON,
                        (BSL_META_U(unit,
                                    "POT%d: invalid wiper %d\n"),
                         devno, params->wiper));
            return SOC_E_PARAM;
        }

        /* Command byte VREG + data byte */
        msg0 = (msg0 << 8) | params->value;
        rv = soc_i2c_write_word(unit, soc_i2c_addr(unit, devno), msg0);
        if (rv == SOC_E_NONE) {
            soc_i2c_device(unit, devno)->tbyte +=2;
        }

        /* Transfer VREG to NVREG */
        rv = soc_i2c_write_byte(unit, soc_i2c_addr(unit, devno), msg1);
        if (rv == SOC_E_NONE) {
            soc_i2c_device(unit, devno)->tbyte++;
        }

        break;

    default:
        LOG_VERBOSE(BSL_LS_SOC_COMMON,
                    (BSL_META_U(unit,
                                "POT%d: invalid request %d\n"),
                     devno, request));
        return SOC_E_PARAM;
    }
    return rv;
}
示例#2
0
Handle openFileHandle(const char *path, u32 openFlags) {
  Handle fileHandle = 0;
  
  LOG_VERBOSE("openFileHandle: %s, %d", path, openFlags);
  FS_Path filePath = fsMakePath(PATH_ASCII, path);
  if(R_FAILED(FSUSER_OpenFile(&fileHandle, sdmcArchive, filePath, openFlags, 0))) {
    LOG_VERBOSE("FSUSER_OpenFile failed.");
    return(0);
  }
  
  LOG_VERBOSE("File opened successfully.");
  return(fileHandle);
}
示例#3
0
Handle openDirectory(const char *path) {
  Handle dir;

  LOG_VERBOSE("openDirectory: %s", path);
  FS_Path filePath = fsMakePath(PATH_ASCII, path);
  if(R_FAILED(FSUSER_OpenDirectory(&dir, sdmcArchive, filePath))) {
    LOG_VERBOSE("FSUSER_OpenDirectory failed.");
    return(0);
  }
  
  LOG_VERBOSE("Directory opened successfully.");
  return(dir);
}
示例#4
0
hash_map_t *hash_map_utils_new_from_string_params(const char *params) {
  assert(params != NULL);

  hash_map_t *map = hash_map_new(BUCKETS_NUM, hash_function_string, osi_free,
                                 osi_free, string_equals);
  if (!map)
    return NULL;

  char *str = osi_strdup(params);
  if (!str)
    return NULL;

  LOG_VERBOSE(LOG_TAG, "%s: source string: '%s'", __func__, str);

  // Parse |str| and add extracted key-and-value pair(s) in |map|.
  int items = 0;
  char *tmpstr;
  char *kvpair = strtok_r(str, ";", &tmpstr);
  while (kvpair && *kvpair) {
    char *eq = strchr(kvpair, '=');

    if (eq == kvpair)
      goto next_pair;

    char *key;
    char *value;
    if (eq) {
      key = osi_strndup(kvpair, eq - kvpair);

      // The increment of |eq| moves |eq| to the beginning of the value.
      ++eq;
      value = (*eq != '\0') ? osi_strdup(eq) : osi_strdup("");
    } else {
      key = osi_strdup(kvpair);
      value = osi_strdup("");
    }

    hash_map_set(map, key, value);

    items++;
next_pair:
    kvpair = strtok_r(NULL, ";", &tmpstr);
  }

  if (!items)
    LOG_VERBOSE(LOG_TAG, "%s: no items found in string\n", __func__);

  osi_free(str);
  return map;
}
示例#5
0
文件: board.c 项目: ariavie/bcm
/*
 * Function:
 *     board_probe
 * Purpose:
 *     Iterates across all registered board drivers, from the highest
 *     priority value to the lowest, and returns the name of the first
 *     board driver whose probe function returns BCM_E_NONE.
 * Parameters:
 *     none
 * Returns:
 *     !NULL - success
 *     NULL  - failed
 *
 */
char *
board_probe(void)
{
    board_reg_t *reg;
    bcm_info_t  *dev;
    int count;
    int rv = BCM_E_INTERNAL;
    char *name = NULL;

    BOARD_INIT_NULL;
    BOARD_LOCK;
    rv = _board_info(&count, &dev);

    if (BCM_SUCCESS(rv)) {
#if defined(BROADCOM_DEBUG)
        {
            int i;

            LOG_VERBOSE(BSL_LS_BOARD_COMMON,
                        (BSL_META("Board probe:\n")));
            for (i=0; i<count; i++) {
                LOG_VERBOSE(BSL_LS_BOARD_COMMON,
                            (BSL_META("  %2d: %s\n"),
                             i, board_device_name(i)));
            }
        }
#endif

        /* For each set of registered drivers */
        for (reg=driver_reg; reg != NULL; reg=reg->next) {
            if (!reg->driver->probe) {
                LOG_VERBOSE(BSL_LS_BOARD_COMMON,
                            (BSL_META("Board %s probe missing\n"),
                             reg->driver->name));
                continue;
            }
            rv = reg->driver->probe(reg->driver, count, dev);
            if (BCM_SUCCESS(rv)) {
                /* Board probe successful */
                name = reg->driver->name;
                break;
            }
        }

        FREE(dev);
    }
    BOARD_UNLOCK;

    return BCM_SUCCESS(rv) ? name : NULL;
}
示例#6
0
文件: pcitest.c 项目: ariavie/bcm
int
pci_test(int u, args_t *a, void *pa)
/*
 * Function: 	pci_test
 * Purpose:	Test basic PCI stuff on StrataSwitch.
 * Parameters:	u - unit #.
 *		a - pointer to arguments.
 *		pa - ignored cookie.
 * Returns:	0
 */
{
    int		i;

    COMPILER_REFERENCE(a);
    COMPILER_REFERENCE(pa);

    setup_pca_table(u);


    for (i = 0; i < pca_cnt; i++) {
	pca_t *p = &pca_table[i];
	uint32	read_val;

	/* If write - do write first */

	if (p->pca_flags & WR) {
	    LOG_VERBOSE(BSL_LS_APPL_TESTS,
                        (BSL_META_U(u,
                                    "Writing PCI Config 0x%x <--- 0x%x\n"),
                         p->pca_addr, p->pca_write));
	    if (bde->pci_conf_write(u, p->pca_addr, p->pca_write)){
		test_error(u, "PCI config write failed to address: 0x%x\n",
			   p->pca_addr);
		continue;		/* If test error returns */
	    }
	}
	read_val = bde->pci_conf_read(u, p->pca_addr);
	read_val &= p->pca_read_mask;
	LOG_VERBOSE(BSL_LS_APPL_TESTS,
                    (BSL_META_U(u,
                                "Reading PCI Config (Masked) 0x%x --> 0x%x\n"), 
                     p->pca_addr, read_val));
	if (read_val != p->pca_read) {
	    test_error(u, "PCI Config @0x%x Read 0x%x expected 0x%x\n",
		       p->pca_addr, read_val, p->pca_read);
	}
    }

    return(0);
}
示例#7
0
/*------------------------------------------------------------------------------
|    OMX_VideoProcessor::convertMetaData
+-----------------------------------------------------------------------------*/
inline
void OMX_MediaProcessor::convertMetaData()
{
   // TODO: It would be good to lock this somehow.
   AVDictionary* dictionary = m_omx_reader->getMetadata();

   AVDictionaryEntry* tag = NULL;
   LOG_VERBOSE(LOG_TAG, "MetaData");
   m_metadata.clear();
   while ((tag = av_dict_get(dictionary, "", tag, AV_DICT_IGNORE_SUFFIX))) {
      m_metadata.insert(tag->key, tag->value);
      LOG_VERBOSE(LOG_TAG, "Key: %s, Value: %s.", tag->key, tag->value);
   }
}
示例#8
0
/*------------------------------------------------------------------------------
|    OMX_VideoProcessor::cleanup
+-----------------------------------------------------------------------------*/
void OMX_MediaProcessor::cleanup()
{
   LOG_INFORMATION(LOG_TAG, "Cleaning up...");

#if 0
   if (m_refresh)
   {
      m_BcmHost.vc_tv_hdmi_power_on_best(
               tv_state.width,
               tv_state.height,
               tv_state.frame_rate,
               HDMI_NONINTERLACED,
               (EDID_MODE_MATCH_FLAG_T)(HDMI_MODE_MATCH_FRAMERATE|
                                        HDMI_MODE_MATCH_RESOLUTION|HDMI_MODE_MATCH_SCANMODE)
               );
   }
#endif

   LOG_VERBOSE(LOG_TAG, "Closing players...");
#ifdef ENABLE_SUBTITLES
   m_player_subtitles->Close();
#endif
   m_player_video->Close();
   m_player_audio->Close();

   if (m_omx_pkt) {
      m_omx_reader->FreePacket(m_omx_pkt);
      m_omx_pkt = NULL;
   }

   LOG_VERBOSE(LOG_TAG, "Closing players...");
   m_omx_reader->Close();
   m_metadata.clear();
   emit metadataChanged(m_metadata);

   vc_tv_show_info(0);

   // lcarlon: free the texture. Invoke freeTexture so that it is the user
   // of the class to do it cause it is commonly required to do it in the
   // current OpenGL and EGL context. Do it here, after the stop command is
   // considered finished: this is needed to avoid hardlock in case the
   // used wants to free the texture in his own thread, which would still
   // be blocked waiting for the stop command to finish.
   LOG_VERBOSE(LOG_TAG, "Freeing texture...");
   m_provider->freeTexture(m_textureData);
   m_textureData = NULL;
   emit textureInvalidated();

   LOG_INFORMATION(LOG_TAG, "Cleanup done.");
}
示例#9
0
	bool fill_input_buffer(std::string &error) {
		if (0 == strm.avail_in) {
			const unsigned char *data;
			ssize_t datasize;
			LOG_VERBOSE("fill_input_buffer: reading at offset %i\n", (int) reader.offset());
			if (!reader.read(4*1024, data, datasize)) {
				error.assign(reader.lastError());
				return false;
			}
			LOG_VERBOSE("fill_input_buffer: read %i bytes\n", (int) datasize);
			strm.next_in = data;
			strm.avail_in = datasize;
		}
		return true;
	}
float MediaPlayerPrivate::maxTimeLoaded() const
{
    // TODO
    LOG_VERBOSE(Media, "maxTimeLoaded");
    notImplemented();
    return duration();
}
float MediaPlayerPrivate::maxTimeBuffered() const
{
    notImplemented();
    LOG_VERBOSE(Media, "maxTimeBuffered");
    // rtsp streams are not buffered
    return m_isStreaming ? 0 : maxTimeLoaded();
}
示例#12
0
/**
 * Disconnect and clean up
 *
 * @param icb The connection control block
 */
static void
cleanup_disconnect(connection_t *cxn)
{
    uint8_t *data;
    biglist_t *ble;

    cxn->status.disconnect_count++;

    /* Close this socket. */
    if (cxn->sd >= 0) {
        ind_soc_socket_unregister(cxn->sd);
        close(cxn->sd);
    }
    cxn->sd = -1;

    cxn->generation_id++;

    /* @fixme Is it possible there's a message that should be processed? */
    LOG_VERBOSE(cxn, "Closing connection, current read buf has %d bytes",
                cxn->read_bytes);
    cxn->read_bytes = 0;
    /* Clear write queue */
    BIGLIST_FOREACH_DATA(ble, cxn->output_list, uint8_t *, data) {
        LOG_TRACE(cxn, "Freeing outgoing msg %p", data);
        INDIGO_MEM_FREE(data);
    }
    biglist_free(cxn->output_list);
    cxn->output_list = NULL;

    cxn->bytes_enqueued = 0;
    cxn->pkts_enqueued = 0;
    cxn->output_head_offset = 0;
}
示例#13
0
void getAllOpenGLEntryPoints()
{
    static bool haveProcs = false;
    if(haveProcs) return;

#define GET_PROC(name) *((void**)&name) = wglGetProcAddress(#name); DENG2_ASSERT(name != 0)

    LOG_AS("getAllOpenGLEntryPoints");

    LOG_VERBOSE("GL_VERSION: ") << (char const *) glGetString(GL_VERSION);

    GET_PROC(glActiveTexture);
    GET_PROC(glAttachShader);
    GET_PROC(glBindAttribLocation);
    GET_PROC(glBindBuffer);
    GET_PROC(glBindFramebuffer);
    GET_PROC(glBindRenderbuffer);
    GET_PROC(glBlendEquation);
    GET_PROC(glBufferData);
    GET_PROC(glCheckFramebufferStatus);
    GET_PROC(glCompileShader);
    GET_PROC(glCreateProgram);
    GET_PROC(glCreateShader);
    GET_PROC(glDeleteBuffers);
    GET_PROC(glDeleteFramebuffers);
    GET_PROC(glDeleteProgram);
    GET_PROC(glDeleteRenderbuffers);
    GET_PROC(glDeleteShader);
    GET_PROC(glDetachShader);
    GET_PROC(glDisableVertexAttribArray);
    GET_PROC(glEnableVertexAttribArray);
    GET_PROC(glFramebufferRenderbuffer);
    GET_PROC(glFramebufferTexture2D);
    GET_PROC(glGenBuffers);
    GET_PROC(glGenFramebuffers);
    GET_PROC(glGenerateMipmap);
    GET_PROC(glGenRenderbuffers);
    GET_PROC(glGetAttribLocation);
    GET_PROC(glGetProgramInfoLog);
    GET_PROC(glGetProgramiv);
    GET_PROC(glGetShaderInfoLog);
    GET_PROC(glGetShaderiv);
    GET_PROC(glGetShaderSource);
    GET_PROC(glGetUniformLocation);
    GET_PROC(glIsBuffer);
    GET_PROC(glLinkProgram);
    GET_PROC(glRenderbufferStorage);
    GET_PROC(glShaderSource);
    GET_PROC(glUniform1f);
    GET_PROC(glUniform1i);
    GET_PROC(glUniform2f);
    GET_PROC(glUniform3f);
    GET_PROC(glUniform4f);
    GET_PROC(glUniformMatrix3fv);
    GET_PROC(glUniformMatrix4fv);
    GET_PROC(glUseProgram);
    GET_PROC(glVertexAttribPointer);

    haveProcs = true;
}
示例#14
0
indigo_error_t
ind_core_enable_set(int enable)
{
    LOG_TRACE("OF state mgr enable called");

    INIT_CHECK;

    if (enable && !ind_core_module_enabled) {
        LOG_INFO("Enabling OF state mgr");
        if (CORE_EXPIRES_FLOWS(&ind_core_config)) {
            ind_soc_timer_event_register_with_priority(
                flow_expiration_timer, NULL,
                ind_core_config.stats_check_ms, -10);
        }
        ind_core_module_enabled = 1;
    } else if (!enable && ind_core_module_enabled) {
        LOG_INFO("Disabling OF state mgr");
        if (CORE_EXPIRES_FLOWS(&ind_core_config)) {
            ind_soc_timer_event_unregister(flow_expiration_timer, NULL);
        }
        ind_core_module_enabled = 0;
    } else {
        LOG_VERBOSE("Redundant enable call.  Currently %s",
                    ind_core_module_enabled ? "enabled" : "disabled");
    }

    return INDIGO_ERROR_NONE;
}
示例#15
0
文件: topo_brd.c 项目: ariavie/bcm
STATIC int
topo_sp_info_update(cpudb_entry_t *entry)
{
    int           i;
    int           unit;
    bcm_port_t    port;
    bcm_trunk_t   tid;
    bcm_module_t  modid = -1;
    int           topo_sp_max = COUNTOF(topo_sp);
    
    /* Load information from current system configuration */
    TOPO_DATA_LOCK;
    for (i = 0; i < topo_sp_max; i++) {
        unit = topo_sp[i].unit;
        port = topo_sp[i].port;
        
        if ((unit < 0) || (port < 0)) {
            continue;
        }
        
        if (BCM_SUCCESS(bcm_trunk_find(unit, modid,
                                       BCM_GPORT_DEVPORT(unit, port), &tid))) {
            topo_sp[i].tid = tid;
        } else {
            topo_sp[i].tid = -1;
        }
        LOG_VERBOSE(BSL_LS_TKS_TOPOLOGY,
                    (BSL_META_U(unit,
                    "Stack port %d: unit %d, port %d, tid %d\n"),
                     i, unit, port, topo_sp[i].tid));
    }
    TOPO_DATA_UNLOCK;

    return BCM_E_NONE;
}
示例#16
0
文件: CabManager.cpp 项目: Thalur/ak
bool CCabManager::Init(std::vector<TCabinetPtr> aCabinets, const TIndexData& aIndexValues)
{
   LOG_METHOD();
   iCabinets.swap(aCabinets);
   iResourceIndex.clear();
   iFileIndex.clear();
   const TSize size = iCabinets.size();
   if (size == 0) {
      return false;
   }
   if (size > 1) {
      std::stable_sort(iCabinets.begin(), iCabinets.end(), CmpCabinetsByPatch);
   }

   // Create the file prefix index
   LOG_DEBUG("Creating file prefix index");
   for (uint8_t i = static_cast<uint8_t>(size); i > 0; i--) {
      MergeIntoFileList(i-1, iCabinets[i-1]->GetFilePrefixList());
   }

   // Create the quick access index
   LOG_DEBUG("Creating quick access index");
   iResourceIndex.resize(aIndexValues.size() + 1, TIndexEntry(KINVALID, 0));
   for (const auto& resourceEntry : aIndexValues) {
      std::vector<TFileEntry>::iterator it = std::lower_bound(iFileIndex.begin(), iFileIndex.end(),
         resourceEntry.second, CmpFileNameIndex);
      if ((it != iFileIndex.end()) && (std::get<0>(*it) == resourceEntry.second)) {
         LOG_VERBOSE("Adding resource index to %d: %d, %s", resourceEntry.first, (int)std::get<2>(*it), resourceEntry.second.c_str());
         iResourceIndex[resourceEntry.first] = TIndexEntry(std::get<1>(*it), std::get<2>(*it));
      } else LOG_ERROR("File not found in cabinet index: %s", resourceEntry.second.c_str());
   }
   return true;
}
示例#17
0
QVariant SongListStandardItemModel::data(
        const QModelIndex & index,
        int role) const
{
    LOG_VERBOSE(__FUNCTION_NAME__);

    /* for the time being, I put static data into the model.
       if this causes performance issue, then I will consider dynamic data fetching.
    */

#if 0
    if(role == Qt::CheckStateRole && index.column() != 4)
    {
        return QVariant();
    }

    switch(index.column())
    {
        case 0:
            return QVariant(songs->at(index.column())->name.c_str());
        case 1:
            return QVariant(songs->at(index.column())->url.c_str());
        case 2:
            return QVariant(songs->at(index.column())->artistName.c_str());
        default:
            break;
    }
#endif

    return QStandardItemModel::data(index,role);
}
示例#18
0
bool ProgSymbolWriter::writeSymbolsToFile(const Prog *prog, const QString &dstFileName)
{
    LOG_VERBOSE("Writing symbols to '%1'", dstFileName);
    const QString fname = prog->getProject()->getSettings()->getOutputDirectory().absoluteFilePath(
        dstFileName);
    QSaveFile tgt(fname);

    if (!tgt.open(QFile::WriteOnly)) {
        LOG_ERROR("Cannot open '%1' for writing", fname);
        return false;
    }

    OStream f(&tgt);

    /* Print procs */
    f << "/* Functions: */\n";
    std::set<Function *> seen;

    for (UserProc *up : prog->getEntryProcs()) {
        printProcsRecursive(up, 0, f, seen);
    }

    f << "/* Leftovers: */\n";

    for (const auto &m : prog->getModuleList()) {
        for (Function *pp : *m) {
            if (!pp->isLib() && (seen.find(pp) == seen.end())) {
                printProcsRecursive(pp, 0, f, seen);
            }
        }
    }

    f.flush();
    return tgt.commit();
}
示例#19
0
	bool decodeFillBuffer(std::string &error) {
		for (;0 != strm.avail_out;) {
			LOG_VERBOSE("decodeFillBuffer: %i bytes to go\n", (int) strm.avail_out);

			if (!fill_input_buffer(error)) return false;

			if (0 == strm.avail_in) {
				error.assign("Unexpected end of file");
				return false;
			}

			lzma_ret ret = lzma_code(&strm, LZMA_RUN);
			if (LZMA_OK != ret && LZMA_STREAM_END != ret) {
				errnoLzmaToStr("failed decoding data", ret, error);
				return false;
			}

			if (0 == strm.avail_out) return true; // done filling buffer

			if (LZMA_STREAM_END == ret) {
				if (lzma_index_iter_next(&iter, LZMA_INDEX_ITER_ANY)) {
					error.assign("Unexepected end of file");
					return false;
				}
				/* restart decoder */
				if (!loadBlock(error)) return false;
			}
		}
		return true;
	}
示例#20
0
	void selectDefaultBuffer() {
		LOG_VERBOSE("selectDefaultBuffer\n");
		/* selectBuffer flushes the current buffer, so only call it when necesary */
		if (defaultOutputBuffer != currentBuffer || sizeof(defaultOutputBuffer) != currentBufferSize) {
			selectBuffer(defaultOutputBuffer, sizeof(defaultOutputBuffer));
		}
	}
示例#21
0
/**
 * Called after the busy mode worker thread and the event (sub-)loop has been stopped.
 */
static void endTask(BusyTask* task)
{
    DENG_ASSERT(task);
    DENG_ASSERT_IN_MAIN_THREAD();

    LOG_VERBOSE("Busy mode lasted %.2f seconds") << busyTime;

    if(busyTaskEndedWithError)
    {
        App_AbnormalShutdown(busyError);
    }

    if(busyWillAnimateTransition)
    {
        Con_TransitionBegin();
    }

    // Make sure that any remaining deferred content gets uploaded.
    if(!(task->mode & BUSYF_NO_UPLOADS))
    {
        GL_ProcessDeferredTasks(0);
    }

    Sys_DestroyMutex(busy_Mutex);
    busyInited = false;
}
enum EDSContactsStorageItemIterator::eCursorInit EDSContactsStorageItemIterator::cursorInit(EBookClient* c)
{
  LOG_FUNC();

  GError *gerror = NULL;

  EContactField sort_fields[]      = { E_CONTACT_FULL_NAME };
  EBookCursorSortType sort_types[] = { E_BOOK_CURSOR_SORT_ASCENDING };

  e_book_client_get_cursor_sync(c, NULL, sort_fields, sort_types, 1, &cursor, NULL, &gerror);

  if (NULL != gerror)
  {
    LOG_ERROR() << "Error e_book_client_get_cursor_sync results: " << GERROR_MESSAGE(gerror)<<std::endl ;
    GERROR_FREE(gerror);
    return eCursorInitFail;
  }

  total = e_book_client_cursor_get_total(cursor);
  LOG_VERBOSE() << "Number of contacts: " << total <<std::endl;

  GERROR_FREE(gerror);

  return eCursorInitOK;
}
示例#23
0
文件: trap.c 项目: ariavie/bcm
/*
 *  Function : drv_dino8_trap_get
 *
 *  Purpose :
 *      Get the trap frame type to CPU.
 *
 *  Parameters :
 *      unit      :  unit id.
 *      port      :  port id.
 *      trap_mask :  the mask of trap type.
 *
 *  Return :
 *      SOC_E_XXX
 *
 *  Note :
 */
int 
drv_dino8_trap_get(int unit, soc_port_t port, uint32 *trap_mask)
{
    uint32  reg_value, temp = 0;

    SOC_IF_ERROR_RETURN(REG_READ_GMNGCFGr
        (unit, &reg_value));
    soc_GMNGCFGr_field_get(unit, &reg_value, 
        IGMPIP_SNOP_ENf, &temp);
    if (temp) {
        *trap_mask |= DRV_SWITCH_TRAP_IGMP;
    }

    soc_GMNGCFGr_field_get(unit, &reg_value, 
        RXBPDU_ENf, &temp);
    if (temp) {
        *trap_mask |= DRV_SWITCH_TRAP_BPDU1;
    }

    /* Broadcast packet */
    SOC_IF_ERROR_RETURN(REG_READ_MII_PCTLr
        (unit, CMIC_PORT(unit), &reg_value));
    SOC_IF_ERROR_RETURN(soc_MII_PCTLr_field_get
        (unit, &reg_value, MIRX_BC_ENf, &temp));

    if (temp) {
        *trap_mask |= DRV_SWITCH_TRAP_BCST;
    }

    LOG_VERBOSE(BSL_LS_SOC_COMMON,
                (BSL_META_U(unit,
                            "drv_dino8_trap_get: unit = %d, trap mask = 0x%x\n"), unit, *trap_mask));

    return SOC_E_NONE;
}
示例#24
0
br24Transmit::~br24Transmit() {
  if (m_radar_socket != INVALID_SOCKET) {
    closesocket(m_radar_socket);
    LOG_TRANSMIT(wxT("BR24radar_pi: %s transmit socket closed"), m_name.c_str());
  }
  LOG_VERBOSE(wxT("BR24radar_pi: %s transmit object destroyed"), m_name.c_str());
}
示例#25
0
文件: topo_brd.c 项目: ariavie/bcm
STATIC int
_topo_set_unit_modid_preference(int unit, int num_modid, int *preference)
{
    int current_modid, new_modid;
    
    if (num_modid == 2) {

        /* If the device requires two modids and the modid is even,
           see if the modid can be odd. */
        
        BCM_IF_ERROR_RETURN(bcm_stk_my_modid_get(unit, &current_modid));
        if ((current_modid & 1) == 0) {
            int rv;

            new_modid = current_modid+1;
            rv = bcm_stk_my_modid_set(unit, new_modid);
            if (rv == BCM_E_BADID) {
                *preference = CPUDB_TOPO_MODID_EVEN;
                LOG_VERBOSE(BSL_LS_TKS_TOPOLOGY,
                            (BSL_META_U(unit,
                            "unit %d modid preference is even\n"),
                             unit));
            }
            BCM_IF_ERROR_RETURN(bcm_stk_my_modid_set(unit, current_modid));
        }
    }
    return BCM_E_NONE;
}
示例#26
0
文件: CabManager.cpp 项目: Thalur/ak
void CCabManager::MergeIntoFileList(uint8_t aCabinetIndex, const std::vector<TEntryIndex>& aEntries)
{
   auto itIndex = iFileIndex.begin();
   auto itData = aEntries.begin();
   const auto itDataEnd = aEntries.end();
   bool bIndexEnd = itIndex == iFileIndex.end();
   while (itData != itDataEnd) {
      int cmp = bIndexEnd ? 1 : std::get<0>(*itIndex).compare(itData->first);
      if (cmp < 0) { // Leave index element at its position
         if (++itIndex == iFileIndex.end()) {
            bIndexEnd = true;
         }
      } else if (cmp > 0) { // Insert the data string before the current position
         LOG_VERBOSE("Adding at %d: %d, %s", (itIndex - iFileIndex.begin()), itData->second, itData->first.c_str());
         itIndex = iFileIndex.emplace(itIndex, itData->first, aCabinetIndex, itData->second) + 1;
         if (!bIndexEnd && itIndex == iFileIndex.end()) {
            bIndexEnd = true;
         }
         itData++;
      } else {
         LOG_DEBUG("Ignoring file entry %s because file is already indexed", std::get<0>(*itIndex).c_str());
         itData++;
      }
   }
}
示例#27
0
void hash_map_utils_dump_string_keys_string_values(hash_map_t *map) {
  if (!map) {
    LOG_VERBOSE( LOG_TAG, "%s: the given map is NULL\n", __func__);
    return;
  }
  hash_map_foreach(map, dump_entry, NULL);
}
示例#28
0
文件: topo_brd.c 项目: ariavie/bcm
STATIC int
topo_cpu_trans_flush(cpudb_ref_t db_ref)
{
    cpudb_ref_t    prev_db;
    cpudb_entry_t  *entry;
    cpudb_entry_t  *l_entry;
    cpudb_entry_t  *prev_entry;

    if ((prev_db = db_ref->old_db) == NULL) {
        return BCM_E_NONE;
    }

    l_entry = db_ref->local_entry;

    /* Check if path to get to this remote CPU has changed */
    CPUDB_FOREACH_ENTRY(db_ref, entry) {
        if (entry == l_entry) {
            continue;
        }

        CPUDB_KEY_SEARCH(prev_db, entry->base.key, prev_entry);
        if (prev_entry != NULL) {
            if ((prev_entry->tx_unit == entry->tx_unit) &&
                (prev_entry->tx_port == entry->tx_port)) {
                continue;
            }
            LOG_VERBOSE(BSL_LS_TKS_TOPOLOGY,
                        (BSL_META("TX path changed to CPU " CPUDB_KEY_FMT_EOLN),
                         CPUDB_KEY_DISP(entry->base.key)));            
            topo_cpu_trans_purge(entry);
        }
    }
                
    return BCM_E_NONE;
}
示例#29
0
void OMX_MediaProcessorElement::setSource(QString source)
{
    LOG_VERBOSE(LOG_TAG, "Setting source.");

    // TODO: Handle errors.
    m_source = source;
    if (m_mediaProc) {
        if (openMedia(source))
            m_mediaProc->play();
        else {
            LOG_WARNING(LOG_TAG, "Failed to open media.");
        }
    }
    else {
        LOG_VERBOSE(LOG_TAG, "Play delayed.");
    }
}
示例#30
0
int SingerList::keyPressEvent(QObject * obj, QKeyEvent * event)
{
    LOG_API();
    static QWidget * fakeFocus = singerIcon[0];
    int        new_idx = cur_idx;
    LOG_VERBOSE("cur hlt idx %d.\n", cur_idx);
    switch(event->key())
    {
        case Qt::Key_Select:
        case Qt::Key_Return:
            slotSingerSelected();
            return OK;
        case Qt::Key_Back:
        case Qt::Key_Escape:
            slotReturnButton();
            return OK;
        case Qt::Key_MediaPrevious:
            slotPagePrev();
            return OK;
        case Qt::Key_MediaNext:
            slotPageNext();
            return OK;
        case Qt::Key_Up:
            new_idx = abs(cur_idx-4)%8;
            break;
        case Qt::Key_Down:
            new_idx = (cur_idx+4)%8;
            break;
        case Qt::Key_Left:
            new_idx = abs(cur_idx-1)%8;
            break;
        case Qt::Key_Right:
            new_idx = (cur_idx+1)%8;
            break;
        default:
            break;
    }
    LOG_VERBOSE("new hlt idx %d.\n", new_idx);

    singerIcon[cur_idx]->highlight(false);
    singerIcon[new_idx]->highlight(true);
    fakeFocus = singerIcon[new_idx];
    cur_idx = new_idx;

    return OK;
}