Author: adrian
Date: Fri Aug 24 07:32:35 2012
New Revision: 239642
URL: http://svn.freebsd.org/changeset/base/239642

Log:
  Add the method to fetch the default DFS parameters for the AR5212 PHY.
  
  I need to check whether new parameters were added for the AR5413 NIC.
  
  PR:           kern/170904

Modified:
  head/sys/dev/ath/ath_hal/ar5212/ar5212.h
  head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212.h    Fri Aug 24 06:56:44 2012        
(r239641)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h    Fri Aug 24 07:32:35 2012        
(r239642)
@@ -633,6 +633,8 @@ extern      void ar5212AniReset(struct ath_ha
 extern HAL_BOOL ar5212IsNFCalInProgress(struct ath_hal *ah);
 extern HAL_BOOL ar5212WaitNFCalComplete(struct ath_hal *ah, int i);
 extern void ar5212EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
+extern HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah,
+           HAL_PHYERR_PARAM *pe);
 extern void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
 extern HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah,
            struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf,

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c     Fri Aug 24 06:56:44 
2012        (r239641)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c     Fri Aug 24 07:32:35 
2012        (r239642)
@@ -137,6 +137,7 @@ static const struct ath_hal_private ar52
        /* DFS Functions */
        .ah_enableDfs                   = ar5212EnableDfs,
        .ah_getDfsThresh                = ar5212GetDfsThresh,
+       .ah_getDfsDefaultThresh         = ar5212GetDfsDefaultThresh,
        .ah_procRadarEvent              = ar5212ProcessRadarEvent,
        .ah_isFastClockEnabled          = ar5212IsFastClockEnabled,
        .ah_get11nExtBusy               = ar5212Get11nExtBusy,

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c       Fri Aug 24 06:56:44 
2012        (r239641)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c       Fri Aug 24 07:32:35 
2012        (r239642)
@@ -1163,6 +1163,35 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_
        OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA);
 }
 
+/*
+ * Parameters for the AR5212 PHY.
+ *
+ * TODO: figure out what values were added for the AR5413 and later
+ * PHY; update these here.
+ */
+#define        AR5212_DFS_FIRPWR       -41
+#define        AR5212_DFS_RRSSI        12
+#define        AR5212_DFS_HEIGHT       20
+#define        AR5212_DFS_PRSSI        22
+#define        AR5212_DFS_INBAND       6
+
+HAL_BOOL
+ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
+{
+
+       pe->pe_firpwr = AR5212_DFS_FIRPWR;
+       pe->pe_rrssi = AR5212_DFS_RRSSI;
+       pe->pe_height = AR5212_DFS_HEIGHT;
+       pe->pe_prssi = AR5212_DFS_PRSSI;
+       pe->pe_inband = AR5212_DFS_INBAND;
+       /* XXX look up what is needed for the AR5413 */
+       pe->pe_relpwr = 0;
+       pe->pe_relstep = 0;
+       pe->pe_maxlen = 0;
+
+       return (AH_TRUE);
+}
+
 void
 ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe)
 {
@@ -1250,7 +1279,7 @@ ar5212Get11nExtBusy(struct ath_hal *ah)
 }
 
 /*
- * There's no channel survey support for the AR5211.
+ * There's no channel survey support for the AR5212.
  */
 HAL_BOOL
 ar5212GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to