Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 GCT Semiconductor, Inc. All rights reserved. |
| 3 | * |
| 4 | * This software is licensed under the terms of the GNU General Public |
| 5 | * License version 2, as published by the Free Software Foundation, and |
| 6 | * may be copied, distributed, and modified under those terms. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
Ben Chan | bbd500d | 2014-06-30 22:13:17 -0700 | [diff] [blame] | 14 | #ifndef __GDM72XX_GDM_SDIO_H__ |
| 15 | #define __GDM72XX_GDM_SDIO_H__ |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 16 | |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/time.h> |
| 19 | |
| 20 | #define MAX_NR_SDU_BUF 64 |
| 21 | |
| 22 | struct sdio_tx { |
| 23 | struct list_head list; |
| 24 | struct tx_cxt *tx_cxt; |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 25 | u8 *buf; |
| 26 | int len; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 27 | void (*callback)(void *cb_data); |
| 28 | void *cb_data; |
| 29 | }; |
| 30 | |
| 31 | struct tx_cxt { |
| 32 | struct list_head free_list; |
| 33 | struct list_head sdu_list; |
| 34 | struct list_head hci_list; |
| 35 | struct timeval sdu_stamp; |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 36 | u8 *sdu_buf; |
| 37 | spinlock_t lock; |
| 38 | int can_send; |
| 39 | int stop_sdu_tx; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | struct sdio_rx { |
| 43 | struct list_head list; |
| 44 | struct rx_cxt *rx_cxt; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 45 | void (*callback)(void *cb_data, void *data, int len); |
| 46 | void *cb_data; |
| 47 | }; |
| 48 | |
| 49 | struct rx_cxt { |
| 50 | struct list_head free_list; |
| 51 | struct list_head req_list; |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 52 | u8 *rx_buf; |
| 53 | spinlock_t lock; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | struct sdiowm_dev { |
| 57 | struct sdio_func *func; |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 58 | struct tx_cxt tx; |
| 59 | struct rx_cxt rx; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 60 | struct work_struct ws; |
| 61 | }; |
| 62 | |
Ben Chan | bbd500d | 2014-06-30 22:13:17 -0700 | [diff] [blame] | 63 | #endif /* __GDM72XX_GDM_SDIO_H__ */ |