r3520 - developers/sameo/patches/ar6k-atheros

sameo at sita.openmoko.org sameo at sita.openmoko.org
Tue Nov 27 17:36:05 CET 2007


Author: sameo
Date: 2007-11-27 17:36:01 +0100 (Tue, 27 Nov 2007)
New Revision: 3520

Modified:
   developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack.patch
   developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_ar6000_wlan.patch
   developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_functions.patch
   developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_shcd.patch
   developers/sameo/patches/ar6k-atheros/pnp_fixes_2.6.22.5.patch
   developers/sameo/patches/ar6k-atheros/s3c2440_wlan_gpio_cfg.patch
   developers/sameo/patches/ar6k-atheros/s3c24xx_hcd_atheros.patch
Log:
ar6k-atheros: Patches cleanup.

With this patch cleanup round, we should be ready for a 1.1 FW.
Multi-block SDIO transfer may still be an issue though.



Modified: developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack.patch
===================================================================
--- developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack.patch	2007-11-27 08:24:57 UTC (rev 3519)
+++ developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack.patch	2007-11-27 16:36:01 UTC (rev 3520)
@@ -8,7 +8,7 @@
  drivers/sdio/busdriver/_busdriver.h            |  462 +++
  drivers/sdio/busdriver/sdio_bus.c              | 2119 ++++++++++++++++
  drivers/sdio/busdriver/sdio_bus_events.c       | 1073 ++++++++
- drivers/sdio/busdriver/sdio_bus_misc.c         | 3184 +++++++++++++++++++++++++
+ drivers/sdio/busdriver/sdio_bus_misc.c         | 3192 +++++++++++++++++++++++++
  drivers/sdio/busdriver/sdio_bus_os.c           |  807 ++++++
  drivers/sdio/busdriver/sdio_function.c         |  713 +++++
  drivers/sdio/hcd/Kconfig                       |   56 
@@ -49,13 +49,13 @@
  drivers/sdio/lib/sdio_lib_os.c                 |  254 +
  include/linux/sdio/_sdio_defs.h                |  632 ++++
  include/linux/sdio/ctsystem.h                  |  110 
- include/linux/sdio/ctsystem_linux.h            |  955 +++++++
+ include/linux/sdio/ctsystem_linux.h            |  959 +++++++
  include/linux/sdio/mmc_defs.h                  |   99 
  include/linux/sdio/sdio_busdriver.h            | 1431 +++++++++++
  include/linux/sdio/sdio_hcd_defs.h             |  215 +
  include/linux/sdio/sdio_lib.h                  |  262 ++
  include/linux/sdio/sdlist.h                    |  137 +
- 56 files changed, 28112 insertions(+)
+ 56 files changed, 28124 insertions(+)
 
 Index: linux-2.6.22/include/linux/sdio/_sdio_defs.h
 ===================================================================
@@ -812,8 +812,8 @@
 Index: linux-2.6.22/include/linux/sdio/ctsystem_linux.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/include/linux/sdio/ctsystem_linux.h	2007-11-08 16:56:34.000000000 +0100
-@@ -0,0 +1,955 @@
++++ linux-2.6.22/include/linux/sdio/ctsystem_linux.h	2007-11-27 16:10:05.000000000 +0100
+@@ -0,0 +1,959 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: ctsystem_linux.h
 +
@@ -984,17 +984,19 @@
 +#define SDDBG_WARN  4
 +#define SDDBG_DEBUG 6
 +#define SDDBG_TRACE 7
++#define SDDBG_ALL   0xff
 +
 +#define DBG_LEVEL_NONE  0
 +#define DBG_LEVEL_ERROR SDDBG_ERROR
 +#define DBG_LEVEL_WARN  SDDBG_WARN
 +#define DBG_LEVEL_DEBUG SDDBG_DEBUG
 +#define DBG_LEVEL_TRACE SDDBG_TRACE
++#define DBG_LEVEL_ALL   SDDBG_ALL
 +
 +#define DBG_GET_LEVEL(lvl) ((lvl) & 0xff)
 +#define DBG_GET_MASK(lvl) (((lvl) & 0xff00))
 +
-+#define DBG_SDIO_MASK (DBG_MASK_NONE | DBG_LEVEL_TRACE)
++#define DBG_SDIO_MASK (DBG_MASK_NONE | DBG_LEVEL_DEBUG)
 +
 +#define DEBUG 1
 +
