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 14 #ifndef __GDM_SDIO_H__ 15 #define __GDM_SDIO_H__ 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; 25 26 u8 *buf; 27 int len; 28 29 void (*callback)(void *cb_data); 30 void *cb_data; 31 }; 32 33 struct tx_cxt { 34 struct list_head free_list; 35 struct list_head sdu_list; 36 struct list_head hci_list; 37 struct timeval sdu_stamp; 38 39 u8 *sdu_buf; 40 41 spinlock_t lock; 42 int can_send; 43 int stop_sdu_tx; 44 }; 45 46 struct sdio_rx { 47 struct list_head list; 48 struct rx_cxt *rx_cxt; 49 50 void (*callback)(void *cb_data, void *data, int len); 51 void *cb_data; 52 }; 53 54 struct rx_cxt { 55 struct list_head free_list; 56 struct list_head req_list; 57 58 u8 *rx_buf; 59 60 spinlock_t lock; 61 }; 62 63 struct sdiowm_dev { 64 struct sdio_func *func; 65 66 struct tx_cxt tx; 67 struct rx_cxt rx; 68 69 struct work_struct ws; 70 }; 71 72 #endif /* __GDM_SDIO_H__ */ 73