当前位置: 首页>>代码示例>>C++>>正文


C++ WLDEV_ERROR函数代码示例

本文整理汇总了C++中WLDEV_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ WLDEV_ERROR函数的具体用法?C++ WLDEV_ERROR怎么用?C++ WLDEV_ERROR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了WLDEV_ERROR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wldev_get_ap_status

int
wldev_get_ap_status(struct net_device *dev)
{
	int res = 0;
	int ap = 0;
	int apsta = 0;
       	char smbuf[WLC_IOCTL_SMLEN];

	printf("%s: enter\n", __FUNCTION__);

        if (!dev) {
                WLDEV_ERROR(("%s: dev is null\n", __FUNCTION__));
                return -1;
        }

        if ((res = wldev_ioctl(dev, WLC_GET_AP, &ap, sizeof(ap), 0))) {
                WLDEV_ERROR(("%s fail to get ap\n", __FUNCTION__));
		ap = 0;
	}

        if ((res = wldev_iovar_getbuf(dev, "apsta", &apsta, sizeof(apsta), smbuf, sizeof(smbuf), NULL)) < 0 ){
                WLDEV_ERROR(("%s fail to get apsta \n", __FUNCTION__));
        } else {
		memcpy(&apsta, smbuf, sizeof(apsta));
		apsta = dtoh32(apsta);
	}

	return (ap||apsta);
}
开发者ID:curbthepain,项目名称:NuK3rn3l_m7_sense_lollipop,代码行数:29,代码来源:wldev_common.c

示例2: wldev_set_country

int wldev_set_country(
	struct net_device *dev, char *country_code, bool notify, bool user_enforced)
{
#ifdef TEGRA_REGION_BASED_NVRAM
	if (nv_dhd_set_nvram_params(country_code, dev)) {
		WLDEV_ERROR(("nvram params changed for country code: %s: Reload f/w\n", country_code));
		return 0;
	} else
		return -1;
#else /* TEGRA_REGION_BASED_NVRAM */
	int error = -1;
	wl_country_t cspec = {{0}, 0, {0}};
	scb_val_t scbval;
	char smbuf[WLC_IOCTL_SMLEN];

	if (!country_code)
		return error;



	bzero(&scbval, sizeof(scb_val_t));
	error = wldev_iovar_getbuf(dev, "country", NULL, 0, &cspec, sizeof(cspec), NULL);
	if (error < 0) {
		WLDEV_ERROR(("%s: get country failed = %d\n", __FUNCTION__, error));
		return error;
	}

	if ((error < 0) ||
	    (strncmp(country_code, cspec.ccode, WLC_CNTRY_BUF_SZ) != 0)) {

		if (user_enforced) {
			bzero(&scbval, sizeof(scb_val_t));
			error = wldev_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t), true);
			if (error < 0) {
				WLDEV_ERROR(("%s: set country failed due to Disassoc error %d\n",
					__FUNCTION__, error));
				return error;
			}
		}

		cspec.rev = -1;
		memcpy(cspec.country_abbrev, country_code, WLC_CNTRY_BUF_SZ);
		memcpy(cspec.ccode, country_code, WLC_CNTRY_BUF_SZ);
		get_customized_country_code((char *)&cspec.country_abbrev, &cspec);
		error = wldev_iovar_setbuf(dev, "country", &cspec, sizeof(cspec),
			smbuf, sizeof(smbuf), NULL);
		if (error < 0) {
			WLDEV_ERROR(("%s: set country for %s as %s rev %d failed\n",
				__FUNCTION__, country_code, cspec.ccode, cspec.rev));
			return error;
		}
		dhd_bus_country_set(dev, &cspec, notify);
		WLDEV_ERROR(("%s: set country for %s as %s rev %d\n",
			__FUNCTION__, country_code, cspec.ccode, cspec.rev));
	}
	return 0;
#endif
}
开发者ID:Toradex-Apalis-TK1-AndroidTV,项目名称:android_kernel_nvidia_mm,代码行数:58,代码来源:wldev_common.c

示例3: wldev_get_rx_rate_stats

int wldev_get_rx_rate_stats(
	struct net_device *dev, char *command, int total_len)
{
	wl_scb_rx_rate_stats_t *rstats;
	struct ether_addr ea;
	char smbuf[WLC_IOCTL_SMLEN];
	char eabuf[18] = {0, };
	int bytes_written = 0;
	int error;