@@ -1002,13 +1004,13 @@
 +#define DBG_ASSERT(test) \
 +{                         \
 +    if (!(test)) {          \
-+        DBG_PRINT(SDDBG_ERROR, ("Debug Assert Caught, File %s, Line: %d, Test:%s \n",__FILE__, __LINE__,#test)); \
++        DBG_PRINT(SDDBG_ERROR, ("%s(): Debug Assert Caught, File %s, Line: %d, Test:%s \n",__FUNCTION__, __FILE__, __LINE__,#test)); \
 +    }                     \
 +}
 +#define DBG_ASSERT_WITH_MSG(test,s) \
 +{                                   \
 +    if (!(test)) {                  \
-+        DBG_PRINT(SDDBG_ERROR, ("Assert:%s File %s, Line: %d \n",(s),__FILE__, __LINE__)); \
++        DBG_PRINT(SDDBG_ERROR, ("Assert:%s at %s() File %s, Line: %d \n",(s), __FUNCTION__, __FILE__, __LINE__)); \
 +    }                     \
 +}
 +
@@ -1570,6 +1572,7 @@
 +
 +    DBG_ASSERT_WITH_MSG(!NonSchedulable(),"OSSleep not allowed\n");
 +        /* convert timeout to ticks */
++
 +    delta = (SleepInterval * HZ)/1000;
 +    if (delta == 0) {
 +        delta = 1;
@@ -1578,6 +1581,7 @@
 +    if (schedule_timeout(delta) != 0) {
 +        return SDIO_STATUS_INTERRUPTED;
 +    }
++
 +    return SDIO_STATUS_SUCCESS;
 +}
 +
@@ -3348,7 +3352,7 @@
 Index: linux-2.6.22/drivers/sdio/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/Makefile	2007-11-08 17:28:12.000000000 +0100
++++ linux-2.6.22/drivers/sdio/Makefile	2007-11-12 13:44:29.000000000 +0100
 @@ -0,0 +1,6 @@
 +#Makefile for SDIO stack
 +obj-$(CONFIG_SDIO)	+= lib/
@@ -5016,7 +5020,7 @@
 Index: linux-2.6.22/drivers/sdio/busdriver/sdio_bus.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/busdriver/sdio_bus.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/busdriver/sdio_bus.c	2007-11-15 20:04:19.000000000 +0100
 @@ -0,0 +1,2119 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_bus.c
@@ -6584,7 +6588,7 @@
 +        }
 +
 +
-+ #ifndef CT_CONFIG_NO_SDMMC
++#ifndef CT_CONFIG_NO_SDMMC
 +
 +
 +        if ((pReq->Flags & SDREQ_FLAGS_AUTO_CMD12) &&
@@ -7140,7 +7144,7 @@
 Index: linux-2.6.22/drivers/sdio/busdriver/sdio_bus_events.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/busdriver/sdio_bus_events.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/busdriver/sdio_bus_events.c	2007-11-27 16:45:11.000000000 +0100
 @@ -0,0 +1,1073 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_bus_events.c
@@ -7760,9 +7764,9 @@
 +            }
 +                /* issue go-idle */
 +            if (IS_HCD_BUS_MODE_SPI(pHcd)) {
-+                _IssueSimpleBusRequest(pHcd,CMD0,0,SDREQ_FLAGS_RESP_R1,NULL);
++		    _IssueSimpleBusRequest(pHcd,CMD0,0,SDREQ_FLAGS_RESP_R1,NULL);
 +            } else {
-+                _IssueSimpleBusRequest(pHcd,CMD0,0,SDREQ_FLAGS_NO_RESP,NULL);
++		    _IssueSimpleBusRequest(pHcd,CMD0,0,SDREQ_FLAGS_NO_RESP,NULL);
 +            }
 +                /* try SDIO */
 +            status = TestPresence(pHcd,CARD_SDIO,NULL);
@@ -8218,8 +8222,8 @@
 Index: linux-2.6.22/drivers/sdio/busdriver/sdio_bus_misc.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/busdriver/sdio_bus_misc.c	2007-11-08 15:47:58.000000000 +0100
-@@ -0,0 +1,3184 @@
++++ linux-2.6.22/drivers/sdio/busdriver/sdio_bus_misc.c	2007-11-27 16:08:23.000000000 +0100
+@@ -0,0 +1,3192 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_bus_misc.c
 +
@@ -8701,7 +8705,9 @@
 +            break;
 +        }
 +            /* delay for power to settle */
-+        OSSleep(pBusContext->PowerSettleDelay);
++	DBG_PRINT(SDDBG_TRACE, ("SDIO Bus Driver: Asjust slot power sleeping \n"));
++//        OSSleep(pBusContext->PowerSettleDelay);
++	DBG_PRINT(SDDBG_TRACE, ("SDIO Bus Driver: Asjust slot waking up \n"));
 +            /* save off for drivers */
 +        pHcd->CardProperties.CardVoltage  = pwrSetting.SlotPowerVoltageMask;
 +
@@ -9719,16 +9725,20 @@
 +
 +    do {
 +            /* power up the card */
++	DBG_PRINT(SDDBG_TRACE, ("SDIO Bus Driver: Slot power\n"));
 +        status = AdjustSlotPower(pHcd, &OCRvalue);
 +        if (!SDIO_SUCCESS(status)) {
 +            DBG_PRINT(SDDBG_ERROR, ("SDIO Bus Driver: Failed to adjust slot power \n"));
 +            break;
 +        }
++	DBG_PRINT(SDDBG_TRACE, ("SDIO Bus Driver: Bus mode\n"));
 +        status = SetOperationalBusMode(pHcd->pPseudoDev,&busMode);
 +        if (!SDIO_SUCCESS(status)) {
 +            DBG_PRINT(SDDBG_ERROR, ("SDIO Bus Driver: Failed to set bus mode \n"));
 +            break;
 +        }
++
++	DBG_PRINT(SDDBG_TRACE, ("SDIO Bus Driver: Init clock\n"));
 +        status = _IssueConfig(pHcd,SDCONFIG_SEND_INIT_CLOCKS,&initClocks,sizeof(initClocks));
 +        if (!SDIO_SUCCESS(status)) {
 +            DBG_PRINT(SDDBG_ERROR, ("SDIO Bus Driver: Failed to send init clocks in hcd \n"));
@@ -10502,6 +10512,7 @@
 +        DBG_PRINT(SDDBG_TRACE, ("SDIO Bus Driver: Function Enable/Disable Polling: %d retries \n",
 +                                retry));
 +        while (retry) {
++		OSSleep(10);
 +            status = Cmd52ReadByteCommon(pDevice, SDIO_READY_REG, &registerValue);
 +            if (!SDIO_SUCCESS(status)){
 +                break;
@@ -10535,6 +10546,7 @@
 +    } while (FALSE);
 +
 +    SemaphorePost(&pDevice->pHcd->ConfigureOpsSem);
++
 +    return status;
 +}
 +
@@ -12937,7 +12949,7 @@
 Index: linux-2.6.22/drivers/sdio/hcd/Kconfig
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/hcd/Kconfig	2007-11-08 17:25:17.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/Kconfig	2007-11-27 17:11:11.000000000 +0100
 @@ -0,0 +1,56 @@
 +#
 +#
@@ -12998,7 +13010,7 @@
 Index: linux-2.6.22/drivers/sdio/hcd/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/hcd/Makefile	2007-11-08 17:25:17.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/Makefile	2007-11-27 17:11:11.000000000 +0100
 @@ -0,0 +1,8 @@
 +# SDIO stack host controller Makefile
 +obj-$(CONFIG_SDIO_STDHCD)		+= stdhost/

Modified: developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_ar6000_wlan.patch
===================================================================
--- developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_ar6000_wlan.patch	2007-11-27 08:24:57 UTC (rev 3519)
+++ developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_ar6000_wlan.patch	2007-11-27 16:36:01 UTC (rev 3520)
@@ -4,7 +4,7 @@
  drivers/pnp/driver.c                                          |    2 
  drivers/sdio/function/wlan/Makefile                           |    4 
  drivers/sdio/function/wlan/ar6000/Makefile                    |   29 
- drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c         | 5752 ++++++++++
+ drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c         | 5856 ++++++++++
  drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h         |  133 
  drivers/sdio/function/wlan/ar6000/bmi/Makefile                |    1 
  drivers/sdio/function/wlan/ar6000/bmi/bmi.c                   |  473 
@@ -22,9 +22,9 @@
  drivers/sdio/function/wlan/ar6000/htc/htc.c                   |  433 
  drivers/sdio/function/wlan/ar6000/htc/htc_events.c            | 1056 +
  drivers/sdio/function/wlan/ar6000/htc/htc_internal.h          |  464 
- drivers/sdio/function/wlan/ar6000/htc/htc_recv.c              |  209 
+ drivers/sdio/function/wlan/ar6000/htc/htc_recv.c              |  211 
  drivers/sdio/function/wlan/ar6000/htc/htc_send.c              |  395 
- drivers/sdio/function/wlan/ar6000/htc/htc_utils.c             |  374 
+ drivers/sdio/function/wlan/ar6000/htc/htc_utils.c             |  375 
  drivers/sdio/function/wlan/ar6000/include/AR6000_bmi.h        |  136 
  drivers/sdio/function/wlan/ar6000/include/AR6000_gpio.h       |   39 
  drivers/sdio/function/wlan/ar6000/include/AR6000_version.h    |   46 
@@ -50,7 +50,7 @@
  drivers/sdio/function/wlan/ar6000/include/osapi_linux.h       |  167 
  drivers/sdio/function/wlan/ar6000/include/queue.h             |  552 
  drivers/sdio/function/wlan/ar6000/include/wlan_api.h          |   90 
- drivers/sdio/function/wlan/ar6000/include/wmi.h               | 1141 +
+ drivers/sdio/function/wlan/ar6000/include/wmi.h               | 1150 +
  drivers/sdio/function/wlan/ar6000/include/wmi_api.h           |  173 
  drivers/sdio/function/wlan/ar6000/include/wmi_host.h          |   75 
  drivers/sdio/function/wlan/ar6000/include/wmix.h              |  197 
@@ -58,13 +58,13 @@
  drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c            |  285 
  drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c     |  169 
  drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c           |   56 
- drivers/sdio/function/wlan/ar6000/wmi/wmi.c                   | 2871 ++++
- 60 files changed, 23099 insertions(+), 7 deletions(-)
+ drivers/sdio/function/wlan/ar6000/wmi/wmi.c                   | 2879 ++++
+ 60 files changed, 23223 insertions(+), 7 deletions(-)
 
 Index: linux-2.6.22/drivers/sdio/function/wlan/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/Makefile	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,4 @@
 +#
 +# SDIO wlan ar600 card function driver
@@ -73,7 +73,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/Makefile	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,29 @@
 +#
 +#  AR6K Kernel Module makefile.
@@ -107,7 +107,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/bmi.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/bmi.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/bmi.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,76 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -188,7 +188,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,133 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -326,7 +326,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ar6000_api.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ar6000_api.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ar6000_api.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,84 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -415,7 +415,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athdrv.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athdrv.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athdrv.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,598 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -1018,7 +1018,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athtypes.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athtypes.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athtypes.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,43 @@
 +/*
 + * Copyright 2003-2006 Atheros Communications, Inc.
@@ -1066,7 +1066,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,333 @@
 +/*-
 + * Copyright (c) 2001 Atsushi Onoe
@@ -1404,7 +1404,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,120 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -1529,7 +1529,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,74 @@
 +/*
 + * Copyright (c) 2001 Atsushi Onoe
@@ -1608,7 +1608,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/osapi_linux.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/osapi_linux.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/osapi_linux.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,167 @@
 +/*
 + * Copyright 2003-2006 Atheros Communications, Inc.
@@ -1780,7 +1780,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi_host.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi_host.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi_host.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,75 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -1860,7 +1860,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/bmi_internal.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/bmi_internal.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/bmi_internal.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,31 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -1896,7 +1896,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/hif.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/hif.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/hif.c	2007-11-19 19:31:15.000000000 +0100
 @@ -0,0 +1,664 @@
 +/*
 + * Copyright (c) 2004-2005 Atheros Communications Inc.
@@ -2565,7 +2565,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc.c	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,433 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -3003,7 +3003,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_events.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_events.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_events.c	2007-11-27 16:36:53.000000000 +0100
 @@ -0,0 +1,1056 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -4064,7 +4064,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_internal.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_internal.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_internal.h	2007-11-27 02:06:36.000000000 +0100
 @@ -0,0 +1,464 @@
 +/*
 + * Copyright (c) 2004-2005 Atheros Communications Inc.
@@ -4533,8 +4533,8 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_recv.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_recv.c	2007-11-08 15:47:58.000000000 +0100
-@@ -0,0 +1,209 @@
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_recv.c	2007-11-27 16:37:23.000000000 +0100
+@@ -0,0 +1,211 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
 + *
@@ -4648,6 +4648,8 @@
 +         AR_DEBUG_PRINTF(ATH_DEBUG_WARN | ATH_DEBUG_RECV,
 +                         ("Mailbox (%d) recv queue empty. Unable to remove buffer\n", endPointId));
 +
++	 printk("Mailbox (%d) recv queue empty. Unable to remove buffer\n", endPointId);
++
 +         /*
 +          * Communicate this situation to the host via the HTC_DATA_AVAILABLE
 +          * event to request some buffers in the queue.
@@ -4747,7 +4749,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_send.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_send.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_send.c	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,395 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -5147,8 +5149,8 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_utils.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_utils.c	2007-11-08 15:47:58.000000000 +0100
-@@ -0,0 +1,374 @@
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/htc_utils.c	2007-11-26 19:49:16.000000000 +0100
+@@ -0,0 +1,375 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
 + *
@@ -5506,6 +5508,7 @@
 +    HTC_REGISTER_TABLE *reg;
 +
 +    reg = &target->table;
++//    printk("\n<------- Register Table -------->\nInt Status:                0x%x\nCPU Int Status:            0x%x\nError Int Status:          0x%x\nCounter Int Status:        0x%x\nMbox Frame:                0x%x\nRx Lookahead Valid:        0x%x\nRx Lookahead 0:            0x%x\nRx Lookahead 1:            0x%x\nRx Lookahead 2:            0x%x\nRx Lookahead 3:            0x%x\nInt Status Enable:         0x%x\nCounter Int Status Enable: 0x%x\n<------------------------------->\n", reg->host_int_status, reg->cpu_int_status, reg->error_int_status, reg->counter_int_status, reg->mbox_frame, reg->rx_lookahead_valid, reg->rx_lookahead[ENDPOINT1], reg->rx_lookahead[ENDPOINT2], reg->rx_lookahead[ENDPOINT3], reg->rx_lookahead[ENDPOINT4], reg->int_status_enable, reg->counter_int_status_enable);
 +    AR_DEBUG_PRINTF(ATH_DEBUG_DUMP, ("\n<------- Register Table -------->\nInt Status:                0x%x\nCPU Int Status:            0x%x\nError Int Status:          0x%x\nCounter Int Status:        0x%x\nMbox Frame:                0x%x\nRx Lookahead Valid:        0x%x\nRx Lookahead 0:            0x%x\nRx Lookahead 1:            0x%x\nRx Lookahead 2:            0x%x\nRx Lookahead 3:            0x%x\nInt Status Enable:         0x%x\nCounter Int Status Enable: 0x%x\n<------------------------------->\n", reg->host_int_status, reg->cpu_int_status, reg->error_int_status, reg->counter_int_status, reg->mbox_frame, reg->rx_lookahead_valid, reg->rx_lookahead[ENDPOINT1], reg->rx_lookahead[ENDPOINT2], reg->rx_lookahead[ENDPOINT3], reg->rx_lookahead[ENDPOINT4], reg->int_status_enable, reg->counter_int_status_enable));
 +}
 +
@@ -5526,7 +5529,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/dset_api.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/dset_api.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/dset_api.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,49 @@
 +/*
 + * Copyright 2005-2006 Atheros Communications, Inc.
@@ -5580,7 +5583,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/gpio_api.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/gpio_api.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/gpio_api.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,64 @@
 +/*
 + * Copyright 2005-2006 Atheros Communications, Inc.
@@ -5649,7 +5652,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hif.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hif.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hif.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,207 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -5861,7 +5864,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/host_version.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/host_version.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/host_version.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,48 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -5914,7 +5917,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/htc.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/htc.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/htc.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,120 @@
 +/*
 + * Copyright (c) 2006 Atheros Communications, Inc.
@@ -6039,7 +6042,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/osapi.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/osapi.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/osapi.h	2007-11-26 18:43:37.000000000 +0100
 @@ -0,0 +1,63 @@
 +/*
 + * Copyright 2003-2006 Atheros Communications, Inc.
@@ -6107,7 +6110,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/queue.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/queue.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/queue.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,552 @@
 +/*
 + * Copyright (c) 1991, 1993
@@ -6664,7 +6667,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wlan_api.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wlan_api.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wlan_api.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,90 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -6759,7 +6762,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi_api.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi_api.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi_api.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,173 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -6937,7 +6940,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,285 @@
 +/*
 + * Copyright (c) 2001 Atsushi Onoe
@@ -7227,7 +7230,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,56 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -7288,8 +7291,8 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/wmi/wmi.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wmi/wmi.c	2007-11-08 15:47:58.000000000 +0100
-@@ -0,0 +1,2871 @@
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wmi/wmi.c	2007-11-26 21:09:46.000000000 +0100
+@@ -0,0 +1,2879 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
 + *
@@ -7784,6 +7787,8 @@
 +    cmd = (WMI_CMD_HDR *)a_netbuf_to_data(osbuf);
 +    id = cmd->commandId;
 +
++    printk("%s(): ID 0x%x\n", __FUNCTION__, id);
++
 +    if (a_netbuf_pull(osbuf, sizeof(WMI_CMD_HDR)) != A_OK) {
 +        WMI_DEBUG_PRINTF("wmi event rx: bad packet\n");
 +        wmip->wmi_stats.cmd_len_err++;
@@ -7865,6 +7870,8 @@
 +        status = wmi_roam_data_event_rx(wmip, datap, len);
 +        break;
 +    default:
++	    printk("Host received unknown reply/event with id 0x%x\n",
++		   id);
 +        WMI_DEBUG_PRINTF("Host received unknown reply/event with id 0x%x\n",
 +                         id);
 +        wmip->wmi_stats.cmd_id_err++;
@@ -8253,6 +8260,7 @@
 +    WMI_TX_PWR_REPLY *reply;
 +
 +    if (len < sizeof(*reply)) {
++	    printk("%s(): %d <-> %d\n", __FUNCTION__, len, sizeof(*reply));
 +        return A_EINVAL;
 +    }
 +    reply = (WMI_TX_PWR_REPLY *)datap;
@@ -8367,8 +8375,11 @@
 +{
 +    WMI_TARGET_STATS *reply;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (len < sizeof(*reply)) {
-+        return A_EINVAL;
++	    printk("len: %d <-> %d\n", len, sizeof(*reply));
++//        return A_EINVAL;
 +    }
 +    reply = (WMI_TARGET_STATS *)datap;
 +    WMI_DEBUG_PRINTF("wmi: target stats event\n");
@@ -8604,8 +8615,8 @@
 +    cc->networkType         = netType;
 +    cc->dot11AuthMode       = dot11AuthMode;
 +    cc->authMode            = authMode;
-+    cc->pairwiseCryptoType  = pairwiseCrypto;
-+    cc->pairwiseCryptoLen   = pairwiseCryptoLen;
++//    cc->pairwiseCryptoType  = pairwiseCrypto;
++//    cc->pairwiseCryptoLen   = pairwiseCryptoLen;
 +    cc->groupCryptoType     = groupCrypto;
 +    cc->groupCryptoLen      = groupCryptoLen;
 +    cc->channel             = channel;
@@ -10164,8 +10175,8 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c	2007-11-08 16:15:45.000000000 +0100
-@@ -0,0 +1,5752 @@
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c	2007-11-26 21:18:07.000000000 +0100
+@@ -0,0 +1,5856 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
 + *
@@ -10503,11 +10514,19 @@
 +static int __init
 +ar6000_init_module(void)
 +{
-+    static int probed = 0;
++    static int probed = 0, i;
 +    A_STATUS status;
++    WMI_CONNECT_CMD connect;
 +
-+    printk("######## %s() ############\n", __FUNCTION__);
++    for (i = 0; i < sizeof(WMI_CONNECT_CMD); i++)
++	    *(((char *)&connect) + i) = i;
 +
++    printk("################### size: %d\n ###################\n", sizeof(WMI_CONNECT_CMD));
++
++    printk("network_type: %d\n", connect.networkType);
++    printk("ssid length: %d\n", connect.ssidLength);
++    printk("channel: %d\n", connect.channel);
++
 +    if (probed) {
 +        return -ENODEV;
 +    }
@@ -13086,7 +13105,10 @@
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +    TARGET_STATS *pStats = &ar->arTargetStats;
 +    struct iw_statistics * pIwStats = &ar->arIwStats;
++    u32 counter;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWmiReady == FALSE) {
 +        pIwStats->status = 0;
 +        pIwStats->qual.qual = 0;
@@ -13114,12 +13136,30 @@
 +    }
 +    AR6000_SPIN_UNLOCK(&ar->arLock, 0);
 +
++#if 1
++    printk("%s() wait\n", __FUNCTION__);
 +    wait_event_interruptible(arEvent, ar->statsUpdatePending == FALSE);
++    printk("%s() no wait\n", __FUNCTION__);
 +
 +    if (signal_pending(current)) {
++	    up(&ar->arSem);
 +        pIwStats->status = 0;
 +        return pIwStats;
 +    }
++#else
++    counter = 0;
++    while (!ar->statsUpdatePending == FALSE) {
++	    counter++;
++	    mdelay(10);
++	    if (counter > 500) {
++		    up(&ar->arSem);
++		    pIwStats->status = 0;
++		    return pIwStats;
++	    }
++
++    }
++#endif
++
 +    pIwStats->status = 1 ;
 +    pIwStats->qual.qual = pStats->cs_aveBeacon_rssi;
 +    pIwStats->qual.level =pStats->cs_aveBeacon_rssi + 161;  /* noise is -95 dBm */
@@ -13128,6 +13168,8 @@
 +    pIwStats->discard.retries = pStats->tx_retry_cnt;
 +    pIwStats->miss.beacon = pStats->cs_bmiss_cnt;
 +    up(&ar->arSem);
++
++    printk("%s() out\n", __FUNCTION__);
 +    return pIwStats;
 +}
 +void
@@ -13400,6 +13442,7 @@
 +    TARGET_STATS *pStats = &ar->arTargetStats;
 +    A_UINT8 ac;
 +
++    printk("AR6000 updating target stats\n");
 +    A_PRINTF("AR6000 updating target stats\n");
 +    pStats->tx_packets          += pTarget->txrxStats.tx_stats.tx_packets;
 +    pStats->tx_bytes            += pTarget->txrxStats.tx_stats.tx_bytes;
@@ -13832,6 +13875,8 @@
 +{
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -13851,6 +13896,7 @@
 +        break;
 +    }
 +
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -13897,6 +13943,8 @@
 +{
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -13908,6 +13956,7 @@
 +    freq->m = ar->arBssChannel * 100000;
 +    freq->e = 1;
 +
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -13949,6 +13998,8 @@
 +{
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -13963,6 +14014,8 @@
 +    default:
 +        return -EIO;
 +    }
++
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -13988,6 +14041,8 @@
 +    sens->value = 0;
 +    sens->fixed = 1;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    return 0;
 +}
 +
@@ -14003,6 +14058,8 @@
 +    struct iw_range *range = (struct iw_range *) extra;
 +    int i, ret = 0;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWmiReady == FALSE) {
 +        return -EIO;
 +    }
@@ -14017,15 +14074,21 @@
 +    ar->arNumChannels = -1;
 +    A_MEMZERO(ar->arChannelList, sizeof (ar->arChannelList));
 +
++
++    printk("%s() spinlock\n", __FUNCTION__);
 +    AR6000_SPIN_LOCK(&ar->arLock, 0);
 +    if (wmi_get_channelList_cmd(ar->arWmi) != A_OK) {
 +        AR6000_SPIN_UNLOCK(&ar->arLock, 0);
 +        up(&ar->arSem);
 +        return -EIO;
 +    }
++    printk("%s() spinunlock\n", __FUNCTION__);
 +    AR6000_SPIN_UNLOCK(&ar->arLock, 0);
 +
++    printk("%s() waiting\n", __FUNCTION__);
++
 +    wait_event_interruptible(arEvent, ar->arNumChannels != -1);
++    printk("%s() done\n", __FUNCTION__);
 +
 +    if (signal_pending(current)) {
 +        up(&ar->arSem);
@@ -14094,6 +14157,7 @@
 +
 +    up(&ar->arSem);
 +
++    printk("%s() out\n", __FUNCTION__);
 +    return ret;
 +}
 +
@@ -14135,17 +14199,22 @@
 +{
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
++	    printk("%s() wlan disabled\n", __FUNCTION__);
 +        return -EIO;
 +    }
 +
 +    if (ar->arConnected != TRUE) {
++	    printk("%s() not connected\n", __FUNCTION__);
 +        return -EINVAL;
 +    }
 +
 +    A_MEMCPY(&ap_addr->sa_data, ar->arBssid, sizeof(ar->arBssid));
 +    ap_addr->sa_family = ARPHRD_ETHER;
 +
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -14171,6 +14240,8 @@
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +    int ret = 0;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWmiReady == FALSE) {
 +        return -EIO;
 +    }
@@ -14185,6 +14256,8 @@
 +    }
 +    AR6000_SPIN_UNLOCK(&ar->arLock, 0);
 +
