<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/iwm/if_iwm_debug.h, branch releng/12.2</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>MFC r343065, r343373-r343390, r343477</title>
<updated>2019-04-08T18:15:10+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2019-04-08T18:15:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=18fc94098b97f954a4ae866ed023d3bcc1f8f0df'/>
<id>18fc94098b97f954a4ae866ed023d3bcc1f8f0df</id>
<content type='text'>
r343065:
With the sync from Dragonfly BSD in r318216 a bug slipped in (also still present
upstream it seems).

The tlv variable was changed to a pointer but the advancement of the data pointer
was left as sizeof(tlv).  While the sizeof the (now) pointer equals the
sizeof 2 x uint32_t (size of the struct) on 64bit platforms, on 32bit platforms
the size of the advancement of the data pointer was wrong leading to
firmware load issues.

Correctly advance the data pointer by the size of the structure and not by
the size of a pointer.

r343373:
if_iwm - Update firmware rs table, instead of indexing the table in tx cmds.

* Rather than providing a non-zero index into the firmware RS table,
we should always use index 0 and update the firmware RS table whenever
our chosen tx rate for data-frames changes.

* Send IWM_LQ_CMD updates when the tx rate gets updated by the net80211
rate control (which is after we tell the tx status to the net80211
rate-control in iwm_mvm_rx_tx_cmd_single()).

* Disregard frames transferred with a different tx rate than the currently
selected rate for the rate-control calculations. This way we avoid
counting management frames (which are sent at a slow, and fixed rate),
as well as frames we added to the tx queue just before a new IWM_LQ_CMD
update took effect.

r343374:
if_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw.

* Doing the iwm_prepare_card_hw() call in iwm_attach() only on Family 8000
hardware matches the code in Linux iwlwifi.

* While there remove DEFAULT_MAX_TX_POWER definition which is unused, and
has a value different from IWL_DEFAULT_MAX_TX_POWER in iwlwifi.

r343375:
if_iwm - Move iwm_read_firmware() call into iwm_attach().

* We should load the firmware exactly once before the driver really
initializes the hardware the first time, and unload it at detach time.
There is no need to retrieve the firmware during execution of
iwm_mvm_load_ucode_wait_alive(), we should make sure we already have the
firmware data at hand before that.

* The existing sc_preinit_hook code fails to deal with the case where
if_iwm is loaded by the loader (or is statically linked) and the
firmware needs to be loaded from disk. So we can just call
iwm_read_firmware() from iwm_attach() directly.

* A separate solution will have to be added to properly defer the firmware
loading during bootup, until the necessary filesystem is mounted.

r343376:
if_iwm - Check sc-&gt;sc_attached flag in suspend/resume callbacks.

* There is (almost) nothing to do in suspend/resume if if_iwm has failed
during initialization (e.g. because of firmware load failure) and was
already uninitialized by iwm_detach_local().

r343377:
iwm - Reduce gratuitous differences with Linux iwlwifi in struct naming.

* Rename some structs and struct members for firmware handling.

r343378:
if_iwm - Update struct iwm_scan_results_notif. Remove old/unused definitions

* Remove outdated notifications IWM_SCAN_ABORT_CMD,
IWM_SCAN_START_NOTIFICATION and IWM_SCAN_RESULTS_NOTIFICATION.

* Remove unused enum iwm_scan_complete_status.

* Use the updated FW Api version 3 of struct iwm_scan_results_notif.

* No functional change, since struct iwm_scan_results_notif is never
accessed in iwm at the moment.

Taken-From: Linux iwlwifi commits 1083fd7391e989be52022f0f338e9dadc048b063
	and 75118fdb63496e4611ab50380499ddd62b9de69f.

r343379:
if_iwm - Configure the PCIe LTR, fix PCI express capability accesses.

Taken-From: Linux iwlwifi

r343380:
if_iwm - Add firmware API definitions for TX power commands.

* While there remove unused IWM_UCODE_TLV_CAPA_LMAC_UPLOAD definition,
which isn't defined in iwlwifi.

Taken-From: Linux iwlwifi

r343381:
iwm - Track firmware state better, and improve handling in iwm_newstate().

* This avoids firmware resets in all the cases in iwm_newstate(). Instead
iwm_bring_down_firmware() is called, which tears down all the STA
connection state, according to the sc-&gt;sc_firmware_state value.

* Improve the behaviour of the LED blinking a bit, so it only blinks when
there really is a wireless scan going on.

* Print the newstate arg in debug output of iwm_newstate(), to help in
debugging.

This is inspired by the firmware state maintaining change in OpenBSD's iwm,
by stsp@openbsd.org (OpenBSD Git 0ddb056fb7370664b1d4b84392697cb17d1a414a).

