您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wl1271_ps_elp_wakeup函数代码示例

51自学网 2021-06-03 10:00:06
  C++
这篇教程C++ wl1271_ps_elp_wakeup函数代码示例写得很实用,希望能帮到您。

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

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

示例1: wl1271_debugfs_update_stats

void wl1271_debugfs_update_stats(struct wl1271 *wl){	int ret;	mutex_lock(&wl->mutex);	if (unlikely(wl->state != WLCORE_STATE_ON))		goto out;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	if (!wl->plt &&	    time_after(jiffies, wl->stats.fw_stats_update +		       msecs_to_jiffies(WL1271_DEBUGFS_STATS_LIFETIME))) {		wl1271_acx_statistics(wl, wl->stats.fw_stats);		wl->stats.fw_stats_update = jiffies;	}	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);}
开发者ID:houlixin,项目名称:BBB-TISDK,代码行数:25,


示例2: radar_detection_write

static ssize_t radar_detection_write(struct file *file,			      const char __user *user_buf,			      size_t count, loff_t *ppos){	struct wl1271 *wl = file->private_data;	int ret;	u8 channel;	ret = kstrtou8_from_user(user_buf, count, 10, &channel);	if (ret < 0) {		wl1271_warning("illegal channel");		return -EINVAL;	}	mutex_lock(&wl->mutex);	if (unlikely(wl->state != WLCORE_STATE_ON))		goto out;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	ret = wlcore_radar_detection_debug(wl, channel);	if (ret < 0)		count = ret;	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return count;}
开发者ID:houlixin,项目名称:BBB-TISDK,代码行数:32,


示例3: wl1271_filter_work

static void wl1271_filter_work(struct work_struct *work){	struct wl1271 *wl =		container_of(work, struct wl1271, filter_work);	int ret;	mutex_lock(&wl->mutex);	if (wl->state == WL1271_STATE_OFF)		goto out;	ret = wl1271_ps_elp_wakeup(wl, false);	if (ret < 0)		goto out;	/* FIXME: replace the magic numbers with proper definitions */	ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);	if (ret < 0)		goto out_sleep;out_sleep:	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);}
开发者ID:Druboo666,项目名称:Xperia-2011-Kernel-2.6.32.9-KRsH,代码行数:26,


示例4: wl1271_op_hw_scan

static int wl1271_op_hw_scan(struct ieee80211_hw *hw,			     struct cfg80211_scan_request *req){	struct wl1271 *wl = hw->priv;	int ret;	u8 *ssid = NULL;	size_t ssid_len = 0;	wl1271_debug(DEBUG_MAC80211, "mac80211 hw scan");	if (req->n_ssids) {		ssid = req->ssids[0].ssid;		ssid_len = req->ssids[0].ssid_len;	}	mutex_lock(&wl->mutex);	ret = wl1271_ps_elp_wakeup(wl, false);	if (ret < 0)		goto out;	ret = wl1271_cmd_scan(hw->priv, ssid, ssid_len, 1, 0, 13, 3);	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return ret;}
开发者ID:Druboo666,项目名称:Xperia-2011-Kernel-2.6.32.9-KRsH,代码行数:30,


示例5: wlcore_tm_cmd_smart_config_set_group_key

static int wlcore_tm_cmd_smart_config_set_group_key(struct wl1271 *wl,						    struct nlattr *tb[]){	int ret;	wl1271_debug(DEBUG_CMD, "testmode cmd smart config set group key");	if (!tb[WL1271_TM_ATTR_GROUP_ID] ||	    !tb[WL1271_TM_ATTR_GROUP_KEY])		return -EINVAL;	mutex_lock(&wl->mutex);	if (unlikely(wl->state != WLCORE_STATE_ON)) {		ret = -EINVAL;		goto out;	}	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	ret = wlcore_smart_config_set_group_key(wl,			nla_get_u32(tb[WL1271_TM_ATTR_GROUP_ID]),			nla_len(tb[WL1271_TM_ATTR_GROUP_KEY]),			nla_data(tb[WL1271_TM_ATTR_GROUP_KEY]));	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return ret;}
开发者ID:174high,项目名称:compat_wl18xx_origin_from_r8.4,代码行数:33,