++    printk("%s() out\n", __FUNCTION__);
++
 +    return ret;
 +}
 +
@@ -14411,6 +14484,8 @@
 +    struct ar_giwscan_param param;
 +    int i;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -14444,6 +14519,7 @@
 +    }
 +
 +    data->length = param.current_ev - extra;
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -14468,8 +14544,8 @@
 +     * iwconfig passes a null terminated string with length including this
 +     * so we need to account for this
 +     */
-+    if (data->flags && (!data->length || (data->length == 1) ||
-+        ((data->length - 1) > sizeof(ar->arSsid))))
++    if (data->flags && (!data->length || (data->length == 0) ||
++        ((data->length) > sizeof(ar->arSsid))))
 +    {
 +        /*
 +         * ssid is invalid
@@ -14496,8 +14572,10 @@
 +    {
 +        if ((!data->flags) ||
 +            (A_MEMCMP(ar->arSsid, ssid, ar->arSsidLen) != 0) ||
-+            (ar->arSsidLen != (data->length - 1)))
++            (ar->arSsidLen != (data->length)))
 +        {
++		printk("%s() choice 1\n", __FUNCTION__);
++
 +            /*
 +             * SSID set previously or essid off has been issued.
 +             *
@@ -14523,6 +14601,7 @@
 +        }
 +        else
 +        {
++		printk("%s() choice 2\n", __FUNCTION__);
 +            /*
 +             * SSID is same, so we assume profile hasn't changed.
 +             * If the interface is up and wmi is ready, we issue
@@ -14547,9 +14626,12 @@
 +        }
 +    }
 +
-+    ar->arSsidLen = data->length - 1;
++    ar->arSsidLen = data->length;
 +    A_MEMCPY(ar->arSsid, ssid, ar->arSsidLen);
++    ar->arSsid[ar->arSsidLen] = 0;
 +
++    printk("%s(), SSID: >%s<, length %d\n", __FUNCTION__, ar->arSsid, ar->arSsidLen);
++
 +    /* The ssid length check prevents second "essid off" from the user,
 +       to be treated as a connect cmd. The second "essid off" is ignored.
 +    */
@@ -14566,6 +14648,8 @@
 +                        ar->arPairwiseCrypto, ar->arPairwiseCryptoLen,
 +                        ar->arGroupCrypto, ar->arGroupCryptoLen);
 +
++	printk("%s(): Trying to connect to >%s<, channel %d\n", __FUNCTION__, ar->arSsid, ar->arChannelHint);
++
 +        status = wmi_connect_cmd(ar->arWmi, ar->arNetworkType,
 +                                 ar->arDot11AuthMode, ar->arAuthMode,
 +                                 ar->arPairwiseCrypto, ar->arPairwiseCryptoLen,
@@ -14594,6 +14678,8 @@
 +{
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -14605,7 +14691,9 @@
 +    data->flags = 1;
 +    data->length = ar->arSsidLen;
 +    A_MEMCPY(essid, ar->arSsid, ar->arSsidLen);
++    essid[ar->arSsidLen] = 0;
 +
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -14654,6 +14742,8 @@
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +    int ret = 0;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (down_interruptible(&ar->arSem)) {
 +        return -ERESTARTSYS;
 +    }
@@ -14667,7 +14757,10 @@
 +            return -EIO;
 +        }
 +        AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++	printk("%s() waiting\n", __FUNCTION__);
 +        wait_event_interruptible(arEvent, ar->arBitRate != 0xFFFF);
++	printk("%s() out\n", __FUNCTION__);
 +        if (signal_pending(current)) {
 +            ret = -EINTR;
 +        }
@@ -14685,6 +14778,7 @@
 +
 +    up(&ar->arSem);
 +
++    printk("%s() out\n", __FUNCTION__);
 +    return ret;
 +}
 +
@@ -14738,6 +14832,8 @@
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +    int ret = 0;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -14745,10 +14841,12 @@
 +    if (down_interruptible(&ar->arSem)) {
 +        return -ERESTARTSYS;
 +    }
++#if 0
 +    if((ar->arWmiReady == TRUE) && (ar->arConnected == TRUE))
 +    {
 +        ar->arTxPwr = 0;
 +
++	printk("%s() spinlock\n", __FUNCTION__);
 +        AR6000_SPIN_LOCK(&ar->arLock, 0);
 +        if (wmi_get_txPwr_cmd(ar->arWmi) != A_OK) {
 +            AR6000_SPIN_UNLOCK(&ar->arLock, 0);
@@ -14757,12 +14855,18 @@
 +        }
 +        AR6000_SPIN_UNLOCK(&ar->arLock, 0);
 +
++	printk("%s() waiting \n", __FUNCTION__);
++
 +        wait_event_interruptible(arEvent, ar->arTxPwr != 0);
 +
++	printk("%s() out\n", __FUNCTION__);
++
 +        if (signal_pending(current)) {
 +            ret = -EINTR;
 +         }
 +    }
++#endif
++
 +   /* If the interace is down or wmi is not ready or target is not connected
 +      then return value stored in the device structure */
 +
@@ -14776,6 +14880,8 @@
 +
 +    up(&ar->arSem);
 +
++    printk("%s() out\n", __FUNCTION__);
++
 +    return ret;
 +}
 +
@@ -14827,6 +14933,8 @@
 +{
 +    AR_SOFTC_T *ar = (AR_SOFTC_T *)dev->priv;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -14850,6 +14958,8 @@
 +        }
 +        break;
 +    }
++
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -14953,6 +15063,8 @@
 +    A_UINT8 keyIndex;
 +    struct ar_wep_key *wk;
 +
++    printk("%s()\n", __FUNCTION__);
++
 +    if (ar->arWlanState == WLAN_DISABLED) {
 +        return -EIO;
 +    }
@@ -14988,6 +15100,7 @@
 +        }
 +    }
 +
++    printk("%s() out\n", __FUNCTION__);
 +    return 0;
 +}
 +