	memcpy(eabuf, command+strlen("RXRATESTATS")+1, 17);

	if (!bcm_ether_atoe(eabuf, &ea)) {
		WLDEV_ERROR(("Invalid MAC Address\n"));
		return -1;
	}

	error = wldev_iovar_getbuf(dev, "rx_rate_stats",
		&ea, ETHER_ADDR_LEN, smbuf, sizeof(smbuf), NULL);
	if (error < 0) {
		WLDEV_ERROR(("get rx_rate_stats failed = %d\n", error));
		return -1;
	}

	rstats = (wl_scb_rx_rate_stats_t *)smbuf;
	bytes_written = sprintf(command, "1/%d/%d,",
		dtoh32(rstats->rx1mbps[0]), dtoh32(rstats->rx1mbps[1]));
	bytes_written += sprintf(command+bytes_written, "2/%d/%d,",
		dtoh32(rstats->rx2mbps[0]), dtoh32(rstats->rx2mbps[1]));
	bytes_written += sprintf(command+bytes_written, "5.5/%d/%d,",
		dtoh32(rstats->rx5mbps5[0]), dtoh32(rstats->rx5mbps5[1]));
	bytes_written += sprintf(command+bytes_written, "6/%d/%d,",
		dtoh32(rstats->rx6mbps[0]), dtoh32(rstats->rx6mbps[1]));
	bytes_written += sprintf(command+bytes_written, "9/%d/%d,",
		dtoh32(rstats->rx9mbps[0]), dtoh32(rstats->rx9mbps[1]));
	bytes_written += sprintf(command+bytes_written, "11/%d/%d,",
		dtoh32(rstats->rx11mbps[0]), dtoh32(rstats->rx11mbps[1]));
	bytes_written += sprintf(command+bytes_written, "12/%d/%d,",
		dtoh32(rstats->rx12mbps[0]), dtoh32(rstats->rx12mbps[1]));
	bytes_written += sprintf(command+bytes_written, "18/%d/%d,",
		dtoh32(rstats->rx18mbps[0]), dtoh32(rstats->rx18mbps[1]));
	bytes_written += sprintf(command+bytes_written, "24/%d/%d,",
		dtoh32(rstats->rx24mbps[0]), dtoh32(rstats->rx24mbps[1]));
	bytes_written += sprintf(command+bytes_written, "36/%d/%d,",
		dtoh32(rstats->rx36mbps[0]), dtoh32(rstats->rx36mbps[1]));
	bytes_written += sprintf(command+bytes_written, "48/%d/%d,",
		dtoh32(rstats->rx48mbps[0]), dtoh32(rstats->rx48mbps[1]));
	bytes_written += sprintf(command+bytes_written, "54/%d/%d",
		dtoh32(rstats->rx54mbps[0]), dtoh32(rstats->rx54mbps[1]));

	return bytes_written;
}
开发者ID:Toradex-Apalis-TK1-AndroidTV,项目名称:android_kernel_nvidia_mm,代码行数:52,代码来源:wldev_common.c

示例4: wldev_set_country

int wldev_set_country(
	struct net_device *dev, char *country_code, bool notify, bool user_enforced, int revinfo)
{
	int error = -1;
	wl_country_t cspec = {{0}, 0, {0}};
	scb_val_t scbval;
	char smbuf[WLC_IOCTL_SMLEN];

	if (!country_code)
		return error;

	bzero(&scbval, sizeof(scb_val_t));
	error = wldev_iovar_getbuf(dev, "country", NULL, 0, &cspec, sizeof(cspec), NULL);
	if (error < 0) {
		WLDEV_ERROR(("%s: get country failed = %d\n", __FUNCTION__, error));
		return error;
	}

