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

C++ request_firmware_nowait函数代码示例

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

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



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

示例1: mwifiex_init_hw_fw

/*
 * This function initializes the hardware and gets firmware.
 */
static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter)
{
	int ret;

	init_completion(&adapter->fw_load);
	ret = request_firmware_nowait(THIS_MODULE, 1, adapter->fw_name,
				      adapter->dev, GFP_KERNEL, adapter,
				      mwifiex_fw_dpc);
	if (ret < 0)
		dev_err(adapter->dev,
			"request_firmware_nowait() returned error %d\n", ret);
	return ret;
}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:16,代码来源:main.c


示例2: carl9170_usb_probe

static int carl9170_usb_probe(struct usb_interface *intf,
			      const struct usb_device_id *id)
{
	struct ar9170 *ar;
	struct usb_device *udev;
	int err;

	err = usb_reset_device(interface_to_usbdev(intf));
	if (err)
		return err;

	ar = carl9170_alloc(sizeof(*ar));
	if (IS_ERR(ar))
		return PTR_ERR(ar);

	udev = interface_to_usbdev(intf);
	usb_get_dev(udev);
	ar->udev = udev;
	ar->intf = intf;
	ar->features = id->driver_info;

	usb_set_intfdata(intf, ar);
	SET_IEEE80211_DEV(ar->hw, &intf->dev);

	init_usb_anchor(&ar->rx_anch);
	init_usb_anchor(&ar->rx_pool);
	init_usb_anchor(&ar->rx_work);
	init_usb_anchor(&ar->tx_wait);
	init_usb_anchor(&ar->tx_anch);
	init_usb_anchor(&ar->tx_cmd);
	init_usb_anchor(&ar->tx_err);
	init_completion(&ar->cmd_wait);
	init_completion(&ar->fw_boot_wait);
	init_completion(&ar->fw_load_wait);
	tasklet_init(&ar->usb_tasklet, carl9170_usb_tasklet,
		     (unsigned long)ar);

	atomic_set(&ar->tx_cmd_urbs, 0);
	atomic_set(&ar->tx_anch_urbs, 0);
	atomic_set(&ar->rx_work_urbs, 0);
	atomic_set(&ar->rx_anch_urbs, 0);
	atomic_set(&ar->rx_pool_urbs, 0);
	ar->cmd_seq = -2;

	usb_get_dev(ar->udev);

	carl9170_set_state(ar, CARL9170_STOPPED);

	return request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME,
		&ar->udev->dev, GFP_KERNEL, ar, carl9170_usb_firmware_step2);
}
开发者ID:Ale1ster,项目名称:kerneldir,代码行数:51,代码来源:usb.c


示例3: hdcp_load_keys

static int hdcp_load_keys(void)
{
	int ret;

	ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
				      "hdcp.keys", mdev.this_device, GFP_KERNEL,
				      &hdcp, hdcp_load_keys_cb);
	if (ret < 0) {
		pr_err("HDCP: request_firmware_nowait failed: %d\n", ret);
		hdcp.hdcp_keys_loaded = false;
		return ret;
	}

	return 0;
}
开发者ID:ARMP,项目名称:ARM-Project,代码行数:15,代码来源:hdcp_top.c


示例4: spec_load_firmware

void spec_load_firmware(struct work_struct *work)
{
    struct spec_dev *dev = container_of(work, struct spec_dev, work);
    struct pci_dev *pdev = dev->pdev;
    static char fwname[SPEC_MAX_FWNAME_SIZE];
    int err;

    if (!(*fwname)) {
        dev_err(&pdev->dev, "no fwname specified\n");
        return;
    }
    if (SPEC_DEBUG)
        pr_info(KBUILD_MODNAME ": %s: %s\n", __func__, fwname);

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
    err = request_firmware_nowait(THIS_MODULE, 1, fwname, &pdev->dev,
                                  dev, spec_complete_firmware);
#else
    err = request_firmware_nowait(THIS_MODULE, 1, fwname, &pdev->dev,
                                  GFP_KERNEL, dev, spec_complete_firmware);
#endif
    pr_info(KBUILD_MODNAME ": %s: request_firmware returned %i\n",
            __func__, err);
}
开发者ID:mvanga,项目名称:SPEC-Driver,代码行数:24,代码来源:spec.c


示例5: hdcp_load_keys

