blob: 77ad9d686f8e2c7e00704efcaa76d8741a898b9d [file] [log] [blame]
Sage Ahn247e9cf2012-05-15 13:20:36 +09001/*
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 Chanbbd500d2014-06-30 22:13:17 -070014#ifndef __GDM72XX_GDM_SDIO_H__
15#define __GDM72XX_GDM_SDIO_H__
Sage Ahn247e9cf2012-05-15 13:20:36 +090016
17#include <linux/types.h>
18#include <linux/time.h>
19
20#define MAX_NR_SDU_BUF 64
21
22struct sdio_tx {
23 struct list_head list;
24 struct tx_cxt *tx_cxt;
Michalis Pappasac1a3bf2014-05-09 18:08:28 +080025 u8 *buf;
26 int len;
Sage Ahn247e9cf2012-05-15 13:20:36 +090027 void (*callback)(void *cb_data);
28 void *cb_data;
29};
30
31struct 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 Pappasac1a3bf2014-05-09 18:08:28 +080036 u8 *sdu_buf;
37 spinlock_t lock;
38 int can_send;
39 int stop_sdu_tx;
Sage Ahn247e9cf2012-05-15 13:20:36 +090040};
41
42struct sdio_rx {
43 struct list_head list;
44 struct rx_cxt *rx_cxt;
Sage Ahn247e9cf2012-05-15 13:20:36 +090045 void (*callback)(void *cb_data, void *data, int len);
46 void *cb_data;
47};
48
49struct rx_cxt {
50 struct list_head free_list;
51 struct list_head req_list;
Michalis Pappasac1a3bf2014-05-09 18:08:28 +080052 u8 *rx_buf;
53 spinlock_t lock;
Sage Ahn247e9cf2012-05-15 13:20:36 +090054};
55
56struct sdiowm_dev {
57 struct sdio_func *func;
Michalis Pappasac1a3bf2014-05-09 18:08:28 +080058 struct tx_cxt tx;
59 struct rx_cxt rx;
Sage Ahn247e9cf2012-05-15 13:20:36 +090060 struct work_struct ws;
61};
62
Ben Chanbbd500d2014-06-30 22:13:17 -070063#endif /* __GDM72XX_GDM_SDIO_H__ */