@@ -15132,6 +15245,8 @@
 +ar6000_ioctl_getparam(struct net_device *dev, struct iw_request_info *info,
 +            void *w, char *extra)
 +{
++	    printk("%s()\n", __FUNCTION__);
++
 +    return -EIO;            /* for now */
 +}
 +
@@ -15921,7 +16036,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/bmi.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/bmi.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/bmi.c	2007-11-27 16:12:21.000000000 +0100
 @@ -0,0 +1,473 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -16399,14 +16514,14 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/Makefile	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,2 @@
 +obj-$(CONFIG_SDIO_AR6000_WLAN)  += hif.o
 +
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/Makefile	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,11 @@
 +#
 +# hif for compact flash
@@ -16422,7 +16537,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs.c	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,1001 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -17428,7 +17543,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,110 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -17543,7 +17658,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs_internal.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs_internal.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/ar6000_cs_internal.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,62 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -17610,7 +17725,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/hif.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/hif.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/hif.c	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,390 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -18005,7 +18120,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/hif_internal.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/hif_internal.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/cf/hif_internal.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,78 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -18088,13 +18203,13 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/bmi/Makefile	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1 @@
 +obj-$(CONFIG_SDIO_AR6000_WLAN)			+= bmi.o
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/hif_internal.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/hif_internal.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/hif/hif_internal.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,85 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
@@ -18184,7 +18299,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/htc/Makefile	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,5 @@
 +#
 +# SDIO ar6000 wlan htc function driver
@@ -18194,14 +18309,14 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/Makefile	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,2 @@
 +obj-$(CONFIG_SDIO_AR6000_WLAN) += wlan_node.o  wlan_recv_beacon.o  wlan_utils.o
 +
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,169 @@
 +/*
 + * Copyright (c) 2001 Atsushi Onoe
@@ -18375,7 +18490,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mbox_reg.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mbox_reg.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mbox_reg.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,550 @@
 +/*
 + * Copyright 2006 Atheros Communications, Inc.
@@ -18930,7 +19045,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mc_reg.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mc_reg.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mc_reg.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,1129 @@
 +/*
 + * Copyright 2006 Atheros Communications, Inc.
@@ -20064,7 +20179,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/rtc_reg.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/rtc_reg.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/rtc_reg.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,1204 @@
 +/*
 + * Copyright 2006 Atheros Communications, Inc.
@@ -21273,7 +21388,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athdefs.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athdefs.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/athdefs.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,82 @@
 +
 +#ifndef __ATHDEFS_H__
@@ -21360,7 +21475,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mbox_host_reg.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mbox_host_reg.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/hw/mbox_host_reg.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,416 @@
 +/*
 + * Copyright 2006 Atheros Communications, Inc.
@@ -21781,7 +21896,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_bmi.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_bmi.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_bmi.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,136 @@
 +/*
 + * Copyright 2006 Atheros Communications, Inc.
@@ -21922,7 +22037,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_version.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_version.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_version.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,46 @@
 +/*
 + * Copyright 2006 Atheros Communications, Inc.
@@ -21973,7 +22088,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_gpio.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_gpio.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/AR6000_gpio.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,39 @@
 +/*
 + * Copyright 2005-2006 Atheros Communications, Inc.
@@ -22017,7 +22132,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/app/dset.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/app/dset.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/app/dset.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,77 @@
 +#ifndef _DSET_H_
 +#define _DSET_H_
@@ -22099,8 +22214,8 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi.h	2007-11-08 15:47:58.000000000 +0100
-@@ -0,0 +1,1141 @@
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmi.h	2007-11-27 15:54:36.000000000 +0100
+@@ -0,0 +1,1150 @@
 +/*
 + * Copyright (c) 2004-2006 Atheros Communications Inc.
 + * All rights reserved.
@@ -22834,26 +22949,26 @@
 + */
 +typedef enum {
 +    WMI_READY_EVENTID           = 0x1001,
-+    WMI_CONNECT_EVENTID,
-+    WMI_DISCONNECT_EVENTID,
-+    WMI_BSSINFO_EVENTID,
-+    WMI_CMDERROR_EVENTID,
-+    WMI_REGDOMAIN_EVENTID,
-+    WMI_PSTREAM_TIMEOUT_EVENTID,
-+    WMI_NEIGHBOR_REPORT_EVENTID,
-+    WMI_TKIP_MICERR_EVENTID,
-+    WMI_SCAN_COMPLETE_EVENTID,
-+    WMI_REPORT_STATISTICS_EVENTID,
-+    WMI_RSSI_THRESHOLD_EVENTID,
-+    WMI_ERROR_REPORT_EVENTID,
-+    WMI_OPT_RX_FRAME_EVENTID,
-+    WMI_REPORT_ROAM_TBL_EVENTID,
-+    WMI_EXTENSION_EVENTID,
-+    WMI_CAC_EVENTID,
-+    WMI_SNR_THRESHOLD_EVENTID,
-+    WMI_LQ_THRESHOLD_EVENTID,
-+    WMI_TX_RETRY_ERR_EVENTID,
-+    WMI_REPORT_ROAM_DATA_EVENTID,
++    WMI_CONNECT_EVENTID, // 0x1002
++    WMI_DISCONNECT_EVENTID, // 0x1003
++    WMI_BSSINFO_EVENTID, // 0x1004
++    WMI_CMDERROR_EVENTID, // 0x1005
++    WMI_REGDOMAIN_EVENTID, // 0x1006
++    WMI_PSTREAM_TIMEOUT_EVENTID, // 0x1007
++    WMI_NEIGHBOR_REPORT_EVENTID, // 0x1008
++    WMI_TKIP_MICERR_EVENTID, // 0x1009
++    WMI_SCAN_COMPLETE_EVENTID, // 0x100a
++    WMI_REPORT_STATISTICS_EVENTID, // 0x100b
++    WMI_RSSI_THRESHOLD_EVENTID, // 0x100c
++    WMI_ERROR_REPORT_EVENTID, // 0x100d
++    WMI_OPT_RX_FRAME_EVENTID, // 0x100e
++    WMI_REPORT_ROAM_TBL_EVENTID, // 0x100f
++    WMI_EXTENSION_EVENTID, // 0x1010
++    WMI_CAC_EVENTID, // 0x1011
++    WMI_SNR_THRESHOLD_EVENTID, // 0x1012
++    WMI_LQ_THRESHOLD_EVENTID, // 0x1013
++    WMI_TX_RETRY_ERR_EVENTID, // 0x1014
++    WMI_REPORT_ROAM_DATA_EVENTID, // 0x1015
 +} WMI_EVENT_ID;
 +
 +typedef enum {
@@ -23098,6 +23213,7 @@
 +    A_UINT8     cs_lastRoam_msec;
 +}__ATTRIB_PACK cserv_stats_t;
 +
++
 +typedef struct {
 +    tx_stats_t          tx_stats;
 +    rx_stats_t          rx_stats;
@@ -23105,12 +23221,20 @@
 +}__ATTRIB_PACK wlan_net_stats_t;
 +
 +typedef struct {
++    tx_stats_t          tx_stats;
++    rx_stats_t          rx_stats;
++    tkip_ccmp_stats_t   tkipCcmpStats;
++} un_wlan_net_stats_t;
++
++
++typedef struct {
 +    wlan_net_stats_t    txrxStats;
 +    cserv_stats_t       cservStats;
 +    pm_stats_t          pmStats;
 +    A_INT16             noise_floor_calibation;
 +}__ATTRIB_PACK WMI_TARGET_STATS;
 +
++
 +/*
 + * WMI_RSSI_THRESHOLD_EVENTID.
 + * Indicate the RSSI events to host. Events are indicated when we breach a
@@ -23245,7 +23369,7 @@
 Index: linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmix.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmix.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/wlan/ar6000/include/wmix.h	2007-11-12 13:47:34.000000000 +0100
 @@ -0,0 +1,197 @@
 +/*
 + * Copyright (c) 2004-2005 Atheros Communications Inc.
@@ -23446,8 +23570,8 @@
 +#endif /* _WMIX_H_ */
 Index: linux-2.6.22/drivers/pnp/core.c
 ===================================================================
---- linux-2.6.22.orig/drivers/pnp/core.c	2007-11-08 15:47:27.000000000 +0100
-+++ linux-2.6.22/drivers/pnp/core.c	2007-11-08 15:47:58.000000000 +0100
+--- linux-2.6.22.orig/drivers/pnp/core.c	2007-11-12 13:47:30.000000000 +0100
++++ linux-2.6.22/drivers/pnp/core.c	2007-11-12 13:47:34.000000000 +0100
 @@ -169,14 +169,12 @@
   *
   * this function will free all mem used by dev
@@ -23475,8 +23599,8 @@
 -#endif  /*  0  */
 Index: linux-2.6.22/drivers/pnp/driver.c
 ===================================================================
---- linux-2.6.22.orig/drivers/pnp/driver.c	2007-11-08 15:47:27.000000000 +0100
-+++ linux-2.6.22/drivers/pnp/driver.c	2007-11-08 15:47:58.000000000 +0100
+--- linux-2.6.22.orig/drivers/pnp/driver.c	2007-11-12 13:47:30.000000000 +0100
++++ linux-2.6.22/drivers/pnp/driver.c	2007-11-12 13:47:34.000000000 +0100
 @@ -243,8 +243,6 @@
  
  EXPORT_SYMBOL(pnp_register_driver);