示例6: wlcore_tm_cmd_smart_config_stop

static int wlcore_tm_cmd_smart_config_stop(struct wl1271 *wl,					   struct nlattr *tb[]){	int ret;	wl1271_debug(DEBUG_CMD, "testmode cmd smart config stop");	mutex_lock(&wl->mutex);	if (unlikely(wl->state != WLCORE_STATE_ON)) {		ret = -EINVAL;		goto out;	}	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	ret = wlcore_smart_config_stop(wl);	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return ret;}
开发者ID:174high,项目名称:compat_wl18xx_origin_from_r8.4,代码行数:26,


示例7: wl1271_scan_complete_work

void wl1271_scan_complete_work(struct work_struct *work){	struct delayed_work *dwork;	struct wl1271 *wl;	struct ieee80211_vif *vif;	struct wl12xx_vif *wlvif;	int ret;	dwork = container_of(work, struct delayed_work, work);	wl = container_of(dwork, struct wl1271, scan_complete_work);	wl1271_debug(DEBUG_SCAN, "Scanning complete");	mutex_lock(&wl->mutex);	if (unlikely(wl->state != WLCORE_STATE_ON))		goto out;	if (wl->scan.state == WL1271_SCAN_STATE_IDLE)		goto out;	vif = wl->scan_vif;	wlvif = wl12xx_vif_to_data(vif);	/*	 * Rearm the tx watchdog just before idling scan. This	 * prevents just-finished scans from triggering the watchdog	 */	wl12xx_rearm_tx_watchdog_locked(wl);	wl->scan.state = WL1271_SCAN_STATE_IDLE;	memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch));	wl->scan.req = NULL;	wl->scan_vif = NULL;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) {		/* restore hardware connection monitoring template */		wl1271_cmd_build_ap_probe_req(wl, wlvif, wlvif->probereq);	}	wl1271_ps_elp_sleep(wl);	if (wl->scan.failed) {		wl1271_info("Scan completed due to error.");		wl12xx_queue_recovery_work(wl);	}	wlcore_cmd_regdomain_config_locked(wl);	ieee80211_scan_completed(wl->hw, false);out:	mutex_unlock(&wl->mutex);}
开发者ID:NXij,项目名称:cm11-p6,代码行数:59,


示例8: wl1271_scan_complete_work

void wl1271_scan_complete_work(struct work_struct *work){	struct delayed_work *dwork;	struct wl1271 *wl;	int ret;	bool is_sta, is_ibss;	dwork = container_of(work, struct delayed_work, work);	wl = container_of(dwork, struct wl1271, scan_complete_work);	wl1271_debug(DEBUG_SCAN, "Scanning complete");	mutex_lock(&wl->mutex);	if (wl->state == WL1271_STATE_OFF)		goto out;	if (wl->scan.state == WL1271_SCAN_STATE_IDLE)		goto out;	wl->scan.state = WL1271_SCAN_STATE_IDLE;	memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch));	wl->scan.req = NULL;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {		/* restore hardware connection monitoring template */		wl1271_cmd_build_ap_probe_req(wl, wl->probereq);	}	/* return to ROC if needed */	is_sta = (wl->bss_type == BSS_TYPE_STA_BSS);	is_ibss = (wl->bss_type == BSS_TYPE_IBSS);	if (((is_sta && !test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) ||	     (is_ibss && !test_bit(WL1271_FLAG_IBSS_JOINED, &wl->flags))) &&	    !test_bit(wl->dev_role_id, wl->roc_map)) {		/* restore remain on channel */		wl12xx_cmd_role_start_dev(wl);		wl12xx_roc(wl, wl->dev_role_id);	}	wl1271_ps_elp_sleep(wl);	if (wl->scan.failed) {		wl1271_info("Scan completed due to error.");		wl12xx_queue_recovery_work(wl);	}	ieee80211_scan_completed(wl->hw, false);out:	mutex_unlock(&wl->mutex);}
开发者ID:padovan,项目名称:bluetooth-next,代码行数:56,


