linux/drivers/staging/gdm72xx/gdm_sdio.h
<<
>>
Prefs
   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
  22struct sdio_tx {
  23        struct list_head        list;
  24        struct tx_cxt           *tx_cxt;
  25        u8                      *buf;
  26        int                     len;
  27        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;
  36        u8                      *sdu_buf;
  37        spinlock_t              lock;
  38        int                     can_send;
  39        int                     stop_sdu_tx;
  40};
  41
  42struct sdio_rx {
  43        struct list_head        list;
  44        struct rx_cxt           *rx_cxt;
  45        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;
  52        u8                      *rx_buf;
  53        spinlock_t              lock;
  54};
  55
  56struct sdiowm_dev {
  57        struct sdio_func        *func;
  58        struct tx_cxt           tx;
  59        struct rx_cxt           rx;
  60        struct work_struct      ws;
  61};
  62
  63#endif /* __GDM_SDIO_H__ */
  64