static int hdcp_load_keys(void)
{
	int ret;

	HDCP_DBG("%s\n", __func__);

	ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
					"hdcp.keys", hdcp.mdev->this_device,
					GFP_KERNEL, &hdcp, hdcp_load_keys_cb);
	if (ret < 0) {
		HDCP_ERR("request_firmware_nowait failed: %d\n", ret);
		hdcp.hdcp_keys_loaded = false;
	}

	return ret;
}
开发者ID:robacklin,项目名称:omap-android,代码行数:16,代码来源:hdcp_top.c


示例6: upgrade_firmware_from_class

static int upgrade_firmware_from_class(struct device *dev)
{
	int retval;

	dev_vdbg(dev, "%s: Enabling firmware class loader\n", __func__);

	retval = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
			CY_FW_MANUAL_UPGRADE_FILE_NAME, dev, GFP_KERNEL, dev,
			_cyttsp5_firmware_cont);
	if (retval < 0) {
		dev_err(dev, "%s: Fail request firmware class file load\n",
			__func__);
		return retval;
	}

	return 0;
}
开发者ID:moonlightly,项目名称:NX523J_kernel,代码行数:17,代码来源:cyttsp5_loader.c


示例7: mxt_load_fw_from_req_fw

static int mxt_load_fw_from_req_fw(struct mxt_fw_info *fw_info,
		const struct firmware *fw)
{
	struct mxt_data *data = fw_info->data;
	struct device *dev = &data->client->dev;
	const char *firmware_name =
		data->pdata->firmware_name ?: MXT_DEFAULT_FIRMWARE_NAME;
	int ret = 0;

	if (MXT_FIRMWARE_UPDATE_TYPE) {
		char fw_path[MXT_MAX_FW_PATH];

		memset(&fw_path, 0, MXT_MAX_FW_PATH);

		snprintf(fw_path, MXT_MAX_FW_PATH, "%s/%s",
			MXT_FIRMWARE_INKERNEL_PATH, firmware_name);

		dev_err(dev, "%s\n", fw_path);

		ret = request_firmware(&fw, fw_path, dev);
		if (ret) {
			dev_err(dev,
				"Could not request firmware %s\n", fw_path);
			goto out;
		}
	} else {
		ret = request_firmware_nowait(THIS_MODULE, true, firmware_name,
					dev, GFP_KERNEL,
					data, mxt_request_firmware_work);
		if (ret) {
			dev_err(dev,
				"Could not request firmware %s\n",
				firmware_name);
			goto out;
		}
	}

	ret = mxt_verify_fw(fw_info, fw);
out:
	return ret;
}
开发者ID:C457,项目名称:android_kernel_samsung_t110,代码行数:41,代码来源:mxts_sec.c


示例8: cptk_update_firmware

static int cptk_update_firmware(struct cptk_data *cptk)
{
	int ret;
	struct device *dev = &cptk->input_dev->dev;
	cptk->touchkey_update_status = 1;
	if (!cptk->pdata->fw_name) {
		dev_err(dev, "%s: Device firmware name is not set\n", __func__);
		return -EINVAL;
	}

	ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG,
			cptk->pdata->fw_name, dev, GFP_KERNEL, cptk,
			cptk_update_firmware_cb);
	if (ret) {
		dev_err(dev, "%s: Can't open firmware file from %s\n", __func__,
			cptk->pdata->fw_name);
		return ret;
	}

	return 0;
}
开发者ID:nickh186,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:21,代码来源:cypress-touchkey.c


示例9: rr_load_firmware

/*
 * We want to run the actual loading from a work queue, to have a known
 * loading environment, especially one that can sleep. The function
 * pointer is already in the work structure, set at compile time from
 * rawrabbit-core.c .
 */
void rr_load_firmware(struct work_struct *work)
{
	struct rr_dev *dev = container_of(work, struct rr_dev, work);
	struct pci_dev *pdev = dev->pdev;
	static char fwname[RR_MAX_FWNAME_SIZE];
	int err;

	if (rr_expand_name(dev, fwname)) {
		dev_err(&pdev->dev, "Wrong fwname: \"%s\"\n", rr_fwname);
		return;
	}
	if (1)
		printk("%s: %s\n", __func__, fwname);

	__rr_report_env(__func__);
	printk(KERN_INFO "firmware name: %s\n", fwname);
	err = request_firmware_nowait(THIS_MODULE, 1, fwname, &pdev->dev,
				      __RR_GFP_FOR_RFNW(GFP_KERNEL)
				      dev, rr_loader_complete);
	printk("request firmware returned %i\n", err);
}
开发者ID:mcattin,项目名称:fmc_adc_100Ms_test,代码行数:27,代码来源:loader.c