示例9: wl1271_scan_complete_work

void wl1271_scan_complete_work(struct work_struct *work){	struct delayed_work *dwork;	struct wl1271 *wl;	struct ieee80211_vif *vif;	struct wl12xx_vif *wlvif;	int ret;	dwork = container_of(work, struct delayed_work, work);	wl = container_of(dwork, struct wl1271, scan_complete_work);	wl1271_debug(DEBUG_SCAN, "Scanning complete");	mutex_lock(&wl->mutex);	if (wl->state == WL1271_STATE_OFF)		goto out;	if (wl->scan.state == WL1271_SCAN_STATE_IDLE)		goto out;	vif = wl->scan_vif;	wlvif = wl12xx_vif_to_data(vif);	wl12xx_rearm_tx_watchdog_locked(wl);	wl->scan.state = WL1271_SCAN_STATE_IDLE;	memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch));	wl->scan.req = NULL;	wl->scan_vif = NULL;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) {				wl1271_cmd_build_ap_probe_req(wl, wlvif, wlvif->probereq);	}	wl1271_ps_elp_sleep(wl);	if (wl->scan.failed) {		wl1271_info("Scan completed due to error.");		wl12xx_queue_recovery_work(wl);	}	ieee80211_scan_completed(wl->hw, false);out:	mutex_unlock(&wl->mutex);}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:53,


示例10: forced_ps_write

static ssize_t forced_ps_write(struct file *file,				    const char __user *user_buf,				    size_t count, loff_t *ppos){	struct wl1271 *wl = file->private_data;	struct wl12xx_vif *wlvif;	unsigned long value;	int ret, ps_mode;	ret = kstrtoul_from_user(user_buf, count, 10, &value);	if (ret < 0) {		wl1271_warning("illegal value in forced_ps");		return -EINVAL;	}	if (value != 1 && value != 0) {		wl1271_warning("forced_ps should be either 0 or 1");		return -ERANGE;	}	mutex_lock(&wl->mutex);	if (wl->conf.conn.forced_ps == value)		goto out;	wl->conf.conn.forced_ps = value;	if (wl->state == WL1271_STATE_OFF)		goto out;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	/* In case we're already in PSM, trigger it again to switch mode	 * immediately without waiting for re-association	 */	ps_mode = value ? STATION_POWER_SAVE_MODE : STATION_AUTO_PS_MODE;	wl12xx_for_each_wlvif_sta(wl, wlvif) {		if (test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags))			wl1271_ps_set_mode(wl, wlvif, ps_mode);	}	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return count;}
开发者ID:AllenWeb,项目名称:linux,代码行数:51,


示例11: wl1271_ps_set_mode

int wl1271_ps_set_mode(struct wl1271 *wl, enum wl1271_cmd_ps_mode mode,		       u32 rates, bool send){	int ret;	switch (mode) {	case STATION_POWER_SAVE_MODE:		wl1271_debug(DEBUG_PSM, "entering psm");		ret = wl1271_acx_wake_up_conditions(wl);		if (ret < 0) {			wl1271_error("couldn't set wake up conditions");			return ret;		}		ret = wl1271_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE);		if (ret < 0)			return ret;		set_bit(WL1271_FLAG_PSM, &wl->flags);		break;	case STATION_ACTIVE_MODE:	default:		wl1271_debug(DEBUG_PSM, "leaving psm");		ret = wl1271_ps_elp_wakeup(wl, false);		if (ret < 0)			return ret;		/* disable beacon early termination */		ret = wl1271_acx_bet_enable(wl, false);		if (ret < 0)			return ret;		/* disable beacon filtering */		ret = wl1271_acx_beacon_filter_opt(wl, false);		if (ret < 0)			return ret;		ret = wl1271_cmd_ps_mode(wl, STATION_ACTIVE_MODE);		if (ret < 0)			return ret;		clear_bit(WL1271_FLAG_PSM, &wl->flags);		break;	}	return ret;}
开发者ID:Meticulus,项目名称:vendor_st-ericsson_u8500,代码行数:48,


