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/80211core/pub_usb.h | |
parent | e543c241412f5f68d6948968f1a6c2cbb5fad7ff (diff) | |
download | op-kernel-dev-4bd43f507c7e2f225f58235226a8381fd6bbff1a.zip op-kernel-dev-4bd43f507c7e2f225f58235226a8381fd6bbff1a.tar.gz |
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/80211core/pub_usb.h')
-rw-r--r-- | drivers/staging/otus/80211core/pub_usb.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/drivers/staging/otus/80211core/pub_usb.h b/drivers/staging/otus/80211core/pub_usb.h new file mode 100644 index 0000000..c4b4bd2 --- /dev/null +++ b/drivers/staging/otus/80211core/pub_usb.h @@ -0,0 +1,102 @@ +/* + * 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. + */ + +#ifndef _PUB_USB_H +#define _PUB_USB_H + +#include "../oal_dt.h" + +#define ZM_HAL_80211_MODE_AP 0 +#define ZM_HAL_80211_MODE_STA 1 +#define ZM_HAL_80211_MODE_IBSS_GENERAL 2 +#define ZM_HAL_80211_MODE_IBSS_WPA2PSK 3 + +/* USB module description */ +/* Queue Management */ +/* 80211core requires OAL to implement a transmission queue in OAL's */ +/* USB module. Because there is only limited on-chip memory, so USB */ +/* data transfer may be pending until on-chip memory is available. */ +/* 80211core also requires OAL's USB module to provide two functions */ +/* zfwUsbGetFreeTxQSize() and zfwUsbGetMaxTxQSize() for 80211core to */ +/* query the status of this transmission queue. The main purpose of */ +/* this queue is for QoS/WMM. Though there are hardware priority */ +/* queues on the chip, and also software priority queues in the */ +/* 80211core. There is still one and only one USB channel. So */ +/* 80211core will use the information that zfwUsbGetFreeTxQSize() */ +/* returned to schedule the traffic from the software priority */ +/* queues to the hardware priority queues. For example, if 80211core */ +/* found that USB transmission queue is going to be full, it will */ +/* not allow packets with lower priority to enter the USB channel. */ + + +/* Structure for USB call back functions */ +struct zfCbUsbFuncTbl { + void (*zfcbUsbRecv)(zdev_t *dev, zbuf_t *buf); + void (*zfcbUsbRegIn)(zdev_t* dev, u32_t* rsp, u16_t rspLen); + void (*zfcbUsbOutComplete)(zdev_t* dev, zbuf_t *buf, u8_t status, u8_t *hdr); + void (*zfcbUsbRegOutComplete)(zdev_t* dev); +}; + +/* Call back functions */ +/* Below are the functions that should be called by the OAL */ + +/* When data is available in endpoint 3, OAL shall embed the data in */ +/* zbuf_t and supply to 80211core by calling this function */ +/* void (*zfcbUsbRecv)(zdev_t *dev, zbuf_t *buf); */ + +/* When data is available in endpoint 2, OAL shall call this function */ +/* void (*zfcbUsbRegIn)(zdev_t* dev, u32_t* rsp, u16_t rspLen); */ + +/* When USB data transfer completed in endpoint 1, OAL shall call this function */ +/* void (*zfcbUsbOutComplete)(zdev_t* dev, zbuf_t *buf, u8_t status, u8_t *hdr); */ + + +/* Call out functions */ +/* Below are the functions that supply by the OAL for 80211core to */ +/* manipulate the USB */ + +/* Return OAL's USB TxQ size */ +extern u32_t zfwUsbGetMaxTxQSize(zdev_t* dev); + +/* Return OAL's TxQ available size */ +extern u32_t zfwUsbGetFreeTxQSize(zdev_t* dev); + +/* Register call back function */ +extern void zfwUsbRegisterCallBack(zdev_t* dev, struct zfCbUsbFuncTbl *zfUsbFunc); + +/* Enable USB interrupt endpoint */ +extern u32_t zfwUsbEnableIntEpt(zdev_t *dev, u8_t endpt); + +/* Enable USB Rx endpoint */ +extern int zfwUsbEnableRxEpt(zdev_t* dev, u8_t endpt); + +/* 80211core call this function to send a USB request over endpoint 0 */ +extern u32_t zfwUsbSubmitControl(zdev_t* dev, u8_t req, u16_t value, + u16_t index, void *data, u32_t size); +extern u32_t zfwUsbSubmitControlIo(zdev_t* dev, u8_t req, u8_t reqtype, + u16_t value, u16_t index, void *data, u32_t size); + +/* 80211core call this function to transfer data out over endpoint 1 */ +extern void zfwUsbCmd(zdev_t* dev, u8_t endpt, u32_t* cmd, u16_t cmdLen); + +/* 80211core call this function to transfer data out over endpoint 4 */ +extern u32_t zfwUsbSend(zdev_t* dev, u8_t endpt, u8_t *hdr, u16_t hdrlen, u8_t *snap, u16_t snapLen, + u8_t *tail, u16_t tailLen, zbuf_t *buf, u16_t offset); + +/* 80211core call this function to set USB configuration */ +extern u32_t zfwUsbSetConfiguration(zdev_t *dev, u16_t value); + +#endif |