Commit b13b3cdf authored by Kalle Valo's avatar Kalle Valo
Browse files

Merge tag 'iwlwifi-next-for-kalle-2017-11-03' of...

Merge tag 'iwlwifi-next-for-kalle-2017-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

iwlwifi updates

* Some new PCI IDs;
* A bunch of cleanups;
* The timers update by Kees;
* Add more register dump call-sites;
* A fix for a locking issue in the TX flush code;
* Actual implementation of the TX flush code for A000;
* An optimization to drop RX frames during restart to avoid BA issues;
parents 2798b80b 57b36f7f
Loading
Loading
Loading
Loading
+0 −51
Original line number Diff line number Diff line
@@ -100,14 +100,6 @@
#define NVM_HW_SECTION_NUM_FAMILY_8000		10
#define DEFAULT_NVM_FILE_FAMILY_8000C		"nvmData-8000C"

/* Max SDIO RX/TX aggregation sizes of the ADDBA request/response */
#define MAX_RX_AGG_SIZE_8260_SDIO	21
#define MAX_TX_AGG_SIZE_8260_SDIO	40

/* Max A-MPDU exponent for HT and VHT */
#define MAX_HT_AMPDU_EXPONENT_8260_SDIO	IEEE80211_HT_MAX_AMPDU_32K
#define MAX_VHT_AMPDU_EXPONENT_8260_SDIO	IEEE80211_VHT_MAX_AMPDU_32K

