software/drivers/sd8887/src/wlan/mapp/mlanevent/mlanevent.c
/**
 *  @brief Parse and print debug event data
 *
 *  @param buffer   Pointer to received buffer
 *  @param size     Length of the received event data
 *  @return         N/A
 */
@brief Parse and print debug event data
@param buffer   Pointer to received buffer
@param size     Length of the received event data
@return         N/A
@brief Parse and print debug event data @param buffer Pointer to received buffer @param size Length of the received event data @return N / A
void
print_event_debug(t_u8 *buffer, t_u16 size)
{
	eventbuf_debug *event_body = NULL;
	if (size < sizeof(eventbuf_debug)) {
		printf("ERR:Event buffer too small!\n");
		return;
	}
	event_body = (eventbuf_debug *)buffer;
	printf("Debug Event Type: %s\n",
	       (event_body->debug_type == 0) ? "EVENT" : "INFO");
	printf("%s log:\n",
	       (uap_le32_to_cpu(event_body->debug_id_major) ==
		DEBUG_ID_MAJ_AUTHENTICATOR) ? "Authenticator" : "Assoc_agent");
	if (uap_le32_to_cpu(event_body->debug_id_major) ==
	    DEBUG_ID_MAJ_AUTHENTICATOR) {
		switch (uap_le32_to_cpu(event_body->debug_id_minor)) {
		case DEBUG_MAJ_AUTH_MIN_PWK1:
			printf("EAPOL Key message 1 (PWK):\n");
			hexdump((t_u8 *)&event_body->info.eapol_pwkmsg,
				sizeof(eapol_keymsg_debug_t), ' ');
			break;
		case DEBUG_MAJ_AUTH_MIN_PWK2:
			printf("EAPOL Key message 2 (PWK):\n");
			hexdump((t_u8 *)&event_body->info.eapol_pwkmsg,
				sizeof(eapol_keymsg_debug_t), ' ');
			break;
		case DEBUG_MAJ_AUTH_MIN_PWK3:
			printf("EAPOL Key message 3 (PWK):\n");
			hexdump((t_u8 *)&event_body->info.eapol_pwkmsg,
				sizeof(eapol_keymsg_debug_t), ' ');
			break;
		case DEBUG_MAJ_AUTH_MIN_PWK4:
			printf("EAPOL Key message 4: (PWK)\n");
			hexdump((t_u8 *)&event_body->info.eapol_pwkmsg,
				sizeof(eapol_keymsg_debug_t), ' ');
			break;
		case DEBUG_MAJ_AUTH_MIN_GWK1:
			printf("EAPOL Key message 1: (GWK)\n");
			hexdump((t_u8 *)&event_body->info.eapol_pwkmsg,
				sizeof(eapol_keymsg_debug_t), ' ');
			break;
		case DEBUG_MAJ_AUTH_MIN_GWK2:
			printf("EAPOL Key message 2: (GWK)\n");
			hexdump((t_u8 *)&event_body->info.eapol_pwkmsg,
				sizeof(eapol_keymsg_debug_t), ' ');
			break;
		case DEBUG_MAJ_AUTH_MIN_STA_REJ:
			printf("Reject STA MAC: ");
			print_mac(event_body->info.sta_reject.sta_mac_addr);
			printf("\n");
			print_reject_state(event_body->info.sta_reject.
					   reject_state);
			print_reject_reason(uap_le16_to_cpu
					    (event_body->info.sta_reject.
					     reject_reason));
			break;
		case DEBUG_MAJ_AUTH_MIN_EAPOL_TR:
			printf("STA MAC: ");
			print_mac(event_body->info.eapol_state.sta_mac_addr);
			printf("\n");
			print_eapol_state(event_body->info.eapol_state.
					  eapol_state);
			break;
		default:
			printf("ERR: unknow debug_id_minor: %d\n",
			       (int)uap_le32_to_cpu(event_body->
						    debug_id_minor));
			hexdump(buffer, size, ' ');
			return;
		}
	} else if (uap_le32_to_cpu(event_body->debug_id_major) ==
		   DEBUG_ID_MAJ_ASSOC_AGENT) {
		switch (uap_le32_to_cpu(event_body->debug_id_minor)) {
		case DEBUG_ID_MAJ_ASSOC_MIN_WPA_IE:
			printf("STA MAC: ");
			print_mac(event_body->info.wpaie.sta_mac_addr);
			printf("\n");
			printf("wpa ie:\n");
			hexdump(event_body->info.wpaie.wpa_ie, MAX_WPA_IE_LEN,
				' ');
			break;
		case DEBUG_ID_MAJ_ASSOC_MIN_STA_REJ:
			printf("Reject STA MAC: ");
			print_mac(event_body->info.sta_reject.sta_mac_addr);
			printf("\n");
			print_reject_state(event_body->info.sta_reject.
					   reject_state);
			print_reject_reason(uap_le16_to_cpu
					    (event_body->info.sta_reject.
					     reject_reason));
			break;
		default:
			printf("ERR: unknow debug_id_minor: %d\n",
			       (int)uap_le32_to_cpu(event_body->
						    debug_id_minor));
			hexdump(buffer, size, ' ');
			return;
		}
	}
	return;
}
void print_event_debug ( t_u8 * buffer , t_u16 size ) { eventbuf_debug * event_body = NULL ; if ( size < sizeof ( eventbuf_debug ) ) { printf ( " \n " ) ; return ; } event_body = ( eventbuf_debug * ) buffer ; printf ( " \n " , ( event_body -> debug_type == 0 ) ? " " : " " ) ; printf ( " \n " , ( uap_le32_to_cpu ( event_body -> debug_id_major ) == DEBUG_ID_MAJ_AUTHENTICATOR ) ? " " : " " ) ; if ( uap_le32_to_cpu ( event_body -> debug_id_major ) == DEBUG_ID_MAJ_AUTHENTICATOR ) { switch ( uap_le32_to_cpu ( event_body -> debug_id_minor ) ) { case DEBUG_MAJ_AUTH_MIN_PWK1 : printf ( " \n " ) ; hexdump ( ( t_u8 * ) & event_body -> info . eapol_pwkmsg , sizeof ( eapol_keymsg_debug_t ) , ' ' ) ; break ; case DEBUG_MAJ_AUTH_MIN_PWK2 : printf ( " \n " ) ; hexdump ( ( t_u8 * ) & event_body -> info . eapol_pwkmsg , sizeof ( eapol_keymsg_debug_t ) , ' ' ) ; break ; case DEBUG_MAJ_AUTH_MIN_PWK3 : printf ( " \n " ) ; hexdump ( ( t_u8 * ) & event_body -> info . eapol_pwkmsg , sizeof ( eapol_keymsg_debug_t ) , ' ' ) ; break ; case DEBUG_MAJ_AUTH_MIN_PWK4 : printf ( " \n " ) ; hexdump ( ( t_u8 * ) & event_body -> info . eapol_pwkmsg , sizeof ( eapol_keymsg_debug_t ) , ' ' ) ; break ; case DEBUG_MAJ_AUTH_MIN_GWK1 : printf ( " \n " ) ; hexdump ( ( t_u8 * ) & event_body -> info . eapol_pwkmsg , sizeof ( eapol_keymsg_debug_t ) , ' ' ) ; break ; case DEBUG_MAJ_AUTH_MIN_GWK2 : printf ( " \n " ) ; hexdump ( ( t_u8 * ) & event_body -> info . eapol_pwkmsg , sizeof ( eapol_keymsg_debug_t ) , ' ' ) ; break ; case DEBUG_MAJ_AUTH_MIN_STA_REJ : printf ( " " ) ; print_mac ( event_body -> info . sta_reject . sta_mac_addr ) ; printf ( " \n " ) ; print_reject_state ( event_body -> info . sta_reject . reject_state ) ; print_reject_reason ( uap_le16_to_cpu ( event_body -> info . sta_reject . reject_reason ) ) ; break ; case DEBUG_MAJ_AUTH_MIN_EAPOL_TR : printf ( " " ) ; print_mac ( event_body -> info . eapol_state . sta_mac_addr ) ; printf ( " \n " ) ; print_eapol_state ( event_body -> info . eapol_state . eapol_state ) ; break ; default : printf ( " \n " , ( int ) uap_le32_to_cpu ( event_body -> debug_id_minor ) ) ; hexdump ( buffer , size , ' ' ) ; return ; } } else if ( uap_le32_to_cpu ( event_body -> debug_id_major ) == DEBUG_ID_MAJ_ASSOC_AGENT ) { switch ( uap_le32_to_cpu ( event_body -> debug_id_minor ) ) { case DEBUG_ID_MAJ_ASSOC_MIN_WPA_IE : printf ( " " ) ; print_mac ( event_body -> info . wpaie . sta_mac_addr ) ; printf ( " \n " ) ; printf ( " \n " ) ; hexdump ( event_body -> info . wpaie . wpa_ie , MAX_WPA_IE_LEN , ' ' ) ; break ; case DEBUG_ID_MAJ_ASSOC_MIN_STA_REJ : printf ( " " ) ; print_mac ( event_body -> info . sta_reject . sta_mac_addr ) ; printf ( " \n " ) ; print_reject_state ( event_body -> info . sta_reject . reject_state ) ; print_reject_reason ( uap_le16_to_cpu ( event_body -> info . sta_reject . reject_reason ) ) ; break ; default : printf ( " \n " , ( int ) uap_le32_to_cpu ( event_body -> debug_id_minor ) ) ; hexdump ( buffer , size , ' ' ) ; return ; } } return ; }
@brief Parse and print debug event data
  @param buffer   Pointer to received buffer
  @param size     Length of the received event data
  @return         N/A
@brief Parse and print debug event data @param buffer Pointer to received buffer @param size Length of the received event data @return N / A