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_USB_H__ |
| 15 | #define __GDM72XX_GDM_USB_H__ |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 16 | |
| 17 | #include <linux/types.h> |
| 18 | #include <linux/usb.h> |
| 19 | #include <linux/list.h> |
| 20 | |
Macpaul Lin | 0d66002 | 2012-09-12 17:49:24 +0800 | [diff] [blame] | 21 | #define B_DIFF_DL_DRV (1 << 4) |
| 22 | #define B_DOWNLOAD (1 << 5) |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 23 | #define MAX_NR_SDU_BUF 64 |
| 24 | |
| 25 | struct usb_tx { |
| 26 | struct list_head list; |
| 27 | #if defined(CONFIG_WIMAX_GDM72XX_USB_PM) || defined(CONFIG_WIMAX_GDM72XX_K_MODE) |
| 28 | struct list_head p_list; |
| 29 | #endif |
| 30 | struct tx_cxt *tx_cxt; |
Macpaul Lin | 0d66002 | 2012-09-12 17:49:24 +0800 | [diff] [blame] | 31 | struct urb *urb; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 32 | u8 *buf; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 33 | void (*callback)(void *cb_data); |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 34 | void *cb_data; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | struct tx_cxt { |
| 38 | struct list_head free_list; |
| 39 | struct list_head sdu_list; |
| 40 | struct list_head hci_list; |
| 41 | #if defined(CONFIG_WIMAX_GDM72XX_USB_PM) || defined(CONFIG_WIMAX_GDM72XX_K_MODE) |
| 42 | struct list_head pending_list; |
| 43 | #endif |
Macpaul Lin | 0d66002 | 2012-09-12 17:49:24 +0800 | [diff] [blame] | 44 | spinlock_t lock; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | struct usb_rx { |
| 48 | struct list_head list; |
| 49 | struct rx_cxt *rx_cxt; |
Macpaul Lin | 0d66002 | 2012-09-12 17:49:24 +0800 | [diff] [blame] | 50 | struct urb *urb; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 51 | u8 *buf; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 52 | void (*callback)(void *cb_data, void *data, int len); |
| 53 | void *cb_data; |
| 54 | }; |
| 55 | |
| 56 | struct rx_cxt { |
| 57 | struct list_head free_list; |
| 58 | struct list_head used_list; |
Macpaul Lin | 0d66002 | 2012-09-12 17:49:24 +0800 | [diff] [blame] | 59 | spinlock_t lock; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | struct usbwm_dev { |
| 63 | struct usb_device *usbdev; |
| 64 | #ifdef CONFIG_WIMAX_GDM72XX_USB_PM |
| 65 | struct work_struct pm_ws; |
| 66 | |
| 67 | struct usb_interface *intf; |
| 68 | #endif |
| 69 | #ifdef CONFIG_WIMAX_GDM72XX_K_MODE |
| 70 | int bw_switch; |
| 71 | struct list_head list; |
| 72 | #endif |
Macpaul Lin | 0d66002 | 2012-09-12 17:49:24 +0800 | [diff] [blame] | 73 | struct tx_cxt tx; |
| 74 | struct rx_cxt rx; |
Michalis Pappas | ac1a3bf | 2014-05-09 18:08:28 +0800 | [diff] [blame] | 75 | int padding; |
Sage Ahn | 247e9cf | 2012-05-15 13:20:36 +0900 | [diff] [blame] | 76 | }; |
| 77 | |
Ben Chan | bbd500d | 2014-06-30 22:13:17 -0700 | [diff] [blame] | 78 | #endif /* __GDM72XX_GDM_USB_H__ */ |