r343382:
iwm - Avoid Tx watchdog timeout, when dropping a connection.

r343383:
iwm - Improve firmware Time Event handling.

* This is a mix of the OpenBSD Git 7fd9664469d1b717a307eebd74aeececbd3c41cc
change, and syncing with the Linux iwlwifi code.

Taken-From: Linux iwlwifi, and OpenBSD

r343384:
iwm - Clear Time Event active state, when receiving End Notification.

* This hopefully avoids some firmware panics, I was occasionally seeing,
when iwm disconnects upon losing signal to an access point at some point.

* This is synchronizing the if_iwm_time_event.c file a bit more from the
corresponding Linux iwlwifi/mvm/time-event.c.

Taken-From:     Linux iwlwifi

r343385:
iwm - Always clear watchdog timer, when bringing down firmware state.

r343386:
if_iwm - Stop iwm_watchdog callout when idle.

r343387:
iwm - Fix race during detach, where a callout is left after driver is gone.

r343388:
iwm - Update alive response handling, add v4 and remove old versions.

r343389:
iwm - Remove unused REPLY_MAX

Taken-From: Linux git e4eb275ac5cfe71686612d929a9829345b2a4ada

r343390:
iwm - Remove unused TX_CMD_NEXT_FRAME_*

Taken-From: Linux git b1e06c65fb69c5e3fddcd91987561e225eaa9bfa

r343477:
Fix logic errors in iwm_pcie_load_firmware_chunk introduced in r314065.

 * There's no reason to have a while() loop here, because:
    - if msleep returns 0, that means we were woken up by the interrupt handler,
      and we are going to exit immediately as sc_fw_chunk_done will now be 1
      (there is nothing else that sleeps on sc_fw.)
    - if msleep doesn't return 0 (i.e. it returned ETIMEDOUT) then we will
      exit immediately because of the if-test.
   So, just use a single msleep() and then check sc_fw_chunk_done as before.
 * The comment said we were sleeping for 5 seconds, but the msleep was only
   for 1. Before r314065, this was 1 second and so was the comment,
   and in that commit the comment was changed and the function call wasn't.

Possibly fixes failures to initialize uCode on certain devices.

PR:		219683
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r343065:
With the sync from Dragonfly BSD in r318216 a bug slipped in (also still present
upstream it seems).

The tlv variable was changed to a pointer but the advancement of the data pointer
was left as sizeof(tlv).  While the sizeof the (now) pointer equals the
sizeof 2 x uint32_t (size of the struct) on 64bit platforms, on 32bit platforms
the size of the advancement of the data pointer was wrong leading to
firmware load issues.

Correctly advance the data pointer by the size of the structure and not by
the size of a pointer.

r343373:
if_iwm - Update firmware rs table, instead of indexing the table in tx cmds.

* Rather than providing a non-zero index into the firmware RS table,
we should always use index 0 and update the firmware RS table whenever
our chosen tx rate for data-frames changes.

* Send IWM_LQ_CMD updates when the tx rate gets updated by the net80211
rate control (which is after we tell the tx status to the net80211
rate-control in iwm_mvm_rx_tx_cmd_single()).

* Disregard frames transferred with a different tx rate than the currently
selected rate for the rate-control calculations. This way we avoid
counting management frames (which are sent at a slow, and fixed rate),
as well as frames we added to the tx queue just before a new IWM_LQ_CMD
update took effect.

r343374:
if_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw.

* Doing the iwm_prepare_card_hw() call in iwm_attach() only on Family 8000
hardware matches the code in Linux iwlwifi.

* While there remove DEFAULT_MAX_TX_POWER definition which is unused, and
has a value different from IWL_DEFAULT_MAX_TX_POWER in iwlwifi.

r343375:
if_iwm - Move iwm_read_firmware() call into iwm_attach().

* We should load the firmware exactly once before the driver really
initializes the hardware the first time, and unload it at detach time.
There is no need to retrieve the firmware during execution of
iwm_mvm_load_ucode_wait_alive(), we should make sure we already have the
firmware data at hand before that.

* The existing sc_preinit_hook code fails to deal with the case where
if_iwm is loaded by the loader (or is statically linked) and the
firmware needs to be loaded from disk. So we can just call
iwm_read_firmware() from iwm_attach() directly.

* A separate solution will have to be added to properly defer the firmware
loading during bootup, until the necessary filesystem is mounted.

r343376:
if_iwm - Check sc-&gt;sc_attached flag in suspend/resume callbacks.

