2 * @file: hif_internal.h
4 * @abstract: internal header file for hif layer
6 * @notice: Copyright (c) 2004-2006 Atheros Communications Inc.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation;
13 * Software distributed under the License is distributed on an "AS
14 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
15 * implied. See the License for the specific language governing
16 * rights and limitations under the License.
22 #include <linux/sdio/ctsystem.h>
23 #include <linux/sdio/sdio_busdriver.h>
24 #include <linux/sdio/_sdio_defs.h>
25 #include <linux/sdio/sdio_lib.h>
32 #define MANUFACTURER_ID_AR6001_BASE 0x100
33 #define MANUFACTURER_ID_AR6002_BASE 0x200
34 #define FUNCTION_CLASS 0x0
35 #define MANUFACTURER_CODE 0x271
37 #define BUS_REQUEST_MAX_NUM 64
39 #define SDIO_CLOCK_FREQUENCY_DEFAULT 25000000
40 #define SDWLAN_ENABLE_DISABLE_TIMEOUT 20
41 #define FLAGS_CARD_ENAB 0x02
42 #define FLAGS_CARD_IRQ_UNMSK 0x04
44 #define HIF_MBOX_BLOCK_SIZE 128
45 #define HIF_MBOX_BASE_ADDR 0x800
46 #define HIF_MBOX_WIDTH 0x800
47 #define HIF_MBOX0_BLOCK_SIZE 1
48 #define HIF_MBOX1_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
49 #define HIF_MBOX2_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
50 #define HIF_MBOX3_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
52 #define HIF_MBOX_START_ADDR(mbox) \
53 HIF_MBOX_BASE_ADDR + mbox * HIF_MBOX_WIDTH
55 #define HIF_MBOX_END_ADDR(mbox) \
56 HIF_MBOX_START_ADDR(mbox) + HIF_MBOX_WIDTH - 1
61 OSKERNEL_HELPER insert_helper
;
65 typedef struct target_function_context
{
66 SDFUNCTION function
; /* function description of the bus driver */
67 OS_SEMAPHORE instanceSem
; /* instance lock. Unused */
68 SDLIST instanceList
; /* list of instances. Unused */
69 } TARGET_FUNCTION_CONTEXT
;
71 typedef struct bus_request
{
72 struct bus_request
*next
;
78 hifDeviceInserted(SDFUNCTION
*function
, SDDEVICE
*device
);
81 hifDeviceRemoved(SDFUNCTION
*function
, SDDEVICE
*device
);
84 hifAllocateDeviceRequest(SDDEVICE
*device
);
87 hifFreeDeviceRequest(SDREQUEST
*request
);
90 hifRWCompletionHandler(SDREQUEST
*request
);
93 hifIRQHandler(void *context
);
96 addHifDevice(SDDEVICE
*handle
);
99 getHifDevice(SDDEVICE
*handle
);
102 delHifDevice(SDDEVICE
*handle
);