static const struct iwl_base_params iwl8000_base_params = {
	.eeprom_size = OTP_LOW_IMAGE_SIZE_FAMILY_8000,
	.num_of_queues = 31,
@@ -234,48 +226,5 @@ const struct iwl_cfg iwl4165_2ac_cfg = {
	.max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K,
};

const struct iwl_cfg iwl8260_2ac_sdio_cfg = {
	.name = "Intel(R) Dual Band Wireless-AC 8260",
	.fw_name_pre = IWL8000_FW_PRE,
	IWL_DEVICE_8260,
	.ht_params = &iwl8000_ht_params,
	.nvm_ver = IWL8000_NVM_VERSION,
	.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
	.max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
	.max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
	.disable_dummy_notification = true,
	.max_ht_ampdu_exponent  = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
	.max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
};

const struct iwl_cfg iwl8265_2ac_sdio_cfg = {
	.name = "Intel(R) Dual Band Wireless-AC 8265",
	.fw_name_pre = IWL8265_FW_PRE,
	IWL_DEVICE_8265,
	.ht_params = &iwl8000_ht_params,
	.nvm_ver = IWL8000_NVM_VERSION,
	.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
	.max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
	.max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
	.disable_dummy_notification = true,
	.max_ht_ampdu_exponent  = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
	.max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
};

const struct iwl_cfg iwl4165_2ac_sdio_cfg = {
	.name = "Intel(R) Dual Band Wireless-AC 4165",
	.fw_name_pre = IWL8000_FW_PRE,
	IWL_DEVICE_8000,
	.ht_params = &iwl8000_ht_params,
	.nvm_ver = IWL8000_NVM_VERSION,
	.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
	.max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
	.max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO,
	.bt_shared_single_ant = true,
	.disable_dummy_notification = true,
	.max_ht_ampdu_exponent  = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
	.max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO,
};

MODULE_FIRMWARE(IWL8000_MODULE_FIRMWARE(IWL8000_UCODE_API_MAX));
MODULE_FIRMWARE(IWL8265_MODULE_FIRMWARE(IWL8265_UCODE_API_MAX));
+0 −24
Original line number Diff line number Diff line
@@ -81,28 +81,4 @@ struct iwl_fw_paging_cmd {
	__le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */

/**
 * enum iwl_fw_item_id - FW item IDs
 *
 * @IWL_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
 *	download
 */
enum iwl_fw_item_id {
	IWL_FW_ITEM_ID_PAGING = 3,
};

/**
 * struct iwl_fw_get_item_cmd - get an item from the fw
 * @item_id: ID of item to obtain, see &enum iwl_fw_item_id
 */
struct iwl_fw_get_item_cmd {
	__le32 item_id;
} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */

struct iwl_fw_get_item_resp {
	__le32 item_id;
	__le32 item_byte_cnt;
	__le32 item_val;
} __packed; /* FW_GET_ITEM_RSP_S_VER_1 */

#endif /* __iwl_fw_api_paging_h__ */
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ enum iwl_ucode_tlv_type {
	IWL_UCODE_TLV_N_SCAN_CHANNELS		= 31,
	IWL_UCODE_TLV_PAGING		= 32,
	IWL_UCODE_TLV_SEC_RT_USNIFFER	= 34,
	IWL_UCODE_TLV_SDIO_ADMA_ADDR	= 35,
	/* 35 is unused */
	IWL_UCODE_TLV_FW_VERSION	= 36,
	IWL_UCODE_TLV_FW_DBG_DEST	= 38,
	IWL_UCODE_TLV_FW_DBG_CONF	= 39,
+0 −8
Original line number Diff line number Diff line
@@ -138,11 +138,6 @@ struct fw_img {
	u32 paging_mem_size;
};

struct iwl_sf_region {
	u32 addr;
	u32 size;
};

/*
 * Block paging calculations
 */
@@ -257,7 +252,6 @@ enum iwl_fw_type {
 * @type: firmware type (&enum iwl_fw_type)
 * @cipher_scheme: optional external cipher scheme.
 * @human_readable: human readable version
 * @sdio_adma_addr: the default address to set for the ADMA in SDIO mode until
 *	we get the ALIVE from the uCode
 * @dbg_dest_tlv: points to the destination TLV for debug
 * @dbg_conf_tlv: array of pointers to configuration TLVs for debug
@@ -290,8 +284,6 @@ struct iwl_fw {
	struct iwl_fw_cipher_scheme cs[IWL_UCODE_MAX_CS];
	u8 human_readable[FW_VER_HUMAN_READABLE_SZ];

	u32 sdio_adma_addr;

	struct iwl_fw_dbg_dest_tlv *dbg_dest_tlv;
	struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_CONF_MAX];
	size_t dbg_conf_tlv_len[FW_DBG_CONF_MAX];
+12 −91
Original line number Diff line number Diff line
@@ -87,9 +87,6 @@ void iwl_free_fw_paging(struct iwl_fw_runtime *fwrt)
			     get_order(paging->fw_paging_size));
		paging->fw_paging_block = NULL;
	}
	kfree(fwrt->trans->paging_download_buf);
	fwrt->trans->paging_download_buf = NULL;
	fwrt->trans->paging_db = NULL;

	memset(fwrt->fw_paging_db, 0, sizeof(fwrt->fw_paging_db));
}
@@ -100,13 +97,11 @@ static int iwl_alloc_fw_paging_mem(struct iwl_fw_runtime *fwrt,
{
	struct page *block;
	dma_addr_t phys = 0;
	int blk_idx, order, num_of_pages, size, dma_enabled;
	int blk_idx, order, num_of_pages, size;

	if (fwrt->fw_paging_db[0].fw_paging_block)
		return 0;

	dma_enabled = is_device_dma_capable(fwrt->trans->dev);

	/* ensure BLOCK_2_EXP_SIZE is power of 2 of PAGING_BLOCK_SIZE */
	BUILD_BUG_ON(BIT(BLOCK_2_EXP_SIZE) != PAGING_BLOCK_SIZE);

@@ -139,7 +134,6 @@ static int iwl_alloc_fw_paging_mem(struct iwl_fw_runtime *fwrt,
		fwrt->fw_paging_db[blk_idx].fw_paging_block = block;
		fwrt->fw_paging_db[blk_idx].fw_paging_size = size;

		if (dma_enabled) {
		phys = dma_map_page(fwrt->trans->dev, block, 0,
				    PAGE_SIZE << order,
				    DMA_BIDIRECTIONAL);
@@ -152,11 +146,6 @@ static int iwl_alloc_fw_paging_mem(struct iwl_fw_runtime *fwrt,
			return -ENOMEM;
		}
		fwrt->fw_paging_db[blk_idx].fw_paging_phys = phys;
		} else {
			fwrt->fw_paging_db[blk_idx].fw_paging_phys =
				PAGING_ADDR_SIG |
				blk_idx << BLOCK_2_EXP_SIZE;
		}

		if (!blk_idx)
			IWL_DEBUG_FW(fwrt,
@@ -312,60 +301,6 @@ static int iwl_send_paging_cmd(struct iwl_fw_runtime *fwrt,
	return iwl_trans_send_cmd(fwrt->trans, &hcmd);
}

/*
 * Send paging item cmd to FW in case CPU2 has paging image
 */
static int iwl_trans_get_paging_item(struct iwl_fw_runtime *fwrt)
{
	int ret;
	struct iwl_fw_get_item_cmd fw_get_item_cmd = {
		.item_id = cpu_to_le32(IWL_FW_ITEM_ID_PAGING),
	};
	struct iwl_fw_get_item_resp *item_resp;
	struct iwl_host_cmd cmd = {
		.id = iwl_cmd_id(FW_GET_ITEM_CMD, IWL_ALWAYS_LONG_GROUP, 0),
		.flags = CMD_WANT_SKB | CMD_SEND_IN_RFKILL,
		.data = { &fw_get_item_cmd, },
		.len = { sizeof(fw_get_item_cmd), },
	};

	ret = iwl_trans_send_cmd(fwrt->trans, &cmd);
	if (ret) {
		IWL_ERR(fwrt,
			"Paging: Failed to send FW_GET_ITEM_CMD cmd (err = %d)\n",
			ret);
		return ret;
	}

	item_resp = (void *)((struct iwl_rx_packet *)cmd.resp_pkt)->data;
	if (item_resp->item_id != cpu_to_le32(IWL_FW_ITEM_ID_PAGING)) {
		IWL_ERR(fwrt,
			"Paging: got wrong item in FW_GET_ITEM_CMD resp (item_id = %u)\n",
			le32_to_cpu(item_resp->item_id));
		ret = -EIO;
		goto exit;
	}

	/* Add an extra page for headers */
	fwrt->trans->paging_download_buf = kzalloc(PAGING_BLOCK_SIZE +
						  FW_PAGING_SIZE,
						  GFP_KERNEL);
	if (!fwrt->trans->paging_download_buf) {
		ret = -ENOMEM;
		goto exit;
	}
	fwrt->trans->paging_req_addr = le32_to_cpu(item_resp->item_val);
	fwrt->trans->paging_db = fwrt->fw_paging_db;
	IWL_DEBUG_FW(fwrt,
		     "Paging: got paging request address (paging_req_addr 0x%08x)\n",
		     fwrt->trans->paging_req_addr);

exit:
	iwl_free_resp(&cmd);

	return ret;
}

int iwl_init_paging(struct iwl_fw_runtime *fwrt, enum iwl_ucode_type type)
{
	const struct fw_img *fw = &fwrt->fw->img[type];
@@ -382,20 +317,6 @@ int iwl_init_paging(struct iwl_fw_runtime *fwrt, enum iwl_ucode_type type)
	if (!fw->paging_mem_size)
		return 0;

	/*
	 * When dma is not enabled, the driver needs to copy / write
	 * the downloaded / uploaded page to / from the smem.
	 * This gets the location of the place were the pages are
	 * stored.
	 */
	if (!is_device_dma_capable(fwrt->trans->dev)) {
		ret = iwl_trans_get_paging_item(fwrt);
		if (ret) {
			IWL_ERR(fwrt, "failed to get FW paging item\n");
			return ret;
		}
	}

	ret = iwl_save_fw_paging(fwrt, fw);
	if (ret) {
		IWL_ERR(fwrt, "failed to save the FW paging image\n");
Loading