@@ -23488,8 +23612,8 @@
  EXPORT_SYMBOL(pnp_device_detach);
 Index: linux-2.6.22/drivers/pnp/Kconfig
 ===================================================================
---- linux-2.6.22.orig/drivers/pnp/Kconfig	2007-11-08 15:47:27.000000000 +0100
-+++ linux-2.6.22/drivers/pnp/Kconfig	2007-11-08 15:47:58.000000000 +0100
+--- linux-2.6.22.orig/drivers/pnp/Kconfig	2007-11-12 13:47:30.000000000 +0100
++++ linux-2.6.22/drivers/pnp/Kconfig	2007-11-12 13:47:34.000000000 +0100
 @@ -7,7 +7,7 @@
  
  config PNP

Modified: developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_functions.patch
===================================================================
--- developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_functions.patch	2007-11-27 08:24:57 UTC (rev 3519)
+++ developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_functions.patch	2007-11-27 16:36:01 UTC (rev 3520)
@@ -21,7 +21,7 @@
 Index: linux-2.6.22/drivers/sdio/function/gps/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/gps/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/gps/Makefile	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,5 @@
 +#
 +# SDIO GPS function driver
@@ -31,7 +31,7 @@
 Index: linux-2.6.22/drivers/sdio/function/gps/gps.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/gps/gps.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/gps/gps.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,392 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: gps.c
@@ -428,7 +428,7 @@
 Index: linux-2.6.22/drivers/sdio/function/gps/gps.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/gps/gps.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/gps/gps.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,194 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: gps.h
@@ -627,7 +627,7 @@
 Index: linux-2.6.22/drivers/sdio/function/gps/gps_linux.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/gps/gps_linux.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/gps/gps_linux.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,63 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: gps_linux.h
@@ -695,7 +695,7 @@
 Index: linux-2.6.22/drivers/sdio/function/gps/gps_os.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/gps/gps_os.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/gps/gps_os.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,633 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: gps_os.c
@@ -1333,7 +1333,7 @@
 Index: linux-2.6.22/drivers/sdio/function/bluetooth/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/bluetooth/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/bluetooth/Makefile	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,5 @@
 +#
 +# SDIO bluetooth functiondriver
@@ -1343,7 +1343,7 @@
 Index: linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,769 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_bt.c
@@ -2117,7 +2117,7 @@
 Index: linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,176 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_bt.h
@@ -2298,7 +2298,7 @@
 Index: linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt_linux.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt_linux.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt_linux.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,70 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_bt_linux.h
@@ -2373,7 +2373,7 @@
 Index: linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt_os.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt_os.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/bluetooth/sdio_bt_os.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,584 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_bt_os.c
@@ -2962,7 +2962,7 @@
 Index: linux-2.6.22/drivers/sdio/function/memory/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/memory/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/memory/Makefile	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,5 @@
 +#
 +# SDIO memory card function driver
@@ -2972,7 +2972,7 @@
 Index: linux-2.6.22/drivers/sdio/function/memory/sdio_memory.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,926 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_memory.c
@@ -3903,7 +3903,7 @@
 Index: linux-2.6.22/drivers/sdio/function/memory/sdio_memory.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,98 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: function.h
@@ -4006,7 +4006,7 @@
 Index: linux-2.6.22/drivers/sdio/function/memory/sdio_memory_linux.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory_linux.h	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory_linux.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,80 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_memory_linux.h
@@ -4091,7 +4091,7 @@
 Index: linux-2.6.22/drivers/sdio/function/memory/sdio_memory_os.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory_os.c	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/memory/sdio_memory_os.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,1036 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_memory_os.c
@@ -5132,7 +5132,7 @@
 Index: linux-2.6.22/drivers/sdio/function/Kconfig
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/Kconfig	2007-11-08 15:52:39.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/Kconfig	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,32 @@
 +
 +menu "SDIO function drivers"
@@ -5169,7 +5169,7 @@
 Index: linux-2.6.22/drivers/sdio/function/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/function/Makefile	2007-11-08 15:47:58.000000000 +0100
++++ linux-2.6.22/drivers/sdio/function/Makefile	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,7 @@
 +#
 +# SDIO function drivers Makefile

Modified: developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_shcd.patch
===================================================================
--- developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_shcd.patch	2007-11-27 08:24:57 UTC (rev 3519)
+++ developers/sameo/patches/ar6k-atheros/common_atheros_sdiostack_shcd.patch	2007-11-27 16:36:01 UTC (rev 3520)
@@ -9,19 +9,19 @@
  drivers/sdio/hcd/stdhost/sdio_std_hcd_os.c        |  826 ++++++++++
  8 files changed, 3610 insertions(+)
 
-Index: linux-2.6.22.5/drivers/sdio/hcd/pci_std/Makefile
+Index: linux-2.6.22/drivers/sdio/hcd/pci_std/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/pci_std/Makefile	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/pci_std/Makefile	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,4 @@
 +obj-m += sdio_pcistd_hcd.o
 +
 +sdio_pcistd_hcd-objs := sdio_hcd_os.o ../stdhost/sdio_std_hcd.o ../stdhost/sdio_std_hcd_os.o
 +
-Index: linux-2.6.22.5/drivers/sdio/hcd/pci_std/sdio_hcd_os.c
+Index: linux-2.6.22/drivers/sdio/hcd/pci_std/sdio_hcd_os.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/pci_std/sdio_hcd_os.c	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/pci_std/sdio_hcd_os.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,569 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_hcd_os.c
@@ -592,10 +592,10 @@
 +
 +module_init(sdio_pci_hcd_init);
 +module_exit(sdio_pci_hcd_cleanup);
-Index: linux-2.6.22.5/drivers/sdio/hcd/stdhost/Makefile
+Index: linux-2.6.22/drivers/sdio/hcd/stdhost/Makefile
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/stdhost/Makefile	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/stdhost/Makefile	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,7 @@
 +#
 +# SDIO standard host controller makefile
@@ -604,10 +604,10 @@
 +
 +sdio_std_hcd-objs := sdio_std_hcd.o sdio_std_hcd_os.o
 +
-Index: linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd.c
+Index: linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd.c	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,1663 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_std_hcd.c
@@ -2272,10 +2272,10 @@
 +}
 +
 +
-Index: linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd.h
+Index: linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd.h	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,330 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_std_hcd.h
@@ -2607,10 +2607,10 @@
 +void DumpCurrentRequestInfo(PSDHCD_INSTANCE pHcInstance);
 +
 +#endif
-Index: linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux.h
+Index: linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux.h	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,132 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_std_hcd_linux.h
@@ -2744,10 +2744,10 @@
 +                             SDDMA_DESCRIPTION_FLAG_DMA))
 +
 +#endif
-Index: linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux_lib.h
+Index: linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux_lib.h
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux_lib.h	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd_linux_lib.h	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,79 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_std_hcd_linux_lib.h
@@ -2828,10 +2828,10 @@
 +PSDHCD_INSTANCE RemoveStdHcdInstance(PSDHCD_CORE_CONTEXT pStdCore);
 +BOOL HandleSharedStdHostInterrupt(PSDHCD_CORE_CONTEXT pStdCore);
 +#endif /*SDIO_STD_HCD_LINUX_LIB_H_*/
-Index: linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd_os.c
+Index: linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd_os.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22.5/drivers/sdio/hcd/stdhost/sdio_std_hcd_os.c	2007-11-06 19:38:13.000000000 +0100
++++ linux-2.6.22/drivers/sdio/hcd/stdhost/sdio_std_hcd_os.c	2007-11-08 17:29:43.000000000 +0100
 @@ -0,0 +1,826 @@
 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 + at file: sdio_std_hcd_os.c

Modified: developers/sameo/patches/ar6k-atheros/pnp_fixes_2.6.22.5.patch
===================================================================
--- developers/sameo/patches/ar6k-atheros/pnp_fixes_2.6.22.5.patch	2007-11-27 08:24:57 UTC (rev 3519)
+++ developers/sameo/patches/ar6k-atheros/pnp_fixes_2.6.22.5.patch	2007-11-27 16:36:01 UTC (rev 3520)
@@ -2,10 +2,10 @@
  drivers/pnp/resource.c |    2 ++
  1 file changed, 2 insertions(+)
 
-Index: linux-2.6.22.5/drivers/pnp/resource.c
+Index: linux-2.6.22/drivers/pnp/resource.c
 ===================================================================
---- linux-2.6.22.5.orig/drivers/pnp/resource.c	2007-11-07 12:51:17.000000000 +0100
-+++ linux-2.6.22.5/drivers/pnp/resource.c	2007-11-07 12:51:26.000000000 +0100
+--- linux-2.6.22.orig/drivers/pnp/resource.c	2007-11-12 13:47:29.000000000 +0100
++++ linux-2.6.22/drivers/pnp/resource.c	2007-11-12 13:47:34.000000000 +0100
 @@ -447,6 +447,7 @@
  		}
  	}