	if ((error < 0) ||
			dhd_force_country_change(dev) ||
	    (strncmp(country_code, cspec.ccode, WLC_CNTRY_BUF_SZ) != 0)) {

		if (user_enforced) {
			bzero(&scbval, sizeof(scb_val_t));
			error = wldev_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t), true);
			if (error < 0) {
				WLDEV_ERROR(("%s: set country failed due to Disassoc error %d\n",
					__FUNCTION__, error));
				return error;
			}
		}

		cspec.rev = revinfo;
		memcpy(cspec.country_abbrev, country_code, WLC_CNTRY_BUF_SZ);
		memcpy(cspec.ccode, country_code, WLC_CNTRY_BUF_SZ);
		dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec);
		error = wldev_iovar_setbuf(dev, "country", &cspec, sizeof(cspec),
			smbuf, sizeof(smbuf), NULL);
		if (error < 0) {
			WLDEV_ERROR(("%s: set country for %s as %s rev %d failed\n",
				__FUNCTION__, country_code, cspec.ccode, cspec.rev));
			return error;
		}
		dhd_bus_country_set(dev, &cspec, notify);
		WLDEV_ERROR(("%s: set country for %s as %s rev %d\n",
			__FUNCTION__, country_code, cspec.ccode, cspec.rev));
	}
	return 0;
}
开发者ID:rafat2026,项目名称:SpaceX-Kernel-Exynos7420,代码行数:49,代码来源:wldev_common.c

示例5: wldev_get_mode

int wldev_get_mode(
	struct net_device *dev, uint8 *cap)
{
	int error = 0;
	int chanspec = 0;
	uint16 band = 0;
	uint16 bandwidth = 0;
	wl_bss_info_t *bss = NULL;
	char* buf = kmalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
	if (!buf)
		return -1;
	*(u32*) buf = htod32(WL_EXTRA_BUF_MAX);
	error = wldev_ioctl(dev, WLC_GET_BSS_INFO, (void*)buf, WL_EXTRA_BUF_MAX, false);
	if (error) {
		WLDEV_ERROR(("%s:failed:%d\n", __FUNCTION__, error));
		return -1;
	}
	bss = (struct  wl_bss_info *)(buf + 4);
	chanspec = wl_chspec_driver_to_host(bss->chanspec);

	band = chanspec & WL_CHANSPEC_BAND_MASK;
	bandwidth = chanspec & WL_CHANSPEC_BW_MASK;

	if (band == WL_CHANSPEC_BAND_2G) {
		if (bss->n_cap)
			strcpy(cap, "n");
		else
			strcpy(cap, "bg");
	} else if (band == WL_CHANSPEC_BAND_5G) {
		if (bandwidth == WL_CHANSPEC_BW_80)
			strcpy(cap, "ac");
		else if ((bandwidth == WL_CHANSPEC_BW_40) || (bandwidth == WL_CHANSPEC_BW_20)) {
			if ((bss->nbss_cap & 0xf00) && (bss->n_cap))
				strcpy(cap, "n|ac");
			else if (bss->n_cap)
				strcpy(cap, "n");
			else if (bss->vht_cap)
				strcpy(cap, "ac");
			else
				strcpy(cap, "a");
		} else {
			WLDEV_ERROR(("%s:Mode get failed\n", __FUNCTION__));
			return -1;
		}

	}
	return error;
}
开发者ID:rafat2026,项目名称:SpaceX-Kernel-Exynos7420,代码行数:48,代码来源:wldev_common.c

示例6: wldev_get_auto_channel

/*
 *  softap channel autoselect
 */
int wldev_get_auto_channel(struct net_device *dev, int *chan)
{
	int chosen = 0;
	wl_uint32_list_t request;
	int retry = 0;
	int updown = 0;
	int ret = 0;
	wlc_ssid_t null_ssid;

	memset(&null_ssid, 0, sizeof(wlc_ssid_t));
	ret |= wldev_ioctl(dev, WLC_UP, &updown, sizeof(updown), true);

	ret |= wldev_ioctl(dev, WLC_SET_SSID, &null_ssid, sizeof(null_ssid), true);

	request.count = htod32(0);
	ret = wldev_ioctl(dev, WLC_START_CHANNEL_SEL, &request, sizeof(request), true);
	if (ret < 0) {
		WLDEV_ERROR(("can't start auto channel scan:%d\n", ret));
		goto fail;
	}

	while  (retry++ < 15) {

		bcm_mdelay(350);

		ret = wldev_ioctl(dev, WLC_GET_CHANNEL_SEL, &chosen, sizeof(chosen), false);

		if ((ret == 0) && (dtoh32(chosen) != 0)) {
			*chan = (uint16)chosen & 0x00FF;  /* covert chanspec --> chan number  */
			printf("%s: Got channel = %d, attempt:%d\n",
				__FUNCTION__, *chan, retry);
			break;
		}
	}

	if ((ret = wldev_ioctl(dev, WLC_DOWN, &updown, sizeof(updown), true)) < 0) {
		WLDEV_ERROR(("%s fail to WLC_DOWN ioctl err =%d\n", __FUNCTION__, ret));
		goto fail;
	}

fail :
	if (ret < 0) {
		WLDEV_ERROR(("%s: return value %d\n", __FUNCTION__, ret));
	}
	return ret;
}
开发者ID:JoinTheRealms,项目名称:TF700-dualboot-hunds,代码行数:49,代码来源:wldev_common.c

