本文整理汇总了C++中WL_ERR函数的典型用法代码示例。如果您正苦于以下问题:C++ WL_ERR函数的具体用法?C++ WL_ERR怎么用?C++ WL_ERR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WL_ERR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wl_cfgvendor_gscan_get_capabilities
static int wl_cfgvendor_gscan_get_capabilities(struct wiphy *wiphy,
struct wireless_dev *wdev, const void *data, int len)
{
int err = 0;
struct bcm_cfg80211 *cfg = wiphy_priv(wiphy);
dhd_pno_gscan_capabilities_t *reply = NULL;
uint32 reply_len = 0;
reply = dhd_dev_pno_get_gscan(bcmcfg_to_prmry_ndev(cfg),
DHD_PNO_GET_CAPABILITIES, NULL, &reply_len);
if (!reply) {
WL_ERR(("Could not get capabilities\n"));
err = -EINVAL;
return err;
}
err = wl_cfgvendor_send_cmd_reply(wiphy, bcmcfg_to_prmry_ndev(cfg),
reply, reply_len);
if (unlikely(err))
WL_ERR(("Vendor Command reply failed ret:%d \n", err));
kfree(reply);
return err;
}
示例2: dhd_config_dongle
s32 dhd_config_dongle(struct bcm_cfg80211 *cfg)
{
#ifndef DHD_SDALIGN
#define DHD_SDALIGN 32
#endif
struct net_device *ndev;
s32 err = 0;
WL_TRACE(("In\n"));
if (dhd_dongle_up) {
WL_ERR(("Dongle is already up\n"));
return err;
}
ndev = bcmcfg_to_prmry_ndev(cfg);
err = wl_dongle_up(ndev, 0);
if (unlikely(err)) {
WL_ERR(("wl_dongle_up failed\n"));
goto default_conf_out;
}
dhd_dongle_up = true;
default_conf_out:
return err;
}
示例3: bcm_mkiovar
/* set mode to allow pattern */
bcm_mkiovar("pkt_filter_mode", (char *)&filter_mode, 4, iovbuf,
sizeof(iovbuf));
err = wldev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf), true);
if (err) {
if (err == -EOPNOTSUPP) {
WL_INFO(("filter_mode not supported\n"));
} else {
WL_ERR(("filter_mode (%d)\n", err));
}
goto dongle_filter_out;
}
dongle_filter_out:
return err;
}
#endif /* OEM_ANDROID */
s32 dhd_config_dongle(struct wl_priv *wl, bool need_lock)
{
#ifndef DHD_SDALIGN
#define DHD_SDALIGN 32
#endif
struct net_device *ndev;
s32 err = 0;
WL_TRACE(("In\n"));
if (dhd_dongle_up) {
WL_ERR(("Dongle is already up\n"));
return err;
}
ndev = wl_to_prmry_ndev(wl);
if (need_lock)
rtnl_lock();
err = wl_dongle_up(ndev, 0);
if (unlikely(err)) {
WL_ERR(("wl_dongle_up failed\n"));
goto default_conf_out;
}
#ifndef OEM_ANDROID
err = wl_dongle_power(ndev, PM_FAST);
if (unlikely(err)) {
WL_ERR(("wl_dongle_power failed\n"));
goto default_conf_out;
}
err = wl_dongle_glom(ndev, 0, DHD_SDALIGN);
if (unlikely(err)) {
WL_ERR(("wl_dongle_glom failed\n"));
goto default_conf_out;
}
err = wl_dongle_roam(ndev, (wl->roam_on ? 0 : 1), 3);
if (unlikely(err)) {
WL_ERR(("wl_dongle_roam failed\n"));
goto default_conf_out;
}
wl_dongle_scantime(ndev, 40, 80);
wl_dongle_offload(ndev, 1, 0xf);
wl_dongle_filter(ndev, 1);
#endif /* OEM_ANDROID */
dhd_dongle_up = true;
default_conf_out:
if (need_lock)
rtnl_unlock();
return err;
}
示例4: dhd_cfg80211_testmode_cmd
int dhd_cfg80211_testmode_cmd(struct wiphy *wiphy, void *data, int len)
{
struct sk_buff *reply;
struct wl_priv *wl;
dhd_pub_t *dhd;
dhd_ioctl_t *ioc = data;
int err = 0;
WL_TRACE(("entry: cmd = %d\n", ioc->cmd));
wl = wiphy_priv(wiphy);
dhd = wl->pub;
DHD_OS_WAKE_LOCK(dhd);
if (dhd->hang_was_sent) {
WL_ERR(("%s: HANG was sent up earlier\n", __FUNCTION__));
DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(dhd, DHD_EVENT_TIMEOUT_MS);
DHD_OS_WAKE_UNLOCK(dhd);
return OSL_ERROR(BCME_DONGLE_DOWN);
}
err = dhd_ioctl_process(dhd, 0, ioc);
if (err)
goto done;
reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*ioc));
nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*ioc), ioc);
err = cfg80211_testmode_reply(reply);
done:
DHD_OS_WAKE_UNLOCK(dhd);
return err;
}
示例5: dhd_cfg80211_set_p2p_info
/*
* dhd_cfg80211_set_p2p_info : gets called when GO or GC created
*/
s32 dhd_cfg80211_set_p2p_info(struct wl_priv *wl, int val)
{
dhd_pub_t *dhd = (dhd_pub_t *)(wl->pub);
int bcn_timeout = DHD_BEACON_TIMEOUT_HIGH;
char iovbuf[30];
DHD_MYTRACE(("%s-%s\n", __FILE__, __FUNCTION__));
dhd->op_mode |= val;
WL_ERR(("Set : op_mode=%d\n", dhd->op_mode));
#ifdef ARP_OFFLOAD_SUPPORT
/* IF P2P is enabled, disable arpoe */
dhd_arp_offload_set(dhd, 0);
dhd_arp_offload_enable(dhd, false);
#endif /* ARP_OFFLOAD_SUPPORT */
/* diable all filtering in p2p mode */
dhd_os_set_packet_filter(dhd, 0);
/* Setup timeout if Beacons are lost and roam is off to report link down */
bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, sizeof(iovbuf));
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
return 0;
}
示例6: dhd_cfg80211_testmode_cmd
int dhd_cfg80211_testmode_cmd(struct wiphy *wiphy, void *data, int len)
{
struct sk_buff *reply;
struct wl_priv *wl;
dhd_pub_t *dhd;
dhd_ioctl_t *ioc = data;
int err = 0;
WL_TRACE(("entry: cmd = %d\n", ioc->cmd));
wl = wiphy_priv(wiphy);
dhd = wl->pub;
DHD_OS_WAKE_LOCK(dhd);
/* send to dongle only if we are not waiting for reload already */
if (dhd->hang_was_sent) {
WL_ERR(("HANG was sent up earlier\n"));
DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(dhd, DHD_EVENT_TIMEOUT_MS);
DHD_OS_WAKE_UNLOCK(dhd);
return OSL_ERROR(BCME_DONGLE_DOWN);
}
/* currently there is only one wiphy for ifidx 0 */
err = dhd_ioctl_process(dhd, 0, ioc);
if (err)
goto done;
/* response data is in ioc->buf so return ioc here */
reply = cfg80211_testmode_alloc_reply_skb(wiphy, sizeof(*ioc));
nla_put(reply, NL80211_ATTR_TESTDATA, sizeof(*ioc), ioc);
err = cfg80211_testmode_reply(reply);
done:
DHD_OS_WAKE_UNLOCK(dhd);
return err;
}
示例7: btcoex_is_sco_active
static bool btcoex_is_sco_active(struct net_device *dev)
{
int ioc_res = 0;
bool res = FALSE;
int sco_id_cnt = 0;
int param27;
int i;
for (i = 0; i < 12; i++) {
ioc_res = dev_wlc_intvar_get_reg(dev, "btc_params", 27, ¶m27);
WL_TRACE(("sample[%d], btc params: 27:%x\n", i, param27));
if (ioc_res < 0) {
WL_ERR(("ioc read btc params error\n"));
break;
}
if ((param27 & 0x6) == 2) { /* count both sco & esco */
sco_id_cnt++;
}
if (sco_id_cnt > 2) {
WL_TRACE(("sco/esco detected, pkt id_cnt:%d samples:%d\n",
sco_id_cnt, i));
res = TRUE;
break;
}
OSL_SLEEP(5);
}
return res;
}
示例8: wl_cfgvendor_gscan_get_channel_list
static int wl_cfgvendor_gscan_get_channel_list(struct wiphy *wiphy,
struct wireless_dev *wdev, const void *data, int len)
{
int err = 0, type, band;
struct wl_priv *cfg = wiphy_priv(wiphy);
uint16 *reply = NULL;
uint32 reply_len = 0, num_channels, mem_needed;
struct sk_buff *skb;
type = nla_type(data);
if (type == GSCAN_ATTRIBUTE_BAND) {
band = nla_get_u32(data);
} else {
return -1;
}
reply = dhd_dev_pno_get_gscan(wl_to_prmry_ndev(cfg),
DHD_PNO_GET_CHANNEL_LIST, &band, &reply_len);
if (!reply) {
WL_ERR(("Could not get channel list\n"));
err = -EINVAL;
return err;
}
num_channels = reply_len/ sizeof(uint32);
mem_needed = reply_len + VENDOR_REPLY_OVERHEAD + (ATTRIBUTE_U32_LEN * 2);
/* Alloc the SKB for vendor_event */
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, mem_needed);
if (unlikely(!skb)) {
WL_ERR(("skb alloc failed"));
err = -ENOMEM;
goto exit;
}
nla_put_u32(skb, GSCAN_ATTRIBUTE_NUM_CHANNELS, num_channels);
nla_put(skb, GSCAN_ATTRIBUTE_CHANNEL_LIST, reply_len, reply);
err = cfg80211_vendor_cmd_reply(skb);
if (unlikely(err))
WL_ERR(("Vendor Command reply failed ret:%d \n", err));
exit:
kfree(reply);
return err;
}
示例9: wl_cfgnan_support_handler
int
wl_cfgnan_support_handler(struct net_device *ndev,
struct bcm_cfg80211 *cfg, char *cmd, nan_cmd_data_t *cmd_data)
{
wl_nan_ioc_t *nanioc = NULL;
void *pxtlv;
s32 ret = BCME_OK;
u16 kflags = in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
uint16 nanioc_size = sizeof(wl_nan_ioc_t) + NAN_IOCTL_BUF_SIZE;
nanioc = kzalloc(nanioc_size, kflags);
if (!nanioc) {
WL_ERR((" memory allocation failed \n"));
return -ENOMEM;
}
/*
* command to test
*
* wl: wl nan
*
* wpa_cli: DRIVER NAN_SUPPORT
*/
/* nan support */
nanioc->version = htod16(WL_NAN_IOCTL_VERSION);
nanioc->id = htod16(WL_NAN_CMD_ENABLE);
pxtlv = nanioc->data;
nanioc->len = htod16(BCM_XTLV_HDR_SIZE + 1);
nanioc_size = sizeof(wl_nan_ioc_t) + sizeof(bcm_xtlv_t);
ret = wldev_iovar_getbuf(ndev, "nan", nanioc, nanioc_size,
cfg->ioctl_buf, WLC_IOCTL_SMLEN, &cfg->ioctl_buf_sync);
if (unlikely(ret)) {
WL_ERR((" nan is not supported, error = %d \n", ret));
goto fail;
} else {
WL_DBG((" nan is supported \n"));
}
fail:
if (nanioc) {
kfree(nanioc);
}
return ret;
}
示例10: wl_dongle_up
static s32 wl_dongle_up(struct net_device *ndev, u32 up)
{
s32 err = 0;
err = wldev_ioctl(ndev, WLC_UP, &up, sizeof(up), true);
if (unlikely(err)) {
WL_ERR(("WLC_UP error (%d)\n", err));
}
return err;
}
示例11: wl_android_get_assoc_res_ies
static int wl_android_get_assoc_res_ies(struct net_device *dev, char *command)
{
int error;
u8 buf[WL_ASSOC_INFO_MAX];
wl_assoc_info_t assoc_info;
u32 resp_ies_len = 0;
int bytes_written = 0;
WL_TRACE(("%s: wl_iw_get_assoc_res_ies\n", dev->name));
error = wldev_iovar_getbuf(dev, "assoc_info", NULL, 0, buf, WL_ASSOC_INFO_MAX, NULL);
if (unlikely(error)) {
WL_ERR(("could not get assoc info (%d)\n", error));
return -1;
}
memcpy(&assoc_info, buf, sizeof(wl_assoc_info_t));
assoc_info.req_len = htod32(assoc_info.req_len);
assoc_info.resp_len = htod32(assoc_info.resp_len);
assoc_info.flags = htod32(assoc_info.flags);
if (assoc_info.resp_len) {
resp_ies_len = assoc_info.resp_len - sizeof(struct dot11_assoc_resp);
}
/* first 4 bytes are ie len */
memcpy(command, &resp_ies_len, sizeof(u32));
bytes_written = sizeof(u32);
/* get the association resp IE's if there are any */
if (resp_ies_len) {
error = wldev_iovar_getbuf(dev, "assoc_resp_ies", NULL, 0,
buf, WL_ASSOC_INFO_MAX, NULL);
if (unlikely(error)) {
WL_ERR(("could not get assoc resp_ies (%d)\n", error));
return -1;
}
memcpy(command+sizeof(u32), buf, resp_ies_len);
bytes_written += resp_ies_len;
}
return bytes_written;
}
示例12: wl_dongle_power
static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode)
{
s32 err = 0;
WL_TRACE(("In\n"));
err = wldev_ioctl(ndev, WLC_SET_PM, &power_mode, sizeof(power_mode), true);
if (unlikely(err)) {
WL_ERR(("WLC_SET_PM error (%d)\n", err));
}
return err;
}
示例13: wl_cfgvendor_get_feature_set_matrix
static int wl_cfgvendor_get_feature_set_matrix(struct wiphy *wiphy,
struct wireless_dev *wdev, const void *data, int len)
{
int err = 0;
struct wl_priv *cfg = wiphy_priv(wiphy);
struct sk_buff *skb;
int *reply;
int num, mem_needed, i;
reply = dhd_dev_get_feature_set_matrix(wl_to_prmry_ndev(cfg), &num);
if (!reply) {
WL_ERR(("Could not get feature list matrix\n"));
err = -EINVAL;
return err;
}
mem_needed = VENDOR_REPLY_OVERHEAD + (ATTRIBUTE_U32_LEN * num) +
ATTRIBUTE_U32_LEN;
/* Alloc the SKB for vendor_event */
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, mem_needed);
if (unlikely(!skb)) {
WL_ERR(("skb alloc failed"));
err = -ENOMEM;
goto exit;
}
nla_put_u32(skb, ANDR_WIFI_ATTRIBUTE_NUM_FEATURE_SET, num);
for (i = 0; i < num; i++) {
nla_put_u32(skb, ANDR_WIFI_ATTRIBUTE_FEATURE_SET, reply[i]);
}
err = cfg80211_vendor_cmd_reply(skb);
if (unlikely(err))
WL_ERR(("Vendor Command reply failed ret:%d \n", err));
exit:
kfree(reply);
return err;
}
示例14: wl_pattern_atoh
static s32 wl_pattern_atoh(s8 *src, s8 *dst)
{
int i;
if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
WL_ERR(("Mask invalid format. Needs to start with 0x\n"));
return -1;
}
src = src + 2; /* Skip past 0x */
if (strlen(src) % 2 != 0) {
WL_ERR(("Mask invalid format. Needs to be of even length\n"));
return -1;
}
for (i = 0; *src != '\0'; i++) {
char num[3];
strncpy(num, src, 2);
num[2] = '\0';
dst[i] = (u8) simple_strtoul(num, NULL, 16);
src += 2;
}
return i;
}
示例15: wl_dongle_down
static s32
wl_dongle_down(struct net_device *ndev)
{
s32 err = 0;
u32 down = 0;
err = wldev_ioctl(ndev, WLC_DOWN, &down, sizeof(down), true);
if (unlikely(err)) {
WL_ERR(("WLC_DOWN error (%d)\n", err));
}
return err;
}