OLD | NEW |
(Empty) | |
| 1 /* structs.h - shared structures |
| 2 * Copyright (c) 2010, Code Aurora Forum. All rights reserved. |
| 3 |
| 4 * This program is free software; you can redistribute it and/or modify |
| 5 * it under the terms of the GNU General Public License version 2 and |
| 6 * only version 2 as published by the Free Software Foundation. |
| 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 * You should have received a copy of the GNU General Public License |
| 14 * along with this program; if not, write to the Free Software |
| 15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 16 * 02110-1301, USA. |
| 17 */ |
| 18 |
| 19 #ifndef QCUSBNET_STRUCTS_H |
| 20 #define QCUSBNET_STRUCTS_H |
| 21 |
| 22 #include <linux/etherdevice.h> |
| 23 #include <linux/ethtool.h> |
| 24 #include <linux/mii.h> |
| 25 #include <linux/usb.h> |
| 26 #include <linux/version.h> |
| 27 #include <linux/cdev.h> |
| 28 #include <linux/kthread.h> |
| 29 |
| 30 #include <linux/usb/usbnet.h> |
| 31 |
| 32 #include <linux/fdtable.h> |
| 33 |
| 34 #define DBG(fmt, arg...) \ |
| 35 do { \ |
| 36 if (qcusbnet_debug == 1) \ |
| 37 printk(KERN_INFO "QCUSBNet2k::%s " fmt, __func__, ##arg); \ |
| 38 } while (0) |
| 39 |
| 40 struct qcusbnet; |
| 41 |
| 42 struct urbreq { |
| 43 struct list_head node; |
| 44 struct urb *urb; |
| 45 }; |
| 46 |
| 47 #define DEFAULT_READ_URB_LENGTH 0x1000 |
| 48 |
| 49 struct worker { |
| 50 struct task_struct *thread; |
| 51 struct completion work; |
| 52 struct list_head urbs; |
| 53 spinlock_t urbs_lock; |
| 54 struct urb *active; |
| 55 spinlock_t active_lock; |
| 56 struct usb_interface *iface; |
| 57 }; |
| 58 |
| 59 struct qmidev { |
| 60 dev_t devnum; |
| 61 struct class *devclass; |
| 62 struct cdev cdev; |
| 63 struct urb *readurb; |
| 64 struct urbsetup *readsetup; |
| 65 void *readbuf; |
| 66 struct urb *inturb; |
| 67 void *intbuf; |
| 68 struct list_head clients; |
| 69 spinlock_t clients_lock; |
| 70 atomic_t qmitid; |
| 71 }; |
| 72 |
| 73 enum { |
| 74 DOWN_NO_NDIS_CONNECTION = 0, |
| 75 DOWN_CDC_CONNECTION_SPEED = 1, |
| 76 DOWN_DRIVER_SUSPENDED = 2, |
| 77 DOWN_NET_IFACE_STOPPED = 3, |
| 78 }; |
| 79 |
| 80 struct qcusbnet { |
| 81 struct usbnet *usbnet; |
| 82 struct usb_interface *iface; |
| 83 int (*open)(struct net_device *); |
| 84 int (*stop)(struct net_device *); |
| 85 unsigned long down; |
| 86 bool valid; |
| 87 struct qmidev qmi; |
| 88 char meid[14]; |
| 89 struct worker worker; |
| 90 }; |
| 91 |
| 92 #endif /* !QCUSBNET_STRUCTS_H */ |
OLD | NEW |