Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Get improvements from FreeBSD-current (January 2011).



details:   https://anonhg.NetBSD.org/src/rev/739c4401b887
branches:  trunk
changeset: 762985:739c4401b887
user:      cegger <cegger%NetBSD.org@localhost>
date:      Mon Mar 07 11:25:41 2011 +0000

description:
Get improvements from FreeBSD-current (January 2011).
Successfully tested with WEP, WPA and WPA2 on AR9285.
Reviewed by jmcneill@

diffstat:

 sys/dev/ic/ath.c                                             |   10 +-
 sys/dev/ic/ath_netbsd.c                                      |    7 +-
 sys/dev/ic/athvar.h                                          |    6 +-
 sys/external/isc/atheros_hal/dist/ah.c                       |    7 +-
 sys/external/isc/atheros_hal/dist/ah.h                       |   34 +-
 sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c            |   21 +-
 sys/external/isc/atheros_hal/dist/ah_eeprom_v3.c             |    4 +-
 sys/external/isc/atheros_hal/dist/ah_internal.h              |   24 +-
 sys/external/isc/atheros_hal/dist/ar5210/ar5210.h            |    5 +-
 sys/external/isc/atheros_hal/dist/ar5210/ar5210_attach.c     |    7 +-
 sys/external/isc/atheros_hal/dist/ar5210/ar5210_interrupts.c |    6 +-
 sys/external/isc/atheros_hal/dist/ar5210/ar5210_misc.c       |    4 +-
 sys/external/isc/atheros_hal/dist/ar5210/ar5210_reset.c      |    4 +-
 sys/external/isc/atheros_hal/dist/ar5211/ar5211.h            |    5 +-
 sys/external/isc/atheros_hal/dist/ar5211/ar5211_attach.c     |    9 +-
 sys/external/isc/atheros_hal/dist/ar5211/ar5211_misc.c       |    4 +-
 sys/external/isc/atheros_hal/dist/ar5211/ar5211_reset.c      |    4 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212.h            |   11 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_ani.c        |   24 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_attach.c     |   24 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_gpio.c       |    4 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_interrupts.c |   30 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_misc.c       |   43 ++-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_power.c      |    4 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_recv.c       |   16 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_reset.c      |    4 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212_xmit.c       |    6 +-
 sys/external/isc/atheros_hal/dist/ar5212/ar5212reg.h         |   16 +-
 sys/external/isc/atheros_hal/dist/ar5312/ar5312.h            |    8 +-
 sys/external/isc/atheros_hal/dist/ar5312/ar5312_attach.c     |    5 +-
 sys/external/isc/atheros_hal/dist/ar5312/ar5312_gpio.c       |    4 +-
 sys/external/isc/atheros_hal/dist/ar5312/ar5312_reset.c      |    4 +-
 sys/external/isc/atheros_hal/dist/ar5312/ar5315_gpio.c       |    4 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416.h            |    7 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416_ani.c        |    8 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416_attach.c     |   28 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416_cal.c        |   48 ++-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416_cal_iq.c     |    4 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416_gpio.c       |  191 ++++++++--
 sys/external/isc/atheros_hal/dist/ar5416/ar5416_interrupts.c |   13 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416_reset.c      |   22 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416phy.h         |   10 +-
 sys/external/isc/atheros_hal/dist/ar5416/ar5416reg.h         |  163 +++++++--
 43 files changed, 622 insertions(+), 240 deletions(-)

diffs (truncated from 2172 to 300 lines):

diff -r 60c25afb68f9 -r 739c4401b887 sys/dev/ic/ath.c
--- a/sys/dev/ic/ath.c  Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/dev/ic/ath.c  Mon Mar 07 11:25:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ath.c,v 1.110 2011/02/20 03:55:56 jmcneill Exp $       */
+/*     $NetBSD: ath.c,v 1.111 2011/03/07 11:25:41 cegger Exp $ */
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
 __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.110 2011/02/20 03:55:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.111 2011/03/07 11:25:41 cegger Exp $");
 #endif
 
 /*
@@ -468,7 +468,8 @@
         */
        sc->sc_softled = (devid == AR5212_DEVID_IBM || devid == AR5211_DEVID);
        if (sc->sc_softled) {
-               ath_hal_gpioCfgOutput(ah, sc->sc_ledpin);
+               ath_hal_gpioCfgOutput(ah, sc->sc_ledpin,
+                   HAL_GPIO_MUX_MAC_NETWORK_LED);
                ath_hal_gpioset(ah, sc->sc_ledpin, !sc->sc_ledon);
        }
 