示例12: wl1271_tx_work

void wl1271_tx_work(struct work_struct *work){	struct wl1271 *wl = container_of(work, struct wl1271, tx_work);	struct sk_buff *skb;	bool woken_up = false;	int ret;	mutex_lock(&wl->mutex);	if (unlikely(wl->state == WL1271_STATE_OFF))		goto out;	while ((skb = skb_dequeue(&wl->tx_queue))) {		if (!woken_up) {			ret = wl1271_ps_elp_wakeup(wl, false);			if (ret < 0)				goto out;			woken_up = true;		}		ret = wl1271_tx_frame(wl, skb);		if (ret == -EBUSY) {			/* firmware buffer is full, stop queues */			wl1271_debug(DEBUG_TX, "tx_work: fw buffer full, "				     "stop queues");			ieee80211_stop_queues(wl->hw);			wl->tx_queue_stopped = true;			skb_queue_head(&wl->tx_queue, skb);			goto out;		} else if (ret < 0) {			dev_kfree_skb(skb);			goto out;		} else if (wl->tx_queue_stopped) {			/* firmware buffer has space, restart queues */			wl1271_debug(DEBUG_TX,				     "complete_packet: waking queues");			ieee80211_wake_queues(wl->hw);			wl->tx_queue_stopped = false;		}	}out:	if (woken_up)		wl1271_ps_elp_sleep(wl);	mutex_unlock(&wl->mutex);}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:47,


示例13: rx_streaming_always_write

static ssize_t rx_streaming_always_write(struct file *file,			   const char __user *user_buf,			   size_t count, loff_t *ppos){	struct wl1271 *wl = file->private_data;	char buf[10];	size_t len;	unsigned long value;	int ret;	len = min(count, sizeof(buf) - 1);	if (copy_from_user(buf, user_buf, len))		return -EFAULT;	buf[len] = '/0';	ret = strict_strtoul(buf, 0, &value);	if (ret < 0) {		wl1271_warning("illegal value in rx_streaming_write!");		return -EINVAL;	}	/* valid values: 0, 10-100 */	if (!(value == 0 || value == 1)) {		wl1271_warning("value is not in valid!");		return -EINVAL;	}	mutex_lock(&wl->mutex);	wl->conf.rx_streaming.always = value;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	wl1271_recalc_rx_streaming(wl);	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return count;}
开发者ID:mcarrier,项目名称:reconn-linux,代码行数:42,


示例14: chip_op_handler

static void chip_op_handler(struct wl1271 *wl, unsigned long value,			    void *arg){	int ret;	int (*chip_op) (struct wl1271 *wl);	if (!arg) {		wl1271_warning("debugfs chip_op_handler with no callback");		return;	}	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		return;	chip_op = arg;	chip_op(wl);	wl1271_ps_elp_sleep(wl);}
开发者ID:174high,项目名称:compat_wl18xx_origin_from_r8.4,代码行数:20,


示例15: wl1271_scan_complete_work

void wl1271_scan_complete_work(struct work_struct *work){	struct delayed_work *dwork;	struct wl1271 *wl;	dwork = container_of(work, struct delayed_work, work);	wl = container_of(dwork, struct wl1271, scan_complete_work);	wl1271_debug(DEBUG_SCAN, "Scanning complete");	mutex_lock(&wl->mutex);	if (wl->state == WL1271_STATE_OFF)		goto out;	if (wl->scan.state == WL1271_SCAN_STATE_IDLE)		goto out;	wl->scan.state = WL1271_SCAN_STATE_IDLE;	memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch));	wl->scan.req = NULL;	ieee80211_scan_completed(wl->hw, false);	/* restore hardware connection monitoring template */	if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) {		if (wl1271_ps_elp_wakeup(wl) == 0) {			wl1271_cmd_build_ap_probe_req(wl, wl->probereq);			wl1271_ps_elp_sleep(wl);		}	}	if (wl->scan.failed) {		wl1271_info("Scan completed due to error.");		wl12xx_queue_recovery_work(wl);	}out:	mutex_unlock(&wl->mutex);}
开发者ID:303750856,项目名称:linux-3.1,代码行数:40,