示例10: m6mo_load_firmware

int m6mo_load_firmware(struct v4l2_subdev *sd)
{
	int ret = 0;	
	struct i2c_client *client = v4l2_get_subdevdata(sd);

	m6mo_set_firmware_status(sd, FIRMWARE_REQUESTING);

	ret = request_firmware_nowait(THIS_MODULE,
				      FW_ACTION_HOTPLUG,
				      M6MO_FIRMWARE_FILE_NAME,
				      &client->dev,
				      GFP_KERNEL,
				      sd,
				      m6mo_fw_request_complete_handler);
	if (ret) {
		dev_err(&client->dev, "could not load firmware (err=%d)\n", ret);
		m6mo_set_firmware_status(sd, FIRMWARE_CHECKED);
	}

	return ret;
}
开发者ID:Scorpio92,项目名称:android_kernel_mx2,代码行数:21,代码来源:m6mo_fw.c


示例11: rtl92cu_init_sw_vars

static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	int err;
	char *fw_name;

	rtlpriv->dm.dm_initialgain_enable = true;
	rtlpriv->dm.dm_flag = 0;
	rtlpriv->dm.disable_framebursting = false;
	rtlpriv->dm.thermalvalue = 0;
	rtlpriv->cfg->mod_params->sw_crypto =
		rtlpriv->cfg->mod_params->sw_crypto;

	/* for firmware buf */
	rtlpriv->rtlhal.pfirmware = vzalloc(0x4000);
	if (!rtlpriv->rtlhal.pfirmware) {
		pr_err("Can't alloc buffer for fw\n");
		return 1;
	}
	if (IS_VENDOR_UMC_A_CUT(rtlpriv->rtlhal.version) &&
	    !IS_92C_SERIAL(rtlpriv->rtlhal.version)) {
		fw_name = "rtlwifi/rtl8192cufw_A.bin";
	} else if (IS_81XXC_VENDOR_UMC_B_CUT(rtlpriv->rtlhal.version)) {
		fw_name = "rtlwifi/rtl8192cufw_B.bin";
	} else {
		fw_name = "rtlwifi/rtl8192cufw_TMSC.bin";
	}
	/* provide name of alternative file */
	rtlpriv->cfg->alt_fw_name = "rtlwifi/rtl8192cufw.bin";
	pr_info("Loading firmware %s\n", fw_name);
	rtlpriv->max_fw_size = 0x4000;
	err = request_firmware_nowait(THIS_MODULE, 1,
				      fw_name, rtlpriv->io.dev,
				      GFP_KERNEL, hw, rtl_fw_cb);
	if (err) {
		vfree(rtlpriv->rtlhal.pfirmware);
		rtlpriv->rtlhal.pfirmware = NULL;
	}
	return err;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:40,代码来源:sw.c


示例12: callbackfn_rbu

static void callbackfn_rbu(const struct firmware *fw, void *context)
{
	int rc = 0;

	if (!fw || !fw->size) {
		rbu_data.entry_created = 0;
		return;
	}

	spin_lock(&rbu_data.lock);
	if (!strcmp(image_type, "mono")) {
		if (!img_update_realloc(fw->size))
			memcpy(rbu_data.image_update_buffer,
				fw->data, fw->size);
	} else if (!strcmp(image_type, "packet")) {
		/*
		 * we need to free previous packets if a
		 * new hunk of packets needs to be downloaded
		 */
		packet_empty_list();
		if (packetize_data(fw->data, fw->size))
			/* Incase something goes wrong when we are
			 * in middle of packetizing the data, we
			 * need to free up whatever packets might
			 * have been created before we quit.
			 */
			packet_empty_list();
	} else
		pr_debug("invalid image type specified.\n");
	spin_unlock(&rbu_data.lock);

	rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG,
		"dell_rbu", &rbu_device->dev, &context, callbackfn_rbu);
	if (rc)
		printk(KERN_ERR
			"dell_rbu:%s request_firmware_nowait failed"
			" %d\n", __FUNCTION__, rc);
	else
		rbu_data.entry_created = 1;
}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:40,代码来源:dell_rbu.c


示例13: ar9170_usb_firmware_inits

