software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Get Driver Version
 *
 *  @param priv         A pointer to moal_private structure
 *  @param req          A pointer to ifreq structure
 *
 *  @return             0 --success, otherwise fail
 */
@brief Get Driver Version
@param priv         A pointer to moal_private structure
@param req          A pointer to ifreq structure

@return             0 --success, otherwise fail
@brief Get Driver Version @param priv A pointer to moal_private structure @param req A pointer to ifreq structure @return 0 -- success otherwise fail
int
woal_get_driver_version(moal_private *priv, struct ifreq *req)
{
	struct iwreq *wrq = (struct iwreq *)req;
	int len;
	char buf[MLAN_MAX_VER_STR_LEN];
	ENTER();
	woal_get_version(priv->phandle, buf, sizeof(buf) - 1);
	len = strlen(buf);
	if (wrq->u.data.pointer) {
		if (copy_to_user(wrq->u.data.pointer, buf, len)) {
			PRINTM(MERROR, "Copy to user failed\n");
			LEAVE();
			return -EFAULT;
		}
		wrq->u.data.length = len;
	}
	PRINTM(MINFO, "MOAL VERSION: %s\n", buf);
	LEAVE();
	return 0;
}
int woal_get_driver_version ( moal_private * priv , struct ifreq * req ) { struct iwreq * wrq = ( struct iwreq * ) req ; int len ; char buf [ MLAN_MAX_VER_STR_LEN ] ; ENTER ( ) ; woal_get_version ( priv -> phandle , buf , sizeof ( buf ) - 1 ) ; len = strlen ( buf ) ; if ( wrq -> u . data . pointer ) { if ( copy_to_user ( wrq -> u . data . pointer , buf , len ) ) { PRINTM ( MERROR , " \n " ) ; LEAVE ( ) ; return - EFAULT ; } wrq -> u . data . length = len ; } PRINTM ( MINFO , " \n " , buf ) ; LEAVE ( ) ; return 0 ; }
@brief Get Driver Version
  @param priv         A pointer to moal_private structure
  @param req          A pointer to ifreq structure
@brief Get Driver Version @param priv A pointer to moal_private structure @param req A pointer to ifreq structure