示例7: wldev_set_scansuppress

int
wldev_set_scansuppress(struct net_device *dev,int enable)
{
	int res = 0;
	int scan_unassoc_time ;

	printf("%s: enter\n", __FUNCTION__);

	if (!dev) {
		WLDEV_ERROR(("%s: dev is null\n", __FUNCTION__));
		return -1;
	}

	printf("wldev_set_scansuppress enable[%d]\n", enable);

	if(enable){
		scan_unassoc_time = 20;
		
		if((res =  wldev_ioctl(dev, WLC_SET_SCAN_UNASSOC_TIME, (char *)&scan_unassoc_time,sizeof(scan_unassoc_time), 1))) {
					WLDEV_ERROR(("%s fail to set  WLC_SET_SCAN_UNASSOC_TIME\n", __FUNCTION__));
		}

		if ((res = wldev_ioctl(dev, WLC_SET_SCANSUPPRESS, &enable, sizeof(enable), 1))) {
			WLDEV_ERROR(("%s fail to get ap\n", __FUNCTION__));
		}
		scan_suppress_flag = 1;
		printf("Successful enable scan suppress!!\n");
	}else{
		scan_unassoc_time = 80;
		
		if ((res =  wldev_ioctl(dev, WLC_SET_SCAN_UNASSOC_TIME, (char *)&scan_unassoc_time,sizeof(scan_unassoc_time), 1))) {
					WLDEV_ERROR(("%s fail to set  WLC_SET_SCAN_UNASSOC_TIME\n", __FUNCTION__));
		}

		if ((res = wldev_ioctl(dev, WLC_SET_SCANSUPPRESS, &enable, sizeof(enable), 1))) {
			WLDEV_ERROR(("%s fail to get ap\n", __FUNCTION__));		
		}
		scan_suppress_flag = 0;
		
		printf("Successful disable scan suppress!!\n");
	}
	
	return 0;
}
开发者ID:curbthepain,项目名称:NuK3rn3l_m7_sense_lollipop,代码行数:44,代码来源:wldev_common.c

示例8: wldev_set_apsta_cfg

int
wldev_set_apsta_cfg(struct net_device *dev, char *param_str)
{
	int res = 0;

	printf("%s: enter\n", __FUNCTION__);

        if (!dev) {
                 WLDEV_ERROR(("%s: dev is null\n", __FUNCTION__));
                 return -1;
  	}
	
	init_ap_profile_from_string(param_str, &ap_cfg);

        if ((res = set_apsta_cfg(dev, &ap_cfg)) < 0)
                 WLDEV_ERROR(("%s failed to set_apsta_cfg %d\n", __FUNCTION__, res));
	
	return res;
}
开发者ID:curbthepain,项目名称:NuK3rn3l_m7_sense_lollipop,代码行数:19,代码来源:wldev_common.c

示例9: wldev_set_ap_sta_registra_wsec

int wldev_set_ap_sta_registra_wsec(struct net_device *dev, char *command, int total_len)
{
	int bytes_written = 0;
	int wsec = 0;

        if ( !ap_net_dev ) return 0;

	wldev_iovar_getint(ap_net_dev, "wsec", &wsec);
	WLDEV_ERROR(("### %s devname[%s],got wsec(bset)=0x%x\n", __FUNCTION__, ap_net_dev->name, wsec));

	wsec |= SES_OW_ENABLED;
	WLDEV_ERROR(("### %s devname[%s],wsec=0x%x\n", __FUNCTION__, ap_net_dev->name, wsec));

	wldev_iovar_setint(ap_net_dev, "wsec", wsec);
	WLDEV_ERROR(("### %s devname[%s] seting\n", __FUNCTION__, ap_net_dev->name));

	wldev_iovar_getint(ap_net_dev, "wsec", &wsec);
	WLDEV_ERROR(("### %s devname[%s],got(aset) wsec=0x%x\n", __FUNCTION__, ap_net_dev->name, wsec));

	return bytes_written;
}
开发者ID:curbthepain,项目名称:NuK3rn3l_m7_sense_lollipop,代码行数:21,代码来源:wldev_common.c