static void ar9170_usb_firmware_inits(const struct firmware *fw,
				      void *context)
{
	struct ar9170_usb *aru = context;
	int err;

	if (!fw) {
		dev_err(&aru->udev->dev, "file with init values not found.\n");
		ar9170_usb_firmware_failed(aru);
		return;
	}

	aru->init_values = fw;

	/* ok so we have the init values -- get code for two-stage */

	err = request_firmware_nowait(THIS_MODULE, 1, "ar9170-2.fw",
				      &aru->udev->dev, GFP_KERNEL, aru,
				      ar9170_usb_firmware_finish);
	if (err)
		ar9170_usb_firmware_failed(aru);
}
开发者ID:kronenpj,项目名称:samsung-s3c6410-android.2.0,代码行数:22,代码来源:usb.c


示例14: fdma_do_bootload

static int fdma_do_bootload(struct fdma *fdma)
{
	int err;
	int result;

	result = snprintf(fdma->fw_name, sizeof(fdma->fw_name),
			  "fdma_%s_%d.elf", get_cpu_subtype(&current_cpu_data),
			  (fdma->pdev->id == -1) ? 0 : fdma->pdev->id);
	BUG_ON(result >= sizeof(fdma->fw_name)); /* was the string truncated? */

	fdma_dbg(fdma, "FDMA: Loading ELF Firmware (%s)...\n", fdma->fw_name);

	err = request_firmware_nowait(THIS_MODULE, 1, fdma->fw_name,
					&fdma->pdev->dev, (struct fdma *)fdma,
					(void *)fdma_load_elf);
	if (err)
		return -ENOMEM;

	wake_up(&fdma->fw_load_q);

	return 0;
}
开发者ID:geraldmusch,项目名称:satip-axe,代码行数:22,代码来源:fdma.c


示例15: rtl92cu_init_sw_vars

static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	int err;

	rtlpriv->dm.dm_initialgain_enable = true;
	rtlpriv->dm.dm_flag = 0;
	rtlpriv->dm.disable_framebursting = false;
	rtlpriv->dm.thermalvalue = 0;
	rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;

	INIT_WORK(&rtlpriv->works.fill_h2c_cmd,
		  rtl92cu_fill_h2c_cmd_work_callback);

	/* for firmware buf */
	rtlpriv->rtlhal.pfirmware = vzalloc(0x4000);
	if (!rtlpriv->rtlhal.pfirmware) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
			 "Can't alloc buffer for fw\n");
		return 1;
	}
	if (IS_VENDOR_UMC_A_CUT(rtlpriv->rtlhal.version) &&
	    !IS_92C_SERIAL(rtlpriv->rtlhal.version)) {
		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cufw_A.bin";
	} else if (IS_81XXC_VENDOR_UMC_B_CUT(rtlpriv->rtlhal.version)) {
		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cufw_B.bin";
	} else {
		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cufw_TMSC.bin";
	}
	/* provide name of alternative file */
	rtlpriv->cfg->alt_fw_name = "rtlwifi/rtl8192cufw.bin";
	pr_info("Loading firmware %s\n", rtlpriv->cfg->fw_name);
	rtlpriv->max_fw_size = 0x4000;
	err = request_firmware_nowait(THIS_MODULE, 1,
				      rtlpriv->cfg->fw_name, rtlpriv->io.dev,
				      GFP_KERNEL, hw, rtl_fw_cb);
	return err;
}
开发者ID:UNwS,项目名称:rtl8192su,代码行数:38,代码来源:sw.c


示例16: rtl8723e_init_sw_vars