* There is (almost) nothing to do in suspend/resume if if_iwm has failed
during initialization (e.g. because of firmware load failure) and was
already uninitialized by iwm_detach_local().

r343377:
iwm - Reduce gratuitous differences with Linux iwlwifi in struct naming.

* Rename some structs and struct members for firmware handling.

r343378:
if_iwm - Update struct iwm_scan_results_notif. Remove old/unused definitions

* Remove outdated notifications IWM_SCAN_ABORT_CMD,
IWM_SCAN_START_NOTIFICATION and IWM_SCAN_RESULTS_NOTIFICATION.

* Remove unused enum iwm_scan_complete_status.

* Use the updated FW Api version 3 of struct iwm_scan_results_notif.

* No functional change, since struct iwm_scan_results_notif is never
accessed in iwm at the moment.

Taken-From: Linux iwlwifi commits 1083fd7391e989be52022f0f338e9dadc048b063
	and 75118fdb63496e4611ab50380499ddd62b9de69f.

r343379:
if_iwm - Configure the PCIe LTR, fix PCI express capability accesses.

Taken-From: Linux iwlwifi

r343380:
if_iwm - Add firmware API definitions for TX power commands.

* While there remove unused IWM_UCODE_TLV_CAPA_LMAC_UPLOAD definition,
which isn't defined in iwlwifi.

Taken-From: Linux iwlwifi

r343381:
iwm - Track firmware state better, and improve handling in iwm_newstate().

* This avoids firmware resets in all the cases in iwm_newstate(). Instead
iwm_bring_down_firmware() is called, which tears down all the STA
connection state, according to the sc-&gt;sc_firmware_state value.

* Improve the behaviour of the LED blinking a bit, so it only blinks when
there really is a wireless scan going on.

* Print the newstate arg in debug output of iwm_newstate(), to help in
debugging.

This is inspired by the firmware state maintaining change in OpenBSD's iwm,
by stsp@openbsd.org (OpenBSD Git 0ddb056fb7370664b1d4b84392697cb17d1a414a).

r343382:
iwm - Avoid Tx watchdog timeout, when dropping a connection.

r343383:
iwm - Improve firmware Time Event handling.

* This is a mix of the OpenBSD Git 7fd9664469d1b717a307eebd74aeececbd3c41cc
change, and syncing with the Linux iwlwifi code.

Taken-From: Linux iwlwifi, and OpenBSD

r343384:
iwm - Clear Time Event active state, when receiving End Notification.

* This hopefully avoids some firmware panics, I was occasionally seeing,
when iwm disconnects upon losing signal to an access point at some point.

* This is synchronizing the if_iwm_time_event.c file a bit more from the
corresponding Linux iwlwifi/mvm/time-event.c.

Taken-From:     Linux iwlwifi

r343385:
iwm - Always clear watchdog timer, when bringing down firmware state.

r343386:
if_iwm - Stop iwm_watchdog callout when idle.

r343387:
iwm - Fix race during detach, where a callout is left after driver is gone.

r343388:
iwm - Update alive response handling, add v4 and remove old versions.

r343389:
iwm - Remove unused REPLY_MAX

Taken-From: Linux git e4eb275ac5cfe71686612d929a9829345b2a4ada

r343390:
iwm - Remove unused TX_CMD_NEXT_FRAME_*

Taken-From: Linux git b1e06c65fb69c5e3fddcd91987561e225eaa9bfa

r343477:
Fix logic errors in iwm_pcie_load_firmware_chunk introduced in r314065.

 * There's no reason to have a while() loop here, because:
    - if msleep returns 0, that means we were woken up by the interrupt handler,
      and we are going to exit immediately as sc_fw_chunk_done will now be 1
      (there is nothing else that sleeps on sc_fw.)
    - if msleep doesn't return 0 (i.e. it returned ETIMEDOUT) then we will
      exit immediately because of the if-test.
   So, just use a single msleep() and then check sc_fw_chunk_done as before.
 * The comment said we were sleeping for 5 seconds, but the msleep was only
   for 1. Before r314065, this was 1 second and so was the comment,
   and in that commit the comment was changed and the function call wasn't.

Possibly fixes failures to initialize uCode on certain devices.

PR:		219683
</pre>
</div>
</content>
</entry>
<entry>
<title>[iwm] Check for lar_disable tunable, and lar_enabled flag from NVM.</title>
<updated>2017-06-04T21:10:14+00:00</updated>
<author>
<name>Adrian Chadd</name>
<email>adrian@FreeBSD.org</email>
</author>
<published>2017-06-04T21:10:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=19d956ec90801250cecbb72f8eca0a2c4bb2369d'/>
<id>19d956ec90801250cecbb72f8eca0a2c4bb2369d</id>
<content type='text'>
* LAR can be disabled with the hw.iwm.lar.disable tunable now.