Modified: developers/sameo/patches/ar6k-atheros/s3c2440_wlan_gpio_cfg.patch
===================================================================
--- developers/sameo/patches/ar6k-atheros/s3c2440_wlan_gpio_cfg.patch	2007-11-27 08:24:57 UTC (rev 3519)
+++ developers/sameo/patches/ar6k-atheros/s3c2440_wlan_gpio_cfg.patch	2007-11-27 16:36:01 UTC (rev 3520)
@@ -1,19 +1,37 @@
 ---
- arch/arm/mach-s3c2440/mach-gta02.c |    3 +++
- 1 file changed, 3 insertions(+)
+ arch/arm/mach-s3c2440/mach-gta02.c |   17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
 
 Index: linux-2.6.22/arch/arm/mach-s3c2440/mach-gta02.c
 ===================================================================
---- linux-2.6.22.orig/arch/arm/mach-s3c2440/mach-gta02.c	2007-11-09 15:11:09.000000000 +0100
-+++ linux-2.6.22/arch/arm/mach-s3c2440/mach-gta02.c	2007-11-09 15:24:36.000000000 +0100
-@@ -651,7 +651,10 @@
+--- linux-2.6.22.orig/arch/arm/mach-s3c2440/mach-gta02.c	2007-11-12 13:47:27.000000000 +0100
++++ linux-2.6.22/arch/arm/mach-s3c2440/mach-gta02.c	2007-11-15 17:24:07.000000000 +0100
+@@ -651,14 +651,25 @@
  	set_s3c2410ts_info(&gta02_ts_cfg);
  
  	/* FIXME: hardcoded WLAN module power-up */
+-	s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
 +	s3c2410_gpio_cfgpin(GTA02_CHIP_PWD, S3C2410_GPIO_OUTPUT);
- 	s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
 +
-+	s3c2410_gpio_cfgpin(GTA02_GPIO_nWLAN_RESET, S3C2410_GPIO_OUTPUT);
++	/* Power is down */
++	s3c2410_gpio_setpin(GTA02_CHIP_PWD, 1);
++	mdelay(100);
++
  	switch (system_rev) {
  	case GTA02v1_SYSTEM_REV:
++		s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
  		break;
+ 	default:
++		s3c2410_gpio_cfgpin(GTA02_GPIO_nWLAN_RESET, S3C2410_GPIO_OUTPUT);
++		/* Chip is in reset state */
+ 		s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 0);
+-		udelay(2000);
+-		udelay(2000);
++		mdelay(100);
++		/* Power is up */
++		s3c2410_gpio_setpin(GTA02_CHIP_PWD, 0);
++		mdelay(100);
++		/* Chip is out of reset */
+ 		s3c2410_gpio_setpin(GTA02_GPIO_nWLAN_RESET, 1);
+ 		break;
+ 	}

Modified: developers/sameo/patches/ar6k-atheros/s3c24xx_hcd_atheros.patch
===================================================================
--- developers/sameo/patches/ar6k-atheros/s3c24xx_hcd_atheros.patch	2007-11-27 08:24:57 UTC (rev 3519)
+++ developers/sameo/patches/ar6k-atheros/s3c24xx_hcd_atheros.patch	2007-11-27 16:36:01 UTC (rev 3520)
@@ -2,9 +2,9 @@
  drivers/sdio/hcd/Kconfig               |    8 
  drivers/sdio/hcd/Makefile              |    1 
  drivers/sdio/hcd/s3c24xx/Makefile      |    2 
- drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.c | 1137 +++++++++++++++++++++++++++++++++
+ drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.c | 1107 +++++++++++++++++++++++++++++++++
  drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.h |   50 +
- 5 files changed, 1198 insertions(+)
+ 5 files changed, 1168 insertions(+)
 
 Index: linux-2.6.22/drivers/sdio/hcd/Kconfig
 ===================================================================
@@ -44,8 +44,8 @@
 Index: linux-2.6.22/drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.c
 ===================================================================
 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.22/drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.c	2007-11-23 18:25:27.000000000 +0100
-@@ -0,0 +1,1137 @@
++++ linux-2.6.22/drivers/sdio/hcd/s3c24xx/s3c24xx_hcd.c	2007-11-27 16:48:57.000000000 +0100
+@@ -0,0 +1,1107 @@
 +/*
 + *  s3c24xx_hcd.c - Samsung S3C MCI driver
 + *
@@ -338,8 +338,6 @@
 +	s3c24xx_hcd_clock_enable(context, pMode->ClockRate, 1);
 +	pMode->ActualClockRate = context->device.actual_clock_rate;
 +
-+	printk("BUS mode: %d bits wide, actual clock rate: %d kHz (requested %d kHz)\n",
-+	       context->bus_width, pMode->ActualClockRate / 1000, pMode->ClockRate / 1000);
 + 	DBG_PRINT(SDDBG_TRACE , ("BUS mode: %d bits wide, actual clock rate: %d kHz (requested %d kHz)\n",
 +				 context->bus_width, pMode->ActualClockRate / 1000, pMode->ClockRate / 1000));
 +}
@@ -351,7 +349,7 @@
 +	u8 *ptr;
 +	int fifo_count;
 +	PSDREQUEST req;
-+	SDIO_STATUS status;
++	SDIO_STATUS status = SDIO_STATUS_ERROR;
 +
 +	req = GET_CURRENT_REQUEST(&context->hcd);
 +	if (req == NULL) {
@@ -362,6 +360,9 @@
 +	ptr = req->pDataBuffer;
 +
 +	if (context->complete == S3C24XX_HCD_DATA_READ) {
++		if (req->BlockCount > 1)
++			s3c24xx_dump_regs(context);
++
 +		counter = 0;
 +		printk("Data read...");
 +		do {
@@ -384,7 +385,9 @@
 +				fifo_count = req->DataRemaining;
 +			}
 +
-+//			printk("%s(): Reading %d bytes, data size: %d\n", __FUNCTION__, fifo_count, context->data_size);
++			if (req->BlockCount > 1)
++				printk("%s(): Reading %d bytes (left %d), data size: %d\n",
++				       __FUNCTION__, fifo_count, req->DataRemaining, context->data_size);
 +
 +			req->DataRemaining -= fifo_count;
 +			while (fifo_count > 0) {
@@ -407,12 +410,15 @@
 +					counter++;
 +					mdelay(1);
 +					if (counter > 500) {
-+						printk("RX XFERFINISH missing\n");
-+						//s3c24xx_dump_regs(context);
++						DBG_PRINT(SDDBG_ERROR, ("RX XFERFINISH missing\n"));
++						s3c24xx_dump_regs(context);
 +						break;
 +					}
 +				}
 +
++				if (req->BlockCount > 1)
++					s3c24xx_dump_regs(context);
++
 +				status = SDIO_STATUS_SUCCESS;
 +				goto out;
 +			}
@@ -436,15 +442,6 @@
 +		printk("TX detected\n");
 +
 +
-+		if (req->BlockLen == 52) {
-+			int i;
-+
-+			printk("Block size is 52\n");
-+			for (i = 0; i < 52; i++)
-+				printk("0x%x ", ptr[i]);
-+			printk("\n");
-+		}
-+
 +		while ((fifo_count = (63 -
 +		       (readl(context->base + S3C2410_SDIFSTA) & S3C2410_SDIFSTA_COUNTMASK)))) {
 +//				printk("%s(): We can write %d bytes\n", __FUNCTION__, fifo_count);
@@ -474,8 +471,8 @@
 +						counter++;
 +						mdelay(1);
 +						if (counter > 500) {
-+							printk("RX XFERFINISH missing\n");
-+							//s3c24xx_dump_regs(context);
++							DBG_PRINT(SDDBG_ERROR, ("RX XFERFINISH missing\n"));
++							s3c24xx_dump_regs(context);
 +							break;
 +						}
 +					}
@@ -499,12 +496,9 @@
 +	struct s3c24xx_hcd_context * context =
 +		container_of(work, struct s3c24xx_hcd_context, pio_work);
 +
-+//	printk("######## %s() ############\n", __FUNCTION__);
-+
 +	req = GET_CURRENT_REQUEST(&context->hcd);
 +	if (req == NULL) {
 +		if (context->int_sdio_pending) {
-+			printk("SDIO IRQ processed\n");
 +			SDIO_HandleHcdEvent(&context->hcd, EVENT_HCD_SDIO_IRQ_PENDING);
 +			context->int_sdio_pending = 0;
 +		} else {
@@ -514,14 +508,13 @@
 +	}
 +
 +	if (req->Status == SDIO_STATUS_BUS_RESP_TIMEOUT) {
-+		printk("### TIMEOUT ###\n");
++		DBG_PRINT(SDDBG_ERROR, ("### TIMEOUT ###\n"));
 +		s3c24xx_dump_regs(context);
 +		SDIO_HandleHcdEvent(&context->hcd, EVENT_HCD_TRANSFER_DONE);
 +		goto out;
 +	}
 +
 +	if (context->int_sdio_pending) {
-+		printk("SDIO IRQ processed\n");
 +		SDIO_HandleHcdEvent(&context->hcd, EVENT_HCD_SDIO_IRQ_PENDING);
 +		context->int_sdio_pending = 0;
 +	}
@@ -548,28 +541,21 @@
 +		resp[3] = readl(context->base + S3C2410_SDIRSP3);
 +
 +		if (GET_SDREQ_RESP_TYPE(req->Flags) != SDREQ_FLAGS_RESP_R2) {
-+			//printk("SHORT response: 0x%08x\n", resp[0]);
 +			DBG_PRINT(SDDBG_TRACE, ("SHORT response: 0x%08x\n", resp[0]));
 +			memcpy(&req->Response[1], (u8*)resp, 4);
 +			req->Response[5] = (readl(context->base + S3C2410_SDICMDSTAT) & 0xff);
 +		} else {
-+			printk("LONG response: 0x%08x\n", resp[0]);
 +			DBG_PRINT(SDDBG_TRACE, ("LONG response: 0x%08x\n", resp[0]));
 +			memcpy(&req->Response[1], (u8*)resp, 16);
 +			//req->Response[17] = (readl(context->base + S3C2410_SDICMDSTAT) & 0xff);
 +		}
 +
-+		if (context->complete == S3C24XX_HCD_RESPONSE_SHORT ||
-+		    context->complete == S3C24XX_HCD_RESPONSE_LONG) {
-+			//SDIO_HandleHcdEvent(&context->hcd, EVENT_HCD_TRANSFER_DONE);
-+		} else {
-+			/* There is a data stage */
++		/* There is a data stage */
++		if (context->complete == S3C24XX_HCD_DATA_READ ||
++		    context->complete == S3C24XX_HCD_DATA_WRITE)
 +			s3c24xx_hcd_pio_complete(context);