示例16: wl1271_sysfs_store_bt_coex_state

static ssize_t wl1271_sysfs_store_bt_coex_state(struct device *dev,						struct device_attribute *attr,						const char *buf, size_t count){	struct wl1271 *wl = dev_get_drvdata(dev);	unsigned long res;	int ret;	ret = kstrtoul(buf, 10, &res);	if (ret < 0) {		wl1271_warning("incorrect value written to bt_coex_mode");		return count;	}	mutex_lock(&wl->mutex);	res = !!res;	if (res == wl->sg_enabled)		goto out;	wl->sg_enabled = res;	if (unlikely(wl->state != WLCORE_STATE_ON))		goto out;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	wl1271_acx_sg_enable(wl, wl->sg_enabled);	wl1271_ps_elp_sleep(wl); out:	mutex_unlock(&wl->mutex);	return count;}
开发者ID:03199618,项目名称:linux,代码行数:37,


示例17: radar_debug_mode_write

static ssize_t radar_debug_mode_write(struct file *file,				      const char __user *user_buf,				      size_t count, loff_t *ppos){	struct wl1271 *wl = file->private_data;	struct wl12xx_vif *wlvif;	unsigned long value;	int ret;	ret = kstrtoul_from_user(user_buf, count, 10, &value);	if (ret < 0) {		wl1271_warning("illegal value in radar_debug_mode!");		return -EINVAL;	}	/* valid values: 0/1 */	if (!(value == 0 || value == 1)) {		wl1271_warning("value is not in valid!");		return -EINVAL;	}	mutex_lock(&wl->mutex);	wl->radar_debug_mode = value;	if (unlikely(wl->state != WLCORE_STATE_ON))		goto out;	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	wl12xx_for_each_wlvif_ap(wl, wlvif) {		wlcore_cmd_generic_cfg(wl, wlvif,				       WLCORE_CFG_FEATURE_RADAR_DEBUG,				       wl->radar_debug_mode, 0);	}
开发者ID:houlixin,项目名称:BBB-TISDK,代码行数:37,


示例18: wl1271_pspoll_work

void wl1271_pspoll_work(struct work_struct *work){	struct delayed_work *dwork;	struct wl1271 *wl;	int ret;	dwork = container_of(work, struct delayed_work, work);	wl = container_of(dwork, struct wl1271, pspoll_work);	wl1271_debug(DEBUG_EVENT, "pspoll work");	mutex_lock(&wl->mutex);	if (unlikely(wl->state == WL1271_STATE_OFF))		goto out;	if (!test_and_clear_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags))		goto out;	if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))		goto out;	/*	 * if we end up here, then we were in powersave when the pspoll	 * delivery failure occurred, and no-one changed state since, so	 * we should go back to powersave.	 */	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, wl->basic_rate, true);	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);};
开发者ID:Druboo666,项目名称:Xperia-2011-Kernel-2.6.32.9-KRsH,代码行数:37,


示例19: wl1271_tm_cmd_test

static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[]){	int buf_len, ret, len;	struct sk_buff *skb;	void *buf;	u8 answer = 0;	wl1271_debug(DEBUG_TESTMODE, "testmode cmd test");	if (!tb[WL1271_TM_ATTR_DATA])		return -EINVAL;	buf = nla_data(tb[WL1271_TM_ATTR_DATA]);	buf_len = nla_len(tb[WL1271_TM_ATTR_DATA]);	if (tb[WL1271_TM_ATTR_ANSWER])		answer = nla_get_u8(tb[WL1271_TM_ATTR_ANSWER]);	if (buf_len > sizeof(struct wl1271_command))		return -EMSGSIZE;	mutex_lock(&wl->mutex);	if (wl->state == WL1271_STATE_OFF) {		ret = -EINVAL;		goto out;	}	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	ret = wl1271_cmd_test(wl, buf, buf_len, answer);	if (ret < 0) {		wl1271_warning("testmode cmd test failed: %d", ret);		goto out_sleep;	}	if (answer) {		len = nla_total_size(buf_len);		skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, len);		if (!skb) {			ret = -ENOMEM;			goto out_sleep;		}		NLA_PUT(skb, WL1271_TM_ATTR_DATA, buf_len, buf);		ret = cfg80211_testmode_reply(skb);		if (ret < 0)			goto out_sleep;	}out_sleep:	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return ret;nla_put_failure:	kfree_skb(skb);	ret = -EMSGSIZE;	goto out_sleep;}
开发者ID:HazouPH,项目名称:android_hardware_ti_wlan,代码行数:64,


