Module Name: src
Committed By: nonaka
Date: Tue Mar 14 23:59:26 UTC 2017
Modified Files:
src/distrib/sets/lists/base: mi
src/external/intel-fw-public: Makefile
src/external/intel-fw-public/iwl3160: Makefile
src/external/intel-fw-public/iwl7260: Makefile
src/external/intel-fw-public/iwl7265: Makefile
src/external/intel-fw-public/iwl8000: Makefile
src/sys/dev/pci: if_iwm.c if_iwmreg.h if_iwmvar.h
Added Files:
src/external/intel-fw-public/iwl3160/dist: iwlwifi-3160-17.ucode
src/external/intel-fw-public/iwl3168: Makefile
src/external/intel-fw-public/iwl3168/dist: LICENSE.iwlwifi-3168-ucode
README.iwlwifi-3168-ucode iwlwifi-3168-22.ucode
src/external/intel-fw-public/iwl7260/dist: iwlwifi-7260-17.ucode
src/external/intel-fw-public/iwl7265/dist: iwlwifi-7265-17.ucode
iwlwifi-7265D-22.ucode
src/external/intel-fw-public/iwl8000/dist: iwlwifi-8000C-22.ucode
src/external/intel-fw-public/iwl8265: Makefile
src/external/intel-fw-public/iwl8265/dist: LICENSE.iwlwifi-8265-ucode
README.iwlwifi-8265-ucode iwlwifi-8265-22.ucode
Removed Files:
src/external/intel-fw-public/iwl3160/dist: iwlwifi-3160-16.ucode
src/external/intel-fw-public/iwl7260/dist: iwlwifi-7260-16.ucode
src/external/intel-fw-public/iwl7265/dist: iwlwifi-7265-16.ucode
iwlwifi-7265D-17.ucode
src/external/intel-fw-public/iwl8000/dist: iwlwifi-8000C-16.ucode
Log Message:
iwm(4): update firmware to maintained core release.
firmware from
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git/tree/?id=4b9559fb0565f582a21a4070a81a3b6a7d77610b
To generate a diff of this commit:
cvs rdiff -u -r1.1155 -r1.1156 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.10 -r1.11 src/external/intel-fw-public/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/intel-fw-public/iwl3160/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/intel-fw-public/iwl3160/dist/iwlwifi-3160-16.ucode
cvs rdiff -u -r0 -r1.1 \
src/external/intel-fw-public/iwl3160/dist/iwlwifi-3160-17.ucode
cvs rdiff -u -r0 -r1.1 src/external/intel-fw-public/iwl3168/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/intel-fw-public/iwl3168/dist/LICENSE.iwlwifi-3168-ucode \
src/external/intel-fw-public/iwl3168/dist/README.iwlwifi-3168-ucode \
src/external/intel-fw-public/iwl3168/dist/iwlwifi-3168-22.ucode
cvs rdiff -u -r1.3 -r1.4 src/external/intel-fw-public/iwl7260/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/intel-fw-public/iwl7260/dist/iwlwifi-7260-16.ucode
cvs rdiff -u -r0 -r1.1 \
src/external/intel-fw-public/iwl7260/dist/iwlwifi-7260-17.ucode
cvs rdiff -u -r1.4 -r1.5 src/external/intel-fw-public/iwl7265/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/intel-fw-public/iwl7265/dist/iwlwifi-7265-16.ucode \
src/external/intel-fw-public/iwl7265/dist/iwlwifi-7265D-17.ucode
cvs rdiff -u -r0 -r1.1 \
src/external/intel-fw-public/iwl7265/dist/iwlwifi-7265-17.ucode \
src/external/intel-fw-public/iwl7265/dist/iwlwifi-7265D-22.ucode
cvs rdiff -u -r1.1 -r1.2 src/external/intel-fw-public/iwl8000/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/intel-fw-public/iwl8000/dist/iwlwifi-8000C-16.ucode
cvs rdiff -u -r0 -r1.1 \
src/external/intel-fw-public/iwl8000/dist/iwlwifi-8000C-22.ucode
cvs rdiff -u -r0 -r1.1 src/external/intel-fw-public/iwl8265/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/intel-fw-public/iwl8265/dist/LICENSE.iwlwifi-8265-ucode \
src/external/intel-fw-public/iwl8265/dist/README.iwlwifi-8265-ucode \
src/external/intel-fw-public/iwl8265/dist/iwlwifi-8265-22.ucode
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/pci/if_iwm.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_iwmreg.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/pci/if_iwmvar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1155 src/distrib/sets/lists/base/mi:1.1156
--- src/distrib/sets/lists/base/mi:1.1155 Wed Mar 1 03:02:48 2017
+++ src/distrib/sets/lists/base/mi Tue Mar 14 23:59:24 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1155 2017/03/01 03:02:48 kre Exp $
+# $NetBSD: mi,v 1.1156 2017/03/14 23:59:24 nonaka Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -150,22 +150,33 @@
./libdata/firmware/if_iwi/ipw2200-sniffer.fw base-firmware-root
./libdata/firmware/if_iwm base-firmware-root
./libdata/firmware/if_iwm/LICENSE.iwlwifi-3160-ucode base-firmware-root
+./libdata/firmware/if_iwm/LICENSE.iwlwifi-3168-ucode base-firmware-root
./libdata/firmware/if_iwm/LICENSE.iwlwifi-7260-ucode base-firmware-root
./libdata/firmware/if_iwm/LICENSE.iwlwifi-7265-ucode base-firmware-root
./libdata/firmware/if_iwm/LICENSE.iwlwifi-8000-ucode base-firmware-root
+./libdata/firmware/if_iwm/LICENSE.iwlwifi-8265-ucode base-firmware-root
./libdata/firmware/if_iwm/README.iwlwifi-3160-ucode base-firmware-root
+./libdata/firmware/if_iwm/README.iwlwifi-3168-ucode base-firmware-root
./libdata/firmware/if_iwm/README.iwlwifi-7260-ucode base-firmware-root
./libdata/firmware/if_iwm/README.iwlwifi-7265-ucode base-firmware-root
./libdata/firmware/if_iwm/README.iwlwifi-8000-ucode base-firmware-root
-./libdata/firmware/if_iwm/iwlwifi-3160-16.ucode base-firmware-root
+./libdata/firmware/if_iwm/README.iwlwifi-8265-ucode base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-3160-16.ucode base-obsolete obsolete
+./libdata/firmware/if_iwm/iwlwifi-3160-17.ucode base-firmware-root
./libdata/firmware/if_iwm/iwlwifi-3160-9.ucode base-obsolete obsolete
-./libdata/firmware/if_iwm/iwlwifi-7260-16.ucode base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-3168-22.ucode base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-7260-16.ucode base-obsolete obsolete
+./libdata/firmware/if_iwm/iwlwifi-7260-17.ucode base-firmware-root
./libdata/firmware/if_iwm/iwlwifi-7260-9.ucode base-obsolete obsolete
-./libdata/firmware/if_iwm/iwlwifi-7265-16.ucode base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-7265-16.ucode base-obsolete obsolete
+./libdata/firmware/if_iwm/iwlwifi-7265-17.ucode base-firmware-root
./libdata/firmware/if_iwm/iwlwifi-7265-9.ucode base-obsolete obsolete
./libdata/firmware/if_iwm/iwlwifi-7265D-16.ucode base-obsolete obsolete
-./libdata/firmware/if_iwm/iwlwifi-7265D-17.ucode base-firmware-root
-./libdata/firmware/if_iwm/iwlwifi-8000C-16.ucode base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-7265D-17.ucode base-obsolete obsolete
+./libdata/firmware/if_iwm/iwlwifi-7265D-22.ucode base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-8000C-16.ucode base-obsolete obsolete
+./libdata/firmware/if_iwm/iwlwifi-8000C-22.ucode base-firmware-root
+./libdata/firmware/if_iwm/iwlwifi-8265-22.ucode base-firmware-root
./libdata/firmware/if_iwn base-firmware-root
./libdata/firmware/if_iwn/LICENSE.iwlwifi-100-ucode base-firmware-root
./libdata/firmware/if_iwn/LICENSE.iwlwifi-1000-ucode base-firmware-root
Index: src/external/intel-fw-public/Makefile
diff -u src/external/intel-fw-public/Makefile:1.10 src/external/intel-fw-public/Makefile:1.11
--- src/external/intel-fw-public/Makefile:1.10 Sun Dec 18 02:18:29 2016
+++ src/external/intel-fw-public/Makefile Tue Mar 14 23:59:24 2017
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.10 2016/12/18 02:18:29 nonaka Exp $
+# $NetBSD: Makefile,v 1.11 2017/03/14 23:59:24 nonaka Exp $
-SUBDIR+= ipw3945 iwl100 iwl105 iwl135 iwl1000 iwl2000 iwl2030 iwl3160 \
+SUBDIR+= ipw3945 iwl100 iwl105 iwl135 iwl1000 iwl2000 iwl2030 \
+ iwl3160 iwl3168 \
iwl4965 iwl5000 iwl5150 iwl6000 iwl6005 iwl6030 iwl6050 \
- iwl7260 iwl7265 iwl8000
+ iwl7260 iwl7265 iwl8000 iwl8265
.include <bsd.subdir.mk>
Index: src/external/intel-fw-public/iwl3160/Makefile
diff -u src/external/intel-fw-public/iwl3160/Makefile:1.3 src/external/intel-fw-public/iwl3160/Makefile:1.4
--- src/external/intel-fw-public/iwl3160/Makefile:1.3 Sun Dec 18 17:57:38 2016
+++ src/external/intel-fw-public/iwl3160/Makefile Tue Mar 14 23:59:25 2017
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2016/12/18 17:57:38 christos Exp $
+# $NetBSD: Makefile,v 1.4 2017/03/14 23:59:25 nonaka Exp $
NOMAN= # define
FILES= dist/LICENSE.iwlwifi-3160-ucode dist/README.iwlwifi-3160-ucode \
- dist/iwlwifi-3160-16.ucode
+ dist/iwlwifi-3160-17.ucode
FILESDIR= /libdata/firmware/if_iwm
Index: src/external/intel-fw-public/iwl7260/Makefile
diff -u src/external/intel-fw-public/iwl7260/Makefile:1.3 src/external/intel-fw-public/iwl7260/Makefile:1.4
--- src/external/intel-fw-public/iwl7260/Makefile:1.3 Sun Dec 18 17:57:38 2016
+++ src/external/intel-fw-public/iwl7260/Makefile Tue Mar 14 23:59:25 2017
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.3 2016/12/18 17:57:38 christos Exp $
+# $NetBSD: Makefile,v 1.4 2017/03/14 23:59:25 nonaka Exp $
NOMAN= # define
FILES= dist/LICENSE.iwlwifi-7260-ucode dist/README.iwlwifi-7260-ucode \
- dist/iwlwifi-7260-16.ucode
+ dist/iwlwifi-7260-17.ucode
FILESDIR= /libdata/firmware/if_iwm
Index: src/external/intel-fw-public/iwl7265/Makefile
diff -u src/external/intel-fw-public/iwl7265/Makefile:1.4 src/external/intel-fw-public/iwl7265/Makefile:1.5
--- src/external/intel-fw-public/iwl7265/Makefile:1.4 Fri Jan 13 11:21:47 2017
+++ src/external/intel-fw-public/iwl7265/Makefile Tue Mar 14 23:59:25 2017
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.4 2017/01/13 11:21:47 nonaka Exp $
+# $NetBSD: Makefile,v 1.5 2017/03/14 23:59:25 nonaka Exp $
NOMAN= # define
FILES= dist/LICENSE.iwlwifi-7265-ucode dist/README.iwlwifi-7265-ucode \
- dist/iwlwifi-7265-16.ucode dist/iwlwifi-7265D-17.ucode
+ dist/iwlwifi-7265-17.ucode dist/iwlwifi-7265D-22.ucode
FILESDIR= /libdata/firmware/if_iwm
Index: src/external/intel-fw-public/iwl8000/Makefile
diff -u src/external/intel-fw-public/iwl8000/Makefile:1.1 src/external/intel-fw-public/iwl8000/Makefile:1.2
--- src/external/intel-fw-public/iwl8000/Makefile:1.1 Sun Dec 18 02:18:29 2016
+++ src/external/intel-fw-public/iwl8000/Makefile Tue Mar 14 23:59:26 2017
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2016/12/18 02:18:29 nonaka Exp $
+# $NetBSD: Makefile,v 1.2 2017/03/14 23:59:26 nonaka Exp $
NOMAN= # define
FILES= dist/LICENSE.iwlwifi-8000-ucode dist/README.iwlwifi-8000-ucode \
- dist/iwlwifi-8000C-16.ucode
+ dist/iwlwifi-8000C-22.ucode
FILESDIR= /libdata/firmware/if_iwm
Index: src/sys/dev/pci/if_iwm.c
diff -u src/sys/dev/pci/if_iwm.c:1.70 src/sys/dev/pci/if_iwm.c:1.71
--- src/sys/dev/pci/if_iwm.c:1.70 Thu Feb 2 10:05:35 2017
+++ src/sys/dev/pci/if_iwm.c Tue Mar 14 23:59:26 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwm.c,v 1.70 2017/02/02 10:05:35 nonaka Exp $ */
+/* $NetBSD: if_iwm.c,v 1.71 2017/03/14 23:59:26 nonaka Exp $ */
/* OpenBSD: if_iwm.c,v 1.148 2016/11/19 21:07:08 stsp Exp */
#define IEEE80211_NO_HT
/*
@@ -30,9 +30,9 @@
*
* GPL LICENSE SUMMARY
*
- * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved.
+ * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
- * Copyright(c) 2016 Intel Deutschland GmbH
+ * Copyright(c) 2016 Intel Deutschland GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
@@ -52,15 +52,14 @@
* in the file called COPYING.
*
* Contact Information:
- * Intel Linux Wireless <[email protected]>
+ * Intel Linux Wireless <[email protected]>
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*
- *
* BSD LICENSE
*
- * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved.
+ * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
- * Copyright(c) 2016 Intel Deutschland GmbH
+ * Copyright(c) 2016 Intel Deutschland GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -107,7 +106,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.70 2017/02/02 10:05:35 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.71 2017/03/14 23:59:26 nonaka Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -345,6 +344,8 @@ static int iwm_firmware_load_sect(struct
const uint8_t *, uint32_t);
static int iwm_firmware_load_chunk(struct iwm_softc *, uint32_t,
const uint8_t *, uint32_t);
+static int iwm_load_cpu_sections_7000(struct iwm_softc *,
+ struct iwm_fw_sects *, int , int *);
static int iwm_load_firmware_7000(struct iwm_softc *, enum iwm_ucode_type);
static int iwm_load_cpu_sections_8000(struct iwm_softc *,
struct iwm_fw_sects *, int , int *);
@@ -755,6 +756,10 @@ iwm_read_firmware(struct iwm_softc *sc,
err = EINVAL;
goto parse_out;
}
+ if (tlv_len % sizeof(uint32_t)) {
+ err = EINVAL;
+ goto parse_out;
+ }
/*
* Apparently there can be many flags, but Linux driver
* parses only the first one, and so do we.
@@ -780,7 +785,14 @@ iwm_read_firmware(struct iwm_softc *sc,
goto parse_out;
}
num_cpu = le32toh(*(uint32_t *)tlv_data);
- if (num_cpu < 1 || num_cpu > 2) {
+ if (num_cpu == 2) {
+ fw->fw_sects[IWM_UCODE_TYPE_REGULAR].is_dual_cpus =
+ true;
+ fw->fw_sects[IWM_UCODE_TYPE_INIT].is_dual_cpus =
+ true;
+ fw->fw_sects[IWM_UCODE_TYPE_WOW].is_dual_cpus =
+ true;
+ } else if (num_cpu < 1 || num_cpu > 2) {
err = EINVAL;
goto parse_out;
}
@@ -823,35 +835,44 @@ iwm_read_firmware(struct iwm_softc *sc,
case IWM_UCODE_TLV_API_CHANGES_SET: {
struct iwm_ucode_api *api;
+ uint32_t idx, bits;
+ int i;
if (tlv_len != sizeof(*api)) {
err = EINVAL;
goto parse_out;
}
api = (struct iwm_ucode_api *)tlv_data;
- /* Flags may exceed 32 bits in future firmware. */
- if (le32toh(api->api_index) > 0) {
+ idx = le32toh(api->api_index);
+ bits = le32toh(api->api_flags);
+ if (idx >= howmany(IWM_NUM_UCODE_TLV_API, 32)) {
err = EINVAL;
goto parse_out;
}
- sc->sc_ucode_api = le32toh(api->api_flags);
+ for (i = 0; i < 32; i++) {
+ if (!ISSET(bits, __BIT(i)))
+ continue;
+ setbit(sc->sc_ucode_api, i + (32 * idx));
+ }
break;
}
case IWM_UCODE_TLV_ENABLED_CAPABILITIES: {
struct iwm_ucode_capa *capa;
- int idx, i;
+ uint32_t idx, bits;
+ int i;
if (tlv_len != sizeof(*capa)) {
err = EINVAL;
goto parse_out;
}
capa = (struct iwm_ucode_capa *)tlv_data;
idx = le32toh(capa->api_index);
+ bits = le32toh(capa->api_capa);
if (idx >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) {
err = EINVAL;
goto parse_out;
}
for (i = 0; i < 32; i++) {
- if (!ISSET(le32toh(capa->api_capa), __BIT(i)))
+ if (!ISSET(bits, __BIT(i)))
continue;
setbit(sc->sc_enabled_capa, i + (32 * idx));
}
@@ -861,6 +882,7 @@ iwm_read_firmware(struct iwm_softc *sc,
case IWM_UCODE_TLV_FW_UNDOCUMENTED1:
case IWM_UCODE_TLV_SDIO_ADMA_ADDR:
case IWM_UCODE_TLV_FW_GSCAN_CAPA:
+ case IWM_UCODE_TLV_FW_MEM_SEG:
/* ignore, not used by current driver */
break;
@@ -872,6 +894,28 @@ iwm_read_firmware(struct iwm_softc *sc,
goto parse_out;
break;
+ case IWM_UCODE_TLV_PAGING: {
+ uint32_t paging_mem_size;
+ if (tlv_len != sizeof(paging_mem_size)) {
+ err = EINVAL;
+ goto parse_out;
+ }
+ paging_mem_size = le32toh(*(uint32_t *)tlv_data);
+ if (paging_mem_size > IWM_MAX_PAGING_IMAGE_SIZE) {
+ err = EINVAL;
+ goto parse_out;
+ }
+ if (paging_mem_size & (IWM_FW_PAGING_SIZE - 1)) {
+ err = EINVAL;
+ goto parse_out;
+ }
+ fw->fw_sects[IWM_UCODE_TYPE_REGULAR].paging_mem_size =
+ paging_mem_size;
+ fw->fw_sects[IWM_UCODE_TYPE_REGULAR_USNIFFER].paging_mem_size =
+ paging_mem_size;
+ break;
+ }
+
case IWM_UCODE_TLV_N_SCAN_CHANNELS:
if (tlv_len != sizeof(uint32_t)) {
err = EINVAL;
@@ -2791,6 +2835,232 @@ iwm_ampdu_rx_stop(struct ieee80211com *i
#endif
static void
+iwm_free_fw_paging(struct iwm_softc *sc)
+{
+ int i;
+
+ if (sc->fw_paging_db[0].fw_paging_block.vaddr == NULL)
+ return;
+
+ for (i = 0; i < IWM_NUM_OF_FW_PAGING_BLOCKS; i++) {
+ iwm_dma_contig_free(&sc->fw_paging_db[i].fw_paging_block);
+ }
+
+ memset(sc->fw_paging_db, 0, sizeof(sc->fw_paging_db));
+}
+
+static int
+iwm_fill_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *fws)
+{
+ int sec_idx, idx;
+ uint32_t offset = 0;
+
+ /*
+ * find where is the paging image start point:
+ * if CPU2 exist and it's in paging format, then the image looks like:
+ * CPU1 sections (2 or more)
+ * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between CPU1 to CPU2
+ * CPU2 sections (not paged)
+ * PAGING_SEPARATOR_SECTION delimiter - separate between CPU2
+ * non paged to CPU2 paging sec
+ * CPU2 paging CSS
+ * CPU2 paging image (including instruction and data)
+ */
+ for (sec_idx = 0; sec_idx < IWM_UCODE_SECT_MAX; sec_idx++) {
+ if (fws->fw_sect[sec_idx].fws_devoff ==
+ IWM_PAGING_SEPARATOR_SECTION) {
+ sec_idx++;
+ break;
+ }
+ }
+
+ /*
+ * If paging is enabled there should be at least 2 more sections left
+ * (one for CSS and one for Paging data)
+ */
+ if (sec_idx >= __arraycount(fws->fw_sect) - 1) {
+ aprint_verbose_dev(sc->sc_dev,
+ "Paging: Missing CSS and/or paging sections\n");
+ iwm_free_fw_paging(sc);
+ return EINVAL;
+ }
+
+ /* copy the CSS block to the dram */
+ DPRINTF(("%s: Paging: load paging CSS to FW, sec = %d\n", DEVNAME(sc),
+ sec_idx));
+
+ memcpy(sc->fw_paging_db[0].fw_paging_block.vaddr,
+ fws->fw_sect[sec_idx].fws_data, sc->fw_paging_db[0].fw_paging_size);
+
+ DPRINTF(("%s: Paging: copied %d CSS bytes to first block\n",
+ DEVNAME(sc), sc->fw_paging_db[0].fw_paging_size));
+
+ sec_idx++;
+
+ /*
+ * copy the paging blocks to the dram
+ * loop index start from 1 since that CSS block already copied to dram
+ * and CSS index is 0.
+ * loop stop at num_of_paging_blk since that last block is not full.
+ */
+ for (idx = 1; idx < sc->num_of_paging_blk; idx++) {
+ memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr,
+ (const char *)fws->fw_sect[sec_idx].fws_data + offset,
+ sc->fw_paging_db[idx].fw_paging_size);
+
+ DPRINTF(("%s: Paging: copied %d paging bytes to block %d\n",
+ DEVNAME(sc), sc->fw_paging_db[idx].fw_paging_size, idx));
+
+ offset += sc->fw_paging_db[idx].fw_paging_size;
+ }
+
+ /* copy the last paging block */
+ if (sc->num_of_pages_in_last_blk > 0) {
+ memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr,
+ (const char *)fws->fw_sect[sec_idx].fws_data + offset,
+ IWM_FW_PAGING_SIZE * sc->num_of_pages_in_last_blk);
+
+ DPRINTF(("%s: Paging: copied %d pages in the last block %d\n",
+ DEVNAME(sc), sc->num_of_pages_in_last_blk, idx));
+ }
+
+ return 0;
+}
+
+static int
+iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *fws)
+{
+ int blk_idx = 0;
+ int error, num_of_pages;
+ bus_dmamap_t dmap;
+
+ if (sc->fw_paging_db[0].fw_paging_block.vaddr != NULL) {
+ int i;
+ /* Device got reset, and we setup firmware paging again */
+ for (i = 0; i < sc->num_of_paging_blk + 1; i++) {
+ dmap = sc->fw_paging_db[i].fw_paging_block.map;
+ bus_dmamap_sync(sc->sc_dmat, dmap, 0, dmap->dm_mapsize,
+ BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
+ }
+ return 0;
+ }
+
+ /* ensure IWM_BLOCK_2_EXP_SIZE is power of 2 of IWM_PAGING_BLOCK_SIZE */
+ CTASSERT(__BIT(IWM_BLOCK_2_EXP_SIZE) == IWM_PAGING_BLOCK_SIZE);
+
+ num_of_pages = fws->paging_mem_size / IWM_FW_PAGING_SIZE;
+ sc->num_of_paging_blk =
+ howmany(num_of_pages, IWM_NUM_OF_PAGE_PER_GROUP);
+ sc->num_of_pages_in_last_blk = num_of_pages -
+ IWM_NUM_OF_PAGE_PER_GROUP * (sc->num_of_paging_blk - 1);
+
+ DPRINTF(("%s: Paging: allocating mem for %d paging blocks, "
+ "each block holds 8 pages, last block holds %d pages\n",
+ DEVNAME(sc), sc->num_of_paging_blk, sc->num_of_pages_in_last_blk));
+
+ /* allocate block of 4Kbytes for paging CSS */
+ error = iwm_dma_contig_alloc(sc->sc_dmat,
+ &sc->fw_paging_db[blk_idx].fw_paging_block, IWM_FW_PAGING_SIZE,
+ 4096);
+ if (error) {
+ /* free all the previous pages since we failed */
+ iwm_free_fw_paging(sc);
+ return ENOMEM;
+ }
+
+ sc->fw_paging_db[blk_idx].fw_paging_size = IWM_FW_PAGING_SIZE;
+
+ DPRINTF(("%s: Paging: allocated 4K(CSS) bytes for firmware paging.\n",
+ DEVNAME(sc)));
+
+ /*
+ * allocate blocks in dram.
+ * since that CSS allocated in fw_paging_db[0] loop start from index 1
+ */
+ for (blk_idx = 1; blk_idx < sc->num_of_paging_blk + 1; blk_idx++) {
+ /* allocate block of IWM_PAGING_BLOCK_SIZE (32K) */
+ /* XXX Use iwm_dma_contig_alloc for allocating */
+ error = iwm_dma_contig_alloc(sc->sc_dmat,
+ &sc->fw_paging_db[blk_idx].fw_paging_block,
+ IWM_PAGING_BLOCK_SIZE, 4096);
+ if (error) {
+ /* free all the previous pages since we failed */
+ iwm_free_fw_paging(sc);
+ return ENOMEM;
+ }
+
+ sc->fw_paging_db[blk_idx].fw_paging_size =
+ IWM_PAGING_BLOCK_SIZE;
+
+ DPRINTF(("%s: Paging: allocated 32K bytes for firmware "
+ "paging.\n", DEVNAME(sc)));
+ }
+
+ return 0;
+}
+
+static int
+iwm_save_fw_paging(struct iwm_softc *sc, const struct iwm_fw_sects *fws)
+{
+ int err;
+
+ err = iwm_alloc_fw_paging_mem(sc, fws);
+ if (err)
+ return err;
+
+ return iwm_fill_paging_mem(sc, fws);
+}
+
+static bool
+iwm_has_new_tx_api(struct iwm_softc *sc)
+{
+ /* XXX */
+ return false;
+}
+
+/* send paging cmd to FW in case CPU2 has paging image */
+static int
+iwm_send_paging_cmd(struct iwm_softc *sc, const struct iwm_fw_sects *fws)
+{
+ struct iwm_fw_paging_cmd fw_paging_cmd = {
+ .flags = htole32(IWM_PAGING_CMD_IS_SECURED |
+ IWM_PAGING_CMD_IS_ENABLED |
+ (sc->num_of_pages_in_last_blk <<
+ IWM_PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS)),
+ .block_size = htole32(IWM_BLOCK_2_EXP_SIZE),
+ .block_num = htole32(sc->num_of_paging_blk),
+ };
+ size_t size = sizeof(fw_paging_cmd);
+ int blk_idx;
+ bus_dmamap_t dmap;
+
+ if (!iwm_has_new_tx_api(sc))
+ size -= (sizeof(uint64_t) - sizeof(uint32_t)) *
+ IWM_NUM_OF_FW_PAGING_BLOCKS;
+
+ /* loop for for all paging blocks + CSS block */
+ for (blk_idx = 0; blk_idx < sc->num_of_paging_blk + 1; blk_idx++) {
+ bus_addr_t dev_phy_addr =
+ sc->fw_paging_db[blk_idx].fw_paging_block.paddr;
+ if (iwm_has_new_tx_api(sc)) {
+ fw_paging_cmd.device_phy_addr.addr64[blk_idx] =
+ htole64(dev_phy_addr);
+ } else {
+ dev_phy_addr = dev_phy_addr >> IWM_PAGE_2_EXP_SIZE;
+ fw_paging_cmd.device_phy_addr.addr32[blk_idx] =
+ htole32(dev_phy_addr);
+ }
+ dmap = sc->fw_paging_db[blk_idx].fw_paging_block.map,
+ bus_dmamap_sync(sc->sc_dmat, dmap, 0, dmap->dm_mapsize,
+ BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
+ }
+
+ return iwm_send_cmd_pdu(sc,
+ iwm_cmd_id(IWM_FW_PAGING_BLOCK_CMD, IWM_ALWAYS_LONG_GROUP, 0),
+ 0, size, &fw_paging_cmd);
+}
+
+static void
iwm_set_hw_address_8000(struct iwm_softc *sc, struct iwm_nvm_data *data,
const uint16_t *mac_override, const uint16_t *nvm_hw)
{
@@ -3115,30 +3385,87 @@ iwm_firmware_load_chunk(struct iwm_softc
}
static int
-iwm_load_firmware_7000(struct iwm_softc *sc, enum iwm_ucode_type ucode_type)
+iwm_load_cpu_sections_7000(struct iwm_softc *sc, struct iwm_fw_sects *fws,
+ int cpu, int *first_ucode_section)
{
- struct iwm_fw_sects *fws;
- int err, i;
+ int i, err = 0;
+ uint32_t last_read_idx = 0;
void *data;
uint32_t dlen;
uint32_t offset;
- fws = &sc->sc_fw.fw_sects[ucode_type];
- for (i = 0; i < fws->fw_count; i++) {
+ if (cpu == 1) {
+ *first_ucode_section = 0;
+ } else {
+ (*first_ucode_section)++;
+ }
+
+ for (i = *first_ucode_section; i < IWM_UCODE_SECT_MAX; i++) {
+ last_read_idx = i;
data = fws->fw_sect[i].fws_data;
dlen = fws->fw_sect[i].fws_len;
offset = fws->fw_sect[i].fws_devoff;
+
+ /*
+ * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between
+ * CPU1 to CPU2.
+ * PAGING_SEPARATOR_SECTION delimiter - separate between
+ * CPU2 non paged to CPU2 paging sec.
+ */
+ if (!data || offset == IWM_CPU1_CPU2_SEPARATOR_SECTION ||
+ offset == IWM_PAGING_SEPARATOR_SECTION)
+ break;
+
if (dlen > sc->sc_fwdmasegsz) {
err = EFBIG;
} else
err = iwm_firmware_load_sect(sc, offset, data, dlen);
if (err) {
- DPRINTF(("%s: could not load firmware chunk %u of %u\n",
- DEVNAME(sc), i, fws->fw_count));
+ DPRINTF(("%s: could not load firmware chunk %d "
+ "(error %d)\n", DEVNAME(sc), i, err));
return err;
}
}
+ *first_ucode_section = last_read_idx;
+
+ return 0;
+}
+
+static int
+iwm_load_firmware_7000(struct iwm_softc *sc, enum iwm_ucode_type ucode_type)
+{
+ struct iwm_fw_sects *fws;
+ int err = 0;
+ int first_ucode_section;
+
+ fws = &sc->sc_fw.fw_sects[ucode_type];
+
+ DPRINTF(("%s: working with %s CPU\n", DEVNAME(sc),
+ fws->is_dual_cpus ? "dual" : "single"));
+
+ /* load to FW the binary Secured sections of CPU1 */
+ err = iwm_load_cpu_sections_7000(sc, fws, 1, &first_ucode_section);
+ if (err)
+ return err;
+
+ if (fws->is_dual_cpus) {
+ /* set CPU2 header address */
+ if (iwm_nic_lock(sc)) {
+ iwm_write_prph(sc,
+ IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR,
+ IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE);
+ iwm_nic_unlock(sc);
+ }
+
+ /* load to FW the binary sections of CPU2 */
+ err = iwm_load_cpu_sections_7000(sc, fws, 2,
+ &first_ucode_section);
+ if (err)
+ return err;
+ }
+
+ /* release CPU reset */
IWM_WRITE(sc, IWM_CSR_RESET, 0);
return 0;
@@ -3336,6 +3663,7 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *s
static int
iwm_load_ucode_wait_alive(struct iwm_softc *sc, enum iwm_ucode_type ucode_type)
{
+ struct iwm_fw_sects *fws;
enum iwm_ucode_type old_type = sc->sc_uc_current;
int err;
@@ -3350,7 +3678,24 @@ iwm_load_ucode_wait_alive(struct iwm_sof
return err;
}
- return iwm_post_alive(sc);
+ err = iwm_post_alive(sc);
+ if (err)
+ return err;
+
+ fws = &sc->sc_fw.fw_sects[ucode_type];
+ if (fws->paging_mem_size) {
+ err = iwm_save_fw_paging(sc, fws);
+ if (err)
+ return err;
+
+ err = iwm_send_paging_cmd(sc, fws);
+ if (err) {
+ iwm_free_fw_paging(sc);
+ return err;
+ }
+ }
+
+ return 0;
}
static int
@@ -6234,7 +6579,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc
memset(&mcc_cmd, 0, sizeof(mcc_cmd));
mcc_cmd.mcc = htole16(alpha2[0] << 8 | alpha2[1]);
- if ((sc->sc_ucode_api & IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) ||
+ if (isset(sc->sc_ucode_api, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) ||
isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC))
mcc_cmd.source_id = IWM_MCC_SOURCE_GET_CURRENT;
else
@@ -7112,6 +7457,7 @@ iwm_notif_intr(struct iwm_softc *sc)
case IWM_REMOVE_STA:
case IWM_TXPATH_FLUSH:
case IWM_LQ_CMD:
+ case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_FW_PAGING_BLOCK_CMD):
case IWM_BT_CONFIG:
case IWM_REPLY_THERMAL_MNG_BACKOFF:
SYNC_RESP_STRUCT(cresp, pkt);
@@ -7181,6 +7527,9 @@ iwm_notif_intr(struct iwm_softc *sc)
break;
}
+ case IWM_DEBUG_LOG_MSG:
+ break;
+
case IWM_MCAST_FILTER_CMD:
break;
@@ -7541,7 +7890,7 @@ iwm_attach(device_t parent, device_t sel
switch (PCI_PRODUCT(sc->sc_pciid)) {
case PCI_PRODUCT_INTEL_WIFI_LINK_3160_1:
case PCI_PRODUCT_INTEL_WIFI_LINK_3160_2:
- sc->sc_fwname = "iwlwifi-3160-16.ucode";
+ sc->sc_fwname = "iwlwifi-3160-17.ucode";
sc->host_interrupt_operation_mode = 1;
sc->apmg_wake_up_wa = 1;
sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
@@ -7549,7 +7898,14 @@ iwm_attach(device_t parent, device_t sel
break;
case PCI_PRODUCT_INTEL_WIFI_LINK_3165_1:
case PCI_PRODUCT_INTEL_WIFI_LINK_3165_2:
- sc->sc_fwname = "iwlwifi-7265D-17.ucode";
+ sc->sc_fwname = "iwlwifi-7265D-22.ucode";
+ sc->host_interrupt_operation_mode = 0;
+ sc->apmg_wake_up_wa = 1;
+ sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
+ sc->sc_fwdmasegsz = IWM_FWDMASEGSZ;
+ break;
+ case PCI_PRODUCT_INTEL_WIFI_LINK_3168:
+ sc->sc_fwname = "iwlwifi-3168-22.ucode";
sc->host_interrupt_operation_mode = 0;
sc->apmg_wake_up_wa = 1;
sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
@@ -7557,7 +7913,7 @@ iwm_attach(device_t parent, device_t sel
break;
case PCI_PRODUCT_INTEL_WIFI_LINK_7260_1:
case PCI_PRODUCT_INTEL_WIFI_LINK_7260_2:
- sc->sc_fwname = "iwlwifi-7260-16.ucode";
+ sc->sc_fwname = "iwlwifi-7260-17.ucode";
sc->host_interrupt_operation_mode = 1;
sc->apmg_wake_up_wa = 1;
sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
@@ -7567,7 +7923,7 @@ iwm_attach(device_t parent, device_t sel
case PCI_PRODUCT_INTEL_WIFI_LINK_7265_2:
sc->sc_fwname = (sc->sc_hw_rev & IWM_CSR_HW_REV_TYPE_MSK) ==
IWM_CSR_HW_REV_TYPE_7265D ?
- "iwlwifi-7265D-17.ucode": "iwlwifi-7265-16.ucode";
+ "iwlwifi-7265D-22.ucode": "iwlwifi-7265-17.ucode";
sc->host_interrupt_operation_mode = 0;
sc->apmg_wake_up_wa = 1;
sc->sc_device_family = IWM_DEVICE_FAMILY_7000;
@@ -7577,7 +7933,14 @@ iwm_attach(device_t parent, device_t sel
case PCI_PRODUCT_INTEL_WIFI_LINK_8260_2:
case PCI_PRODUCT_INTEL_WIFI_LINK_4165_1:
case PCI_PRODUCT_INTEL_WIFI_LINK_4165_2:
- sc->sc_fwname = "iwlwifi-8000C-16.ucode";
+ sc->sc_fwname = "iwlwifi-8000C-22.ucode";
+ sc->host_interrupt_operation_mode = 0;
+ sc->apmg_wake_up_wa = 0;
+ sc->sc_device_family = IWM_DEVICE_FAMILY_8000;
+ sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000;
+ break;
+ case PCI_PRODUCT_INTEL_WIFI_LINK_8265:
+ sc->sc_fwname = "iwlwifi-8265-22.ucode";
sc->host_interrupt_operation_mode = 0;
sc->apmg_wake_up_wa = 0;
sc->sc_device_family = IWM_DEVICE_FAMILY_8000;
Index: src/sys/dev/pci/if_iwmreg.h
diff -u src/sys/dev/pci/if_iwmreg.h:1.5 src/sys/dev/pci/if_iwmreg.h:1.6
--- src/sys/dev/pci/if_iwmreg.h:1.5 Fri Jan 13 11:21:47 2017
+++ src/sys/dev/pci/if_iwmreg.h Tue Mar 14 23:59:26 2017
@@ -1,14 +1,20 @@
-/* $NetBSD: if_iwmreg.h,v 1.5 2017/01/13 11:21:47 nonaka Exp $ */
+/* $NetBSD: if_iwmreg.h,v 1.6 2017/03/14 23:59:26 nonaka Exp $ */
/* OpenBSD: if_iwmreg.h,v 1.19 2016/09/20 11:46:09 stsp Exp */
-/******************************************************************************
+/*-
+ * Based on BSD-licensed source modules in the Linux iwlwifi driver,
+ * which were used as the reference documentation for this implementation.
+ *
+ ***********************************************************************
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
- * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
+ * Copyright(c) 2016 Intel Deutschland GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
@@ -28,12 +34,14 @@
* in the file called COPYING.
*
* Contact Information:
- * Intel Linux Wireless <[email protected]>
+ * Intel Linux Wireless <[email protected]>
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*
* BSD LICENSE
*
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
+ * Copyright(c) 2016 Intel Deutschland GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,8 +69,7 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- *****************************************************************************/
+ */
/*
* CSR (control and status registers)
@@ -656,12 +663,12 @@ enum iwm_ucode_tlv_flag {
* @IWM_NUM_UCODE_TLV_API: number of bits used
*/
enum iwm_ucode_tlv_api {
- IWM_UCODE_TLV_API_FRAGMENTED_SCAN = (1 << 8),
- IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = (1 << 9),
- IWM_UCODE_TLV_API_WIDE_CMD_HDR = (1 << 14),
- IWM_UCODE_TLV_API_LQ_SS_PARAMS = (1 << 18),
- IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = (1 << 24),
- IWM_UCODE_TLV_API_TX_POWER_CHAIN = (1 << 27),
+ IWM_UCODE_TLV_API_FRAGMENTED_SCAN = 8,
+ IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = 9,
+ IWM_UCODE_TLV_API_WIDE_CMD_HDR = 14,
+ IWM_UCODE_TLV_API_LQ_SS_PARAMS = 18,
+ IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = 24,
+ IWM_UCODE_TLV_API_TX_POWER_CHAIN = 27,
IWM_NUM_UCODE_TLV_API = 32
};
@@ -946,6 +953,7 @@ enum iwm_ucode_tlv_type {
IWM_UCODE_TLV_FW_DBG_TRIGGER = 40,
IWM_UCODE_TLV_FW_UNDOCUMENTED1 = 48, /* undocumented TLV */
IWM_UCODE_TLV_FW_GSCAN_CAPA = 50,
+ IWM_UCODE_TLV_FW_MEM_SEG = 51,
};
struct iwm_ucode_tlv {
@@ -1757,6 +1765,9 @@ enum {
IWM_LQ_CMD = 0x4e,
+ /* paging block to FW cpu2 */
+ IWM_FW_PAGING_BLOCK_CMD = 0x4f,
+
/* Calibration */
IWM_TEMPERATURE_NOTIFICATION = 0x62,
IWM_CALIBRATION_CFG_CMD = 0x65,
@@ -2133,6 +2144,48 @@ struct iwm_nvm_access_cmd {
uint8_t data[];
} __packed; /* IWM_NVM_ACCESS_CMD_API_S_VER_2 */
+#define IWM_NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
+
+/*
+ * struct iwm_fw_paging_cmd - paging layout
+ *
+ * (IWM_FW_PAGING_BLOCK_CMD = 0x4f)
+ *
+ * Send to FW the paging layout in the driver.
+ *
+ * @flags: various flags for the command
+ * @block_size: the block size in powers of 2
+ * @block_num: number of blocks specified in the command.
+ * @device_phy_addr: virtual addresses from device side
+ * 32 bit address for API version 1, 64 bit address for API version 2.
+*/
+struct iwm_fw_paging_cmd {
+ uint32_t flags;
+ uint32_t block_size;
+ uint32_t block_num;
+ union {
+ uint32_t addr32[IWM_NUM_OF_FW_PAGING_BLOCKS];
+ uint64_t addr64[IWM_NUM_OF_FW_PAGING_BLOCKS];
+ } device_phy_addr;
+} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */
+
+/*
+ * Fw items ID's
+ *
+ * @IWM_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload
+ * download
+ */
+enum iwm_fw_item_id {
+ IWM_FW_ITEM_ID_PAGING = 3,
+};
+
+/*
+ * struct iwm_fw_get_item_cmd - get an item from the fw
+ */
+struct iwm_fw_get_item_cmd {
+ uint32_t item_id;
+} __packed; /* FW_GET_ITEM_CMD_API_S_VER_1 */
+
/**
* struct iwm_nvm_access_resp_ver2 - response to IWM_NVM_ACCESS_CMD
* @offset: offset in bytes into the section
@@ -6508,6 +6561,36 @@ iwm_rx_packet_payload_len(const struct i
#define IWM_MIN_DBM -100
#define IWM_MAX_DBM -33 /* realistic guess */
+/*
+ * Block paging calculations
+ */
+#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */
+#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */
+#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3
+/* 8 pages per group */
+#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE)
+/* don't change, support only 32KB size */
+#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE)
+/* 32K == 2^15 */
+#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE)
+
+/*
+ * Image paging calculations
+ */
+#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5
+/* 2^5 == 32 blocks per image */
+#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE)
+/* maximum image size 1024KB */
+#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE)
+
+/* Virtual address signature */
+#define IWM_PAGING_ADDR_SIG 0xAA000000
+
+#define IWM_PAGING_CMD_IS_SECURED (1 << 9)
+#define IWM_PAGING_CMD_IS_ENABLED (1 << 8)
+#define IWM_PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS 0
+#define IWM_PAGING_TLV_SECURE_MASK 1
+
#define IWM_READ(sc, reg) \
bus_space_read_4((sc)->sc_st, (sc)->sc_sh, (reg))
Index: src/sys/dev/pci/if_iwmvar.h
diff -u src/sys/dev/pci/if_iwmvar.h:1.17 src/sys/dev/pci/if_iwmvar.h:1.18
--- src/sys/dev/pci/if_iwmvar.h:1.17 Thu Feb 2 10:05:35 2017
+++ src/sys/dev/pci/if_iwmvar.h Tue Mar 14 23:59:26 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwmvar.h,v 1.17 2017/02/02 10:05:35 nonaka Exp $ */
+/* $NetBSD: if_iwmvar.h,v 1.18 2017/03/14 23:59:26 nonaka Exp $ */
/* OpenBSD: if_iwmvar.h,v 1.24 2016/09/21 13:53:18 stsp Exp */
/*
@@ -174,6 +174,8 @@ struct iwm_fw_info {
} fw_sect[IWM_UCODE_SECT_MAX];
size_t fw_totlen;
int fw_count;
+ int is_dual_cpus;
+ uint32_t paging_mem_size;
} fw_sects[IWM_UCODE_TYPE_MAX];
};
@@ -238,6 +240,16 @@ struct iwm_dma_info {
bus_size_t size;
};
+/**
+ * struct iwm_fw_paging
+ * @fw_paging_block: dma memory info
+ * @fw_paging_size: page size
+ */
+struct iwm_fw_paging {
+ struct iwm_dma_info fw_paging_block;
+ uint32_t fw_paging_size;
+};
+
#define IWM_TX_RING_COUNT 256
#define IWM_TX_RING_LOMARK 192
#define IWM_TX_RING_HIMARK 224
@@ -411,7 +423,7 @@ struct iwm_softc {
int sc_capaflags;
int sc_capa_max_probe_len;
int sc_capa_n_scan_channels;
- uint32_t sc_ucode_api;
+ uint8_t sc_ucode_api[howmany(IWM_NUM_UCODE_TLV_API, NBBY)];
uint8_t sc_enabled_capa[howmany(IWM_NUM_UCODE_TLV_CAPA, NBBY)];
char sc_fw_mcc[3];
@@ -475,6 +487,14 @@ struct iwm_softc {
* This is due to a HW bug in 7260, 3160 and 7265. */
int apmg_wake_up_wa;
+ /*
+ * Paging parameters - All of the parameters should be set by the
+ * opmode when paging is enabled
+ */
+ struct iwm_fw_paging fw_paging_db[IWM_NUM_OF_FW_PAGING_BLOCKS];
+ uint16_t num_of_paging_blk;
+ uint16_t num_of_pages_in_last_blk;
+
struct sysctllog *sc_clog;
struct bpf_if *sc_drvbpf;
Added files:
Index: src/external/intel-fw-public/iwl3160/dist/iwlwifi-3160-17.ucode
Binary files are different
Index: src/external/intel-fw-public/iwl3168/Makefile
diff -u /dev/null src/external/intel-fw-public/iwl3168/Makefile:1.1
--- /dev/null Tue Mar 14 23:59:26 2017
+++ src/external/intel-fw-public/iwl3168/Makefile Tue Mar 14 23:59:25 2017
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2017/03/14 23:59:25 nonaka Exp $
+
+NOMAN= # define
+
+FILES= dist/LICENSE.iwlwifi-3168-ucode dist/README.iwlwifi-3168-ucode \
+ dist/iwlwifi-3168-22.ucode
+
+FILESDIR= /libdata/firmware/if_iwm
+
+.include <bsd.files.mk>
Index: src/external/intel-fw-public/iwl3168/dist/LICENSE.iwlwifi-3168-ucode
diff -u /dev/null src/external/intel-fw-public/iwl3168/dist/LICENSE.iwlwifi-3168-ucode:1.1
--- /dev/null Tue Mar 14 23:59:26 2017
+++ src/external/intel-fw-public/iwl3168/dist/LICENSE.iwlwifi-3168-ucode Tue Mar 14 23:59:25 2017
@@ -0,0 +1,39 @@
+Copyright (c) 2016, Intel Corporation.
+All rights reserved.
+
+Redistribution. Redistribution and use in binary form, without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions must reproduce the above copyright notice and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its suppliers
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+* No reverse engineering, decompilation, or disassembly of this software
+ is permitted.
+
+Limited patent license. Intel Corporation grants a world-wide,
+royalty-free, non-exclusive license under patents it now or hereafter
+owns or controls to make, have made, use, import, offer to sell and
+sell ("Utilize") this software, but solely to the extent that any
+such patent is necessary to Utilize the software alone, or in
+combination with an operating system licensed under an approved Open
+Source license as listed by the Open Source Initiative at
+http://opensource.org/licenses. The patent license shall not apply to
+any other combinations which include this software. No hardware per
+se is licensed hereunder.
+
+DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
Index: src/external/intel-fw-public/iwl3168/dist/README.iwlwifi-3168-ucode
diff -u /dev/null src/external/intel-fw-public/iwl3168/dist/README.iwlwifi-3168-ucode:1.1
--- /dev/null Tue Mar 14 23:59:26 2017
+++ src/external/intel-fw-public/iwl3168/dist/README.iwlwifi-3168-ucode Tue Mar 14 23:59:25 2017
@@ -0,0 +1,112 @@
+Intel Wireless WiFi Link 3168 AC Adapter
+Copyright (C) 2016 Intel Corporation. All rights reserved.
+
+Microcode Package README.iwlwifi-3168-ucode
+
+INDEX
+
+1. OVERVIEW
+2. INSTALLATION
+3. LICENSE
+
+
+1. OVERVIEW
+
+The files iwlwifi-3168-22.ucode provided in this package
+must be present on your system in order for the Intel Wireless WiFi Link
+AGN driver for Linux (iwlwifi) to operate on your system.
+
+The "-22" in the filename reflects an interface/architecture version number.
+It will change only when changes in new uCode releases make the new uCode
+incompatible with earlier drivers.
+
+On adapter initialization, and at varying times during the uptime of
+the adapter, the microcode is loaded into the memory on the network
+adapter. The microcode provides the low level MAC features including
+radio control and high precision timing events (backoff, transmit,
+etc.) while also providing varying levels of packet filtering which can
+be used to keep the host from having to handle packets that are not of
+interest given the current operating mode of the device.
+
+2. INSTALLATION
+
+The iwlwifi driver will look for the file iwlwifi-3168-22.ucode
+using the kernel's firmware_class infrastructure.
+More information can be found under Documentation/firmware_class in kernel
+source. In order to function correctly, you need to have this support enabled
+in your kernel. When you configure the kernel, you can find this option in
+the following location:
+
+ Device Drivers ->
+ Generic Driver Options ->
+ Userspace firmware loading support
+
+
+You can determine if your kernel currently has firmware loader support
+by looking for the CONFIG_FW_LOADER definition on your kernel's
+.config.
+
+In addition to having the firmware_class support in your kernel, you
+must also have a working udev and uevent infrastructure configured.
+The steps for installing and configuring udev are very
+distribution specific.
+
+Once you have the firmware loader in place (or if you aren't sure and
+you just want to try things to see if it works), you need to install
+the microcode file into the appropriate location.
+
+Where that appropriate location is depends (again) on your system
+distribution. You can typically find this location by looking in the
+udev scripts of your distro, the default is /lib/firmware.
+
+Installation of the firmware is simply:
+
+ % cp iwlwifi-3168-22.ucode /lib/firmware
+
+You can now load the driver (see the INSTALL and README.iwlwifi provided with
+the iwlwifi package for information on building and using that driver.)
+
+3. LICENSE
+
+The microcode in this package (iwlwifi-3168-22.ucode) is provided
+under the terms of the following license (available in the file
+LICENSE.iwlwifi-8000-ucode):
+
+Copyright (c) 2016, Intel Corporation.
+All rights reserved.
+
+Redistribution. Redistribution and use in binary form, without
+modification, are permitted provided that the following conditions are
+met:
+ reproduce the above copyright notice and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its suppliers
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+* No reverse engineering, decompilation, or disassembly of this software
+ is permitted.
+
+Limited patent license. Intel Corporation grants a world-wide,
+royalty-free, non-exclusive license under patents it now or hereafter
+owns or controls to make, have made, use, import, offer to sell and
+sell ("Utilize") this software, but solely to the extent that any
+such patent is necessary to Utilize the software alone, or in
+combination with an operating system licensed under an approved Open
+Source license as listed by the Open Source Initiative at
+http://opensource.org/licenses. The patent license shall not apply to
+any other combinations which include this software. No hardware per
+se is licensed hereunder.
+
+DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
Index: src/external/intel-fw-public/iwl3168/dist/iwlwifi-3168-22.ucode
Binary files are different
Index: src/external/intel-fw-public/iwl7260/dist/iwlwifi-7260-17.ucode
Binary files are different
Index: src/external/intel-fw-public/iwl7265/dist/iwlwifi-7265-17.ucode
Binary files are different
Index: src/external/intel-fw-public/iwl7265/dist/iwlwifi-7265D-22.ucode
Binary files are different
Index: src/external/intel-fw-public/iwl8000/dist/iwlwifi-8000C-22.ucode
Binary files are different
Index: src/external/intel-fw-public/iwl8265/Makefile
diff -u /dev/null src/external/intel-fw-public/iwl8265/Makefile:1.1
--- /dev/null Tue Mar 14 23:59:27 2017
+++ src/external/intel-fw-public/iwl8265/Makefile Tue Mar 14 23:59:26 2017
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2017/03/14 23:59:26 nonaka Exp $
+
+NOMAN= # define
+
+FILES= dist/LICENSE.iwlwifi-8265-ucode dist/README.iwlwifi-8265-ucode \
+ dist/iwlwifi-8265-22.ucode
+
+FILESDIR= /libdata/firmware/if_iwm
+
+.include <bsd.files.mk>
Index: src/external/intel-fw-public/iwl8265/dist/LICENSE.iwlwifi-8265-ucode
diff -u /dev/null src/external/intel-fw-public/iwl8265/dist/LICENSE.iwlwifi-8265-ucode:1.1
--- /dev/null Tue Mar 14 23:59:27 2017
+++ src/external/intel-fw-public/iwl8265/dist/LICENSE.iwlwifi-8265-ucode Tue Mar 14 23:59:26 2017
@@ -0,0 +1,39 @@
+Copyright (c) 2015, Intel Corporation.
+All rights reserved.
+
+Redistribution. Redistribution and use in binary form, without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions must reproduce the above copyright notice and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its suppliers
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+* No reverse engineering, decompilation, or disassembly of this software
+ is permitted.
+
+Limited patent license. Intel Corporation grants a world-wide,
+royalty-free, non-exclusive license under patents it now or hereafter
+owns or controls to make, have made, use, import, offer to sell and
+sell ("Utilize") this software, but solely to the extent that any
+such patent is necessary to Utilize the software alone, or in
+combination with an operating system licensed under an approved Open
+Source license as listed by the Open Source Initiative at
+http://opensource.org/licenses. The patent license shall not apply to
+any other combinations which include this software. No hardware per
+se is licensed hereunder.
+
+DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
Index: src/external/intel-fw-public/iwl8265/dist/README.iwlwifi-8265-ucode
diff -u /dev/null src/external/intel-fw-public/iwl8265/dist/README.iwlwifi-8265-ucode:1.1
--- /dev/null Tue Mar 14 23:59:27 2017
+++ src/external/intel-fw-public/iwl8265/dist/README.iwlwifi-8265-ucode Tue Mar 14 23:59:26 2017
@@ -0,0 +1,112 @@
+Intel Wireless WiFi Link 8260 AC Adapter
+Copyright (C) 2015 Intel Corporation. All rights reserved.
+
+Microcode Package README.iwlwifi-8265-ucode
+
+INDEX
+
+1. OVERVIEW
+2. INSTALLATION
+3. LICENSE
+
+
+1. OVERVIEW
+
+The files iwlwifi-8265-22.ucode provided in this package
+must be present on your system in order for the Intel Wireless WiFi Link
+AGN driver for Linux (iwlwifi) to operate on your system.
+
+The "-22" in the filename reflects an interface/architecture version number.
+It will change only when changes in new uCode releases make the new uCode
+incompatible with earlier drivers.
+
+On adapter initialization, and at varying times during the uptime of
+the adapter, the microcode is loaded into the memory on the network
+adapter. The microcode provides the low level MAC features including
+radio control and high precision timing events (backoff, transmit,
+etc.) while also providing varying levels of packet filtering which can
+be used to keep the host from having to handle packets that are not of
+interest given the current operating mode of the device.
+
+2. INSTALLATION
+
+The iwlwifi driver will look for the file iwlwifi-8265-22.ucode
+using the kernel's firmware_class infrastructure.
+More information can be found under Documentation/firmware_class in kernel
+source. In order to function correctly, you need to have this support enabled
+in your kernel. When you configure the kernel, you can find this option in
+the following location:
+
+ Device Drivers ->
+ Generic Driver Options ->
+ Userspace firmware loading support
+
+
+You can determine if your kernel currently has firmware loader support
+by looking for the CONFIG_FW_LOADER definition on your kernel's
+.config.
+
+In addition to having the firmware_class support in your kernel, you
+must also have a working udev and uevent infrastructure configured.
+The steps for installing and configuring udev are very
+distribution specific.
+
+Once you have the firmware loader in place (or if you aren't sure and
+you just want to try things to see if it works), you need to install
+the microcode file into the appropriate location.
+
+Where that appropriate location is depends (again) on your system
+distribution. You can typically find this location by looking in the
+udev scripts of your distro, the default is /lib/firmware.
+
+Installation of the firmware is simply:
+
+ % cp iwlwifi-8265-22.ucode /lib/firmware
+
+You can now load the driver (see the INSTALL and README.iwlwifi provided with
+the iwlwifi package for information on building and using that driver.)
+
+3. LICENSE
+
+The microcode in this package (iwlwifi-8265-22.ucode) is provided
+under the terms of the following license (available in the file
+LICENSE.iwlwifi-8000-ucode):
+
+Copyright (c) 2015, Intel Corporation.
+All rights reserved.
+
+Redistribution. Redistribution and use in binary form, without
+modification, are permitted provided that the following conditions are
+met:
+ reproduce the above copyright notice and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its suppliers
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+* No reverse engineering, decompilation, or disassembly of this software
+ is permitted.
+
+Limited patent license. Intel Corporation grants a world-wide,
+royalty-free, non-exclusive license under patents it now or hereafter
+owns or controls to make, have made, use, import, offer to sell and
+sell ("Utilize") this software, but solely to the extent that any
+such patent is necessary to Utilize the software alone, or in
+combination with an operating system licensed under an approved Open
+Source license as listed by the Open Source Initiative at
+http://opensource.org/licenses. The patent license shall not apply to
+any other combinations which include this software. No hardware per
+se is licensed hereunder.
+
+DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
Index: src/external/intel-fw-public/iwl8265/dist/iwlwifi-8265-22.ucode
Binary files are different