@@ -723,7 +724,8 @@
                        ath_hal_resettxqueue(ah, i);
 
        if (sc->sc_softled) {
-               ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin);
+               ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
+                   HAL_GPIO_MUX_MAC_NETWORK_LED);
                ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin, !sc->sc_ledon);
        }
        return true;
diff -r 60c25afb68f9 -r 739c4401b887 sys/dev/ic/ath_netbsd.c
--- a/sys/dev/ic/ath_netbsd.c   Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/dev/ic/ath_netbsd.c   Mon Mar 07 11:25:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ath_netbsd.c,v 1.19 2011/02/20 03:55:56 jmcneill Exp $ */
+/*     $NetBSD: ath_netbsd.c,v 1.20 2011/03/07 11:25:41 cegger Exp $ */
 
 /*-
  * Copyright (c) 2003, 2004 David Young
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ath_netbsd.c,v 1.19 2011/02/20 03:55:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath_netbsd.c,v 1.20 2011/03/07 11:25:41 cegger Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -183,7 +183,8 @@
        if (softled != sc->sc_softled) {
                if (softled) {
                        /* NB: handle any sc_ledpin change */
-                       ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin);
+                       ath_hal_gpioCfgOutput(sc->sc_ah, sc->sc_ledpin,
+                           HAL_GPIO_MUX_MAC_NETWORK_LED);
                        ath_hal_gpioset(sc->sc_ah, sc->sc_ledpin,
                                !sc->sc_ledon);
                }
diff -r 60c25afb68f9 -r 739c4401b887 sys/dev/ic/athvar.h
--- a/sys/dev/ic/athvar.h       Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/dev/ic/athvar.h       Mon Mar 07 11:25:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: athvar.h,v 1.33 2010/03/19 01:32:30 dyoung Exp $       */
+/*     $NetBSD: athvar.h,v 1.34 2011/03/07 11:25:41 cegger Exp $       */
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -571,8 +571,8 @@
 #define        ath_hal_gettxintrtxqs(_ah, _txqs) \
        ((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs)))
 
-#define ath_hal_gpioCfgOutput(_ah, _gpio) \
-        ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio)))
+#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \
+        ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type)))
 #define ath_hal_gpioset(_ah, _gpio, _b) \
         ((*(_ah)->ah_gpioSet)((_ah), (_gpio), (_b)))
 
diff -r 60c25afb68f9 -r 739c4401b887 sys/external/isc/atheros_hal/dist/ah.c
--- a/sys/external/isc/atheros_hal/dist/ah.c    Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/external/isc/atheros_hal/dist/ah.c    Mon Mar 07 11:25:41 2011 +0000
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah.c,v 1.2 2008/12/11 05:30:29 alc Exp $
+ * $Id: ah.c,v 1.3 2011/03/07 11:25:42 cegger Exp $
  */
 #include "opt_ah.h"
 
@@ -525,6 +525,11 @@
        case HAL_CAP_RXTSTAMP_PREC:     /* rx desc tstamp precision (bits) */
                *result = pCap->halTstampPrecision;
                return HAL_OK;
+       case HAL_CAP_INTRMASK:          /* mask of supported interrupts */
+               *result = pCap->halIntrMask;
+               return HAL_OK;
+       case HAL_CAP_BSSIDMATCH:        /* hardware has disable bssid match */
+               return pCap->halBssidMatchSupport ? HAL_OK : HAL_ENOTSUPP;
        default:
                return HAL_EINVAL;
        }
diff -r 60c25afb68f9 -r 739c4401b887 sys/external/isc/atheros_hal/dist/ah.h
--- a/sys/external/isc/atheros_hal/dist/ah.h    Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/external/isc/atheros_hal/dist/ah.h    Mon Mar 07 11:25:41 2011 +0000
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah.h,v 1.3 2011/02/21 11:06:38 cegger Exp $
+ * $Id: ah.h,v 1.4 2011/03/07 11:25:42 cegger Exp $
  */
 
 #ifndef _ATH_AH_H_
@@ -63,6 +63,8 @@
        HAL_ENOTSUPP    = 13,   /* Hardware revision not supported */
        HAL_ESELFTEST   = 14,   /* Hardware self-test failed */
        HAL_EINPROGRESS = 15,   /* Operation incomplete */
+       HAL_EEBADREG    = 16,   /* EEPROM invalid regulatory contents */
+       HAL_EEBADCC     = 17,   /* EEPROM invalid country code */
 } HAL_STATUS;
 
 typedef enum {
@@ -107,6 +109,8 @@
        HAL_CAP_RXTSTAMP_PREC   = 34,   /* rx desc tstamp precision (bits) */
        HAL_CAP_BB_HANG         = 35,   /* can baseband hang */
        HAL_CAP_MAC_HANG        = 36,   /* can MAC hang */
+       HAL_CAP_INTRMASK        = 37,   /* bitmask of supported interupts */
+       HAL_CAP_BSSIDMATCH      = 38,   /* hardware has disable bssid match */
 } HAL_CAPABILITY_TYPE;
 
 /* 
@@ -293,6 +297,7 @@
        HAL_RX_FILTER_PHYERR    = 0x00000100,   /* Allow phy errors */
        HAL_RX_FILTER_PHYRADAR  = 0x00000200,   /* Allow phy radar errors */
        HAL_RX_FILTER_COMPBAR   = 0x00000400,   /* Allow compressed BAR */
+       HAL_RX_FILTER_BSSID     = 0x00000800,   /* Disable BSSID match */
 } HAL_RX_FILTER;
 
 typedef enum {
@@ -319,19 +324,21 @@
        HAL_INT_RXORN   = 0x00000020,
        HAL_INT_TX      = 0x00000040,   /* Non-common mapping */
        HAL_INT_TXDESC  = 0x00000080,
+       HAL_INT_TIM_TIMER=0x00000100,
        HAL_INT_TXURN   = 0x00000800,
        HAL_INT_MIB     = 0x00001000,
        HAL_INT_RXPHY   = 0x00004000,
        HAL_INT_RXKCM   = 0x00008000,
        HAL_INT_SWBA    = 0x00010000,
        HAL_INT_BMISS   = 0x00040000,
-       HAL_INT_BNR     = 0x00100000,   /* Non-common mapping */
+       HAL_INT_BNR     = 0x00100000,
        HAL_INT_TIM     = 0x00200000,   /* Non-common mapping */
        HAL_INT_DTIM    = 0x00400000,   /* Non-common mapping */
        HAL_INT_DTIMSYNC= 0x00800000,   /* Non-common mapping */
        HAL_INT_GPIO    = 0x01000000,
        HAL_INT_CABEND  = 0x02000000,   /* Non-common mapping */
        HAL_INT_TSFOOR  = 0x04000000,   /* Non-common mapping */
+       HAL_INT_TBTT    = 0x08000000,   /* Non-common mapping */
        HAL_INT_CST     = 0x10000000,   /* Non-common mapping */
        HAL_INT_GTT     = 0x20000000,   /* Non-common mapping */
        HAL_INT_FATAL   = 0x40000000,   /* Non-common mapping */
@@ -339,7 +346,8 @@
        HAL_INT_BMISC   = HAL_INT_TIM
                        | HAL_INT_DTIM
                        | HAL_INT_DTIMSYNC
-                       | HAL_INT_CABEND,
+                       | HAL_INT_CABEND
+                       | HAL_INT_TBTT,
 
        /* Interrupt bits that map directly to ISR/IMR bits */
        HAL_INT_COMMON  = HAL_INT_RXNOFRM
@@ -353,10 +361,27 @@
                        | HAL_INT_RXKCM
                        | HAL_INT_SWBA
                        | HAL_INT_BMISS
+                       | HAL_INT_BNR
                        | HAL_INT_GPIO,
 } HAL_INT;
 
 typedef enum {
+       HAL_GPIO_MUX_OUTPUT             = 0,
+       HAL_GPIO_MUX_PCIE_ATTENTION_LED = 1,
+       HAL_GPIO_MUX_PCIE_POWER_LED     = 2,
+       HAL_GPIO_MUX_TX_FRAME           = 3,
+       HAL_GPIO_MUX_RX_CLEAR_EXTERNAL  = 4,
+       HAL_GPIO_MUX_MAC_NETWORK_LED    = 5,
+       HAL_GPIO_MUX_MAC_POWER_LED      = 6
+} HAL_GPIO_MUX_TYPE;
+
+typedef enum {
+       HAL_GPIO_INTR_LOW               = 0,
+       HAL_GPIO_INTR_HIGH              = 1,
+       HAL_GPIO_INTR_DISABLE           = 2
+} HAL_GPIO_INTR_TYPE;
+
+typedef enum {
        HAL_RFGAIN_INACTIVE             = 0,
        HAL_RFGAIN_READ_REQUESTED       = 1,
        HAL_RFGAIN_NEED_CHANGE          = 2
@@ -764,7 +789,8 @@
        void      __ahdecl(*ah_setLedState)(struct ath_hal*, HAL_LED_STATE);
        void      __ahdecl(*ah_writeAssocid)(struct ath_hal*,
                                const uint8_t *bssid, uint16_t assocId);
-       HAL_BOOL  __ahdecl(*ah_gpioCfgOutput)(struct ath_hal *, uint32_t gpio);
+       HAL_BOOL  __ahdecl(*ah_gpioCfgOutput)(struct ath_hal *,
+                               uint32_t gpio, HAL_GPIO_MUX_TYPE);
        HAL_BOOL  __ahdecl(*ah_gpioCfgInput)(struct ath_hal *, uint32_t gpio);
        uint32_t __ahdecl(*ah_gpioGet)(struct ath_hal *, uint32_t gpio);
        HAL_BOOL  __ahdecl(*ah_gpioSet)(struct ath_hal *,
diff -r 60c25afb68f9 -r 739c4401b887 sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c
--- a/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/external/isc/atheros_hal/dist/ah_eeprom_v14.c Mon Mar 07 11:25:41 2011 +0000
@@ -14,9 +14,8 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah_eeprom_v14.c,v 1.4 2008/12/31 14:08:46 christos Exp $
+ * $Id: ah_eeprom_v14.c,v 1.5 2011/03/07 11:25:42 cegger Exp $
  */
-#include <sys/endian.h>
 #include "opt_ah.h"
 
 #include "ah.h"
@@ -54,8 +53,8 @@
                        HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad mac address %s\n",
                            __func__, ath_hal_ether_sprintf(macaddr));
                        return HAL_EEBADMAC;
-               } else
-                       return HAL_OK;
+               }
+               return HAL_OK;
         case AR_EEP_REGDMN_0:
                return pBase->regDmn[0];
         case AR_EEP_REGDMN_1:
