Print this page
7154 arn(7D) walks out of bounds when byteswapping the 4K eeprom
7152 weird condition in arn(7D) needs clarification
7153 delete unused code in arn(7D)
7155 arn(7D) should include the mac fields in the eeprom enumeration

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/arn/arn_beacon.c
          +++ new/usr/src/uts/common/io/arn/arn_beacon.c
↓ open down ↓ 21 lines elided ↑ open up ↑
  22   22  #include <sys/param.h>
  23   23  #include <sys/strsun.h>
  24   24  #include <inet/common.h>
  25   25  #include <inet/nd.h>
  26   26  #include <inet/mi.h>
  27   27  #include <inet/wifi_ioctl.h>
  28   28  
  29   29  #include "arn_core.h"
  30   30  
  31   31  /*
  32      - * This function will modify certain transmit queue properties depending on
  33      - * the operating mode of the station (AP or AdHoc).  Parameters are AIFS
  34      - * settings and channel width min/max
  35      - */
  36      -
  37      -static int
  38      -/* LINTED E_STATIC_UNUSED */
  39      -arn_beaconq_config(struct arn_softc *sc)
  40      -{
  41      -        struct ath_hal *ah = sc->sc_ah;
  42      -        struct ath9k_tx_queue_info qi;
  43      -
  44      -        (void) ath9k_hw_get_txq_props(ah, sc->sc_beaconq, &qi);
  45      -        if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
  46      -                /* Always burst out beacon and CAB traffic. */
  47      -                qi.tqi_aifs = 1;
  48      -                qi.tqi_cwmin = 0;
  49      -                qi.tqi_cwmax = 0;
  50      -        } else {
  51      -                /* Adhoc mode; important thing is to use 2x cwmin. */
  52      -                qi.tqi_aifs = sc->sc_beacon_qi.tqi_aifs;
  53      -                qi.tqi_cwmin = 2*sc->sc_beacon_qi.tqi_cwmin;
  54      -                qi.tqi_cwmax = sc->sc_beacon_qi.tqi_cwmax;
  55      -        }
  56      -
  57      -        if (!ath9k_hw_set_txq_props(ah, sc->sc_beaconq, &qi)) {
  58      -                arn_problem("unable to update h/w beacon queue parameters\n");
  59      -                return (0);
  60      -        } else {
  61      -                /* push to h/w */
  62      -                (void) ath9k_hw_resettxqueue(ah, sc->sc_beaconq);
  63      -                return (1);
  64      -        }
  65      -}
  66      -
  67      -/*
  68   32   * Associates the beacon frame buffer with a transmit descriptor.  Will set
  69   33   * up all required antenna switch parameters, rate codes, and channel flags.
  70   34   * Beacons are always sent out at the lowest rate, and are not retried.
  71   35   */
  72   36  #ifdef ARN_IBSS
  73   37  static void
  74   38  arn_beacon_setup(struct arn_softc *sc, struct ath_buf *bf)
  75   39  {
  76   40  #define USE_SHPREAMBLE(_ic) \
  77   41          (((_ic)->ic_flags & (IEEE80211_F_SHPREAMBLE | IEEE80211_F_USEBARKER))\
↓ open down ↓ 67 lines elided ↑ open up ↑
 145  109  }
 146  110  #endif
 147  111  
 148  112  /*
 149  113   * Startup beacon transmission for adhoc mode when they are sent entirely
 150  114   * by the hardware using the self-linked descriptor + veol trick.
 151  115   */
 152  116  #ifdef ARN_IBSS
 153  117  static void
 154  118  arn_beacon_start_adhoc(struct arn_softc *sc)
 155      -
 156  119  {
 157  120          struct ath_buf *bf = list_head(&sc->sc_bcbuf_list);
 158  121          struct ieee80211_node *in = bf->bf_in;
 159  122          struct ieee80211com *ic = in->in_ic;
 160  123          struct ath_hal *ah = sc->sc_ah;
 161  124          mblk_t *mp;
 162  125  
 163  126          mp = bf->bf_m;
 164  127          if (ieee80211_beacon_update(ic, bf->bf_in, &sc->asc_boff, mp, 0))
 165  128                  bcopy(mp->b_rptr, bf->bf_dma.mem_va, MBLKL(mp));
↓ open down ↓ 84 lines elided ↑ open up ↑
 250  213                          ieee80211_free_node(bf->bf_in);
 251  214                          bf->bf_in = NULL;
 252  215                  }
 253  216                  bf = list_next(&sc->sc_bcbuf_list, bf);
 254  217          }
 255  218          mutex_exit(&sc->sc_bcbuflock);
 256  219  }
 257  220  
 258  221  void
 259  222  arn_beacon_config(struct arn_softc *sc)
 260      -
 261  223  {
 262  224          struct ath_beacon_config conf;
 263  225          ieee80211com_t *ic = (ieee80211com_t *)sc;
 264  226          struct ieee80211_node *in = ic->ic_bss;
 265  227  
 266  228          /* New added */
 267  229          struct ath9k_beacon_state bs;
 268  230          int dtimperiod, dtimcount, sleepduration;
 269  231          int cfpperiod, cfpcount;
 270  232          uint32_t nexttbtt = 0, intval, tsftu;
↓ open down ↓ 55 lines elided ↑ open up ↑
 326  288          bs.bs_cfpmaxduration = 0;
 327  289  
 328  290          /*
 329  291           * Calculate the number of consecutive beacons to miss* before taking
 330  292           * a BMISS interrupt. The configuration is specified in TU so we only
 331  293           * need calculate based on the beacon interval.  Note that we clamp the
 332  294           * result to at most 15 beacons.
 333  295           */
 334  296          if (sleepduration > intval) {
 335  297                  bs.bs_bmissthreshold = conf.listen_interval *
 336      -                        ATH_DEFAULT_BMISS_LIMIT / 2;
      298 +                    ATH_DEFAULT_BMISS_LIMIT / 2;
 337  299          } else {
 338  300                  bs.bs_bmissthreshold = DIV_ROUND_UP(conf.bmiss_timeout, intval);
 339  301                  if (bs.bs_bmissthreshold > 15)
 340  302                          bs.bs_bmissthreshold = 15;
 341  303                  else if (bs.bs_bmissthreshold == 0)
 342  304                          bs.bs_bmissthreshold = 1;
 343  305          }
 344  306  
 345  307          /*
 346  308           * Calculate sleep duration. The configuration is given in ms.
↓ open down ↓ 86 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX