diff options
author | Daniel Martensson <daniel.martensson@stericsson.com> | 2011-10-13 07:29:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-19 03:25:41 -0400 |
commit | 687b13e98addc99644002703944ec89e94287cb6 (patch) | |
tree | 79ef989f2c8bc701edd31969751577ad81852193 /include/net | |
parent | 73033c987a8bd0b080509063bb7c130b8941ad73 (diff) |
caif-hsi: Making read and writes asynchronous.
Some platforms do not allow to put HSI block into low-power
mode when FIFO is not empty. The patch flushes (by reading)
FIFO at wake down sequence. Asynchronous read and write is
implemented for that. As a side effect this will also greatly
improve performance.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/caif/caif_hsi.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h index c5dedd87b4cb..17dff451efe3 100644 --- a/include/net/caif/caif_hsi.h +++ b/include/net/caif/caif_hsi.h | |||
@@ -75,18 +75,21 @@ struct cfhsi_desc { | |||
75 | #define CFHSI_WAKE_UP_ACK 1 | 75 | #define CFHSI_WAKE_UP_ACK 1 |
76 | #define CFHSI_WAKE_DOWN_ACK 2 | 76 | #define CFHSI_WAKE_DOWN_ACK 2 |
77 | #define CFHSI_AWAKE 3 | 77 | #define CFHSI_AWAKE 3 |
78 | #define CFHSI_PENDING_RX 4 | 78 | #define CFHSI_WAKELOCK_HELD 4 |
79 | #define CFHSI_SHUTDOWN 6 | 79 | #define CFHSI_SHUTDOWN 5 |
80 | #define CFHSI_FLUSH_FIFO 7 | 80 | #define CFHSI_FLUSH_FIFO 6 |
81 | 81 | ||
82 | #ifndef CFHSI_INACTIVITY_TOUT | 82 | #ifndef CFHSI_INACTIVITY_TOUT |
83 | #define CFHSI_INACTIVITY_TOUT (1 * HZ) | 83 | #define CFHSI_INACTIVITY_TOUT (1 * HZ) |
84 | #endif /* CFHSI_INACTIVITY_TOUT */ | 84 | #endif /* CFHSI_INACTIVITY_TOUT */ |
85 | 85 | ||
86 | #ifndef CFHSI_WAKEUP_TOUT | 86 | #ifndef CFHSI_WAKE_TOUT |
87 | #define CFHSI_WAKEUP_TOUT (3 * HZ) | 87 | #define CFHSI_WAKE_TOUT (3 * HZ) |
88 | #endif /* CFHSI_WAKEUP_TOUT */ | 88 | #endif /* CFHSI_WAKE_TOUT */ |
89 | 89 | ||
90 | #ifndef CFHSI_MAX_RX_RETRIES | ||
91 | #define CFHSI_MAX_RX_RETRIES (10 * HZ) | ||
92 | #endif | ||
90 | 93 | ||
91 | /* Structure implemented by the CAIF HSI driver. */ | 94 | /* Structure implemented by the CAIF HSI driver. */ |
92 | struct cfhsi_drv { | 95 | struct cfhsi_drv { |
@@ -109,6 +112,15 @@ struct cfhsi_dev { | |||
109 | struct cfhsi_drv *drv; | 112 | struct cfhsi_drv *drv; |
110 | }; | 113 | }; |
111 | 114 | ||
115 | /* Structure holds status of received CAIF frames processing */ | ||
116 | struct cfhsi_rx_state { | ||
117 | int state; | ||
118 | int nfrms; | ||
119 | int pld_len; | ||
120 | int retries; | ||
121 | bool piggy_desc; | ||
122 | }; | ||
123 | |||
112 | /* Structure implemented by CAIF HSI drivers. */ | 124 | /* Structure implemented by CAIF HSI drivers. */ |
113 | struct cfhsi { | 125 | struct cfhsi { |
114 | struct caif_dev_common cfdev; | 126 | struct caif_dev_common cfdev; |
@@ -118,7 +130,7 @@ struct cfhsi { | |||
118 | struct cfhsi_drv drv; | 130 | struct cfhsi_drv drv; |
119 | struct cfhsi_dev *dev; | 131 | struct cfhsi_dev *dev; |
120 | int tx_state; | 132 | int tx_state; |
121 | int rx_state; | 133 | struct cfhsi_rx_state rx_state; |
122 | int rx_len; | 134 | int rx_len; |
123 | u8 *rx_ptr; | 135 | u8 *rx_ptr; |
124 | u8 *tx_buf; | 136 | u8 *tx_buf; |
@@ -130,13 +142,12 @@ struct cfhsi { | |||
130 | struct list_head list; | 142 | struct list_head list; |
131 | struct work_struct wake_up_work; | 143 | struct work_struct wake_up_work; |
132 | struct work_struct wake_down_work; | 144 | struct work_struct wake_down_work; |
133 | struct work_struct rx_done_work; | ||
134 | struct work_struct tx_done_work; | ||
135 | struct workqueue_struct *wq; | 145 | struct workqueue_struct *wq; |
136 | wait_queue_head_t wake_up_wait; | 146 | wait_queue_head_t wake_up_wait; |
137 | wait_queue_head_t wake_down_wait; | 147 | wait_queue_head_t wake_down_wait; |
138 | wait_queue_head_t flush_fifo_wait; | 148 | wait_queue_head_t flush_fifo_wait; |
139 | struct timer_list timer; | 149 | struct timer_list timer; |
150 | struct timer_list rx_slowpath_timer; | ||
140 | unsigned long bits; | 151 | unsigned long bits; |
141 | }; | 152 | }; |
142 | 153 | ||