Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #1017: ar5418_dmasize.diff

File ar5418_dmasize.diff, 3.2 kB (added by mentor, 11 years ago)

Patch to test the effect of stomping on the HW DMA size settings.

  • ath/if_ath_hal_extensions.h

    old new  
    143143#define DEFAULT_AR5K_PHY_SPUR_THRESH            2 
    144144#define DEFAULT_AR5K_PHY_SIG_FIRSTEP            0 
    145145 
     146/* 
     147 * Transmit configuration register 
     148 */ 
     149#define AR5K_TXCFG              0x0030                  /* Register Address */ 
     150#define AR5K_TXCFG_SDMAMR       0x00000007      /* DMA size */ 
     151#define AR5K_TXCFG_SDMAMR_S     0 
     152 
     153/* 
     154 * Receive configuration register 
     155 */ 
     156#define AR5K_RXCFG              0x0034                  /* Register Address */ 
     157#define AR5K_RXCFG_SDMAMW       0x00000007      /* DMA size */ 
     158#define AR5K_RXCFG_SDMAMW_S     0 
     159 
     160/* 
     161 * DMA size definitions (2^(n+2)) 
     162 */ 
     163enum ath5k_dmasize { 
     164        AR5K_DMASIZE_4B = 0, 
     165        AR5K_DMASIZE_8B, 
     166        AR5K_DMASIZE_16B, 
     167        AR5K_DMASIZE_32B, 
     168        AR5K_DMASIZE_64B, 
     169        AR5K_DMASIZE_128B, 
     170        AR5K_DMASIZE_256B, 
     171        AR5K_DMASIZE_512B 
     172}; 
     173 
    146174static inline unsigned long field_width(unsigned long mask, unsigned long shift) 
    147175{ 
    148176        unsigned long r = 0; 
     
    429457        VERIFICATION_WARNING(ah, AR5K_PHY_SPUR, AR5K_PHY_SPUR_THRESH, 0); 
    430458} 
    431459 
     460static inline void ath_hal_set_dmasize_pcie(struct ath_hal *ah) { 
     461        SET_FIELD(ah, AR5K_TXCFG, AR5K_TXCFG_SDMAMR, AR5K_DMASIZE_128B); 
     462        SET_FIELD(ah, AR5K_RXCFG, AR5K_RXCFG_SDMAMW, AR5K_DMASIZE_128B); 
     463} 
     464 
    432465#endif /* _IF_ATH_HAL_EXTENSIONS_H_ */ 
  • ath/if_athvar.h

    old new  
    692692        unsigned int    sc_txcont:1;            /* Is continuous transmit enabled? */ 
    693693        unsigned int    sc_dfs_testmode:1;      /* IF this is on, AP vaps will stay in 
    694694                                                 * 'channel availability check' indefinately, 
    695                                                  * reporting radar and interference detections. 
    696                                                  */ 
     695                                                 * reporting radar and interference detections. */ 
     696        unsigned int    sc_dmasize_stomp:1;     /* Whether to stomp on DMA size. */ 
     697 
    697698        unsigned int sc_txcont_power; /* Continuous transmit power in 0.5dBm units */ 
    698699        unsigned int sc_txcont_rate;  /* Continuous transmit rate in Mbps */ 
    699700 
  • ath/if_ath_pci.c

    old new  
    252252                dev_info, dev->name, athname ? athname : "Atheros ???", 
    253253                (unsigned long long)phymem, dev->irq); 
    254254 
     255        if (vdevice == AR5418_DEVID) 
     256                sc->aps_sc.sc_dmasize_stomp = 1; 
     257 
    255258        /* ready to process interrupts */ 
    256259        sc->aps_sc.sc_invalid = 0; 
    257260 
  • ath/if_ath.c

    old new  
    632632                IPRINTF(sc, "Interference mitigation is supported.  Currently %s.\n", 
    633633                        (sc->sc_useintmit ? "enabled" : "disabled")); 
    634634        } 
     635 
     636        sc->sc_dmasize_stomp = 0; 
     637 
    635638        /* 
    636639         * Check if the MAC has multi-rate retry support. 
    637640         * We do this by trying to setup a fake extended 
     
    17081711#endif 
    17091712/* XXX: Any other features they clobber? */ 
    17101713        ath_override_intmit_if_disabled(sc); 
     1714        if (sc->sc_dmasize_stomp) 
     1715                ath_hal_set_dmasize_pcie(sc->sc_ah); 
    17111716        if (sc->sc_softled) 
    17121717                ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin); 
    17131718        ath_update_txpow(sc);           /* update tx power state */