int rtl8723e_init_sw_vars(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
	int err = 0;

	rtl8723e_bt_reg_init(hw);

	rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();

	rtlpriv->dm.dm_initialgain_enable = 1;
	rtlpriv->dm.dm_flag = 0;
	rtlpriv->dm.disable_framebursting = 0;
	rtlpriv->dm.thermalvalue = 0;
	rtlpci->transmit_config = CFENDFORM | BIT(12) | BIT(13);

	/* compatible 5G band 88ce just 2.4G band & smsp */
	rtlpriv->rtlhal.current_bandtype = BAND_ON_2_4G;
	rtlpriv->rtlhal.bandset = BAND_ON_2_4G;
	rtlpriv->rtlhal.macphymode = SINGLEMAC_SINGLEPHY;

	rtlpci->receive_config = (RCR_APPFCS |
				  RCR_APP_MIC |
				  RCR_APP_ICV |
				  RCR_APP_PHYST_RXFF |
				  RCR_HTC_LOC_CTRL |
				  RCR_AMF |
				  RCR_ACF |
				  RCR_ADF |
				  RCR_AICV |
				  RCR_AB |
				  RCR_AM |
				  RCR_APM |
				  0);

	rtlpci->irq_mask[0] =
	    (u32) (PHIMR_ROK |
		   PHIMR_RDU |
		   PHIMR_VODOK |
		   PHIMR_VIDOK |
		   PHIMR_BEDOK |
		   PHIMR_BKDOK |
		   PHIMR_MGNTDOK |
		   PHIMR_HIGHDOK |
		   PHIMR_C2HCMD |
		   PHIMR_HISRE_IND |
		   PHIMR_TSF_BIT32_TOGGLE |
		   PHIMR_TXBCNOK |
		   PHIMR_PSTIMEOUT |
		   0);

	rtlpci->irq_mask[1]	=
		 (u32)(PHIMR_RXFOVW |
				0);

	/* for debug level */
	rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
	/* for LPS & IPS */
	rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
	rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
	rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
	if (rtlpriv->cfg->mod_params->disable_watchdog)
		pr_info("watchdog disabled\n");
	rtlpriv->psc.reg_fwctrl_lps = 3;
	rtlpriv->psc.reg_max_lps_awakeintvl = 5;
	rtl8723e_init_aspm_vars(hw);

	if (rtlpriv->psc.reg_fwctrl_lps == 1)
		rtlpriv->psc.fwctrl_psmode = FW_PS_MIN_MODE;
	else if (rtlpriv->psc.reg_fwctrl_lps == 2)
		rtlpriv->psc.fwctrl_psmode = FW_PS_MAX_MODE;
	else if (rtlpriv->psc.reg_fwctrl_lps == 3)
		rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE;

	/* for firmware buf */
	rtlpriv->rtlhal.pfirmware = vzalloc(0x6000);
	if (!rtlpriv->rtlhal.pfirmware) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
			 "Can't alloc buffer for fw.\n");
		return 1;
	}

	if (IS_VENDOR_8723_A_CUT(rtlhal->version))
		rtlpriv->cfg->fw_name = "rtlwifi/rtl8723fw.bin";
	else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version))
		rtlpriv->cfg->fw_name = "rtlwifi/rtl8723fw_B.bin";

	rtlpriv->max_fw_size = 0x6000;
	pr_info("Using firmware %s\n", rtlpriv->cfg->fw_name);
	err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name,
				      rtlpriv->io.dev, GFP_KERNEL, hw,
				      rtl_fw_cb);
	if (err) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
			 "Failed to request firmware!\n");
		return 1;
	}
	return 0;
}
开发者ID:Codefollows,项目名称:ps4-linux,代码行数:100,代码来源:sw.c


示例17: rtl8723be_init_sw_vars

