Пример #1
0
void
osl_ctfpool_stats(osl_t *osh, void *b)
{
	struct bcmstrbuf *bb;

	if ((osh == NULL) || (osh->ctfpool == NULL))
		return;

#ifdef DHD_USE_STATIC_BUF
	if (bcm_static_buf) {
		bcm_static_buf = 0;
	}
	if (bcm_static_skb) {
		bcm_static_skb = 0;
	}
#endif /* DHD_USE_STATIC_BUF */

	bb = b;

	ASSERT((osh != NULL) && (bb != NULL));

	bcm_bprintf(bb, "max_obj %d obj_size %d curr_obj %d refills %d\n",
	            osh->ctfpool->max_obj, osh->ctfpool->obj_size,
	            osh->ctfpool->curr_obj, osh->ctfpool->refills);
	bcm_bprintf(bb, "fast_allocs %d fast_frees %d slow_allocs %d\n",
	            osh->ctfpool->fast_allocs, osh->ctfpool->fast_frees,
	            osh->ctfpool->slow_allocs);
}
Пример #2
0
static void
chipdump(struct bcm4xxx *ch, struct bcmstrbuf *b)
{
#ifdef BCMDBG
	bcm_bprintf(b, "regs 0x%x etphy 0x%x ch->intstatus 0x%x intmask 0x%x\n",
		(ulong)ch->regs, (ulong)ch->etphy, ch->intstatus, ch->intmask);
	bcm_bprintf(b, "\n");

	/* dma engine state */
	dma_dump(ch->di, b, FALSE);
	bcm_bprintf(b, "\n");

	/* registers */
	chipdumpregs(ch, ch->regs, b);
	bcm_bprintf(b, "\n");

	/* switch registers */
#ifdef ETROBO
	if (ch->etc->robo)
		robo_dump_regs(ch->etc->robo, b);
#endif /* ETROBO */
#ifdef ETADM
	if (ch->adm)
		adm_dump_regs(ch->adm, b->buf);
#endif /* ETADM */
#endif	/* BCMDBG */
}
Пример #3
0
/*
 * bcm_notif_dump_list()
 *
 * For debugging, display interest list
 *
 * Parameters
 *    hdl        Opaque list handle.
 *    b          Output buffer.
 * Returns:
 *    BCME_OK     Event list successfully dumped.
 *    BCME_ERROR  General error.
 */
int bcm_notif_dump_list(bcm_notif_h hdl, struct bcmstrbuf *b)
{
#if defined(BCMDBG)
	struct bcm_notif_client_request * nodep;

	if (hdl == NULL)
		bcm_bprintf(b, "<uninit list>\n");
	else {
		nodep = hdl->tail;

		bcm_bprintf(b, "List id=0x%p: ", hdl);

		if (nodep == NULL) {
			bcm_bprintf(b, "(empty)");
		} else {
			/* List is not empty. Display all data in correct sequence. */
			struct bcm_notif_client_request * firstp = hdl->tail->next;
			nodep = nodep->next;
			do {
				bcm_bprintf(b, " [0x%p,0x%p]", nodep->callback,
				          nodep->passthru);
				nodep = nodep->next;
			} while (nodep != firstp);
		}
	}

	bcm_bprintf(b, "\n");
#endif   

	return (BCME_OK);
}
Пример #4
0
/*
 * bcm_mpm_dump() - Display statistics on all extant pools
 *
 * Parameters:
 *    mgr:     INPUT  The handle to the pools manager
 *    b:       OUTPUT Output buffer.
 *
 * Returns:
 *    BCME_OK   Ok
 *    other     Error during dump.
 *
 */
int bcm_mpm_dump(bcm_mpm_mgr_h mgr, struct bcmstrbuf *b)
{
#if defined(BCMDBG)
	bcm_mp_pool_t  *pool;
	uint16         i;

	/* Check parameters */
	ASSERT(mgr != NULL);
	ASSERT(b != NULL);

	/* Iterate list of pools, and dump. */
	bcm_bprintf(b, "\nDump pools (%d):\n", mgr->npools);
	bcm_bprintf(b, "%-8s %10s %5s %5s %5s %5s %6s %5s  %5s %10s %10s\n", "Name",
	            "Hdl", "SZ", "Curr", "HiWtr", "Fail", "Flags", "P_SZ", "Max",
	            "Freep", "Malloc");

	for (i = 0; i < mgr->max_pools; i++) {
		pool = &mgr->pool_objs[i];
		if (BCM_MP_IS_IN_USE(pool)) {
			bcm_mp_dump(pool, b);
		}
	}


#endif   
	return (BCME_OK);
}
Пример #5
0
/*
 * EMFL Packet Counters/Statistics
 */
static int32
emf_stats_get(char *buf, char **start, off_t offset, int32 size,
              int32 *eof, void *data)
{
	emf_info_t *emfi = (emf_info_t *)data;
	emf_cfg_request_t *cfg;
	emf_stats_t *emfs;
	struct bcmstrbuf b;

	ASSERT(emfi);

	cfg = MALLOC(emfi->osh, sizeof(emf_cfg_request_t));
	if (cfg == NULL)
	{
		EMF_ERROR("Out of memory allocating emf_cfg_request\n");
		return (FAILURE);
	}

	cfg->command_id = EMFCFG_CMD_EMF_STATS;
	cfg->oper_type = EMFCFG_OPER_TYPE_GET;
	cfg->size = sizeof(emf_stats_t);
	emfs = (emf_stats_t *)cfg->arg;

	emfc_cfg_request_process(emfi->emfci, cfg);
	if (cfg->status != EMFCFG_STATUS_SUCCESS)
	{
		EMF_ERROR("Unable to get the EMF stats\n");
		MFREE(emfi->osh, cfg, sizeof(emf_cfg_request_t));
		return (FAILURE);
	}

	bcm_binit(&b, buf, size);
	bcm_bprintf(&b, "McastDataPkts   McastDataFwd    McastFlooded    "
		    "McastDataSentUp McastDataDropped\n");
	bcm_bprintf(&b, "%-15d %-15d %-15d %-15d %d\n",
	            emfs->mcast_data_frames, emfs->mcast_data_fwd,
	            emfs->mcast_data_flooded, emfs->mcast_data_sentup,
	            emfs->mcast_data_dropped);
	bcm_bprintf(&b, "IgmpPkts        IgmpPktsFwd     "
		    "IgmpPktsSentUp  MFDBCacheHits   MFDBCacheMisses\n");
	bcm_bprintf(&b, "%-15d %-15d %-15d %-15d %d\n",
	            emfs->igmp_frames, emfs->igmp_frames_fwd,
	            emfs->igmp_frames_sentup, emfs->mfdb_cache_hits,
	            emfs->mfdb_cache_misses);
	MFREE(emfi->osh, cfg, sizeof(emf_cfg_request_t));

	if (b.size == 0)
	{
		EMF_ERROR("Input buffer overflow\n");
		return (FAILURE);
	}

	return (b.buf - b.origbuf);
}
Пример #6
0
static int32
igs_sdb_list(char *buf, char **start, off_t offset, int32 size,
             int32 *eof, void *data)
{
	igs_info_t *igs_info = (igs_info_t *)data;
	igs_cfg_request_t *cfg;
	igs_cfg_sdb_list_t *list;
	int32 i;
	struct bcmstrbuf b;

	ASSERT(igs_info);

	cfg = MALLOC(igs_info->osh, sizeof(igs_cfg_request_t));
	if (cfg == NULL)
	{
		IGS_ERROR("Out of memory allocating igs_cfg_request\n");
		return (FAILURE);
	}

	strcpy(cfg->inst_id, igs_info->inst_id);
	cfg->command_id = IGSCFG_CMD_IGSDB_LIST;
	cfg->oper_type = IGSCFG_OPER_TYPE_GET;
	cfg->size = sizeof(cfg->arg);
	list = (igs_cfg_sdb_list_t *)cfg->arg;

	igsc_cfg_request_process(igs_info->igsc_info, cfg);
	if (cfg->status != IGSCFG_STATUS_SUCCESS)
	{
		IGS_ERROR("Unable to get the IGSDB list\n");
		MFREE(igs_info->osh, cfg, sizeof(igs_cfg_request_t));
		return (FAILURE);
	}

	bcm_binit(&b, buf, size);
	bcm_bprintf(&b, "Group           Members         Interface\n");

	for (i = 0; i < list->num_entries; i++)
	{
		bcm_bprintf(&b, "%08x        ", list->sdb_entry[i].mgrp_ip);
		bcm_bprintf(&b, "%08x        ", list->sdb_entry[i].mh_ip);
		bcm_bprintf(&b, "%s\n", list->sdb_entry[i].if_name);
	}
	MFREE(igs_info->osh, cfg, sizeof(igs_cfg_request_t));

	if (b.size == 0)
	{
		IGS_ERROR("Input buffer overflow\n");
		return (FAILURE);
	}

	return (b.buf - b.origbuf);
}
Пример #7
0
static int32
emf_mfdb_list(char *buf, char **start, off_t offset, int32 size,
              int32 *eof, void *data)
{
	emf_info_t *emfi = (emf_info_t *)data;
	emf_cfg_request_t *cfg;
	struct bcmstrbuf b;
	emf_cfg_mfdb_list_t *list;
	int32 i;

	ASSERT(emfi);

	cfg = MALLOC(emfi->osh, sizeof(emf_cfg_request_t));
	if (cfg == NULL)
	{
		EMF_ERROR("Out of memory allocating emf_cfg_request\n");
		return (FAILURE);
	}

	cfg->command_id = EMFCFG_CMD_MFDB_LIST;
	cfg->oper_type = EMFCFG_OPER_TYPE_GET;
	cfg->size = sizeof(cfg->arg);
	list = (emf_cfg_mfdb_list_t *)cfg->arg;

	emfc_cfg_request_process(emfi->emfci, cfg);
	if (cfg->status != EMFCFG_STATUS_SUCCESS)
	{
		EMF_ERROR("Unable to get the MFDB list\n");
		MFREE(emfi->osh, cfg, sizeof(emf_cfg_request_t));
		return (FAILURE);
	}

	bcm_binit(&b, buf, size);
	bcm_bprintf(&b, "Group           Interface      Pkts\n");

	for (i = 0; i < list->num_entries; i++)
	{
		bcm_bprintf(&b, "%08x        ", list->mfdb_entry[i].mgrp_ip);
		bcm_bprintf(&b, "%-15s", list->mfdb_entry[i].if_name);
		bcm_bprintf(&b, "%d\n", list->mfdb_entry[i].pkts_fwd);
	}
	MFREE(emfi->osh, cfg, sizeof(emf_cfg_request_t));

	if (b.size == 0)
	{
		EMF_ERROR("Input buffer overflow\n");
		return (FAILURE);
	}

	return (b.buf - b.origbuf);
}
Пример #8
0
int
osl_debug_memdump(osl_t *osh, struct bcmstrbuf *b)
{
	bcm_mem_link_t *p;

	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));

	bcm_bprintf(b, "   Address\tSize\tFile:line\n");
	for (p = osh->dbgmem_list; p; p = p->next)
		bcm_bprintf(b, "0x%08x\t%5d\t%s:%d\n",
			(uintptr)p + sizeof(bcm_mem_link_t), p->size, p->file, p->line);

	return 0;
}
Пример #9
0
void
pcicore_dump(void *pch, struct bcmstrbuf *b)
{
	pcicore_info_t *pi = (pcicore_info_t *)pch;

	bcm_bprintf(b, "FORCEHT %d pcie_polarity 0x%x pcie_war_ovr %d\n",
	            pi->sih->pci_pr32414, pi->pcie_polarity, pi->pcie_war_aspm_ovr);
}
Пример #10
0
/*
 * IGSL Packet Counters/Statistics Function
 */