示例10: wldev_mkiovar_bsscfg

/** Format a bsscfg indexed iovar buffer. The bsscfg index will be
 *  taken care of in dhd_ioctl_entry. Internal use only, not exposed to
 *  wl_iw, wl_cfg80211 and wl_cfgp2p
 */
s32 wldev_mkiovar_bsscfg(
	const s8 *iovar_name, s8 *param, s32 paramlen,
	s8 *iovar_buf, s32 buflen, s32 bssidx)
{
	const s8 *prefix = "bsscfg:";
	s8 *p;
	u32 prefixlen;
	u32 namelen;
	u32 iolen;

	if (bssidx == 0) {
		return wldev_mkiovar((s8*)iovar_name, (s8 *)param, paramlen,
			(s8 *) iovar_buf, buflen);
	}

	prefixlen = (u32) strlen(prefix); /* lengh of bsscfg prefix */
	namelen = (u32) strlen(iovar_name) + 1; /* lengh of iovar  name + null */
	iolen = prefixlen + namelen + sizeof(u32) + paramlen;

	if (buflen < 0 || iolen > (u32)buflen)
	{
		WLDEV_ERROR(("%s: buffer is too short\n", __FUNCTION__));
		return BCME_BUFTOOSHORT;
	}

	if (iovar_buf && buflen != 0)
		memset(iovar_buf, 0, buflen);
	else
		return BCME_BADARG;

	p = (s8 *)iovar_buf;
	/* copy prefix, no null */
	memcpy(p, prefix, prefixlen);
	p += prefixlen;

	/* copy iovar name including null */
	memcpy(p, iovar_name, namelen);
	p += namelen;

	/* bss config index as first param */
	bssidx = htod32(bssidx);
	memcpy(p, &bssidx, sizeof(u32));
	p += sizeof(u32);

	/* parameter buffer follows */
	if (paramlen)
		memcpy(p, param, paramlen);

	return iolen;

}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:55,代码来源:wldev_common.c

示例11: wldev_mkiovar_bsscfg

s32 wldev_mkiovar_bsscfg(
	const s8 *iovar_name, s8 *param, s32 paramlen,
	s8 *iovar_buf, s32 buflen, s32 bssidx)
{
	const s8 *prefix = "bsscfg:";
	s8 *p;
	u32 prefixlen;
	u32 namelen;
	u32 iolen;

	if (bssidx == 0) {
		return wldev_mkiovar((s8*)iovar_name, (s8 *)param, paramlen,
			(s8 *) iovar_buf, buflen);
	}

	prefixlen = (u32) strlen(prefix); 
	namelen = (u32) strlen(iovar_name) + 1; 
	iolen = prefixlen + namelen + sizeof(u32) + paramlen;

	if (buflen < 0 || iolen > (u32)buflen)
	{
		WLDEV_ERROR(("%s: buffer is too short\n", __FUNCTION__));
		return BCME_BUFTOOSHORT;
	}

	p = (s8 *)iovar_buf;

	
	memcpy(p, prefix, prefixlen);
	p += prefixlen;

	
	memcpy(p, iovar_name, namelen);
	p += namelen;

	
	bssidx = htod32(bssidx);
	memcpy(p, &bssidx, sizeof(u32));
	p += sizeof(u32);

	
	if (paramlen)
		memcpy(p, param, paramlen);

	return iolen;

}
开发者ID:smokin901,项目名称:m7-GPE-5.0.1,代码行数:47,代码来源:wldev_common.c

示例12: wldev_set_pktfilter_enable_by_id

static int wldev_set_pktfilter_enable_by_id(struct net_device *dev, int pkt_id, int enable)
{
	wl_pkt_filter_enable_t	enable_parm;
	char smbuf[WLC_IOCTL_SMLEN];
	int res;

	/* enable or disable pkt filter, enable:1, disable:0 */
	enable_parm.id = htod32(pkt_id);
	enable_parm.enable = htod32(enable);
	res = wldev_iovar_setbuf(dev, "pkt_filter_enable", &enable_parm, sizeof(enable_parm),
		smbuf, sizeof(smbuf), NULL);
	if (res < 0) {
		WLDEV_ERROR(("%s: set pkt_filter_enable failed, error:%d\n", __FUNCTION__, res));
		return res;
	}
	
	return 0;
}
开发者ID:curbthepain,项目名称:NuK3rn3l_m7_sense_lollipop,代码行数:18,代码来源:wldev_common.c

