2 * linux/drivers/mmc/host/sdio_hal.h - Secure Digital Host Controller Interface driver
4 * Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
14 #include <linux/kfifo.h>
15 #include <linux/miscdevice.h>
16 #include <linux/wakelock.h>
17 #include <mach/modem_interface.h>
20 //#define SETUP_PACKET_SIZE (128)
21 #define MAX_RECEIVER_SIZE (8*1024)
23 //#define SETUP_MAGIC 0x1a2b
24 #define DATA_MAGIC 0x3c4d
25 #define ACK_MAGIC 0x5e6f
26 //#define SETUP_ACK_MAGIC 0x789a
27 #define DATA_ACK_MAGIC 0x9abc
28 #define DUMMY_MAGIC 0x5a5a
30 #define CP2AP_NOIRQ 0x0
31 #define CP2AP_FALLING 0x1
32 #define CP2AP_RASING 0x2
34 //#define REMOTE_ALIVE_STATUS 0x1
35 //#define REMOTE_ASSERT_STATUS 0x2
40 TYPE_NAKALL, //if receive this ack , cancel the data you want to resend
54 // data packet type like below
56 struct data_packet_header {
60 struct ack_packet ack;
76 struct list_head frame_list_head;
77 struct mutex list_mutex;
81 struct ipc_transfer_frame {
88 struct list_head link;
94 struct mutex transfer_mutex;
95 struct list_head frame_fifo;
96 struct ipc_transfer_frame* cur_frame_ptr;
101 unsigned long long time;
110 u16 rx_ctl; // gpio control no irq: 0 , falling: 1, rasing: 2
111 u16 rwctrl; /* read write controlled by mux */
112 u16 rx_status; // rx status
113 u32 rx_seqnum; /* received num */
116 struct frame_list tx_free_lst;
117 struct ipc_transfer tx_transfer;
118 struct frame_list rx_free_lst;
119 struct frame_list rx_recv_lst;
120 struct ipc_transfer_frame* rx_curframe;
121 struct ipc_transfer_frame *tx_curframe;
122 wait_queue_head_t wait;
123 wait_queue_head_t rx_read_wait;
124 wait_queue_head_t tx_frame_wait; // tx frame wait
125 struct task_struct *task;
126 struct spi_device *spi;
127 struct miscdevice miscdev;
128 struct wake_lock wake_lock;
129 struct modemsts_chg modemsts;
133 u32 irq_num; /* use for debug cp side irq num */
134 u32 task_count; /* use for debug task run count*/
135 u32 task_status; /* use for debug record the status of task */
137 u32 tx_irqennum; /* use for debug enable gpio num */
138 u32 tx_irqdisnum; /* usefor debug disable gpio num */
140 struct timer_info cp2ap[100];
141 struct timer_info ap_info[100];
147 #endif /* __SDHCI_H */