static int32
igs_stats_get(char *buf, char **start, off_t offset, int32 size,
              int32 *eof, void *data)
{
	igs_info_t *igs_info;
	igs_cfg_request_t cfg;
	igs_stats_t *stats;
	struct bcmstrbuf b;

	igs_info = (igs_info_t *)data;

	strcpy(cfg.inst_id, igs_info->inst_id);
	cfg.command_id = IGSCFG_CMD_IGS_STATS;
	cfg.oper_type = IGSCFG_OPER_TYPE_GET;
	cfg.size = sizeof(cfg.arg);
	stats = (igs_stats_t *)cfg.arg;

	igsc_cfg_request_process(igs_info->igsc_info, &cfg);
	if (cfg.status != IGSCFG_STATUS_SUCCESS)
	{
		IGS_ERROR("Unable to get the IGS stats\n");
		return (FAILURE);
	}

	bcm_binit(&b, buf, size);
	bcm_bprintf(&b, "IgmpPkts        IgmpQueries     "
	            "IgmpReports     IgmpV2Reports   IgmpLeaves\n");
	bcm_bprintf(&b, "%-15d %-15d %-15d %-15d %d\n",
	            stats->igmp_packets, stats->igmp_queries,
	            stats->igmp_reports, stats->igmp_v2reports,
	            stats->igmp_leaves);
	bcm_bprintf(&b, "IgmpNotHandled  McastGroups     "
	            "McastMembers    MemTimeouts\n");
	bcm_bprintf(&b, "%-15d %-15d %-15d %d\n",
	            stats->igmp_not_handled, stats->igmp_mcast_groups,
	            stats->igmp_mcast_members, stats->igmp_mem_timeouts);

	if (b.size == 0)
	{
		IGS_ERROR("Input buffer overflow\n");
		return (FAILURE);
	}

	return (b.buf - b.origbuf);
}
Пример #11
0
/* Dump PCIE Info */
int
pcicore_dump_pcieinfo(void *pch, struct bcmstrbuf *b)
{
	pcicore_info_t *pi = (pcicore_info_t *)pch;

	if (!PCIE_GEN1(pi->sih) && !PCIE_GEN2(pi->sih))
		return BCME_ERROR;

	bcm_bprintf(b, "PCIE link speed: %d\n", pcie_get_link_speed(pch));
	return 0;
}
Пример #12
0
int
osl_debug_memdump(osl_t *osh, struct bcmstrbuf *b)
{
	bcm_mem_link_t *p;

	ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));

	if (b != NULL)
		bcm_bprintf(b, "   Address\tSize\tFile:line\n");
	else
		printf("   Address\tSize\tFile:line\n");
	for (p = osh->dbgmem_list; p; p = p->next)
		if (b != NULL)
			bcm_bprintf(b, "0x%p\t%5d\t%s:%d\n",
			            p + 1, p->size, p->file, p->line);
		else
			printf("0x%p\t%5d\t%s:%d\n",
			            p + 1, p->size, p->file, p->line);

	return 0;
}
Пример #13
0
/*
 * bcm_mp_dump() - Dump a pool
 *
 * Parameters:
 *    pool:    INPUT    The handle to the pool
 *    b        OUTPUT   Output buffer
 *
 * Returns:
 *    BCME_OK   Ok
 *    other     Error during dump.
 *
 */