@@ -161,20 +160,6 @@
        return AH_FALSE;
 }
 
-#if 0
-/* XXX conditionalize by target byte order */
-#ifndef bswap16
-static __inline__ uint16_t
-__bswap16(uint16_t _x)
-{
-       return ((uint16_t)(
-             (((const uint8_t *)(&_x))[0]    ) |
-             (((const uint8_t *)(&_x))[1]<< 8))
-       );
-}
-#endif
-#endif
-
 /* Do structure specific swaps if Eeprom format is non native to host */
 static void
 eepromSwap(struct ar5416eeprom *ee)
diff -r 60c25afb68f9 -r 739c4401b887 sys/external/isc/atheros_hal/dist/ah_eeprom_v3.c
--- a/sys/external/isc/atheros_hal/dist/ah_eeprom_v3.c  Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/external/isc/atheros_hal/dist/ah_eeprom_v3.c  Mon Mar 07 11:25:41 2011 +0000
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah_eeprom_v3.c,v 1.2 2008/12/11 05:30:29 alc Exp $
+ * $Id: ah_eeprom_v3.c,v 1.3 2011/03/07 11:25:42 cegger Exp $
  */
 #include "opt_ah.h"
 
@@ -1759,7 +1759,7 @@
        HAL_EEPROM *ee = AH_PRIVATE(ah)->ah_eeprom;
 
         if (ee->ee_version >= AR_EEPROM_VER4_0 && ee->ee_eepMap == 1)
-               return freeEepromRawPowerCalInfo5112(ah, ee);
+               freeEepromRawPowerCalInfo5112(ah, ee);
        ath_hal_free(ee);
        AH_PRIVATE(ah)->ah_eeprom = AH_NULL;
 }
diff -r 60c25afb68f9 -r 739c4401b887 sys/external/isc/atheros_hal/dist/ah_internal.h
--- a/sys/external/isc/atheros_hal/dist/ah_internal.h   Mon Mar 07 05:09:09 2011 +0000
+++ b/sys/external/isc/atheros_hal/dist/ah_internal.h   Mon Mar 07 11:25:41 2011 +0000
@@ -14,7 +14,7 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: ah_internal.h,v 1.5 2011/02/20 11:21:02 jmcneill Exp $
+ * $Id: ah_internal.h,v 1.6 2011/03/07 11:25:42 cegger Exp $
  */
 #ifndef _ATH_AH_INTERAL_H_
 #define _ATH_AH_INTERAL_H_
@@ -57,6 +57,11 @@
        uint16_t        end;            /* ending register or zero */



Home | Main Index | Thread Index | Old Index