* On Family 8000 devices we need to check the lar_enabled flag from
  nvm_data in addition to the TLV_CAPA_LAR_SUPPORT flag from the firmware.

* Add a separate IWM_DEBUG_LAR debugging flag.

Obtained from:	dragonflybsd.git 0593e39cb295aa996ecf789ed4990c3b255f1770
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* LAR can be disabled with the hw.iwm.lar.disable tunable now.

* On Family 8000 devices we need to check the lar_enabled flag from
  nvm_data in addition to the TLV_CAPA_LAR_SUPPORT flag from the firmware.

* Add a separate IWM_DEBUG_LAR debugging flag.

Obtained from:	dragonflybsd.git 0593e39cb295aa996ecf789ed4990c3b255f1770
</pre>
</div>
</content>
</entry>
<entry>
<title>[iwm] Add support for Firmware paging, needed for newer 8000C firmware.</title>
<updated>2017-02-24T07:07:58+00:00</updated>
<author>
<name>Adrian Chadd</name>
<email>adrian@FreeBSD.org</email>
</author>
<published>2017-02-24T07:07:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ad35d471389c2667573b16978175f87c337d8314'/>
<id>ad35d471389c2667573b16978175f87c337d8314</id>
<content type='text'>
* Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware
  what memory ranges to use for paging.

Obtained from:	dragonflybsd.git 8a5b199964f8e7bdb00039f0b48817a01b402f18
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware
  what memory ranges to use for paging.

Obtained from:	dragonflybsd.git 8a5b199964f8e7bdb00039f0b48817a01b402f18
</pre>
</div>
</content>
</entry>
<entry>
<title>[iwm] Very basic DTS thermal sensor support (prints temp as debug msg).</title>
<updated>2017-02-08T06:56:28+00:00</updated>
<author>
<name>Adrian Chadd</name>
<email>adrian@FreeBSD.org</email>
</author>
<published>2017-02-08T06:56:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a717dd3a7f7e2667c114ce6cb74d99c974dbc6aa'/>
<id>a717dd3a7f7e2667c114ce6cb74d99c974dbc6aa</id>
<content type='text'>
* Adds IWM_DEBUG_TEMP debug message type, for printing messages related
  to temperature sensors and thermal/TDP infos.

* The firmware regularly sends us DTS measurement notifications, so just
  print the temperature value as a debugging message.

(Adrian's addition):

* Eventually this can be used by the driver to limit transmit rate / power to
  try and do some thermal throttling.

Obtained from:	DragonflyBSD commit efb7d4eb5c3140889a8880e12fd83c7bbfd0059d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Adds IWM_DEBUG_TEMP debug message type, for printing messages related
  to temperature sensors and thermal/TDP infos.

* The firmware regularly sends us DTS measurement notifications, so just
  print the temperature value as a debugging message.

(Adrian's addition):

* Eventually this can be used by the driver to limit transmit rate / power to
  try and do some thermal throttling.

Obtained from:	DragonflyBSD commit efb7d4eb5c3140889a8880e12fd83c7bbfd0059d
</pre>
</div>
</content>
</entry>
<entry>
<title>Import OpenBSD's iwm WiFi driver for Intel 3160/7260/7265.</title>
<updated>2015-08-08T06:06:48+00:00</updated>
<author>
<name>Rui Paulo</name>
<email>rpaulo@FreeBSD.org</email>
</author>
<published>2015-08-08T06:06:48+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d4886179cbebc2985084fb55240f87dbeb7909a3'/>
<id>d4886179cbebc2985084fb55240f87dbeb7909a3</id>
<content type='text'>
There are still several bugs, but I've been using it for a while now.
Thanks to all the testers and to Adrian for his help with this
driver.

This driver isn't connected to the build yet, but it will be soon.

There's no MFC planned because the driver isn't very stable yet.

Reviewed by:	adrian
Obtained from:	https://github.com/rpaulo/iwm
Tested by:	adrian, gjb, dumbbell (others that I forgot).
Relnotes:	yes
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are still several bugs, but I've been using it for a while now.
Thanks to all the testers and to Adrian for his help with this
driver.

This driver isn't connected to the build yet, but it will be soon.

There's no MFC planned because the driver isn't very stable yet.

Reviewed by:	adrian
Obtained from:	https://github.com/rpaulo/iwm
Tested by:	adrian, gjb, dumbbell (others that I forgot).
Relnotes:	yes
</pre>
</div>
</content>
</entry>
</feed>
