• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ IWM_ERR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: iwm_store_rxiq_calib_result

int iwm_store_rxiq_calib_result(struct iwm_priv *iwm)
{
	struct iwm_calib_rxiq *rxiq;
	u8 *eeprom_rxiq = iwm_eeprom_access(iwm, IWM_EEPROM_CALIB_RXIQ);
	int grplen = sizeof(struct iwm_calib_rxiq_group);

	rxiq = kzalloc(sizeof(struct iwm_calib_rxiq), GFP_KERNEL);
	if (!rxiq) {
		IWM_ERR(iwm, "Couldn't alloc memory for RX IQ\n");
		return -ENOMEM;
	}

	eeprom_rxiq = iwm_eeprom_access(iwm, IWM_EEPROM_CALIB_RXIQ);
	if (IS_ERR(eeprom_rxiq)) {
		IWM_ERR(iwm, "Couldn't access EEPROM RX IQ entry\n");
		return PTR_ERR(eeprom_rxiq);
	}

	iwm->calib_res[SHILOH_PHY_CALIBRATE_RX_IQ_CMD].buf = (u8 *)rxiq;
	iwm->calib_res[SHILOH_PHY_CALIBRATE_RX_IQ_CMD].size = sizeof(*rxiq);

	rxiq->hdr.opcode = SHILOH_PHY_CALIBRATE_RX_IQ_CMD;
	rxiq->hdr.first_grp = 0;
	rxiq->hdr.grp_num = 1;
	rxiq->hdr.all_data_valid = 1;

	memcpy(&rxiq->group[0], eeprom_rxiq, 4 * grplen);
	memcpy(&rxiq->group[4], eeprom_rxiq + 6 * grplen, grplen);

	return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:31,代码来源:commands.c


示例2: iwm_check_profile

static int iwm_check_profile(struct iwm_priv *iwm)
{
	if (!iwm->umac_profile_active)
		return -EAGAIN;

	if (iwm->umac_profile->sec.ucast_cipher != UMAC_CIPHER_TYPE_WEP_40 &&
	    iwm->umac_profile->sec.ucast_cipher != UMAC_CIPHER_TYPE_WEP_104 &&
	    iwm->umac_profile->sec.ucast_cipher != UMAC_CIPHER_TYPE_TKIP &&
	    iwm->umac_profile->sec.ucast_cipher != UMAC_CIPHER_TYPE_CCMP) {
		IWM_ERR(iwm, "Wrong unicast cipher: 0x%x\n",
			iwm->umac_profile->sec.ucast_cipher);
		return -EAGAIN;
	}

	if (iwm->umac_profile->sec.mcast_cipher != UMAC_CIPHER_TYPE_WEP_40 &&
	    iwm->umac_profile->sec.mcast_cipher != UMAC_CIPHER_TYPE_WEP_104 &&
	    iwm->umac_profile->sec.mcast_cipher != UMAC_CIPHER_TYPE_TKIP &&
	    iwm->umac_profile->sec.mcast_cipher != UMAC_CIPHER_TYPE_CCMP) {
		IWM_ERR(iwm, "Wrong multicast cipher: 0x%x\n",
			iwm->umac_profile->sec.mcast_cipher);
		return -EAGAIN;
	}

	if ((iwm->umac_profile->sec.ucast_cipher == UMAC_CIPHER_TYPE_WEP_40 ||
	     iwm->umac_profile->sec.ucast_cipher == UMAC_CIPHER_TYPE_WEP_104) &&
	    (iwm->umac_profile->sec.ucast_cipher !=
	     iwm->umac_profile->sec.mcast_cipher)) {
		IWM_ERR(iwm, "Unicast and multicast ciphers differ for WEP\n");
	}

	return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:32,代码来源:commands.c


示例3: iwm_fw_op_offset

static int iwm_fw_op_offset(struct iwm_priv *iwm, const struct firmware *fw,
			    u16 op_code, u32 index)
{
	int offset = -EINVAL, fw_offset;
	u32 op_index = 0;
	const u8 *fw_ptr;
	struct iwm_fw_hdr_rec *rec;

	fw_offset = 0;
	fw_ptr = fw->data;

	
	if (memcmp(fw_ptr, fw_barker, IWM_HDR_BARKER_LEN)) {
		IWM_ERR(iwm, "No barker string in this FW\n");
		return -EINVAL;
	}

	if (fw->size < IWM_HDR_LEN) {
		IWM_ERR(iwm, "FW is too small (%zu)\n", fw->size);
		return -EINVAL;
	}

	fw_offset += IWM_HDR_BARKER_LEN;

	while (fw_offset < fw->size) {
		rec = (struct iwm_fw_hdr_rec *)(fw_ptr + fw_offset);

		IWM_DBG_FW(iwm, DBG, "FW: op_code: 0x%x, len: %d @ 0x%x\n",
			   rec->op_code, rec->len, fw_offset);

		if (rec->op_code == IWM_HDR_REC_OP_INVALID) {
			IWM_DBG_FW(iwm, DBG, "Reached INVALID op code\n");
			break;
		}

		if (rec->op_code == op_code) {
			if (op_index == index) {
				fw_offset += sizeof(struct iwm_fw_hdr_rec);
				offset = fw_offset;
				goto out;
			}
			op_index++;
		}

		fw_offset += sizeof(struct iwm_fw_hdr_rec) + rec->len;
	}

 out:
	return offset;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:50,代码来源:fw.c


示例4: iwm_set_auth_alg

static int iwm_set_auth_alg(struct iwm_priv *iwm, u8 auth_alg)
{
    u8 *auth_type = &iwm->umac_profile->sec.auth_type;

    switch (auth_alg) {
    case IW_AUTH_ALG_OPEN_SYSTEM:
        *auth_type = UMAC_AUTH_TYPE_OPEN;
        break;
    case IW_AUTH_ALG_SHARED_KEY:
        if (iwm->umac_profile->sec.flags &
                (UMAC_SEC_FLG_WPA_ON_MSK | UMAC_SEC_FLG_RSNA_ON_MSK)) {
            if (*auth_type == UMAC_AUTH_TYPE_8021X)
                return -EINVAL;
            *auth_type = UMAC_AUTH_TYPE_RSNA_PSK;
        } else {
            *auth_type = UMAC_AUTH_TYPE_LEGACY_PSK;
        }
        break;
    case IW_AUTH_ALG_LEAP:
    default:
        IWM_ERR(iwm, "Unsupported auth alg: 0x%x\n", auth_alg);
        return -ENOTSUPP;
    }

    return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:26,代码来源:wext.c


示例5: iwm_send_pmkid_update

int iwm_send_pmkid_update(struct iwm_priv *iwm,
			  struct cfg80211_pmksa *pmksa, u32 command)
{
	struct iwm_umac_pmkid_update update;
	int ret;

	memset(&update, 0, sizeof(struct iwm_umac_pmkid_update));

	update.hdr.oid = UMAC_WIFI_IF_CMD_PMKID_UPDATE;
	update.hdr.buf_size = cpu_to_le16(sizeof(struct iwm_umac_pmkid_update) -
					  sizeof(struct iwm_umac_wifi_if));

	update.command = cpu_to_le32(command);
	if (pmksa->bssid)
		memcpy(&update.bssid, pmksa->bssid, ETH_ALEN);
	if (pmksa->pmkid)
		memcpy(&update.pmkid, pmksa->pmkid, WLAN_PMKID_LEN);

	ret = iwm_send_wifi_if_cmd(iwm, &update,
				   sizeof(struct iwm_umac_pmkid_update), 0);
	if (ret) {
		IWM_ERR(iwm, "PMKID update command failed\n");
		return ret;
	}

	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:27,代码来源:commands.c


示例6: iwm_send_umac_stop_resume_tx

int iwm_send_umac_stop_resume_tx(struct iwm_priv *iwm,
				 struct iwm_umac_notif_stop_resume_tx *ntf)
{
	struct iwm_udma_wifi_cmd udma_cmd = UDMA_UMAC_INIT;
	struct iwm_umac_cmd umac_cmd;
	struct iwm_umac_cmd_stop_resume_tx stp_res_cmd;
	struct iwm_sta_info *sta_info;
	u8 sta_id = STA_ID_N_COLOR_ID(ntf->sta_id);
	int i;

	sta_info = &iwm->sta_table[sta_id];
	if (!sta_info->valid) {
		IWM_ERR(iwm, "Invalid STA: %d\n", sta_id);
		return -EINVAL;
	}

	umac_cmd.id = UMAC_CMD_OPCODE_STOP_RESUME_STA_TX;
	umac_cmd.resp = 0;

	stp_res_cmd.flags = ntf->flags;
	stp_res_cmd.sta_id = ntf->sta_id;
	stp_res_cmd.stop_resume_tid_msk = ntf->stop_resume_tid_msk;
	for (i = 0; i < IWM_UMAC_TID_NR; i++)
		stp_res_cmd.last_seq_num[i] =
			sta_info->tid_info[i].last_seq_num;

	return iwm_hal_send_umac_cmd(iwm, &udma_cmd, &umac_cmd, &stp_res_cmd,
				 sizeof(struct iwm_umac_cmd_stop_resume_tx));

}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:30,代码来源:commands.c


示例7: iwm_scan_ssids

int iwm_scan_ssids(struct iwm_priv *iwm, struct cfg80211_ssid *ssids,
		   int ssid_num)
{
	struct iwm_umac_cmd_scan_request req;
	int i, ret;

	memset(&req, 0, sizeof(struct iwm_umac_cmd_scan_request));

	req.hdr.oid = UMAC_WIFI_IF_CMD_SCAN_REQUEST;
	req.hdr.buf_size = cpu_to_le16(sizeof(struct iwm_umac_cmd_scan_request)
				       - sizeof(struct iwm_umac_wifi_if));
	req.type = UMAC_WIFI_IF_SCAN_TYPE_USER;
	req.timeout = 2;
	req.seq_num = iwm->scan_id;
	req.ssid_num = min(ssid_num, UMAC_WIFI_IF_PROBE_OPTION_MAX);

	for (i = 0; i < req.ssid_num; i++) {
		memcpy(req.ssids[i].ssid, ssids[i].ssid, ssids[i].ssid_len);
		req.ssids[i].ssid_len = ssids[i].ssid_len;
	}

	ret = iwm_send_wifi_if_cmd(iwm, &req, sizeof(req), 0);
	if (ret < 0) {
		IWM_ERR(iwm, "Couldn't send scan request\n");
		return ret;
	}

	iwm->scan_id = iwm->scan_id++ % IWM_SCAN_ID_MAX;

	return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:31,代码来源:commands.c


示例8: iwm_eeprom_init

int iwm_eeprom_init(struct iwm_priv *iwm)
{
	int i, ret = 0;
	char name[32];

	iwm->eeprom = kzalloc(IWM_EEPROM_LEN, GFP_KERNEL);
	if (!iwm->eeprom)
		return -ENOMEM;

	for (i = IWM_EEPROM_FIRST; i < IWM_EEPROM_LAST; i++) {
		ret = iwm_eeprom_read(iwm, i);
		if (ret < 0) {
			IWM_ERR(iwm, "Couldn't read eeprom entry #%d: %s\n",
				i, eeprom_map[i].name);
			break;
		}
	}

	IWM_DBG_BOOT(iwm, DBG, "EEPROM dump:\n");
	for (i = IWM_EEPROM_FIRST; i < IWM_EEPROM_LAST; i++) {
		memset(name, 0, 32);
		sprintf(name, "%s: ", eeprom_map[i].name);

		IWM_HEXDUMP(iwm, DBG, BOOT, name,
			    iwm->eeprom + eeprom_map[i].offset,
			    eeprom_map[i].length);
	}

	return ret;
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:30,代码来源:eeprom.c


示例9: iwm_wext_siwessid

static int iwm_wext_siwessid(struct net_device *dev,
                             struct iw_request_info *info,
                             struct iw_point *data, char *ssid)
{
    struct iwm_priv *iwm = ndev_to_iwm(dev);
    size_t len = data->length;
    int ret;

    if (iwm->conf.mode == UMAC_MODE_IBSS)
        return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);

    if (!test_bit(IWM_STATUS_READY, &iwm->status))
        return -EIO;

    if (len > 0 && ssid[len - 1] == '\0')
        len--;

    if (iwm->umac_profile_active) {
        if (iwm->umac_profile->ssid.ssid_len == len &&
                !memcmp(iwm->umac_profile->ssid.ssid, ssid, len))
            return 0;

        ret = iwm_invalidate_mlme_profile(iwm);
        if (ret < 0) {
            IWM_ERR(iwm, "Couldn't invalidate profile\n");
            return ret;
        }
    }

    iwm->umac_profile->ssid.ssid_len = len;
    memcpy(iwm->umac_profile->ssid.ssid, ssid, len);

    return iwm_send_mlme_profile(iwm);
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:34,代码来源:wext.c


示例10: iwm_set_cipher

static int iwm_set_cipher(struct iwm_priv *iwm, u8 cipher, u8 ucast)
{
    u8 *profile_cipher = ucast ? &iwm->umac_profile->sec.ucast_cipher :
                         &iwm->umac_profile->sec.mcast_cipher;

    switch (cipher) {
    case IW_AUTH_CIPHER_NONE:
        *profile_cipher = UMAC_CIPHER_TYPE_NONE;
        break;
    case IW_AUTH_CIPHER_WEP40:
        *profile_cipher = UMAC_CIPHER_TYPE_WEP_40;
        break;
    case IW_AUTH_CIPHER_TKIP:
        *profile_cipher = UMAC_CIPHER_TYPE_TKIP;
        break;
    case IW_AUTH_CIPHER_CCMP:
        *profile_cipher = UMAC_CIPHER_TYPE_CCMP;
        break;
    case IW_AUTH_CIPHER_WEP104:
        *profile_cipher = UMAC_CIPHER_TYPE_WEP_104;
        break;
    default:
        IWM_ERR(iwm, "Unsupported cipher: 0x%x\n", cipher);
        return -ENOTSUPP;
    }

    return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:28,代码来源:wext.c


示例11: iwm_send_wifi_if_cmd

int iwm_send_wifi_if_cmd(struct iwm_priv *iwm, void *payload, u16 payload_size,
			 bool resp)
{
	struct iwm_umac_wifi_if *hdr = (struct iwm_umac_wifi_if *)payload;
	struct iwm_udma_wifi_cmd udma_cmd = UDMA_UMAC_INIT;
	struct iwm_umac_cmd umac_cmd;
	int ret;
	u8 oid = hdr->oid;

	if (!test_bit(IWM_STATUS_READY, &iwm->status)) {
		IWM_ERR(iwm, "Interface is not ready yet");
		return -EAGAIN;
	}

	umac_cmd.id = UMAC_CMD_OPCODE_WIFI_IF_WRAPPER;
	umac_cmd.resp = resp;

	ret = iwm_hal_send_umac_cmd(iwm, &udma_cmd, &umac_cmd,
				    payload, payload_size);

	if (resp) {
		ret = wait_event_interruptible_timeout(iwm->wifi_ntfy_queue,
				   test_and_clear_bit(oid, &iwm->wifi_ntfy[0]),
				   3 * HZ);

		return ret ? 0 : -EBUSY;
	}

	return ret;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:30,代码来源:commands.c


示例12: iwm_umac_set_config_var

int iwm_umac_set_config_var(struct iwm_priv *iwm, u16 key,
			    void *payload, u16 payload_size)
{
	struct iwm_udma_wifi_cmd udma_cmd = UDMA_UMAC_INIT;
	struct iwm_umac_cmd umac_cmd;
	struct iwm_umac_cmd_set_param_var *param_hdr;
	u8 *param;
	int ret;

	param = kzalloc(payload_size +
			sizeof(struct iwm_umac_cmd_set_param_var), GFP_KERNEL);
	if (!param) {
		IWM_ERR(iwm, "Couldn't allocate param\n");
		return -ENOMEM;
	}

	param_hdr = (struct iwm_umac_cmd_set_param_var *)param;

	umac_cmd.id = UMAC_CMD_OPCODE_SET_PARAM_VAR;
	umac_cmd.resp = 0;

	param_hdr->tbl = cpu_to_le16(UMAC_PARAM_TBL_CFG_VAR);
	param_hdr->key = cpu_to_le16(key);
	param_hdr->len = cpu_to_le16(payload_size);
	memcpy(param + sizeof(struct iwm_umac_cmd_set_param_var),
	       payload, payload_size);

	ret = iwm_hal_send_umac_cmd(iwm, &udma_cmd, &umac_cmd, param,
				    sizeof(struct iwm_umac_cmd_set_param_var) +
				    payload_size);
	kfree(param);

	return ret;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:34,代码来源:commands.c


示例13: iwm_send_prio_table

int iwm_send_prio_table(struct iwm_priv *iwm)
{
	struct iwm_coex_prio_table_cmd coex_table_cmd;
	u32 coex_enabled, mode_enabled;

	memset(&coex_table_cmd, 0, sizeof(struct iwm_coex_prio_table_cmd));

	coex_table_cmd.flags = COEX_FLAGS_STA_TABLE_VALID_MSK;

	switch (iwm->conf.coexist_mode) {
	case COEX_MODE_XOR:
	case COEX_MODE_CM:
		coex_enabled = 1;
		break;
	default:
		coex_enabled = 0;
		break;
	}

	switch (iwm->conf.mode) {
	case UMAC_MODE_BSS:
	case UMAC_MODE_IBSS:
		mode_enabled = 1;
		break;
	default:
		mode_enabled = 0;
		break;
	}

	if (coex_enabled && mode_enabled) {
		coex_table_cmd.flags |= COEX_FLAGS_COEX_ENABLE_MSK |
					COEX_FLAGS_ASSOC_WAKEUP_UMASK_MSK |
					COEX_FLAGS_UNASSOC_WAKEUP_UMASK_MSK;

		switch (iwm->conf.coexist_mode) {
		case COEX_MODE_XOR:
			memcpy(coex_table_cmd.sta_prio, iwm_sta_xor_prio_tbl,
			       sizeof(iwm_sta_xor_prio_tbl));
			break;
		case COEX_MODE_CM:
			memcpy(coex_table_cmd.sta_prio, iwm_sta_cm_prio_tbl,
			       sizeof(iwm_sta_cm_prio_tbl));
			break;
		default:
			IWM_ERR(iwm, "Invalid coex_mode 0x%x\n",
				iwm->conf.coexist_mode);
			break;
		}
	} else
		IWM_WARN(iwm, "coexistense disabled\n");

	return iwm_send_lmac_ptrough_cmd(iwm, COEX_PRIORITY_TABLE_CMD,
				&coex_table_cmd,
				sizeof(struct iwm_coex_prio_table_cmd), 1);
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:55,代码来源:commands.c


示例14: iwm_target_read

static int iwm_target_read(struct iwm_priv *iwm, __le32 address,
			   u8 *response, u32 resp_size)
{
	struct iwm_udma_nonwifi_cmd target_cmd;
	struct iwm_nonwifi_cmd *cmd;
	u16 seq_num;
	int ret = 0;

	target_cmd.opcode = UMAC_HDI_OUT_OPCODE_READ;
	target_cmd.addr = address;
	target_cmd.op1_sz = cpu_to_le32(resp_size);
	target_cmd.op2 = 0;
	target_cmd.handle_by_hw = 0;
	target_cmd.resp = 1;
	target_cmd.eop = 1;

	ret = iwm_hal_send_target_cmd(iwm, &target_cmd, NULL);
	if (ret < 0) {
		IWM_ERR(iwm, "Couldn't send READ command\n");
		return ret;
	}

	/*                                                                 */
	seq_num = ret;

	ret = wait_event_interruptible_timeout(iwm->nonwifi_queue,
		(cmd = iwm_get_pending_nonwifi_cmd(iwm, seq_num,
					  UMAC_HDI_OUT_OPCODE_READ)) != NULL,
					       2 * HZ);

	if (!ret) {
		IWM_ERR(iwm, "Didn't receive a target READ answer\n");
		return ret;
	}

	memcpy(response, cmd->buf.hdr + sizeof(struct iwm_udma_in_hdr),
	       resp_size);

	kfree(cmd);

	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:42,代码来源:commands.c


示例15: if_sdio_enable

/* Bus ops */
static int if_sdio_enable(struct iwm_priv *iwm)
{
	struct iwm_sdio_priv *hw = iwm_to_if_sdio(iwm);
	int ret;

	sdio_claim_host(hw->func);

	ret = sdio_enable_func(hw->func);
	if (ret) {
		IWM_ERR(iwm, "Couldn't enable the device: is TOP driver "
			"loaded and functional?\n");
		goto release_host;
	}

	iwm_reset(iwm);

	ret = sdio_claim_irq(hw->func, iwm_sdio_isr);
	if (ret) {
		IWM_ERR(iwm, "Failed to claim irq: %d\n", ret);
		goto release_host;
	}

	sdio_writeb(hw->func, 1, IWM_SDIO_INTR_ENABLE_ADDR, &ret);
	if (ret < 0) {
		IWM_ERR(iwm, "Couldn't enable INTR: %d\n", ret);
		goto release_irq;
	}

	sdio_release_host(hw->func);

	IWM_DBG_SDIO(iwm, INFO, "IWM SDIO enable\n");

	return 0;

 release_irq:
	sdio_release_irq(hw->func);
 release_host:
	sdio_release_host(hw->func);

	return ret;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:42,代码来源:sdio.c


示例16: iwm_load_firmware_chunk

static int iwm_load_firmware_chunk(struct iwm_priv *iwm,
				   const struct firmware *fw,
				   struct iwm_fw_img_desc *img_desc)
{
	struct iwm_udma_nonwifi_cmd target_cmd;
	u32 chunk_size;
	const u8 *chunk_ptr;
	int ret = 0;

	IWM_DBG_FW(iwm, INFO, "Loading FW chunk: %d bytes @ 0x%x\n",
		   img_desc->length, img_desc->address);

	target_cmd.opcode = UMAC_HDI_OUT_OPCODE_WRITE;
	target_cmd.handle_by_hw = 1;
	target_cmd.op2 = 0;
	target_cmd.resp = 0;
	target_cmd.eop = 1;

	chunk_size = img_desc->length;
	chunk_ptr = fw->data + img_desc->offset;

	while (chunk_size > 0) {
		u32 tmp_chunk_size;

		tmp_chunk_size = min_t(u32, chunk_size,
				       IWM_MAX_NONWIFI_CMD_BUFF_SIZE);

		target_cmd.addr = cpu_to_le32(img_desc->address +
				    (chunk_ptr - fw->data - img_desc->offset));
		target_cmd.op1_sz = cpu_to_le32(tmp_chunk_size);

		IWM_DBG_FW(iwm, DBG, "\t%d bytes @ 0x%x\n",
			   tmp_chunk_size, target_cmd.addr);

		ret = iwm_hal_send_target_cmd(iwm, &target_cmd, chunk_ptr);
		if (ret < 0) {
			IWM_ERR(iwm, "Couldn't load FW chunk\n");
			break;
		}

		chunk_size -= tmp_chunk_size;
		chunk_ptr += tmp_chunk_size;
	}

	return ret;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:46,代码来源:fw.c


示例17: iwm_send_mlme_profile

int iwm_send_mlme_profile(struct iwm_priv *iwm)
{
	int ret, i;
	struct iwm_umac_profile profile;

	memcpy(&profile, iwm->umac_profile, sizeof(profile));

	profile.hdr.oid = UMAC_WIFI_IF_CMD_SET_PROFILE;
	profile.hdr.buf_size = cpu_to_le16(sizeof(struct iwm_umac_profile) -
					   sizeof(struct iwm_umac_wifi_if));

	ret = iwm_send_wifi_if_cmd(iwm, &profile, sizeof(profile), 1);
	if (ret < 0) {
		IWM_ERR(iwm, "Send profile command failed\n");
		return ret;
	}

	/* Wait for the profile to be active */
	ret = wait_event_interruptible_timeout(iwm->mlme_queue,
					       iwm->umac_profile_active == 1,
					       3 * HZ);
	if (!ret)
		return -EBUSY;


	for (i = 0; i < IWM_NUM_KEYS; i++)
		if (iwm->keys[i].in_use) {
			int default_key = 0;
			struct iwm_key *key = &iwm->keys[i];

			if (key == iwm->default_key)
				default_key = 1;

			/* Wait for the profile before sending the keys */
			wait_event_interruptible_timeout(iwm->mlme_queue,
			     (test_bit(IWM_STATUS_ASSOCIATING, &iwm->status) ||
			      test_bit(IWM_STATUS_ASSOCIATED, &iwm->status)),
							 3 * HZ);

			ret = iwm_set_key(iwm, 0, default_key, key);
			if (ret < 0)
				return ret;
		}

	return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:46,代码来源:commands.c


示例18: iwm_set_key_mgt

static int iwm_set_key_mgt(struct iwm_priv *iwm, u8 key_mgt)
{
    u8 *auth_type = &iwm->umac_profile->sec.auth_type;

    if (key_mgt == IW_AUTH_KEY_MGMT_802_1X)
        *auth_type = UMAC_AUTH_TYPE_8021X;
    else if (key_mgt == IW_AUTH_KEY_MGMT_PSK) {
        if (iwm->umac_profile->sec.flags &
                (UMAC_SEC_FLG_WPA_ON_MSK | UMAC_SEC_FLG_RSNA_ON_MSK))
            *auth_type = UMAC_AUTH_TYPE_RSNA_PSK;
        else
            *auth_type = UMAC_AUTH_TYPE_LEGACY_PSK;
    } else {
        IWM_ERR(iwm, "Invalid key mgt: 0x%x\n", key_mgt);
        return -EINVAL;
    }

    return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:19,代码来源:wext.c


示例19: if_sdio_send_chunk

static int if_sdio_send_chunk(struct iwm_priv *iwm, u8 *buf, int count)
{
	struct iwm_sdio_priv *hw = iwm_to_if_sdio(iwm);
	int aligned_count = ALIGN(count, hw->blk_size);
	int ret;

	if ((unsigned long)buf & 0x3) {
		IWM_ERR(iwm, "buf <%p> is not dword aligned\n", buf);
		/* TODO: Is this a hardware limitation? use get_unligned */
		return -EINVAL;
	}

	sdio_claim_host(hw->func);
	ret = sdio_memcpy_toio(hw->func, IWM_SDIO_DATA_ADDR, buf,
			       aligned_count);
	sdio_release_host(hw->func);

	return ret;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:19,代码来源:sdio.c


示例20: iwm_wext_siwauth

static int iwm_wext_siwauth(struct net_device *dev,
                            struct iw_request_info *info,
                            struct iw_param *data, char *extra)
{
    struct iwm_priv *iwm = ndev_to_iwm(dev);
    int ret;

    if ((data->flags) &
            (IW_AUTH_WPA_VERSION | IW_AUTH_KEY_MGMT |
             IW_AUTH_WPA_ENABLED | IW_AUTH_80211_AUTH_ALG)) {
        /* We need to invalidate the current profile */
        if (iwm->umac_profile_active) {
            ret = iwm_invalidate_mlme_profile(iwm);
            if (ret < 0) {
                IWM_ERR(iwm, "Couldn't invalidate profile\n");
                return ret;
            }
        }
    }

    switch (data->flags & IW_AUTH_INDEX) {
    case IW_AUTH_WPA_VERSION:
        return iwm_set_wpa_version(iwm, data->value);
        break;
    case IW_AUTH_CIPHER_PAIRWISE:
        return iwm_set_cipher(iwm, data->value, 1);
        break;
    case IW_AUTH_CIPHER_GROUP:
        return iwm_set_cipher(iwm, data->value, 0);
        break;
    case IW_AUTH_KEY_MGMT:
        return iwm_set_key_mgt(iwm, data->value);
        break;
    case IW_AUTH_80211_AUTH_ALG:
        return iwm_set_auth_alg(iwm, data->value);
        break;
    default:
        return -ENOTSUPP;
    }

    return 0;
}
开发者ID:Herysutrisno,项目名称:mpc5200,代码行数:42,代码来源:wext.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IW_CALLSTACK函数代码示例发布时间:2022-05-30
下一篇:
C++ IWL_WARN函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap