9418 iwn: rate array in struct iwn_ks_txpower should have size IWN_RIDX_MAX+1

Review Request #1060 — Created March 28, 2018 and submitted

tsoome
illumos-gate
9418
0cd7312...
general

9418 iwn: rate array in struct iwn_ks_txpower should have size IWN_RIDX_MAX+1



  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
andy_js
  1. An explanation would be nice.

    1. As much as I can read, it seems the rate array should correspond to power array, which is sized as IWN_RIDX_MAX + 1.

  2. 
      
marcel
  1. 
      
  2. usr/src/uts/common/io/iwn/if_iwnvar.h (Diff revision 1)
     
     

    You probably also wants to change this:

    600     for (r = 0; r != IWN_RIDX_MAX; r++) {
    

    to this

    600     for (r = 0; r <= IWN_RIDX_MAX; r++) {
    

    in if_iwn.c.

  3. 
      
tsoome
marcel
  1. Ship It!
  2. 
      
rm
  1. Is it possible to get some analysis about what's going on and why we need this?

    1. Apparently the IWN_RIDX_MAX (32) is not the max number of rates, but last valid index, hence the code we have and also freebsd and netbsd are having loops like:

      for (ridx = 0; ridx <= IWN_RIDX_MAX; ridx++)
      

      There is also comment: http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/iwn/if_iwn.c#4661

      telling us: Set TX power for current channel (each rate has its own power settings). From this hint, we can conclude that we would need an array for power stats with size IWN_RIDX_MAX + 1, note the same is done in struct iwn4965_cmd_txpower (http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/io/iwn/if_iwnreg.h#882).

    2. Thanks, this is a big help. Let's get this into the ticket and update the synopsis to cover what's going on a bit more if you don't mind.

  2. 
      
rm
  1. Ship It!
  2. 
      
citrus
  1. Ship It!
  2. 
      
tsoome
tsoome
rm
  1. Ship It!
  2. 
      
tsoome
marcel
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...