OLD | NEW |
1 /* structs.h - shared structures | 1 /* structs.h - shared structures |
2 * Copyright (c) 2010, Code Aurora Forum. All rights reserved. | 2 * Copyright (c) 2010, Code Aurora Forum. All rights reserved. |
3 | 3 |
4 * This program is free software; you can redistribute it and/or modify | 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 | 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. | 6 * only version 2 as published by the Free Software Foundation. |
7 | 7 |
8 * This program is distributed in the hope that it will be useful, | 8 * This program is distributed in the hope that it will be useful, |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 * GNU General Public License for more details. | 11 * GNU General Public License for more details. |
12 | 12 |
13 * You should have received a copy of the GNU General Public License | 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 | 14 * along with this program; if not, write to the Free Software |
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
16 * 02110-1301, USA. | 16 * 02110-1301, USA. |
17 */ | 17 */ |
18 | 18 |
19 #ifndef QCUSBNET_STRUCTS_H | 19 #ifndef QCUSBNET_STRUCTS_H |
20 #define QCUSBNET_STRUCTS_H | 20 #define QCUSBNET_STRUCTS_H |
21 | 21 |
22 #include <linux/etherdevice.h> | 22 #include <linux/etherdevice.h> |
23 #include <linux/ethtool.h> | 23 #include <linux/ethtool.h> |
24 #include <linux/mii.h> | 24 #include <linux/mii.h> |
25 #include <linux/usb.h> | 25 #include <linux/usb.h> |
26 #include <linux/version.h> | 26 #include <linux/version.h> |
27 #include <linux/cdev.h> | 27 #include <linux/cdev.h> |
| 28 #include <linux/kobject.h> |
28 #include <linux/kthread.h> | 29 #include <linux/kthread.h> |
29 | 30 |
30 #include <linux/usb/usbnet.h> | 31 #include <linux/usb/usbnet.h> |
31 | 32 |
32 #include <linux/fdtable.h> | 33 #include <linux/fdtable.h> |
33 | 34 |
34 #define DBG(fmt, arg...) \ | 35 #define DBG(fmt, arg...) \ |
35 do { \ | 36 do { \ |
36 if (qcusbnet_debug == 1) \ | 37 if (qcusbnet_debug == 1) \ |
37 printk(KERN_INFO "QCUSBNet2k::%s " fmt, __func__, ##arg); \ | 38 printk(KERN_INFO "QCUSBNet2k::%s " fmt, __func__, ##arg); \ |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 }; | 72 }; |
72 | 73 |
73 enum { | 74 enum { |
74 DOWN_NO_NDIS_CONNECTION = 0, | 75 DOWN_NO_NDIS_CONNECTION = 0, |
75 DOWN_CDC_CONNECTION_SPEED = 1, | 76 DOWN_CDC_CONNECTION_SPEED = 1, |
76 DOWN_DRIVER_SUSPENDED = 2, | 77 DOWN_DRIVER_SUSPENDED = 2, |
77 DOWN_NET_IFACE_STOPPED = 3, | 78 DOWN_NET_IFACE_STOPPED = 3, |
78 }; | 79 }; |
79 | 80 |
80 struct qcusbnet { | 81 struct qcusbnet { |
| 82 struct list_head node; |
| 83 struct kref refcount; |
81 struct usbnet *usbnet; | 84 struct usbnet *usbnet; |
82 struct usb_interface *iface; | 85 struct usb_interface *iface; |
83 int (*open)(struct net_device *); | 86 int (*open)(struct net_device *); |
84 int (*stop)(struct net_device *); | 87 int (*stop)(struct net_device *); |
85 unsigned long down; | 88 unsigned long down; |
86 bool valid; | 89 bool valid; |
| 90 bool dying; |
87 struct qmidev qmi; | 91 struct qmidev qmi; |
88 char meid[14]; | 92 char meid[14]; |
89 struct worker worker; | 93 struct worker worker; |
90 }; | 94 }; |
91 | 95 |
92 #endif /* !QCUSBNET_STRUCTS_H */ | 96 #endif /* !QCUSBNET_STRUCTS_H */ |
OLD | NEW |