diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2008-10-27 22:44:22 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 13:52:10 -0800 |
commit | 4bd43f507c7e2f225f58235226a8381fd6bbff1a (patch) | |
tree | a603a8ecc7fbb98ad06a1eda170532f301df01b3 /drivers/staging/otus/wrap_mis.c | |
parent | e543c241412f5f68d6948968f1a6c2cbb5fad7ff (diff) |
Staging: add otus Atheros wireless network driver
Initial dump of the otus USB wireless network driver.
It builds properly, but a lot of work needs to be done cleaning
it up before it can be merged into the wireless driver tree.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/otus/wrap_mis.c')
-rw-r--r-- | drivers/staging/otus/wrap_mis.c | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/drivers/staging/otus/wrap_mis.c b/drivers/staging/otus/wrap_mis.c new file mode 100644 index 00000000000..18adf393a68 --- /dev/null +++ b/drivers/staging/otus/wrap_mis.c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2007-2008 Atheros Communications Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +/* */ +/* Module Name : wrap_mis.c */ +/* */ +/* Abstract */ +/* This module contains wrapper functions for misc functions */ +/* */ +/* NOTES */ +/* Platform dependent. */ +/* */ +/************************************************************************/ + +#include "oal_dt.h" +#include "usbdrv.h" + +#include <linux/netlink.h> + +#if WIRELESS_EXT > 12 +#include <net/iw_handler.h> +#endif + +//extern struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER]; +extern struct zsVapStruct vap[ZM_VAP_PORT_NUMBER]; +extern u16_t zfLnxGetVapId(zdev_t* dev); + +/* Simply return 0xffff if VAP function is not supported */ +u16_t zfwGetVapId(zdev_t* dev) +{ + return zfLnxGetVapId(dev); +} + +void zfwSleep(zdev_t* dev, u32_t ms) +{ + if (in_interrupt() == 0) + { + mdelay(ms); + } + else + { + int ii; + int iter = 100000 * ms; + + for (ii = 0; ii < iter; ii++) + { + + } + } +} + +#ifdef ZM_HALPLUS_LOCK +asmlinkage struct zsWlanDev *zfwGetWlanDev(zdev_t* dev) +{ + return ((struct zsWlanDev*)(((struct usbdrv_private*)dev->priv)->wd)); +} + +asmlinkage void zfwEnterCriticalSection(zdev_t* dev) +{ + spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), + (((struct usbdrv_private *)(dev->priv))->hal_irqFlag)); +} + +asmlinkage void zfwLeaveCriticalSection(zdev_t* dev) +{ + spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), + (((struct usbdrv_private *)(dev->priv))->hal_irqFlag)); +} + +asmlinkage u8_t zfwBufReadByte(zdev_t* dev, zbuf_t* buf, u16_t offset) +{ + return *(u8_t*)((u8_t*)buf->data+offset); +} + +asmlinkage u16_t zfwBufReadHalfWord(zdev_t* dev, zbuf_t* buf, u16_t offset) +{ + return zmw_cpu_to_le16(*(u16_t*)((u8_t*)buf->data+offset)); +} + +asmlinkage void zfwBufWriteByte(zdev_t* dev, zbuf_t* buf, u16_t offset, u8_t value) +{ + *(u8_t*)((u8_t*)buf->data+offset) = value; +} + +asmlinkage void zfwBufWriteHalfWord(zdev_t* dev, zbuf_t* buf, u16_t offset, u16_t value) +{ + *(u16_t*)((u8_t*)buf->data+offset) = zmw_cpu_to_le16(value); +} + +asmlinkage u8_t *zfwGetBuffer(zdev_t* dev, zbuf_t* buf) +{ + return (u8_t*)(buf->data); +} +#endif + +/* Leave an empty line below to remove warning message on some compiler */ |