int bcm_mp_dump(bcm_mp_pool_h pool, struct bcmstrbuf *b)
{
#if defined(BCMDBG)
	/* Check parameters */
	ASSERT(pool != NULL);
	ASSERT(b != NULL);

	bcm_bprintf(b, "%-8s 0x%08p %5d %5d %5d %5d 0x%04d", pool->name, pool, pool->objsz,
	            pool->num_alloc, pool->high_water, pool->failed_alloc, pool->flags);

	if (BCM_MP_GET_POOL_TYPE(pool) == BCM_MP_TYPE_PREALLOC) {
		bcm_mp_prealloc_pool_t *prealloc = &pool->u.p;

		bcm_bprintf(b, " %5d %5d 0x%08p 0x%08p", prealloc->padded_objsz,
		            prealloc->nobj, prealloc->free_objp, prealloc->malloc_memstart);
	}
	bcm_bprintf(b, "\n");

#endif   

	return (BCME_OK);
}
Пример #14
0
static void
chipdumpmib(ch_t *ch, struct bcmstrbuf *b, bool clear)
{
	bcmenetmib_t *m;

	m = &ch->mib;

	if (clear) {
		bzero((char *)m, sizeof(bcmenetmib_t));
		return;
	}

	bcm_bprintf(b, "tx_broadcast_pkts %d tx_multicast_pkts %d tx_jabber_pkts %d "
	               "tx_oversize_pkts %d\n",
	               m->tx_broadcast_pkts, m->tx_multicast_pkts,
	               m->tx_jabber_pkts,
	               m->tx_oversize_pkts);
	bcm_bprintf(b, "tx_fragment_pkts %d tx_underruns %d\n",
	               m->tx_fragment_pkts, m->tx_underruns);
	bcm_bprintf(b, "tx_total_cols %d tx_single_cols %d tx_multiple_cols %d "
	               "tx_excessive_cols %d\n",
	               m->tx_total_cols, m->tx_single_cols, m->tx_multiple_cols,
	               m->tx_excessive_cols);
	bcm_bprintf(b, "tx_late_cols %d tx_defered %d tx_carrier_lost %d tx_pause_pkts %d\n",
	               m->tx_late_cols, m->tx_defered, m->tx_carrier_lost,
	               m->tx_pause_pkts);

	/* receive stat counters */
	/* hardware mib pkt and octet counters wrap too quickly to be useful */
	bcm_bprintf(b, "rx_broadcast_pkts %d rx_multicast_pkts %d rx_jabber_pkts %d "
	               "rx_oversize_pkts %d\n",
	               m->rx_broadcast_pkts, m->rx_multicast_pkts,
	               m->rx_jabber_pkts, m->rx_oversize_pkts);
	bcm_bprintf(b, "rx_fragment_pkts %d rx_missed_pkts %d rx_crc_align_errs %d "
	               "rx_undersize %d\n",
	               m->rx_fragment_pkts, m->rx_missed_pkts,
	               m->rx_crc_align_errs, m->rx_undersize);
	bcm_bprintf(b, "rx_crc_errs %d rx_align_errs %d rx_symbol_errs %d\n",
	               m->rx_crc_errs, m->rx_align_errs, m->rx_symbol_errs);
	bcm_bprintf(b, "rx_pause_pkts %d rx_nonpause_pkts %d\n",
	               m->rx_pause_pkts, m->rx_nonpause_pkts);
}
Пример #15
0
static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
{
	struct bcmstrbuf b;
	struct bcmstrbuf *strbuf = &b;

	bcm_binit(strbuf, buf, buflen);

	/* Base DHD info */
	bcm_bprintf(strbuf, "%s\n", dhd_version);
	bcm_bprintf(strbuf, "\n");
	bcm_bprintf(strbuf, "pub.up %d pub.txoff %d pub.busstate %d\n",
		    dhdp->up, dhdp->txoff, dhdp->busstate);
	bcm_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n",
		    dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz);
	bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n",
		    dhdp->iswl, dhdp->drv_version, &dhdp->mac);
	bcm_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror,
		    dhdp->tickcnt);

	bcm_bprintf(strbuf, "dongle stats:\n");
	bcm_bprintf(strbuf,
		    "tx_packets %ld tx_bytes %ld tx_errors %ld tx_dropped %ld\n",
		    dhdp->dstats.tx_packets, dhdp->dstats.tx_bytes,
		    dhdp->dstats.tx_errors, dhdp->dstats.tx_dropped);
	bcm_bprintf(strbuf,
		    "rx_packets %ld rx_bytes %ld rx_errors %ld rx_dropped %ld\n",
		    dhdp->dstats.rx_packets, dhdp->dstats.rx_bytes,
		    dhdp->dstats.rx_errors, dhdp->dstats.rx_dropped);
	bcm_bprintf(strbuf, "multicast %ld\n", dhdp->dstats.multicast);

	bcm_bprintf(strbuf, "bus stats:\n");
	bcm_bprintf(strbuf, "tx_packets %ld tx_multicast %ld tx_errors %ld\n",
		    dhdp->tx_packets, dhdp->tx_multicast, dhdp->tx_errors);
	bcm_bprintf(strbuf, "tx_ctlpkts %ld tx_ctlerrs %ld\n",
		    dhdp->tx_ctlpkts, dhdp->tx_ctlerrs);
	bcm_bprintf(strbuf, "rx_packets %ld rx_multicast %ld rx_errors %ld\n",
		    dhdp->rx_packets, dhdp->rx_multicast, dhdp->rx_errors);
	bcm_bprintf(strbuf,
		    "rx_ctlpkts %ld rx_ctlerrs %ld rx_dropped %ld rx_flushed %ld\n",
		    dhdp->rx_ctlpkts, dhdp->rx_ctlerrs, dhdp->rx_dropped,
		    dhdp->rx_flushed);
	bcm_bprintf(strbuf,
		    "rx_readahead_cnt %ld tx_realloc %ld fc_packets %ld\n",
		    dhdp->rx_readahead_cnt, dhdp->tx_realloc, dhdp->fc_packets);
	bcm_bprintf(strbuf, "wd_dpc_sched %ld\n", dhdp->wd_dpc_sched);
	bcm_bprintf(strbuf, "\n");

	/* Add any prot info */
	dhd_prot_dump(dhdp, strbuf);
	bcm_bprintf(strbuf, "\n");

	/* Add any bus info */
	dhd_bus_dump(dhdp, strbuf);

	return !strbuf->size ? -EOVERFLOW : 0;
}
Пример #16
0
static void
chipdumpregs(struct bcm4xxx *ch, bcmenetregs_t *regs, struct bcmstrbuf *b)
{
	uint phyaddr;

	phyaddr = ch->etc->phyaddr;

	PRREG(devcontrol); PRREG(biststatus); PRREG(wakeuplength);
	bcm_bprintf(b, "\n");
	PRREG(intstatus); PRREG(intmask); PRREG(gptimer);
	bcm_bprintf(b, "\n");
	PRREG(emactxmaxburstlen); PRREG(emacrxmaxburstlen);
	PRREG(emaccontrol); PRREG(emacflowcontrol);
	bcm_bprintf(b, "\n");
	PRREG(intrecvlazy);
	bcm_bprintf(b, "\n");

	/* emac registers */
	PRREG(rxconfig); PRREG(rxmaxlength); PRREG(txmaxlength);
	bcm_bprintf(b, "\n");
	PRREG(mdiocontrol); PRREG(camcontrol); PRREG(enetcontrol);
	bcm_bprintf(b, "\n");
	PRREG(txcontrol); PRREG(txwatermark); PRREG(mibcontrol);
	bcm_bprintf(b, "\n");

	/* mib registers */
	PRMIBREG(tx_good_octets); PRMIBREG(tx_good_pkts); PRMIBREG(tx_octets); PRMIBREG(tx_pkts);
	bcm_bprintf(b, "\n");
	PRMIBREG(tx_broadcast_pkts); PRMIBREG(tx_multicast_pkts);
	bcm_bprintf(b, "\n");
	PRMIBREG(tx_jabber_pkts); PRMIBREG(tx_oversize_pkts); PRMIBREG(tx_fragment_pkts);
	bcm_bprintf(b, "\n");
	PRMIBREG(tx_underruns); PRMIBREG(tx_total_cols); PRMIBREG(tx_single_cols);
	bcm_bprintf(b, "\n");
	PRMIBREG(tx_multiple_cols); PRMIBREG(tx_excessive_cols); PRMIBREG(tx_late_cols);
	bcm_bprintf(b, "\n");
	PRMIBREG(tx_defered); PRMIBREG(tx_carrier_lost); PRMIBREG(tx_pause_pkts);
	bcm_bprintf(b, "\n");

	PRMIBREG(rx_good_octets); PRMIBREG(rx_good_pkts); PRMIBREG(rx_octets); PRMIBREG(rx_pkts);
	bcm_bprintf(b, "\n");
	PRMIBREG(rx_broadcast_pkts); PRMIBREG(rx_multicast_pkts);
	bcm_bprintf(b, "\n");
	PRMIBREG(rx_jabber_pkts); PRMIBREG(rx_oversize_pkts); PRMIBREG(rx_fragment_pkts);
	bcm_bprintf(b, "\n");
	PRMIBREG(rx_missed_pkts); PRMIBREG(rx_crc_align_errs); PRMIBREG(rx_undersize);
	bcm_bprintf(b, "\n");
	PRMIBREG(rx_crc_errs); PRMIBREG(rx_align_errs); PRMIBREG(rx_symbol_errs);
	bcm_bprintf(b, "\n");
	PRMIBREG(rx_pause_pkts); PRMIBREG(rx_nonpause_pkts);
	bcm_bprintf(b, "\n");

	if (phyaddr != EPHY_NOREG) {
		/* print a few interesting phy registers */
		bcm_bprintf(b, "phy0 0x%x phy1 0x%x phy2 0x%x phy3 0x%x\n",
		               chipphyrd(ch, phyaddr, 0),
		               chipphyrd(ch, phyaddr, 1),
		               chipphyrd(ch, phyaddr, 2),
		               chipphyrd(ch, phyaddr, 3));
		bcm_bprintf(b, "phy4 0x%x phy5 0x%x phy24 0x%x phy25 0x%x\n",
		               chipphyrd(ch, phyaddr, 4),
		               chipphyrd(ch, phyaddr, 5),
		               chipphyrd(ch, phyaddr, 24),
		               chipphyrd(ch, phyaddr, 25));
	}

}
Пример #17
0
static int
dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
{
	char eabuf[ETHER_ADDR_STR_LEN];

	struct bcmstrbuf b;
	struct bcmstrbuf *strbuf = &b;

	bcm_binit(strbuf, buf, buflen);

	/* Base DHD info */
	bcm_bprintf(strbuf, "%s\n", dhd_version);
	bcm_bprintf(strbuf, "\n");
	bcm_bprintf(strbuf, "pub.up %d pub.txoff %d pub.busstate %d\n",
	            dhdp->up, dhdp->txoff, dhdp->busstate);
	bcm_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n",
	            dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz);
	bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %s\n",
	            dhdp->iswl, dhdp->drv_version, bcm_ether_ntoa(&dhdp->mac, eabuf));
	bcm_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror, dhdp->tickcnt);

	bcm_bprintf(strbuf, "dongle stats:\n");
	bcm_bprintf(strbuf, "tx_packets %ld tx_bytes %ld tx_errors %ld tx_dropped %ld\n",
	            dhdp->dstats.tx_packets, dhdp->dstats.tx_bytes,
	            dhdp->dstats.tx_errors, dhdp->dstats.tx_dropped);
	bcm_bprintf(strbuf, "rx_packets %ld rx_bytes %ld rx_errors %ld rx_dropped %ld\n",
	            dhdp->dstats.rx_packets, dhdp->dstats.rx_bytes,
	            dhdp->dstats.rx_errors, dhdp->dstats.rx_dropped);
	bcm_bprintf(strbuf, "multicast %ld\n", dhdp->dstats.multicast);

	bcm_bprintf(strbuf, "bus stats:\n");
	bcm_bprintf(strbuf, "tx_packets %ld tx_multicast %ld tx_errors %ld\n",
	            dhdp->tx_packets, dhdp->tx_multicast, dhdp->tx_errors);
	bcm_bprintf(strbuf, "tx_ctlpkts %ld tx_ctlerrs %ld\n",
	            dhdp->tx_ctlpkts, dhdp->tx_ctlerrs);
	bcm_bprintf(strbuf, "rx_packets %ld rx_multicast %ld rx_errors %ld \n",
	            dhdp->rx_packets, dhdp->rx_multicast, dhdp->rx_errors);
	bcm_bprintf(strbuf, "rx_ctlpkts %ld rx_ctlerrs %ld rx_dropped %ld rx_flushed %ld\n",
	            dhdp->rx_ctlpkts, dhdp->rx_ctlerrs, dhdp->rx_dropped, dhdp->rx_flushed);
	bcm_bprintf(strbuf, "rx_readahead_cnt %ld tx_realloc %ld\n",
	            dhdp->rx_readahead_cnt, dhdp->tx_realloc);
	bcm_bprintf(strbuf, "\n");

	/* Add any prot info */
	dhd_prot_dump(dhdp, strbuf);
	bcm_bprintf(strbuf, "\n");

	/* Add any bus info */
	dhd_bus_dump(dhdp, strbuf);

	return (!strbuf->size ? BCME_BUFTOOSHORT : 0);
}
Пример #18
0
int
bcm_rpc_tp_dump(rpc_tp_info_t *rpcb, struct bcmstrbuf *b)
{
	int i = 0, j = 0;

	RPC_TP_LOCK(rpcb);

	bcm_bprintf(b, "\nRPC_TP_DBUS:\n");
	bcm_bprintf(b, "bufalloc %d(buf_inuse %d, max %d) tx %d(txerr %d) rx %d(rxdrop %d)\n",
		rpcb->bufalloc, rpcb->buf_cnt_inuse, rpcb->buf_cnt_max, rpcb->tx_cnt,
		rpcb->txerr_cnt, rpcb->rx_cnt, rpcb->rxdrop_cnt);

	bcm_bprintf(b, "mtu %d depth %d pending %d tx_flowctrl_cnt %d, rxflowctl %d\n",
	            rpcb->bus_mtu, rpcb->bus_txdepth, rpcb->bus_txpending, rpcb->tx_flowctl_cnt,
	            rpcb->rxflowctrl);

	bcm_bprintf(b, "tp_host_deagg chain %d subframes %d bytes %d badsflen %d passthrough %d\n",
		rpcb->tp_host_deagg_cnt_chain, rpcb->tp_host_deagg_cnt_sf,
		rpcb->tp_host_deagg_cnt_bytes,
		rpcb->tp_host_deagg_cnt_badsflen, rpcb->tp_host_deagg_cnt_pass);
	bcm_bprintf(b, "tp_host_deagg sf/chain %d bytes/chain %d \n",
		(rpcb->tp_host_deagg_cnt_chain == 0) ?
		0 : rpcb->tp_host_deagg_cnt_sf/rpcb->tp_host_deagg_cnt_chain,
		(rpcb->tp_host_deagg_cnt_chain == 0) ?
		0 : rpcb->tp_host_deagg_cnt_bytes/rpcb->tp_host_deagg_cnt_chain);

	bcm_bprintf(b, "\n");

	bcm_bprintf(b, "tp_host_agg sf_limit %d bytes_limit %d\n",
		rpcb->tp_tx_agg_sframes_limit, rpcb->tp_tx_agg_bytes_max);
	bcm_bprintf(b, "tp_host_agg: chain %d, sf %d, bytes %d, non-agg-frame %d bypass %d\n",
		rpcb->tp_tx_agg_cnt_chain, rpcb->tp_tx_agg_cnt_sf, rpcb->tp_tx_agg_cnt_bytes,
		rpcb->tp_tx_agg_cnt_noagg, rpcb->tp_tx_agg_cnt_pass);
	bcm_bprintf(b, "tp_host_agg: sf/chain %d, bytes/chain %d\n",
		(rpcb->tp_tx_agg_cnt_chain == 0) ?
		0 : rpcb->tp_tx_agg_cnt_sf/rpcb->tp_tx_agg_cnt_chain,
		(rpcb->tp_tx_agg_cnt_chain == 0) ?
		0 : rpcb->tp_tx_agg_cnt_bytes/rpcb->tp_tx_agg_cnt_chain);

	bcm_bprintf(b, "\nRPC TP histogram\n");
	for (i = 0; i < BCM_RPC_TP_DBUS_NTXQ; i++) {
		if (rpcb->rpctp_dbus_hist[i]) {
			bcm_bprintf(b, "%d: %d ", i, rpcb->rpctp_dbus_hist[i]);
			j++;
			if (j % 10 == 0) {
				bcm_bprintf(b, "\n");
			}
		}
	}
	bcm_bprintf(b, "\n");

	RPC_TP_UNLOCK(rpcb);

	dbus_hist_dump(rpcb->bus, b);

	return 0;
}
Пример #19
0
/*
 * IGSL Packet Counters/Statistics Function
 */
