Changeset 3921
- Timestamp:
- 01/22/08 17:28:04 (5 years ago)
- Location:
- developers/sameo/patches/ar6k-atheros-2.0/2.6.24
- Files:
-
- 2 edited
-
atheros_2_0_function.patch (modified) (67 diffs)
-
atheros_2_0_sdio_stack.patch (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
developers/sameo/patches/ar6k-atheros-2.0/2.6.24/atheros_2_0_function.patch
r3825 r3921 86 86 84 files changed, 32510 insertions(+) 87 87 88 Index: linux-2.6 -openmoko/drivers/sdio/function/Kconfig88 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/Kconfig 89 89 =================================================================== 90 90 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 91 +++ linux-2.6 -openmoko/drivers/sdio/function/Kconfig 2008-01-14 13:07:38.000000000 +010091 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/Kconfig 2008-01-22 13:33:10.000000000 +0100 92 92 @@ -0,0 +1,11 @@ 93 93 +#menu "SDIO function drivers" … … 103 103 +#endmenu 104 104 \ No newline at end of file 105 Index: linux-2.6 -openmoko/drivers/sdio/function/Makefile105 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/Makefile 106 106 =================================================================== 107 107 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 108 +++ linux-2.6 -openmoko/drivers/sdio/function/Makefile 2008-01-14 13:07:38.000000000 +0100108 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/Makefile 2008-01-22 13:33:10.000000000 +0100 109 109 @@ -0,0 +1 @@ 110 110 +obj-$(CONFIG_SDIO_AR6000_WLAN) += wlan/ 111 111 \ No newline at end of file 112 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c112 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/Makefile 113 113 =================================================================== 114 114 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 115 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c 2008-01-14 13:12:34.000000000 +0100 115 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/Makefile 2008-01-22 13:33:10.000000000 +0100 116 @@ -0,0 +1,4 @@ 117 +# 118 +# SDIO wlan ar600 card function driver 119 +# 120 +obj-$(CONFIG_SDIO_AR6000_WLAN) += ar6000/ 121 \ No newline at end of file 122 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/Makefile 123 =================================================================== 124 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 125 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/Makefile 2008-01-22 13:33:10.000000000 +0100 126 @@ -0,0 +1,38 @@ 127 +REV ?= 2 128 + 129 +PWD := $(shell pwd) 130 + 131 +EXTRA_CFLAGS += -I$(src)/include 132 + 133 +EXTRA_CFLAGS += -DLINUX -DDEBUG -D__KERNEL__ -DHTC_RAW_INTERFACE\ 134 + -DTCMD -DSEND_EVENT_TO_APP -DUSER_KEYS \ 135 + -DNO_SYNC_FLUSH #\ 136 + -DMULTIPLE_FRAMES_PER_INTERRUPT -DAR6000REV$(REV) \ 137 + -DBLOCK_TX_PATH_FLAG \ 138 + -DSDIO \ 139 + 140 +EXTRA_CFLAGS += -DKERNEL_2_6 141 + 142 +obj-$(CONFIG_SDIO_AR6000_WLAN) += ar6000.o 143 + 144 +ar6000-objs += htc/ar6k.o \ 145 + htc/ar6k_events.o \ 146 + htc/htc_send.o \ 147 + htc/htc_recv.o \ 148 + htc/htc_services.o \ 149 + htc/htc.o \ 150 + hif/hif.o \ 151 + bmi/bmi.o \ 152 + ar6000/ar6000_drv.o \ 153 + ar6000/ar6000_raw_if.o \ 154 + ar6000/netbuf.o \ 155 + ar6000/wireless_ext.o \ 156 + ar6000/ioctl.o \ 157 + miscdrv/common_drv.o \ 158 + miscdrv/credit_dist.o \ 159 + wmi/wmi.o \ 160 + wlan/wlan_node.o \ 161 + wlan/wlan_recv_beacon.o \ 162 + wlan/wlan_utils.o 163 + 164 + 165 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c 166 =================================================================== 167 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 168 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c 2008-01-22 13:33:10.000000000 +0100 116 169 @@ -0,0 +1,3069 @@ 117 170 +/* … … 3184 3237 +{ 3185 3238 +} 3186 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h3239 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h 3187 3240 =================================================================== 3188 3241 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 3189 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h 2008-01-14 13:07:38.000000000 +01003242 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h 2008-01-22 13:33:10.000000000 +0100 3190 3243 @@ -0,0 +1,361 @@ 3191 3244 +/* … … 3550 3603 + 3551 3604 +#endif /* _AR6000_H_ */ 3552 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_raw_if.c3605 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_raw_if.c 3553 3606 =================================================================== 3554 3607 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 3555 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_raw_if.c 2008-01-14 13:07:38.000000000 +01003608 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_raw_if.c 2008-01-22 13:33:10.000000000 +0100 3556 3609 @@ -0,0 +1,439 @@ 3557 3610 +/* … … 3994 4047 +} 3995 4048 +#endif /* HTC_RAW_INTERFACE */ 3996 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6xapi_linux.h4049 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6xapi_linux.h 3997 4050 =================================================================== 3998 4051 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 3999 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6xapi_linux.h 2008-01-14 13:07:38.000000000 +01004052 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ar6xapi_linux.h 2008-01-22 13:33:10.000000000 +0100 4000 4053 @@ -0,0 +1,128 @@ 4001 4054 +#ifndef _AR6XAPI_LINUX_H … … 4127 4180 + 4128 4181 +#endif 4129 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/athdrv_linux.h4182 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/athdrv_linux.h 4130 4183 =================================================================== 4131 4184 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 4132 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/athdrv_linux.h 2008-01-14 13:07:38.000000000 +01004185 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/athdrv_linux.h 2008-01-22 13:33:10.000000000 +0100 4133 4186 @@ -0,0 +1,993 @@ 4134 4187 +/* … … 5125 5178 +#endif 5126 5179 +#endif 5127 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/athtypes_linux.h5180 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/athtypes_linux.h 5128 5181 =================================================================== 5129 5182 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 5130 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/athtypes_linux.h 2008-01-14 13:07:38.000000000 +01005183 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/athtypes_linux.h 2008-01-22 13:33:10.000000000 +0100 5131 5184 @@ -0,0 +1,47 @@ 5132 5185 +/* … … 5177 5230 + 5178 5231 +#endif /* _ATHTYPES_LINUX_H_ */ 5179 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/config_linux.h5232 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/config_linux.h 5180 5233 =================================================================== 5181 5234 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 5182 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/config_linux.h 2008-01-14 13:07:38.000000000 +01005235 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/config_linux.h 2008-01-22 13:33:10.000000000 +0100 5183 5236 @@ -0,0 +1,44 @@ 5184 5237 +/* … … 5226 5279 + 5227 5280 +#endif 5228 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/debug_linux.h5281 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/debug_linux.h 5229 5282 =================================================================== 5230 5283 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 5231 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/debug_linux.h 2008-01-14 13:07:38.000000000 +01005284 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/debug_linux.h 2008-01-22 13:33:10.000000000 +0100 5232 5285 @@ -0,0 +1,86 @@ 5233 5286 +/* … … 5317 5370 + 5318 5371 +#endif /* _DEBUG_LINUX_H_ */ 5319 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ioctl.c5372 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ioctl.c 5320 5373 =================================================================== 5321 5374 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 5322 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/ioctl.c 2008-01-14 13:07:38.000000000 +01005375 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/ioctl.c 2008-01-22 13:33:10.000000000 +0100 5323 5376 @@ -0,0 +1,2573 @@ 5324 5377 +/* … … 7895 7948 +} 7896 7949 + 7897 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/netbuf.c7950 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/netbuf.c 7898 7951 =================================================================== 7899 7952 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 7900 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/netbuf.c 2008-01-14 13:07:38.000000000 +01007953 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/netbuf.c 2008-01-22 13:33:10.000000000 +0100 7901 7954 @@ -0,0 +1,225 @@ 7902 7955 + … … 8125 8178 +} 8126 8179 + 8127 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/osapi_linux.h8180 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/osapi_linux.h 8128 8181 =================================================================== 8129 8182 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 8130 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/osapi_linux.h 2008-01-14 13:07:38.000000000 +01008183 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/osapi_linux.h 2008-01-22 13:33:10.000000000 +0100 8131 8184 @@ -0,0 +1,319 @@ 8132 8185 +/* … … 8449 8502 + 8450 8503 +#endif /* _OSAPI_LINUX_H_ */ 8451 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c8504 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c 8452 8505 =================================================================== 8453 8506 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 8454 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c 2008-01-14 13:07:38.000000000 +01008507 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c 2008-01-22 13:33:10.000000000 +0100 8455 8508 @@ -0,0 +1,1866 @@ 8456 8509 +/* … … 10320 10373 + 10321 10374 + 10322 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/bmi/bmi.c10375 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/bmi/bmi.c 10323 10376 =================================================================== 10324 10377 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 10325 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/bmi/bmi.c 2008-01-14 13:07:38.000000000 +010010378 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/bmi/bmi.c 2008-01-22 13:33:10.000000000 +0100 10326 10379 @@ -0,0 +1,657 @@ 10327 10380 +/* … … 10982 11035 + return status; 10983 11036 +} 10984 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/bmi/bmi_internal.h11037 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/bmi/bmi_internal.h 10985 11038 =================================================================== 10986 11039 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 10987 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/bmi/bmi_internal.h 2008-01-14 13:07:38.000000000 +010011040 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/bmi/bmi_internal.h 2008-01-22 13:33:10.000000000 +0100 10988 11041 @@ -0,0 +1,45 @@ 10989 11042 +#ifndef BMI_INTERNAL_H … … 11032 11085 + 11033 11086 +#endif 11034 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/hif/hif.c11087 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/hif/hif.c 11035 11088 =================================================================== 11036 11089 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 11037 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/hif/hif.c 2008-01-14 13:07:38.000000000 +010011090 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/hif/hif.c 2008-01-22 13:33:10.000000000 +0100 11038 11091 @@ -0,0 +1,818 @@ 11039 11092 +/* … … 11855 11908 + return; 11856 11909 +} 11857 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/hif/hif_internal.h11910 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/hif/hif_internal.h 11858 11911 =================================================================== 11859 11912 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 11860 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/hif/hif_internal.h 2008-01-14 13:07:38.000000000 +010011913 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/hif/hif_internal.h 2008-01-22 13:33:10.000000000 +0100 11861 11914 @@ -0,0 +1,102 @@ 11862 11915 +/* … … 11962 12015 +void 11963 12016 +delHifDevice(SDDEVICE *handle); 11964 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.c12017 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.c 11965 12018 =================================================================== 11966 12019 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 11967 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.c 2008-01-14 13:07:38.000000000 +010012020 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.c 2008-01-22 13:33:10.000000000 +0100 11968 12021 @@ -0,0 +1,991 @@ 11969 12022 +/* … … 12958 13011 + 12959 13012 + 12960 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/ar6k_events.c13013 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.h 12961 13014 =================================================================== 12962 13015 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 12963 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/htc/ar6k_events.c 2008-01-14 13:07:38.000000000 +0100 13016 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.h 2008-01-22 13:33:10.000000000 +0100 13017 @@ -0,0 +1,191 @@ 13018 +/* 13019 + * 13020 + * Copyright (c) 2007 Atheros Communications Inc. 13021 + * All rights reserved. 13022 + * 13023 + * 13024 + * This program is free software; you can redistribute it and/or modify 13025 + * it under the terms of the GNU General Public License version 2 as 13026 + * published by the Free Software Foundation; 13027 + * 13028 + * Software distributed under the License is distributed on an "AS 13029 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 13030 + * implied. See the License for the specific language governing 13031 + * rights and limitations under the License. 13032 + * 13033 + * 13034 + * 13035 + */ 13036 + 13037 +#ifndef AR6K_H_ 13038 +#define AR6K_H_ 13039 + 13040 +#define AR6K_MAILBOXES 4 13041 + 13042 +/* HTC runs over mailbox 0 */ 13043 +#define HTC_MAILBOX 0 13044 + 13045 +#define AR6K_TARGET_DEBUG_INTR_MASK 0x01 13046 + 13047 +#define OTHER_INTS_ENABLED (INT_STATUS_ENABLE_ERROR_MASK | \ 13048 + INT_STATUS_ENABLE_CPU_MASK | \ 13049 + INT_STATUS_ENABLE_COUNTER_MASK) 13050 + 13051 +//#define MBOXHW_UNIT_TEST 1 13052 + 13053 +#include "athstartpack.h" 13054 +typedef PREPACK struct _AR6K_IRQ_PROC_REGISTERS { 13055 + A_UINT8 host_int_status; 13056 + A_UINT8 cpu_int_status; 13057 + A_UINT8 error_int_status; 13058 + A_UINT8 counter_int_status; 13059 + A_UINT8 mbox_frame; 13060 + A_UINT8 rx_lookahead_valid; 13061 + A_UINT8 hole[2]; 13062 + A_UINT32 rx_lookahead[2]; 13063 +} POSTPACK AR6K_IRQ_PROC_REGISTERS; 13064 + 13065 +#define AR6K_IRQ_PROC_REGS_SIZE sizeof(AR6K_IRQ_PROC_REGISTERS) 13066 + 13067 + 13068 + 13069 +typedef PREPACK struct _AR6K_IRQ_ENABLE_REGISTERS { 13070 + A_UINT8 int_status_enable; 13071 + A_UINT8 cpu_int_status_enable; 13072 + A_UINT8 error_status_enable; 13073 + A_UINT8 counter_int_status_enable; 13074 +} POSTPACK AR6K_IRQ_ENABLE_REGISTERS; 13075 + 13076 +#include "athendpack.h" 13077 + 13078 +#define AR6K_IRQ_ENABLE_REGS_SIZE sizeof(AR6K_IRQ_ENABLE_REGISTERS) 13079 + 13080 +#define AR6K_REG_IO_BUFFER_SIZE 32 13081 +#define AR6K_MAX_REG_IO_BUFFERS 8 13082 + 13083 +/* buffers for ASYNC I/O */ 13084 +typedef struct AR6K_ASYNC_REG_IO_BUFFER { 13085 + HTC_PACKET HtcPacket; /* we use an HTC packet as a wrapper for our async register-based I/O */ 13086 + A_UINT8 Buffer[AR6K_REG_IO_BUFFER_SIZE]; 13087 +} AR6K_ASYNC_REG_IO_BUFFER; 13088 + 13089 +typedef struct _AR6K_DEVICE { 13090 + A_MUTEX_T Lock; 13091 + AR6K_IRQ_PROC_REGISTERS IrqProcRegisters; 13092 + AR6K_IRQ_ENABLE_REGISTERS IrqEnableRegisters; 13093 + void *HIFDevice; 13094 + A_UINT32 BlockSize; 13095 + A_UINT32 BlockMask; 13096 + A_UINT32 MailboxAddress; 13097 + HIF_PENDING_EVENTS_FUNC GetPendingEventsFunc; 13098 + void *HTCContext; 13099 + HTC_PACKET_QUEUE RegisterIOList; 13100 + AR6K_ASYNC_REG_IO_BUFFER RegIOBuffers[AR6K_MAX_REG_IO_BUFFERS]; 13101 + void (*TargetFailureCallback)(void *Context); 13102 + A_STATUS (*MessagePendingCallback)(void *Context, A_UINT32 LookAhead, A_BOOL *pAsyncProc); 13103 + HIF_DEVICE_IRQ_PROCESSING_MODE HifIRQProcessingMode; 13104 + HIF_MASK_UNMASK_RECV_EVENT HifMaskUmaskRecvEvent; 13105 +} AR6K_DEVICE; 13106 + 13107 +#define IS_DEV_IRQ_PROCESSING_ASYNC_ALLOWED(pDev) ((pDev)->HifIRQProcessingMode != HIF_DEVICE_IRQ_SYNC_ONLY) 13108 + 13109 +A_STATUS DevSetup(AR6K_DEVICE *pDev); 13110 +A_STATUS DevUnmaskInterrupts(AR6K_DEVICE *pDev); 13111 +A_STATUS DevMaskInterrupts(AR6K_DEVICE *pDev); 13112 +A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, 13113 + A_UINT32 *pLookAhead, 13114 + int TimeoutMS); 13115 +A_STATUS DevRWCompletionHandler(void *context, A_STATUS status); 13116 +A_STATUS DevDsrHandler(void *context); 13117 +A_STATUS DevCheckPendingRecvMsgsAsync(void *context); 13118 +void DevDumpRegisters(AR6K_IRQ_PROC_REGISTERS *pIrqProcRegs, 13119 + AR6K_IRQ_ENABLE_REGISTERS *pIrqEnableRegs); 13120 + 13121 +#define DEV_STOP_RECV_ASYNC TRUE 13122 +#define DEV_STOP_RECV_SYNC FALSE 13123 +#define DEV_ENABLE_RECV_ASYNC TRUE 13124 +#define DEV_ENABLE_RECV_SYNC FALSE 13125 +A_STATUS DevStopRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); 13126 +A_STATUS DevEnableRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); 13127 + 13128 +static INLINE A_STATUS DevSendPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 SendLength) { 13129 + A_UINT32 paddedLength; 13130 + A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; 13131 + A_STATUS status; 13132 + 13133 + /* adjust the length to be a multiple of block size if appropriate */ 13134 + paddedLength = (SendLength + (pDev->BlockMask)) & 13135 + (~(pDev->BlockMask)); 13136 +#if 0 // BufferLength may not be set in , fix this... 13137 + if (paddedLength > pPacket->BufferLength) { 13138 + AR_DEBUG_ASSERT(FALSE); 13139 + if (pPacket->Completion != NULL) { 13140 + COMPLETE_HTC_PACKET(pPacket,A_EINVAL); 13141 + } 13142 + return A_EINVAL; 13143 + } 13144 +#endif 13145 + AR_DEBUG_PRINTF(ATH_DEBUG_SEND, 13146 + ("DevSendPacket, Padded Length: %d Mbox:0x%X (mode:%s)\n", 13147 + paddedLength, 13148 + pDev->MailboxAddress, 13149 + sync ? "SYNC" : "ASYNC")); 13150 + 13151 + status = HIFReadWrite(pDev->HIFDevice, 13152 + pDev->MailboxAddress, 13153 + pPacket->pBuffer, 13154 + paddedLength, /* the padded length */ 13155 + sync ? HIF_WR_SYNC_BLOCK_INC : HIF_WR_ASYNC_BLOCK_INC, 13156 + sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ 13157 + 13158 + if (sync) { 13159 + pPacket->Status = status; 13160 + } 13161 + 13162 + return status; 13163 +} 13164 + 13165 +static INLINE A_STATUS DevRecvPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 RecvLength) { 13166 + A_UINT32 paddedLength; 13167 + A_STATUS status; 13168 + A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; 13169 + 13170 + /* adjust the length to be a multiple of block size if appropriate */ 13171 + paddedLength = (RecvLength + (pDev->BlockMask)) & 13172 + (~(pDev->BlockMask)); 13173 + if (paddedLength > pPacket->BufferLength) { 13174 + AR_DEBUG_ASSERT(FALSE); 13175 + AR_DEBUG_PRINTF(ATH_DEBUG_ERR, 13176 + ("DevRecvPacket, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n", 13177 + paddedLength,RecvLength,pPacket->BufferLength)); 13178 + if (pPacket->Completion != NULL) { 13179 + COMPLETE_HTC_PACKET(pPacket,A_EINVAL); 13180 + } 13181 + return A_EINVAL; 13182 + } 13183 + 13184 + AR_DEBUG_PRINTF(ATH_DEBUG_RECV, 13185 + ("DevRecvPacket, Padded Length: %d Mbox:0x%X (mode:%s)\n", 13186 + paddedLength, 13187 + pDev->MailboxAddress, 13188 + sync ? "SYNC" : "ASYNC")); 13189 + 13190 + status = HIFReadWrite(pDev->HIFDevice, 13191 + pDev->MailboxAddress, 13192 + pPacket->pBuffer, 13193 + paddedLength, 13194 + sync ? HIF_RD_SYNC_BLOCK_INC : HIF_RD_ASYNC_BLOCK_INC, 13195 + sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ 13196 + 13197 + if (sync) { 13198 + pPacket->Status = status; 13199 + } 13200 + 13201 + return status; 13202 +} 13203 + 13204 +#ifdef MBOXHW_UNIT_TEST 13205 +A_STATUS DoMboxHWTest(AR6K_DEVICE *pDev); 13206 +#endif 13207 + 13208 +#endif /*AR6K_H_*/ 13209 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/ar6k_events.c 13210 =================================================================== 13211 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 13212 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/ar6k_events.c 2008-01-22 13:33:10.000000000 +0100 12964 13213 @@ -0,0 +1,638 @@ 12965 13214 +/* … … 13601 13850 + 13602 13851 + 13603 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.h13852 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc.c 13604 13853 =================================================================== 13605 13854 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 13606 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/htc/ar6k.h 2008-01-14 13:07:38.000000000 +0100 13607 @@ -0,0 +1,191 @@ 13608 +/* 13609 + * 13610 + * Copyright (c) 2007 Atheros Communications Inc. 13611 + * All rights reserved. 13612 + * 13613 + * 13614 + * This program is free software; you can redistribute it and/or modify 13615 + * it under the terms of the GNU General Public License version 2 as 13616 + * published by the Free Software Foundation; 13617 + * 13618 + * Software distributed under the License is distributed on an "AS 13619 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 13620 + * implied. See the License for the specific language governing 13621 + * rights and limitations under the License. 13622 + * 13623 + * 13624 + * 13625 + */ 13626 + 13627 +#ifndef AR6K_H_ 13628 +#define AR6K_H_ 13629 + 13630 +#define AR6K_MAILBOXES 4 13631 + 13632 +/* HTC runs over mailbox 0 */ 13633 +#define HTC_MAILBOX 0 13634 + 13635 +#define AR6K_TARGET_DEBUG_INTR_MASK 0x01 13636 + 13637 +#define OTHER_INTS_ENABLED (INT_STATUS_ENABLE_ERROR_MASK | \ 13638 + INT_STATUS_ENABLE_CPU_MASK | \ 13639 + INT_STATUS_ENABLE_COUNTER_MASK) 13640 + 13641 +//#define MBOXHW_UNIT_TEST 1 13642 + 13643 +#include "athstartpack.h" 13644 +typedef PREPACK struct _AR6K_IRQ_PROC_REGISTERS { 13645 + A_UINT8 host_int_status; 13646 + A_UINT8 cpu_int_status; 13647 + A_UINT8 error_int_status; 13648 + A_UINT8 counter_int_status; 13649 + A_UINT8 mbox_frame; 13650 + A_UINT8 rx_lookahead_valid; 13651 + A_UINT8 hole[2]; 13652 + A_UINT32 rx_lookahead[2]; 13653 +} POSTPACK AR6K_IRQ_PROC_REGISTERS; 13654 + 13655 +#define AR6K_IRQ_PROC_REGS_SIZE sizeof(AR6K_IRQ_PROC_REGISTERS) 13656 + 13657 + 13658 + 13659 +typedef PREPACK struct _AR6K_IRQ_ENABLE_REGISTERS { 13660 + A_UINT8 int_status_enable; 13661 + A_UINT8 cpu_int_status_enable; 13662 + A_UINT8 error_status_enable; 13663 + A_UINT8 counter_int_status_enable; 13664 +} POSTPACK AR6K_IRQ_ENABLE_REGISTERS; 13665 + 13666 +#include "athendpack.h" 13667 + 13668 +#define AR6K_IRQ_ENABLE_REGS_SIZE sizeof(AR6K_IRQ_ENABLE_REGISTERS) 13669 + 13670 +#define AR6K_REG_IO_BUFFER_SIZE 32 13671 +#define AR6K_MAX_REG_IO_BUFFERS 8 13672 + 13673 +/* buffers for ASYNC I/O */ 13674 +typedef struct AR6K_ASYNC_REG_IO_BUFFER { 13675 + HTC_PACKET HtcPacket; /* we use an HTC packet as a wrapper for our async register-based I/O */ 13676 + A_UINT8 Buffer[AR6K_REG_IO_BUFFER_SIZE]; 13677 +} AR6K_ASYNC_REG_IO_BUFFER; 13678 + 13679 +typedef struct _AR6K_DEVICE { 13680 + A_MUTEX_T Lock; 13681 + AR6K_IRQ_PROC_REGISTERS IrqProcRegisters; 13682 + AR6K_IRQ_ENABLE_REGISTERS IrqEnableRegisters; 13683 + void *HIFDevice; 13684 + A_UINT32 BlockSize; 13685 + A_UINT32 BlockMask; 13686 + A_UINT32 MailboxAddress; 13687 + HIF_PENDING_EVENTS_FUNC GetPendingEventsFunc; 13688 + void *HTCContext; 13689 + HTC_PACKET_QUEUE RegisterIOList; 13690 + AR6K_ASYNC_REG_IO_BUFFER RegIOBuffers[AR6K_MAX_REG_IO_BUFFERS]; 13691 + void (*TargetFailureCallback)(void *Context); 13692 + A_STATUS (*MessagePendingCallback)(void *Context, A_UINT32 LookAhead, A_BOOL *pAsyncProc); 13693 + HIF_DEVICE_IRQ_PROCESSING_MODE HifIRQProcessingMode; 13694 + HIF_MASK_UNMASK_RECV_EVENT HifMaskUmaskRecvEvent; 13695 +} AR6K_DEVICE; 13696 + 13697 +#define IS_DEV_IRQ_PROCESSING_ASYNC_ALLOWED(pDev) ((pDev)->HifIRQProcessingMode != HIF_DEVICE_IRQ_SYNC_ONLY) 13698 + 13699 +A_STATUS DevSetup(AR6K_DEVICE *pDev); 13700 +A_STATUS DevUnmaskInterrupts(AR6K_DEVICE *pDev); 13701 +A_STATUS DevMaskInterrupts(AR6K_DEVICE *pDev); 13702 +A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, 13703 + A_UINT32 *pLookAhead, 13704 + int TimeoutMS); 13705 +A_STATUS DevRWCompletionHandler(void *context, A_STATUS status); 13706 +A_STATUS DevDsrHandler(void *context); 13707 +A_STATUS DevCheckPendingRecvMsgsAsync(void *context); 13708 +void DevDumpRegisters(AR6K_IRQ_PROC_REGISTERS *pIrqProcRegs, 13709 + AR6K_IRQ_ENABLE_REGISTERS *pIrqEnableRegs); 13710 + 13711 +#define DEV_STOP_RECV_ASYNC TRUE 13712 +#define DEV_STOP_RECV_SYNC FALSE 13713 +#define DEV_ENABLE_RECV_ASYNC TRUE 13714 +#define DEV_ENABLE_RECV_SYNC FALSE 13715 +A_STATUS DevStopRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); 13716 +A_STATUS DevEnableRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); 13717 + 13718 +static INLINE A_STATUS DevSendPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 SendLength) { 13719 + A_UINT32 paddedLength; 13720 + A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; 13721 + A_STATUS status; 13722 + 13723 + /* adjust the length to be a multiple of block size if appropriate */ 13724 + paddedLength = (SendLength + (pDev->BlockMask)) & 13725 + (~(pDev->BlockMask)); 13726 +#if 0 // BufferLength may not be set in , fix this... 13727 + if (paddedLength > pPacket->BufferLength) { 13728 + AR_DEBUG_ASSERT(FALSE); 13729 + if (pPacket->Completion != NULL) { 13730 + COMPLETE_HTC_PACKET(pPacket,A_EINVAL); 13731 + } 13732 + return A_EINVAL; 13733 + } 13734 +#endif 13735 + AR_DEBUG_PRINTF(ATH_DEBUG_SEND, 13736 + ("DevSendPacket, Padded Length: %d Mbox:0x%X (mode:%s)\n", 13737 + paddedLength, 13738 + pDev->MailboxAddress, 13739 + sync ? "SYNC" : "ASYNC")); 13740 + 13741 + status = HIFReadWrite(pDev->HIFDevice, 13742 + pDev->MailboxAddress, 13743 + pPacket->pBuffer, 13744 + paddedLength, /* the padded length */ 13745 + sync ? HIF_WR_SYNC_BLOCK_INC : HIF_WR_ASYNC_BLOCK_INC, 13746 + sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ 13747 + 13748 + if (sync) { 13749 + pPacket->Status = status; 13750 + } 13751 + 13752 + return status; 13753 +} 13754 + 13755 +static INLINE A_STATUS DevRecvPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 RecvLength) { 13756 + A_UINT32 paddedLength; 13757 + A_STATUS status; 13758 + A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; 13759 + 13760 + /* adjust the length to be a multiple of block size if appropriate */ 13761 + paddedLength = (RecvLength + (pDev->BlockMask)) & 13762 + (~(pDev->BlockMask)); 13763 + if (paddedLength > pPacket->BufferLength) { 13764 + AR_DEBUG_ASSERT(FALSE); 13765 + AR_DEBUG_PRINTF(ATH_DEBUG_ERR, 13766 + ("DevRecvPacket, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n", 13767 + paddedLength,RecvLength,pPacket->BufferLength)); 13768 + if (pPacket->Completion != NULL) { 13769 + COMPLETE_HTC_PACKET(pPacket,A_EINVAL); 13770 + } 13771 + return A_EINVAL; 13772 + } 13773 + 13774 + AR_DEBUG_PRINTF(ATH_DEBUG_RECV, 13775 + ("DevRecvPacket, Padded Length: %d Mbox:0x%X (mode:%s)\n", 13776 + paddedLength, 13777 + pDev->MailboxAddress, 13778 + sync ? "SYNC" : "ASYNC")); 13779 + 13780 + status = HIFReadWrite(pDev->HIFDevice, 13781 + pDev->MailboxAddress, 13782 + pPacket->pBuffer, 13783 + paddedLength, 13784 + sync ? HIF_RD_SYNC_BLOCK_INC : HIF_RD_ASYNC_BLOCK_INC, 13785 + sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */ 13786 + 13787 + if (sync) { 13788 + pPacket->Status = status; 13789 + } 13790 + 13791 + return status; 13792 +} 13793 + 13794 +#ifdef MBOXHW_UNIT_TEST 13795 +A_STATUS DoMboxHWTest(AR6K_DEVICE *pDev); 13796 +#endif 13797 + 13798 +#endif /*AR6K_H_*/ 13799 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/htc/htc.c 13800 =================================================================== 13801 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 13802 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/htc/htc.c 2008-01-14 13:07:38.000000000 +0100 13855 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc.c 2008-01-22 13:33:10.000000000 +0100 13803 13856 @@ -0,0 +1,507 @@ 13804 13857 +/* … … 14309 14362 +#endif 14310 14363 +} 14311 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_debug.h14364 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_debug.h 14312 14365 =================================================================== 14313 14366 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 14314 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_debug.h 2008-01-14 13:07:38.000000000 +010014367 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_debug.h 2008-01-22 13:33:10.000000000 +0100 14315 14368 @@ -0,0 +1,65 @@ 14316 14369 +#ifndef HTC_DEBUG_H_ … … 14379 14432 + 14380 14433 +#endif /*HTC_DEBUG_H_*/ 14381 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_internal.h14434 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_internal.h 14382 14435 =================================================================== 14383 14436 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 14384 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_internal.h 2008-01-14 13:07:38.000000000 +010014437 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_internal.h 2008-01-22 13:33:10.000000000 +0100 14385 14438 @@ -0,0 +1,168 @@ 14386 14439 +/* … … 14552 14605 + 14553 14606 +#endif /* _HTC_INTERNAL_H_ */ 14554 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_recv.c14607 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_recv.c 14555 14608 =================================================================== 14556 14609 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 14557 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_recv.c 2008-01-14 13:07:38.000000000 +010014610 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_recv.c 2008-01-22 13:33:10.000000000 +0100 14558 14611 @@ -0,0 +1,703 @@ 14559 14612 +/* … … 15260 15313 + 15261 15314 + 15262 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_send.c15315 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_send.c 15263 15316 =================================================================== 15264 15317 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 15265 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_send.c 2008-01-14 13:07:38.000000000 +010015318 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_send.c 2008-01-22 13:33:10.000000000 +0100 15266 15319 @@ -0,0 +1,541 @@ 15267 15320 +/* … … 15806 15859 + 15807 15860 +} 15808 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_services.c15861 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_services.c 15809 15862 =================================================================== 15810 15863 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 15811 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/htc/htc_services.c 2008-01-14 13:07:38.000000000 +010015864 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/htc/htc_services.c 2008-01-22 13:33:10.000000000 +0100 15812 15865 @@ -0,0 +1,403 @@ 15813 15866 +/* … … 16214 16267 + 16215 16268 +} 16216 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/a_config.h16269 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6001_regdump.h 16217 16270 =================================================================== 16218 16271 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16219 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_config.h 2008-01-14 13:07:38.000000000 +0100 16220 @@ -0,0 +1,27 @@ 16221 +#ifndef _A_CONFIG_H_ 16222 +#define _A_CONFIG_H_ 16223 +/* 16224 + * Copyright (c) 2004-2005 Atheros Communications Inc. 16225 + * All rights reserved. 16226 + * 16227 + * 16228 + * This program is free software; you can redistribute it and/or modify 16229 + * it under the terms of the GNU General Public License version 2 as 16230 + * published by the Free Software Foundation; 16231 + * 16232 + * Software distributed under the License is distributed on an "AS 16233 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16234 + * implied. See the License for the specific language governing 16235 + * rights and limitations under the License. 16236 + * 16237 + * 16238 + * 16239 + */ 16240 + 16241 +/* 16242 + * This file contains software configuration options that enables 16243 + * specific software "features" 16244 + */ 16245 +#include "../ar6000/config_linux.h" 16246 + 16247 +#endif 16248 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_debug.h 16249 =================================================================== 16250 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16251 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_debug.h 2008-01-14 13:07:38.000000000 +0100 16252 @@ -0,0 +1,41 @@ 16253 +#ifndef _A_DEBUG_H_ 16254 +#define _A_DEBUG_H_ 16255 +/* 16256 + * Copyright (c) 2004-2006 Atheros Communications Inc. 16257 + * All rights reserved. 16258 + * 16259 + * Copyright (c) 2004-2007 Atheros Communications Inc. 16260 + * All rights reserved. 16261 + * 16262 + * 16263 + * This program is free software; you can redistribute it and/or modify 16264 + * it under the terms of the GNU General Public License version 2 as 16265 + * published by the Free Software Foundation; 16266 + * 16267 + * Software distributed under the License is distributed on an "AS 16268 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16269 + * implied. See the License for the specific language governing 16270 + * rights and limitations under the License. 16271 + * 16272 + * 16273 + * 16274 + */ 16275 + 16276 +#include <a_types.h> 16277 +#include <a_osapi.h> 16278 + 16279 +#define DBG_INFO 0x00000001 16280 +#define DBG_ERROR 0x00000002 16281 +#define DBG_WARNING 0x00000004 16282 +#define DBG_SDIO 0x00000008 16283 +#define DBG_HIF 0x00000010 16284 +#define DBG_HTC 0x00000020 16285 +#define DBG_WMI 0x00000040 16286 +#define DBG_WMI2 0x00000080 16287 +#define DBG_DRIVER 0x00000100 16288 + 16289 +#define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING) 16290 + 16291 +#include "../ar6000/debug_linux.h" 16292 + 16293 +#endif 16294 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_drv_api.h 16295 =================================================================== 16296 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16297 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_drv_api.h 2008-01-14 13:07:38.000000000 +0100 16298 @@ -0,0 +1,185 @@ 16299 +#ifndef _A_DRV_API_H_ 16300 +#define _A_DRV_API_H_ 16301 +/* 16302 + * Copyright (c) 2004-2006 Atheros Communications Inc. 16303 + * All rights reserved. 16304 + * 16305 + * 16306 + * This program is free software; you can redistribute it and/or modify 16307 + * it under the terms of the GNU General Public License version 2 as 16308 + * published by the Free Software Foundation; 16309 + * 16310 + * Software distributed under the License is distributed on an "AS 16311 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16312 + * implied. See the License for the specific language governing 16313 + * rights and limitations under the License. 16314 + * 16315 + * 16316 + * 16317 + */ 16318 + 16319 +#ifdef __cplusplus 16320 +extern "C" { 16321 +#endif 16322 + 16323 +/****************************************************************************/ 16324 +/****************************************************************************/ 16325 +/** **/ 16326 +/** WMI related hooks **/ 16327 +/** **/ 16328 +/****************************************************************************/ 16329 +/****************************************************************************/ 16330 + 16331 +#include <ar6000_api.h> 16332 + 16333 +#define A_WMI_CHANNELLIST_RX(devt, numChan, chanList) \ 16334 + ar6000_channelList_rx((devt), (numChan), (chanList)) 16335 + 16336 +#define A_WMI_SET_NUMDATAENDPTS(devt, num) \ 16337 + ar6000_set_numdataendpts((devt), (num)) 16338 + 16339 +#define A_WMI_CONTROL_TX(devt, osbuf, streamID) \ 16340 + ar6000_control_tx((devt), (osbuf), (streamID)) 16341 + 16342 +#define A_WMI_TARGETSTATS_EVENT(devt, pStats) \ 16343 + ar6000_targetStats_event((devt), (pStats)) 16344 + 16345 +#define A_WMI_SCANCOMPLETE_EVENT(devt, status) \ 16346 + ar6000_scanComplete_event((devt), (status)) 16347 + 16348 +#ifdef CONFIG_HOST_DSET_SUPPORT 16349 + 16350 +#define A_WMI_DSET_DATA_REQ(devt, access_cookie, offset, length, targ_buf, targ_reply_fn, targ_reply_arg) \ 16351 + ar6000_dset_data_req((devt), (access_cookie), (offset), (length), (targ_buf), (targ_reply_fn), (targ_reply_arg)) 16352 + 16353 +#define A_WMI_DSET_CLOSE(devt, access_cookie) \ 16354 + ar6000_dset_close((devt), (access_cookie)) 16355 + 16356 +#endif 16357 + 16358 +#define A_WMI_DSET_OPEN_REQ(devt, id, targ_handle, targ_reply_fn, targ_reply_arg) \ 16359 + ar6000_dset_open_req((devt), (id), (targ_handle), (targ_reply_fn), (targ_reply_arg)) 16360 + 16361 +#define A_WMI_CONNECT_EVENT(devt, channel, bssid, listenInterval, beaconInterval, networkType, beaconIeLen, assocReqLen, assocRespLen, assocInfo) \ 16362 + ar6000_connect_event((devt), (channel), (bssid), (listenInterval), (beaconInterval), (networkType), (beaconIeLen), (assocReqLen), (assocRespLen), (assocInfo)) 16363 + 16364 +#define A_WMI_REGDOMAIN_EVENT(devt, regCode) \ 16365 + ar6000_regDomain_event((devt), (regCode)) 16366 + 16367 +#define A_WMI_NEIGHBORREPORT_EVENT(devt, numAps, info) \ 16368 + ar6000_neighborReport_event((devt), (numAps), (info)) 16369 + 16370 +#define A_WMI_DISCONNECT_EVENT(devt, reason, bssid, assocRespLen, assocInfo, protocolReasonStatus) \ 16371 + ar6000_disconnect_event((devt), (reason), (bssid), (assocRespLen), (assocInfo), (protocolReasonStatus)) 16372 + 16373 +#define A_WMI_TKIP_MICERR_EVENT(devt, keyid, ismcast) \ 16374 + ar6000_tkip_micerr_event((devt), (keyid), (ismcast)) 16375 + 16376 +#define A_WMI_BITRATE_RX(devt, rateKbps) \ 16377 + ar6000_bitrate_rx((devt), (rateKbps)) 16378 + 16379 +#define A_WMI_TXPWR_RX(devt, txPwr) \ 16380 + ar6000_txPwr_rx((devt), (txPwr)) 16381 + 16382 +#define A_WMI_READY_EVENT(devt, datap, phyCap) \ 16383 + ar6000_ready_event((devt), (datap), (phyCap)) 16384 + 16385 +#define A_WMI_DBGLOG_INIT_DONE(ar) \ 16386 + ar6000_dbglog_init_done(ar); 16387 + 16388 +#define A_WMI_RSSI_THRESHOLD_EVENT(devt, newThreshold, rssi) \ 16389 + ar6000_rssiThreshold_event((devt), (newThreshold), (rssi)) 16390 + 16391 +#define A_WMI_REPORT_ERROR_EVENT(devt, errorVal) \ 16392 + ar6000_reportError_event((devt), (errorVal)) 16393 + 16394 +#define A_WMI_ROAM_TABLE_EVENT(devt, pTbl) \ 16395 + ar6000_roam_tbl_event((devt), (pTbl)) 16396 + 16397 +#define A_WMI_ROAM_DATA_EVENT(devt, p) \ 16398 + ar6000_roam_data_event((devt), (p)) 16399 + 16400 +#define A_WMI_WOW_LIST_EVENT(devt, num_filters, wow_filters) \ 16401 + ar6000_wow_list_event((devt), (num_filters), (wow_filters)) 16402 + 16403 +#define A_WMI_CAC_EVENT(devt, ac, cac_indication, statusCode, tspecSuggestion) \ 16404 + ar6000_cac_event((devt), (ac), (cac_indication), (statusCode), (tspecSuggestion)) 16405 + 16406 +#define A_WMI_IPTOS_TO_USERPRIORITY(pkt) \ 16407 + ar6000_iptos_to_userPriority((pkt)) 16408 + 16409 +#define A_WMI_PMKID_LIST_EVENT(devt, num_pmkid, pmkid_list) \ 16410 + ar6000_pmkid_list_event((devt), (num_pmkid), (pmkid_list)) 16411 + 16412 +#ifdef CONFIG_HOST_GPIO_SUPPORT 16413 + 16414 +#define A_WMI_GPIO_INTR_RX(intr_mask, input_values) \ 16415 + ar6000_gpio_intr_rx((intr_mask), (input_values)) 16416 + 16417 +#define A_WMI_GPIO_DATA_RX(reg_id, value) \ 16418 + ar6000_gpio_data_rx((reg_id), (value)) 16419 + 16420 +#define A_WMI_GPIO_ACK_RX() \ 16421 + ar6000_gpio_ack_rx() 16422 + 16423 +#endif 16424 + 16425 +#ifdef SEND_EVENT_TO_APP 16426 + 16427 +#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len) \ 16428 + ar6000_send_event_to_app((ar), (eventId), (datap), (len)) 16429 + 16430 +#else 16431 + 16432 +#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len) 16433 + 16434 +#endif 16435 + 16436 +#ifdef CONFIG_HOST_TCMD_SUPPORT 16437 +#define A_WMI_TCMD_RX_REPORT_EVENT(devt, results, len) \ 16438 + ar6000_tcmd_rx_report_event((devt), (results), (len)) 16439 +#endif 16440 + 16441 +#define A_WMI_HBCHALLENGERESP_EVENT(devt, cookie, source) \ 16442 + ar6000_hbChallengeResp_event((devt), (cookie), (source)) 16443 + 16444 +#define A_WMI_TX_RETRY_ERR_EVENT(devt) \ 16445 + ar6000_tx_retry_err_event((devt)) 16446 + 16447 +#define A_WMI_SNR_THRESHOLD_EVENT_RX(devt, newThreshold, snr) \ 16448 + ar6000_snrThresholdEvent_rx((devt), (newThreshold), (snr)) 16449 + 16450 +#define A_WMI_LQ_THRESHOLD_EVENT_RX(devt, range, lqVal) \ 16451 + ar6000_lqThresholdEvent_rx((devt), (range), (lqVal)) 16452 + 16453 +#define A_WMI_RATEMASK_RX(devt, ratemask) \ 16454 + ar6000_ratemask_rx((devt), (ratemask)) 16455 + 16456 +#define A_WMI_KEEPALIVE_RX(devt, configured) \ 16457 + ar6000_keepalive_rx((devt), (configured)) 16458 + 16459 +#define A_WMI_BSSINFO_EVENT_RX(ar, datp, len) \ 16460 + ar6000_bssInfo_event_rx((ar), (datap), (len)) 16461 + 16462 +#define A_WMI_DBGLOG_EVENT(ar, dropped, buffer, length) \ 16463 + ar6000_dbglog_event((ar), (dropped), (buffer), (length)); 16464 + 16465 +#define A_WMI_STREAM_TX_ACTIVE(devt,trafficClass) \ 16466 + ar6000_indicate_tx_activity((devt),(trafficClass), TRUE) 16467 + 16468 +#define A_WMI_STREAM_TX_INACTIVE(devt,trafficClass) \ 16469 + ar6000_indicate_tx_activity((devt),(trafficClass), FALSE) 16470 + 16471 +/****************************************************************************/ 16472 +/****************************************************************************/ 16473 +/** **/ 16474 +/** HTC related hooks **/ 16475 +/** **/ 16476 +/****************************************************************************/ 16477 +/****************************************************************************/ 16478 + 16479 +#ifdef __cplusplus 16480 +} 16481 +#endif 16482 + 16483 +#endif 16484 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_drv.h 16485 =================================================================== 16486 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16487 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_drv.h 2008-01-14 13:07:38.000000000 +0100 16488 @@ -0,0 +1,28 @@ 16489 +#ifndef _A_DRV_H_ 16490 +#define _A_DRV_H_ 16491 +/* 16492 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_drv.h#1 $ 16493 + * 16494 + * This file contains the definitions of the basic atheros data types. 16495 + * It is used to map the data types in atheros files to a platform specific 16496 + * type. 16497 + * 16498 + * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved. 16499 + * 16500 + * 16501 + * This program is free software; you can redistribute it and/or modify 16502 + * it under the terms of the GNU General Public License version 2 as 16503 + * published by the Free Software Foundation; 16504 + * 16505 + * Software distributed under the License is distributed on an "AS 16506 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16507 + * implied. See the License for the specific language governing 16508 + * rights and limitations under the License. 16509 + * 16510 + * 16511 + * 16512 + */ 16513 + 16514 +#include "../ar6000/athdrv_linux.h" 16515 + 16516 +#endif /* _ADRV_H_ */ 16517 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_osapi.h 16518 =================================================================== 16519 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16520 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_osapi.h 2008-01-14 13:07:38.000000000 +0100 16521 @@ -0,0 +1,28 @@ 16522 +#ifndef _A_OSAPI_H_ 16523 +#define _A_OSAPI_H_ 16524 +/* 16525 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_osapi.h#1 $ 16526 + * 16527 + * This file contains the definitions of the basic atheros data types. 16528 + * It is used to map the data types in atheros files to a platform specific 16529 + * type. 16530 + * 16531 + * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved. 16532 + * 16533 + * 16534 + * This program is free software; you can redistribute it and/or modify 16535 + * it under the terms of the GNU General Public License version 2 as 16536 + * published by the Free Software Foundation; 16537 + * 16538 + * Software distributed under the License is distributed on an "AS 16539 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16540 + * implied. See the License for the specific language governing 16541 + * rights and limitations under the License. 16542 + * 16543 + * 16544 + * 16545 + */ 16546 + 16547 +#include "../ar6000/osapi_linux.h" 16548 + 16549 +#endif /* _OSAPI_H_ */ 16550 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/ar6000_api.h 16551 =================================================================== 16552 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16553 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/ar6000_api.h 2008-01-14 13:07:38.000000000 +0100 16554 @@ -0,0 +1,29 @@ 16555 +#ifndef _AR6000_API_H_ 16556 +#define _AR6000_API_H_ 16557 +/* 16558 + * Copyright (c) 2004-2005 Atheros Communications Inc. 16559 + * All rights reserved. 16560 + * 16561 + * This file contains the API to access the OS dependent atheros host driver 16562 + * by the WMI or WLAN generic modules. 16563 + * 16564 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/ar6000_api.h#1 $ 16565 + * 16566 + * 16567 + * This program is free software; you can redistribute it and/or modify 16568 + * it under the terms of the GNU General Public License version 2 as 16569 + * published by the Free Software Foundation; 16570 + * 16571 + * Software distributed under the License is distributed on an "AS 16572 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16573 + * implied. See the License for the specific language governing 16574 + * rights and limitations under the License. 16575 + * 16576 + * 16577 + * 16578 + */ 16579 + 16580 +#include "../ar6000/ar6xapi_linux.h" 16581 + 16582 +#endif /* _AR6000_API_H */ 16583 + 16584 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/ar6000_diag.h 16585 =================================================================== 16586 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16587 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/ar6000_diag.h 2008-01-14 13:07:38.000000000 +0100 16588 @@ -0,0 +1,38 @@ 16589 +/* 16590 + * 16591 + * Copyright (c) 2004-2007 Atheros Communications Inc. 16592 + * All rights reserved. 16593 + * 16594 + * 16595 + * This program is free software; you can redistribute it and/or modify 16596 + * it under the terms of the GNU General Public License version 2 as 16597 + * published by the Free Software Foundation; 16598 + * 16599 + * Software distributed under the License is distributed on an "AS 16600 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16601 + * implied. See the License for the specific language governing 16602 + * rights and limitations under the License. 16603 + * 16604 + * 16605 + * 16606 + */ 16607 + 16608 +#ifndef AR6000_DIAG_H_ 16609 +#define AR6000_DIAG_H_ 16610 + 16611 + 16612 +A_STATUS 16613 +ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); 16614 + 16615 +A_STATUS 16616 +ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); 16617 + 16618 +A_STATUS 16619 +ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, 16620 + A_UCHAR *data, A_UINT32 length); 16621 + 16622 +A_STATUS 16623 +ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, 16624 + A_UCHAR *data, A_UINT32 length); 16625 + 16626 +#endif /*AR6000_DIAG_H_*/ 16627 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/AR6001_regdump.h 16628 =================================================================== 16629 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16630 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/AR6001_regdump.h 2008-01-14 13:07:38.000000000 +0100 16272 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6001_regdump.h 2008-01-22 13:33:10.000000000 +0100 16631 16273 @@ -0,0 +1,100 @@ 16632 16274 +/* … … 16730 16372 + 16731 16373 +#endif /* __AR6000_REGDUMP_H__ */ 16732 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/AR6Khwreg.h16374 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h 16733 16375 =================================================================== 16734 16376 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16735 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/AR6Khwreg.h 2008-01-14 13:07:38.000000000 +0100 16377 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h 2008-01-22 13:33:10.000000000 +0100 16378 @@ -0,0 +1,36 @@ 16379 +#define __VER_MAJOR_ 2 16380 +#define __VER_MINOR_ 0 16381 +#define __VER_PATCH_ 0 16382 + 16383 + 16384 +/* 16385 + * Copyright (c) 2004-2007 Atheros Communications Inc. 16386 + * All rights reserved. 16387 + * 16388 + * $ATH_LICENSE_HOSTSDK0_C$ 16389 + * 16390 + * The makear6ksdk script (used for release builds) modifies the following line. 16391 + */ 16392 +#define __BUILD_NUMBER_ 18 16393 + 16394 + 16395 +/* Format of the version number. */ 16396 +#define VER_MAJOR_BIT_OFFSET 28 16397 +#define VER_MINOR_BIT_OFFSET 24 16398 +#define VER_PATCH_BIT_OFFSET 16 16399 +#define VER_BUILD_NUM_BIT_OFFSET 0 16400 + 16401 + 16402 +/* 16403 + * The version has the following format: 16404 + * Bits 28-31: Major version 16405 + * Bits 24-27: Minor version 16406 + * Bits 16-23: Patch version 16407 + * Bits 0-15: Build number (automatically generated during build process ) 16408 + * E.g. Build 1.1.3.7 would be represented as 0x11030007. 16409 + * 16410 + * DO NOT split the following macro into multiple lines as this may confuse the build scripts. 16411 + */ 16412 +#define AR6K_SW_VERSION ( ( __VER_MAJOR_ << VER_MAJOR_BIT_OFFSET ) + ( __VER_MINOR_ << VER_MINOR_BIT_OFFSET ) + ( __VER_PATCH_ << VER_PATCH_BIT_OFFSET ) + ( __BUILD_NUMBER_ << VER_BUILD_NUM_BIT_OFFSET ) ) 16413 + 16414 + 16415 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h.NEW 16416 =================================================================== 16417 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16418 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h.NEW 2008-01-22 13:33:10.000000000 +0100 16419 @@ -0,0 +1,36 @@ 16420 +#define __VER_MAJOR_ 2 16421 +#define __VER_MINOR_ 0 16422 +#define __VER_PATCH_ 0 16423 + 16424 + 16425 +/* 16426 + * Copyright (c) 2004-2007 Atheros Communications Inc. 16427 + * All rights reserved. 16428 + * 16429 + * $ATH_LICENSE_HOSTSDK0_C$ 16430 + * 16431 + * The makear6ksdk script (used for release builds) modifies the following line. 16432 + */ 16433 +#define __BUILD_NUMBER_ 18 16434 + 16435 + 16436 +/* Format of the version number. */ 16437 +#define VER_MAJOR_BIT_OFFSET 28 16438 +#define VER_MINOR_BIT_OFFSET 24 16439 +#define VER_PATCH_BIT_OFFSET 16 16440 +#define VER_BUILD_NUM_BIT_OFFSET 0 16441 + 16442 + 16443 +/* 16444 + * The version has the following format: 16445 + * Bits 28-31: Major version 16446 + * Bits 24-27: Minor version 16447 + * Bits 16-23: Patch version 16448 + * Bits 0-15: Build number (automatically generated during build process ) 16449 + * E.g. Build 1.1.3.7 would be represented as 0x11030007. 16450 + * 16451 + * DO NOT split the following macro into multiple lines as this may confuse the build scripts. 16452 + */ 16453 +#define AR6K_SW_VERSION ( ( __VER_MAJOR_ << VER_MAJOR_BIT_OFFSET ) + ( __VER_MINOR_ << VER_MINOR_BIT_OFFSET ) + ( __VER_PATCH_ << VER_PATCH_BIT_OFFSET ) + ( __BUILD_NUMBER_ << VER_BUILD_NUM_BIT_OFFSET ) ) 16454 + 16455 + 16456 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6Khwreg.h 16457 =================================================================== 16458 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16459 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/AR6Khwreg.h 2008-01-22 13:33:10.000000000 +0100 16736 16460 @@ -0,0 +1,147 @@ 16737 16461 +/* … … 16882 16606 + 16883 16607 +#endif /* __AR6KHWREG_H__ */ 16884 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h16608 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_config.h 16885 16609 =================================================================== 16886 16610 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16887 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h 2008-01-14 13:07:38.000000000 +0100 16888 @@ -0,0 +1,36 @@ 16889 +#define __VER_MAJOR_ 2 16890 +#define __VER_MINOR_ 0 16891 +#define __VER_PATCH_ 0 16892 + 16893 + 16894 +/* 16611 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_config.h 2008-01-22 13:33:10.000000000 +0100 16612 @@ -0,0 +1,27 @@ 16613 +#ifndef _A_CONFIG_H_ 16614 +#define _A_CONFIG_H_ 16615 +/* 16616 + * Copyright (c) 2004-2005 Atheros Communications Inc. 16617 + * All rights reserved. 16618 + * 16619 + * 16620 + * This program is free software; you can redistribute it and/or modify 16621 + * it under the terms of the GNU General Public License version 2 as 16622 + * published by the Free Software Foundation; 16623 + * 16624 + * Software distributed under the License is distributed on an "AS 16625 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16626 + * implied. See the License for the specific language governing 16627 + * rights and limitations under the License. 16628 + * 16629 + * 16630 + * 16631 + */ 16632 + 16633 +/* 16634 + * This file contains software configuration options that enables 16635 + * specific software "features" 16636 + */ 16637 +#include "../ar6000/config_linux.h" 16638 + 16639 +#endif 16640 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_debug.h 16641 =================================================================== 16642 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16643 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_debug.h 2008-01-22 13:33:10.000000000 +0100 16644 @@ -0,0 +1,41 @@ 16645 +#ifndef _A_DEBUG_H_ 16646 +#define _A_DEBUG_H_ 16647 +/* 16648 + * Copyright (c) 2004-2006 Atheros Communications Inc. 16649 + * All rights reserved. 16650 + * 16895 16651 + * Copyright (c) 2004-2007 Atheros Communications Inc. 16896 16652 + * All rights reserved. 16897 16653 + * 16898 + * $ATH_LICENSE_HOSTSDK0_C$ 16899 + * 16900 + * The makear6ksdk script (used for release builds) modifies the following line. 16901 + */ 16902 +#define __BUILD_NUMBER_ 18 16903 + 16904 + 16905 +/* Format of the version number. */ 16906 +#define VER_MAJOR_BIT_OFFSET 28 16907 +#define VER_MINOR_BIT_OFFSET 24 16908 +#define VER_PATCH_BIT_OFFSET 16 16909 +#define VER_BUILD_NUM_BIT_OFFSET 0 16910 + 16911 + 16912 +/* 16913 + * The version has the following format: 16914 + * Bits 28-31: Major version 16915 + * Bits 24-27: Minor version 16916 + * Bits 16-23: Patch version 16917 + * Bits 0-15: Build number (automatically generated during build process ) 16918 + * E.g. Build 1.1.3.7 would be represented as 0x11030007. 16919 + * 16920 + * DO NOT split the following macro into multiple lines as this may confuse the build scripts. 16921 + */ 16922 +#define AR6K_SW_VERSION ( ( __VER_MAJOR_ << VER_MAJOR_BIT_OFFSET ) + ( __VER_MINOR_ << VER_MINOR_BIT_OFFSET ) + ( __VER_PATCH_ << VER_PATCH_BIT_OFFSET ) + ( __BUILD_NUMBER_ << VER_BUILD_NUM_BIT_OFFSET ) ) 16923 + 16924 + 16925 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h.NEW 16654 + * 16655 + * This program is free software; you can redistribute it and/or modify 16656 + * it under the terms of the GNU General Public License version 2 as 16657 + * published by the Free Software Foundation; 16658 + * 16659 + * Software distributed under the License is distributed on an "AS 16660 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16661 + * implied. See the License for the specific language governing 16662 + * rights and limitations under the License. 16663 + * 16664 + * 16665 + * 16666 + */ 16667 + 16668 +#include <a_types.h> 16669 +#include <a_osapi.h> 16670 + 16671 +#define DBG_INFO 0x00000001 16672 +#define DBG_ERROR 0x00000002 16673 +#define DBG_WARNING 0x00000004 16674 +#define DBG_SDIO 0x00000008 16675 +#define DBG_HIF 0x00000010 16676 +#define DBG_HTC 0x00000020 16677 +#define DBG_WMI 0x00000040 16678 +#define DBG_WMI2 0x00000080 16679 +#define DBG_DRIVER 0x00000100 16680 + 16681 +#define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING) 16682 + 16683 +#include "../ar6000/debug_linux.h" 16684 + 16685 +#endif 16686 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_drv.h 16926 16687 =================================================================== 16927 16688 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16928 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/AR6K_version.h.NEW 2008-01-14 13:07:38.000000000 +0100 16929 @@ -0,0 +1,36 @@ 16930 +#define __VER_MAJOR_ 2 16931 +#define __VER_MINOR_ 0 16932 +#define __VER_PATCH_ 0 16933 + 16934 + 16935 +/* 16689 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_drv.h 2008-01-22 13:33:10.000000000 +0100 16690 @@ -0,0 +1,28 @@ 16691 +#ifndef _A_DRV_H_ 16692 +#define _A_DRV_H_ 16693 +/* 16694 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_drv.h#1 $ 16695 + * 16696 + * This file contains the definitions of the basic atheros data types. 16697 + * It is used to map the data types in atheros files to a platform specific 16698 + * type. 16699 + * 16700 + * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved. 16701 + * 16702 + * 16703 + * This program is free software; you can redistribute it and/or modify 16704 + * it under the terms of the GNU General Public License version 2 as 16705 + * published by the Free Software Foundation; 16706 + * 16707 + * Software distributed under the License is distributed on an "AS 16708 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16709 + * implied. See the License for the specific language governing 16710 + * rights and limitations under the License. 16711 + * 16712 + * 16713 + * 16714 + */ 16715 + 16716 +#include "../ar6000/athdrv_linux.h" 16717 + 16718 +#endif /* _ADRV_H_ */ 16719 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_drv_api.h 16720 =================================================================== 16721 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16722 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_drv_api.h 2008-01-22 13:33:10.000000000 +0100 16723 @@ -0,0 +1,185 @@ 16724 +#ifndef _A_DRV_API_H_ 16725 +#define _A_DRV_API_H_ 16726 +/* 16727 + * Copyright (c) 2004-2006 Atheros Communications Inc. 16728 + * All rights reserved. 16729 + * 16730 + * 16731 + * This program is free software; you can redistribute it and/or modify 16732 + * it under the terms of the GNU General Public License version 2 as 16733 + * published by the Free Software Foundation; 16734 + * 16735 + * Software distributed under the License is distributed on an "AS 16736 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16737 + * implied. See the License for the specific language governing 16738 + * rights and limitations under the License. 16739 + * 16740 + * 16741 + * 16742 + */ 16743 + 16744 +#ifdef __cplusplus 16745 +extern "C" { 16746 +#endif 16747 + 16748 +/****************************************************************************/ 16749 +/****************************************************************************/ 16750 +/** **/ 16751 +/** WMI related hooks **/ 16752 +/** **/ 16753 +/****************************************************************************/ 16754 +/****************************************************************************/ 16755 + 16756 +#include <ar6000_api.h> 16757 + 16758 +#define A_WMI_CHANNELLIST_RX(devt, numChan, chanList) \ 16759 + ar6000_channelList_rx((devt), (numChan), (chanList)) 16760 + 16761 +#define A_WMI_SET_NUMDATAENDPTS(devt, num) \ 16762 + ar6000_set_numdataendpts((devt), (num)) 16763 + 16764 +#define A_WMI_CONTROL_TX(devt, osbuf, streamID) \ 16765 + ar6000_control_tx((devt), (osbuf), (streamID)) 16766 + 16767 +#define A_WMI_TARGETSTATS_EVENT(devt, pStats) \ 16768 + ar6000_targetStats_event((devt), (pStats)) 16769 + 16770 +#define A_WMI_SCANCOMPLETE_EVENT(devt, status) \ 16771 + ar6000_scanComplete_event((devt), (status)) 16772 + 16773 +#ifdef CONFIG_HOST_DSET_SUPPORT 16774 + 16775 +#define A_WMI_DSET_DATA_REQ(devt, access_cookie, offset, length, targ_buf, targ_reply_fn, targ_reply_arg) \ 16776 + ar6000_dset_data_req((devt), (access_cookie), (offset), (length), (targ_buf), (targ_reply_fn), (targ_reply_arg)) 16777 + 16778 +#define A_WMI_DSET_CLOSE(devt, access_cookie) \ 16779 + ar6000_dset_close((devt), (access_cookie)) 16780 + 16781 +#endif 16782 + 16783 +#define A_WMI_DSET_OPEN_REQ(devt, id, targ_handle, targ_reply_fn, targ_reply_arg) \ 16784 + ar6000_dset_open_req((devt), (id), (targ_handle), (targ_reply_fn), (targ_reply_arg)) 16785 + 16786 +#define A_WMI_CONNECT_EVENT(devt, channel, bssid, listenInterval, beaconInterval, networkType, beaconIeLen, assocReqLen, assocRespLen, assocInfo) \ 16787 + ar6000_connect_event((devt), (channel), (bssid), (listenInterval), (beaconInterval), (networkType), (beaconIeLen), (assocReqLen), (assocRespLen), (assocInfo)) 16788 + 16789 +#define A_WMI_REGDOMAIN_EVENT(devt, regCode) \ 16790 + ar6000_regDomain_event((devt), (regCode)) 16791 + 16792 +#define A_WMI_NEIGHBORREPORT_EVENT(devt, numAps, info) \ 16793 + ar6000_neighborReport_event((devt), (numAps), (info)) 16794 + 16795 +#define A_WMI_DISCONNECT_EVENT(devt, reason, bssid, assocRespLen, assocInfo, protocolReasonStatus) \ 16796 + ar6000_disconnect_event((devt), (reason), (bssid), (assocRespLen), (assocInfo), (protocolReasonStatus)) 16797 + 16798 +#define A_WMI_TKIP_MICERR_EVENT(devt, keyid, ismcast) \ 16799 + ar6000_tkip_micerr_event((devt), (keyid), (ismcast)) 16800 + 16801 +#define A_WMI_BITRATE_RX(devt, rateKbps) \ 16802 + ar6000_bitrate_rx((devt), (rateKbps)) 16803 + 16804 +#define A_WMI_TXPWR_RX(devt, txPwr) \ 16805 + ar6000_txPwr_rx((devt), (txPwr)) 16806 + 16807 +#define A_WMI_READY_EVENT(devt, datap, phyCap) \ 16808 + ar6000_ready_event((devt), (datap), (phyCap)) 16809 + 16810 +#define A_WMI_DBGLOG_INIT_DONE(ar) \ 16811 + ar6000_dbglog_init_done(ar); 16812 + 16813 +#define A_WMI_RSSI_THRESHOLD_EVENT(devt, newThreshold, rssi) \ 16814 + ar6000_rssiThreshold_event((devt), (newThreshold), (rssi)) 16815 + 16816 +#define A_WMI_REPORT_ERROR_EVENT(devt, errorVal) \ 16817 + ar6000_reportError_event((devt), (errorVal)) 16818 + 16819 +#define A_WMI_ROAM_TABLE_EVENT(devt, pTbl) \ 16820 + ar6000_roam_tbl_event((devt), (pTbl)) 16821 + 16822 +#define A_WMI_ROAM_DATA_EVENT(devt, p) \ 16823 + ar6000_roam_data_event((devt), (p)) 16824 + 16825 +#define A_WMI_WOW_LIST_EVENT(devt, num_filters, wow_filters) \ 16826 + ar6000_wow_list_event((devt), (num_filters), (wow_filters)) 16827 + 16828 +#define A_WMI_CAC_EVENT(devt, ac, cac_indication, statusCode, tspecSuggestion) \ 16829 + ar6000_cac_event((devt), (ac), (cac_indication), (statusCode), (tspecSuggestion)) 16830 + 16831 +#define A_WMI_IPTOS_TO_USERPRIORITY(pkt) \ 16832 + ar6000_iptos_to_userPriority((pkt)) 16833 + 16834 +#define A_WMI_PMKID_LIST_EVENT(devt, num_pmkid, pmkid_list) \ 16835 + ar6000_pmkid_list_event((devt), (num_pmkid), (pmkid_list)) 16836 + 16837 +#ifdef CONFIG_HOST_GPIO_SUPPORT 16838 + 16839 +#define A_WMI_GPIO_INTR_RX(intr_mask, input_values) \ 16840 + ar6000_gpio_intr_rx((intr_mask), (input_values)) 16841 + 16842 +#define A_WMI_GPIO_DATA_RX(reg_id, value) \ 16843 + ar6000_gpio_data_rx((reg_id), (value)) 16844 + 16845 +#define A_WMI_GPIO_ACK_RX() \ 16846 + ar6000_gpio_ack_rx() 16847 + 16848 +#endif 16849 + 16850 +#ifdef SEND_EVENT_TO_APP 16851 + 16852 +#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len) \ 16853 + ar6000_send_event_to_app((ar), (eventId), (datap), (len)) 16854 + 16855 +#else 16856 + 16857 +#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len) 16858 + 16859 +#endif 16860 + 16861 +#ifdef CONFIG_HOST_TCMD_SUPPORT 16862 +#define A_WMI_TCMD_RX_REPORT_EVENT(devt, results, len) \ 16863 + ar6000_tcmd_rx_report_event((devt), (results), (len)) 16864 +#endif 16865 + 16866 +#define A_WMI_HBCHALLENGERESP_EVENT(devt, cookie, source) \ 16867 + ar6000_hbChallengeResp_event((devt), (cookie), (source)) 16868 + 16869 +#define A_WMI_TX_RETRY_ERR_EVENT(devt) \ 16870 + ar6000_tx_retry_err_event((devt)) 16871 + 16872 +#define A_WMI_SNR_THRESHOLD_EVENT_RX(devt, newThreshold, snr) \ 16873 + ar6000_snrThresholdEvent_rx((devt), (newThreshold), (snr)) 16874 + 16875 +#define A_WMI_LQ_THRESHOLD_EVENT_RX(devt, range, lqVal) \ 16876 + ar6000_lqThresholdEvent_rx((devt), (range), (lqVal)) 16877 + 16878 +#define A_WMI_RATEMASK_RX(devt, ratemask) \ 16879 + ar6000_ratemask_rx((devt), (ratemask)) 16880 + 16881 +#define A_WMI_KEEPALIVE_RX(devt, configured) \ 16882 + ar6000_keepalive_rx((devt), (configured)) 16883 + 16884 +#define A_WMI_BSSINFO_EVENT_RX(ar, datp, len) \ 16885 + ar6000_bssInfo_event_rx((ar), (datap), (len)) 16886 + 16887 +#define A_WMI_DBGLOG_EVENT(ar, dropped, buffer, length) \ 16888 + ar6000_dbglog_event((ar), (dropped), (buffer), (length)); 16889 + 16890 +#define A_WMI_STREAM_TX_ACTIVE(devt,trafficClass) \ 16891 + ar6000_indicate_tx_activity((devt),(trafficClass), TRUE) 16892 + 16893 +#define A_WMI_STREAM_TX_INACTIVE(devt,trafficClass) \ 16894 + ar6000_indicate_tx_activity((devt),(trafficClass), FALSE) 16895 + 16896 +/****************************************************************************/ 16897 +/****************************************************************************/ 16898 +/** **/ 16899 +/** HTC related hooks **/ 16900 +/** **/ 16901 +/****************************************************************************/ 16902 +/****************************************************************************/ 16903 + 16904 +#ifdef __cplusplus 16905 +} 16906 +#endif 16907 + 16908 +#endif 16909 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_osapi.h 16910 =================================================================== 16911 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16912 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_osapi.h 2008-01-22 13:33:10.000000000 +0100 16913 @@ -0,0 +1,28 @@ 16914 +#ifndef _A_OSAPI_H_ 16915 +#define _A_OSAPI_H_ 16916 +/* 16917 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_osapi.h#1 $ 16918 + * 16919 + * This file contains the definitions of the basic atheros data types. 16920 + * It is used to map the data types in atheros files to a platform specific 16921 + * type. 16922 + * 16923 + * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved. 16924 + * 16925 + * 16926 + * This program is free software; you can redistribute it and/or modify 16927 + * it under the terms of the GNU General Public License version 2 as 16928 + * published by the Free Software Foundation; 16929 + * 16930 + * Software distributed under the License is distributed on an "AS 16931 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16932 + * implied. See the License for the specific language governing 16933 + * rights and limitations under the License. 16934 + * 16935 + * 16936 + * 16937 + */ 16938 + 16939 +#include "../ar6000/osapi_linux.h" 16940 + 16941 +#endif /* _OSAPI_H_ */ 16942 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_types.h 16943 =================================================================== 16944 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16945 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/a_types.h 2008-01-22 13:33:10.000000000 +0100 16946 @@ -0,0 +1,28 @@ 16947 +#ifndef _A_TYPES_H_ 16948 +#define _A_TYPES_H_ 16949 +/* 16950 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_types.h#1 $ 16951 + * 16952 + * This file contains the definitions of the basic atheros data types. 16953 + * It is used to map the data types in atheros files to a platform specific 16954 + * type. 16955 + * 16956 + * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved. 16957 + * 16958 + * 16959 + * This program is free software; you can redistribute it and/or modify 16960 + * it under the terms of the GNU General Public License version 2 as 16961 + * published by the Free Software Foundation; 16962 + * 16963 + * Software distributed under the License is distributed on an "AS 16964 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16965 + * implied. See the License for the specific language governing 16966 + * rights and limitations under the License. 16967 + * 16968 + * 16969 + * 16970 + */ 16971 + 16972 +#include "../ar6000/athtypes_linux.h" 16973 + 16974 +#endif /* _ATHTYPES_H_ */ 16975 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ar6000_api.h 16976 =================================================================== 16977 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16978 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ar6000_api.h 2008-01-22 13:33:10.000000000 +0100 16979 @@ -0,0 +1,29 @@ 16980 +#ifndef _AR6000_API_H_ 16981 +#define _AR6000_API_H_ 16982 +/* 16983 + * Copyright (c) 2004-2005 Atheros Communications Inc. 16984 + * All rights reserved. 16985 + * 16986 + * This file contains the API to access the OS dependent atheros host driver 16987 + * by the WMI or WLAN generic modules. 16988 + * 16989 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/ar6000_api.h#1 $ 16990 + * 16991 + * 16992 + * This program is free software; you can redistribute it and/or modify 16993 + * it under the terms of the GNU General Public License version 2 as 16994 + * published by the Free Software Foundation; 16995 + * 16996 + * Software distributed under the License is distributed on an "AS 16997 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16998 + * implied. See the License for the specific language governing 16999 + * rights and limitations under the License. 17000 + * 17001 + * 17002 + * 17003 + */ 17004 + 17005 +#include "../ar6000/ar6xapi_linux.h" 17006 + 17007 +#endif /* _AR6000_API_H */ 17008 + 17009 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ar6000_diag.h 17010 =================================================================== 17011 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17012 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ar6000_diag.h 2008-01-22 13:33:10.000000000 +0100 17013 @@ -0,0 +1,38 @@ 17014 +/* 17015 + * 16936 17016 + * Copyright (c) 2004-2007 Atheros Communications Inc. 16937 17017 + * All rights reserved. 16938 17018 + * 16939 + * $ATH_LICENSE_HOSTSDK0_C$ 16940 + * 16941 + * The makear6ksdk script (used for release builds) modifies the following line. 16942 + */ 16943 +#define __BUILD_NUMBER_ 18 16944 + 16945 + 16946 +/* Format of the version number. */ 16947 +#define VER_MAJOR_BIT_OFFSET 28 16948 +#define VER_MINOR_BIT_OFFSET 24 16949 +#define VER_PATCH_BIT_OFFSET 16 16950 +#define VER_BUILD_NUM_BIT_OFFSET 0 16951 + 16952 + 16953 +/* 16954 + * The version has the following format: 16955 + * Bits 28-31: Major version 16956 + * Bits 24-27: Minor version 16957 + * Bits 16-23: Patch version 16958 + * Bits 0-15: Build number (automatically generated during build process ) 16959 + * E.g. Build 1.1.3.7 would be represented as 0x11030007. 16960 + * 16961 + * DO NOT split the following macro into multiple lines as this may confuse the build scripts. 16962 + */ 16963 +#define AR6K_SW_VERSION ( ( __VER_MAJOR_ << VER_MAJOR_BIT_OFFSET ) + ( __VER_MINOR_ << VER_MINOR_BIT_OFFSET ) + ( __VER_PATCH_ << VER_PATCH_BIT_OFFSET ) + ( __BUILD_NUMBER_ << VER_BUILD_NUM_BIT_OFFSET ) ) 16964 + 16965 + 16966 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/athdefs.h 17019 + * 17020 + * This program is free software; you can redistribute it and/or modify 17021 + * it under the terms of the GNU General Public License version 2 as 17022 + * published by the Free Software Foundation; 17023 + * 17024 + * Software distributed under the License is distributed on an "AS 17025 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 17026 + * implied. See the License for the specific language governing 17027 + * rights and limitations under the License. 17028 + * 17029 + * 17030 + * 17031 + */ 17032 + 17033 +#ifndef AR6000_DIAG_H_ 17034 +#define AR6000_DIAG_H_ 17035 + 17036 + 17037 +A_STATUS 17038 +ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); 17039 + 17040 +A_STATUS 17041 +ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data); 17042 + 17043 +A_STATUS 17044 +ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, 17045 + A_UCHAR *data, A_UINT32 length); 17046 + 17047 +A_STATUS 17048 +ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, 17049 + A_UCHAR *data, A_UINT32 length); 17050 + 17051 +#endif /*AR6000_DIAG_H_*/ 17052 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athdefs.h 16967 17053 =================================================================== 16968 17054 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 16969 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/athdefs.h 2008-01-14 13:07:38.000000000 +010017055 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athdefs.h 2008-01-22 13:33:10.000000000 +0100 16970 17056 @@ -0,0 +1,85 @@ 16971 17057 +#ifndef __ATHDEFS_H__ … … 17054 17140 + 17055 17141 +#endif /* __ATHDEFS_H__ */ 17056 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/athdrv.h17142 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athdrv.h 17057 17143 =================================================================== 17058 17144 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17059 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/athdrv.h 2008-01-14 13:07:38.000000000 +010017145 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athdrv.h 2008-01-22 13:33:10.000000000 +0100 17060 17146 @@ -0,0 +1,32 @@ 17061 17147 +/* … … 17091 17177 + 17092 17178 +#endif /* _ATHDRV_H_ */ 17093 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/athendpack.h17179 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athendpack.h 17094 17180 =================================================================== 17095 17181 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17096 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/athendpack.h 2008-01-14 13:07:38.000000000 +010017182 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athendpack.h 2008-01-22 13:33:10.000000000 +0100 17097 17183 @@ -0,0 +1,41 @@ 17098 17184 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 17137 17223 +#endif /* WINCE */ 17138 17224 + 17139 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/athstartpack.h17225 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athstartpack.h 17140 17226 =================================================================== 17141 17227 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17142 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/athstartpack.h 2008-01-14 13:07:38.000000000 +010017228 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/athstartpack.h 2008-01-22 13:33:10.000000000 +0100 17143 17229 @@ -0,0 +1,42 @@ 17144 17230 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 17184 17270 +#endif /* WINCE */ 17185 17271 + 17186 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/a_types.h17272 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/bmi.h 17187 17273 =================================================================== 17188 17274 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17189 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/a_types.h 2008-01-14 13:07:38.000000000 +0100 17190 @@ -0,0 +1,28 @@ 17191 +#ifndef _A_TYPES_H_ 17192 +#define _A_TYPES_H_ 17193 +/* 17194 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_types.h#1 $ 17195 + * 17196 + * This file contains the definitions of the basic atheros data types. 17197 + * It is used to map the data types in atheros files to a platform specific 17198 + * type. 17199 + * 17200 + * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved. 17201 + * 17202 + * 17203 + * This program is free software; you can redistribute it and/or modify 17204 + * it under the terms of the GNU General Public License version 2 as 17205 + * published by the Free Software Foundation; 17206 + * 17207 + * Software distributed under the License is distributed on an "AS 17208 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 17209 + * implied. See the License for the specific language governing 17210 + * rights and limitations under the License. 17211 + * 17212 + * 17213 + * 17214 + */ 17215 + 17216 +#include "../ar6000/athtypes_linux.h" 17217 + 17218 +#endif /* _ATHTYPES_H_ */ 17219 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/bmi.h 17220 =================================================================== 17221 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17222 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/bmi.h 2008-01-14 13:07:38.000000000 +0100 17275 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/bmi.h 2008-01-22 13:33:10.000000000 +0100 17223 17276 @@ -0,0 +1,100 @@ 17224 17277 +#ifndef _BMI_H_ … … 17322 17375 + 17323 17376 +#endif /* _BMI_H_ */ 17324 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/bmi_msg.h17377 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/bmi_msg.h 17325 17378 =================================================================== 17326 17379 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17327 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/bmi_msg.h 2008-01-14 13:07:38.000000000 +010017380 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/bmi_msg.h 2008-01-22 13:33:10.000000000 +0100 17328 17381 @@ -0,0 +1,199 @@ 17329 17382 +#ifndef __BMI_MSG_H__ … … 17526 17579 + 17527 17580 +#endif /* __BMI_MSG_H__ */ 17528 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/common_drv.h17581 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/common_drv.h 17529 17582 =================================================================== 17530 17583 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17531 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/common_drv.h 2008-01-14 13:07:38.000000000 +010017584 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/common_drv.h 2008-01-22 13:33:10.000000000 +0100 17532 17585 @@ -0,0 +1,61 @@ 17533 17586 +/* … … 17592 17645 + 17593 17646 +#endif /*COMMON_DRV_H_*/ 17594 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/dbglog_api.h17647 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dbglog.h 17595 17648 =================================================================== 17596 17649 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17597 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/dbglog_api.h 2008-01-14 13:07:38.000000000 +0100 17598 @@ -0,0 +1,46 @@ 17599 +#ifndef _DBGLOG_API_H_ 17600 +#define _DBGLOG_API_H_ 17601 +/* 17602 + * Copyright (c) 2004-2006 Atheros Communications Inc. 17603 + * All rights reserved. 17604 + * 17605 + * 17606 + * This program is free software; you can redistribute it and/or modify 17607 + * it under the terms of the GNU General Public License version 2 as 17608 + * published by the Free Software Foundation; 17609 + * 17610 + * Software distributed under the License is distributed on an "AS 17611 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 17612 + * implied. See the License for the specific language governing 17613 + * rights and limitations under the License. 17614 + * 17615 + * 17616 + * 17617 + * This file contains host side debug primitives. 17618 + */ 17619 + 17620 +#ifdef __cplusplus 17621 +extern "C" { 17622 +#endif 17623 + 17624 +#include "dbglog.h" 17625 + 17626 +#define DBGLOG_HOST_LOG_BUFFER_SIZE DBGLOG_LOG_BUFFER_SIZE 17627 + 17628 +#define DBGLOG_GET_DBGID(arg) \ 17629 + ((arg & DBGLOG_DBGID_MASK) >> DBGLOG_DBGID_OFFSET) 17630 + 17631 +#define DBGLOG_GET_MODULEID(arg) \ 17632 + ((arg & DBGLOG_MODULEID_MASK) >> DBGLOG_MODULEID_OFFSET) 17633 + 17634 +#define DBGLOG_GET_NUMARGS(arg) \ 17635 + ((arg & DBGLOG_NUM_ARGS_MASK) >> DBGLOG_NUM_ARGS_OFFSET) 17636 + 17637 +#define DBGLOG_GET_TIMESTAMP(arg) \ 17638 + ((arg & DBGLOG_TIMESTAMP_MASK) >> DBGLOG_TIMESTAMP_OFFSET) 17639 + 17640 +#ifdef __cplusplus 17641 +} 17642 +#endif 17643 + 17644 +#endif /* _DBGLOG_API_H_ */ 17645 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/dbglog.h 17646 =================================================================== 17647 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17648 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/dbglog.h 2008-01-14 13:07:38.000000000 +0100 17650 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dbglog.h 2008-01-22 13:33:10.000000000 +0100 17649 17651 @@ -0,0 +1,107 @@ 17650 17652 +/* … … 17755 17757 + 17756 17758 +#endif /* _DBGLOG_H_ */ 17757 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/dbglog_id.h17759 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dbglog_api.h 17758 17760 =================================================================== 17759 17761 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17760 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/dbglog_id.h 2008-01-14 13:07:38.000000000 +0100 17762 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dbglog_api.h 2008-01-22 13:33:10.000000000 +0100 17763 @@ -0,0 +1,46 @@ 17764 +#ifndef _DBGLOG_API_H_ 17765 +#define _DBGLOG_API_H_ 17766 +/* 17767 + * Copyright (c) 2004-2006 Atheros Communications Inc. 17768 + * All rights reserved. 17769 + * 17770 + * 17771 + * This program is free software; you can redistribute it and/or modify 17772 + * it under the terms of the GNU General Public License version 2 as 17773 + * published by the Free Software Foundation; 17774 + * 17775 + * Software distributed under the License is distributed on an "AS 17776 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 17777 + * implied. See the License for the specific language governing 17778 + * rights and limitations under the License. 17779 + * 17780 + * 17781 + * 17782 + * This file contains host side debug primitives. 17783 + */ 17784 + 17785 +#ifdef __cplusplus 17786 +extern "C" { 17787 +#endif 17788 + 17789 +#include "dbglog.h" 17790 + 17791 +#define DBGLOG_HOST_LOG_BUFFER_SIZE DBGLOG_LOG_BUFFER_SIZE 17792 + 17793 +#define DBGLOG_GET_DBGID(arg) \ 17794 + ((arg & DBGLOG_DBGID_MASK) >> DBGLOG_DBGID_OFFSET) 17795 + 17796 +#define DBGLOG_GET_MODULEID(arg) \ 17797 + ((arg & DBGLOG_MODULEID_MASK) >> DBGLOG_MODULEID_OFFSET) 17798 + 17799 +#define DBGLOG_GET_NUMARGS(arg) \ 17800 + ((arg & DBGLOG_NUM_ARGS_MASK) >> DBGLOG_NUM_ARGS_OFFSET) 17801 + 17802 +#define DBGLOG_GET_TIMESTAMP(arg) \ 17803 + ((arg & DBGLOG_TIMESTAMP_MASK) >> DBGLOG_TIMESTAMP_OFFSET) 17804 + 17805 +#ifdef __cplusplus 17806 +} 17807 +#endif 17808 + 17809 +#endif /* _DBGLOG_API_H_ */ 17810 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dbglog_id.h 17811 =================================================================== 17812 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 17813 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dbglog_id.h 2008-01-22 13:33:10.000000000 +0100 17761 17814 @@ -0,0 +1,307 @@ 17762 17815 +/* … … 18067 18120 + 18068 18121 +#endif /* _DBGLOG_ID_H_ */ 18069 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/dl_list.h18122 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dl_list.h 18070 18123 =================================================================== 18071 18124 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18072 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/dl_list.h 2008-01-14 13:07:38.000000000 +010018125 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dl_list.h 2008-01-22 13:33:10.000000000 +0100 18073 18126 @@ -0,0 +1,114 @@ 18074 18127 +/* … … 18186 18239 + 18187 18240 +#endif /* __DL_LIST_H___ */ 18188 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/dset_api.h18241 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dset_api.h 18189 18242 =================================================================== 18190 18243 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18191 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/dset_api.h 2008-01-14 13:07:38.000000000 +010018244 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dset_api.h 2008-01-22 13:33:10.000000000 +0100 18192 18245 @@ -0,0 +1,63 @@ 18193 18246 +/* … … 18254 18307 + 18255 18308 +#endif /* _DSET_API_H_ */ 18256 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/dsetid.h18309 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dset_internal.h 18257 18310 =================================================================== 18258 18311 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18259 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/dsetid.h 2008-01-14 13:07:38.000000000 +0100 18260 @@ -0,0 +1,110 @@ 18261 +/* 18262 + * Copyright (c) 2004-2007 Atheros Communications Inc. 18263 + * All rights reserved. 18264 + * 18265 + * $ATH_LICENSE_HOSTSDK0_C$ 18266 + * 18267 + */ 18268 + 18269 +#ifndef __DSETID_H__ 18270 +#define __DSETID_H__ 18271 + 18272 +/* Well-known DataSet IDs */ 18273 +#define DSETID_UNUSED 0x00000000 18274 +#define DSETID_BOARD_DATA 0x00000001 /* Cal and board data */ 18275 +#define DSETID_REGDB 0x00000002 /* Regulatory Database */ 18276 +#define DSETID_POWER_CONTROL 0x00000003 /* TX Pwr Lim & Ant Gain */ 18277 +#define DSETID_USER_CONFIG 0x00000004 /* User Configuration */ 18278 + 18279 +#define DSETID_ANALOG_CONTROL_DATA_START 0x00000005 18280 +#define DSETID_ANALOG_CONTROL_DATA_END 0x00000025 18281 +/* 18282 + * Get DSETID for various reference clock speeds. 18283 + * For each speed there are three DataSets that correspond 18284 + * to the three columns of bank6 data (addr, 11a, 11b/g). 18285 + * This macro returns the dsetid of the first of those 18286 + * three DataSets. 18287 + */ 18288 +#define ANALOG_CONTROL_DATA_DSETID(refclk) \ 18289 + (DSETID_ANALOG_CONTROL_DATA_START + 3*refclk) 18290 + 18291 +/* 18292 + * There are TWO STARTUP_PATCH DataSets. 18293 + * DSETID_STARTUP_PATCH is historical, and was applied before BMI on 18294 + * earlier systems. On AR6002, it is applied after BMI, just like 18295 + * DSETID_STARTUP_PATCH2. 18296 + */ 18297 +#define DSETID_STARTUP_PATCH 0x00000026 18298 +#define DSETID_GPIO_CONFIG_PATCH 0x00000027 18299 +#define DSETID_WLANREGS 0x00000028 /* override wlan regs */ 18300 +#define DSETID_STARTUP_PATCH2 0x00000029 18301 + 18302 +#define DSETID_WOW_CONFIG 0x00000090 /* WoW Configuration */ 18303 + 18304 +/* Add WHAL_INI_DATA_ID to DSETID_INI_DATA for a specific WHAL INI table. */ 18305 +#define DSETID_INI_DATA 0x00000100 18306 +/* Reserved for WHAL INI Tables: 0x100..0x11f */ 18307 +#define DSETID_INI_DATA_END 0x0000011f 18308 + 18309 +#define DSETID_VENDOR_START 0x00010000 /* Vendor-defined DataSets */ 18310 + 18311 +#define DSETID_INDEX_END 0xfffffffe /* Reserved to indicate the 18312 + end of a memory-based 18313 + DataSet Index */ 18314 +#define DSETID_INDEX_FREE 0xffffffff /* An unused index entry */ 18315 + 18316 +/* 18317 + * PATCH DataSet format: 18318 + * A list of patches, terminated by a patch with 18319 + * address=PATCH_END. 18320 + * 18321 + * This allows for patches to be stored in flash. 18322 + */ 18323 +struct patch_s { 18324 + A_UINT32 *address; 18325 + A_UINT32 data; 18326 +}; 18327 + 18328 +/* 18329 + * Skip some patches. Can be used to erase a single patch in a 18330 + * patch DataSet without having to re-write the DataSet. May 18331 + * also be used to embed information for use by subsequent 18332 + * patch code. The "data" in a PATCH_SKIP tells how many 18333 + * bytes of length "patch_s" to skip. 18334 + */ 18335 +#define PATCH_SKIP ((A_UINT32 *)0x00000000) 18336 + 18337 +/* 18338 + * Execute code at the address specified by "data". 18339 + * The address of the patch structure is passed as 18340 + * the one parameter. 18341 + */ 18342 +#define PATCH_CODE_ABS ((A_UINT32 *)0x00000001) 18343 + 18344 +/* 18345 + * Same as PATCH_CODE_ABS, but treat "data" as an 18346 + * offset from the start of the patch word. 18347 + */ 18348 +#define PATCH_CODE_REL ((A_UINT32 *)0x00000002) 18349 + 18350 +/* Mark the end of this patch DataSet. */ 18351 +#define PATCH_END ((A_UINT32 *)0xffffffff) 18352 + 18353 +/* 18354 + * A DataSet which contains a Binary Patch to some other DataSet 18355 + * uses the original dsetid with the DSETID_BPATCH_FLAG bit set. 18356 + * Such a BPatch DataSet consists of BPatch metadata followed by 18357 + * the bdiff bytes. BPatch metadata consists of a single 32-bit 18358 + * word that contains the size of the BPatched final image. 18359 + * 18360 + * To create a suitable bdiff DataSet, use bdiff in host/tools/bdiff 18361 + * to create "diffs": 18362 + * bdiff -q -O -nooldmd5 -nonewmd5 -d ORIGfile NEWfile diffs 18363 + * Then add BPatch metadata to the start of "diffs". 18364 + * 18365 + * NB: There are some implementation-induced restrictions 18366 + * on which DataSets can be BPatched. 18367 + */ 18368 +#define DSETID_BPATCH_FLAG 0x80000000 18369 + 18370 +#endif /* __DSETID_H__ */ 18371 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/dset_internal.h 18372 =================================================================== 18373 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18374 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/dset_internal.h 2008-01-14 13:07:38.000000000 +0100 18312 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dset_internal.h 2008-01-22 13:33:10.000000000 +0100 18375 18313 @@ -0,0 +1,39 @@ 18376 18314 +/* … … 18413 18351 + 18414 18352 +#endif /* __DSET_INTERNAL_H__ */ 18415 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/gpio_api.h18353 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dsetid.h 18416 18354 =================================================================== 18417 18355 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18418 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/gpio_api.h 2008-01-14 13:07:38.000000000 +0100 18419 @@ -0,0 +1,57 @@ 18420 +#ifndef _GPIO_API_H_ 18421 +#define _GPIO_API_H_ 18422 +/* 18423 + * Copyright 2005 Atheros Communications, Inc., All Rights Reserved. 18424 + * 18425 + * 18426 + * This program is free software; you can redistribute it and/or modify 18427 + * it under the terms of the GNU General Public License version 2 as 18428 + * published by the Free Software Foundation; 18429 + * 18430 + * Software distributed under the License is distributed on an "AS 18431 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18432 + * implied. See the License for the specific language governing 18433 + * rights and limitations under the License. 18434 + * 18435 + * 18436 + * 18437 + */ 18438 + 18439 +/* 18440 + * Host-side General Purpose I/O API. 18441 + * 18442 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/gpio_api.h#1 $ 18443 + */ 18444 + 18445 +/* 18446 + * Send a command to the Target in order to change output on GPIO pins. 18447 + */ 18448 +A_STATUS wmi_gpio_output_set(struct wmi_t *wmip, 18449 + A_UINT32 set_mask, 18450 + A_UINT32 clear_mask, 18451 + A_UINT32 enable_mask, 18452 + A_UINT32 disable_mask); 18453 + 18454 +/* 18455 + * Send a command to the Target requesting input state of GPIO pins. 18456 + */ 18457 +A_STATUS wmi_gpio_input_get(struct wmi_t *wmip); 18458 + 18459 +/* 18460 + * Send a command to the Target to change the value of a GPIO register. 18461 + */ 18462 +A_STATUS wmi_gpio_register_set(struct wmi_t *wmip, 18463 + A_UINT32 gpioreg_id, 18464 + A_UINT32 value); 18465 + 18466 +/* 18467 + * Send a command to the Target to fetch the value of a GPIO register. 18468 + */ 18469 +A_STATUS wmi_gpio_register_get(struct wmi_t *wmip, A_UINT32 gpioreg_id); 18470 + 18471 +/* 18472 + * Send a command to the Target, acknowledging some GPIO interrupts. 18473 + */ 18474 +A_STATUS wmi_gpio_intr_ack(struct wmi_t *wmip, A_UINT32 ack_mask); 18475 + 18476 +#endif /* _GPIO_API_H_ */ 18477 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/gpio.h 18356 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/dsetid.h 2008-01-22 13:33:10.000000000 +0100 18357 @@ -0,0 +1,110 @@ 18358 +/* 18359 + * Copyright (c) 2004-2007 Atheros Communications Inc. 18360 + * All rights reserved. 18361 + * 18362 + * $ATH_LICENSE_HOSTSDK0_C$ 18363 + * 18364 + */ 18365 + 18366 +#ifndef __DSETID_H__ 18367 +#define __DSETID_H__ 18368 + 18369 +/* Well-known DataSet IDs */ 18370 +#define DSETID_UNUSED 0x00000000 18371 +#define DSETID_BOARD_DATA 0x00000001 /* Cal and board data */ 18372 +#define DSETID_REGDB 0x00000002 /* Regulatory Database */ 18373 +#define DSETID_POWER_CONTROL 0x00000003 /* TX Pwr Lim & Ant Gain */ 18374 +#define DSETID_USER_CONFIG 0x00000004 /* User Configuration */ 18375 + 18376 +#define DSETID_ANALOG_CONTROL_DATA_START 0x00000005 18377 +#define DSETID_ANALOG_CONTROL_DATA_END 0x00000025 18378 +/* 18379 + * Get DSETID for various reference clock speeds. 18380 + * For each speed there are three DataSets that correspond 18381 + * to the three columns of bank6 data (addr, 11a, 11b/g). 18382 + * This macro returns the dsetid of the first of those 18383 + * three DataSets. 18384 + */ 18385 +#define ANALOG_CONTROL_DATA_DSETID(refclk) \ 18386 + (DSETID_ANALOG_CONTROL_DATA_START + 3*refclk) 18387 + 18388 +/* 18389 + * There are TWO STARTUP_PATCH DataSets. 18390 + * DSETID_STARTUP_PATCH is historical, and was applied before BMI on 18391 + * earlier systems. On AR6002, it is applied after BMI, just like 18392 + * DSETID_STARTUP_PATCH2. 18393 + */ 18394 +#define DSETID_STARTUP_PATCH 0x00000026 18395 +#define DSETID_GPIO_CONFIG_PATCH 0x00000027 18396 +#define DSETID_WLANREGS 0x00000028 /* override wlan regs */ 18397 +#define DSETID_STARTUP_PATCH2 0x00000029 18398 + 18399 +#define DSETID_WOW_CONFIG 0x00000090 /* WoW Configuration */ 18400 + 18401 +/* Add WHAL_INI_DATA_ID to DSETID_INI_DATA for a specific WHAL INI table. */ 18402 +#define DSETID_INI_DATA 0x00000100 18403 +/* Reserved for WHAL INI Tables: 0x100..0x11f */ 18404 +#define DSETID_INI_DATA_END 0x0000011f 18405 + 18406 +#define DSETID_VENDOR_START 0x00010000 /* Vendor-defined DataSets */ 18407 + 18408 +#define DSETID_INDEX_END 0xfffffffe /* Reserved to indicate the 18409 + end of a memory-based 18410 + DataSet Index */ 18411 +#define DSETID_INDEX_FREE 0xffffffff /* An unused index entry */ 18412 + 18413 +/* 18414 + * PATCH DataSet format: 18415 + * A list of patches, terminated by a patch with 18416 + * address=PATCH_END. 18417 + * 18418 + * This allows for patches to be stored in flash. 18419 + */ 18420 +struct patch_s { 18421 + A_UINT32 *address; 18422 + A_UINT32 data; 18423 +}; 18424 + 18425 +/* 18426 + * Skip some patches. Can be used to erase a single patch in a 18427 + * patch DataSet without having to re-write the DataSet. May 18428 + * also be used to embed information for use by subsequent 18429 + * patch code. The "data" in a PATCH_SKIP tells how many 18430 + * bytes of length "patch_s" to skip. 18431 + */ 18432 +#define PATCH_SKIP ((A_UINT32 *)0x00000000) 18433 + 18434 +/* 18435 + * Execute code at the address specified by "data". 18436 + * The address of the patch structure is passed as 18437 + * the one parameter. 18438 + */ 18439 +#define PATCH_CODE_ABS ((A_UINT32 *)0x00000001) 18440 + 18441 +/* 18442 + * Same as PATCH_CODE_ABS, but treat "data" as an 18443 + * offset from the start of the patch word. 18444 + */ 18445 +#define PATCH_CODE_REL ((A_UINT32 *)0x00000002) 18446 + 18447 +/* Mark the end of this patch DataSet. */ 18448 +#define PATCH_END ((A_UINT32 *)0xffffffff) 18449 + 18450 +/* 18451 + * A DataSet which contains a Binary Patch to some other DataSet 18452 + * uses the original dsetid with the DSETID_BPATCH_FLAG bit set. 18453 + * Such a BPatch DataSet consists of BPatch metadata followed by 18454 + * the bdiff bytes. BPatch metadata consists of a single 32-bit 18455 + * word that contains the size of the BPatched final image. 18456 + * 18457 + * To create a suitable bdiff DataSet, use bdiff in host/tools/bdiff 18458 + * to create "diffs": 18459 + * bdiff -q -O -nooldmd5 -nonewmd5 -d ORIGfile NEWfile diffs 18460 + * Then add BPatch metadata to the start of "diffs". 18461 + * 18462 + * NB: There are some implementation-induced restrictions 18463 + * on which DataSets can be BPatched. 18464 + */ 18465 +#define DSETID_BPATCH_FLAG 0x80000000 18466 + 18467 +#endif /* __DSETID_H__ */ 18468 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/gpio.h 18478 18469 =================================================================== 18479 18470 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18480 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/gpio.h 2008-01-14 13:07:38.000000000 +010018471 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/gpio.h 2008-01-22 13:33:10.000000000 +0100 18481 18472 @@ -0,0 +1,34 @@ 18482 18473 +/* … … 18514 18505 +#define GPIO_LAST_REGISTER_ID GPIO_ID_PIN(17) 18515 18506 +#define GPIO_ID_NONE 0xffffffff 18516 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/hif.h18507 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/gpio_api.h 18517 18508 =================================================================== 18518 18509 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18519 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/hif.h 2008-01-14 13:07:38.000000000 +0100 18510 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/gpio_api.h 2008-01-22 13:33:10.000000000 +0100 18511 @@ -0,0 +1,57 @@ 18512 +#ifndef _GPIO_API_H_ 18513 +#define _GPIO_API_H_ 18514 +/* 18515 + * Copyright 2005 Atheros Communications, Inc., All Rights Reserved. 18516 + * 18517 + * 18518 + * This program is free software; you can redistribute it and/or modify 18519 + * it under the terms of the GNU General Public License version 2 as 18520 + * published by the Free Software Foundation; 18521 + * 18522 + * Software distributed under the License is distributed on an "AS 18523 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18524 + * implied. See the License for the specific language governing 18525 + * rights and limitations under the License. 18526 + * 18527 + * 18528 + * 18529 + */ 18530 + 18531 +/* 18532 + * Host-side General Purpose I/O API. 18533 + * 18534 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/gpio_api.h#1 $ 18535 + */ 18536 + 18537 +/* 18538 + * Send a command to the Target in order to change output on GPIO pins. 18539 + */ 18540 +A_STATUS wmi_gpio_output_set(struct wmi_t *wmip, 18541 + A_UINT32 set_mask, 18542 + A_UINT32 clear_mask, 18543 + A_UINT32 enable_mask, 18544 + A_UINT32 disable_mask); 18545 + 18546 +/* 18547 + * Send a command to the Target requesting input state of GPIO pins. 18548 + */ 18549 +A_STATUS wmi_gpio_input_get(struct wmi_t *wmip); 18550 + 18551 +/* 18552 + * Send a command to the Target to change the value of a GPIO register. 18553 + */ 18554 +A_STATUS wmi_gpio_register_set(struct wmi_t *wmip, 18555 + A_UINT32 gpioreg_id, 18556 + A_UINT32 value); 18557 + 18558 +/* 18559 + * Send a command to the Target to fetch the value of a GPIO register. 18560 + */ 18561 +A_STATUS wmi_gpio_register_get(struct wmi_t *wmip, A_UINT32 gpioreg_id); 18562 + 18563 +/* 18564 + * Send a command to the Target, acknowledging some GPIO interrupts. 18565 + */ 18566 +A_STATUS wmi_gpio_intr_ack(struct wmi_t *wmip, A_UINT32 ack_mask); 18567 + 18568 +#endif /* _GPIO_API_H_ */ 18569 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/hif.h 18570 =================================================================== 18571 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18572 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/hif.h 2008-01-22 13:33:10.000000000 +0100 18520 18573 @@ -0,0 +1,291 @@ 18521 18574 +/* … … 18810 18863 + 18811 18864 +#endif /* _HIF_H_ */ 18812 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/host_version.h18865 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/host_version.h 18813 18866 =================================================================== 18814 18867 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18815 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/host_version.h 2008-01-14 13:07:38.000000000 +010018868 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/host_version.h 2008-01-22 13:33:10.000000000 +0100 18816 18869 @@ -0,0 +1,49 @@ 18817 18870 +#ifndef _HOST_VERSION_H_ … … 18864 18917 + 18865 18918 +#endif /* _HOST_VERSION_H_ */ 18866 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/htc_api.h18919 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc.h 18867 18920 =================================================================== 18868 18921 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 18869 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/htc_api.h 2008-01-14 13:07:38.000000000 +0100 18922 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc.h 2008-01-22 13:33:10.000000000 +0100 18923 @@ -0,0 +1,190 @@ 18924 +/* 18925 + * Copyright (c) 2007 Atheros Communications Inc. 18926 + * All rights reserved. 18927 + * 18928 + * $ATH_LICENSE_HOSTSDK0_C$ 18929 + * 18930 + */ 18931 + 18932 + 18933 +#ifndef __HTC_H__ 18934 +#define __HTC_H__ 18935 + 18936 +#ifndef ATH_TARGET 18937 +#include "athstartpack.h" 18938 +#endif 18939 + 18940 +#define A_OFFSETOF(type,field) (int)(&(((type *)NULL)->field)) 18941 + 18942 +#define ASSEMBLE_UNALIGNED_UINT16(p,highbyte,lowbyte) \ 18943 + (((A_UINT16)(((A_UINT8 *)(p))[(highbyte)])) << 8 | (A_UINT16)(((A_UINT8 *)(p))[(lowbyte)])) 18944 + 18945 +/* alignment independent macros (little-endian) to fetch UINT16s or UINT8s from a 18946 + * structure using only the type and field name. 18947 + * Use these macros if there is the potential for unaligned buffer accesses. */ 18948 +#define A_GET_UINT16_FIELD(p,type,field) \ 18949 + ASSEMBLE_UNALIGNED_UINT16(p,\ 18950 + A_OFFSETOF(type,field) + 1, \ 18951 + A_OFFSETOF(type,field)) 18952 + 18953 +#define A_SET_UINT16_FIELD(p,type,field,value) \ 18954 +{ \ 18955 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (A_UINT8)(value); \ 18956 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field) + 1] = (A_UINT8)((value) >> 8); \ 18957 +} 18958 + 18959 +#define A_GET_UINT8_FIELD(p,type,field) \ 18960 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] 18961 + 18962 +#define A_SET_UINT8_FIELD(p,type,field,value) \ 18963 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (value) 18964 + 18965 +/****** DANGER DANGER *************** 18966 + * 18967 + * The frame header length and message formats defined herein were 18968 + * selected to accommodate optimal alignment for target processing. This reduces code 18969 + * size and improves performance. 18970 + * 18971 + * Any changes to the header length may alter the alignment and cause exceptions 18972 + * on the target. When adding to the message structures insure that fields are 18973 + * properly aligned. 18974 + * 18975 + */ 18976 + 18977 +/* HTC frame header */ 18978 +typedef PREPACK struct _HTC_FRAME_HDR{ 18979 + /* do not remove or re-arrange these fields, these are minimally required 18980 + * to take advantage of 4-byte lookaheads in some hardware implementations */ 18981 + A_UINT8 EndpointID; 18982 + A_UINT8 Flags; 18983 + A_UINT16 PayloadLen; /* length of data (including trailer) that follows the header */ 18984 + 18985 + /***** end of 4-byte lookahead ****/ 18986 + 18987 + A_UINT8 ControlBytes[2]; 18988 + 18989 + /* message payload starts after the header */ 18990 + 18991 +} POSTPACK HTC_FRAME_HDR; 18992 + 18993 +/* frame header flags */ 18994 +#define HTC_FLAGS_NEED_CREDIT_UPDATE (1 << 0) 18995 +#define HTC_FLAGS_RECV_TRAILER (1 << 1) 18996 + 18997 + 18998 +#define HTC_HDR_LENGTH (sizeof(HTC_FRAME_HDR)) 18999 +#define HTC_MAX_TRAILER_LENGTH 255 19000 +#define HTC_MAX_PAYLOAD_LENGTH (2048 - sizeof(HTC_FRAME_HDR)) 19001 + 19002 +/* HTC control message IDs */ 19003 +typedef enum { 19004 + HTC_MSG_READY_ID = 1, 19005 + HTC_MSG_CONNECT_SERVICE_ID = 2, 19006 + HTC_MSG_CONNECT_SERVICE_RESPONSE_ID = 3, 19007 + HTC_MSG_SETUP_COMPLETE_ID = 4, 19008 +} HTC_MSG_IDS; 19009 + 19010 +#define HTC_MAX_CONTROL_MESSAGE_LENGTH 256 19011 + 19012 +/* base message ID header */ 19013 +typedef PREPACK struct { 19014 + A_UINT16 MessageID; 19015 +} POSTPACK HTC_UNKNOWN_MSG; 19016 + 19017 +/* HTC ready message 19018 + * direction : target-to-host */ 19019 +typedef PREPACK struct { 19020 + A_UINT16 MessageID; /* ID */ 19021 + A_UINT16 CreditCount; /* number of credits the target can offer */ 19022 + A_UINT16 CreditSize; /* size of each credit */ 19023 + A_UINT8 MaxEndpoints; /* maximum number of endpoints the target has resources for */ 19024 + A_UINT8 _Pad1; 19025 +} POSTPACK HTC_READY_MSG; 19026 + 19027 +#define HTC_SERVICE_META_DATA_MAX_LENGTH 128 19028 + 19029 +/* connect service 19030 + * direction : host-to-target */ 19031 +typedef PREPACK struct { 19032 + A_UINT16 MessageID; 19033 + A_UINT16 ServiceID; /* service ID of the service to connect to */ 19034 + A_UINT16 ConnectionFlags; /* connection flags */ 19035 + 19036 +#define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2) /* reduce credit dribbling when 19037 + the host needs credits */ 19038 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK (0x3) 19039 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH 0x0 19040 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF 0x1 19041 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS 0x2 19042 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_UNITY 0x3 19043 + 19044 + A_UINT8 ServiceMetaLength; /* length of meta data that follows */ 19045 + A_UINT8 _Pad1; 19046 + 19047 + /* service-specific meta data starts after the header */ 19048 + 19049 +} POSTPACK HTC_CONNECT_SERVICE_MSG; 19050 + 19051 +/* connect response 19052 + * direction : target-to-host */ 19053 +typedef PREPACK struct { 19054 + A_UINT16 MessageID; 19055 + A_UINT16 ServiceID; /* service ID that the connection request was made */ 19056 + A_UINT8 Status; /* service connection status */ 19057 + A_UINT8 EndpointID; /* assigned endpoint ID */ 19058 + A_UINT16 MaxMsgSize; /* maximum expected message size on this endpoint */ 19059 + A_UINT8 ServiceMetaLength; /* length of meta data that follows */ 19060 + A_UINT8 _Pad1; 19061 + 19062 + /* service-specific meta data starts after the header */ 19063 + 19064 +} POSTPACK HTC_CONNECT_SERVICE_RESPONSE_MSG; 19065 + 19066 +typedef PREPACK struct { 19067 + A_UINT16 MessageID; 19068 + /* currently, no other fields */ 19069 +} POSTPACK HTC_SETUP_COMPLETE_MSG; 19070 + 19071 + 19072 +/* connect response status codes */ 19073 +#define HTC_SERVICE_SUCCESS 0 /* success */ 19074 +#define HTC_SERVICE_NOT_FOUND 1 /* service could not be found */ 19075 +#define HTC_SERVICE_FAILED 2 /* specific service failed the connect */ 19076 +#define HTC_SERVICE_NO_RESOURCES 3 /* no resources (i.e. no more endpoints) */ 19077 +#define HTC_SERVICE_NO_MORE_EP 4 /* specific service is not allowing any more 19078 + endpoints */ 19079 + 19080 +/* report record IDs */ 19081 +typedef enum { 19082 + HTC_RECORD_NULL = 0, 19083 + HTC_RECORD_CREDITS = 1, 19084 + HTC_RECORD_LOOKAHEAD = 2, 19085 +} HTC_RPT_IDS; 19086 + 19087 +typedef PREPACK struct { 19088 + A_UINT8 RecordID; /* Record ID */ 19089 + A_UINT8 Length; /* Length of record */ 19090 +} POSTPACK HTC_RECORD_HDR; 19091 + 19092 +typedef PREPACK struct { 19093 + A_UINT8 EndpointID; /* Endpoint that owns these credits */ 19094 + A_UINT8 Credits; /* credits to report since last report */ 19095 +} POSTPACK HTC_CREDIT_REPORT; 19096 + 19097 +typedef PREPACK struct { 19098 + A_UINT8 PreValid; /* pre valid guard */ 19099 + A_UINT8 LookAhead[4]; /* 4 byte lookahead */ 19100 + A_UINT8 PostValid; /* post valid guard */ 19101 + 19102 + /* NOTE: the LookAhead array is guarded by a PreValid and Post Valid guard bytes. 19103 + * The PreValid bytes must equal the inverse of the PostValid byte */ 19104 + 19105 +} POSTPACK HTC_LOOKAHEAD_REPORT; 19106 + 19107 +#ifndef ATH_TARGET 19108 +#include "athendpack.h" 19109 +#endif 19110 + 19111 + 19112 +#endif /* __HTC_H__ */ 19113 + 19114 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc_api.h 19115 =================================================================== 19116 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 19117 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc_api.h 2008-01-22 13:33:10.000000000 +0100 18870 19118 @@ -0,0 +1,436 @@ 18871 19119 +/* … … 19305 19553 + 19306 19554 +#endif /* _HTC_API_H_ */ 19307 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/htc.h19555 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc_packet.h 19308 19556 =================================================================== 19309 19557 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 19310 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/htc.h 2008-01-14 13:07:38.000000000 +0100 19311 @@ -0,0 +1,190 @@ 19312 +/* 19313 + * Copyright (c) 2007 Atheros Communications Inc. 19314 + * All rights reserved. 19315 + * 19316 + * $ATH_LICENSE_HOSTSDK0_C$ 19317 + * 19318 + */ 19319 + 19320 + 19321 +#ifndef __HTC_H__ 19322 +#define __HTC_H__ 19323 + 19324 +#ifndef ATH_TARGET 19325 +#include "athstartpack.h" 19326 +#endif 19327 + 19328 +#define A_OFFSETOF(type,field) (int)(&(((type *)NULL)->field)) 19329 + 19330 +#define ASSEMBLE_UNALIGNED_UINT16(p,highbyte,lowbyte) \ 19331 + (((A_UINT16)(((A_UINT8 *)(p))[(highbyte)])) << 8 | (A_UINT16)(((A_UINT8 *)(p))[(lowbyte)])) 19332 + 19333 +/* alignment independent macros (little-endian) to fetch UINT16s or UINT8s from a 19334 + * structure using only the type and field name. 19335 + * Use these macros if there is the potential for unaligned buffer accesses. */ 19336 +#define A_GET_UINT16_FIELD(p,type,field) \ 19337 + ASSEMBLE_UNALIGNED_UINT16(p,\ 19338 + A_OFFSETOF(type,field) + 1, \ 19339 + A_OFFSETOF(type,field)) 19340 + 19341 +#define A_SET_UINT16_FIELD(p,type,field,value) \ 19342 +{ \ 19343 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (A_UINT8)(value); \ 19344 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field) + 1] = (A_UINT8)((value) >> 8); \ 19345 +} 19346 + 19347 +#define A_GET_UINT8_FIELD(p,type,field) \ 19348 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] 19349 + 19350 +#define A_SET_UINT8_FIELD(p,type,field,value) \ 19351 + ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (value) 19352 + 19353 +/****** DANGER DANGER *************** 19354 + * 19355 + * The frame header length and message formats defined herein were 19356 + * selected to accommodate optimal alignment for target processing. This reduces code 19357 + * size and improves performance. 19358 + * 19359 + * Any changes to the header length may alter the alignment and cause exceptions 19360 + * on the target. When adding to the message structures insure that fields are 19361 + * properly aligned. 19362 + * 19363 + */ 19364 + 19365 +/* HTC frame header */ 19366 +typedef PREPACK struct _HTC_FRAME_HDR{ 19367 + /* do not remove or re-arrange these fields, these are minimally required 19368 + * to take advantage of 4-byte lookaheads in some hardware implementations */ 19369 + A_UINT8 EndpointID; 19370 + A_UINT8 Flags; 19371 + A_UINT16 PayloadLen; /* length of data (including trailer) that follows the header */ 19372 + 19373 + /***** end of 4-byte lookahead ****/ 19374 + 19375 + A_UINT8 ControlBytes[2]; 19376 + 19377 + /* message payload starts after the header */ 19378 + 19379 +} POSTPACK HTC_FRAME_HDR; 19380 + 19381 +/* frame header flags */ 19382 +#define HTC_FLAGS_NEED_CREDIT_UPDATE (1 << 0) 19383 +#define HTC_FLAGS_RECV_TRAILER (1 << 1) 19384 + 19385 + 19386 +#define HTC_HDR_LENGTH (sizeof(HTC_FRAME_HDR)) 19387 +#define HTC_MAX_TRAILER_LENGTH 255 19388 +#define HTC_MAX_PAYLOAD_LENGTH (2048 - sizeof(HTC_FRAME_HDR)) 19389 + 19390 +/* HTC control message IDs */ 19391 +typedef enum { 19392 + HTC_MSG_READY_ID = 1, 19393 + HTC_MSG_CONNECT_SERVICE_ID = 2, 19394 + HTC_MSG_CONNECT_SERVICE_RESPONSE_ID = 3, 19395 + HTC_MSG_SETUP_COMPLETE_ID = 4, 19396 +} HTC_MSG_IDS; 19397 + 19398 +#define HTC_MAX_CONTROL_MESSAGE_LENGTH 256 19399 + 19400 +/* base message ID header */ 19401 +typedef PREPACK struct { 19402 + A_UINT16 MessageID; 19403 +} POSTPACK HTC_UNKNOWN_MSG; 19404 + 19405 +/* HTC ready message 19406 + * direction : target-to-host */ 19407 +typedef PREPACK struct { 19408 + A_UINT16 MessageID; /* ID */ 19409 + A_UINT16 CreditCount; /* number of credits the target can offer */ 19410 + A_UINT16 CreditSize; /* size of each credit */ 19411 + A_UINT8 MaxEndpoints; /* maximum number of endpoints the target has resources for */ 19412 + A_UINT8 _Pad1; 19413 +} POSTPACK HTC_READY_MSG; 19414 + 19415 +#define HTC_SERVICE_META_DATA_MAX_LENGTH 128 19416 + 19417 +/* connect service 19418 + * direction : host-to-target */ 19419 +typedef PREPACK struct { 19420 + A_UINT16 MessageID; 19421 + A_UINT16 ServiceID; /* service ID of the service to connect to */ 19422 + A_UINT16 ConnectionFlags; /* connection flags */ 19423 + 19424 +#define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2) /* reduce credit dribbling when 19425 + the host needs credits */ 19426 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK (0x3) 19427 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH 0x0 19428 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF 0x1 19429 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS 0x2 19430 +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_UNITY 0x3 19431 + 19432 + A_UINT8 ServiceMetaLength; /* length of meta data that follows */ 19433 + A_UINT8 _Pad1; 19434 + 19435 + /* service-specific meta data starts after the header */ 19436 + 19437 +} POSTPACK HTC_CONNECT_SERVICE_MSG; 19438 + 19439 +/* connect response 19440 + * direction : target-to-host */ 19441 +typedef PREPACK struct { 19442 + A_UINT16 MessageID; 19443 + A_UINT16 ServiceID; /* service ID that the connection request was made */ 19444 + A_UINT8 Status; /* service connection status */ 19445 + A_UINT8 EndpointID; /* assigned endpoint ID */ 19446 + A_UINT16 MaxMsgSize; /* maximum expected message size on this endpoint */ 19447 + A_UINT8 ServiceMetaLength; /* length of meta data that follows */ 19448 + A_UINT8 _Pad1; 19449 + 19450 + /* service-specific meta data starts after the header */ 19451 + 19452 +} POSTPACK HTC_CONNECT_SERVICE_RESPONSE_MSG; 19453 + 19454 +typedef PREPACK struct { 19455 + A_UINT16 MessageID; 19456 + /* currently, no other fields */ 19457 +} POSTPACK HTC_SETUP_COMPLETE_MSG; 19458 + 19459 + 19460 +/* connect response status codes */ 19461 +#define HTC_SERVICE_SUCCESS 0 /* success */ 19462 +#define HTC_SERVICE_NOT_FOUND 1 /* service could not be found */ 19463 +#define HTC_SERVICE_FAILED 2 /* specific service failed the connect */ 19464 +#define HTC_SERVICE_NO_RESOURCES 3 /* no resources (i.e. no more endpoints) */ 19465 +#define HTC_SERVICE_NO_MORE_EP 4 /* specific service is not allowing any more 19466 + endpoints */ 19467 + 19468 +/* report record IDs */ 19469 +typedef enum { 19470 + HTC_RECORD_NULL = 0, 19471 + HTC_RECORD_CREDITS = 1, 19472 + HTC_RECORD_LOOKAHEAD = 2, 19473 +} HTC_RPT_IDS; 19474 + 19475 +typedef PREPACK struct { 19476 + A_UINT8 RecordID; /* Record ID */ 19477 + A_UINT8 Length; /* Length of record */ 19478 +} POSTPACK HTC_RECORD_HDR; 19479 + 19480 +typedef PREPACK struct { 19481 + A_UINT8 EndpointID; /* Endpoint that owns these credits */ 19482 + A_UINT8 Credits; /* credits to report since last report */ 19483 +} POSTPACK HTC_CREDIT_REPORT; 19484 + 19485 +typedef PREPACK struct { 19486 + A_UINT8 PreValid; /* pre valid guard */ 19487 + A_UINT8 LookAhead[4]; /* 4 byte lookahead */ 19488 + A_UINT8 PostValid; /* post valid guard */ 19489 + 19490 + /* NOTE: the LookAhead array is guarded by a PreValid and Post Valid guard bytes. 19491 + * The PreValid bytes must equal the inverse of the PostValid byte */ 19492 + 19493 +} POSTPACK HTC_LOOKAHEAD_REPORT; 19494 + 19495 +#ifndef ATH_TARGET 19496 +#include "athendpack.h" 19497 +#endif 19498 + 19499 + 19500 +#endif /* __HTC_H__ */ 19501 + 19502 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/htc_packet.h 19503 =================================================================== 19504 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 19505 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/htc_packet.h 2008-01-14 13:07:38.000000000 +0100 19558 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc_packet.h 2008-01-22 13:33:10.000000000 +0100 19506 19559 @@ -0,0 +1,138 @@ 19507 19560 +/* … … 19643 19696 + 19644 19697 +#endif /*HTC_PACKET_H_*/ 19645 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/htc_services.h19698 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc_services.h 19646 19699 =================================================================== 19647 19700 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 19648 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/htc_services.h 2008-01-14 13:07:38.000000000 +010019701 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/htc_services.h 2008-01-22 13:33:10.000000000 +0100 19649 19702 @@ -0,0 +1,37 @@ 19650 19703 +/* … … 19685 19738 + 19686 19739 +#endif /*HTC_SERVICES_H_*/ 19687 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ieee80211.h19740 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ieee80211.h 19688 19741 =================================================================== 19689 19742 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 19690 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ieee80211.h 2008-01-14 13:07:38.000000000 +010019743 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ieee80211.h 2008-01-22 13:33:10.000000000 +0100 19691 19744 @@ -0,0 +1,342 @@ 19692 19745 +/*- … … 20032 20085 + 20033 20086 +#endif /* _NET80211_IEEE80211_H_ */ 20034 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h20087 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h 20035 20088 =================================================================== 20036 20089 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20037 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h 2008-01-14 13:07:38.000000000 +010020090 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_ioctl.h 2008-01-22 13:33:10.000000000 +0100 20038 20091 @@ -0,0 +1,163 @@ 20039 20092 +/* … … 20200 20253 + 20201 20254 +#endif /* _IEEE80211_IOCTL_H_ */ 20202 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h20255 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h 20203 20256 =================================================================== 20204 20257 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20205 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h 2008-01-14 13:07:38.000000000 +010020258 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ieee80211_node.h 2008-01-22 13:33:10.000000000 +0100 20206 20259 @@ -0,0 +1,77 @@ 20207 20260 +/*- … … 20282 20335 + 20283 20336 +#endif /* _IEEE80211_NODE_H_ */ 20284 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ini_dset.h20337 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ini_dset.h 20285 20338 =================================================================== 20286 20339 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20287 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/ini_dset.h 2008-01-14 13:07:38.000000000 +010020340 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/ini_dset.h 2008-01-22 13:33:10.000000000 +0100 20288 20341 @@ -0,0 +1,40 @@ 20289 20342 +/* … … 20327 20380 + 20328 20381 +#endif 20329 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/regDb.h20382 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/regDb.h 20330 20383 =================================================================== 20331 20384 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20332 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/regDb.h 2008-01-14 13:07:38.000000000 +010020385 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/regDb.h 2008-01-22 13:33:10.000000000 +0100 20333 20386 @@ -0,0 +1,19 @@ 20334 20387 +/* … … 20351 20404 + 20352 20405 +#endif /* __REG_DB_H__ */ 20353 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/regdump.h20406 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/regdump.h 20354 20407 =================================================================== 20355 20408 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20356 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/regdump.h 2008-01-14 13:07:38.000000000 +010020409 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/regdump.h 2008-01-22 13:33:10.000000000 +0100 20357 20410 @@ -0,0 +1,33 @@ 20358 20411 +#ifndef __REGDUMP_H__ … … 20389 20442 +#endif /* __ASSEMBLER__ */ 20390 20443 +#endif /* __REGDUMP_H__ */ 20391 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/targaddrs.h20444 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/targaddrs.h 20392 20445 =================================================================== 20393 20446 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20394 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/targaddrs.h 2008-01-14 13:07:38.000000000 +010020447 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/targaddrs.h 2008-01-22 13:33:10.000000000 +0100 20395 20448 @@ -0,0 +1,158 @@ 20396 20449 +/* … … 20552 20605 + 20553 20606 +#endif /* __TARGADDRS_H__ */ 20554 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/testcmd.h20607 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/testcmd.h 20555 20608 =================================================================== 20556 20609 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20557 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/testcmd.h 2008-01-14 13:07:38.000000000 +010020610 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/testcmd.h 2008-01-22 13:33:10.000000000 +0100 20558 20611 @@ -0,0 +1,144 @@ 20559 20612 +/* … … 20701 20754 + 20702 20755 +#endif /* TESTCMD_H_ */ 20703 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/wlan_api.h20756 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wlan_api.h 20704 20757 =================================================================== 20705 20758 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20706 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/wlan_api.h 2008-01-14 13:07:38.000000000 +010020759 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wlan_api.h 2008-01-22 13:33:10.000000000 +0100 20707 20760 @@ -0,0 +1,101 @@ 20708 20761 +#ifndef _HOST_WLAN_API_H_ … … 20807 20860 + 20808 20861 +#endif /* _HOST_WLAN_API_H_ */ 20809 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/wlan_dset.h20862 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wlan_dset.h 20810 20863 =================================================================== 20811 20864 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20812 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/wlan_dset.h 2008-01-14 13:07:38.000000000 +010020865 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wlan_dset.h 2008-01-22 13:33:10.000000000 +0100 20813 20866 @@ -0,0 +1,20 @@ 20814 20867 +/* … … 20832 20885 + 20833 20886 +#endif 20834 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/wmi_api.h20887 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wmi.h 20835 20888 =================================================================== 20836 20889 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 20837 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/wmi_api.h 2008-01-14 13:07:38.000000000 +0100 20838 @@ -0,0 +1,259 @@ 20839 +#ifndef _WMI_API_H_ 20840 +#define _WMI_API_H_ 20841 +/* 20842 + * Copyright (c) 2004-2006 Atheros Communications Inc. 20843 + * All rights reserved. 20844 + * 20845 + * This file contains the definitions for the Wireless Module Interface (WMI). 20846 + * 20847 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/wmi_api.h#2 $ 20848 + * 20849 + * 20850 + * This program is free software; you can redistribute it and/or modify 20851 + * it under the terms of the GNU General Public License version 2 as 20852 + * published by the Free Software Foundation; 20853 + * 20854 + * Software distributed under the License is distributed on an "AS 20855 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 20856 + * implied. See the License for the specific language governing 20857 + * rights and limitations under the License. 20858 + * 20859 + * 20860 + * 20861 + */ 20862 + 20863 +#ifdef __cplusplus 20864 +extern "C" { 20865 +#endif 20866 + 20867 +/* 20868 + * IP QoS Field definitions according to 802.1p 20869 + */ 20870 +#define BEST_EFFORT_PRI 0 20871 +#define BACKGROUND_PRI 1 20872 +#define EXCELLENT_EFFORT_PRI 3 20873 +#define CONTROLLED_LOAD_PRI 4 20874 +#define VIDEO_PRI 5 20875 +#define VOICE_PRI 6 20876 +#define NETWORK_CONTROL_PRI 7 20877 +#define MAX_NUM_PRI 8 20878 + 20879 +#define UNDEFINED_PRI (0xff) 20880 + 20881 +/* simple mapping of IP TOS field to a WMI priority stream 20882 + * this mapping was taken from the original linux driver implementation 20883 + * The operation maps the following 20884 + * 20885 + * */ 20886 +#define IP_TOS_TO_WMI_PRI(tos) \ 20887 + ((WMI_PRI_STREAM_ID)(((tos) >> 1) & 0x03)) 20888 + 20889 +#define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000 /* 5 seconds */ 20890 + 20891 + 20892 +struct wmi_t; 20893 + 20894 +void *wmi_init(void *devt); 20895 + 20896 +void wmi_qos_state_init(struct wmi_t *wmip); 20897 +void wmi_shutdown(struct wmi_t *wmip); 20898 +A_UINT16 wmi_get_mapped_qos_queue(struct wmi_t *, A_UINT8); 20899 +A_STATUS wmi_dix_2_dot3(struct wmi_t *wmip, void *osbuf); 20900 +A_STATUS wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, A_UINT8 msgType); 20901 +A_STATUS wmi_dot3_2_dix(struct wmi_t *wmip, void *osbuf); 20902 +A_STATUS wmi_data_hdr_remove(struct wmi_t *wmip, void *osbuf); 20903 +A_STATUS wmi_syncpoint(struct wmi_t *wmip); 20904 +A_STATUS wmi_syncpoint_reset(struct wmi_t *wmip); 20905 +WMI_PRI_STREAM_ID wmi_get_stream_id(struct wmi_t *wmip, A_UINT8 trafficClass); 20906 +A_UINT8 wmi_implicit_create_pstream(struct wmi_t *wmip, void *osbuf, A_UINT8 dir, A_UINT8 up); 20907 + 20908 +A_STATUS wmi_control_rx(struct wmi_t *wmip, void *osbuf); 20909 +void wmi_iterate_nodes(struct wmi_t *wmip, wlan_node_iter_func *f, void *arg); 20910 +void wmi_free_allnodes(struct wmi_t *wmip); 20911 +bss_t *wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr); 20912 + 20913 + 20914 +typedef enum { 20915 + NO_SYNC_WMIFLAG = 0, 20916 + SYNC_BEFORE_WMIFLAG, /* transmit all queued data before cmd */ 20917 + SYNC_AFTER_WMIFLAG, /* any new data waits until cmd execs */ 20918 + SYNC_BOTH_WMIFLAG, 20919 + END_WMIFLAG /* end marker */ 20920 +} WMI_SYNC_FLAG; 20921 + 20922 +A_STATUS wmi_cmd_send(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId, 20923 + WMI_SYNC_FLAG flag); 20924 +A_STATUS wmi_connect_cmd(struct wmi_t *wmip, 20925 + NETWORK_TYPE netType, 20926 + DOT11_AUTH_MODE dot11AuthMode, 20927 + AUTH_MODE authMode, 20928 + CRYPTO_TYPE pairwiseCrypto, 20929 + A_UINT8 pairwiseCryptoLen, 20930 + CRYPTO_TYPE groupCrypto, 20931 + A_UINT8 groupCryptoLen, 20932 + int ssidLength, 20933 + A_UCHAR *ssid, 20934 + A_UINT8 *bssid, 20935 + A_UINT16 channel, 20936 + A_UINT32 ctrl_flags); 20937 +A_STATUS wmi_reconnect_cmd(struct wmi_t *wmip, 20938 + A_UINT8 *bssid, 20939 + A_UINT16 channel); 20940 +A_STATUS wmi_disconnect_cmd(struct wmi_t *wmip); 20941 +A_STATUS wmi_getrev_cmd(struct wmi_t *wmip); 20942 +A_STATUS wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType, 20943 + A_BOOL forceFgScan, A_BOOL isLegacy, 20944 + A_UINT32 homeDwellTime, A_UINT32 forceScanInterval); 20945 +A_STATUS wmi_scanparams_cmd(struct wmi_t *wmip, A_UINT16 fg_start_sec, 20946 + A_UINT16 fg_end_sec, A_UINT16 bg_sec, 20947 + A_UINT16 minact_chdw_msec, 20948 + A_UINT16 maxact_chdw_msec, A_UINT16 pas_chdw_msec, 20949 + A_UINT8 shScanRatio, A_UINT8 scanCtrlFlags, 20950 + A_UINT32 max_dfsch_act_time); 20951 +A_STATUS wmi_bssfilter_cmd(struct wmi_t *wmip, A_UINT8 filter, A_UINT32 ieMask); 20952 +A_STATUS wmi_probedSsid_cmd(struct wmi_t *wmip, A_UINT8 index, A_UINT8 flag, 20953 + A_UINT8 ssidLength, A_UCHAR *ssid); 20954 +A_STATUS wmi_listeninterval_cmd(struct wmi_t *wmip, A_UINT16 listenInterval, A_UINT16 listenBeacons); 20955 +A_STATUS wmi_bmisstime_cmd(struct wmi_t *wmip, A_UINT16 bmisstime, A_UINT16 bmissbeacons); 20956 +A_STATUS wmi_associnfo_cmd(struct wmi_t *wmip, A_UINT8 ieType, 20957 + A_UINT8 ieLen, A_UINT8 *ieInfo); 20958 +A_STATUS wmi_powermode_cmd(struct wmi_t *wmip, A_UINT8 powerMode); 20959 +A_STATUS wmi_ibsspmcaps_cmd(struct wmi_t *wmip, A_UINT8 pmEnable, A_UINT8 ttl, 20960 + A_UINT16 atim_windows, A_UINT16 timeout_value); 20961 +A_STATUS wmi_pmparams_cmd(struct wmi_t *wmip, A_UINT16 idlePeriod, 20962 + A_UINT16 psPollNum, A_UINT16 dtimPolicy); 20963 +A_STATUS wmi_disctimeout_cmd(struct wmi_t *wmip, A_UINT8 timeout); 20964 +A_STATUS wmi_sync_cmd(struct wmi_t *wmip, A_UINT8 syncNumber); 20965 +A_STATUS wmi_create_pstream_cmd(struct wmi_t *wmip, WMI_CREATE_PSTREAM_CMD *pstream); 20966 +A_STATUS wmi_delete_pstream_cmd(struct wmi_t *wmip, A_UINT8 trafficClass, A_UINT8 streamID); 20967 +A_STATUS wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 rate); 20968 +A_STATUS wmi_get_bitrate_cmd(struct wmi_t *wmip); 20969 +A_INT8 wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate); 20970 +A_STATUS wmi_get_regDomain_cmd(struct wmi_t *wmip); 20971 +A_STATUS wmi_get_channelList_cmd(struct wmi_t *wmip); 20972 +A_STATUS wmi_set_channelParams_cmd(struct wmi_t *wmip, A_UINT8 scanParam, 20973 + WMI_PHY_MODE mode, A_INT8 numChan, 20974 + A_UINT16 *channelList); 20975 + 20976 +A_STATUS wmi_set_snr_threshold_params(struct wmi_t *wmip, 20977 + WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd); 20978 +A_STATUS wmi_set_rssi_threshold_params(struct wmi_t *wmip, 20979 + WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd); 20980 +A_STATUS wmi_clr_rssi_snr(struct wmi_t *wmip); 20981 +A_STATUS wmi_set_lq_threshold_params(struct wmi_t *wmip, 20982 + WMI_LQ_THRESHOLD_PARAMS_CMD *lqCmd); 20983 +A_STATUS wmi_set_rts_cmd(struct wmi_t *wmip, A_UINT16 threshold); 20984 +A_STATUS wmi_set_lpreamble_cmd(struct wmi_t *wmip, A_UINT8 status); 20985 + 20986 +A_STATUS wmi_set_error_report_bitmask(struct wmi_t *wmip, A_UINT32 bitmask); 20987 + 20988 +A_STATUS wmi_get_challenge_resp_cmd(struct wmi_t *wmip, A_UINT32 cookie, 20989 + A_UINT32 source); 20990 +A_STATUS wmi_config_debug_module_cmd(struct wmi_t *wmip, A_UINT16 mmask, 20991 + A_UINT16 tsr, A_BOOL rep, A_UINT16 size, 20992 + A_UINT32 valid); 20993 +A_STATUS wmi_get_stats_cmd(struct wmi_t *wmip); 20994 +A_STATUS wmi_addKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex, 20995 + CRYPTO_TYPE keyType, A_UINT8 keyUsage, 20996 + A_UINT8 keyLength,A_UINT8 *keyRSC, 20997 + A_UINT8 *keyMaterial, A_UINT8 key_op_ctrl, 20998 + WMI_SYNC_FLAG sync_flag); 20999 +A_STATUS wmi_add_krk_cmd(struct wmi_t *wmip, A_UINT8 *krk); 21000 +A_STATUS wmi_delete_krk_cmd(struct wmi_t *wmip); 21001 +A_STATUS wmi_deleteKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex); 21002 +A_STATUS wmi_set_akmp_params_cmd(struct wmi_t *wmip, 21003 + WMI_SET_AKMP_PARAMS_CMD *akmpParams); 21004 +A_STATUS wmi_get_pmkid_list_cmd(struct wmi_t *wmip); 21005 +A_STATUS wmi_set_pmkid_list_cmd(struct wmi_t *wmip, 21006 + WMI_SET_PMKID_LIST_CMD *pmkInfo); 21007 +A_STATUS wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM); 21008 +A_STATUS wmi_get_txPwr_cmd(struct wmi_t *wmip); 21009 +A_STATUS wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid); 21010 +A_STATUS wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex); 21011 +A_STATUS wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en); 21012 +A_STATUS wmi_setPmkid_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT8 *pmkId, 21013 + A_BOOL set); 21014 +A_STATUS wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT16 txop, 21015 + A_UINT8 eCWmin, A_UINT8 eCWmax, 21016 + A_UINT8 aifsn); 21017 +A_STATUS wmi_set_retry_limits_cmd(struct wmi_t *wmip, A_UINT8 frameType, 21018 + A_UINT8 trafficClass, A_UINT8 maxRetries, 21019 + A_UINT8 enableNotify); 21020 + 21021 +void wmi_get_current_bssid(struct wmi_t *wmip, A_UINT8 *bssid); 21022 + 21023 +A_STATUS wmi_get_roam_tbl_cmd(struct wmi_t *wmip); 21024 +A_STATUS wmi_get_roam_data_cmd(struct wmi_t *wmip, A_UINT8 roamDataType); 21025 +A_STATUS wmi_set_roam_ctrl_cmd(struct wmi_t *wmip, WMI_SET_ROAM_CTRL_CMD *p, 21026 + A_UINT8 size); 21027 +A_STATUS wmi_set_powersave_timers_cmd(struct wmi_t *wmip, 21028 + WMI_POWERSAVE_TIMERS_POLICY_CMD *pCmd, 21029 + A_UINT8 size); 21030 + 21031 +A_STATUS wmi_set_opt_mode_cmd(struct wmi_t *wmip, A_UINT8 optMode); 21032 +A_STATUS wmi_opt_tx_frame_cmd(struct wmi_t *wmip, 21033 + A_UINT8 frmType, 21034 + A_UINT8 *dstMacAddr, 21035 + A_UINT8 *bssid, 21036 + A_UINT16 optIEDataLen, 21037 + A_UINT8 *optIEData); 21038 + 21039 +A_STATUS wmi_set_adhoc_bconIntvl_cmd(struct wmi_t *wmip, A_UINT16 intvl); 21040 +A_STATUS wmi_set_voice_pkt_size_cmd(struct wmi_t *wmip, A_UINT16 voicePktSize); 21041 +A_STATUS wmi_set_max_sp_len_cmd(struct wmi_t *wmip, A_UINT8 maxSpLen); 21042 +A_UINT8 convert_userPriority_to_trafficClass(A_UINT8 userPriority); 21043 +A_UINT8 wmi_get_power_mode_cmd(struct wmi_t *wmip); 21044 +A_STATUS wmi_verify_tspec_params(WMI_CREATE_PSTREAM_CMD *pCmd, A_BOOL tspecCompliance); 21045 + 21046 +#ifdef CONFIG_HOST_TCMD_SUPPORT 21047 +A_STATUS wmi_test_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT32 len); 21048 +#endif 21049 + 21050 +A_STATUS wmi_set_bt_status_cmd(struct wmi_t *wmip, A_UINT8 streamType, A_UINT8 status); 21051 +A_STATUS wmi_set_bt_params_cmd(struct wmi_t *wmip, WMI_SET_BT_PARAMS_CMD* cmd); 21052 + 21053 + 21054 +/* 21055 + * This function is used to configure the fix rates mask to the target. 21056 + */ 21057 +A_STATUS wmi_set_fixrates_cmd(struct wmi_t *wmip, A_INT16 fixRatesMask); 21058 +A_STATUS wmi_get_ratemask_cmd(struct wmi_t *wmip); 21059 + 21060 +A_STATUS wmi_set_authmode_cmd(struct wmi_t *wmip, A_UINT8 mode); 21061 + 21062 +A_STATUS wmi_set_reassocmode_cmd(struct wmi_t *wmip, A_UINT8 mode); 21063 + 21064 +A_STATUS wmi_set_wmm_cmd(struct wmi_t *wmip, WMI_WMM_STATUS status); 21065 +A_STATUS wmi_set_wmm_txop(struct wmi_t *wmip, WMI_TXOP_CFG txEnable); 21066 + 21067 +A_STATUS wmi_get_keepalive_configured(struct wmi_t *wmip); 21068 +A_UINT8 wmi_get_keepalive_cmd(struct wmi_t *wmip); 21069 +A_STATUS wmi_set_keepalive_cmd(struct wmi_t *wmip, A_UINT8 keepaliveInterval); 21070 + 21071 +A_STATUS wmi_set_appie_cmd(struct wmi_t *wmip, A_UINT8 mgmtFrmType, 21072 + A_UINT8 ieLen,A_UINT8 *ieInfo); 21073 + 21074 +A_STATUS wmi_set_halparam_cmd(struct wmi_t *wmip, A_UINT8 *cmd, A_UINT16 dataLen); 21075 +A_INT32 wmi_get_rate(A_INT8 rateindex); 21076 + 21077 +/*Wake on Wireless WMI commands*/ 21078 +A_STATUS wmi_set_host_sleep_mode_cmd(struct wmi_t *wmip, WMI_SET_HOST_SLEEP_MODE_CMD *cmd); 21079 +A_STATUS wmi_set_wow_mode_cmd(struct wmi_t *wmip, WMI_SET_WOW_MODE_CMD *cmd); 21080 +A_STATUS wmi_get_wow_list_cmd(struct wmi_t *wmip, WMI_GET_WOW_LIST_CMD *cmd); 21081 +A_STATUS wmi_add_wow_pattern_cmd(struct wmi_t *wmip, 21082 + WMI_ADD_WOW_PATTERN_CMD *cmd, A_UINT8* pattern, A_UINT8* mask, A_UINT8 pattern_size); 21083 +A_STATUS wmi_del_wow_pattern_cmd(struct wmi_t *wmip, 21084 + WMI_DEL_WOW_PATTERN_CMD *cmd); 21085 +A_STATUS wmi_set_wsc_status_cmd(struct wmi_t *wmip, A_UINT32 status); 21086 + 21087 +bss_t * 21088 +wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, 21089 + A_UINT32 ssidLength, A_BOOL bIsWPA2); 21090 + 21091 +void 21092 +wmi_node_return (struct wmi_t *wmip, bss_t *bss); 21093 +#ifdef __cplusplus 21094 +} 21095 +#endif 21096 + 21097 +#endif /* _WMI_API_H_ */ 21098 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/wmi.h 21099 =================================================================== 21100 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 21101 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/wmi.h 2008-01-14 13:07:38.000000000 +0100 20890 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wmi.h 2008-01-22 16:57:48.000000000 +0100 21102 20891 @@ -0,0 +1,1739 @@ 21103 20892 +/* … … 22206 21995 + A_INT16 rssi; 22207 21996 + A_UINT8 bssid[ATH_MAC_LEN]; 22208 + //A_UINT32 ieMask;21997 + A_UINT32 ieMask; 22209 21998 +} POSTPACK WMI_BSS_INFO_HDR; 22210 21999 + … … 22840 22629 + 22841 22630 +#endif /* _WMI_H_ */ 22842 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/include/wmix.h22631 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wmi_api.h 22843 22632 =================================================================== 22844 22633 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 22845 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/include/wmix.h 2008-01-14 13:07:38.000000000 +0100 22634 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wmi_api.h 2008-01-22 13:33:10.000000000 +0100 22635 @@ -0,0 +1,259 @@ 22636 +#ifndef _WMI_API_H_ 22637 +#define _WMI_API_H_ 22638 +/* 22639 + * Copyright (c) 2004-2006 Atheros Communications Inc. 22640 + * All rights reserved. 22641 + * 22642 + * This file contains the definitions for the Wireless Module Interface (WMI). 22643 + * 22644 + * $Id: //depot/sw/releases/olca2.0-GPL/host/include/wmi_api.h#2 $ 22645 + * 22646 + * 22647 + * This program is free software; you can redistribute it and/or modify 22648 + * it under the terms of the GNU General Public License version 2 as 22649 + * published by the Free Software Foundation; 22650 + * 22651 + * Software distributed under the License is distributed on an "AS 22652 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 22653 + * implied. See the License for the specific language governing 22654 + * rights and limitations under the License. 22655 + * 22656 + * 22657 + * 22658 + */ 22659 + 22660 +#ifdef __cplusplus 22661 +extern "C" { 22662 +#endif 22663 + 22664 +/* 22665 + * IP QoS Field definitions according to 802.1p 22666 + */ 22667 +#define BEST_EFFORT_PRI 0 22668 +#define BACKGROUND_PRI 1 22669 +#define EXCELLENT_EFFORT_PRI 3 22670 +#define CONTROLLED_LOAD_PRI 4 22671 +#define VIDEO_PRI 5 22672 +#define VOICE_PRI 6 22673 +#define NETWORK_CONTROL_PRI 7 22674 +#define MAX_NUM_PRI 8 22675 + 22676 +#define UNDEFINED_PRI (0xff) 22677 + 22678 +/* simple mapping of IP TOS field to a WMI priority stream 22679 + * this mapping was taken from the original linux driver implementation 22680 + * The operation maps the following 22681 + * 22682 + * */ 22683 +#define IP_TOS_TO_WMI_PRI(tos) \ 22684 + ((WMI_PRI_STREAM_ID)(((tos) >> 1) & 0x03)) 22685 + 22686 +#define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000 /* 5 seconds */ 22687 + 22688 + 22689 +struct wmi_t; 22690 + 22691 +void *wmi_init(void *devt); 22692 + 22693 +void wmi_qos_state_init(struct wmi_t *wmip); 22694 +void wmi_shutdown(struct wmi_t *wmip); 22695 +A_UINT16 wmi_get_mapped_qos_queue(struct wmi_t *, A_UINT8); 22696 +A_STATUS wmi_dix_2_dot3(struct wmi_t *wmip, void *osbuf); 22697 +A_STATUS wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, A_UINT8 msgType); 22698 +A_STATUS wmi_dot3_2_dix(struct wmi_t *wmip, void *osbuf); 22699 +A_STATUS wmi_data_hdr_remove(struct wmi_t *wmip, void *osbuf); 22700 +A_STATUS wmi_syncpoint(struct wmi_t *wmip); 22701 +A_STATUS wmi_syncpoint_reset(struct wmi_t *wmip); 22702 +WMI_PRI_STREAM_ID wmi_get_stream_id(struct wmi_t *wmip, A_UINT8 trafficClass); 22703 +A_UINT8 wmi_implicit_create_pstream(struct wmi_t *wmip, void *osbuf, A_UINT8 dir, A_UINT8 up); 22704 + 22705 +A_STATUS wmi_control_rx(struct wmi_t *wmip, void *osbuf); 22706 +void wmi_iterate_nodes(struct wmi_t *wmip, wlan_node_iter_func *f, void *arg); 22707 +void wmi_free_allnodes(struct wmi_t *wmip); 22708 +bss_t *wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr); 22709 + 22710 + 22711 +typedef enum { 22712 + NO_SYNC_WMIFLAG = 0, 22713 + SYNC_BEFORE_WMIFLAG, /* transmit all queued data before cmd */ 22714 + SYNC_AFTER_WMIFLAG, /* any new data waits until cmd execs */ 22715 + SYNC_BOTH_WMIFLAG, 22716 + END_WMIFLAG /* end marker */ 22717 +} WMI_SYNC_FLAG; 22718 + 22719 +A_STATUS wmi_cmd_send(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId, 22720 + WMI_SYNC_FLAG flag); 22721 +A_STATUS wmi_connect_cmd(struct wmi_t *wmip, 22722 + NETWORK_TYPE netType, 22723 + DOT11_AUTH_MODE dot11AuthMode, 22724 + AUTH_MODE authMode, 22725 + CRYPTO_TYPE pairwiseCrypto, 22726 + A_UINT8 pairwiseCryptoLen, 22727 + CRYPTO_TYPE groupCrypto, 22728 + A_UINT8 groupCryptoLen, 22729 + int ssidLength, 22730 + A_UCHAR *ssid, 22731 + A_UINT8 *bssid, 22732 + A_UINT16 channel, 22733 + A_UINT32 ctrl_flags); 22734 +A_STATUS wmi_reconnect_cmd(struct wmi_t *wmip, 22735 + A_UINT8 *bssid, 22736 + A_UINT16 channel); 22737 +A_STATUS wmi_disconnect_cmd(struct wmi_t *wmip); 22738 +A_STATUS wmi_getrev_cmd(struct wmi_t *wmip); 22739 +A_STATUS wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType, 22740 + A_BOOL forceFgScan, A_BOOL isLegacy, 22741 + A_UINT32 homeDwellTime, A_UINT32 forceScanInterval); 22742 +A_STATUS wmi_scanparams_cmd(struct wmi_t *wmip, A_UINT16 fg_start_sec, 22743 + A_UINT16 fg_end_sec, A_UINT16 bg_sec, 22744 + A_UINT16 minact_chdw_msec, 22745 + A_UINT16 maxact_chdw_msec, A_UINT16 pas_chdw_msec, 22746 + A_UINT8 shScanRatio, A_UINT8 scanCtrlFlags, 22747 + A_UINT32 max_dfsch_act_time); 22748 +A_STATUS wmi_bssfilter_cmd(struct wmi_t *wmip, A_UINT8 filter, A_UINT32 ieMask); 22749 +A_STATUS wmi_probedSsid_cmd(struct wmi_t *wmip, A_UINT8 index, A_UINT8 flag, 22750 + A_UINT8 ssidLength, A_UCHAR *ssid); 22751 +A_STATUS wmi_listeninterval_cmd(struct wmi_t *wmip, A_UINT16 listenInterval, A_UINT16 listenBeacons); 22752 +A_STATUS wmi_bmisstime_cmd(struct wmi_t *wmip, A_UINT16 bmisstime, A_UINT16 bmissbeacons); 22753 +A_STATUS wmi_associnfo_cmd(struct wmi_t *wmip, A_UINT8 ieType, 22754 + A_UINT8 ieLen, A_UINT8 *ieInfo); 22755 +A_STATUS wmi_powermode_cmd(struct wmi_t *wmip, A_UINT8 powerMode); 22756 +A_STATUS wmi_ibsspmcaps_cmd(struct wmi_t *wmip, A_UINT8 pmEnable, A_UINT8 ttl, 22757 + A_UINT16 atim_windows, A_UINT16 timeout_value); 22758 +A_STATUS wmi_pmparams_cmd(struct wmi_t *wmip, A_UINT16 idlePeriod, 22759 + A_UINT16 psPollNum, A_UINT16 dtimPolicy); 22760 +A_STATUS wmi_disctimeout_cmd(struct wmi_t *wmip, A_UINT8 timeout); 22761 +A_STATUS wmi_sync_cmd(struct wmi_t *wmip, A_UINT8 syncNumber); 22762 +A_STATUS wmi_create_pstream_cmd(struct wmi_t *wmip, WMI_CREATE_PSTREAM_CMD *pstream); 22763 +A_STATUS wmi_delete_pstream_cmd(struct wmi_t *wmip, A_UINT8 trafficClass, A_UINT8 streamID); 22764 +A_STATUS wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 rate); 22765 +A_STATUS wmi_get_bitrate_cmd(struct wmi_t *wmip); 22766 +A_INT8 wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate); 22767 +A_STATUS wmi_get_regDomain_cmd(struct wmi_t *wmip); 22768 +A_STATUS wmi_get_channelList_cmd(struct wmi_t *wmip); 22769 +A_STATUS wmi_set_channelParams_cmd(struct wmi_t *wmip, A_UINT8 scanParam, 22770 + WMI_PHY_MODE mode, A_INT8 numChan, 22771 + A_UINT16 *channelList); 22772 + 22773 +A_STATUS wmi_set_snr_threshold_params(struct wmi_t *wmip, 22774 + WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd); 22775 +A_STATUS wmi_set_rssi_threshold_params(struct wmi_t *wmip, 22776 + WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd); 22777 +A_STATUS wmi_clr_rssi_snr(struct wmi_t *wmip); 22778 +A_STATUS wmi_set_lq_threshold_params(struct wmi_t *wmip, 22779 + WMI_LQ_THRESHOLD_PARAMS_CMD *lqCmd); 22780 +A_STATUS wmi_set_rts_cmd(struct wmi_t *wmip, A_UINT16 threshold); 22781 +A_STATUS wmi_set_lpreamble_cmd(struct wmi_t *wmip, A_UINT8 status); 22782 + 22783 +A_STATUS wmi_set_error_report_bitmask(struct wmi_t *wmip, A_UINT32 bitmask); 22784 + 22785 +A_STATUS wmi_get_challenge_resp_cmd(struct wmi_t *wmip, A_UINT32 cookie, 22786 + A_UINT32 source); 22787 +A_STATUS wmi_config_debug_module_cmd(struct wmi_t *wmip, A_UINT16 mmask, 22788 + A_UINT16 tsr, A_BOOL rep, A_UINT16 size, 22789 + A_UINT32 valid); 22790 +A_STATUS wmi_get_stats_cmd(struct wmi_t *wmip); 22791 +A_STATUS wmi_addKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex, 22792 + CRYPTO_TYPE keyType, A_UINT8 keyUsage, 22793 + A_UINT8 keyLength,A_UINT8 *keyRSC, 22794 + A_UINT8 *keyMaterial, A_UINT8 key_op_ctrl, 22795 + WMI_SYNC_FLAG sync_flag); 22796 +A_STATUS wmi_add_krk_cmd(struct wmi_t *wmip, A_UINT8 *krk); 22797 +A_STATUS wmi_delete_krk_cmd(struct wmi_t *wmip); 22798 +A_STATUS wmi_deleteKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex); 22799 +A_STATUS wmi_set_akmp_params_cmd(struct wmi_t *wmip, 22800 + WMI_SET_AKMP_PARAMS_CMD *akmpParams); 22801 +A_STATUS wmi_get_pmkid_list_cmd(struct wmi_t *wmip); 22802 +A_STATUS wmi_set_pmkid_list_cmd(struct wmi_t *wmip, 22803 + WMI_SET_PMKID_LIST_CMD *pmkInfo); 22804 +A_STATUS wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM); 22805 +A_STATUS wmi_get_txPwr_cmd(struct wmi_t *wmip); 22806 +A_STATUS wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid); 22807 +A_STATUS wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex); 22808 +A_STATUS wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en); 22809 +A_STATUS wmi_setPmkid_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT8 *pmkId, 22810 + A_BOOL set); 22811 +A_STATUS wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT16 txop, 22812 + A_UINT8 eCWmin, A_UINT8 eCWmax, 22813 + A_UINT8 aifsn); 22814 +A_STATUS wmi_set_retry_limits_cmd(struct wmi_t *wmip, A_UINT8 frameType, 22815 + A_UINT8 trafficClass, A_UINT8 maxRetries, 22816 + A_UINT8 enableNotify); 22817 + 22818 +void wmi_get_current_bssid(struct wmi_t *wmip, A_UINT8 *bssid); 22819 + 22820 +A_STATUS wmi_get_roam_tbl_cmd(struct wmi_t *wmip); 22821 +A_STATUS wmi_get_roam_data_cmd(struct wmi_t *wmip, A_UINT8 roamDataType); 22822 +A_STATUS wmi_set_roam_ctrl_cmd(struct wmi_t *wmip, WMI_SET_ROAM_CTRL_CMD *p, 22823 + A_UINT8 size); 22824 +A_STATUS wmi_set_powersave_timers_cmd(struct wmi_t *wmip, 22825 + WMI_POWERSAVE_TIMERS_POLICY_CMD *pCmd, 22826 + A_UINT8 size); 22827 + 22828 +A_STATUS wmi_set_opt_mode_cmd(struct wmi_t *wmip, A_UINT8 optMode); 22829 +A_STATUS wmi_opt_tx_frame_cmd(struct wmi_t *wmip, 22830 + A_UINT8 frmType, 22831 + A_UINT8 *dstMacAddr, 22832 + A_UINT8 *bssid, 22833 + A_UINT16 optIEDataLen, 22834 + A_UINT8 *optIEData); 22835 + 22836 +A_STATUS wmi_set_adhoc_bconIntvl_cmd(struct wmi_t *wmip, A_UINT16 intvl); 22837 +A_STATUS wmi_set_voice_pkt_size_cmd(struct wmi_t *wmip, A_UINT16 voicePktSize); 22838 +A_STATUS wmi_set_max_sp_len_cmd(struct wmi_t *wmip, A_UINT8 maxSpLen); 22839 +A_UINT8 convert_userPriority_to_trafficClass(A_UINT8 userPriority); 22840 +A_UINT8 wmi_get_power_mode_cmd(struct wmi_t *wmip); 22841 +A_STATUS wmi_verify_tspec_params(WMI_CREATE_PSTREAM_CMD *pCmd, A_BOOL tspecCompliance); 22842 + 22843 +#ifdef CONFIG_HOST_TCMD_SUPPORT 22844 +A_STATUS wmi_test_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT32 len); 22845 +#endif 22846 + 22847 +A_STATUS wmi_set_bt_status_cmd(struct wmi_t *wmip, A_UINT8 streamType, A_UINT8 status); 22848 +A_STATUS wmi_set_bt_params_cmd(struct wmi_t *wmip, WMI_SET_BT_PARAMS_CMD* cmd); 22849 + 22850 + 22851 +/* 22852 + * This function is used to configure the fix rates mask to the target. 22853 + */ 22854 +A_STATUS wmi_set_fixrates_cmd(struct wmi_t *wmip, A_INT16 fixRatesMask); 22855 +A_STATUS wmi_get_ratemask_cmd(struct wmi_t *wmip); 22856 + 22857 +A_STATUS wmi_set_authmode_cmd(struct wmi_t *wmip, A_UINT8 mode); 22858 + 22859 +A_STATUS wmi_set_reassocmode_cmd(struct wmi_t *wmip, A_UINT8 mode); 22860 + 22861 +A_STATUS wmi_set_wmm_cmd(struct wmi_t *wmip, WMI_WMM_STATUS status); 22862 +A_STATUS wmi_set_wmm_txop(struct wmi_t *wmip, WMI_TXOP_CFG txEnable); 22863 + 22864 +A_STATUS wmi_get_keepalive_configured(struct wmi_t *wmip); 22865 +A_UINT8 wmi_get_keepalive_cmd(struct wmi_t *wmip); 22866 +A_STATUS wmi_set_keepalive_cmd(struct wmi_t *wmip, A_UINT8 keepaliveInterval); 22867 + 22868 +A_STATUS wmi_set_appie_cmd(struct wmi_t *wmip, A_UINT8 mgmtFrmType, 22869 + A_UINT8 ieLen,A_UINT8 *ieInfo); 22870 + 22871 +A_STATUS wmi_set_halparam_cmd(struct wmi_t *wmip, A_UINT8 *cmd, A_UINT16 dataLen); 22872 +A_INT32 wmi_get_rate(A_INT8 rateindex); 22873 + 22874 +/*Wake on Wireless WMI commands*/ 22875 +A_STATUS wmi_set_host_sleep_mode_cmd(struct wmi_t *wmip, WMI_SET_HOST_SLEEP_MODE_CMD *cmd); 22876 +A_STATUS wmi_set_wow_mode_cmd(struct wmi_t *wmip, WMI_SET_WOW_MODE_CMD *cmd); 22877 +A_STATUS wmi_get_wow_list_cmd(struct wmi_t *wmip, WMI_GET_WOW_LIST_CMD *cmd); 22878 +A_STATUS wmi_add_wow_pattern_cmd(struct wmi_t *wmip, 22879 + WMI_ADD_WOW_PATTERN_CMD *cmd, A_UINT8* pattern, A_UINT8* mask, A_UINT8 pattern_size); 22880 +A_STATUS wmi_del_wow_pattern_cmd(struct wmi_t *wmip, 22881 + WMI_DEL_WOW_PATTERN_CMD *cmd); 22882 +A_STATUS wmi_set_wsc_status_cmd(struct wmi_t *wmip, A_UINT32 status); 22883 + 22884 +bss_t * 22885 +wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid, 22886 + A_UINT32 ssidLength, A_BOOL bIsWPA2); 22887 + 22888 +void 22889 +wmi_node_return (struct wmi_t *wmip, bss_t *bss); 22890 +#ifdef __cplusplus 22891 +} 22892 +#endif 22893 + 22894 +#endif /* _WMI_API_H_ */ 22895 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wmix.h 22896 =================================================================== 22897 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 22898 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/include/wmix.h 2008-01-22 13:33:10.000000000 +0100 22846 22899 @@ -0,0 +1,233 @@ 22847 22900 +/* … … 23078 23131 + 23079 23132 +#endif /* _WMIX_H_ */ 23080 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/Makefile23133 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/miscdrv/common_drv.c 23081 23134 =================================================================== 23082 23135 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 23083 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/Makefile 2008-01-14 13:07:38.000000000 +0100 23084 @@ -0,0 +1,38 @@ 23085 +REV ?= 2 23086 + 23087 +PWD := $(shell pwd) 23088 + 23089 +EXTRA_CFLAGS += -I$(src)/include 23090 + 23091 +EXTRA_CFLAGS += -DLINUX -DDEBUG -D__KERNEL__ -DHTC_RAW_INTERFACE\ 23092 + -DTCMD -DSEND_EVENT_TO_APP -DUSER_KEYS \ 23093 + -DNO_SYNC_FLUSH #\ 23094 + -DMULTIPLE_FRAMES_PER_INTERRUPT -DAR6000REV$(REV) \ 23095 + -DBLOCK_TX_PATH_FLAG \ 23096 + -DSDIO \ 23097 + 23098 +EXTRA_CFLAGS += -DKERNEL_2_6 23099 + 23100 +obj-$(CONFIG_SDIO_AR6000_WLAN) += ar6000.o 23101 + 23102 +ar6000-objs += htc/ar6k.o \ 23103 + htc/ar6k_events.o \ 23104 + htc/htc_send.o \ 23105 + htc/htc_recv.o \ 23106 + htc/htc_services.o \ 23107 + htc/htc.o \ 23108 + hif/hif.o \ 23109 + bmi/bmi.o \ 23110 + ar6000/ar6000_drv.o \ 23111 + ar6000/ar6000_raw_if.o \ 23112 + ar6000/netbuf.o \ 23113 + ar6000/wireless_ext.o \ 23114 + ar6000/ioctl.o \ 23115 + miscdrv/common_drv.o \ 23116 + miscdrv/credit_dist.o \ 23117 + wmi/wmi.o \ 23118 + wlan/wlan_node.o \ 23119 + wlan/wlan_recv_beacon.o \ 23120 + wlan/wlan_utils.o 23121 + 23122 + 23123 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/miscdrv/common_drv.c 23124 =================================================================== 23125 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 23126 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/ar6000/miscdrv/common_drv.c 2008-01-14 13:07:38.000000000 +0100 23136 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/miscdrv/common_drv.c 2008-01-22 13:33:10.000000000 +0100 23127 23137 @@ -0,0 +1,467 @@ 23128 23138 + … … 23593 23603 +} 23594 23604 + 23595 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/miscdrv/credit_dist.c23605 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/miscdrv/credit_dist.c 23596 23606 =================================================================== 23597 23607 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 23598 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/miscdrv/credit_dist.c 2008-01-14 13:07:38.000000000 +010023608 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/miscdrv/credit_dist.c 2008-01-22 13:33:10.000000000 +0100 23599 23609 @@ -0,0 +1,346 @@ 23600 23610 + … … 23944 23954 +} 23945 23955 + 23946 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c23956 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c 23947 23957 =================================================================== 23948 23958 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 23949 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c 2008-01-14 13:07:38.000000000 +010023959 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_node.c 2008-01-22 13:33:10.000000000 +0100 23950 23960 @@ -0,0 +1,371 @@ 23951 23961 +/*- … … 24320 24330 + IEEE80211_NODE_UNLOCK (nt); 24321 24331 +} 24322 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c24332 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c 24323 24333 =================================================================== 24324 24334 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 24325 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c 2008-01-14 13:07:38.000000000 +010024335 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_recv_beacon.c 2008-01-22 13:33:10.000000000 +0100 24326 24336 @@ -0,0 +1,192 @@ 24327 24337 +/*- … … 24517 24527 + return A_OK; 24518 24528 +} 24519 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c24529 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c 24520 24530 =================================================================== 24521 24531 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 24522 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c 2008-01-14 13:07:38.000000000 +010024532 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wlan/wlan_utils.c 2008-01-22 13:33:10.000000000 +0100 24523 24533 @@ -0,0 +1,59 @@ 24524 24534 +/* … … 24581 24591 + return (freq - 5000) / 5; 24582 24592 +} 24583 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wmi/wmi.c24593 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wmi/wmi.c 24584 24594 =================================================================== 24585 24595 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 24586 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wmi/wmi.c 2008-01-14 13:07:38.000000000 +010024596 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wmi/wmi.c 2008-01-22 13:33:10.000000000 +0100 24587 24597 @@ -0,0 +1,3921 @@ 24588 24598 +/* … … 28507 28517 +} 28508 28518 + 28509 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_doc.h28519 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_doc.h 28510 28520 =================================================================== 28511 28521 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 28512 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_doc.h 2008-01-14 13:07:38.000000000 +010028522 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_doc.h 2008-01-22 13:33:10.000000000 +0100 28513 28523 @@ -0,0 +1,4421 @@ 28514 28524 +/* … … 32933 32943 +===================================================================== 32934 32944 +#endif 32935 Index: linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_host.h32945 Index: linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_host.h 32936 32946 =================================================================== 32937 32947 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 32938 +++ linux-2.6 -openmoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_host.h 2008-01-14 13:07:38.000000000 +010032948 +++ linux-2.6.24-rc8-omoko/drivers/sdio/function/wlan/ar6000/wmi/wmi_host.h 2008-01-22 13:33:10.000000000 +0100 32939 32949 @@ -0,0 +1,71 @@ 32940 32950 +#ifndef _WMI_HOST_H_ … … 33009 33019 + 33010 33020 +#endif /* _WMI_HOST_H_ */ 33011 Index: linux-2.6-openmoko/drivers/sdio/function/wlan/Makefile33012 ===================================================================33013 --- /dev/null 1970-01-01 00:00:00.000000000 +000033014 +++ linux-2.6-openmoko/drivers/sdio/function/wlan/Makefile 2008-01-14 13:07:38.000000000 +010033015 @@ -0,0 +1,4 @@33016 +#33017 +# SDIO wlan ar600 card function driver33018 +#33019 +obj-$(CONFIG_SDIO_AR6000_WLAN) += ar6000/33020 \ No newline at end of file -
developers/sameo/patches/ar6k-atheros-2.0/2.6.24/atheros_2_0_sdio_stack.patch
r3825 r3921 9 9 drivers/sdio/stack/busdriver/_busdriver.h | 466 +++ 10 10 drivers/sdio/stack/busdriver/sdio_bus.c | 2120 +++++++++++++++ 11 drivers/sdio/stack/busdriver/sdio_bus_events.c | 104 4+++++++11 drivers/sdio/stack/busdriver/sdio_bus_events.c | 1040 +++++++ 12 12 drivers/sdio/stack/busdriver/sdio_bus_misc.c | 3122 +++++++++++++++++++++++ 13 13 drivers/sdio/stack/busdriver/sdio_bus_os.c | 832 ++++++ … … 27 27 include/linux/sdio/sdio_lib.h | 270 + 28 28 include/linux/sdio/sdlist.h | 141 + 29 27 files changed, 1374 5insertions(+)29 27 files changed, 13741 insertions(+) 30 30 31 Index: linux-2.6 -openmoko/drivers/Makefile31 Index: linux-2.6.24-rc8-omoko/arch/arm/Kconfig 32 32 =================================================================== 33 --- linux-2.6-openmoko.orig/drivers/Makefile 2008-01-14 13:07:18.000000000 +0100 34 +++ linux-2.6-openmoko/drivers/Makefile 2008-01-14 13:07:38.000000000 +0100 33 --- linux-2.6.24-rc8-omoko.orig/arch/arm/Kconfig 2008-01-22 13:32:02.000000000 +0100 34 +++ linux-2.6.24-rc8-omoko/arch/arm/Kconfig 2008-01-22 13:33:10.000000000 +0100 35 @@ -1064,6 +1064,8 @@ 36 37 source "drivers/usb/Kconfig" 38 39 +source "drivers/sdio/Kconfig" 40 + 41 source "drivers/mmc/Kconfig" 42 43 source "drivers/leds/Kconfig" 44 Index: linux-2.6.24-rc8-omoko/drivers/Kconfig 45 =================================================================== 46 --- linux-2.6.24-rc8-omoko.orig/drivers/Kconfig 2008-01-22 13:32:03.000000000 +0100 47 +++ linux-2.6.24-rc8-omoko/drivers/Kconfig 2008-01-22 13:33:10.000000000 +0100 48 @@ -74,6 +74,8 @@ 49 50 source "drivers/usb/Kconfig" 51 52 +source "drivers/sdio/Kconfig" 53 + 54 source "drivers/mmc/Kconfig" 55 56 source "drivers/leds/Kconfig" 57 Index: linux-2.6.24-rc8-omoko/drivers/Makefile 58 =================================================================== 59 --- linux-2.6.24-rc8-omoko.orig/drivers/Makefile 2008-01-22 13:32:03.000000000 +0100 60 +++ linux-2.6.24-rc8-omoko/drivers/Makefile 2008-01-22 13:33:10.000000000 +0100 35 61 @@ -77,6 +77,7 @@ 36 62 obj-$(CONFIG_CPU_FREQ) += cpufreq/ … … 41 67 obj-$(CONFIG_INFINIBAND) += infiniband/ 42 68 obj-$(CONFIG_SGI_SN) += sn/ 43 Index: linux-2.6-openmoko/drivers/Kconfig 44 =================================================================== 45 --- linux-2.6-openmoko.orig/drivers/Kconfig 2008-01-14 13:07:18.000000000 +0100 46 +++ linux-2.6-openmoko/drivers/Kconfig 2008-01-14 13:07:38.000000000 +0100 47 @@ -74,6 +74,8 @@ 48 49 source "drivers/usb/Kconfig" 50 51 +source "drivers/sdio/Kconfig" 52 + 53 source "drivers/mmc/Kconfig" 54 55 source "drivers/leds/Kconfig" 56 Index: linux-2.6-openmoko/arch/arm/Kconfig 57 =================================================================== 58 --- linux-2.6-openmoko.orig/arch/arm/Kconfig 2008-01-14 13:07:18.000000000 +0100 59 +++ linux-2.6-openmoko/arch/arm/Kconfig 2008-01-14 13:07:38.000000000 +0100 60 @@ -1064,6 +1064,8 @@ 61 62 source "drivers/usb/Kconfig" 63 64 +source "drivers/sdio/Kconfig" 65 + 66 source "drivers/mmc/Kconfig" 67 68 source "drivers/leds/Kconfig" 69 Index: linux-2.6-openmoko/drivers/sdio/Kconfig 69 Index: linux-2.6.24-rc8-omoko/drivers/sdio/Kconfig 70 70 =================================================================== 71 71 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 72 +++ linux-2.6 -openmoko/drivers/sdio/Kconfig 2008-01-14 13:07:38.000000000 +010072 +++ linux-2.6.24-rc8-omoko/drivers/sdio/Kconfig 2008-01-22 13:33:10.000000000 +0100 73 73 @@ -0,0 +1,17 @@ 74 74 +# … … 89 89 + 90 90 +endmenu 91 Index: linux-2.6 -openmoko/drivers/sdio/Makefile91 Index: linux-2.6.24-rc8-omoko/drivers/sdio/Makefile 92 92 =================================================================== 93 93 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 94 +++ linux-2.6 -openmoko/drivers/sdio/Makefile 2008-01-14 13:07:38.000000000 +010094 +++ linux-2.6.24-rc8-omoko/drivers/sdio/Makefile 2008-01-22 13:33:10.000000000 +0100 95 95 @@ -0,0 +1,4 @@ 96 96 +#Makefile for SDIO stack … … 98 98 +obj-$(CONFIG_SDIO) += hcd/ 99 99 +obj-$(CONFIG_SDIO) += function/ 100 Index: linux-2.6 -openmoko/drivers/sdio/stack/busdriver/_busdriver.h100 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/Makefile 101 101 =================================================================== 102 102 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 103 +++ linux-2.6-openmoko/drivers/sdio/stack/busdriver/_busdriver.h 2008-01-14 13:07:38.000000000 +0100 103 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/Makefile 2008-01-22 13:33:10.000000000 +0100 104 @@ -0,0 +1 @@ 105 +obj-$(CONFIG_SDIO) += busdriver/ lib/ 106 \ No newline at end of file 107 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/Makefile 108 =================================================================== 109 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 110 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/Makefile 2008-01-22 13:33:10.000000000 +0100 111 @@ -0,0 +1,2 @@ 112 +obj-$(CONFIG_SDIO) += sdio_busdriver.o 113 +sdio_busdriver-objs := sdio_bus.o sdio_function.o sdio_bus_misc.o sdio_bus_events.o sdio_bus_os.o 114 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/_busdriver.h 115 =================================================================== 116 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 117 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/_busdriver.h 2008-01-22 13:33:10.000000000 +0100 104 118 @@ -0,0 +1,466 @@ 105 119 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 569 583 + 570 584 +#endif /*___BUSDRIVER_H___*/ 571 Index: linux-2.6 -openmoko/drivers/sdio/stack/busdriver/Makefile585 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus.c 572 586 =================================================================== 573 587 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 574 +++ linux-2.6-openmoko/drivers/sdio/stack/busdriver/Makefile 2008-01-14 13:07:38.000000000 +0100 575 @@ -0,0 +1,2 @@ 576 +obj-$(CONFIG_SDIO) += sdio_busdriver.o 577 +sdio_busdriver-objs := sdio_bus.o sdio_function.o sdio_bus_misc.o sdio_bus_events.o sdio_bus_os.o 578 Index: linux-2.6-openmoko/drivers/sdio/stack/busdriver/sdio_bus.c 579 =================================================================== 580 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 581 +++ linux-2.6-openmoko/drivers/sdio/stack/busdriver/sdio_bus.c 2008-01-14 13:07:38.000000000 +0100 588 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus.c 2008-01-22 13:33:10.000000000 +0100 582 589 @@ -0,0 +1,2120 @@ 583 590 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 2701 2708 + 2702 2709 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 2703 Index: linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_bus_events.c2710 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus_events.c 2704 2711 =================================================================== 2705 2712 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 2706 +++ linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_bus_events.c 2008-01-14 13:07:38.000000000 +01002707 @@ -0,0 +1,104 4@@2713 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus_events.c 2008-01-22 16:59:19.000000000 +0100 2714 @@ -0,0 +1,1040 @@ 2708 2715 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2709 2716 +@file: sdio_bus_events.c … … 3420 3427 + } 3421 3428 + if (pHcd->IrqProcState != SDHCD_IDLE) { 3422 + DBG_PRINT(SDDBG_ERROR, ("-SDIO Bus Driver: Already processing interrupts! (state = %d) \n",3423 + pHcd->IrqProcState));3424 3429 + status = SDIO_STATUS_ERROR; 3425 3430 + status2 = _ReleaseHcdLock(pHcd); … … 3454 3459 + 3455 3460 + if (pHcd->IrqProcState != SDHCD_IDLE) { 3456 + DBG_PRINT(SDDBG_ERROR, ("-SDIO Bus Driver: Already processing interrupts! (state = %d) \n",3457 + pHcd->IrqProcState));3458 3461 + status = SDIO_STATUS_ERROR; 3459 3462 + } else { … … 3750 3753 + 3751 3754 +} 3752 Index: linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_bus_misc.c3755 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus_misc.c 3753 3756 =================================================================== 3754 3757 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 3755 +++ linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_bus_misc.c 2008-01-14 13:07:38.000000000 +01003758 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus_misc.c 2008-01-22 13:33:10.000000000 +0100 3756 3759 @@ -0,0 +1,3122 @@ 3757 3760 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 6877 6880 +} 6878 6881 + 6879 Index: linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_bus_os.c6882 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus_os.c 6880 6883 =================================================================== 6881 6884 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 6882 +++ linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_bus_os.c 2008-01-14 13:17:24.000000000 +01006885 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_bus_os.c 2008-01-22 13:33:10.000000000 +0100 6883 6886 @@ -0,0 +1,832 @@ 6884 6887 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 7714 7717 +EXPORT_SYMBOL(SDIO_RegisterFunction); 7715 7718 +EXPORT_SYMBOL(SDIO_UnregisterFunction); 7716 Index: linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_function.c7719 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_function.c 7717 7720 =================================================================== 7718 7721 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 7719 +++ linux-2.6 -openmoko/drivers/sdio/stack/busdriver/sdio_function.c 2008-01-14 13:07:38.000000000 +01007722 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/busdriver/sdio_function.c 2008-01-22 13:33:10.000000000 +0100 7720 7723 @@ -0,0 +1,715 @@ 7721 7724 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 8434 8437 +} 8435 8438 + 8436 Index: linux-2.6 -openmoko/drivers/sdio/stack/lib/Makefile8439 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/Makefile 8437 8440 =================================================================== 8438 8441 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 8439 +++ linux-2.6 -openmoko/drivers/sdio/stack/lib/Makefile 2008-01-14 13:07:38.000000000 +01008442 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/Makefile 2008-01-22 13:33:10.000000000 +0100 8440 8443 @@ -0,0 +1,2 @@ 8441 8444 +obj-$(CONFIG_SDIO) += sdio_lib.o 8442 8445 +sdio_lib-objs := sdio_lib_c.o sdio_lib_os.o 8443 Index: linux-2.6 -openmoko/drivers/sdio/stack/lib/sdio_lib_c.c8446 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/_sdio_lib.h 8444 8447 =================================================================== 8445 8448 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 8446 +++ linux-2.6-openmoko/drivers/sdio/stack/lib/sdio_lib_c.c 2008-01-14 13:07:38.000000000 +0100 8449 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/_sdio_lib.h 2008-01-22 13:33:10.000000000 +0100 8450 @@ -0,0 +1,50 @@ 8451 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8452 +@file: _sdio_lib.h 8453 + 8454 +@abstract: SDIO Lib internal include 8455 + 8456 +#notes: 8457 + 8458 +@notice: Copyright (c), 2004-2006 Atheros Communications, Inc. 8459 + 8460 + 8461 + * 8462 + * This program is free software; you can redistribute it and/or modify 8463 + * it under the terms of the GNU General Public License version 2 as 8464 + * published by the Free Software Foundation; 8465 + * 8466 + * Software distributed under the License is distributed on an "AS 8467 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 8468 + * implied. See the License for the specific language governing 8469 + * rights and limitations under the License. 8470 + * 8471 + * Portions of this code were developed with information supplied from the 8472 + * SD Card Association Simplified Specifications. The following conditions and disclaimers may apply: 8473 + * 8474 + * The following conditions apply to the release of the SD simplified specification (ᅵSimplified 8475 + * Specificationᅵ) by the SD Card Association. The Simplified Specification is a subset of the complete 8476 + * SD Specification which is owned by the SD Card Association. This Simplified Specification is provided 8477 + * on a non-confidential basis subject to the disclaimers below. Any implementation of the Simplified 8478 + * Specification may require a license from the SD Card Association or other third parties. 8479 + * Disclaimers: 8480 + * The information contained in the Simplified Specification is presented only as a standard 8481 + * specification for SD Cards and SD Host/Ancillary products and is provided "AS-IS" without any 8482 + * representations or warranties of any kind. No responsibility is assumed by the SD Card Association for 8483 + * any damages, any infringements of patents or other right of the SD Card Association or any third 8484 + * parties, which may result from its use. No license is granted by implication, estoppel or otherwise 8485 + * under any patent or other rights of the SD Card Association or any third party. Nothing herein shall 8486 + * be construed as an obligation by the SD Card Association to disclose or distribute any technical 8487 + * information, know-how or other confidential information to any third party. 8488 + * 8489 + * 8490 + * The initial developers of the original code are Seung Yi and Paul Lever 8491 + * 8492 + * sdio@atheros.com 8493 + * 8494 + * 8495 + 8496 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 8497 +#ifndef ___SDIO_LIB_H___ 8498 +#define ___SDIO_LIB_H___ 8499 + 8500 +#endif /* ___SDIO_LIB_H___*/ 8501 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/sdio_lib_c.c 8502 =================================================================== 8503 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 8504 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/sdio_lib_c.c 2008-01-22 13:33:10.000000000 +0100 8447 8505 @@ -0,0 +1,908 @@ 8448 8506 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 9354 9412 + 9355 9413 + 9356 Index: linux-2.6 -openmoko/drivers/sdio/stack/lib/_sdio_lib.h9414 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/sdio_lib_os.c 9357 9415 =================================================================== 9358 9416 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 9359 +++ linux-2.6-openmoko/drivers/sdio/stack/lib/_sdio_lib.h 2008-01-14 13:07:38.000000000 +0100 9360 @@ -0,0 +1,50 @@ 9361 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 9362 +@file: _sdio_lib.h 9363 + 9364 +@abstract: SDIO Lib internal include 9365 + 9366 +#notes: 9367 + 9368 +@notice: Copyright (c), 2004-2006 Atheros Communications, Inc. 9369 + 9370 + 9371 + * 9372 + * This program is free software; you can redistribute it and/or modify 9373 + * it under the terms of the GNU General Public License version 2 as 9374 + * published by the Free Software Foundation; 9375 + * 9376 + * Software distributed under the License is distributed on an "AS 9377 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 9378 + * implied. See the License for the specific language governing 9379 + * rights and limitations under the License. 9380 + * 9381 + * Portions of this code were developed with information supplied from the 9382 + * SD Card Association Simplified Specifications. The following conditions and disclaimers may apply: 9383 + * 9384 + * The following conditions apply to the release of the SD simplified specification (ᅵSimplified 9385 + * Specificationᅵ) by the SD Card Association. The Simplified Specification is a subset of the complete 9386 + * SD Specification which is owned by the SD Card Association. This Simplified Specification is provided 9387 + * on a non-confidential basis subject to the disclaimers below. Any implementation of the Simplified 9388 + * Specification may require a license from the SD Card Association or other third parties. 9389 + * Disclaimers: 9390 + * The information contained in the Simplified Specification is presented only as a standard 9391 + * specification for SD Cards and SD Host/Ancillary products and is provided "AS-IS" without any 9392 + * representations or warranties of any kind. No responsibility is assumed by the SD Card Association for 9393 + * any damages, any infringements of patents or other right of the SD Card Association or any third 9394 + * parties, which may result from its use. No license is granted by implication, estoppel or otherwise 9395 + * under any patent or other rights of the SD Card Association or any third party. Nothing herein shall 9396 + * be construed as an obligation by the SD Card Association to disclose or distribute any technical 9397 + * information, know-how or other confidential information to any third party. 9398 + * 9399 + * 9400 + * The initial developers of the original code are Seung Yi and Paul Lever 9401 + * 9402 + * sdio@atheros.com 9403 + * 9404 + * 9405 + 9406 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 9407 +#ifndef ___SDIO_LIB_H___ 9408 +#define ___SDIO_LIB_H___ 9409 + 9410 +#endif /* ___SDIO_LIB_H___*/ 9411 Index: linux-2.6-openmoko/drivers/sdio/stack/lib/sdio_lib_os.c 9412 =================================================================== 9413 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 9414 +++ linux-2.6-openmoko/drivers/sdio/stack/lib/sdio_lib_os.c 2008-01-14 13:07:38.000000000 +0100 9417 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/lib/sdio_lib_os.c 2008-01-22 13:33:10.000000000 +0100 9415 9418 @@ -0,0 +1,251 @@ 9416 9419 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 9665 9668 +EXPORT_SYMBOL(SDLIB_PostMessage); 9666 9669 +EXPORT_SYMBOL(SDLIB_GetMessage); 9667 Index: linux-2.6 -openmoko/drivers/sdio/stack/Makefile9670 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/platform/Makefile 9668 9671 =================================================================== 9669 9672 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 9670 +++ linux-2.6-openmoko/drivers/sdio/stack/Makefile 2008-01-14 13:07:38.000000000 +0100 9671 @@ -0,0 +1 @@ 9672 +obj-$(CONFIG_SDIO) += busdriver/ lib/ 9673 \ No newline at end of file 9674 Index: linux-2.6-openmoko/drivers/sdio/stack/platform/Makefile 9675 =================================================================== 9676 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 9677 +++ linux-2.6-openmoko/drivers/sdio/stack/platform/Makefile 2008-01-14 13:07:38.000000000 +0100 9673 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/platform/Makefile 2008-01-22 13:33:10.000000000 +0100 9678 9674 @@ -0,0 +1,2 @@ 9679 9675 +obj-$(CONFIG_SDIO) += sdio_platform.o 9680 9676 +sdio_platform-objs := sdioplatformdriver.o 9681 9677 \ No newline at end of file 9682 Index: linux-2.6 -openmoko/drivers/sdio/stack/platform/sdioplatformdriver.c9678 Index: linux-2.6.24-rc8-omoko/drivers/sdio/stack/platform/sdioplatformdriver.c 9683 9679 =================================================================== 9684 9680 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 9685 +++ linux-2.6 -openmoko/drivers/sdio/stack/platform/sdioplatformdriver.c 2008-01-14 13:07:38.000000000 +01009681 +++ linux-2.6.24-rc8-omoko/drivers/sdio/stack/platform/sdioplatformdriver.c 2008-01-22 13:33:10.000000000 +0100 9686 9682 @@ -0,0 +1,300 @@ 9687 9683 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 9985 9981 + 9986 9982 + 9987 Index: linux-2.6 -openmoko/include/linux/sdio/ctsystem.h9983 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/_sdio_defs.h 9988 9984 =================================================================== 9989 9985 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 9990 +++ linux-2.6-openmoko/include/linux/sdio/ctsystem.h 2008-01-14 13:07:38.000000000 +0100 9986 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/_sdio_defs.h 2008-01-22 13:33:10.000000000 +0100 9987 @@ -0,0 +1,638 @@ 9988 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 9989 +@file: _sdio_defs.h 9990 + 9991 +@abstract: SD/SDIO definitions 9992 + 9993 +@notice: Copyright (c), 2004-2006 Atheros Communications, Inc. 9994 + 9995 + 9996 + * 9997 + * This program is free software; you can redistribute it and/or modify 9998 + * it under the terms of the GNU General Public License version 2 as 9999 + * published by the Free Software Foundation; 10000 + * 10001 + * Software distributed under the License is distributed on an "AS 10002 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 10003 + * implied. See the License for the specific language governing 10004 + * rights and limitations under the License. 10005 + * 10006 + * Portions of this code were developed with information supplied from the 10007 + * SD Card Association Simplified Specifications. The following conditions and disclaimers may apply: 10008 + * 10009 + * The following conditions apply to the release of the SD simplified specification (ᅵSimplified 10010 + * Specificationᅵ) by the SD Card Association. The Simplified Specification is a subset of the complete 10011 + * SD Specification which is owned by the SD Card Association. This Simplified Specification is provided 10012 + * on a non-confidential basis subject to the disclaimers below. Any implementation of the Simplified 10013 + * Specification may require a license from the SD Card Association or other third parties. 10014 + * Disclaimers: 10015 + * The information contained in the Simplified Specification is presented only as a standard 10016 + * specification for SD Cards and SD Host/Ancillary products and is provided "AS-IS" without any 10017 + * representations or warranties of any kind. No responsibility is assumed by the SD Card Association for 10018 + * any damages, any infringements of patents or other right of the SD Card Association or any third 10019 + * parties, which may result from its use. No license is granted by implication, estoppel or otherwise 10020 + * under any patent or other rights of the SD Card Association or any third party. Nothing herein shall 10021 + * be construed as an obligation by the SD Card Association to disclose or distribute any technical 10022 + * information, know-how or other confidential information to any third party. 10023 + * 10024 + * 10025 + * The initial developers of the original code are Seung Yi and Paul Lever 10026 + * 10027 + * sdio@atheros.com 10028 + * 10029 + * 10030 + 10031 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 10032 +#ifndef ___SDIO_DEFS_H___ 10033 +#define ___SDIO_DEFS_H___ 10034 + 10035 +#define SD_INIT_BUS_CLOCK 100000 /* initialization clock in hz */ 10036 +#define SPI_INIT_BUS_CLOCK 100000 /* initialization clock in hz */ 10037 +#define SD_MAX_BUS_CLOCK 25000000 /* max clock speed in hz */ 10038 +#define SD_HS_MAX_BUS_CLOCK 50000000 /* SD high speed max clock speed in hz */ 10039 +#define SDIO_LOW_SPEED_MAX_BUS_CLOCK 400000 /* max low speed clock in hz */ 10040 +#define SDMMC_MIN_INIT_CLOCKS 80 /* minimun number of initialization clocks */ 10041 +#define SDIO_EMPC_CURRENT_THRESHOLD 300 /* SDIO 1.10 , EMPC (mA) threshold, we add some overhead */ 10042 + 10043 +/* commands */ 10044 +#define CMD0 0 10045 +#define CMD1 1 10046 +#define CMD2 2 10047 +#define CMD3 3 10048 +#define CMD4 4 10049 +#define CMD5 5 10050 +#define CMD6 6 10051 +#define CMD7 7 10052 +#define CMD9 9 10053 +#define CMD10 10 10054 +#define CMD12 12 10055 +#define CMD13 13 10056 +#define CMD15 15 10057 +#define CMD16 16 10058 +#define CMD17 17 10059 +#define CMD18 18 10060 +#define CMD24 24 10061 +#define CMD25 25 10062 +#define CMD27 27 10063 +#define CMD28 28 10064 +#define CMD29 29 10065 +#define CMD30 30 10066 +#define CMD32 32 10067 +#define CMD33 33 10068 +#define CMD38 38 10069 +#define CMD42 42 10070 +#define CMD52 52 10071 +#define CMD53 53 10072 +#define CMD55 55 10073 +#define CMD56 56 10074 +#define CMD58 58 10075 +#define CMD59 59 10076 +#define ACMD6 6 10077 +#define ACMD13 13 10078 +#define ACMD22 22 10079 +#define ACMD23 23 10080 +#define ACMD41 41 10081 +#define ACMD42 42 10082 +#define ACMD51 51 10083 + 10084 +#define SD_ACMD6_BUS_WIDTH_1_BIT 0x00 10085 +#define SD_ACMD6_BUS_WIDTH_4_BIT 0x02 10086 + 10087 +#define SD_CMD59_CRC_OFF 0x00000000 10088 +#define SD_CMD59_CRC_ON 0x00000001 10089 + 10090 +/* SD/SPI max response size */ 10091 +#define SD_MAX_CMD_RESPONSE_BYTES SD_R2_RESPONSE_BYTES 10092 + 10093 +#define SD_R1_RESPONSE_BYTES 6 10094 +#define SD_R1B_RESPONSE_BYTES SD_R1_RESPONSE_BYTES 10095 +#define SD_R1_GET_CMD(pR) ((pR)[5] & 0xC0)) 10096 +#define SD_R1_SET_CMD(pR,cmd) (pR)[5] = (cmd) & 0xC0 10097 +#define SD_R1_GET_CARD_STATUS(pR) (((UINT32)((pR)[1])) | \ 10098 + (((UINT32)((pR)[2])) << 8) | \ 10099 + (((UINT32)((pR)[3])) << 16) | \ 10100 + (((UINT32)((pR)[4])) << 24) ) 10101 +#define SD_R1_SET_CMD_STATUS(pR,status) \ 10102 +{ \ 10103 + (pR)[1] = (UINT8)(status); \ 10104 + (pR)[2] = (UINT8)((status) >> 8); \ 10105 + (pR)[3] = (UINT8)((status) >> 16); \ 10106 + (pR)[4] = (UINT8)((status) >> 24); \ 10107 +} 10108 + 10109 +/* SD R1 card status bit masks */ 10110 +#define SD_CS_CMD_OUT_OF_RANGE ((UINT32)(1 << 31)) 10111 +#define SD_CS_ADDRESS_ERR (1 << 30) 10112 +#define SD_CS_BLK_LEN_ERR (1 << 29) 10113 +#define SD_CS_ERASE_SEQ_ERR (1 << 28) 10114 +#define SD_CS_ERASE_PARAM_ERR (1 << 27) 10115 +#define SD_CS_WP_ERR (1 << 26) 10116 +#define SD_CS_CARD_LOCKED (1 << 25) 10117 +#define SD_CS_LK_UNLK_FAILED (1 << 24) 10118 +#define SD_CS_PREV_CMD_CRC_ERR (1 << 23) 10119 +#define SD_CS_ILLEGAL_CMD_ERR (1 << 22) 10120 +#define SD_CS_ECC_FAILED (1 << 21) 10121 +#define SD_CS_CARD_INTERNAL_ERR (1 << 20) 10122 +#define SD_CS_GENERAL_ERR (1 << 19) 10123 +#define SD_CS_CSD_OVERWR_ERR (1 << 16) 10124 +#define SD_CS_WP_ERASE_SKIP (1 << 15) 10125 +#define SD_CS_ECC_DISABLED (1 << 14) 10126 +#define SD_CS_ERASE_RESET (1 << 13) 10127 +#define SD_CS_GET_STATE(status) (((status) >> 9) & 0x0f) 10128 +#define SD_CS_SET_STATE(status, state) \ 10129 +{ \ 10130 + (status) &= ~(0x0F << 9); \ 10131 + (status) |= (state) << 9 \ 10132 +} 10133 + 10134 +#define SD_CS_TRANSFER_ERRORS \ 10135 + ( SD_CS_ADDRESS_ERR | \ 10136 + SD_CS_BLK_LEN_ERR | \ 10137 + SD_CS_ERASE_SEQ_ERR | \ 10138 + SD_CS_ERASE_PARAM_ERR | \ 10139 + SD_CS_WP_ERR | \ 10140 + SD_CS_ECC_FAILED | \ 10141 + SD_CS_CARD_INTERNAL_ERR | \ 10142 + SD_CS_GENERAL_ERR ) 10143 + 10144 +#define SD_CS_STATE_IDLE 0 10145 +#define SD_CS_STATE_READY 1 10146 +#define SD_CS_STATE_IDENT 2 10147 +#define SD_CS_STATE_STBY 3 10148 +#define SD_CS_STATE_TRANS 4 10149 +#define SD_CS_STATE_DATA 5 10150 +#define SD_CS_STATE_RCV 6 10151 +#define SD_CS_STATE_PRG 7 10152 +#define SD_CS_STATE_DIS 8 10153 +#define SD_CS_READY_FOR_DATA (1 << 8) 10154 +#define SD_CS_APP_CMD (1 << 5) 10155 +#define SD_CS_AKE_SEQ_ERR (1 << 3) 10156 + 10157 +/* SD R2 response */ 10158 +#define SD_R2_RESPONSE_BYTES 17 10159 +#define MAX_CSD_CID_BYTES 16 10160 +#define SD_R2_SET_STUFF_BITS(pR) (pR)[16] = 0x3F 10161 +#define GET_SD_CSD_TRANS_SPEED(pR) (pR)[12] 10162 +#define GET_SD_CID_MANFID(pR) (pR)[15] 10163 +#define GET_SD_CID_PN_1(pR) (pR)[12] 10164 +#define GET_SD_CID_PN_2(pR) (pR)[11] 10165 +#define GET_SD_CID_PN_3(pR) (pR)[10] 10166 +#define GET_SD_CID_PN_4(pR) (pR)[9] 10167 +#define GET_SD_CID_PN_5(pR) (pR)[8] 10168 +#define GET_SD_CID_PN_6(pR) (pR)[7] 10169 + 10170 +#define GET_SD_CID_OEMID(pR) ((((UINT16)(pR)[14]) << 8 )| (UINT16)((pR)[13])) 10171 +#define SDMMC_OCR_VOLTAGE_MASK 0x7FFFFFFF 10172 +/* SD R3 response */ 10173 +#define SD_R3_RESPONSE_BYTES 6 10174 +#define SD_R3_GET_OCR(pR) ((((UINT32)((pR)[1])) | \ 10175 + (((UINT32)((pR)[2])) << 8) | \ 10176 + (((UINT32)((pR)[3])) << 16) | \ 10177 + (((UINT32)((pR)[4])) << 24)) & SDMMC_OCR_VOLTAGE_MASK) 10178 +#define SD_R3_IS_CARD_READY(pR) (((pR)[4] & 0x80) == 0x80) 10179 + 10180 +/* OCR bit definitions */ 10181 +#define SD_OCR_CARD_PWR_UP_STATUS ((UINT32)(1 << 31)) 10182 +#define SD_OCR_3_5_TO_3_6_VDD (1 << 23) 10183 +#define SD_OCR_3_4_TO_3_5_VDD (1 << 22) 10184 +#define SD_OCR_3_3_TO_3_4_VDD (1 << 21) 10185 +#define SD_OCR_3_2_TO_3_3_VDD (1 << 20) 10186 +#define SD_OCR_3_1_TO_3_2_VDD (1 << 19) 10187 +#define SD_OCR_3_0_TO_3_1_VDD (1 << 18) 10188 +#define SD_OCR_2_9_TO_3_0_VDD (1 << 17) 10189 +#define SD_OCR_2_8_TO_2_9_VDD (1 << 16) 10190 +#define SD_OCR_2_7_TO_2_8_VDD (1 << 15) 10191 +#define SD_OCR_2_6_TO_2_7_VDD (1 << 14) 10192 +#define SD_OCR_2_5_TO_2_6_VDD (1 << 13) 10193 +#define SD_OCR_2_4_TO_2_5_VDD (1 << 12) 10194 +#define SD_OCR_2_3_TO_2_4_VDD (1 << 11) 10195 +#define SD_OCR_2_2_TO_2_3_VDD (1 << 10) 10196 +#define SD_OCR_2_1_TO_2_2_VDD (1 << 9) 10197 +#define SD_OCR_2_0_TO_2_1_VDD (1 << 8) 10198 +#define SD_OCR_1_9_TO_2_0_VDD (1 << 7) 10199 +#define SD_OCR_1_8_TO_1_9_VDD (1 << 6) 10200 +#define SD_OCR_1_7_TO_1_8_VDD (1 << 5) 10201 +#define SD_OCR_1_6_TO_1_7_VDD (1 << 4) 10202 + 10203 +/* SD Status data block */ 10204 +#define SD_STATUS_DATA_BYTES 64 10205 +#define SDS_GET_DATA_WIDTH(buffer) ((buffer)[0] & 0xC0) 10206 +#define SDS_BUS_1_BIT 0x00 10207 +#define SDS_BUS_4_BIT 0x80 10208 +#define SDS_GET_SECURE_MODE(buffer) ((buffer)[0] & 0x20) 10209 +#define SDS_CARD_SECURE_MODE 0x20 10210 +#define SDS_GET_CARD_TYPE(buffer) ((buffer)[60] & 0x0F) 10211 +#define SDS_SD_CARD_RW 0x00 10212 +#define SDS_SD_CARD_ROM 0x01 10213 + 10214 +/* SD R6 response */ 10215 +#define SD_R6_RESPONSE_BYTES 6 10216 +#define SD_R6_GET_RCA(pR) ((UINT16)((pR)[3]) | (((UINT16)((pR)[4])) << 8)) 10217 +#define SD_R6_GET_CS(pR) ((UINT16)((pR)[1]) | (((UINT16)((pR)[2])) << 8)) 10218 + 10219 +/* SD Configuration Register (SCR) */ 10220 +#define SD_SCR_BYTES 8 10221 +#define SCR_REV_1_0 0x00 10222 +#define SCR_SD_SPEC_1_00 0x00 10223 +#define SCR_SD_SPEC_1_10 0x01 10224 +#define SCR_BUS_SUPPORTS_1_BIT 0x01 10225 +#define SCR_BUS_SUPPORTS_4_BIT 0x04 10226 +#define SCR_SD_SECURITY_MASK 0x70 10227 +#define SCR_SD_NO_SECURITY 0x00 10228 +#define SCR_SD_SECURITY_1_0 0x10 10229 +#define SCR_SD_SECURITY_2_0 0x20 10230 +#define SCR_DATA_STATUS_1_AFTER_ERASE 0x80 10231 + 10232 +#define GET_SD_SCR_STRUCT_VER(pB) ((pB)[7] >> 4) 10233 +#define GET_SD_SCR_SDSPEC_VER(pB) ((pB)[7] & 0x0F) 10234 +#define GET_SD_SCR_BUSWIDTHS(pB) ((pB)[6] & 0x0F) 10235 +#define GET_SD_SCR_BUSWIDTHS_FLAGS(pB) (pB)[6] 10236 +#define GET_SD_SCR_SECURITY(pB) (((pB)[6] >> 4) & 0x07) 10237 +#define GET_SD_SCR_DATA_STAT_AFTER_ERASE(pB) (((pB)[6] >> 7) & 0x01) 10238 + 10239 +/* SDIO R4 Response */ 10240 +#define SD_SDIO_R4_RESPONSE_BYTES 6 10241 +#define SD_SDIO_R4_GET_OCR(pR) ((UINT32)((pR)[1]) | \ 10242 + (((UINT32)(pR)[2]) << 8) | \ 10243 + (((UINT32)(pR)[3]) << 16)) 10244 +#define SD_SDIO_R4_IS_MEMORY_PRESENT(pR) (((pR)[4] & 0x08) == 0x08) 10245 +#define SD_SDIO_R4_GET_IO_FUNC_COUNT(pR) (((pR)[4] >> 4) & 0x07) 10246 +#define SD_SDIO_R4_IS_CARD_READY(pR) (((pR)[4] & 0x80) == 0x80) 10247 + 10248 +/* SDIO R5 response */ 10249 +#define SD_SDIO_R5_RESPONSE_BYTES 6 10250 +#define SD_SDIO_R5_READ_DATA_OFFSET 1 10251 +#define SD_R5_GET_READ_DATA(pR) (pR)[SD_SDIO_R5_READ_DATA_OFFSET] 10252 +#define SD_R5_RESP_FLAGS_OFFSET 2 10253 +#define SD_R5_GET_RESP_FLAGS(pR) (pR)[SD_R5_RESP_FLAGS_OFFSET] 10254 +#define SD_R5_SET_CMD(pR,cmd) (pR)[5] = (cmd) & 0xC0 10255 +#define SD_R5_RESP_CMD_ERR (1 << 7) /* for previous cmd */ 10256 +#define SD_R5_ILLEGAL_CMD (1 << 6) 10257 +#define SD_R5_GENERAL_ERR (1 << 3) 10258 +#define SD_R5_INVALID_FUNC (1 << 1) 10259 +#define SD_R5_ARG_RANGE_ERR (1 << 0) 10260 +#define SD_R5_CURRENT_CMD_ERRORS (SD_R5_ILLEGAL_CMD | SD_R5_GENERAL_ERR \ 10261 + | SD_R5_INVALID_FUNC | SD_R5_ARG_RANGE_ERR) 10262 +#define SD_R5_ERRORS (SD_R5_CURRENT_CMD_ERRORS) 10263 + 10264 +#define SD_R5_GET_IO_STATE(pR) (((pR)[2] >> 4) & 0x03) 10265 +#define SD_R5_STATE_DIS 0x00 10266 +#define SD_R5_STATE_CMD 0x01 10267 +#define SD_R5_STATE_TRN 0x02 10268 + 10269 +/* SDIO Modified R6 Response */ 10270 +#define SD_SDIO_R6_RESPONSE_BYTES 6 10271 +#define SD_SDIO_R6_GET_RCA(pR) ((UINT16)((pR)[3]) | ((UINT16)((pR)[4]) << 8)) 10272 +#define SD_SDIO_R6_GET_CSTAT(pR)((UINT16)((pR)[1]) | ((UINT16)((pR)[2]) << 8)) 10273 + 10274 +/* SPI mode R1 response */ 10275 +#define SPI_R1_RESPONSE_BYTES 1 10276 +#define GET_SPI_R1_RESP_TOKEN(pR) (pR)[0] 10277 +#define SPI_CS_STATE_IDLE 0x01 10278 +#define SPI_CS_ERASE_RESET (1 << 1) 10279 +#define SPI_CS_ILLEGAL_CMD (1 << 2) 10280 +#define SPI_CS_CMD_CRC_ERR (1 << 3) 10281 +#define SPI_CS_ERASE_SEQ_ERR (1 << 4) 10282 +#define SPI_CS_ADDRESS_ERR (1 << 5) 10283 +#define SPI_CS_PARAM_ERR (1 << 6) 10284 +#define SPI_CS_ERR_MASK 0x7c 10285 + 10286 +/* SPI mode R2 response */ 10287 +#define SPI_R2_RESPONSE_BYTES 2 10288 +#define GET_SPI_R2_RESP_TOKEN(pR) (pR)[1] 10289 +#define GET_SPI_R2_STATUS_TOKEN(pR) (pR)[0] 10290 +/* the first response byte is defined above */ 10291 +/* the second response byte is defined below */ 10292 +#define SPI_CS_CARD_IS_LOCKED (1 << 0) 10293 +#define SPI_CS_LOCK_UNLOCK_FAILED (1 << 1) 10294 +#define SPI_CS_ERROR (1 << 2) 10295 +#define SPI_CS_INTERNAL_ERROR (1 << 3) 10296 +#define SPI_CS_ECC_FAILED (1 << 4) 10297 +#define SPI_CS_WP_VIOLATION (1 << 5) 10298 +#define SPI_CS_ERASE_PARAM_ERR (1 << 6) 10299 +#define SPI_CS_OUT_OF_RANGE (1 << 7) 10300 + 10301 +/* SPI mode R3 response */ 10302 +#define SPI_R3_RESPONSE_BYTES 5 10303 +#define SPI_R3_GET_OCR(pR) ((((UINT32)((pR)[0])) | \ 10304 + (((UINT32)((pR)[1])) << 8) | \ 10305 + (((UINT32)((pR)[2])) << 16) | \ 10306 + (((UINT32)((pR)[3])) << 24)) & SDMMC_OCR_VOLTAGE_MASK) 10307 +#define SPI_R3_IS_CARD_READY(pR) (((pR)[3] & 0x80) == 0x80) 10308 +#define GET_SPI_R3_RESP_TOKEN(pR) (pR)[4] 10309 + 10310 +/* SPI mode SDIO R4 response */ 10311 +#define SPI_SDIO_R4_RESPONSE_BYTES 5 10312 +#define SPI_SDIO_R4_GET_OCR(pR) ((UINT32)((pR)[0]) | \ 10313 + (((UINT32)(pR)[1]) << 8) | \ 10314 + (((UINT32)(pR)[2]) << 16)) 10315 +#define SPI_SDIO_R4_IS_MEMORY_PRESENT(pR) (((pR)[3] & 0x08) == 0x08) 10316 +#define SPI_SDIO_R4_GET_IO_FUNC_COUNT(pR) (((pR)[3] >> 4) & 0x07) 10317 +#define SPI_SDIO_R4_IS_CARD_READY(pR) (((pR)[3] & 0x80) == 0x80) 10318 +#define GET_SPI_SDIO_R4_RESP_TOKEN(pR) (pR)[4] 10319 + 10320 +/* SPI Mode SDIO R5 response */ 10321 +#define SPI_SDIO_R5_RESPONSE_BYTES 2 10322 +#define GET_SPI_SDIO_R5_RESP_TOKEN(pR) (pR)[1] 10323 +#define GET_SPI_SDIO_R5_RESPONSE_RDATA(pR) (pR)[0] 10324 +#define SPI_R5_IDLE_STATE 0x01 10325 +#define SPI_R5_ILLEGAL_CMD (1 << 2) 10326 +#define SPI_R5_CMD_CRC (1 << 3) 10327 +#define SPI_R5_FUNC_ERR (1 << 4) 10328 +#define SPI_R5_PARAM_ERR (1 << 6) 10329 + 10330 +/* SDIO COMMAND 52 Definitions */ 10331 +#define CMD52_READ 0 10332 +#define CMD52_WRITE 1 10333 +#define CMD52_READ_AFTER_WRITE 1 10334 +#define CMD52_NORMAL_WRITE 0 10335 +#define SDIO_SET_CMD52_ARG(arg,rw,func,raw,address,writedata) \ 10336 + (arg) = (((rw) & 1) << 31) | \ 10337 + (((func) & 0x7) << 28) | \ 10338 + (((raw) & 1) << 27) | \ 10339 + (1 << 26) | \ 10340 + (((address) & 0x1FFFF) << 9) | \ 10341 + (1 << 8) | \ 10342 + ((writedata) & 0xFF) 10343 +#define SDIO_SET_CMD52_READ_ARG(arg,func,address) \ 10344 + SDIO_SET_CMD52_ARG(arg,CMD52_READ,(func),0,address,0x00) 10345 +#define SDIO_SET_CMD52_WRITE_ARG(arg,func,address,value) \ 10346 + SDIO_SET_CMD52_ARG(arg,CMD52_WRITE,(func),CMD52_NORMAL_WRITE,address,value) 10347 + 10348 +/* SDIO COMMAND 53 Definitions */ 10349 +#define CMD53_READ 0 10350 +#define CMD53_WRITE 1 10351 +#define CMD53_BLOCK_BASIS 1 10352 +#define CMD53_BYTE_BASIS 0 10353 +#define CMD53_FIXED_ADDRESS 0 10354 +#define CMD53_INCR_ADDRESS 1 10355 +#define SDIO_SET_CMD53_ARG(arg,rw,func,mode,opcode,address,bytes_blocks) \ 10356 + (arg) = (((rw) & 1) << 31) | \ 10357 + (((func) & 0x7) << 28) | \ 10358 + (((mode) & 1) << 27) | \ 10359 + (((opcode) & 1) << 26) | \ 10360 + (((address) & 0x1FFFF) << 9) | \ 10361 + ((bytes_blocks) & 0x1FF) 10362 + 10363 +#define SDIO_MAX_LENGTH_BYTE_BASIS 512 10364 +#define SDIO_MAX_BLOCKS_BLOCK_BASIS 511 10365 +#define SDIO_MAX_BYTES_PER_BLOCK 2048 10366 +#define SDIO_COMMON_AREA_FUNCTION_NUMBER 0 10367 +#define SDIO_FIRST_FUNCTION_NUMBER 1 10368 +#define SDIO_LAST_FUNCTION_NUMBER 7 10369 + 10370 +#define CMD53_CONVERT_BYTE_BASIS_BLK_LENGTH_PARAM(b) (((b) < SDIO_MAX_LENGTH_BYTE_BASIS) ? (b) : 0) 10371 +#define CMD53_CONVERT_BLOCK_BASIS_BLK_COUNT_PARAM(b) (((b) <= SDIO_MAX_BLOCKS_BLOCK_BASIS) ? (b) : 0) 10372 + 10373 + 10374 +/* SDIO COMMON Registers */ 10375 + 10376 +/* revision register */ 10377 +#define CCCR_SDIO_REVISION_REG 0x00 10378 +#define CCCR_REV_MASK 0x0F 10379 +#define CCCR_REV_1_0 0x00 10380 +#define CCCR_REV_1_1 0x01 10381 +#define SDIO_REV_MASK 0xF0 10382 +#define SDIO_REV_1_00 0x00 10383 +#define SDIO_REV_1_10 0x10 10384 +#define SDIO_REV_1_20 0x20 10385 +/* SD physical spec revision */ 10386 +#define SD_SPEC_REVISION_REG 0x01 10387 +#define SD_REV_MASK 0x0F 10388 +#define SD_REV_1_01 0x00 10389 +#define SD_REV_1_10 0x01 10390 +/* I/O Enable */ 10391 +#define SDIO_ENABLE_REG 0x02 10392 +/* I/O Ready */ 10393 +#define SDIO_READY_REG 0x03 10394 +/* Interrupt Enable */ 10395 +#define SDIO_INT_ENABLE_REG 0x04 10396 +#define SDIO_INT_MASTER_ENABLE 0x01 10397 +#define SDIO_INT_ALL_ENABLE 0xFE 10398 +/* Interrupt Pending */ 10399 +#define SDIO_INT_PENDING_REG 0x05 10400 +#define SDIO_INT_PEND_MASK 0xFE 10401 +/* I/O Abort */ 10402 +#define SDIO_IO_ABORT_REG 0x06 10403 +#define SDIO_IO_RESET (1 << 3) 10404 +/* Bus Interface */ 10405 +#define SDIO_BUS_IF_REG 0x07 10406 +#define CARD_DETECT_DISABLE 0x80 10407 +#define SDIO_BUS_WIDTH_1_BIT 0x00 10408 +#define SDIO_BUS_WIDTH_4_BIT 0x02 10409 +/* Card Capabilities */ 10410 +#define SDIO_CARD_CAPS_REG 0x08 10411 +#define SDIO_CAPS_CMD52_WHILE_DATA 0x01 /* card can issue CMD52 while data transfer */ 10412 +#define SDIO_CAPS_MULTI_BLOCK 0x02 /* card supports multi-block data transfers */ 10413 +#define SDIO_CAPS_READ_WAIT 0x04 /* card supports read-wait protocol */ 10414 +#define SDIO_CAPS_SUSPEND_RESUME 0x08 /* card supports I/O function suspend/resume */ 10415 +#define SDIO_CAPS_INT_MULTI_BLK 0x10 /* interrupts between multi-block data capable */ 10416 +#define SDIO_CAPS_ENB_INT_MULTI_BLK 0x20 /* enable ints between muli-block data */ 10417 +#define SDIO_CAPS_LOW_SPEED 0x40 /* low speed card */ 10418 +#define SDIO_CAPS_4BIT_LS 0x80 /* 4 bit low speed card */ 10419 +/* Common CIS pointer */ 10420 +#define SDIO_CMN_CIS_PTR_LOW_REG 0x09 10421 +#define SDIO_CMN_CIS_PTR_MID_REG 0x0a 10422 +#define SDIO_CMN_CIS_PTR_HI_REG 0x0b 10423 +/* Bus suspend */ 10424 +#define SDIO_BUS_SUSPEND_REG 0x0c 10425 +#define SDIO_FUNC_SUSPEND_STATUS_MASK 0x01 /* selected function is suspended */ 10426 +#define SDIO_SUSPEND_FUNCTION 0x02 /* suspend the current selected function */ 10427 +/* Function select (for bus suspension) */ 10428 +#define SDIO_FUNCTION_SELECT_REG 0x0d 10429 +#define SDIO_SUSPEND_FUNCTION_0 0x00 10430 +#define SDIO_SUSPEND_MEMORY_FUNC_MASK 0x08 10431 +/* Function Execution */ 10432 +#define SDIO_FUNCTION_EXEC_REG 0x0e 10433 +#define SDIO_MEMORY_FUNC_EXEC_MASK 0x01 10434 +/* Function Ready */ 10435 +#define SDIO_FUNCTION_READY_REG 0x0f 10436 +#define SDIO_MEMORY_FUNC_BUSY_MASK 0x01 10437 + 10438 +/* power control 1.10 only */ 10439 +#define SDIO_POWER_CONTROL_REG 0x12 10440 +#define SDIO_POWER_CONTROL_SMPC 0x01 10441 +#define SDIO_POWER_CONTROL_EMPC 0x02 10442 + 10443 +/* high speed control , 1.20 only */ 10444 +#define SDIO_HS_CONTROL_REG 0x13 10445 +#define SDIO_HS_CONTROL_SHS 0x01 10446 +#define SDIO_HS_CONTROL_EHS 0x02 10447 + 10448 +/* Function Base Registers */ 10449 +#define xFUNCTION_FBR_OFFSET(funcNo) (0x100*(funcNo)) 10450 +/* offset calculation that does not use multiplication */ 10451 +static INLINE UINT32 CalculateFBROffset(UCHAR FuncNo) { 10452 + UCHAR i = FuncNo; 10453 + UINT32 offset = 0; 10454 + while (i) { 10455 + offset += 0x100; 10456 + i--; 10457 + } 10458 + return offset; 10459 +} 10460 +/* Function info */ 10461 +#define FBR_FUNC_INFO_REG_OFFSET(fbr) ((fbr) + 0x00) 10462 +#define FUNC_INFO_SUPPORTS_CSA_MASK 0x40 10463 +#define FUNC_INFO_ENABLE_CSA 0x80 10464 +#define FUNC_INFO_DEVICE_CODE_MASK 0x0F 10465 +#define FUNC_INFO_DEVICE_CODE_LAST 0x0F 10466 +#define FBR_FUNC_EXT_DEVICE_CODE_OFFSET(fbr) ((fbr) + 0x01) 10467 +/* Function Power selection */ 10468 +#define FBR_FUNC_POWER_SELECT_OFFSET(fbr) ((fbr) + 0x02) 10469 +#define FUNC_POWER_SELECT_SPS 0x01 10470 +#define FUNC_POWER_SELECT_EPS 0x02 10471 +/* Function CIS ptr */ 10472 +#define FBR_FUNC_CIS_LOW_OFFSET(fbr) ((fbr) + 0x09) 10473 +#define FBR_FUNC_CIS_MID_OFFSET(fbr) ((fbr) + 0x0a) 10474 +#define FBR_FUNC_CIS_HI_OFFSET(fbr) ((fbr) + 0x0b) 10475 +/* Function CSA ptr */ 10476 +#define FBR_FUNC_CSA_LOW_OFFSET(fbr) ((fbr) + 0x0c) 10477 +#define FBR_FUNC_CSA_MID_OFFSET(fbr) ((fbr) + 0x0d) 10478 +#define FBR_FUNC_CSA_HI_OFFSET(fbr) ((fbr) + 0x0e) 10479 +/* Function CSA data window */ 10480 +#define FBR_FUNC_CSA_DATA_OFFSET(fbr) ((fbr) + 0x0f) 10481 +/* Function Block Size Control */ 10482 +#define FBR_FUNC_BLK_SIZE_LOW_OFFSET(fbr) ((fbr) + 0x10) 10483 +#define FBR_FUNC_BLK_SIZE_HI_OFFSET(fbr) ((fbr) + 0x11) 10484 +#define SDIO_CIS_AREA_BEGIN 0x00001000 10485 +#define SDIO_CIS_AREA_END 0x00017fff 10486 +/* Tuple definitions */ 10487 +#define CISTPL_NULL 0x00 10488 +#define CISTPL_CHECKSUM 0x10 10489 +#define CISTPL_VERS_1 0x15 10490 +#define CISTPL_ALTSTR 0x16 10491 +#define CISTPL_MANFID 0x20 10492 +#define CISTPL_FUNCID 0x21 10493 +#define CISTPL_FUNCE 0x22 10494 +#define CISTPL_VENDOR 0x91 10495 +#define CISTPL_END 0xff 10496 +#define CISTPL_LINK_END 0xff 10497 + 10498 + 10499 +/* these structures must be packed */ 10500 + 10501 +/* Manufacturer ID tuple */ 10502 +struct SDIO_MANFID_TPL { 10503 + UINT16 ManufacturerCode; /* jedec code */ 10504 + UINT16 ManufacturerInfo; /* manufacturer specific code */ 10505 +}CT_PACK_STRUCT; 10506 + 10507 +/* Function ID Tuple */ 10508 +struct SDIO_FUNC_ID_TPL { 10509 + UINT8 DeviceCode; /* device code */ 10510 + UINT8 InitMask; /* system initialization mask (not used) */ 10511 +}CT_PACK_STRUCT; 10512 + 10513 + /* Extended Function Tuple (Common) */ 10514 +struct SDIO_FUNC_EXT_COMMON_TPL { 10515 + UINT8 Type; /* type */ 10516 + UINT16 Func0_MaxBlockSize; /* max function 0 block transfer size */ 10517 + UINT8 MaxTransSpeed; /* max transfer speed (encoded) */ 10518 +#define TRANSFER_UNIT_MULTIPIER_MASK 0x07 10519 +#define TIME_VALUE_MASK 0x78 10520 +#define TIME_VALUE_SHIFT 3 10521 +}CT_PACK_STRUCT; 10522 + 10523 +/* Extended Function Tuple (Per Function) */ 10524 +struct SDIO_FUNC_EXT_FUNCTION_TPL { 10525 + UINT8 Type; /* type */ 10526 +#define SDIO_FUNC_INFO_WAKEUP_SUPPORT 0x01 10527 + UINT8 FunctionInfo; /* function info */ 10528 + UINT8 SDIORev; /* revision */ 10529 + UINT32 CardPSN; /* product serial number */ 10530 + UINT32 CSASize; /* CSA size */ 10531 + UINT8 CSAProperties; /* CSA properties */ 10532 + UINT16 MaxBlockSize; /* max block size for block transfers */ 10533 + UINT32 FunctionOCR; /* optimal function OCR */ 10534 + UINT8 OpMinPwr; /* operational min power */ 10535 + UINT8 OpAvgPwr; /* operational average power */ 10536 + UINT8 OpMaxPwr; /* operation maximum power */ 10537 + UINT8 SbMinPwr; /* standby minimum power */ 10538 + UINT8 SbAvgPwr; /* standby average power */ 10539 + UINT8 SbMaxPwr; /* standby maximum power */ 10540 + UINT16 MinBandWidth; /* minimum bus bandwidth */ 10541 + UINT16 OptBandWidth; /* optimalbus bandwitdh */ 10542 +}CT_PACK_STRUCT; 10543 + 10544 +struct SDIO_FUNC_EXT_FUNCTION_TPL_1_1 { 10545 + struct SDIO_FUNC_EXT_FUNCTION_TPL CommonInfo; /* from 1.0*/ 10546 + UINT16 EnableTimeOut; /* timeout for enable */ 10547 + UINT16 OperPwrMaxPwr; 10548 + UINT16 OperPwrAvgPwr; 10549 + UINT16 HiPwrMaxPwr; 10550 + UINT16 HiPwrAvgPwr; 10551 + UINT16 LowPwrMaxPwr; 10552 + UINT16 LowPwrAvgPwr; 10553 +}CT_PACK_STRUCT; 10554 + 10555 +static INLINE SDIO_STATUS ConvertCMD52ResponseToSDIOStatus(UINT8 CMD52ResponseFlags) { 10556 + if (!(CMD52ResponseFlags & SD_R5_ERRORS)) { 10557 + return SDIO_STATUS_SUCCESS; 10558 + } 10559 + if (CMD52ResponseFlags & SD_R5_ILLEGAL_CMD) { 10560 + return SDIO_STATUS_DATA_STATE_INVALID; 10561 + } else if (CMD52ResponseFlags & SD_R5_INVALID_FUNC) { 10562 + return SDIO_STATUS_INVALID_FUNC; 10563 + } else if (CMD52ResponseFlags & SD_R5_ARG_RANGE_ERR) { 10564 + return SDIO_STATUS_FUNC_ARG_ERROR; 10565 + } else { 10566 + return SDIO_STATUS_DATA_ERROR_UNKNOWN; 10567 + } 10568 +} 10569 + 10570 +/* CMD6 mode switch definitions */ 10571 + 10572 +#define SD_SWITCH_FUNC_CHECK 0 10573 +#define SD_SWITCH_FUNC_SET ((UINT32)(1 << 31)) 10574 +#define SD_FUNC_NO_SELECT_MASK 0x00FFFFFF 10575 +#define SD_SWITCH_GRP_1 0 10576 +#define SD_SWITCH_GRP_2 1 10577 +#define SD_SWITCH_GRP_3 2 10578 +#define SD_SWITCH_GRP_4 3 10579 +#define SD_SWITCH_GRP_5 4 10580 +#define SD_SWITCH_GRP_6 5 10581 + 10582 +#define SD_SWITCH_HIGH_SPEED_GROUP SD_SWITCH_GRP_1 10583 +#define SD_SWITCH_HIGH_SPEED_FUNC_NO 1 10584 + 10585 +#define SD_SWITCH_MAKE_SHIFT(grp) ((grp) * 4) 10586 + 10587 +#define SD_SWITCH_MAKE_GRP_PATTERN(FuncGrp,FuncNo) \ 10588 + ((SD_FUNC_NO_SELECT_MASK & (~(0xF << SD_SWITCH_MAKE_SHIFT(FuncGrp)))) | \ 10589 + (((FuncNo) & 0xF) << SD_SWITCH_MAKE_SHIFT(FuncGrp))) \ 10590 + 10591 +#define SD_SWITCH_FUNC_ARG_GROUP_CHECK(FuncGrp,FuncNo) \ 10592 + (SD_SWITCH_FUNC_CHECK | SD_SWITCH_MAKE_GRP_PATTERN(FuncGrp,FuncNo)) 10593 + 10594 +#define SD_SWITCH_FUNC_ARG_GROUP_SET(FuncGrp,FuncNo) \ 10595 + (SD_SWITCH_FUNC_SET | SD_SWITCH_MAKE_GRP_PATTERN(FuncGrp,FuncNo)) 10596 + 10597 +#define SD_SWITCH_FUNC_STATUS_BLOCK_BYTES 64 10598 + 10599 +#define SD_SWITCH_FUNC_STATUS_GET_GRP_BIT_MASK(pBuffer,FuncGrp) \ 10600 + (USHORT)((pBuffer)[50 + ((FuncGrp)*2)] | ((pBuffer)[51 + ((FuncGrp)*2)] << 8)) 10601 + 10602 +#define SD_SWITCH_FUNC_STATUS_GET_MAX_CURRENT(pBuffer) \ 10603 + (USHORT)((pBuffer)[62] | ((pBuffer)[63] << 8)) 10604 + 10605 +static INLINE UINT8 SDSwitchGetSwitchResult(PUINT8 pBuffer, UINT8 FuncGrp) 10606 +{ 10607 + switch (FuncGrp) { 10608 + case 0: 10609 + return (pBuffer[47] & 0xF); 10610 + case 1: 10611 + return (pBuffer[47] >> 4); 10612 + case 2: 10613 + return (pBuffer[48] & 0xF); 10614 + case 3: 10615 + return (pBuffer[48] >> 4); 10616 + case 4: 10617 + return (pBuffer[49] & 0xF); 10618 + case 5: 10619 + return (pBuffer[49] >> 4); 10620 + default: 10621 + return 0xF; 10622 + } 10623 +} 10624 + 10625 +#endif 10626 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/ctsystem.h 10627 =================================================================== 10628 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 10629 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/ctsystem.h 2008-01-22 13:33:10.000000000 +0100 9991 10630 @@ -0,0 +1,115 @@ 9992 10631 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 10105 10744 + 10106 10745 +#endif /* __CPSYSTEM_H___ */ 10107 Index: linux-2.6 -openmoko/include/linux/sdio/ctsystem_linux.h10746 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/ctsystem_linux.h 10108 10747 =================================================================== 10109 10748 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 10110 +++ linux-2.6 -openmoko/include/linux/sdio/ctsystem_linux.h 2008-01-14 13:07:38.000000000 +010010749 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/ctsystem_linux.h 2008-01-22 13:33:10.000000000 +0100 10111 10750 @@ -0,0 +1,983 @@ 10112 10751 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 11093 11732 +#endif /* __CPSYSTEM_LINUX_H___ */ 11094 11733 + 11095 Index: linux-2.6 -openmoko/include/linux/sdio/mmc_defs.h11734 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/mmc_defs.h 11096 11735 =================================================================== 11097 11736 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 11098 +++ linux-2.6 -openmoko/include/linux/sdio/mmc_defs.h 2008-01-14 13:07:38.000000000 +010011737 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/mmc_defs.h 2008-01-22 13:33:10.000000000 +0100 11099 11738 @@ -0,0 +1,103 @@ 11100 11739 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 11201 11840 + 11202 11841 +#endif 11203 Index: linux-2.6 -openmoko/include/linux/sdio/sdio_busdriver.h11842 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/sdio_busdriver.h 11204 11843 =================================================================== 11205 11844 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 11206 +++ linux-2.6 -openmoko/include/linux/sdio/sdio_busdriver.h 2008-01-14 13:07:38.000000000 +010011845 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/sdio_busdriver.h 2008-01-22 13:33:10.000000000 +0100 11207 11846 @@ -0,0 +1,1435 @@ 11208 11847 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 12641 13280 +#include "sdio_hcd_defs.h" 12642 13281 +#endif /* __SDIO_BUSDRIVER_H___ */ 12643 Index: linux-2.6 -openmoko/include/linux/sdio/_sdio_defs.h13282 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/sdio_hcd_defs.h 12644 13283 =================================================================== 12645 13284 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 12646 +++ linux-2.6-openmoko/include/linux/sdio/_sdio_defs.h 2008-01-14 13:07:38.000000000 +0100 12647 @@ -0,0 +1,638 @@ 12648 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 12649 +@file: _sdio_defs.h 12650 + 12651 +@abstract: SD/SDIO definitions 12652 + 12653 +@notice: Copyright (c), 2004-2006 Atheros Communications, Inc. 12654 + 12655 + 12656 + * 12657 + * This program is free software; you can redistribute it and/or modify 12658 + * it under the terms of the GNU General Public License version 2 as 12659 + * published by the Free Software Foundation; 12660 + * 12661 + * Software distributed under the License is distributed on an "AS 12662 + * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 12663 + * implied. See the License for the specific language governing 12664 + * rights and limitations under the License. 12665 + * 12666 + * Portions of this code were developed with information supplied from the 12667 + * SD Card Association Simplified Specifications. The following conditions and disclaimers may apply: 12668 + * 12669 + * The following conditions apply to the release of the SD simplified specification (ᅵSimplified 12670 + * Specificationᅵ) by the SD Card Association. The Simplified Specification is a subset of the complete 12671 + * SD Specification which is owned by the SD Card Association. This Simplified Specification is provided 12672 + * on a non-confidential basis subject to the disclaimers below. Any implementation of the Simplified 12673 + * Specification may require a license from the SD Card Association or other third parties. 12674 + * Disclaimers: 12675 + * The information contained in the Simplified Specification is presented only as a standard 12676 + * specification for SD Cards and SD Host/Ancillary products and is provided "AS-IS" without any 12677 + * representations or warranties of any kind. No responsibility is assumed by the SD Card Association for 12678 + * any damages, any infringements of patents or other right of the SD Card Association or any third 12679 + * parties, which may result from its use. No license is granted by implication, estoppel or otherwise 12680 + * under any patent or other rights of the SD Card Association or any third party. Nothing herein shall 12681 + * be construed as an obligation by the SD Card Association to disclose or distribute any technical 12682 + * information, know-how or other confidential information to any third party. 12683 + * 12684 + * 12685 + * The initial developers of the original code are Seung Yi and Paul Lever 12686 + * 12687 + * sdio@atheros.com 12688 + * 12689 + * 12690 + 12691 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 12692 +#ifndef ___SDIO_DEFS_H___ 12693 +#define ___SDIO_DEFS_H___ 12694 + 12695 +#define SD_INIT_BUS_CLOCK 100000 /* initialization clock in hz */ 12696 +#define SPI_INIT_BUS_CLOCK 100000 /* initialization clock in hz */ 12697 +#define SD_MAX_BUS_CLOCK 25000000 /* max clock speed in hz */ 12698 +#define SD_HS_MAX_BUS_CLOCK 50000000 /* SD high speed max clock speed in hz */ 12699 +#define SDIO_LOW_SPEED_MAX_BUS_CLOCK 400000 /* max low speed clock in hz */ 12700 +#define SDMMC_MIN_INIT_CLOCKS 80 /* minimun number of initialization clocks */ 12701 +#define SDIO_EMPC_CURRENT_THRESHOLD 300 /* SDIO 1.10 , EMPC (mA) threshold, we add some overhead */ 12702 + 12703 +/* commands */ 12704 +#define CMD0 0 12705 +#define CMD1 1 12706 +#define CMD2 2 12707 +#define CMD3 3 12708 +#define CMD4 4 12709 +#define CMD5 5 12710 +#define CMD6 6 12711 +#define CMD7 7 12712 +#define CMD9 9 12713 +#define CMD10 10 12714 +#define CMD12 12 12715 +#define CMD13 13 12716 +#define CMD15 15 12717 +#define CMD16 16 12718 +#define CMD17 17 12719 +#define CMD18 18 12720 +#define CMD24 24 12721 +#define CMD25 25 12722 +#define CMD27 27 12723 +#define CMD28 28 12724 +#define CMD29 29 12725 +#define CMD30 30 12726 +#define CMD32 32 12727 +#define CMD33 33 12728 +#define CMD38 38 12729 +#define CMD42 42 12730 +#define CMD52 52 12731 +#define CMD53 53 12732 +#define CMD55 55 12733 +#define CMD56 56 12734 +#define CMD58 58 12735 +#define CMD59 59 12736 +#define ACMD6 6 12737 +#define ACMD13 13 12738 +#define ACMD22 22 12739 +#define ACMD23 23 12740 +#define ACMD41 41 12741 +#define ACMD42 42 12742 +#define ACMD51 51 12743 + 12744 +#define SD_ACMD6_BUS_WIDTH_1_BIT 0x00 12745 +#define SD_ACMD6_BUS_WIDTH_4_BIT 0x02 12746 + 12747 +#define SD_CMD59_CRC_OFF 0x00000000 12748 +#define SD_CMD59_CRC_ON 0x00000001 12749 + 12750 +/* SD/SPI max response size */ 12751 +#define SD_MAX_CMD_RESPONSE_BYTES SD_R2_RESPONSE_BYTES 12752 + 12753 +#define SD_R1_RESPONSE_BYTES 6 12754 +#define SD_R1B_RESPONSE_BYTES SD_R1_RESPONSE_BYTES 12755 +#define SD_R1_GET_CMD(pR) ((pR)[5] & 0xC0)) 12756 +#define SD_R1_SET_CMD(pR,cmd) (pR)[5] = (cmd) & 0xC0 12757 +#define SD_R1_GET_CARD_STATUS(pR) (((UINT32)((pR)[1])) | \ 12758 + (((UINT32)((pR)[2])) << 8) | \ 12759 + (((UINT32)((pR)[3])) << 16) | \ 12760 + (((UINT32)((pR)[4])) << 24) ) 12761 +#define SD_R1_SET_CMD_STATUS(pR,status) \ 12762 +{ \ 12763 + (pR)[1] = (UINT8)(status); \ 12764 + (pR)[2] = (UINT8)((status) >> 8); \ 12765 + (pR)[3] = (UINT8)((status) >> 16); \ 12766 + (pR)[4] = (UINT8)((status) >> 24); \ 12767 +} 12768 + 12769 +/* SD R1 card status bit masks */ 12770 +#define SD_CS_CMD_OUT_OF_RANGE ((UINT32)(1 << 31)) 12771 +#define SD_CS_ADDRESS_ERR (1 << 30) 12772 +#define SD_CS_BLK_LEN_ERR (1 << 29) 12773 +#define SD_CS_ERASE_SEQ_ERR (1 << 28) 12774 +#define SD_CS_ERASE_PARAM_ERR (1 << 27) 12775 +#define SD_CS_WP_ERR (1 << 26) 12776 +#define SD_CS_CARD_LOCKED (1 << 25) 12777 +#define SD_CS_LK_UNLK_FAILED (1 << 24) 12778 +#define SD_CS_PREV_CMD_CRC_ERR (1 << 23) 12779 +#define SD_CS_ILLEGAL_CMD_ERR (1 << 22) 12780 +#define SD_CS_ECC_FAILED (1 << 21) 12781 +#define SD_CS_CARD_INTERNAL_ERR (1 << 20) 12782 +#define SD_CS_GENERAL_ERR (1 << 19) 12783 +#define SD_CS_CSD_OVERWR_ERR (1 << 16) 12784 +#define SD_CS_WP_ERASE_SKIP (1 << 15) 12785 +#define SD_CS_ECC_DISABLED (1 << 14) 12786 +#define SD_CS_ERASE_RESET (1 << 13) 12787 +#define SD_CS_GET_STATE(status) (((status) >> 9) & 0x0f) 12788 +#define SD_CS_SET_STATE(status, state) \ 12789 +{ \ 12790 + (status) &= ~(0x0F << 9); \ 12791 + (status) |= (state) << 9 \ 12792 +} 12793 + 12794 +#define SD_CS_TRANSFER_ERRORS \ 12795 + ( SD_CS_ADDRESS_ERR | \ 12796 + SD_CS_BLK_LEN_ERR | \ 12797 + SD_CS_ERASE_SEQ_ERR | \ 12798 + SD_CS_ERASE_PARAM_ERR | \ 12799 + SD_CS_WP_ERR | \ 12800 + SD_CS_ECC_FAILED | \ 12801 + SD_CS_CARD_INTERNAL_ERR | \ 12802 + SD_CS_GENERAL_ERR ) 12803 + 12804 +#define SD_CS_STATE_IDLE 0 12805 +#define SD_CS_STATE_READY 1 12806 +#define SD_CS_STATE_IDENT 2 12807 +#define SD_CS_STATE_STBY 3 12808 +#define SD_CS_STATE_TRANS 4 12809 +#define SD_CS_STATE_DATA 5 12810 +#define SD_CS_STATE_RCV 6 12811 +#define SD_CS_STATE_PRG 7 12812 +#define SD_CS_STATE_DIS 8 12813 +#define SD_CS_READY_FOR_DATA (1 << 8) 12814 +#define SD_CS_APP_CMD (1 << 5) 12815 +#define SD_CS_AKE_SEQ_ERR (1 << 3) 12816 + 12817 +/* SD R2 response */ 12818 +#define SD_R2_RESPONSE_BYTES 17 12819 +#define MAX_CSD_CID_BYTES 16 12820 +#define SD_R2_SET_STUFF_BITS(pR) (pR)[16] = 0x3F 12821 +#define GET_SD_CSD_TRANS_SPEED(pR) (pR)[12] 12822 +#define GET_SD_CID_MANFID(pR) (pR)[15] 12823 +#define GET_SD_CID_PN_1(pR) (pR)[12] 12824 +#define GET_SD_CID_PN_2(pR) (pR)[11] 12825 +#define GET_SD_CID_PN_3(pR) (pR)[10] 12826 +#define GET_SD_CID_PN_4(pR) (pR)[9] 12827 +#define GET_SD_CID_PN_5(pR) (pR)[8] 12828 +#define GET_SD_CID_PN_6(pR) (pR)[7] 12829 + 12830 +#define GET_SD_CID_OEMID(pR) ((((UINT16)(pR)[14]) << 8 )| (UINT16)((pR)[13])) 12831 +#define SDMMC_OCR_VOLTAGE_MASK 0x7FFFFFFF 12832 +/* SD R3 response */ 12833 +#define SD_R3_RESPONSE_BYTES 6 12834 +#define SD_R3_GET_OCR(pR) ((((UINT32)((pR)[1])) | \ 12835 + (((UINT32)((pR)[2])) << 8) | \ 12836 + (((UINT32)((pR)[3])) << 16) | \ 12837 + (((UINT32)((pR)[4])) << 24)) & SDMMC_OCR_VOLTAGE_MASK) 12838 +#define SD_R3_IS_CARD_READY(pR) (((pR)[4] & 0x80) == 0x80) 12839 + 12840 +/* OCR bit definitions */ 12841 +#define SD_OCR_CARD_PWR_UP_STATUS ((UINT32)(1 << 31)) 12842 +#define SD_OCR_3_5_TO_3_6_VDD (1 << 23) 12843 +#define SD_OCR_3_4_TO_3_5_VDD (1 << 22) 12844 +#define SD_OCR_3_3_TO_3_4_VDD (1 << 21) 12845 +#define SD_OCR_3_2_TO_3_3_VDD (1 << 20) 12846 +#define SD_OCR_3_1_TO_3_2_VDD (1 << 19) 12847 +#define SD_OCR_3_0_TO_3_1_VDD (1 << 18) 12848 +#define SD_OCR_2_9_TO_3_0_VDD (1 << 17) 12849 +#define SD_OCR_2_8_TO_2_9_VDD (1 << 16) 12850 +#define SD_OCR_2_7_TO_2_8_VDD (1 << 15) 12851 +#define SD_OCR_2_6_TO_2_7_VDD (1 << 14) 12852 +#define SD_OCR_2_5_TO_2_6_VDD (1 << 13) 12853 +#define SD_OCR_2_4_TO_2_5_VDD (1 << 12) 12854 +#define SD_OCR_2_3_TO_2_4_VDD (1 << 11) 12855 +#define SD_OCR_2_2_TO_2_3_VDD (1 << 10) 12856 +#define SD_OCR_2_1_TO_2_2_VDD (1 << 9) 12857 +#define SD_OCR_2_0_TO_2_1_VDD (1 << 8) 12858 +#define SD_OCR_1_9_TO_2_0_VDD (1 << 7) 12859 +#define SD_OCR_1_8_TO_1_9_VDD (1 << 6) 12860 +#define SD_OCR_1_7_TO_1_8_VDD (1 << 5) 12861 +#define SD_OCR_1_6_TO_1_7_VDD (1 << 4) 12862 + 12863 +/* SD Status data block */ 12864 +#define SD_STATUS_DATA_BYTES 64 12865 +#define SDS_GET_DATA_WIDTH(buffer) ((buffer)[0] & 0xC0) 12866 +#define SDS_BUS_1_BIT 0x00 12867 +#define SDS_BUS_4_BIT 0x80 12868 +#define SDS_GET_SECURE_MODE(buffer) ((buffer)[0] & 0x20) 12869 +#define SDS_CARD_SECURE_MODE 0x20 12870 +#define SDS_GET_CARD_TYPE(buffer) ((buffer)[60] & 0x0F) 12871 +#define SDS_SD_CARD_RW 0x00 12872 +#define SDS_SD_CARD_ROM 0x01 12873 + 12874 +/* SD R6 response */ 12875 +#define SD_R6_RESPONSE_BYTES 6 12876 +#define SD_R6_GET_RCA(pR) ((UINT16)((pR)[3]) | (((UINT16)((pR)[4])) << 8)) 12877 +#define SD_R6_GET_CS(pR) ((UINT16)((pR)[1]) | (((UINT16)((pR)[2])) << 8)) 12878 + 12879 +/* SD Configuration Register (SCR) */ 12880 +#define SD_SCR_BYTES 8 12881 +#define SCR_REV_1_0 0x00 12882 +#define SCR_SD_SPEC_1_00 0x00 12883 +#define SCR_SD_SPEC_1_10 0x01 12884 +#define SCR_BUS_SUPPORTS_1_BIT 0x01 12885 +#define SCR_BUS_SUPPORTS_4_BIT 0x04 12886 +#define SCR_SD_SECURITY_MASK 0x70 12887 +#define SCR_SD_NO_SECURITY 0x00 12888 +#define SCR_SD_SECURITY_1_0 0x10 12889 +#define SCR_SD_SECURITY_2_0 0x20 12890 +#define SCR_DATA_STATUS_1_AFTER_ERASE 0x80 12891 + 12892 +#define GET_SD_SCR_STRUCT_VER(pB) ((pB)[7] >> 4) 12893 +#define GET_SD_SCR_SDSPEC_VER(pB) ((pB)[7] & 0x0F) 12894 +#define GET_SD_SCR_BUSWIDTHS(pB) ((pB)[6] & 0x0F) 12895 +#define GET_SD_SCR_BUSWIDTHS_FLAGS(pB) (pB)[6] 12896 +#define GET_SD_SCR_SECURITY(pB) (((pB)[6] >> 4) & 0x07) 12897 +#define GET_SD_SCR_DATA_STAT_AFTER_ERASE(pB) (((pB)[6] >> 7) & 0x01) 12898 + 12899 +/* SDIO R4 Response */ 12900 +#define SD_SDIO_R4_RESPONSE_BYTES 6 12901 +#define SD_SDIO_R4_GET_OCR(pR) ((UINT32)((pR)[1]) | \ 12902 + (((UINT32)(pR)[2]) << 8) | \ 12903 + (((UINT32)(pR)[3]) << 16)) 12904 +#define SD_SDIO_R4_IS_MEMORY_PRESENT(pR) (((pR)[4] & 0x08) == 0x08) 12905 +#define SD_SDIO_R4_GET_IO_FUNC_COUNT(pR) (((pR)[4] >> 4) & 0x07) 12906 +#define SD_SDIO_R4_IS_CARD_READY(pR) (((pR)[4] & 0x80) == 0x80) 12907 + 12908 +/* SDIO R5 response */ 12909 +#define SD_SDIO_R5_RESPONSE_BYTES 6 12910 +#define SD_SDIO_R5_READ_DATA_OFFSET 1 12911 +#define SD_R5_GET_READ_DATA(pR) (pR)[SD_SDIO_R5_READ_DATA_OFFSET] 12912 +#define SD_R5_RESP_FLAGS_OFFSET 2 12913 +#define SD_R5_GET_RESP_FLAGS(pR) (pR)[SD_R5_RESP_FLAGS_OFFSET] 12914 +#define SD_R5_SET_CMD(pR,cmd) (pR)[5] = (cmd) & 0xC0 12915 +#define SD_R5_RESP_CMD_ERR (1 << 7) /* for previous cmd */ 12916 +#define SD_R5_ILLEGAL_CMD (1 << 6) 12917 +#define SD_R5_GENERAL_ERR (1 << 3) 12918 +#define SD_R5_INVALID_FUNC (1 << 1) 12919 +#define SD_R5_ARG_RANGE_ERR (1 << 0) 12920 +#define SD_R5_CURRENT_CMD_ERRORS (SD_R5_ILLEGAL_CMD | SD_R5_GENERAL_ERR \ 12921 + | SD_R5_INVALID_FUNC | SD_R5_ARG_RANGE_ERR) 12922 +#define SD_R5_ERRORS (SD_R5_CURRENT_CMD_ERRORS) 12923 + 12924 +#define SD_R5_GET_IO_STATE(pR) (((pR)[2] >> 4) & 0x03) 12925 +#define SD_R5_STATE_DIS 0x00 12926 +#define SD_R5_STATE_CMD 0x01 12927 +#define SD_R5_STATE_TRN 0x02 12928 + 12929 +/* SDIO Modified R6 Response */ 12930 +#define SD_SDIO_R6_RESPONSE_BYTES 6 12931 +#define SD_SDIO_R6_GET_RCA(pR) ((UINT16)((pR)[3]) | ((UINT16)((pR)[4]) << 8)) 12932 +#define SD_SDIO_R6_GET_CSTAT(pR)((UINT16)((pR)[1]) | ((UINT16)((pR)[2]) << 8)) 12933 + 12934 +/* SPI mode R1 response */ 12935 +#define SPI_R1_RESPONSE_BYTES 1 12936 +#define GET_SPI_R1_RESP_TOKEN(pR) (pR)[0] 12937 +#define SPI_CS_STATE_IDLE 0x01 12938 +#define SPI_CS_ERASE_RESET (1 << 1) 12939 +#define SPI_CS_ILLEGAL_CMD (1 << 2) 12940 +#define SPI_CS_CMD_CRC_ERR (1 << 3) 12941 +#define SPI_CS_ERASE_SEQ_ERR (1 << 4) 12942 +#define SPI_CS_ADDRESS_ERR (1 << 5) 12943 +#define SPI_CS_PARAM_ERR (1 << 6) 12944 +#define SPI_CS_ERR_MASK 0x7c 12945 + 12946 +/* SPI mode R2 response */ 12947 +#define SPI_R2_RESPONSE_BYTES 2 12948 +#define GET_SPI_R2_RESP_TOKEN(pR) (pR)[1] 12949 +#define GET_SPI_R2_STATUS_TOKEN(pR) (pR)[0] 12950 +/* the first response byte is defined above */ 12951 +/* the second response byte is defined below */ 12952 +#define SPI_CS_CARD_IS_LOCKED (1 << 0) 12953 +#define SPI_CS_LOCK_UNLOCK_FAILED (1 << 1) 12954 +#define SPI_CS_ERROR (1 << 2) 12955 +#define SPI_CS_INTERNAL_ERROR (1 << 3) 12956 +#define SPI_CS_ECC_FAILED (1 << 4) 12957 +#define SPI_CS_WP_VIOLATION (1 << 5) 12958 +#define SPI_CS_ERASE_PARAM_ERR (1 << 6) 12959 +#define SPI_CS_OUT_OF_RANGE (1 << 7) 12960 + 12961 +/* SPI mode R3 response */ 12962 +#define SPI_R3_RESPONSE_BYTES 5 12963 +#define SPI_R3_GET_OCR(pR) ((((UINT32)((pR)[0])) | \ 12964 + (((UINT32)((pR)[1])) << 8) | \ 12965 + (((UINT32)((pR)[2])) << 16) | \ 12966 + (((UINT32)((pR)[3])) << 24)) & SDMMC_OCR_VOLTAGE_MASK) 12967 +#define SPI_R3_IS_CARD_READY(pR) (((pR)[3] & 0x80) == 0x80) 12968 +#define GET_SPI_R3_RESP_TOKEN(pR) (pR)[4] 12969 + 12970 +/* SPI mode SDIO R4 response */ 12971 +#define SPI_SDIO_R4_RESPONSE_BYTES 5 12972 +#define SPI_SDIO_R4_GET_OCR(pR) ((UINT32)((pR)[0]) | \ 12973 + (((UINT32)(pR)[1]) << 8) | \ 12974 + (((UINT32)(pR)[2]) << 16)) 12975 +#define SPI_SDIO_R4_IS_MEMORY_PRESENT(pR) (((pR)[3] & 0x08) == 0x08) 12976 +#define SPI_SDIO_R4_GET_IO_FUNC_COUNT(pR) (((pR)[3] >> 4) & 0x07) 12977 +#define SPI_SDIO_R4_IS_CARD_READY(pR) (((pR)[3] & 0x80) == 0x80) 12978 +#define GET_SPI_SDIO_R4_RESP_TOKEN(pR) (pR)[4] 12979 + 12980 +/* SPI Mode SDIO R5 response */ 12981 +#define SPI_SDIO_R5_RESPONSE_BYTES 2 12982 +#define GET_SPI_SDIO_R5_RESP_TOKEN(pR) (pR)[1] 12983 +#define GET_SPI_SDIO_R5_RESPONSE_RDATA(pR) (pR)[0] 12984 +#define SPI_R5_IDLE_STATE 0x01 12985 +#define SPI_R5_ILLEGAL_CMD (1 << 2) 12986 +#define SPI_R5_CMD_CRC (1 << 3) 12987 +#define SPI_R5_FUNC_ERR (1 << 4) 12988 +#define SPI_R5_PARAM_ERR (1 << 6) 12989 + 12990 +/* SDIO COMMAND 52 Definitions */ 12991 +#define CMD52_READ 0 12992 +#define CMD52_WRITE 1 12993 +#define CMD52_READ_AFTER_WRITE 1 12994 +#define CMD52_NORMAL_WRITE 0 12995 +#define SDIO_SET_CMD52_ARG(arg,rw,func,raw,address,writedata) \ 12996 + (arg) = (((rw) & 1) << 31) | \ 12997 + (((func) & 0x7) << 28) | \ 12998 + (((raw) & 1) << 27) | \ 12999 + (1 << 26) | \ 13000 + (((address) & 0x1FFFF) << 9) | \ 13001 + (1 << 8) | \ 13002 + ((writedata) & 0xFF) 13003 +#define SDIO_SET_CMD52_READ_ARG(arg,func,address) \ 13004 + SDIO_SET_CMD52_ARG(arg,CMD52_READ,(func),0,address,0x00) 13005 +#define SDIO_SET_CMD52_WRITE_ARG(arg,func,address,value) \ 13006 + SDIO_SET_CMD52_ARG(arg,CMD52_WRITE,(func),CMD52_NORMAL_WRITE,address,value) 13007 + 13008 +/* SDIO COMMAND 53 Definitions */ 13009 +#define CMD53_READ 0 13010 +#define CMD53_WRITE 1 13011 +#define CMD53_BLOCK_BASIS 1 13012 +#define CMD53_BYTE_BASIS 0 13013 +#define CMD53_FIXED_ADDRESS 0 13014 +#define CMD53_INCR_ADDRESS 1 13015 +#define SDIO_SET_CMD53_ARG(arg,rw,func,mode,opcode,address,bytes_blocks) \ 13016 + (arg) = (((rw) & 1) << 31) | \ 13017 + (((func) & 0x7) << 28) | \ 13018 + (((mode) & 1) << 27) | \ 13019 + (((opcode) & 1) << 26) | \ 13020 + (((address) & 0x1FFFF) << 9) | \ 13021 + ((bytes_blocks) & 0x1FF) 13022 + 13023 +#define SDIO_MAX_LENGTH_BYTE_BASIS 512 13024 +#define SDIO_MAX_BLOCKS_BLOCK_BASIS 511 13025 +#define SDIO_MAX_BYTES_PER_BLOCK 2048 13026 +#define SDIO_COMMON_AREA_FUNCTION_NUMBER 0 13027 +#define SDIO_FIRST_FUNCTION_NUMBER 1 13028 +#define SDIO_LAST_FUNCTION_NUMBER 7 13029 + 13030 +#define CMD53_CONVERT_BYTE_BASIS_BLK_LENGTH_PARAM(b) (((b) < SDIO_MAX_LENGTH_BYTE_BASIS) ? (b) : 0) 13031 +#define CMD53_CONVERT_BLOCK_BASIS_BLK_COUNT_PARAM(b) (((b) <= SDIO_MAX_BLOCKS_BLOCK_BASIS) ? (b) : 0) 13032 + 13033 + 13034 +/* SDIO COMMON Registers */ 13035 + 13036 +/* revision register */ 13037 +#define CCCR_SDIO_REVISION_REG 0x00 13038 +#define CCCR_REV_MASK 0x0F 13039 +#define CCCR_REV_1_0 0x00 13040 +#define CCCR_REV_1_1 0x01 13041 +#define SDIO_REV_MASK 0xF0 13042 +#define SDIO_REV_1_00 0x00 13043 +#define SDIO_REV_1_10 0x10 13044 +#define SDIO_REV_1_20 0x20 13045 +/* SD physical spec revision */ 13046 +#define SD_SPEC_REVISION_REG 0x01 13047 +#define SD_REV_MASK 0x0F 13048 +#define SD_REV_1_01 0x00 13049 +#define SD_REV_1_10 0x01 13050 +/* I/O Enable */ 13051 +#define SDIO_ENABLE_REG 0x02 13052 +/* I/O Ready */ 13053 +#define SDIO_READY_REG 0x03 13054 +/* Interrupt Enable */ 13055 +#define SDIO_INT_ENABLE_REG 0x04 13056 +#define SDIO_INT_MASTER_ENABLE 0x01 13057 +#define SDIO_INT_ALL_ENABLE 0xFE 13058 +/* Interrupt Pending */ 13059 +#define SDIO_INT_PENDING_REG 0x05 13060 +#define SDIO_INT_PEND_MASK 0xFE 13061 +/* I/O Abort */ 13062 +#define SDIO_IO_ABORT_REG 0x06 13063 +#define SDIO_IO_RESET (1 << 3) 13064 +/* Bus Interface */ 13065 +#define SDIO_BUS_IF_REG 0x07 13066 +#define CARD_DETECT_DISABLE 0x80 13067 +#define SDIO_BUS_WIDTH_1_BIT 0x00 13068 +#define SDIO_BUS_WIDTH_4_BIT 0x02 13069 +/* Card Capabilities */ 13070 +#define SDIO_CARD_CAPS_REG 0x08 13071 +#define SDIO_CAPS_CMD52_WHILE_DATA 0x01 /* card can issue CMD52 while data transfer */ 13072 +#define SDIO_CAPS_MULTI_BLOCK 0x02 /* card supports multi-block data transfers */ 13073 +#define SDIO_CAPS_READ_WAIT 0x04 /* card supports read-wait protocol */ 13074 +#define SDIO_CAPS_SUSPEND_RESUME 0x08 /* card supports I/O function suspend/resume */ 13075 +#define SDIO_CAPS_INT_MULTI_BLK 0x10 /* interrupts between multi-block data capable */ 13076 +#define SDIO_CAPS_ENB_INT_MULTI_BLK 0x20 /* enable ints between muli-block data */ 13077 +#define SDIO_CAPS_LOW_SPEED 0x40 /* low speed card */ 13078 +#define SDIO_CAPS_4BIT_LS 0x80 /* 4 bit low speed card */ 13079 +/* Common CIS pointer */ 13080 +#define SDIO_CMN_CIS_PTR_LOW_REG 0x09 13081 +#define SDIO_CMN_CIS_PTR_MID_REG 0x0a 13082 +#define SDIO_CMN_CIS_PTR_HI_REG 0x0b 13083 +/* Bus suspend */ 13084 +#define SDIO_BUS_SUSPEND_REG 0x0c 13085 +#define SDIO_FUNC_SUSPEND_STATUS_MASK 0x01 /* selected function is suspended */ 13086 +#define SDIO_SUSPEND_FUNCTION 0x02 /* suspend the current selected function */ 13087 +/* Function select (for bus suspension) */ 13088 +#define SDIO_FUNCTION_SELECT_REG 0x0d 13089 +#define SDIO_SUSPEND_FUNCTION_0 0x00 13090 +#define SDIO_SUSPEND_MEMORY_FUNC_MASK 0x08 13091 +/* Function Execution */ 13092 +#define SDIO_FUNCTION_EXEC_REG 0x0e 13093 +#define SDIO_MEMORY_FUNC_EXEC_MASK 0x01 13094 +/* Function Ready */ 13095 +#define SDIO_FUNCTION_READY_REG 0x0f 13096 +#define SDIO_MEMORY_FUNC_BUSY_MASK 0x01 13097 + 13098 +/* power control 1.10 only */ 13099 +#define SDIO_POWER_CONTROL_REG 0x12 13100 +#define SDIO_POWER_CONTROL_SMPC 0x01 13101 +#define SDIO_POWER_CONTROL_EMPC 0x02 13102 + 13103 +/* high speed control , 1.20 only */ 13104 +#define SDIO_HS_CONTROL_REG 0x13 13105 +#define SDIO_HS_CONTROL_SHS 0x01 13106 +#define SDIO_HS_CONTROL_EHS 0x02 13107 + 13108 +/* Function Base Registers */ 13109 +#define xFUNCTION_FBR_OFFSET(funcNo) (0x100*(funcNo)) 13110 +/* offset calculation that does not use multiplication */ 13111 +static INLINE UINT32 CalculateFBROffset(UCHAR FuncNo) { 13112 + UCHAR i = FuncNo; 13113 + UINT32 offset = 0; 13114 + while (i) { 13115 + offset += 0x100; 13116 + i--; 13117 + } 13118 + return offset; 13119 +} 13120 +/* Function info */ 13121 +#define FBR_FUNC_INFO_REG_OFFSET(fbr) ((fbr) + 0x00) 13122 +#define FUNC_INFO_SUPPORTS_CSA_MASK 0x40 13123 +#define FUNC_INFO_ENABLE_CSA 0x80 13124 +#define FUNC_INFO_DEVICE_CODE_MASK 0x0F 13125 +#define FUNC_INFO_DEVICE_CODE_LAST 0x0F 13126 +#define FBR_FUNC_EXT_DEVICE_CODE_OFFSET(fbr) ((fbr) + 0x01) 13127 +/* Function Power selection */ 13128 +#define FBR_FUNC_POWER_SELECT_OFFSET(fbr) ((fbr) + 0x02) 13129 +#define FUNC_POWER_SELECT_SPS 0x01 13130 +#define FUNC_POWER_SELECT_EPS 0x02 13131 +/* Function CIS ptr */ 13132 +#define FBR_FUNC_CIS_LOW_OFFSET(fbr) ((fbr) + 0x09) 13133 +#define FBR_FUNC_CIS_MID_OFFSET(fbr) ((fbr) + 0x0a) 13134 +#define FBR_FUNC_CIS_HI_OFFSET(fbr) ((fbr) + 0x0b) 13135 +/* Function CSA ptr */ 13136 +#define FBR_FUNC_CSA_LOW_OFFSET(fbr) ((fbr) + 0x0c) 13137 +#define FBR_FUNC_CSA_MID_OFFSET(fbr) ((fbr) + 0x0d) 13138 +#define FBR_FUNC_CSA_HI_OFFSET(fbr) ((fbr) + 0x0e) 13139 +/* Function CSA data window */ 13140 +#define FBR_FUNC_CSA_DATA_OFFSET(fbr) ((fbr) + 0x0f) 13141 +/* Function Block Size Control */ 13142 +#define FBR_FUNC_BLK_SIZE_LOW_OFFSET(fbr) ((fbr) + 0x10) 13143 +#define FBR_FUNC_BLK_SIZE_HI_OFFSET(fbr) ((fbr) + 0x11) 13144 +#define SDIO_CIS_AREA_BEGIN 0x00001000 13145 +#define SDIO_CIS_AREA_END 0x00017fff 13146 +/* Tuple definitions */ 13147 +#define CISTPL_NULL 0x00 13148 +#define CISTPL_CHECKSUM 0x10 13149 +#define CISTPL_VERS_1 0x15 13150 +#define CISTPL_ALTSTR 0x16 13151 +#define CISTPL_MANFID 0x20 13152 +#define CISTPL_FUNCID 0x21 13153 +#define CISTPL_FUNCE 0x22 13154 +#define CISTPL_VENDOR 0x91 13155 +#define CISTPL_END 0xff 13156 +#define CISTPL_LINK_END 0xff 13157 + 13158 + 13159 +/* these structures must be packed */ 13160 + 13161 +/* Manufacturer ID tuple */ 13162 +struct SDIO_MANFID_TPL { 13163 + UINT16 ManufacturerCode; /* jedec code */ 13164 + UINT16 ManufacturerInfo; /* manufacturer specific code */ 13165 +}CT_PACK_STRUCT; 13166 + 13167 +/* Function ID Tuple */ 13168 +struct SDIO_FUNC_ID_TPL { 13169 + UINT8 DeviceCode; /* device code */ 13170 + UINT8 InitMask; /* system initialization mask (not used) */ 13171 +}CT_PACK_STRUCT; 13172 + 13173 + /* Extended Function Tuple (Common) */ 13174 +struct SDIO_FUNC_EXT_COMMON_TPL { 13175 + UINT8 Type; /* type */ 13176 + UINT16 Func0_MaxBlockSize; /* max function 0 block transfer size */ 13177 + UINT8 MaxTransSpeed; /* max transfer speed (encoded) */ 13178 +#define TRANSFER_UNIT_MULTIPIER_MASK 0x07 13179 +#define TIME_VALUE_MASK 0x78 13180 +#define TIME_VALUE_SHIFT 3 13181 +}CT_PACK_STRUCT; 13182 + 13183 +/* Extended Function Tuple (Per Function) */ 13184 +struct SDIO_FUNC_EXT_FUNCTION_TPL { 13185 + UINT8 Type; /* type */ 13186 +#define SDIO_FUNC_INFO_WAKEUP_SUPPORT 0x01 13187 + UINT8 FunctionInfo; /* function info */ 13188 + UINT8 SDIORev; /* revision */ 13189 + UINT32 CardPSN; /* product serial number */ 13190 + UINT32 CSASize; /* CSA size */ 13191 + UINT8 CSAProperties; /* CSA properties */ 13192 + UINT16 MaxBlockSize; /* max block size for block transfers */ 13193 + UINT32 FunctionOCR; /* optimal function OCR */ 13194 + UINT8 OpMinPwr; /* operational min power */ 13195 + UINT8 OpAvgPwr; /* operational average power */ 13196 + UINT8 OpMaxPwr; /* operation maximum power */ 13197 + UINT8 SbMinPwr; /* standby minimum power */ 13198 + UINT8 SbAvgPwr; /* standby average power */ 13199 + UINT8 SbMaxPwr; /* standby maximum power */ 13200 + UINT16 MinBandWidth; /* minimum bus bandwidth */ 13201 + UINT16 OptBandWidth; /* optimalbus bandwitdh */ 13202 +}CT_PACK_STRUCT; 13203 + 13204 +struct SDIO_FUNC_EXT_FUNCTION_TPL_1_1 { 13205 + struct SDIO_FUNC_EXT_FUNCTION_TPL CommonInfo; /* from 1.0*/ 13206 + UINT16 EnableTimeOut; /* timeout for enable */ 13207 + UINT16 OperPwrMaxPwr; 13208 + UINT16 OperPwrAvgPwr; 13209 + UINT16 HiPwrMaxPwr; 13210 + UINT16 HiPwrAvgPwr; 13211 + UINT16 LowPwrMaxPwr; 13212 + UINT16 LowPwrAvgPwr; 13213 +}CT_PACK_STRUCT; 13214 + 13215 +static INLINE SDIO_STATUS ConvertCMD52ResponseToSDIOStatus(UINT8 CMD52ResponseFlags) { 13216 + if (!(CMD52ResponseFlags & SD_R5_ERRORS)) { 13217 + return SDIO_STATUS_SUCCESS; 13218 + } 13219 + if (CMD52ResponseFlags & SD_R5_ILLEGAL_CMD) { 13220 + return SDIO_STATUS_DATA_STATE_INVALID; 13221 + } else if (CMD52ResponseFlags & SD_R5_INVALID_FUNC) { 13222 + return SDIO_STATUS_INVALID_FUNC; 13223 + } else if (CMD52ResponseFlags & SD_R5_ARG_RANGE_ERR) { 13224 + return SDIO_STATUS_FUNC_ARG_ERROR; 13225 + } else { 13226 + return SDIO_STATUS_DATA_ERROR_UNKNOWN; 13227 + } 13228 +} 13229 + 13230 +/* CMD6 mode switch definitions */ 13231 + 13232 +#define SD_SWITCH_FUNC_CHECK 0 13233 +#define SD_SWITCH_FUNC_SET ((UINT32)(1 << 31)) 13234 +#define SD_FUNC_NO_SELECT_MASK 0x00FFFFFF 13235 +#define SD_SWITCH_GRP_1 0 13236 +#define SD_SWITCH_GRP_2 1 13237 +#define SD_SWITCH_GRP_3 2 13238 +#define SD_SWITCH_GRP_4 3 13239 +#define SD_SWITCH_GRP_5 4 13240 +#define SD_SWITCH_GRP_6 5 13241 + 13242 +#define SD_SWITCH_HIGH_SPEED_GROUP SD_SWITCH_GRP_1 13243 +#define SD_SWITCH_HIGH_SPEED_FUNC_NO 1 13244 + 13245 +#define SD_SWITCH_MAKE_SHIFT(grp) ((grp) * 4) 13246 + 13247 +#define SD_SWITCH_MAKE_GRP_PATTERN(FuncGrp,FuncNo) \ 13248 + ((SD_FUNC_NO_SELECT_MASK & (~(0xF << SD_SWITCH_MAKE_SHIFT(FuncGrp)))) | \ 13249 + (((FuncNo) & 0xF) << SD_SWITCH_MAKE_SHIFT(FuncGrp))) \ 13250 + 13251 +#define SD_SWITCH_FUNC_ARG_GROUP_CHECK(FuncGrp,FuncNo) \ 13252 + (SD_SWITCH_FUNC_CHECK | SD_SWITCH_MAKE_GRP_PATTERN(FuncGrp,FuncNo)) 13253 + 13254 +#define SD_SWITCH_FUNC_ARG_GROUP_SET(FuncGrp,FuncNo) \ 13255 + (SD_SWITCH_FUNC_SET | SD_SWITCH_MAKE_GRP_PATTERN(FuncGrp,FuncNo)) 13256 + 13257 +#define SD_SWITCH_FUNC_STATUS_BLOCK_BYTES 64 13258 + 13259 +#define SD_SWITCH_FUNC_STATUS_GET_GRP_BIT_MASK(pBuffer,FuncGrp) \ 13260 + (USHORT)((pBuffer)[50 + ((FuncGrp)*2)] | ((pBuffer)[51 + ((FuncGrp)*2)] << 8)) 13261 + 13262 +#define SD_SWITCH_FUNC_STATUS_GET_MAX_CURRENT(pBuffer) \ 13263 + (USHORT)((pBuffer)[62] | ((pBuffer)[63] << 8)) 13264 + 13265 +static INLINE UINT8 SDSwitchGetSwitchResult(PUINT8 pBuffer, UINT8 FuncGrp) 13266 +{ 13267 + switch (FuncGrp) { 13268 + case 0: 13269 + return (pBuffer[47] & 0xF); 13270 + case 1: 13271 + return (pBuffer[47] >> 4); 13272 + case 2: 13273 + return (pBuffer[48] & 0xF); 13274 + case 3: 13275 + return (pBuffer[48] >> 4); 13276 + case 4: 13277 + return (pBuffer[49] & 0xF); 13278 + case 5: 13279 + return (pBuffer[49] >> 4); 13280 + default: 13281 + return 0xF; 13282 + } 13283 +} 13284 + 13285 +#endif 13286 Index: linux-2.6-openmoko/include/linux/sdio/sdio_hcd_defs.h 13287 =================================================================== 13288 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 13289 +++ linux-2.6-openmoko/include/linux/sdio/sdio_hcd_defs.h 2008-01-14 13:07:38.000000000 +0100 13285 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/sdio_hcd_defs.h 2008-01-22 13:33:10.000000000 +0100 13290 13286 @@ -0,0 +1,219 @@ 13291 13287 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 13508 13504 + 13509 13505 +#endif /* __SDIO_BUSDRIVER_H___ */ 13510 Index: linux-2.6 -openmoko/include/linux/sdio/sdio_lib.h13506 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/sdio_lib.h 13511 13507 =================================================================== 13512 13508 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 13513 +++ linux-2.6 -openmoko/include/linux/sdio/sdio_lib.h 2008-01-14 13:07:38.000000000 +010013509 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/sdio_lib.h 2008-01-22 13:33:10.000000000 +0100 13514 13510 @@ -0,0 +1,270 @@ 13515 13511 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ … … 13783 13779 + 13784 13780 +#endif /* __SDIO_LIB_H___*/ 13785 Index: linux-2.6 -openmoko/include/linux/sdio/sdlist.h13781 Index: linux-2.6.24-rc8-omoko/include/linux/sdio/sdlist.h 13786 13782 =================================================================== 13787 13783 --- /dev/null 1970-01-01 00:00:00.000000000 +0000 13788 +++ linux-2.6 -openmoko/include/linux/sdio/sdlist.h 2008-01-14 13:07:38.000000000 +010013784 +++ linux-2.6.24-rc8-omoko/include/linux/sdio/sdlist.h 2008-01-22 13:33:10.000000000 +0100 13789 13785 @@ -0,0 +1,141 @@ 13790 13786 +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Note: See TracChangeset
for help on using the changeset viewer.