示例13: wldev_ioctl

s32 wldev_ioctl(
	struct net_device *dev, u32 cmd, void *arg, u32 len, u32 set)
{
	s32 ret = 0;
	struct wl_ioctl ioc;

	memset(&ioc, 0, sizeof(ioc));
	ioc.cmd = cmd;
	ioc.buf = arg;
	ioc.len = len;
	ioc.set = set;
	if (arg != NULL) {
		WLDEV_ERROR(("iovar:%s ioc->len%d cmd->%d type->%s\n",
			(char *)arg, ioc.len, cmd, set ? "set": "get"));
	}
	ret = dhd_ioctl_entry_local(dev, &ioc, cmd);
	return ret;
}
开发者ID:mdeejay,项目名称:kernel_huawei_front,代码行数:18,代码来源:wldev_common.c

示例14: wldev_set_apsta

int
wldev_set_apsta(struct net_device *dev, bool enable)
{
   	int res = 0;
   	int mpc = 0;
	int concr_mode = 0;
   	char smbuf[WLC_IOCTL_SMLEN];
	bss_setbuf_t bss_setbuf;

        memset(smbuf, 0, sizeof(smbuf));

	printf("%s: enter\n", __FUNCTION__);

   	if (!dev) {
                  WLDEV_ERROR(("%s: dev is null\n", __FUNCTION__));
                  return -1;
   	}

	if (enable){
		/* wait for interface ready */
		wait_for_ap_ready(1); //broacom 0405

		if ( ap_net_dev == NULL ) {
                        WLDEV_ERROR(("%s ap_net_dev == NULL\n", __FUNCTION__));
                        goto fail;
		}

		//2012-09-10 CT2 set Concr_mode ++++
		concr_mode = 1;
		if ((res = wldev_iovar_setint(dev, "concr_mode_set", concr_mode))) {
					printf("%s fail to set concr_mode res[%d]\n", __FUNCTION__,res);
		}
		//2012-09-10 CT2 set Concr_mode ++++

   		mpc = 0;
      	        if ((res = wldev_iovar_setint(dev, "mpc", mpc))) {
           	        WLDEV_ERROR(("%s fail to set mpc\n", __FUNCTION__));
           	        goto fail;
      	        }	

         	if ((res = wl_iw_set_ap_security(ap_net_dev, &ap_cfg)) != 0) {
           	        WLDEV_ERROR((" %s ERROR setting SOFTAP security in :%d\n", __FUNCTION__, res));
         	        goto fail;
                } 
                
                bss_setbuf.cfg = 1;
                bss_setbuf.val = 1;  /* up the interface */

                if ((res = wldev_iovar_setbuf_bsscfg(dev, "bss", &bss_setbuf, sizeof(bss_setbuf), smbuf, sizeof(smbuf), 1, NULL)) < 0){
           	         WLDEV_ERROR(("%s: ERROR:%d, set bss up failed\n", __FUNCTION__, res));
           	         goto fail;
        	}

	        bcm_mdelay(500);

		if ((res = wldev_iovar_setint(dev, "allmulti", 1))) {
            		WLDEV_ERROR(("%s: ERROR:%d, set allmulti failed\n", __FUNCTION__, res));
            		goto fail;
		}
//BRCM_APSTA_START
		set_ap_channel(dev,&ap_cfg);
		ap_net_dev->operstate = IF_OPER_UP;
//BRCM_APSTA_END
	} else {
		if ((res = wl_softap_stop(ap_net_dev))){
           		WLDEV_ERROR(("%s: ERROR:%d, call wl_softap_stop failed\n", __FUNCTION__, res));
           		goto fail;
		}

		//2012-09-10 CT2 set Concr_mode ++++
		concr_mode = 0;
		if ((res = wldev_iovar_setint(dev, "concr_mode_set", concr_mode))) {
				printf("%s fail to set concr_mode res[%d]\n", __FUNCTION__,res);
		}
		//2012-09-10 CT2 set Concr_mode ++++

    		mpc = 1;
	     	if ((res = wldev_iovar_setint(dev, "mpc", mpc))) {
        	   	WLDEV_ERROR(("%s fail to set mpc\n", __FUNCTION__));
           		goto fail;
	      	}	
	}

fail:
    return res;
}
开发者ID:JmzTaylor,项目名称:android_kernel_htc_totemc2,代码行数:86,代码来源:wldev_common.c

