software/drivers/sd8887/src/wlan/mapp/mlan2040coex/mlan2040coex.c
/**
 *  @brief Configure and read event data from netlink socket
 *
 *  @param nl_sk        Netlink socket handler
 *  @param msg          Pointer to message header
 *  @param ptv          Pointer to struct timeval
 *
 *  @return             Number of bytes read or MLAN_STATUS_FAILURE
 */
@brief Configure and read event data from netlink socket
@param nl_sk        Netlink socket handler
@param msg          Pointer to message header
@param ptv          Pointer to struct timeval

@return             Number of bytes read or MLAN_STATUS_FAILURE
@brief Configure and read event data from netlink socket @param nl_sk Netlink socket handler @param msg Pointer to message header @param ptv Pointer to struct timeval @return Number of bytes read or MLAN_STATUS_FAILURE
int
read_event(int nl_sk, struct msghdr *msg, struct timeval *ptv)
{
	int count = -1;
	int ret = MLAN_STATUS_FAILURE;
	fd_set rfds;
	FD_ZERO(&rfds);
	FD_SET(nl_sk, &rfds);
	ret = select(nl_sk + 1, &rfds, NULL, NULL, ptv);
	if (ret == MLAN_STATUS_FAILURE) {
		terminate_flag++;
		ptv->tv_sec = DEFAULT_SCAN_INTERVAL;
		ptv->tv_usec = 0;
		goto done;
	} else if (!ret) {
		if (assoc_flag && is_ht_ap) {
			process_setuserscan();
			if (coex_cmd_req_flag)
				invoke_coex_command();
		}
		if (assoc_flag && is_ht_ap) {
			ptv->tv_sec =
				(t_u32)le16_to_cpu(cur_obss_scan_param.
						   bss_chan_width_trigger_scan_int);
		} else {
			ptv->tv_sec = DEFAULT_SCAN_INTERVAL;
		}
		ptv->tv_usec = 0;
		goto done;
	}
	if (!FD_ISSET(nl_sk, &rfds)) {
		ptv->tv_sec = DEFAULT_SCAN_INTERVAL;
		ptv->tv_usec = 0;
		goto done;
	}
	count = recvmsg(nl_sk, msg, 0);
done:
	return count;
}
int read_event ( int nl_sk , struct msghdr * msg , struct timeval * ptv ) { int count = -1 ; int ret = MLAN_STATUS_FAILURE ; fd_set rfds ; FD_ZERO ( & rfds ) ; FD_SET ( nl_sk , & rfds ) ; ret = select ( nl_sk + 1 , & rfds , NULL , NULL , ptv ) ; if ( ret == MLAN_STATUS_FAILURE ) { terminate_flag ++ ; ptv -> tv_sec = DEFAULT_SCAN_INTERVAL ; ptv -> tv_usec = 0 ; goto done ; } else if ( ! ret ) { if ( assoc_flag && is_ht_ap ) { process_setuserscan ( ) ; if ( coex_cmd_req_flag ) invoke_coex_command ( ) ; } if ( assoc_flag && is_ht_ap ) { ptv -> tv_sec = ( t_u32 ) le16_to_cpu ( cur_obss_scan_param . bss_chan_width_trigger_scan_int ) ; } else { ptv -> tv_sec = DEFAULT_SCAN_INTERVAL ; } ptv -> tv_usec = 0 ; goto done ; } if ( ! FD_ISSET ( nl_sk , & rfds ) ) { ptv -> tv_sec = DEFAULT_SCAN_INTERVAL ; ptv -> tv_usec = 0 ; goto done ; } count = recvmsg ( nl_sk , msg , 0 ) ; done : return count ; }
@brief Configure and read event data from netlink socket
  @param nl_sk        Netlink socket handler
  @param msg          Pointer to message header
  @param ptv          Pointer to struct timeval
@brief Configure and read event data from netlink socket @param nl_sk Netlink socket handler @param msg Pointer to message header @param ptv Pointer to struct timeval
/* Setup read fds and initialize event buffers */ /* Wait for reply */ /* Error */ /** Issue OBSS scan */ /** Invoke 2040coex command, if any legacy AP found or
             *  any AP has 40MHz intolarent bit set */ /* Timeout. Try again after BSS channel width triger scan
			   interval when the STA is connected with a HT AP */ /* Timeout. Try again after default duration when the STA is
			   not connected with a HT AP */ /* Unexpected error. Try again */ /* Success */