Re: iwm(4): Update struct iwm_scan_results_notif. Remove a few old defines.

2017-01-31 Thread Stefan Sperling
On Mon, Jan 30, 2017 at 12:07:46PM +0100, Imre Vadász wrote:
> Thanks, this patch was trying to remove the struct iwm_scan_complete_notif
> definition that was already removed in one of the previous diffs.
> fixed patch:

Committed. Thank you!



Re: iwm(4): Update struct iwm_scan_results_notif. Remove a few old defines.

2017-01-30 Thread Imre Vadász
On 10:47 Sun 29 Jan , Stefan Sperling wrote:
> On Mon, Jan 16, 2017 at 05:26:05PM +0100, Imre Vadász wrote:
> > Hi,
> > This patch updates the struct iwm_scan_results_notif to FW Api version 3,
> > and removes the unused enum iwm_scan_complete_status status codes, as well
> > as the deprecated/unused struct iwm_scan_complete_notif.
> > 
> > This corresponds to the Linux iwlwifi commits
> > 1083fd7391e989be52022f0f338e9dadc048b063 and
> > 75118fdb63496e4611ab50380499ddd62b9de69f.
> > No functional change, since struct iwm_scan_results_notif isn't accessed
> > in iwm at the moment.
> 
> This patch does not apply cleanly. I applied your patches in the
> order they arrived in my inbox, so perhaps they're out of order.
> 
> Patching file if_iwmreg.h using Plan A...
> Hunk #1 succeeded at 4864 with fuzz 2 (offset -137 lines).
> Hunk #2 failed at 4879.
> 1 out of 2 hunks failed--saving rejects to if_iwmreg.h.rej
> Hmm...  Ignoring the trailing garbage.
> 
> Can you make a fresh patch against -current?
> 
> I have committed all other diffs you sent. Thanks!

Thanks, this patch was trying to remove the struct iwm_scan_complete_notif
definition that was already removed in one of the previous diffs.
fixed patch:

Update the struct iwm_scan_results_notif to FW Api version 3, and remove
the unused enum iwm_scan_complete_status status codes.

This corresponds to parts of the Linux iwlwifi commits
1083fd7391e989be52022f0f338e9dadc048b063 and
75118fdb63496e4611ab50380499ddd62b9de69f.
No functional change, since struct iwm_scan_results_notif isn't accessed
in iwm at the moment.


Index: sys/dev/pci/if_iwmreg.h
===
RCS file: /cvs/src/sys/dev/pci/if_iwmreg.h,v
retrieving revision 1.23
diff -u -r1.23 if_iwmreg.h
--- sys/dev/pci/if_iwmreg.h 29 Jan 2017 09:43:50 -  1.23
+++ sys/dev/pci/if_iwmreg.h 29 Jan 2017 17:52:50 -
@@ -4864,48 +4864,14 @@
uint32_t reserved;
 } __packed;
 
-/* How many statistics are gathered for each channel */
-#define IWM_SCAN_RESULTS_STATISTICS 1
-
 /**
- * status codes for scan complete notifications
- * @IWM_SCAN_COMP_STATUS_OK:  scan completed successfully
- * @IWM_SCAN_COMP_STATUS_ABORT: scan was aborted by user
- * @IWM_SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
- * @IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
- * @IWM_SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
- * @IWM_SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
- * @IWM_SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
- * @IWM_SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
- * @IWM_SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
- * @IWM_SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was 
successful
- * (not an error!)
- * @IWM_SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the 
driver
- * asked for
- * @IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
-*/
-#define IWM_SCAN_COMP_STATUS_OK0x1
-#define IWM_SCAN_COMP_STATUS_ABORT 0x2
-#define IWM_SCAN_COMP_STATUS_ERR_SLEEP 0x3
-#define IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT  0x4
-#define IWM_SCAN_COMP_STATUS_ERR_PROBE 0x5
-#define IWM_SCAN_COMP_STATUS_ERR_WAKEUP0x6
-#define IWM_SCAN_COMP_STATUS_ERR_ANTENNAS  0x7
-#define IWM_SCAN_COMP_STATUS_ERR_INTERNAL  0x8
-#define IWM_SCAN_COMP_STATUS_ERR_COEX  0x9
-#define IWM_SCAN_COMP_STATUS_P2P_ACTION_OK 0xA
-#define IWM_SCAN_COMP_STATUS_ITERATION_END 0x0B
-#define IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE  0x0C
-
-/**
- * struct iwm_scan_results_notif - scan results for one channel
- * ( IWM_SCAN_RESULTS_NOTIFICATION = 0x83 )
+ * struct iwm_scan_results_notif - scan results for one channel -
+ *  SCAN_RESULT_NTF_API_S_VER_3
  * @channel: which channel the results are from
  * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
  * @probe_status: IWM_SCAN_PROBE_STATUS_*, indicates success of probe request
  * @num_probe_not_sent: # of request that weren't sent due to not enough time
  * @duration: duration spent in channel, in usecs
- * @statistics: statistics gathered for this channel
  */
 struct iwm_scan_results_notif {
uint8_t channel;
@@ -4913,8 +4879,7 @@
uint8_t probe_status;
uint8_t num_probe_not_sent;
uint32_t duration;
-   uint32_t statistics[IWM_SCAN_RESULTS_STATISTICS];
-} __packed; /* IWM_SCAN_RESULT_NTF_API_S_VER_2 */
+} __packed;
 
 #define IWM_SCAN_CLIENT_SCHED_SCAN (1 << 0)
 #define IWM_SCAN_CLIENT_NETDETECT  (1 << 1)



Re: iwm(4): Update struct iwm_scan_results_notif. Remove a few old defines.

2017-01-29 Thread Stefan Sperling
On Mon, Jan 16, 2017 at 05:26:05PM +0100, Imre Vadász wrote:
> Hi,
> This patch updates the struct iwm_scan_results_notif to FW Api version 3,
> and removes the unused enum iwm_scan_complete_status status codes, as well
> as the deprecated/unused struct iwm_scan_complete_notif.
> 
> This corresponds to the Linux iwlwifi commits
> 1083fd7391e989be52022f0f338e9dadc048b063 and
> 75118fdb63496e4611ab50380499ddd62b9de69f.
> No functional change, since struct iwm_scan_results_notif isn't accessed
> in iwm at the moment.

This patch does not apply cleanly. I applied your patches in the
order they arrived in my inbox, so perhaps they're out of order.

Patching file if_iwmreg.h using Plan A...
Hunk #1 succeeded at 4864 with fuzz 2 (offset -137 lines).
Hunk #2 failed at 4879.
1 out of 2 hunks failed--saving rejects to if_iwmreg.h.rej
Hmm...  Ignoring the trailing garbage.

Can you make a fresh patch against -current?

I have committed all other diffs you sent. Thanks!

> Index: sys/dev/pci/if_iwmreg.h
> ===
> RCS file: /cvs/src/sys/dev/pci/if_iwmreg.h,v
> retrieving revision 1.21
> diff -u -r1.21 if_iwmreg.h
> --- sys/dev/pci/if_iwmreg.h   10 Dec 2016 19:03:53 -  1.21
> +++ sys/dev/pci/if_iwmreg.h   16 Jan 2017 16:23:01 -
> @@ -5001,48 +5001,14 @@
>  #define IWM_SCAN_PROBE_STATUS_FAIL_TTL   (1 << 1)
>  #define IWM_SCAN_PROBE_STATUS_FAIL_BT(1 << 2)
>  
> -/* How many statistics are gathered for each channel */
> -#define IWM_SCAN_RESULTS_STATISTICS 1
> -
>  /**
> - * status codes for scan complete notifications
> - * @IWM_SCAN_COMP_STATUS_OK:  scan completed successfully
> - * @IWM_SCAN_COMP_STATUS_ABORT: scan was aborted by user
> - * @IWM_SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
> - * @IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
> - * @IWM_SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
> - * @IWM_SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
> - * @IWM_SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan 
> command
> - * @IWM_SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
> - * @IWM_SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
> - * @IWM_SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was 
> successful
> - *   (not an error!)
> - * @IWM_SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the 
> driver
> - *   asked for
> - * @IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
> -*/
> -#define IWM_SCAN_COMP_STATUS_OK  0x1
> -#define IWM_SCAN_COMP_STATUS_ABORT   0x2
> -#define IWM_SCAN_COMP_STATUS_ERR_SLEEP   0x3
> -#define IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT0x4
> -#define IWM_SCAN_COMP_STATUS_ERR_PROBE   0x5
> -#define IWM_SCAN_COMP_STATUS_ERR_WAKEUP  0x6
> -#define IWM_SCAN_COMP_STATUS_ERR_ANTENNAS0x7
> -#define IWM_SCAN_COMP_STATUS_ERR_INTERNAL0x8
> -#define IWM_SCAN_COMP_STATUS_ERR_COEX0x9
> -#define IWM_SCAN_COMP_STATUS_P2P_ACTION_OK   0xA
> -#define IWM_SCAN_COMP_STATUS_ITERATION_END   0x0B
> -#define IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE0x0C
> -
> -/**
> - * struct iwm_scan_results_notif - scan results for one channel
> - * ( IWM_SCAN_RESULTS_NOTIFICATION = 0x83 )
> + * struct iwm_scan_results_notif - scan results for one channel -
> + *  SCAN_RESULT_NTF_API_S_VER_3
>   * @channel: which channel the results are from
>   * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
>   * @probe_status: IWM_SCAN_PROBE_STATUS_*, indicates success of probe request
>   * @num_probe_not_sent: # of request that weren't sent due to not enough time
>   * @duration: duration spent in channel, in usecs
> - * @statistics: statistics gathered for this channel
>   */
>  struct iwm_scan_results_notif {
>   uint8_t channel;
> @@ -5050,29 +5016,7 @@
>   uint8_t probe_status;
>   uint8_t num_probe_not_sent;
>   uint32_t duration;
> - uint32_t statistics[IWM_SCAN_RESULTS_STATISTICS];
> -} __packed; /* IWM_SCAN_RESULT_NTF_API_S_VER_2 */
> -
> -/**
> - * struct iwm_scan_complete_notif - notifies end of scanning (all channels)
> - * ( IWM_SCAN_COMPLETE_NOTIFICATION = 0x84 )
> - * @scanned_channels: number of channels scanned (and number of valid 
> results)
> - * @status: one of IWM_SCAN_COMP_STATUS_*
> - * @bt_status: BT on/off status
> - * @last_channel: last channel that was scanned
> - * @tsf_low: TSF timer (lower half) in usecs
> - * @tsf_high: TSF timer (higher half) in usecs
> - * @results: all scan results, only "scanned_channels" of them are valid
> - */
> -struct iwm_scan_complete_notif {
> - uint8_t scanned_channels;
> - uint8_t status;
> - uint8_t bt_status;
> - uint8_t last_channel;
> - uint32_t tsf_low;
> - uint32_t tsf_high;
> - struct iwm_scan_results_notif results[IWM_MAX_NUM_SCAN_CHANNELS];
> -} __packed; /* IWM_SCAN_COMPLETE_NTF_API_S_VER_2 */
> +} 