static int32
igs_stats_get(char *buf, char **start, off_t offset, int32 size,
              int32 *eof, void *data)
{
	igs_info_t *igs_info = (igs_info_t *)data;
	igs_cfg_request_t *cfg;
	igs_stats_t *stats;
	struct bcmstrbuf b;

	ASSERT(igs_info);

	cfg = MALLOC(igs_info->osh, sizeof(igs_cfg_request_t));
	if (cfg == NULL)
	{
		IGS_ERROR("Out of memory allocating igs_cfg_request\n");
		return (FAILURE);
	}

	strcpy(cfg->inst_id, igs_info->inst_id);
	cfg->command_id = IGSCFG_CMD_IGS_STATS;
	cfg->oper_type = IGSCFG_OPER_TYPE_GET;
	cfg->size = sizeof(cfg->arg);
	stats = (igs_stats_t *)cfg->arg;

	igsc_cfg_request_process(igs_info->igsc_info, cfg);
	if (cfg->status != IGSCFG_STATUS_SUCCESS)
	{
		IGS_ERROR("Unable to get the IGS stats\n");
		MFREE(igs_info->osh, cfg, sizeof(igs_cfg_request_t));
		return (FAILURE);
	}

	bcm_binit(&b, buf, size);
	bcm_bprintf(&b, "IgmpPkts        IgmpQueries     "
	            "IgmpReports     IgmpV2Reports   "
#ifdef SUPPORT_IGMP_V3
	            "IgmpV3Reports   "
#endif
	            "IgmpLeaves\n");
	bcm_bprintf(&b, "%-15d %-15d %-15d %-15d "
#ifdef SUPPORT_IGMP_V3
	            "%-15d "
#endif
	            "%d\n",
	            stats->igmp_packets, stats->igmp_queries,
	            stats->igmp_reports, stats->igmp_v2reports,
#ifdef SUPPORT_IGMP_V3
		    stats->igmp_v3reports,
#endif
	            stats->igmp_leaves);
	bcm_bprintf(&b, "IgmpNotHandled  McastGroups     "
	            "McastMembers    MemTimeouts\n");
	bcm_bprintf(&b, "%-15d %-15d %-15d %d\n",
	            stats->igmp_not_handled, stats->igmp_mcast_groups,
	            stats->igmp_mcast_members, stats->igmp_mem_timeouts);
	MFREE(igs_info->osh, cfg, sizeof(igs_cfg_request_t));

	if (b.size == 0)
	{
		IGS_ERROR("Input buffer overflow\n");
		return (FAILURE);
	}

	return (b.buf - b.origbuf);
}
Пример #20
0
void
dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
{
	bcm_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
}
Пример #21
0
/* Dump PCIE PLP/DLLP/TLP  diagnostic registers */
int
pcicore_dump_pcieregs(void *pch, struct bcmstrbuf *b)
{
	pcicore_info_t *pi = (pcicore_info_t *)pch;
	sbpcieregs_t *pcieregs = pi->regs.pcieregs;
	si_t *sih = pi->sih;
	uint reg_val = 0;
	char bitfield_dump_buf[BITFIELD_DUMP_SIZE];

	bcm_bprintf(b, "PLPRegs \t");
	bcmdumpfields(si_pcie_readreg, (void *)(uintptr)pi->sih, PCIE_PCIEREGS,
		(struct fielddesc *)(uintptr)pcie_plp_regdesc,
		bitfield_dump_buf, BITFIELD_DUMP_SIZE);
	bcm_bprintf(b, "%s", bitfield_dump_buf);
	bzero(bitfield_dump_buf, BITFIELD_DUMP_SIZE);
	bcm_bprintf(b, "\n");
	bcm_bprintf(b, "DLLPRegs \t");
	bcmdumpfields(si_pcie_readreg, (void *)(uintptr)pi->sih, PCIE_PCIEREGS,
		(struct fielddesc *)(uintptr)pcie_dllp_regdesc,
		bitfield_dump_buf, BITFIELD_DUMP_SIZE);
	bcm_bprintf(b, "%s", bitfield_dump_buf);
	bzero(bitfield_dump_buf, BITFIELD_DUMP_SIZE);
	bcm_bprintf(b, "\n");
	bcm_bprintf(b, "TLPRegs \t");
	bcmdumpfields(si_pcie_readreg, (void *)(uintptr)pi->sih, PCIE_PCIEREGS,
		(struct fielddesc *)(uintptr)pcie_tlp_regdesc,
		bitfield_dump_buf, BITFIELD_DUMP_SIZE);
	bcm_bprintf(b, "%s", bitfield_dump_buf);
	bzero(bitfield_dump_buf, BITFIELD_DUMP_SIZE);
	bcm_bprintf(b, "\n");

	/* enable mdio access to SERDES */
	W_REG(pi->osh, (&pcieregs->mdiocontrol), MDIOCTL_PREAM_EN | MDIOCTL_DIVISOR_VAL);

	bcm_bprintf(b, "SERDES regs \n");
	if (sih->buscorerev >= 10) {
		pcie_mdioread(pi, MDIO_DEV_IEEE0, 0x2, &reg_val);
		bcm_bprintf(b, "block IEEE0, offset 2: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_IEEE0, 0x3, &reg_val);
		bcm_bprintf(b, "block IEEE0, offset 2: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_IEEE1, 0x08, &reg_val);
		bcm_bprintf(b, "block IEEE1, lanestatus: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_IEEE1, 0x0a, &reg_val);
		bcm_bprintf(b, "block IEEE1, lanestatus2: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_BLK4, 0x16, &reg_val);
		bcm_bprintf(b, "MDIO_DEV_BLK4, lanetest0: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_TXPLL, 0x11, &reg_val);
		bcm_bprintf(b, "MDIO_DEV_TXPLL, pllcontrol: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_TXPLL, 0x12, &reg_val);
		bcm_bprintf(b, "MDIO_DEV_TXPLL, plltimer1: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_TXPLL, 0x13, &reg_val);
		bcm_bprintf(b, "MDIO_DEV_TXPLL, plltimer2: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_TXPLL, 0x14, &reg_val);
		bcm_bprintf(b, "MDIO_DEV_TXPLL, plltimer3: 0x%x\n", reg_val);
		pcie_mdioread(pi, MDIO_DEV_TXPLL, 0x17, &reg_val);
		bcm_bprintf(b, "MDIO_DEV_TXPLL, freqdetcounter: 0x%x\n", reg_val);
	} else {
		pcie_mdioread(pi, MDIODATA_DEV_RX, SERDES_RX_TIMER1, &reg_val);
		bcm_bprintf(b, "rxtimer1 0x%x ", reg_val);
		pcie_mdioread(pi, MDIODATA_DEV_RX, SERDES_RX_CDR, &reg_val);
		bcm_bprintf(b, "rxCDR 0x%x ", reg_val);
		pcie_mdioread(pi, MDIODATA_DEV_RX, SERDES_RX_CDRBW, &reg_val);
		bcm_bprintf(b, "rxCDRBW 0x%x\n", reg_val);
	}

	/* disable mdio access to SERDES */
	W_REG(pi->osh, (&pcieregs->mdiocontrol), 0);

	return 0;
}