示例15: wldev_set_country

int wldev_set_country(
	struct net_device *dev, char *country_code, bool notify, bool user_enforced)
{
	int error = -1;
	wl_country_t cspec = {{0}, 0, {0}};
	scb_val_t scbval;
	char smbuf[WLC_IOCTL_SMLEN];

//CY+ default country when set country fail
	char default_country[10] = "XY";
//CY-
#ifdef CHIPNUM
	uint chipnum = 0;
#endif

	if (!country_code)
		return error;

	bzero(&scbval, sizeof(scb_val_t));
	error = wldev_iovar_getbuf(dev, "country", NULL, 0, &cspec, sizeof(cspec), NULL);
	if (error < 0) {
		WLDEV_ERROR(("%s: get country failed = %d\n", __FUNCTION__, error));
		return error;
	}

//CY+ always set country
#if 0
	if ((error < 0) ||
	    (strncmp(country_code, cspec.country_abbrev, WLC_CNTRY_BUF_SZ) != 0)) {
#else
	if(true){
#endif
//CY- always set country

		if (user_enforced) {
			bzero(&scbval, sizeof(scb_val_t));
			error = wldev_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t), true);
			if (error < 0) {
				WLDEV_ERROR(("%s: set country failed due to Disassoc error %d\n",
					__FUNCTION__, error));
				return error;
			}
		}

		cspec.rev = -1;
		memcpy(cspec.country_abbrev, country_code, WLC_CNTRY_BUF_SZ);
		memcpy(cspec.ccode, country_code, WLC_CNTRY_BUF_SZ);
#ifdef CHIPNUM
		chipnum = dhd_get_chipnum(dev);
		printk("%s: chipnum:%d\n", __FUNCTION__, chipnum);
		dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec, chipnum);

//CY+ set default country
//BCM43340: XY
//BCM43362: XV
//BCM4343s: XV
		if (chipnum == 43430){
			sprintf(default_country, "XV");
		}else if (chipnum == 43362){
			sprintf(default_country, "XV");
		}else {
			sprintf(default_country, "XY");
		}
		WLDEV_ERROR(("%s: set default country to %s for CHIP %d\n", __FUNCTION__, default_country, chipnum));
//CY-

#else
		dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec);
#endif

		error = wldev_iovar_setbuf(dev, "country", &cspec, sizeof(cspec),
			smbuf, sizeof(smbuf), NULL);
		if (error < 0) {
			WLDEV_ERROR(("%s: set country for %s as %s rev %d failed, try to use %s\n",
				__FUNCTION__, country_code, cspec.ccode, cspec.rev, default_country));
			//return error;

			//if set country error, use default_country
			cspec.rev = -1;
			memcpy(cspec.country_abbrev, default_country, WLC_CNTRY_BUF_SZ);
			memcpy(cspec.ccode, default_country, WLC_CNTRY_BUF_SZ);

#ifdef CHIPNUM
			dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec, chipnum);
#else
			dhd_get_customized_country_code(dev, (char *)&cspec.country_abbrev, &cspec);
#endif

			error = wldev_iovar_setbuf(dev, "country", &cspec, sizeof(cspec),
				smbuf, sizeof(smbuf), NULL);
			if (error < 0) {
				WLDEV_ERROR(("%s: set country for %s as %s rev %d failed\n",
					__FUNCTION__, country_code, cspec.ccode, cspec.rev));
				return error;
			}
		}
		dhd_bus_country_set(dev, &cspec, notify);
		WLDEV_ERROR(("%s: set country for %s as %s rev %d\n",
			__FUNCTION__, country_code, cspec.ccode, cspec.rev));
	}
//.........这里部分代码省略.........
开发者ID:nel82,项目名称:android_zenfone4_kernel,代码行数:101,代码来源:wldev_common.c


注:本文中的WLDEV_ERROR函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。