iwm(4): Update struct iwm_scan_results_notif. Remove a few old defines.

2017-01-16 Thread Imre Vadász
Hi,
This patch updates the struct iwm_scan_results_notif to FW Api version 3,
and removes the unused enum iwm_scan_complete_status status codes, as well
as the deprecated/unused struct iwm_scan_complete_notif.

This corresponds to the Linux iwlwifi commits
1083fd7391e989be52022f0f338e9dadc048b063 and
75118fdb63496e4611ab50380499ddd62b9de69f.
No functional change, since struct iwm_scan_results_notif isn't accessed
in iwm at the moment.

Index: sys/dev/pci/if_iwmreg.h
===
RCS file: /cvs/src/sys/dev/pci/if_iwmreg.h,v
retrieving revision 1.21
diff -u -r1.21 if_iwmreg.h
--- sys/dev/pci/if_iwmreg.h 10 Dec 2016 19:03:53 -  1.21
+++ sys/dev/pci/if_iwmreg.h 16 Jan 2017 16:23:01 -
@@ -5001,48 +5001,14 @@
 #define IWM_SCAN_PROBE_STATUS_FAIL_TTL (1 << 1)
 #define IWM_SCAN_PROBE_STATUS_FAIL_BT  (1 << 2)
 
-/* How many statistics are gathered for each channel */
-#define IWM_SCAN_RESULTS_STATISTICS 1
-
 /**
- * status codes for scan complete notifications
- * @IWM_SCAN_COMP_STATUS_OK:  scan completed successfully
- * @IWM_SCAN_COMP_STATUS_ABORT: scan was aborted by user
- * @IWM_SCAN_COMP_STATUS_ERR_SLEEP: sending null sleep packet failed
- * @IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT: timeout before channel is ready
- * @IWM_SCAN_COMP_STATUS_ERR_PROBE: sending probe request failed
- * @IWM_SCAN_COMP_STATUS_ERR_WAKEUP: sending null wakeup packet failed
- * @IWM_SCAN_COMP_STATUS_ERR_ANTENNAS: invalid antennas chosen at scan command
- * @IWM_SCAN_COMP_STATUS_ERR_INTERNAL: internal error caused scan abort
- * @IWM_SCAN_COMP_STATUS_ERR_COEX: medium was lost ot WiMax
- * @IWM_SCAN_COMP_STATUS_P2P_ACTION_OK: P2P public action frame TX was 
successful
- * (not an error!)
- * @IWM_SCAN_COMP_STATUS_ITERATION_END: indicates end of one repeatition the 
driver
- * asked for
- * @IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE: scan could not allocate time events
-*/
-#define IWM_SCAN_COMP_STATUS_OK0x1
-#define IWM_SCAN_COMP_STATUS_ABORT 0x2
-#define IWM_SCAN_COMP_STATUS_ERR_SLEEP 0x3
-#define IWM_SCAN_COMP_STATUS_ERR_CHAN_TIMEOUT  0x4
-#define IWM_SCAN_COMP_STATUS_ERR_PROBE 0x5
-#define IWM_SCAN_COMP_STATUS_ERR_WAKEUP0x6
-#define IWM_SCAN_COMP_STATUS_ERR_ANTENNAS  0x7
-#define IWM_SCAN_COMP_STATUS_ERR_INTERNAL  0x8
-#define IWM_SCAN_COMP_STATUS_ERR_COEX  0x9
-#define IWM_SCAN_COMP_STATUS_P2P_ACTION_OK 0xA
-#define IWM_SCAN_COMP_STATUS_ITERATION_END 0x0B
-#define IWM_SCAN_COMP_STATUS_ERR_ALLOC_TE  0x0C
-
-/**
- * struct iwm_scan_results_notif - scan results for one channel
- * ( IWM_SCAN_RESULTS_NOTIFICATION = 0x83 )
+ * struct iwm_scan_results_notif - scan results for one channel -
+ *  SCAN_RESULT_NTF_API_S_VER_3
  * @channel: which channel the results are from
  * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
  * @probe_status: IWM_SCAN_PROBE_STATUS_*, indicates success of probe request
  * @num_probe_not_sent: # of request that weren't sent due to not enough time
  * @duration: duration spent in channel, in usecs
- * @statistics: statistics gathered for this channel
  */
 struct iwm_scan_results_notif {
uint8_t channel;
@@ -5050,29 +5016,7 @@
uint8_t probe_status;
uint8_t num_probe_not_sent;
uint32_t duration;
-   uint32_t statistics[IWM_SCAN_RESULTS_STATISTICS];
-} __packed; /* IWM_SCAN_RESULT_NTF_API_S_VER_2 */
-
-/**
- * struct iwm_scan_complete_notif - notifies end of scanning (all channels)
- * ( IWM_SCAN_COMPLETE_NOTIFICATION = 0x84 )
- * @scanned_channels: number of channels scanned (and number of valid results)
- * @status: one of IWM_SCAN_COMP_STATUS_*
- * @bt_status: BT on/off status
- * @last_channel: last channel that was scanned
- * @tsf_low: TSF timer (lower half) in usecs
- * @tsf_high: TSF timer (higher half) in usecs
- * @results: all scan results, only "scanned_channels" of them are valid
- */
-struct iwm_scan_complete_notif {
-   uint8_t scanned_channels;
-   uint8_t status;
-   uint8_t bt_status;
-   uint8_t last_channel;
-   uint32_t tsf_low;
-   uint32_t tsf_high;
-   struct iwm_scan_results_notif results[IWM_MAX_NUM_SCAN_CHANNELS];
-} __packed; /* IWM_SCAN_COMPLETE_NTF_API_S_VER_2 */
+} __packed;
 
 #define IWM_SCAN_CLIENT_SCHED_SCAN (1 << 0)
 #define IWM_SCAN_CLIENT_NETDETECT  (1 << 1)