int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
{
	int err = 0;
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
	char *fw_name = "rtlwifi/rtl8723befw.bin";

	rtl8723be_bt_reg_init(hw);
	rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();

	rtlpriv->dm.dm_initialgain_enable = 1;
	rtlpriv->dm.dm_flag = 0;
	rtlpriv->dm.disable_framebursting = 0;
	rtlpriv->dm.thermalvalue = 0;
	rtlpci->transmit_config = CFENDFORM | BIT(15) | BIT(24) | BIT(25);

	rtlpriv->phy.lck_inprogress = false;

	mac->ht_enable = true;

	/* compatible 5G band 88ce just 2.4G band & smsp */
	rtlpriv->rtlhal.current_bandtype = BAND_ON_2_4G;
	rtlpriv->rtlhal.bandset = BAND_ON_2_4G;
	rtlpriv->rtlhal.macphymode = SINGLEMAC_SINGLEPHY;

	rtlpci->receive_config = (RCR_APPFCS		|
				  RCR_APP_MIC		|
				  RCR_APP_ICV		|
				  RCR_APP_PHYST_RXFF	|
				  RCR_HTC_LOC_CTRL	|
				  RCR_AMF		|
				  RCR_ACF		|
				  RCR_ADF		|
				  RCR_AICV		|
				  RCR_AB		|
				  RCR_AM		|
				  RCR_APM		|
				  0);

	rtlpci->irq_mask[0] = (u32) (IMR_PSTIMEOUT	|
				     IMR_HSISR_IND_ON_INT	|
				     IMR_C2HCMD		|
				     IMR_HIGHDOK	|
				     IMR_MGNTDOK	|
				     IMR_BKDOK		|
				     IMR_BEDOK		|
				     IMR_VIDOK		|
				     IMR_VODOK		|
				     IMR_RDU		|
				     IMR_ROK		|
				     0);

	rtlpci->irq_mask[1] = (u32)(IMR_RXFOVW | 0);

	rtlpci->sys_irq_mask = (u32)(HSIMR_PDN_INT_EN	|
				     HSIMR_RON_INT_EN	|
				     0);

	/* for LPS & IPS */
	rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
	rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
	rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
	rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
	rtlpriv->cfg->mod_params->sw_crypto =
		 rtlpriv->cfg->mod_params->sw_crypto;
	rtlpriv->cfg->mod_params->disable_watchdog =
		 rtlpriv->cfg->mod_params->disable_watchdog;
	if (rtlpriv->cfg->mod_params->disable_watchdog)
		pr_info("watchdog disabled\n");
	rtlpriv->psc.reg_fwctrl_lps = 3;
	rtlpriv->psc.reg_max_lps_awakeintvl = 5;
	/* for ASPM, you can close aspm through
	 * set const_support_pciaspm = 0
	 */
	rtl8723be_init_aspm_vars(hw);

	if (rtlpriv->psc.reg_fwctrl_lps == 1)
		rtlpriv->psc.fwctrl_psmode = FW_PS_MIN_MODE;
	else if (rtlpriv->psc.reg_fwctrl_lps == 2)
		rtlpriv->psc.fwctrl_psmode = FW_PS_MAX_MODE;
	else if (rtlpriv->psc.reg_fwctrl_lps == 3)
		rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE;

	/*low power: Disable 32k */
	rtlpriv->psc.low_power_enable = false;

	rtlpriv->rtlhal.earlymode_enable = false;

	/* for firmware buf */
	rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
	if (!rtlpriv->rtlhal.pfirmware) {
		pr_err("Can't alloc buffer for fw.\n");
		return 1;
	}

	rtlpriv->max_fw_size = 0x8000;
	pr_info("Using firmware %s\n", fw_name);
	err = request_firmware_nowait(THIS_MODULE, 1, fw_name,
				      rtlpriv->io.dev, GFP_KERNEL, hw,
//.........这里部分代码省略.........
开发者ID:AshishNamdev,项目名称:linux,代码行数:101,代码来源:sw.c


示例18: rtl92c_init_sw_vars

int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
{
	int err;
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));

	rtl8192ce_bt_reg_init(hw);

	rtlpriv->dm.dm_initialgain_enable = true;
	rtlpriv->dm.dm_flag = 0;
	rtlpriv->dm.disable_framebursting = false;
	rtlpriv->dm.thermalvalue = 0;
	rtlpci->transmit_config = CFENDFORM | BIT(12) | BIT(13);

	/* compatible 5G band 88ce just 2.4G band & smsp */
	rtlpriv->rtlhal.current_bandtype = BAND_ON_2_4G;
	rtlpriv->rtlhal.bandset = BAND_ON_2_4G;
	rtlpriv->rtlhal.macphymode = SINGLEMAC_SINGLEPHY;

	rtlpci->receive_config = (RCR_APPFCS |
				  RCR_AMF |
				  RCR_ADF |
				  RCR_APP_MIC |
				  RCR_APP_ICV |
				  RCR_AICV |
				  RCR_ACRC32 |
				  RCR_AB |
				  RCR_AM |
				  RCR_APM |
				  RCR_APP_PHYST_RXFF | RCR_HTC_LOC_CTRL | 0);

	rtlpci->irq_mask[0] =
	    (u32) (IMR_ROK |
		   IMR_VODOK |
		   IMR_VIDOK |
		   IMR_BEDOK |
		   IMR_BKDOK |
		   IMR_MGNTDOK |
		   IMR_HIGHDOK | IMR_BDOK | IMR_RDU | IMR_RXFOVW | 0);

	rtlpci->irq_mask[1] = (u32) (IMR_CPWM | IMR_C2HCMD | 0);

	/* for debug level */
	rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
	/* for LPS & IPS */
	rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
	rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
	rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
	if (!rtlpriv->psc.inactiveps)
		pr_info("rtl8192ce: Power Save off (module option)\n");
	if (!rtlpriv->psc.fwctrl_lps)
		pr_info("rtl8192ce: FW Power Save off (module option)\n");
	rtlpriv->psc.reg_fwctrl_lps = 3;
	rtlpriv->psc.reg_max_lps_awakeintvl = 5;
	/* for ASPM, you can close aspm through
	 * set const_support_pciaspm = 0 */
	rtl92c_init_aspm_vars(hw);

	if (rtlpriv->psc.reg_fwctrl_lps == 1)
		rtlpriv->psc.fwctrl_psmode = FW_PS_MIN_MODE;
	else if (rtlpriv->psc.reg_fwctrl_lps == 2)
		rtlpriv->psc.fwctrl_psmode = FW_PS_MAX_MODE;
	else if (rtlpriv->psc.reg_fwctrl_lps == 3)
		rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE;

	/* for firmware buf */
	rtlpriv->rtlhal.pfirmware = vzalloc(0x4000);
	if (!rtlpriv->rtlhal.pfirmware) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
			 "Can't alloc buffer for fw\n");
		return 1;
	}

	/* request fw */
	if (IS_VENDOR_UMC_A_CUT(rtlhal->version) &&
	    !IS_92C_SERIAL(rtlhal->version)) {
		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU.bin";
	} else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version)) {
		rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU_B.bin";
		pr_info("****** This B_CUT device may not work with kernels 3.6 and earlier\n");
	}

	rtlpriv->max_fw_size = 0x4000;
	pr_info("Using firmware %s\n", rtlpriv->cfg->fw_name);
	err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name,
				      rtlpriv->io.dev, GFP_KERNEL, hw,
				      rtl_fw_cb);
	if (err) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
			 "Failed to request firmware!\n");
		return 1;
	}

	return 0;
}
开发者ID:AllenDou,项目名称:linux,代码行数:96,代码来源:sw.c


