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_main.c
          +++ new/usr/src/uts/common/io/arn/arn_main.c
↓ open down ↓ 494 lines elided ↑ open up ↑
 495  495              ATH_BCBUF, DDI_DMA_STREAMING);
 496  496          if (err != DDI_SUCCESS) {
 497  497                  arn_desc_free(sc);
 498  498                  return (err);
 499  499          }
 500  500  #endif
 501  501  
 502  502          return (DDI_SUCCESS);
 503  503  }
 504  504  
 505      -static struct ath_rate_table *
 506      -/* LINTED E_STATIC_UNUSED */
 507      -arn_get_ratetable(struct arn_softc *sc, uint32_t mode)
 508      -{
 509      -        struct ath_rate_table *rate_table = NULL;
 510      -
 511      -        switch (mode) {
 512      -        case IEEE80211_MODE_11A:
 513      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11A];
 514      -                break;
 515      -        case IEEE80211_MODE_11B:
 516      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11B];
 517      -                break;
 518      -        case IEEE80211_MODE_11G:
 519      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11G];
 520      -                break;
 521      -#ifdef ARB_11N
 522      -        case IEEE80211_MODE_11NA_HT20:
 523      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11NA_HT20];
 524      -                break;
 525      -        case IEEE80211_MODE_11NG_HT20:
 526      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11NG_HT20];
 527      -                break;
 528      -        case IEEE80211_MODE_11NA_HT40PLUS:
 529      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11NA_HT40PLUS];
 530      -                break;
 531      -        case IEEE80211_MODE_11NA_HT40MINUS:
 532      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11NA_HT40MINUS];
 533      -                break;
 534      -        case IEEE80211_MODE_11NG_HT40PLUS:
 535      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11NG_HT40PLUS];
 536      -                break;
 537      -        case IEEE80211_MODE_11NG_HT40MINUS:
 538      -                rate_table = sc->hw_rate_table[ATH9K_MODE_11NG_HT40MINUS];
 539      -                break;
 540      -#endif
 541      -        default:
 542      -                ARN_DBG((ARN_DBG_FATAL, "arn: arn_get_ratetable(): "
 543      -                    "invalid mode %u\n", mode));
 544      -                return (NULL);
 545      -        }
 546      -
 547      -        return (rate_table);
 548      -
 549      -}
 550      -
 551  505  static void
 552  506  arn_setcurmode(struct arn_softc *sc, enum wireless_mode mode)
 553  507  {
 554  508          struct ath_rate_table *rt;
 555  509          int i;
 556  510  
 557  511          for (i = 0; i < sizeof (sc->asc_rixmap); i++)
 558  512                  sc->asc_rixmap[i] = 0xff;
 559  513  
 560  514          rt = sc->hw_rate_table[mode];
↓ open down ↓ 408 lines elided ↑ open up ↑
 969  923  
 970  924  /*
 971  925   *  This routine performs the periodic noise floor calibration function
 972  926   *  that is used to adjust and optimize the chip performance.  This
 973  927   *  takes environmental changes (location, temperature) into account.
 974  928   *  When the task is complete, it reschedules itself depending on the
 975  929   *  appropriate interval that was calculated.
 976  930   */
 977  931  static void
 978  932  arn_ani_calibrate(void *arg)
 979      -
 980  933  {
 981  934          ieee80211com_t *ic = (ieee80211com_t *)arg;
 982  935          struct arn_softc *sc = (struct arn_softc *)ic;
 983  936          struct ath_hal *ah = sc->sc_ah;
 984  937          boolean_t longcal = B_FALSE;
 985  938          boolean_t shortcal = B_FALSE;
 986  939          boolean_t aniflag = B_FALSE;
 987  940          unsigned int timestamp = drv_hztousec(ddi_get_lbolt())/1000;
 988  941          uint32_t cal_interval;
 989  942  
↓ open down ↓ 20 lines elided ↑ open up ↑
1010  963                          ARN_DBG((ARN_DBG_CALIBRATE, "arn: "
1011  964                              "%s: shortcal @%lu\n",
1012  965                              __func__, drv_hztousec));
1013  966                          sc->sc_ani.sc_shortcal_timer = timestamp;
1014  967                          sc->sc_ani.sc_resetcal_timer = timestamp;
1015  968                  }
1016  969          } else {
1017  970                  if ((timestamp - sc->sc_ani.sc_resetcal_timer) >=
1018  971                      ATH_RESTART_CALINTERVAL) {
1019  972                          ath9k_hw_reset_calvalid(ah, ah->ah_curchan,
1020      -                                                &sc->sc_ani.sc_caldone);
      973 +                            &sc->sc_ani.sc_caldone);
1021  974                          if (sc->sc_ani.sc_caldone)
1022  975                                  sc->sc_ani.sc_resetcal_timer = timestamp;
1023  976                  }
1024  977          }
1025  978  
1026  979          /* Verify whether we must check ANI */
1027  980          if ((timestamp - sc->sc_ani.sc_checkani_timer) >=
1028  981              ATH_ANI_POLLINTERVAL) {
1029  982                  aniflag = B_TRUE;
1030  983                  sc->sc_ani.sc_checkani_timer = timestamp;
↓ open down ↓ 1590 lines elided ↑ open up ↑
2621 2574              ATH9K_CIPHER_MIC, NULL))
2622 2575                  ic->ic_caps |= IEEE80211_C_TKIPMIC;
2623 2576  }
2624 2577  
2625 2578  static void
2626 2579  arn_setup_ht_cap(struct arn_softc *sc)
2627 2580  {
2628 2581  #define ATH9K_HT_CAP_MAXRXAMPDU_65536 0x3       /* 2 ^ 16 */
2629 2582  #define ATH9K_HT_CAP_MPDUDENSITY_8 0x6          /* 8 usec */
2630 2583  
2631      -        /* LINTED E_FUNC_SET_NOT_USED */
2632      -        uint8_t tx_streams;
2633 2584          uint8_t rx_streams;
2634 2585  
2635 2586          arn_ht_conf *ht_info = &sc->sc_ht_conf;
2636 2587  
2637 2588          ht_info->ht_supported = B_TRUE;
2638 2589  
2639 2590          /* Todo: IEEE80211_HTCAP_SMPS */
2640 2591          ht_info->cap = IEEE80211_HTCAP_CHWIDTH40|
2641 2592              IEEE80211_HTCAP_SHORTGI40 |
2642 2593              IEEE80211_HTCAP_DSSSCCK40;
2643 2594  
2644 2595          ht_info->ampdu_factor = ATH9K_HT_CAP_MAXRXAMPDU_65536;
2645 2596          ht_info->ampdu_density = ATH9K_HT_CAP_MPDUDENSITY_8;
2646 2597  
2647 2598          /* set up supported mcs set */
2648 2599          (void) memset(&ht_info->rx_mcs_mask, 0, sizeof (ht_info->rx_mcs_mask));
2649      -        tx_streams = ISP2(sc->sc_ah->ah_caps.tx_chainmask) ? 1 : 2;
2650 2600          rx_streams = ISP2(sc->sc_ah->ah_caps.rx_chainmask) ? 1 : 2;
2651 2601  
2652 2602          ht_info->rx_mcs_mask[0] = 0xff;
2653 2603          if (rx_streams >= 2)
2654 2604                  ht_info->rx_mcs_mask[1] = 0xff;
2655 2605  }
2656 2606  
2657 2607  /* xxx should be used for ht rate set negotiating ? */
2658 2608  static void
2659 2609  arn_overwrite_11n_rateset(struct arn_softc *sc)
↓ open down ↓ 834 lines elided ↑ open up ↑
3494 3444          (void) ath9k_hw_phy_disable(ah);
3495 3445  
3496 3446          return (DDI_SUCCESS);
3497 3447  }
3498 3448  
3499 3449  DDI_DEFINE_STREAM_OPS(arn_dev_ops, nulldev, nulldev, arn_attach, arn_detach,
3500 3450      nodev, NULL, D_MP, NULL, arn_quiesce);
3501 3451  
3502 3452  static struct modldrv arn_modldrv = {
3503 3453          &mod_driverops, /* Type of module.  This one is a driver */
3504      -        "arn-Atheros 9000 series driver:2.0", /* short description */
     3454 +        "Atheros 9000 series driver", /* short description */
3505 3455          &arn_dev_ops /* driver specific ops */
3506 3456  };
3507 3457  
3508 3458  static struct modlinkage modlinkage = {
3509 3459          MODREV_1, (void *)&arn_modldrv, NULL
3510 3460  };
3511 3461  
3512 3462  int
3513 3463  _info(struct modinfo *modinfop)
3514 3464  {
↓ open down ↓ 38 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX