Lines Matching +full:tx +full:- +full:sec

21  * <<Broadcom-WL-IPTag/Open:>>
38 #define DHD_STATLOG_ERR_INTERNAL(fmt, ...) DHD_ERROR(("STATLOG-" fmt, ##__VA_ARGS__))
39 #define DHD_STATLOG_INFO_INTERNAL(fmt, ...) DHD_INFO(("STATLOG-" fmt, ##__VA_ARGS__))
57 statlog = (dhd_statlog_t *)VMALLOCZ(dhdp->osh, sizeof(dhd_statlog_t)); in dhd_attach_statlog()
65 statlog->logbuf = (uint8 *)VMALLOCZ(dhdp->osh, logbuf_len); in dhd_attach_statlog()
66 if (!statlog->logbuf) { in dhd_attach_statlog()
70 statlog->logbuf_len = logbuf_len; in dhd_attach_statlog()
73 statlog->bufsize = (uint32)(dhd_ring_get_hdr_size() + in dhd_attach_statlog()
75 buf = VMALLOCZ(dhdp->osh, statlog->bufsize); in dhd_attach_statlog()
82 statlog->ringbuf = dhd_ring_init(dhdp, buf, statlog->bufsize, in dhd_attach_statlog()
84 if (!statlog->ringbuf) { in dhd_attach_statlog()
86 VMFREE(dhdp->osh, buf, statlog->bufsize); in dhd_attach_statlog()
91 statlog->bdlog_bufsize = (uint32)(dhd_ring_get_hdr_size() + in dhd_attach_statlog()
93 buf = VMALLOCZ(dhdp->osh, statlog->bdlog_bufsize); in dhd_attach_statlog()
100 statlog->bdlog_ringbuf = dhd_ring_init(dhdp, buf, statlog->bdlog_bufsize, in dhd_attach_statlog()
102 if (!statlog->bdlog_ringbuf) { in dhd_attach_statlog()
105 VMFREE(dhdp->osh, buf, statlog->bdlog_bufsize); in dhd_attach_statlog()
112 if (statlog->logbuf) { in dhd_attach_statlog()
113 VMFREE(dhdp->osh, statlog->logbuf, logbuf_len); in dhd_attach_statlog()
116 if (statlog->ringbuf) { in dhd_attach_statlog()
117 dhd_ring_deinit(dhdp, statlog->ringbuf); in dhd_attach_statlog()
118 VMFREE(dhdp->osh, statlog->ringbuf, statlog->bufsize); in dhd_attach_statlog()
121 if (statlog->bdlog_ringbuf) { in dhd_attach_statlog()
122 dhd_ring_deinit(dhdp, statlog->bdlog_ringbuf); in dhd_attach_statlog()
123 VMFREE(dhdp->osh, statlog->bdlog_ringbuf, statlog->bdlog_bufsize); in dhd_attach_statlog()
127 VMFREE(dhdp->osh, statlog, sizeof(dhd_statlog_t)); in dhd_attach_statlog()
143 if (!dhdp->statlog) { in dhd_detach_statlog()
148 statlog = (dhd_statlog_t *)(dhdp->statlog); in dhd_detach_statlog()
150 if (statlog->bdlog_ringbuf) { in dhd_detach_statlog()
151 dhd_ring_deinit(dhdp, statlog->bdlog_ringbuf); in dhd_detach_statlog()
152 VMFREE(dhdp->osh, statlog->bdlog_ringbuf, statlog->bdlog_bufsize); in dhd_detach_statlog()
155 if (statlog->ringbuf) { in dhd_detach_statlog()
156 dhd_ring_deinit(dhdp, statlog->ringbuf); in dhd_detach_statlog()
157 VMFREE(dhdp->osh, statlog->ringbuf, statlog->bufsize); in dhd_detach_statlog()
160 if (statlog->logbuf) { in dhd_detach_statlog()
161 VMFREE(dhdp->osh, statlog->logbuf, statlog->logbuf_len); in dhd_detach_statlog()
164 VMFREE(dhdp->osh, statlog, sizeof(dhd_statlog_t)); in dhd_detach_statlog()
165 dhdp->statlog = NULL; in dhd_detach_statlog()
175 if (!dhdp || !dhdp->statlog) { in dhd_statlog_ring_log()
176 DHD_STATLOG_ERR(("%s: dhdp or dhdp->statlog is NULL\n", in dhd_statlog_ring_log()
191 statlog = (dhd_statlog_t *)(dhdp->statlog); in dhd_statlog_ring_log()
192 elem = (stat_elem_t *)dhd_ring_get_empty(statlog->ringbuf); in dhd_statlog_ring_log()
200 elem->ts_tz = OSL_SYSTZTIME_US(); in dhd_statlog_ring_log()
201 elem->ts = OSL_LOCALTIME_NS(); in dhd_statlog_ring_log()
202 elem->stat = stat; in dhd_statlog_ring_log()
203 elem->ifidx = ifidx; in dhd_statlog_ring_log()
204 elem->dir = dir; in dhd_statlog_ring_log()
205 elem->reason = reason; in dhd_statlog_ring_log()
206 elem->status = status; in dhd_statlog_ring_log()
209 if (isset(statlog->bdmask, stat)) { in dhd_statlog_ring_log()
211 elem_bd = (stat_elem_t *)dhd_ring_get_empty(statlog->bdlog_ringbuf); in dhd_statlog_ring_log()
229 dir ? STDIR(TX) : STDIR(RX), 0, 0) : BCME_OK; in dhd_statlog_ring_log_data()
237 dir ? STDIR(TX) : STDIR(RX), 0, reason); in dhd_statlog_ring_log_data_reason()
253 if (!dhdp || !dhdp->statlog) { in dhd_statlog_process_event()
254 DHD_STATLOG_ERR(("%s: dhdp or dhdp->statlog is NULL\n", in dhd_statlog_process_event()
291 dir = STDIR(TX); in dhd_statlog_process_event()
298 dir = STDIR(TX); in dhd_statlog_process_event()
305 dir = STDIR(TX); in dhd_statlog_process_event()
317 dir = STDIR(TX); in dhd_statlog_process_event()
335 dir = STDIR(TX); in dhd_statlog_process_event()
358 if (dhdp && dhdp->statlog) { in dhd_statlog_get_logbuf_len()
359 statlog = (dhd_statlog_t *)(dhdp->statlog); in dhd_statlog_get_logbuf_len()
360 length = statlog->logbuf_len; in dhd_statlog_get_logbuf_len()
372 if (dhdp && dhdp->statlog) { in dhd_statlog_get_logbuf()
373 statlog = (dhd_statlog_t *)(dhdp->statlog); in dhd_statlog_get_logbuf()
374 ret_addr = (void *)(statlog->logbuf); in dhd_statlog_get_logbuf()
389 bool tx = (dir == STDIR(TX)); in dhd_statlog_stat_name() local
409 stat_str = tx ? "ASSOC_REQ" : "RX_ASSOC_REQ"; in dhd_statlog_stat_name()
427 stat_str = tx ? "DISASSOC_EVENT" : "DISASSOC_IND_EVENT"; in dhd_statlog_stat_name()
430 stat_str = tx ? "DEAUTH_EVENT" : "DEAUTH_IND_EVENT"; in dhd_statlog_stat_name()
445 stat_str = tx ? "TX_EAPOL_M1" : "RX_EAPOL_M1"; in dhd_statlog_stat_name()
448 stat_str = tx ? "TX_EAPOL_M2" : "RX_EAPOL_M2"; in dhd_statlog_stat_name()
451 stat_str = tx ? "TX_EAPOL_M3" : "RX_EAPOL_M3"; in dhd_statlog_stat_name()
454 stat_str = tx ? "TX_EAPOL_M4" : "RX_EAPOL_M4"; in dhd_statlog_stat_name()
457 stat_str = tx ? "TX_EAPOL_GROUPKEY_M1" : "RX_EAPOL_GROUPKEY_M1"; in dhd_statlog_stat_name()
460 stat_str = tx ? "TX_EAPOL_GROUPKEY_M2" : "RX_EAPOL_GROUPKEY_M2"; in dhd_statlog_stat_name()
463 stat_str = tx ? "TX_EAP_REQ_IDENTITY" : "RX_EAP_REQ_IDENTITY"; in dhd_statlog_stat_name()
466 stat_str = tx ? "TX_EAP_RESP_IDENTITY" : "RX_EAP_RESP_IDENTITY"; in dhd_statlog_stat_name()
469 stat_str = tx ? "TX_EAP_REQ_TLS" : "RX_EAP_REQ_TLS"; in dhd_statlog_stat_name()
472 stat_str = tx ? "TX_EAP_RESP_TLS" : "RX_EAP_RESP_TLS"; in dhd_statlog_stat_name()
475 stat_str = tx ? "TX_EAP_REQ_LEAP" : "RX_EAP_REQ_LEAP"; in dhd_statlog_stat_name()
478 stat_str = tx ? "TX_EAP_RESP_LEAP" : "RX_EAP_RESP_LEAP"; in dhd_statlog_stat_name()
481 stat_str = tx ? "TX_EAP_REQ_TTLS" : "RX_EAP_REQ_TTLS"; in dhd_statlog_stat_name()
484 stat_str = tx ? "TX_EAP_RESP_TTLS" : "RX_EAP_RESP_TTLS"; in dhd_statlog_stat_name()
487 stat_str = tx ? "TX_EAP_REQ_AKA" : "RX_EAP_REQ_AKA"; in dhd_statlog_stat_name()
490 stat_str = tx ? "TX_EAP_RESP_AKA" : "RX_EAP_RESP_AKA"; in dhd_statlog_stat_name()
493 stat_str = tx ? "TX_EAP_REQ_PEAP" : "RX_EAP_REQ_PEAP"; in dhd_statlog_stat_name()
496 stat_str = tx ? "TX_EAP_RESP_PEAP" : "RX_EAP_RESP_PEAP"; in dhd_statlog_stat_name()
499 stat_str = tx ? "TX_EAP_REQ_FAST" : "RX_EAP_REQ_FAST"; in dhd_statlog_stat_name()
502 stat_str = tx ? "TX_EAP_RESP_FAST" : "RX_EAP_RESP_FAST"; in dhd_statlog_stat_name()
505 stat_str = tx ? "TX_EAP_REQ_PSK" : "RX_EAP_REQ_PSK"; in dhd_statlog_stat_name()
508 stat_str = tx ? "TX_EAP_RESP_PSK" : "RX_EAP_RESP_PSK"; in dhd_statlog_stat_name()
511 stat_str = tx ? "TX_EAP_REQ_AKAP" : "RX_EAP_REQ_AKAP"; in dhd_statlog_stat_name()
514 stat_str = tx ? "TX_EAP_RESP_AKAP" : "RX_EAP_RESP_AKAP"; in dhd_statlog_stat_name()
517 stat_str = tx ? "TX_EAP_SUCCESS" : "RX_EAP_SUCCESS"; in dhd_statlog_stat_name()
520 stat_str = tx ? "TX_EAP_FAILURE" : "RX_EAP_FAILURE"; in dhd_statlog_stat_name()
523 stat_str = tx ? "TX_EAPOL_START" : "RX_EAPOL_START"; in dhd_statlog_stat_name()
526 stat_str = tx ? "TX_WSC_START" : "RX_WSC_START"; in dhd_statlog_stat_name()
529 stat_str = tx ? "TX_WSC_DONE" : "RX_WSC_DONE"; in dhd_statlog_stat_name()
532 stat_str = tx ? "TX_WPS_M1" : "RX_WPS_M1"; in dhd_statlog_stat_name()
535 stat_str = tx ? "TX_WPS_M2" : "RX_WPS_M2"; in dhd_statlog_stat_name()
538 stat_str = tx ? "TX_WPS_M3" : "RX_WPS_M3"; in dhd_statlog_stat_name()
541 stat_str = tx ? "TX_WPS_M4" : "RX_WPS_M4"; in dhd_statlog_stat_name()
544 stat_str = tx ? "TX_WPS_M5" : "RX_WPS_M5"; in dhd_statlog_stat_name()
547 stat_str = tx ? "TX_WPS_M6" : "RX_WPS_M6"; in dhd_statlog_stat_name()
550 stat_str = tx ? "TX_WPS_M7" : "RX_WPS_M7"; in dhd_statlog_stat_name()
553 stat_str = tx ? "TX_WPS_M8" : "RX_WPS_M8"; in dhd_statlog_stat_name()
556 stat_str = tx ? "TX_OTHER_8021X" : "RX_OTHER_8021X"; in dhd_statlog_stat_name()
571 stat_str = tx ? "TX_DHCP_DISCOVER" : "RX_DHCP_DISCOVER"; in dhd_statlog_stat_name()
574 stat_str = tx ? "TX_DHCP_OFFER" : "RX_DHCP_OFFER"; in dhd_statlog_stat_name()
577 stat_str = tx ? "TX_DHCP_REQUEST" : "RX_DHCP_REQUEST"; in dhd_statlog_stat_name()
580 stat_str = tx ? "TX_DHCP_DECLINE" : "RX_DHCP_DECLINE"; in dhd_statlog_stat_name()
583 stat_str = tx ? "TX_DHCP_ACK" : "RX_DHCP_ACK"; in dhd_statlog_stat_name()
586 stat_str = tx ? "TX_DHCP_NAK" : "RX_DHCP_NAK"; in dhd_statlog_stat_name()
589 stat_str = tx ? "TX_DHCP_RELEASE" : "RX_DHCP_RELEASE"; in dhd_statlog_stat_name()
592 stat_str = tx ? "TX_DHCP_INFORM" : "RX_DHCP_INFORM"; in dhd_statlog_stat_name()
595 stat_str = tx ? "TX_ICMP_PING_REQ" : "RX_ICMP_PING_REQ"; in dhd_statlog_stat_name()
598 stat_str = tx ? "TX_ICMP_PING_RESP" : "RX_ICMP_PING_RESP"; in dhd_statlog_stat_name()
601 stat_str = tx ? "TX_ICMP_DEST_UNREACH" : "RX_ICMP_DEST_UNREACH"; in dhd_statlog_stat_name()
604 stat_str = tx ? "TX_ICMP_OTHER" : "RX_ICMP_OTHER"; in dhd_statlog_stat_name()
607 stat_str = tx ? "TX_ARP_REQ" : "RX_ARP_REQ"; in dhd_statlog_stat_name()
610 stat_str = tx ? "TX_ARP_RESP" : "RX_ARP_RESP"; in dhd_statlog_stat_name()
613 stat_str = tx ? "TX_DNS_QUERY" : "RX_DNS_QUERY"; in dhd_statlog_stat_name()
616 stat_str = tx ? "TX_DNS_RESP" : "RX_DNS_RESP"; in dhd_statlog_stat_name()
666 buf[max_buf_len - 1] = '\0'; in dhd_statlog_stat_name()
670 dhd_statlog_get_timestamp(stat_elem_t *elem, uint64 *sec, uint64 *usec) in dhd_statlog_get_timestamp() argument
674 ts_nsec = elem->ts; in dhd_statlog_get_timestamp()
676 *sec = ts_nsec; in dhd_statlog_get_timestamp()
693 ts_sec = elem->ts_tz; in dhd_statlog_convert_time()
698 tm.tm_year - 100, tm.tm_mon + 1, tm.tm_mday, in dhd_statlog_convert_time()
713 uint64 sec = 0, usec = 0; in dhd_statlog_dump() local
723 dhd_ring_whole_lock(statlog->ringbuf); in dhd_statlog_dump()
724 elem = (stat_elem_t *)dhd_ring_get_first(statlog->ringbuf); in dhd_statlog_dump()
726 if (DHD_STATLOG_VALID(elem->stat)) { in dhd_statlog_dump()
728 elem->stat, elem->dir); in dhd_statlog_dump()
729 dhd_statlog_get_timestamp(elem, &sec, &usec); in dhd_statlog_dump()
732 "reason=%d, status=%d\n", ts_str, (unsigned long)sec, in dhd_statlog_dump()
733 (unsigned long)usec, stat_str, elem->ifidx, in dhd_statlog_dump()
734 elem->reason, elem->status); in dhd_statlog_dump()
736 elem = (stat_elem_t *)dhd_ring_get_next(statlog->ringbuf, (void *)elem); in dhd_statlog_dump()
738 dhd_ring_whole_unlock(statlog->ringbuf); in dhd_statlog_dump()
740 return (!strbuf->size ? BCME_BUFTOOSHORT : strbuf->size); in dhd_statlog_dump()
754 if (!dhdp || !dhdp->statlog) { in dhd_statlog_write_logdump()
755 DHD_STATLOG_ERR(("%s: dhdp or dhdp->statlog is NULL\n", in dhd_statlog_write_logdump()
760 statlog = (dhd_statlog_t *)(dhdp->statlog); in dhd_statlog_write_logdump()
761 if (!statlog->logbuf) { in dhd_statlog_write_logdump()
766 buf = statlog->logbuf; in dhd_statlog_write_logdump()
767 buflen = statlog->logbuf_len; in dhd_statlog_write_logdump()
788 sec_hdr.length = buflen - remain_len; in dhd_statlog_write_logdump()
796 ret = dhd_export_debug_data(buf, fp, user_buf, buflen - remain_len, pos); in dhd_statlog_write_logdump()
819 if (!dhdp || !dhdp->statlog) { in dhd_statlog_generate_bdmask()
829 statlog = dhdp->statlog; in dhd_statlog_generate_bdmask()
831 req_buf = query->req_buf; in dhd_statlog_generate_bdmask()
832 req_buf_len = query->req_buf_len; in dhd_statlog_generate_bdmask()
838 bzero(statlog->bdmask, DHD_STAT_BDMASK_SIZE); in dhd_statlog_generate_bdmask()
841 setbit(statlog->bdmask, req_buf[cnt]); in dhd_statlog_generate_bdmask()
861 if (!dhdp || !dhdp->statlog) { in dhd_statlog_get_latest_info()
873 statlog = (dhd_statlog_t *)(dhdp->statlog); in dhd_statlog_get_latest_info()
874 req_buf = query->req_buf; in dhd_statlog_get_latest_info()
875 req_buf_len = query->req_buf_len; in dhd_statlog_get_latest_info()
876 resp_buf = query->resp_buf; in dhd_statlog_get_latest_info()
877 resp_buf_len = query->resp_buf_len; in dhd_statlog_get_latest_info()
878 req_num = MIN(query->req_num, MAX_STATLOG_REQ_ITEM); in dhd_statlog_get_latest_info()
887 ringbuf = statlog->bdlog_ringbuf; in dhd_statlog_get_latest_info()
889 ringbuf = statlog->ringbuf; in dhd_statlog_get_latest_info()
903 if (query_bigdata || isset(filter, elem->stat)) { in dhd_statlog_get_latest_info()
911 remain_len -= sizeof(stat_elem_t); in dhd_statlog_get_latest_info()
937 uint64 sec = 0, usec = 0; in dhd_statlog_query() local
968 req_buf = (uint8 *)MALLOCZ(dhdp->osh, req_buf_len); in dhd_statlog_query()
990 resp_buf = (uint8 *)MALLOCZ(dhdp->osh, resp_buf_len); in dhd_statlog_query()
1016 if (DHD_STATLOG_VALID(elem->stat)) { in dhd_statlog_query()
1018 elem->stat, elem->dir); in dhd_statlog_query()
1019 dhd_statlog_get_timestamp(elem, &sec, &usec); in dhd_statlog_query()
1022 " ifidx=%d, reason=%d, status=%d\n", elem->ts_tz, in dhd_statlog_query()
1023 ts_str, (unsigned long)sec, (unsigned long)usec, in dhd_statlog_query()
1024 stat_str, elem->ifidx, elem->reason, elem->status)); in dhd_statlog_query()
1034 MFREE(dhdp->osh, resp_buf, resp_buf_len); in dhd_statlog_query()
1038 MFREE(dhdp->osh, req_buf, req_buf_len); in dhd_statlog_query()
1051 uint64 sec = 0, usec = 0; in dhd_statlog_dump_scr() local
1053 if (!dhdp || !dhdp->statlog) { in dhd_statlog_dump_scr()
1058 statlog = (dhd_statlog_t *)(dhdp->statlog); in dhd_statlog_dump_scr()
1063 dhd_ring_whole_lock(statlog->ringbuf); in dhd_statlog_dump_scr()
1064 elem = (stat_elem_t *)dhd_ring_get_first(statlog->ringbuf); in dhd_statlog_dump_scr()
1066 if (DHD_STATLOG_VALID(elem->stat)) { in dhd_statlog_dump_scr()
1068 elem->stat, elem->dir); in dhd_statlog_dump_scr()
1069 dhd_statlog_get_timestamp(elem, &sec, &usec); in dhd_statlog_dump_scr()
1072 " ifidx=%d, reason=%d, status=%d\n", elem->ts_tz, ts_str, in dhd_statlog_dump_scr()
1073 (unsigned long)sec, (unsigned long)usec, stat_str, in dhd_statlog_dump_scr()
1074 elem->ifidx, elem->reason, elem->status)); in dhd_statlog_dump_scr()
1076 elem = (stat_elem_t *)dhd_ring_get_next(statlog->ringbuf, (void *)elem); in dhd_statlog_dump_scr()
1078 dhd_ring_whole_unlock(statlog->ringbuf); in dhd_statlog_dump_scr()