-+			//SDIO_HandleHcdEvent(&context->hcd, EVENT_HCD_TRANSFER_DONE);
-+		}
 +	}
 +
-+
 + out:
 +	s3c24xx_hcd_clear_sta(context);
 +	s3c24xx_hcd_clear_imask(context);
@@ -577,13 +563,6 @@
 +	writel(0, context->base + S3C2410_SDICMDARG);
 +	writel(0, context->base + S3C2410_SDICMDCON);
 +
-+#if 0
-+	if ((req->Argument == 0x941FF804) ||
-+	    (req->Argument == 0x1008A001)) {
-+		s3c24xx_dump_regs(context);
-+		printk("INT SDIO: %d\n", context->int_sdio);
-+	}
-+#endif
 +	spin_unlock(&context->lock);
 +
 +	SDIO_HandleHcdEvent(&context->hcd, EVENT_HCD_TRANSFER_DONE);
@@ -613,10 +592,7 @@
 +	dsta = readl(context->base + S3C2410_SDIDSTA);
 +	s3c24xx_hcd_clear_csta(context);
 +
-+//	printk("######## IRQ cmsta: 0x%08x dsta: 0x%08x ############\n", cmdsta, dsta);
-+
 +	if (dsta & S3C2410_SDIDSTA_SDIOIRQDETECT) {
-+//		printk("Got SDIO IRQ\n");
 +		writel(S3C2410_SDIDSTA_SDIOIRQDETECT, context->base + S3C2410_SDIDSTA);
 +
 +		if (context->int_sdio &&
@@ -625,6 +601,7 @@
 +			u32 imask;
 +
 +			printk("Got SDIO IRQ\n");
++
 +			context->int_sdio = 0;
 +			context->int_sdio_reported = 1;
 +			context->int_sdio_pending = 1;
@@ -638,7 +615,7 @@
 +
 +	req = GET_CURRENT_REQUEST(&context->hcd);
 +	if (req == NULL) {
-+		DBG_PRINT(SDDBG_ERROR, ("%s(): No current request\n", __FUNCTION__));
++		DBG_PRINT(SDDBG_TRACE, ("%s(): No current request\n", __FUNCTION__));
 +		goto out;
 +	}
 +
@@ -678,8 +655,6 @@
 +	PSDCONFIG_SDIO_INT_CTRL_DATA int_data;
 +	struct s3c24xx_hcd_context * context = (struct s3c24xx_hcd_context *)hcd->pContext;
 +
-+//	printk("######## %s() ############\n", __FUNCTION__);
-+
 +	switch (GET_SDCONFIG_CMD(config)){
 +	case SDCONFIG_GET_WP:
 +		DBG_PRINT(SDDBG_TRACE, ("config GET_WP\n"));
@@ -705,7 +680,6 @@
 +		status = SDIO_STATUS_SUCCESS;
 +		break;
 +        case SDCONFIG_SDIO_INT_CTRL:
-+		printk("config SDIO_INT_CTRL\n");
 +		DBG_PRINT(SDDBG_TRACE, ("config SDIO_INT_CTRL\n"));
 +		int_data =  GET_SDCONFIG_CMD_DATA(PSDCONFIG_SDIO_INT_CTRL_DATA, config);
 +
@@ -729,10 +703,9 @@
 +				writel(imsk, context->base + S3C2440_SDIIMSK);
 +			}
 +		}
-+
++		status = SDIO_STATUS_SUCCESS;
 +		break;
 +        case SDCONFIG_SDIO_REARM_INT:
-+		printk("config SDIO_REARM_INT\n");
 +		DBG_PRINT(SDDBG_TRACE, ("config SDIO_REARM_INT\n"));
 +		context->int_sdio = 1;
 +		context->int_sdio_reported = 0;
@@ -743,6 +716,7 @@
 +		if (dsta & S3C2410_SDIDSTA_SDIOIRQDETECT) {
 +			context->int_sdio_pending = 1;
 +		}
++		status = SDIO_STATUS_SUCCESS;
 +		break;
 +	case SDCONFIG_FUNC_CHANGE_BUS_MODE:
 +        case SDCONFIG_BUS_MODE_CTRL:
@@ -756,9 +730,11 @@
 +		break;
 +        case SDCONFIG_GET_HCD_DEBUG:
 +		DBG_PRINT(SDDBG_TRACE, ("config GET_HCD_DEBUG\n"));
++		status = SDIO_STATUS_SUCCESS;
 +		break;
 +        case SDCONFIG_SET_HCD_DEBUG:
 +		DBG_PRINT(SDDBG_TRACE, ("config SET_HCD_DEBUG\n"));
++		status = SDIO_STATUS_SUCCESS;
 +		break;
 +	default:
 +		/* invalid request */
@@ -796,7 +772,6 @@
 +	struct s3c24xx_hcd_context * context =
 +		(struct s3c24xx_hcd_context *)hcd->pContext;
 +
-+//	printk("######## %s() ############\n", __FUNCTION__);
 +//	dump_request(context);
 +
 +	req = GET_CURRENT_REQUEST(hcd);
@@ -980,9 +955,6 @@
 +	s3c2410_gpio_cfgpin(S3C2410_GPE9, S3C2410_GPE9_SDDAT2);
 +	s3c2410_gpio_cfgpin(S3C2410_GPE10, S3C2410_GPE10_SDDAT3);
 +
-+	/* Reset the controller */
-+//	s3c24xx_hcd_reset(context);
-+
 +	con = readl(context->base + S3C2410_SDICON);
 +	con |= S3C2410_SDICON_RWAITEN | S3C2410_SDICON_SDIOIRQ;
 +	writel(con, context->base + S3C2410_SDICON);
@@ -1050,7 +1022,7 @@
 +	if (request_irq(context->io_irq, s3c24xx_hcd_irq, 0, context->description, context)) {
 +		DBG_PRINT(SDDBG_ERROR, ("failed to request mci interrupt.\n"));
 +		status = -ENOENT;
-+		goto out_free_irq;
++		goto out_unmap_mem_region;
 +	}
 +
 +
@@ -1059,9 +1031,7 @@
 +
 +	return SDIOErrorToOSError(status);
 +
-+ out_free_irq:
-+//	free_irq(context->cd_irq, context);
-+// out_unmap_mem_region:
++ out_unmap_mem_region:
 +	iounmap(context->base);
 +
 + out_free_mem_region:
@@ -1157,7 +1127,7 @@
 +{
 +	SDIO_STATUS status = SDIO_STATUS_SUCCESS;
 +
-+	printk("######## %s() ############\n", __FUNCTION__);
++	printk("S3c2440 SDIO Host controller\n");
 +
 +	REL_PRINT(SDDBG_TRACE, ("SDIO S3C24xx started\n"));
 +
@@ -1172,8 +1142,8 @@
 + * module cleanup
 +*/
 +static void __exit s3c24xx_hcd_cleanup(void) {
-+    REL_PRINT(SDDBG_TRACE, ("+SDIO S3C24xx unloaded\n"));
-+    SDIO_BusRemoveOSDevice(&hcd_context.device.pnp_driver, &hcd_context.device.pnp_device);
++	printk("S3C2440 SDIO host controller unloaded\n");
++	SDIO_BusRemoveOSDevice(&hcd_context.device.pnp_driver, &hcd_context.device.pnp_device);
 +}
 +
 +





More information about the commitlog mailing list