Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5a87625 authored by John W. Linville's avatar John W. Linville
Browse files
parents 9b4e9e75 83f84d7b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)
static int iwl_verify_sec_sparse(struct iwl_priv *priv,
				  const struct fw_desc *fw_desc)
{
	__le32 *image = (__le32 *)fw_desc->v_addr;
	__le32 *image = (__le32 *)fw_desc->data;
	u32 len = fw_desc->len;
	u32 val;
	u32 i;
@@ -319,7 +319,7 @@ static int iwl_verify_sec_sparse(struct iwl_priv *priv,
static void iwl_print_mismatch_sec(struct iwl_priv *priv,
				    const struct fw_desc *fw_desc)
{
	__le32 *image = (__le32 *)fw_desc->v_addr;
	__le32 *image = (__le32 *)fw_desc->data;
	u32 len = fw_desc->len;
	u32 val;
	u32 offs;
+14 −12
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include <linux/vmalloc.h>

#include "iwl-drv.h"
#include "iwl-debug.h"
@@ -164,10 +165,8 @@ struct fw_sec {

static void iwl_free_fw_desc(struct iwl_drv *drv, struct fw_desc *desc)
{
	if (desc->v_addr)
		dma_free_coherent(drv->trans->dev, desc->len,
				  desc->v_addr, desc->p_addr);
	desc->v_addr = NULL;
	vfree(desc->data);
	desc->data = NULL;
	desc->len = 0;
}

@@ -188,19 +187,22 @@ static void iwl_dealloc_ucode(struct iwl_drv *drv)
static int iwl_alloc_fw_desc(struct iwl_drv *drv, struct fw_desc *desc,
			     struct fw_sec *sec)
{
	if (!sec || !sec->size) {
		desc->v_addr = NULL;
	void *data;

	desc->data = NULL;

	if (!sec || !sec->size)
		return -EINVAL;
	}

	desc->v_addr = dma_alloc_coherent(drv->trans->dev, sec->size,
					  &desc->p_addr, GFP_KERNEL);
	if (!desc->v_addr)
	data = vmalloc(sec->size);
	if (!data)
		return -ENOMEM;

	desc->len = sec->size;
	desc->offset = sec->offset;
	memcpy(desc->v_addr, sec->data, sec->size);
	memcpy(data, sec->data, desc->len);
	desc->data = data;

	return 0;
}

+1 −2
Original line number Diff line number Diff line
@@ -124,8 +124,7 @@ struct iwl_ucode_capabilities {

/* one for each uCode image (inst/data, init/runtime/wowlan) */
struct fw_desc {
	dma_addr_t p_addr;	/* hardware address */
	void *v_addr;		/* software address */
	const void *data;	/* vmalloc'ed data */
	u32 len;		/* size in bytes */
	u32 offset;		/* offset in the device */
};
+0 −13
Original line number Diff line number Diff line
@@ -263,8 +263,6 @@ MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
/* PCI registers */
#define PCI_CFG_RETRY_TIMEOUT	0x041

#ifndef CONFIG_IWLWIFI_IDI

static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
	const struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
@@ -307,8 +305,6 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
	pci_set_drvdata(pdev, NULL);
}

#endif /* CONFIG_IWLWIFI_IDI */

#ifdef CONFIG_PM_SLEEP

static int iwl_pci_suspend(struct device *device)
@@ -353,15 +349,6 @@ static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume);

#endif

#ifdef CONFIG_IWLWIFI_IDI
/*
 * Defined externally in iwl-idi.c
 */
int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
void __devexit iwl_pci_remove(struct pci_dev *pdev);

#endif /* CONFIG_IWLWIFI_IDI */

static struct pci_driver iwl_pci_driver = {
	.name = DRV_NAME,
	.id_table = iwl_hw_card_ids,
+1 −1
Original line number Diff line number Diff line
@@ -311,7 +311,7 @@ void iwl_trans_pcie_free(struct iwl_trans *trans);
******************************************************/
void iwl_bg_rx_replenish(struct work_struct *data);
void iwl_irq_tasklet(struct iwl_trans *trans);
void iwlagn_rx_replenish(struct iwl_trans *trans);
void iwl_rx_replenish(struct iwl_trans *trans);
void iwl_rx_queue_update_write_ptr(struct iwl_trans *trans,
				   struct iwl_rx_queue *q);

Loading