示例19: mfc_probe


//.........这里部分代码省略.........
	mfc_debug(" mfc_port0_base_paddr= 0x%x \n", mfc_port0_base_paddr);
	mfc_debug(" mfc_port0_memsize = 0x%x \n", mfc_port0_memsize);

	mfc_port0_base_paddr = ALIGN_TO_128KB(mfc_port0_base_paddr);
	mfc_port0_base_vaddr = phys_to_virt(mfc_port0_base_paddr);

	if (mfc_port0_base_vaddr == NULL) {
		mfc_err("fail to mapping port0 buffer\n");
		ret = -EPERM;
		goto err_vaddr_map;
	}

	mfc_port1_alloc_paddr = (unsigned int)pdata->buf_phy_base[1];
	mfc_port1_memsize =  (unsigned int)pdata->buf_phy_size[1];

	mfc_port1_base_paddr = (unsigned int)s5p_get_media_membase_bank(1);
	mfc_port1_base_paddr = ALIGN_TO_128KB(mfc_port1_base_paddr);

	mfc_debug(" mfc_port1_base_paddr= 0x%x \n", mfc_port1_base_paddr);
	mfc_debug(" mfc_port1_memsize = 0x%x \n", mfc_port1_memsize);

	mfc_port1_alloc_paddr = ALIGN_TO_128KB(mfc_port1_alloc_paddr);
	mfc_port1_base_vaddr = phys_to_virt(mfc_port1_alloc_paddr);

	if (mfc_port1_base_vaddr == NULL) {
		mfc_err("fail to mapping port1 buffer\n");
		ret = -EPERM;
		goto err_vaddr_map;
	}

	mfc_set_port1_buff_paddr(mfc_port1_alloc_paddr);

	mfc_debug("mfc_port0_base_paddr = 0x%08x, mfc_port1_base_paddr = 0x%08x <<\n",
		(unsigned int)mfc_port0_base_paddr, (unsigned int)mfc_port1_base_paddr);
	mfc_debug("mfc_port0_base_vaddr = 0x%08x, mfc_port1_base_vaddr = 0x%08x <<\n",
		(unsigned int)mfc_port0_base_vaddr, (unsigned int)mfc_port1_base_vaddr);
	mfc_debug("mfc_port1_alloc_paddr = 0x%08x <<\n", (unsigned int)mfc_port1_alloc_paddr);

	/* Get mfc power domain regulator */
	mfc_pd_regulator = regulator_get(&pdev->dev, "pd");
	if (IS_ERR(mfc_pd_regulator)) {
		mfc_err("failed to find mfc power domain\n");
		ret = PTR_ERR(mfc_pd_regulator);
		goto err_regulator_get;
	}

	mfc_sclk = clk_get(&pdev->dev, "sclk_mfc");
	if (IS_ERR(mfc_sclk)) {
		mfc_err("failed to find mfc clock source\n");
		ret = PTR_ERR(mfc_sclk);
		goto err_clk_get;
	}

	mfc_init_mem_inst_no();
	mfc_init_buffer();

	ret = misc_register(&mfc_miscdev);
	if (ret) {
		mfc_err("MFC can't misc register on minor\n");
		goto err_misc_reg;
	}

	/*
	 * MFC FW downloading
	 */
	ret = request_firmware_nowait(THIS_MODULE,
				      FW_ACTION_HOTPLUG,
				      MFC_FW_NAME,
				      &pdev->dev,
				      GFP_KERNEL,
				      pdev,
				      mfc_firmware_request_complete_handler);
	if (ret) {
		mfc_err("MFCINST_ERR_FW_INIT_FAIL\n");
		ret = -EPERM;
		goto err_req_fw;
	}

	return 0;

err_req_fw:
	misc_deregister(&mfc_miscdev);
err_misc_reg:
	clk_put(mfc_sclk);
err_clk_get:
	regulator_put(mfc_pd_regulator);
err_regulator_get:
err_vaddr_map:
	free_irq(res->start, pdev);
	mutex_destroy(&mfc_mutex);
err_irq_req:
err_irq_res:
	iounmap(mfc_sfr_base_vaddr);
err_mem_map:
	release_mem_region(mfc_mem, size);
err_mem_req:
probe_out:
	dev_err(&pdev->dev, "not found (%d).\n", ret);
	return ret;
}
开发者ID:ferow2k,项目名称:NeatKernel_captivate,代码行数:101,代码来源:mfc.c


示例20: p54p_probe

static int p54p_probe(struct pci_dev *pdev,
				const struct pci_device_id *id)
{
	struct p54p_priv *priv;
	struct ieee80211_hw *dev;
	unsigned long mem_addr, mem_len;
	int err;

	pci_dev_get(pdev);
	err = pci_enable_device(pdev);
	if (err) {
		dev_err(&pdev->dev, "Cannot enable new PCI device\n");
		return err;
	}

	mem_addr = pci_resource_start(pdev, 0);
	mem_len = pci_resource_len(pdev, 0);
	if (mem_len < sizeof(struct p54p_csr)) {
		dev_err(&pdev->dev, "Too short PCI resources\n");
		err = -ENODEV;
		goto err_disable_dev;
	}

	err = pci_request_regions(pdev, "p54pci");
	if (err) {
		dev_err(&pdev->dev, "Cannot obtain PCI resources\n");
		goto err_disable_dev;
	}

	err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
	if (!err)
		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
	if (err) {
		dev_err(&pdev->dev, "No suitable DMA available\n");
		goto err_free_reg;
	}

	pci_set_master(pdev);
	pci_try_set_mwi(pdev);

	pci_write_config_byte(pdev, 0x40, 0);
	pci_write_config_byte(pdev, 0x41, 0);

	dev = p54_init_common(sizeof(*priv));
	if (!dev) {
		dev_err(&pdev->dev, "ieee80211 alloc failed\n");
		err = -ENOMEM;
		goto err_free_reg;
	}

	priv = dev->priv;
	priv->pdev = pdev;

	init_completion(&priv->fw_loaded);
	SET_IEEE80211_DEV(dev, &pdev->dev);
	pci_set_drvdata(pdev, dev);

	priv->map = ioremap(mem_addr, mem_len);
	if (!priv->map) {
		dev_err(&pdev->dev, "Cannot map device memory\n");
		err = -ENOMEM;
		goto err_free_dev;
	}

	priv->ring_control = pci_alloc_consistent(pdev, sizeof(*priv->ring_control),
						  &priv->ring_control_dma);
	if (!priv->ring_control) {
		dev_err(&pdev->dev, "Cannot allocate rings\n");
		err = -ENOMEM;
		goto err_iounmap;
	}
	priv->common.open = p54p_open;
	priv->common.stop = p54p_stop;
	priv->common.tx = p54p_tx;

	spin_lock_init(&priv->lock);
	tasklet_init(&priv->tasklet, p54p_tasklet, (unsigned long)dev);

	err = request_firmware_nowait(THIS_MODULE, 1, "isl3886pci",
				      &priv->pdev->dev, GFP_KERNEL,
				      priv, p54p_firmware_step2);
	if (!err)
		return 0;

	pci_free_consistent(pdev, sizeof(*priv->ring_control),
			    priv->ring_control, priv->ring_control_dma);

 err_iounmap:
	iounmap(priv->map);

 err_free_dev:
	p54_free_common(dev);

 err_free_reg:
	pci_release_regions(pdev);
 err_disable_dev:
	pci_disable_device(pdev);
	pci_dev_put(pdev);
	return err;
}
开发者ID:383530895,项目名称:linux,代码行数:100,代码来源:p54pci.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ request_free函数代码示例发布时间:2022-05-30
下一篇:
C++ request_firmware函数代码示例发布时间: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