示例20: wl1271_tm_cmd_interrogate

static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[]){	int ret;	struct wl1271_command *cmd;	struct sk_buff *skb;	u8 ie_id;	wl1271_debug(DEBUG_TESTMODE, "testmode cmd interrogate");	if (!tb[WL1271_TM_ATTR_IE_ID])		return -EINVAL;	ie_id = nla_get_u8(tb[WL1271_TM_ATTR_IE_ID]);	mutex_lock(&wl->mutex);	if (wl->state == WL1271_STATE_OFF) {		ret = -EINVAL;		goto out;	}	ret = wl1271_ps_elp_wakeup(wl);	if (ret < 0)		goto out;	cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);	if (!cmd) {		ret = -ENOMEM;		goto out_sleep;	}	ret = wl1271_cmd_interrogate(wl, ie_id, cmd, sizeof(*cmd));	if (ret < 0) {		wl1271_warning("testmode cmd interrogate failed: %d", ret);		goto out_free;	}	skb = cfg80211_testmode_alloc_reply_skb(wl->hw->wiphy, sizeof(*cmd));	if (!skb) {		ret = -ENOMEM;		goto out_free;	}	NLA_PUT(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd);	ret = cfg80211_testmode_reply(skb);	if (ret < 0)		goto out_free;out_free:	kfree(cmd);out_sleep:	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return ret;nla_put_failure:	kfree_skb(skb);	ret = -EMSGSIZE;	goto out_free;}
开发者ID:HazouPH,项目名称:android_hardware_ti_wlan,代码行数:62,


示例21: wl1271_op_config

static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed){	struct wl1271 *wl = hw->priv;	struct ieee80211_conf *conf = &hw->conf;	int channel, ret = 0;	channel = ieee80211_frequency_to_channel(conf->channel->center_freq);	wl1271_debug(DEBUG_MAC80211, "mac80211 config ch %d psm %s power %d",		     channel,		     conf->flags & IEEE80211_CONF_PS ? "on" : "off",		     conf->power_level);	mutex_lock(&wl->mutex);	ret = wl1271_ps_elp_wakeup(wl, false);	if (ret < 0)		goto out;	if (channel != wl->channel) {		u8 old_channel = wl->channel;		wl->channel = channel;		/* FIXME: use beacon interval provided by mac80211 */		ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);		if (ret < 0) {			wl->channel = old_channel;			goto out_sleep;		}	}	ret = wl1271_cmd_build_null_data(wl);	if (ret < 0)		goto out_sleep;	if (conf->flags & IEEE80211_CONF_PS && !wl->psm_requested) {		wl1271_info("psm enabled");		wl->psm_requested = true;		/*		 * We enter PSM only if we're already associated.		 * If we're not, we'll enter it when joining an SSID,		 * through the bss_info_changed() hook.		 */		ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE);	} else if (!(conf->flags & IEEE80211_CONF_PS) &&		   wl->psm_requested) {		wl1271_info("psm disabled");		wl->psm_requested = false;		if (wl->psm)			ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE);	}	if (conf->power_level != wl->power_level) {		ret = wl1271_acx_tx_power(wl, conf->power_level);		if (ret < 0)			goto out;		wl->power_level = conf->power_level;	}out_sleep:	wl1271_ps_elp_sleep(wl);out:	mutex_unlock(&wl->mutex);	return ret;}
开发者ID:Druboo666,项目名称:Xperia-2011-Kernel-2.6.32.9-KRsH,代码行数:72,



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


C++ wl1271_warning函数代码示例
C++ wl1271_error函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。