Changeset 1478
- Timestamp:
- 03/21/06 22:36:32 (3 years ago)
- Files:
-
- trunk/ath/if_ath.c (modified) (9 diffs)
- trunk/ath/if_athvar.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ath/if_ath.c
r1475 r1478 111 111 static void ath_vap_delete(struct ieee80211vap *); 112 112 static int ath_init(struct net_device *); 113 static int ath_set_ack_bitrate(struct ath_softc *, int); 113 114 static int ath_reset(struct net_device *); 114 115 static void ath_fatal_tasklet(TQUEUE_ARG); … … 391 392 u_int8_t csz; 392 393 394 sc->devid = devid; 393 395 sc->sc_debug = ath_debug; 394 396 DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); … … 1902 1904 */ 1903 1905 ath_chan_change(sc, ic->ic_curchan); 1906 ath_set_ack_bitrate(sc, sc->sc_ackrate); 1904 1907 dev->flags |= IFF_RUNNING; /* we are ready to go */ 1905 1908 ieee80211_start_running(ic); /* start all vap's */ … … 2006 2009 } 2007 2010 2011 static int 2012 ar_device(int devid) 2013 { 2014 switch (devid) { 2015 case AR5210_DEFAULT: 2016 case AR5210_PROD: 2017 case AR5210_AP: 2018 return 5210; 2019 case AR5211_DEFAULT: 2020 case AR5311_DEVID: 2021 case AR5211_LEGACY: 2022 case AR5211_FPGA11B: 2023 return 5211; 2024 case AR5212_DEFAULT: 2025 case AR5212_DEVID: 2026 case AR5212_FPGA: 2027 case AR5212_DEVID_IBM: 2028 case AR5212_AR5312_REV2: 2029 case AR5212_AR5312_REV7: 2030 case AR5212_AR2313_REV8: 2031 case AR5212_AR2315_REV6: 2032 case AR5212_AR2315_REV7: 2033 case AR5212_AR2317_REV1: 2034 case AR5212_DEVID_0014: 2035 case AR5212_DEVID_0015: 2036 case AR5212_DEVID_0016: 2037 case AR5212_DEVID_0017: 2038 case AR5212_DEVID_0018: 2039 case AR5212_DEVID_0019: 2040 case AR5212_AR2413: 2041 case AR5212_AR5413: 2042 case AR5212_AR5424: 2043 case AR5212_DEVID_FF19: 2044 return 5212; 2045 case AR5213_SREV_1_0: 2046 case AR5213_SREV_REG: 2047 case AR_SUBVENDOR_ID_NOG: 2048 case AR_SUBVENDOR_ID_NEW_A: 2049 return 5213; 2050 default: 2051 return 0; /* unknown */ 2052 } 2053 } 2054 2055 2056 static int 2057 ath_set_ack_bitrate(struct ath_softc *sc, int high) 2058 { 2059 struct ath_hal *ah = sc->sc_ah; 2060 if (ar_device(sc->devid) == 5212 || ar_device(sc->devid) == 5213) { 2061 /* set ack to be sent at low bit-rate */ 2062 /* registers taken from the openbsd 5212 hal */ 2063 #define AR5K_AR5212_STA_ID1 0x8004 2064 #define AR5K_AR5212_STA_ID1_ACKCTS_6MB 0x01000000 2065 #define AR5K_AR5212_STA_ID1_BASE_RATE_11B 0x02000000 2066 u_int32_t v = AR5K_AR5212_STA_ID1_BASE_RATE_11B | AR5K_AR5212_STA_ID1_ACKCTS_6MB; 2067 if (high) { 2068 OS_REG_WRITE(ah, AR5K_AR5212_STA_ID1, OS_REG_READ(ah, AR5K_AR5212_STA_ID1) & ~v); 2069 } else { 2070 OS_REG_WRITE(ah, AR5K_AR5212_STA_ID1, OS_REG_READ(ah, AR5K_AR5212_STA_ID1) | v); 2071 } 2072 return 0; 2073 } 2074 return 1; 2075 } 2076 2008 2077 /* 2009 2078 * Reset the hardware w/o losing operational state. This is … … 2053 2122 ath_beacon_config(sc, NULL); /* restart beacons */ 2054 2123 ath_hal_intrset(ah, sc->sc_imask); 2055 2124 ath_set_ack_bitrate(sc, sc->sc_ackrate); 2056 2125 netif_wake_queue(dev); /* restart xmit */ 2057 2126 #ifdef ATH_SUPERG_XR … … 8975 9044 ATH_XR_POLL_PERIOD = 20, 8976 9045 ATH_XR_POLL_COUNT = 21, 9046 ATH_ACKRATE = 22, 8977 9047 }; 8978 9048 … … 9100 9170 break; 9101 9171 #endif 9172 case ATH_ACKRATE: 9173 sc->sc_ackrate = val; 9174 ath_set_ack_bitrate(sc, sc->sc_ackrate); 9175 break; 9102 9176 default: 9103 9177 return -EINVAL; … … 9156 9230 break; 9157 9231 #endif 9232 case ATH_ACKRATE: 9233 val = sc->sc_ackrate; 9234 break; 9158 9235 default: 9159 9236 return -EINVAL; … … 9254 9331 }, 9255 9332 #endif 9333 { .ctl_name = ATH_ACKRATE, 9334 .procname = "ackrate", 9335 .mode = 0644, 9336 .proc_handler = ath_sysctl_halparam 9337 }, 9256 9338 { 0 } 9257 9339 }; trunk/ath/if_athvar.h
r1441 r1478 465 465 struct net_device_stats sc_devstats; /* device statistics */ 466 466 struct ath_stats sc_stats; /* private statistics */ 467 int devid; 467 468 int sc_debug; 468 469 void (*sc_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int, int, u_int32_t); … … 504 505 sc_rtasksched:1, /* radar task is scheduled */ 505 506 sc_dfswait:1, /* waiting on channel for radar detect */ 506 sc_dfstest:1; /* Test timer in progress */ 507 sc_dfstest:1, /* Test timer in progress */ 508 sc_ackrate:1; /* send acks at high bitrate */ 507 509 /* rate tables */ 508 510 const HAL_RATE_TABLE *sc_rates[IEEE80211_MODE_MAX];
