4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name Texas Instruments nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 #include <linux/version.h>
44 #include <linux/completion.h>
45 #include <linux/netdevice.h>
46 #include <linux/workqueue.h>
47 #include <mach/gpio.h>
48 #ifdef CONFIG_HAS_WAKELOCK
49 #include <linux/wakelock.h>
53 #include "WlanDrvCommon.h"
56 #include "windows_types.h"
58 #define TIWLAN_DRV_NAME "tiwlan"
59 #define DRIVERWQ_NAME "tiwlan_wq"
60 #define TIWLAN_DRV_IF_NAME TIWLAN_DRV_NAME"%d"
63 #define ti_dprintf(log, fmt, args...) do { \
64 if (log != TIWLAN_LOG_OTHER) { \
65 printk(KERN_INFO fmt, ## args); \
69 #define ti_dprintf(log, fmt, args...)
73 #define ti_nodprintf(log, fmt, args...)
76 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
77 #define NETDEV_SET_PRIVATE(dev, drv) dev->priv = drv
78 #define NETDEV_GET_PRIVATE(dev) dev->priv
80 #define NETDEV_SET_PRIVATE(dev, drv) dev->ml_priv = drv
81 #define NETDEV_GET_PRIVATE(dev) dev->ml_priv
94 * TCmdRespUnion is defined for each OS:
95 * For Linx and WM that defined is empty.
96 * For OSE the new typedef includes all "Done" typedefs in union from EMP code (H files).
106 TWlanDrvIfCommon tCommon; /* The driver object common part */
108 int irq; /* The OS IRQ handle */
109 unsigned long irq_flags; /* The IRQ flags */
110 struct workqueue_struct *tiwlan_wq; /* Work Queue */
111 struct work_struct tWork; /* The OS work handle. */
112 spinlock_t lock; /* The OS spinlock handle. */
113 unsigned long flags; /* For saving the cpu flags during spinlock */
114 TI_HANDLE hPollTimer;/* Polling timer for working without interrupts (debug) */
115 struct net_device_stats stats; /* The driver's statistics for OS reports. */
116 struct sock *wl_sock; /* The OS socket used for sending it the driver events */
117 struct net_device *netdev; /* The OS handle for the driver interface. */
118 int wl_packet; /* Remember to stay awake */
119 int wl_count; /* Wifi wakelock counter */
120 #ifdef CONFIG_HAS_WAKELOCK
121 struct wake_lock wl_wifi; /* Wifi wakelock */
122 struct wake_lock wl_rxwake; /* Wifi rx wakelock */
124 NDIS_HANDLE ConfigHandle;/* Temp - For Windows compatibility */
126 } TWlanDrvIfObj, *TWlanDrvIfObjPtr;
129 #define NETDEV(drv) (((TWlanDrvIfObj*)(drv))->netdev)
131 #endif /* WLAN_DRV_IF_H*/