You need to sign in or sign up before continuing.
提交 6445ced8 编写于 作者: L Linus Torvalds

Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (961 commits)
  staging: hv: fix memory leaks
  staging: hv: Remove NULL check before kfree
  Staging: hv: Get rid of vmbus_child_dev_add()
  Staging: hv: Change the signature for vmbus_child_device_register()
  Staging: hv: Get rid of vmbus_cleanup() function
  Staging: hv: Get rid of vmbus_dev_rm() function
  Staging: hv: Change the signature for vmbus_on_isr()
  Staging: hv: Eliminate vmbus_event_dpc()
  Staging: hv: Get rid of the function vmbus_msg_dpc()
  Staging: hv: Change the signature for vmbus_cleanup()
  Staging: hv: Simplify root device management
  staging: rtl8192e: Don't copy dev pointer to skb
  staging: rtl8192e: Pass priv to cmdpkt functions
  staging: rtl8192e: Pass priv to firmware download functions
  staging: rtl8192e: Pass priv to rtl8192_interrupt
  staging: rtl8192e: Pass rtl8192_priv to dm functions
  staging: rtl8192e: Pass ieee80211_device to callbacks
  staging: rtl8192e: Pass ieee80211_device to callbacks
  staging: rtl8192e: Pass ieee80211_device to callbacks
  staging: rtl8192e: Pass ieee80211_device to callbacks
  ...
...@@ -3613,12 +3613,6 @@ W: http://lse.sourceforge.net/kdump/ ...@@ -3613,12 +3613,6 @@ W: http://lse.sourceforge.net/kdump/
S: Maintained S: Maintained
F: Documentation/kdump/ F: Documentation/kdump/
KERNEL AUTOMOUNTER (AUTOFS)
M: "H. Peter Anvin" <hpa@zytor.com>
L: autofs@linux.kernel.org
S: Obsolete
F: drivers/staging/autofs/
KERNEL AUTOMOUNTER v4 (AUTOFS4) KERNEL AUTOMOUNTER v4 (AUTOFS4)
M: Ian Kent <raven@themaw.net> M: Ian Kent <raven@themaw.net>
L: autofs@linux.kernel.org L: autofs@linux.kernel.org
......
...@@ -219,4 +219,14 @@ config BT_ATH3K ...@@ -219,4 +219,14 @@ config BT_ATH3K
Say Y here to compile support for "Atheros firmware download driver" Say Y here to compile support for "Atheros firmware download driver"
into the kernel or say M to compile it as module (ath3k). into the kernel or say M to compile it as module (ath3k).
config BT_WILINK
tristate "Texas Instruments WiLink7 driver"
depends on TI_ST
help
This enables the Bluetooth driver for Texas Instrument's BT/FM/GPS
combo devices. This makes use of shared transport line discipline
core driver to communicate with the BT core of the combo chip.
Say Y here to compile support for Texas Instrument's WiLink7 driver
into the kernel or say M to compile it as module.
endmenu endmenu
...@@ -18,6 +18,7 @@ obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o ...@@ -18,6 +18,7 @@ obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o
obj-$(CONFIG_BT_ATH3K) += ath3k.o obj-$(CONFIG_BT_ATH3K) += ath3k.o
obj-$(CONFIG_BT_MRVL) += btmrvl.o obj-$(CONFIG_BT_MRVL) += btmrvl.o
obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o
obj-$(CONFIG_BT_WILINK) += btwilink.o
btmrvl-y := btmrvl_main.o btmrvl-y := btmrvl_main.o
btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o
......
/*
* Texas Instrument's Bluetooth Driver For Shared Transport.
*
* Bluetooth Driver acts as interface between HCI core and
* TI Shared Transport Layer.
*
* Copyright (C) 2009-2010 Texas Instruments
* Author: Raja Mani <raja_mani@ti.com>
* Pavan Savoy <pavan_savoy@ti.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#define DEBUG
#include <linux/platform_device.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/hci.h>
#include <linux/ti_wilink_st.h>
/* Bluetooth Driver Version */
#define VERSION "1.0"
#define MAX_BT_CHNL_IDS 3
/* Number of seconds to wait for registration completion
* when ST returns PENDING status.
*/
#define BT_REGISTER_TIMEOUT 6000 /* 6 sec */
/**
* struct ti_st - driver operation structure
* @hdev: hci device pointer which binds to bt driver
* @reg_status: ST registration callback status
* @st_write: write function provided by the ST driver
* to be used by the driver during send_frame.
* @wait_reg_completion - completion sync between ti_st_open
* and st_reg_completion_cb.
*/
struct ti_st {
struct hci_dev *hdev;
char reg_status;
long (*st_write) (struct sk_buff *);
struct completion wait_reg_completion;
};
/* Increments HCI counters based on pocket ID (cmd,acl,sco) */
static inline void ti_st_tx_complete(struct ti_st *hst, int pkt_type)
{
struct hci_dev *hdev = hst->hdev;
/* Update HCI stat counters */
switch (pkt_type) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
case HCI_ACLDATA_PKT:
hdev->stat.acl_tx++;
break;
case HCI_SCODATA_PKT:
hdev->stat.sco_tx++;
break;
}
}
/* ------- Interfaces to Shared Transport ------ */
/* Called by ST layer to indicate protocol registration completion
* status.ti_st_open() function will wait for signal from this
* API when st_register() function returns ST_PENDING.
*/
static void st_reg_completion_cb(void *priv_data, char data)
{
struct ti_st *lhst = priv_data;
/* Save registration status for use in ti_st_open() */
lhst->reg_status = data;
/* complete the wait in ti_st_open() */
complete(&lhst->wait_reg_completion);
}
/* Called by Shared Transport layer when receive data is
* available */
static long st_receive(void *priv_data, struct sk_buff *skb)
{
struct ti_st *lhst = priv_data;
int err;
if (!skb)
return -EFAULT;
if (!lhst) {
kfree_skb(skb);
return -EFAULT;
}
skb->dev = (void *) lhst->hdev;
/* Forward skb to HCI core layer */
err = hci_recv_frame(skb);
if (err < 0) {
BT_ERR("Unable to push skb to HCI core(%d)", err);
return err;
}
lhst->hdev->stat.byte_rx += skb->len;
return 0;
}
/* ------- Interfaces to HCI layer ------ */
/* protocol structure registered with shared transport */
static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
{
.chnl_id = HCI_ACLDATA_PKT, /* ACL */
.hdr_len = sizeof(struct hci_acl_hdr),
.offset_len_in_hdr = offsetof(struct hci_acl_hdr, dlen),
.len_size = 2, /* sizeof(dlen) in struct hci_acl_hdr */
.reserve = 8,
},
{
.chnl_id = HCI_SCODATA_PKT, /* SCO */
.hdr_len = sizeof(struct hci_sco_hdr),
.offset_len_in_hdr = offsetof(struct hci_sco_hdr, dlen),
.len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */
.reserve = 8,
},
{
.chnl_id = HCI_EVENT_PKT, /* HCI Events */
.hdr_len = sizeof(struct hci_event_hdr),
.offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
.len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
.reserve = 8,
},
};
/* Called from HCI core to initialize the device */
static int ti_st_open(struct hci_dev *hdev)
{
unsigned long timeleft;
struct ti_st *hst;
int err, i;
BT_DBG("%s %p", hdev->name, hdev);
if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
return -EBUSY;
/* provide contexts for callbacks from ST */
hst = hdev->driver_data;
for (i = 0; i < MAX_BT_CHNL_IDS; i++) {
ti_st_proto[i].priv_data = hst;
ti_st_proto[i].max_frame_size = HCI_MAX_FRAME_SIZE;
ti_st_proto[i].recv = st_receive;
ti_st_proto[i].reg_complete_cb = st_reg_completion_cb;
/* Prepare wait-for-completion handler */
init_completion(&hst->wait_reg_completion);
/* Reset ST registration callback status flag,
* this value will be updated in
* st_reg_completion_cb()
* function whenever it called from ST driver.
*/
hst->reg_status = -EINPROGRESS;
err = st_register(&ti_st_proto[i]);
if (!err)
goto done;
if (err != -EINPROGRESS) {
clear_bit(HCI_RUNNING, &hdev->flags);
BT_ERR("st_register failed %d", err);
return err;
}
/* ST is busy with either protocol
* registration or firmware download.
*/
BT_DBG("waiting for registration "
"completion signal from ST");
timeleft = wait_for_completion_timeout
(&hst->wait_reg_completion,
msecs_to_jiffies(BT_REGISTER_TIMEOUT));
if (!timeleft) {
clear_bit(HCI_RUNNING, &hdev->flags);
BT_ERR("Timeout(%d sec),didn't get reg "
"completion signal from ST",
BT_REGISTER_TIMEOUT / 1000);
return -ETIMEDOUT;
}
/* Is ST registration callback
* called with ERROR status? */
if (hst->reg_status != 0) {
clear_bit(HCI_RUNNING, &hdev->flags);
BT_ERR("ST registration completed with invalid "
"status %d", hst->reg_status);
return -EAGAIN;
}
done:
hst->st_write = ti_st_proto[i].write;
if (!hst->st_write) {
BT_ERR("undefined ST write function");
clear_bit(HCI_RUNNING, &hdev->flags);
for (i = 0; i < MAX_BT_CHNL_IDS; i++) {
/* Undo registration with ST */
err = st_unregister(&ti_st_proto[i]);
if (err)
BT_ERR("st_unregister() failed with "
"error %d", err);
hst->st_write = NULL;
}
return -EIO;
}
}
return 0;
}
/* Close device */
static int ti_st_close(struct hci_dev *hdev)
{
int err, i;
struct ti_st *hst = hdev->driver_data;
if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
return 0;
for (i = 0; i < MAX_BT_CHNL_IDS; i++) {
err = st_unregister(&ti_st_proto[i]);
if (err)
BT_ERR("st_unregister(%d) failed with error %d",
ti_st_proto[i].chnl_id, err);
}
hst->st_write = NULL;
return err;
}
static int ti_st_send_frame(struct sk_buff *skb)
{
struct hci_dev *hdev;
struct ti_st *hst;
long len;
hdev = (struct hci_dev *)skb->dev;
if (!test_bit(HCI_RUNNING, &hdev->flags))
return -EBUSY;
hst = hdev->driver_data;
/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
BT_DBG("%s: type %d len %d", hdev->name, bt_cb(skb)->pkt_type,
skb->len);
/* Insert skb to shared transport layer's transmit queue.
* Freeing skb memory is taken care in shared transport layer,
* so don't free skb memory here.
*/
len = hst->st_write(skb);
if (len < 0) {
kfree_skb(skb);
BT_ERR("ST write failed (%ld)", len);
/* Try Again, would only fail if UART has gone bad */
return -EAGAIN;
}
/* ST accepted our skb. So, Go ahead and do rest */
hdev->stat.byte_tx += len;
ti_st_tx_complete(hst, bt_cb(skb)->pkt_type);
return 0;
}
static void ti_st_destruct(struct hci_dev *hdev)
{
BT_DBG("%s", hdev->name);
/* do nothing here, since platform remove
* would free the hdev->driver_data
*/
}
static int bt_ti_probe(struct platform_device *pdev)
{
static struct ti_st *hst;
struct hci_dev *hdev;
int err;
hst = kzalloc(sizeof(struct ti_st), GFP_KERNEL);
if (!hst)
return -ENOMEM;
/* Expose "hciX" device to user space */
hdev = hci_alloc_dev();
if (!hdev) {
kfree(hst);
return -ENOMEM;
}
BT_DBG("hdev %p", hdev);
hst->hdev = hdev;
hdev->bus = HCI_UART;
hdev->driver_data = hst;
hdev->open = ti_st_open;
hdev->close = ti_st_close;
hdev->flush = NULL;
hdev->send = ti_st_send_frame;
hdev->destruct = ti_st_destruct;
hdev->owner = THIS_MODULE;
err = hci_register_dev(hdev);
if (err < 0) {
BT_ERR("Can't register HCI device error %d", err);
kfree(hst);
hci_free_dev(hdev);
return err;
}
BT_DBG("HCI device registered (hdev %p)", hdev);
dev_set_drvdata(&pdev->dev, hst);
return err;
}
static int bt_ti_remove(struct platform_device *pdev)
{
struct hci_dev *hdev;
struct ti_st *hst = dev_get_drvdata(&pdev->dev);
if (!hst)
return -EFAULT;
BT_DBG("%s", hst->hdev->name);
hdev = hst->hdev;
ti_st_close(hdev);
hci_unregister_dev(hdev);
hci_free_dev(hdev);
kfree(hst);
dev_set_drvdata(&pdev->dev, NULL);
return 0;
}
static struct platform_driver btwilink_driver = {
.probe = bt_ti_probe,
.remove = bt_ti_remove,
.driver = {
.name = "btwilink",
.owner = THIS_MODULE,
},
};
/* ------- Module Init/Exit interfaces ------ */
static int __init btwilink_init(void)
{
BT_INFO("Bluetooth Driver for TI WiLink - Version %s", VERSION);
return platform_driver_register(&btwilink_driver);
}
static void __exit btwilink_exit(void)
{
platform_driver_unregister(&btwilink_driver);
}
module_init(btwilink_init);
module_exit(btwilink_exit);
/* ------ Module Info ------ */
MODULE_AUTHOR("Raja Mani <raja_mani@ti.com>");
MODULE_DESCRIPTION("Bluetooth Driver for TI Shared Transport" VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
...@@ -48,7 +48,7 @@ void cn_queue_wrapper(struct work_struct *work) ...@@ -48,7 +48,7 @@ void cn_queue_wrapper(struct work_struct *work)
} }
static struct cn_callback_entry * static struct cn_callback_entry *
cn_queue_alloc_callback_entry(char *name, struct cb_id *id, cn_queue_alloc_callback_entry(const char *name, struct cb_id *id,
void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) void (*callback)(struct cn_msg *, struct netlink_skb_parms *))
{ {
struct cn_callback_entry *cbq; struct cn_callback_entry *cbq;
...@@ -78,7 +78,8 @@ int cn_cb_equal(struct cb_id *i1, struct cb_id *i2) ...@@ -78,7 +78,8 @@ int cn_cb_equal(struct cb_id *i1, struct cb_id *i2)
return ((i1->idx == i2->idx) && (i1->val == i2->val)); return ((i1->idx == i2->idx) && (i1->val == i2->val));
} }
int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name,
struct cb_id *id,
void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) void (*callback)(struct cn_msg *, struct netlink_skb_parms *))
{ {
struct cn_callback_entry *cbq, *__cbq; struct cn_callback_entry *cbq, *__cbq;
...@@ -135,7 +136,7 @@ void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id) ...@@ -135,7 +136,7 @@ void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id)
} }
} }
struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *nls) struct cn_queue_dev *cn_queue_alloc_dev(const char *name, struct sock *nls)
{ {
struct cn_queue_dev *dev; struct cn_queue_dev *dev;
......
...@@ -205,7 +205,7 @@ static void cn_rx_skb(struct sk_buff *__skb) ...@@ -205,7 +205,7 @@ static void cn_rx_skb(struct sk_buff *__skb)
* *
* May sleep. * May sleep.
*/ */
int cn_add_callback(struct cb_id *id, char *name, int cn_add_callback(struct cb_id *id, const char *name,
void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) void (*callback)(struct cn_msg *, struct netlink_skb_parms *))
{ {
int err; int err;
......
...@@ -91,12 +91,12 @@ source "drivers/staging/rtl8192e/Kconfig" ...@@ -91,12 +91,12 @@ source "drivers/staging/rtl8192e/Kconfig"
source "drivers/staging/rtl8712/Kconfig" source "drivers/staging/rtl8712/Kconfig"
source "drivers/staging/rts_pstor/Kconfig"
source "drivers/staging/frontier/Kconfig" source "drivers/staging/frontier/Kconfig"
source "drivers/staging/pohmelfs/Kconfig" source "drivers/staging/pohmelfs/Kconfig"
source "drivers/staging/autofs/Kconfig"
source "drivers/staging/phison/Kconfig" source "drivers/staging/phison/Kconfig"
source "drivers/staging/line6/Kconfig" source "drivers/staging/line6/Kconfig"
...@@ -131,6 +131,8 @@ source "drivers/staging/cs5535_gpio/Kconfig" ...@@ -131,6 +131,8 @@ source "drivers/staging/cs5535_gpio/Kconfig"
source "drivers/staging/zram/Kconfig" source "drivers/staging/zram/Kconfig"
source "drivers/staging/zcache/Kconfig"
source "drivers/staging/wlags49_h2/Kconfig" source "drivers/staging/wlags49_h2/Kconfig"
source "drivers/staging/wlags49_h25/Kconfig" source "drivers/staging/wlags49_h25/Kconfig"
...@@ -145,16 +147,12 @@ source "drivers/staging/crystalhd/Kconfig" ...@@ -145,16 +147,12 @@ source "drivers/staging/crystalhd/Kconfig"
source "drivers/staging/cxt1e1/Kconfig" source "drivers/staging/cxt1e1/Kconfig"
source "drivers/staging/ti-st/Kconfig"
source "drivers/staging/xgifb/Kconfig" source "drivers/staging/xgifb/Kconfig"
source "drivers/staging/msm/Kconfig" source "drivers/staging/msm/Kconfig"
source "drivers/staging/lirc/Kconfig" source "drivers/staging/lirc/Kconfig"
source "drivers/staging/smbfs/Kconfig"
source "drivers/staging/easycap/Kconfig" source "drivers/staging/easycap/Kconfig"
source "drivers/staging/solo6x10/Kconfig" source "drivers/staging/solo6x10/Kconfig"
...@@ -183,5 +181,7 @@ source "drivers/staging/cptm1217/Kconfig" ...@@ -183,5 +181,7 @@ source "drivers/staging/cptm1217/Kconfig"
source "drivers/staging/ste_rmi4/Kconfig" source "drivers/staging/ste_rmi4/Kconfig"
source "drivers/staging/gma500/Kconfig"
endif # !STAGING_EXCLUDE_BUILD endif # !STAGING_EXCLUDE_BUILD
endif # STAGING endif # STAGING
...@@ -29,14 +29,13 @@ obj-$(CONFIG_R8187SE) += rtl8187se/ ...@@ -29,14 +29,13 @@ obj-$(CONFIG_R8187SE) += rtl8187se/
obj-$(CONFIG_RTL8192U) += rtl8192u/ obj-$(CONFIG_RTL8192U) += rtl8192u/
obj-$(CONFIG_RTL8192E) += rtl8192e/ obj-$(CONFIG_RTL8192E) += rtl8192e/
obj-$(CONFIG_R8712U) += rtl8712/ obj-$(CONFIG_R8712U) += rtl8712/
obj-$(CONFIG_RTS_PSTOR) += rts_pstor/
obj-$(CONFIG_SPECTRA) += spectra/ obj-$(CONFIG_SPECTRA) += spectra/
obj-$(CONFIG_TRANZPORT) += frontier/ obj-$(CONFIG_TRANZPORT) += frontier/
obj-$(CONFIG_POHMELFS) += pohmelfs/ obj-$(CONFIG_POHMELFS) += pohmelfs/
obj-$(CONFIG_AUTOFS_FS) += autofs/
obj-$(CONFIG_IDE_PHISON) += phison/ obj-$(CONFIG_IDE_PHISON) += phison/
obj-$(CONFIG_LINE6_USB) += line6/ obj-$(CONFIG_LINE6_USB) += line6/
obj-$(CONFIG_USB_SERIAL_QUATECH2) += serqt_usb2/ obj-$(CONFIG_USB_SERIAL_QUATECH2) += serqt_usb2/
obj-$(CONFIG_SMB_FS) += smbfs/
obj-$(CONFIG_USB_SERIAL_QUATECH_USB2) += quatech_usb2/ obj-$(CONFIG_USB_SERIAL_QUATECH_USB2) += quatech_usb2/
obj-$(CONFIG_OCTEON_ETHERNET) += octeon/ obj-$(CONFIG_OCTEON_ETHERNET) += octeon/
obj-$(CONFIG_VT6655) += vt6655/ obj-$(CONFIG_VT6655) += vt6655/
...@@ -48,6 +47,8 @@ obj-$(CONFIG_DX_SEP) += sep/ ...@@ -48,6 +47,8 @@ obj-$(CONFIG_DX_SEP) += sep/
obj-$(CONFIG_IIO) += iio/ obj-$(CONFIG_IIO) += iio/
obj-$(CONFIG_CS5535_GPIO) += cs5535_gpio/ obj-$(CONFIG_CS5535_GPIO) += cs5535_gpio/
obj-$(CONFIG_ZRAM) += zram/ obj-$(CONFIG_ZRAM) += zram/
obj-$(CONFIG_XVMALLOC) += zram/
obj-$(CONFIG_ZCACHE) += zcache/
obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/ obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/
obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/ obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/
obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop/ obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop/
...@@ -55,7 +56,6 @@ obj-$(CONFIG_FB_SM7XX) += sm7xx/ ...@@ -55,7 +56,6 @@ obj-$(CONFIG_FB_SM7XX) += sm7xx/
obj-$(CONFIG_VIDEO_DT3155) += dt3155v4l/ obj-$(CONFIG_VIDEO_DT3155) += dt3155v4l/
obj-$(CONFIG_CRYSTALHD) += crystalhd/ obj-$(CONFIG_CRYSTALHD) += crystalhd/
obj-$(CONFIG_CXT1E1) += cxt1e1/ obj-$(CONFIG_CXT1E1) += cxt1e1/
obj-$(CONFIG_TI_ST) += ti-st/
obj-$(CONFIG_FB_XGI) += xgifb/ obj-$(CONFIG_FB_XGI) += xgifb/
obj-$(CONFIG_MSM_STAGING) += msm/ obj-$(CONFIG_MSM_STAGING) += msm/
obj-$(CONFIG_EASYCAP) += easycap/ obj-$(CONFIG_EASYCAP) += easycap/
...@@ -72,3 +72,4 @@ obj-$(CONFIG_SND_INTEL_SST) += intel_sst/ ...@@ -72,3 +72,4 @@ obj-$(CONFIG_SND_INTEL_SST) += intel_sst/
obj-$(CONFIG_SPEAKUP) += speakup/ obj-$(CONFIG_SPEAKUP) += speakup/
obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217) += cptm1217/ obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217) += cptm1217/
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += ste_rmi4/ obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += ste_rmi4/
obj-$(CONFIG_DRM_PSB) += gma500/
- The driver is a stop-gap measure until a proper mac80211 driver is available. TODO:
- The driver does not conform to the Linux coding style.
- The driver has been tested on a wide variety of embedded platforms running different versions of the Linux kernel but may still have bringup/performance issues with a new platform. We are working hard on cleaning up the driver. There's sooooooooo much todo
- Pls use the following link to get information about the driver's architecture, exposed APIs, supported features, limitations, testing, hardware availability and other details. so instead of editign this file please use the wiki:
http://wireless.kernel.org/en/users/Drivers/ath6kl
- Pls send any patches to http://wireless.kernel.org/en/users/Drivers/ath6kl
There's a respective TODO page there. Please also subscribe to the wiki page
to get e-mail updates on changes.
IRC:
We *really* need to coordinate development for ath6kl as the cleanup
patches will break pretty much any other patches. Please use IRC to
help coordinate better:
irc.freenode.net
#ath6kl
Send patches to:
- Greg Kroah-Hartman <greg@kroah.com> - Greg Kroah-Hartman <greg@kroah.com>
- Vipin Mehta <vmehta@atheros.com> - Luis R. Rodriguez <mcgrof@gmail.com>
- Joe Perches <joe@perches.com>
- Naveen Singh <nsingh@atheros.com>
...@@ -39,17 +39,17 @@ ...@@ -39,17 +39,17 @@
#define BMI_COMMUNICATION_TIMEOUT 100000 #define BMI_COMMUNICATION_TIMEOUT 100000
/* ------ Global Variable Declarations ------- */ /* ------ Global Variable Declarations ------- */
static A_BOOL bmiDone; static bool bmiDone;
A_STATUS int
bmiBufferSend(HIF_DEVICE *device, bmiBufferSend(struct hif_device *device,
A_UCHAR *buffer, u8 *buffer,
A_UINT32 length); u32 length);
A_STATUS int
bmiBufferReceive(HIF_DEVICE *device, bmiBufferReceive(struct hif_device *device,
A_UCHAR *buffer, u8 *buffer,
A_UINT32 length, u32 length,
A_BOOL want_timeout); bool want_timeout);
#endif #endif
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#define HIF_DEFAULT_IO_BLOCK_SIZE 128 #define HIF_DEFAULT_IO_BLOCK_SIZE 128
/* set extended MBOX window information for SDIO interconnects */ /* set extended MBOX window information for SDIO interconnects */
static INLINE void SetExtendedMboxWindowInfo(A_UINT16 Manfid, HIF_DEVICE_MBOX_INFO *pInfo) static INLINE void SetExtendedMboxWindowInfo(u16 Manfid, struct hif_device_mbox_info *pInfo)
{ {
switch (Manfid & MANUFACTURER_ID_AR6K_BASE_MASK) { switch (Manfid & MANUFACTURER_ID_AR6K_BASE_MASK) {
case MANUFACTURER_ID_AR6002_BASE : case MANUFACTURER_ID_AR6002_BASE :
...@@ -74,7 +74,7 @@ static INLINE void SetExtendedMboxWindowInfo(A_UINT16 Manfid, HIF_DEVICE_MBOX_IN ...@@ -74,7 +74,7 @@ static INLINE void SetExtendedMboxWindowInfo(A_UINT16 Manfid, HIF_DEVICE_MBOX_IN
pInfo->GMboxSize = HIF_GMBOX_WIDTH; pInfo->GMboxSize = HIF_GMBOX_WIDTH;
break; break;
default: default:
A_ASSERT(FALSE); A_ASSERT(false);
break; break;
} }
} }
......
...@@ -47,19 +47,17 @@ ...@@ -47,19 +47,17 @@
#define HIF_MBOX2_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE #define HIF_MBOX2_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
#define HIF_MBOX3_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE #define HIF_MBOX3_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
struct _HIF_SCATTER_REQ_PRIV;
typedef struct bus_request { typedef struct bus_request {
struct bus_request *next; /* link list of available requests */ struct bus_request *next; /* link list of available requests */
struct bus_request *inusenext; /* link list of in use requests */ struct bus_request *inusenext; /* link list of in use requests */
struct semaphore sem_req; struct semaphore sem_req;
A_UINT32 address; /* request data */ u32 address; /* request data */
A_UCHAR *buffer; u8 *buffer;
A_UINT32 length; u32 length;
A_UINT32 request; u32 request;
void *context; void *context;
A_STATUS status; int status;
struct _HIF_SCATTER_REQ_PRIV *pScatterReq; /* this request is a scatter request */ struct hif_scatter_req_priv *pScatterReq; /* this request is a scatter request */
} BUS_REQUEST; } BUS_REQUEST;
struct hif_device { struct hif_device {
...@@ -76,11 +74,11 @@ struct hif_device { ...@@ -76,11 +74,11 @@ struct hif_device {
BUS_REQUEST busRequest[BUS_REQUEST_MAX_NUM]; /* available bus requests */ BUS_REQUEST busRequest[BUS_REQUEST_MAX_NUM]; /* available bus requests */
void *claimedContext; void *claimedContext;
HTC_CALLBACKS htcCallbacks; HTC_CALLBACKS htcCallbacks;
A_UINT8 *dma_buffer; u8 *dma_buffer;
DL_LIST ScatterReqHead; /* scatter request list head */ struct dl_list ScatterReqHead; /* scatter request list head */
A_BOOL scatter_enabled; /* scatter enabled flag */ bool scatter_enabled; /* scatter enabled flag */
A_BOOL is_suspend; bool is_suspend;
A_BOOL is_disabled; bool is_disabled;
atomic_t irqHandling; atomic_t irqHandling;
HIF_DEVICE_POWER_CHANGE_TYPE powerConfig; HIF_DEVICE_POWER_CHANGE_TYPE powerConfig;
const struct sdio_device_id *id; const struct sdio_device_id *id;
...@@ -90,9 +88,9 @@ struct hif_device { ...@@ -90,9 +88,9 @@ struct hif_device {
#define CMD53_FIXED_ADDRESS 1 #define CMD53_FIXED_ADDRESS 1
#define CMD53_INCR_ADDRESS 2 #define CMD53_INCR_ADDRESS 2
BUS_REQUEST *hifAllocateBusRequest(HIF_DEVICE *device); BUS_REQUEST *hifAllocateBusRequest(struct hif_device *device);
void hifFreeBusRequest(HIF_DEVICE *device, BUS_REQUEST *busrequest); void hifFreeBusRequest(struct hif_device *device, BUS_REQUEST *busrequest);
void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest); void AddToAsyncList(struct hif_device *device, BUS_REQUEST *busrequest);
#ifdef HIF_LINUX_MMC_SCATTER_SUPPORT #ifdef HIF_LINUX_MMC_SCATTER_SUPPORT
...@@ -100,28 +98,28 @@ void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest); ...@@ -100,28 +98,28 @@ void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest);
#define MAX_SCATTER_ENTRIES_PER_REQ 16 #define MAX_SCATTER_ENTRIES_PER_REQ 16
#define MAX_SCATTER_REQ_TRANSFER_SIZE 32*1024 #define MAX_SCATTER_REQ_TRANSFER_SIZE 32*1024
typedef struct _HIF_SCATTER_REQ_PRIV { struct hif_scatter_req_priv {
HIF_SCATTER_REQ *pHifScatterReq; /* HIF scatter request with allocated entries */ struct hif_scatter_req *pHifScatterReq; /* HIF scatter request with allocated entries */
HIF_DEVICE *device; /* this device */ struct hif_device *device; /* this device */
BUS_REQUEST *busrequest; /* request associated with request */ BUS_REQUEST *busrequest; /* request associated with request */
/* scatter list for linux */ /* scatter list for linux */
struct scatterlist sgentries[MAX_SCATTER_ENTRIES_PER_REQ]; struct scatterlist sgentries[MAX_SCATTER_ENTRIES_PER_REQ];
} HIF_SCATTER_REQ_PRIV; };
#define ATH_DEBUG_SCATTER ATH_DEBUG_MAKE_MODULE_MASK(0) #define ATH_DEBUG_SCATTER ATH_DEBUG_MAKE_MODULE_MASK(0)
A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_INFO *pInfo); int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_support_info *pInfo);
void CleanupHIFScatterResources(HIF_DEVICE *device); void CleanupHIFScatterResources(struct hif_device *device);
A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest); int DoHifReadWriteScatter(struct hif_device *device, BUS_REQUEST *busrequest);
#else // HIF_LINUX_MMC_SCATTER_SUPPORT #else // HIF_LINUX_MMC_SCATTER_SUPPORT
static inline A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_INFO *pInfo) static inline int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_support_info *pInfo)
{ {
return A_ENOTSUP; return A_ENOTSUP;
} }
static inline A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest) static inline int DoHifReadWriteScatter(struct hif_device *device, BUS_REQUEST *busrequest)
{ {
return A_ENOTSUP; return A_ENOTSUP;
} }
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
(((address) & 0x1FFFF) << 9) | \ (((address) & 0x1FFFF) << 9) | \
((bytes_blocks) & 0x1FF) ((bytes_blocks) & 0x1FF)
static void FreeScatterReq(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) static void FreeScatterReq(struct hif_device *device, struct hif_scatter_req *pReq)
{ {
unsigned long flag; unsigned long flag;
...@@ -60,9 +60,9 @@ static void FreeScatterReq(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) ...@@ -60,9 +60,9 @@ static void FreeScatterReq(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq)
} }
static HIF_SCATTER_REQ *AllocScatterReq(HIF_DEVICE *device) static struct hif_scatter_req *AllocScatterReq(struct hif_device *device)
{ {
DL_LIST *pItem; struct dl_list *pItem;
unsigned long flag; unsigned long flag;
spin_lock_irqsave(&device->lock, flag); spin_lock_irqsave(&device->lock, flag);
...@@ -72,24 +72,24 @@ static HIF_SCATTER_REQ *AllocScatterReq(HIF_DEVICE *device) ...@@ -72,24 +72,24 @@ static HIF_SCATTER_REQ *AllocScatterReq(HIF_DEVICE *device)
spin_unlock_irqrestore(&device->lock, flag); spin_unlock_irqrestore(&device->lock, flag);
if (pItem != NULL) { if (pItem != NULL) {
return A_CONTAINING_STRUCT(pItem, HIF_SCATTER_REQ, ListLink); return A_CONTAINING_STRUCT(pItem, struct hif_scatter_req, ListLink);
} }
return NULL; return NULL;
} }
/* called by async task to perform the operation synchronously using direct MMC APIs */ /* called by async task to perform the operation synchronously using direct MMC APIs */
A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest) int DoHifReadWriteScatter(struct hif_device *device, BUS_REQUEST *busrequest)
{ {
int i; int i;
A_UINT8 rw; u8 rw;
A_UINT8 opcode; u8 opcode;
struct mmc_request mmcreq; struct mmc_request mmcreq;
struct mmc_command cmd; struct mmc_command cmd;
struct mmc_data data; struct mmc_data data;
HIF_SCATTER_REQ_PRIV *pReqPriv; struct hif_scatter_req_priv *pReqPriv;
HIF_SCATTER_REQ *pReq; struct hif_scatter_req *pReq;
A_STATUS status = A_OK; int status = 0;
struct scatterlist *pSg; struct scatterlist *pSg;
pReqPriv = busrequest->pScatterReq; pReqPriv = busrequest->pScatterReq;
...@@ -176,7 +176,7 @@ A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest) ...@@ -176,7 +176,7 @@ A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest)
AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF-SCATTER: data error: %d \n",data.error)); AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF-SCATTER: data error: %d \n",data.error));
} }
if (A_FAILED(status)) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF-SCATTER: FAILED!!! (%s) Address: 0x%X, Block mode (BlockLen: %d, BlockCount: %d)\n", AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF-SCATTER: FAILED!!! (%s) Address: 0x%X, Block mode (BlockLen: %d, BlockCount: %d)\n",
(pReq->Request & HIF_WRITE) ? "WRITE":"READ",pReq->Address, data.blksz, data.blocks)); (pReq->Request & HIF_WRITE) ? "WRITE":"READ",pReq->Address, data.blksz, data.blocks));
} }
...@@ -199,11 +199,11 @@ A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest) ...@@ -199,11 +199,11 @@ A_STATUS DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest)
} }
/* callback to issue a read-write scatter request */ /* callback to issue a read-write scatter request */
static A_STATUS HifReadWriteScatter(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) static int HifReadWriteScatter(struct hif_device *device, struct hif_scatter_req *pReq)
{ {
A_STATUS status = A_EINVAL; int status = A_EINVAL;
A_UINT32 request = pReq->Request; u32 request = pReq->Request;
HIF_SCATTER_REQ_PRIV *pReqPriv = (HIF_SCATTER_REQ_PRIV *)pReq->HIFPrivate[0]; struct hif_scatter_req_priv *pReqPriv = (struct hif_scatter_req_priv *)pReq->HIFPrivate[0];
do { do {
...@@ -237,7 +237,7 @@ static A_STATUS HifReadWriteScatter(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) ...@@ -237,7 +237,7 @@ static A_STATUS HifReadWriteScatter(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq)
} }
if (pReq->TotalLength == 0) { if (pReq->TotalLength == 0) {
A_ASSERT(FALSE); A_ASSERT(false);
break; break;
} }
...@@ -260,26 +260,26 @@ static A_STATUS HifReadWriteScatter(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) ...@@ -260,26 +260,26 @@ static A_STATUS HifReadWriteScatter(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq)
AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER: queued async req: 0x%lX\n", (unsigned long)pReqPriv->busrequest)); AR_DEBUG_PRINTF(ATH_DEBUG_SCATTER, ("HIF-SCATTER: queued async req: 0x%lX\n", (unsigned long)pReqPriv->busrequest));
/* wake thread, it will process and then take care of the async callback */ /* wake thread, it will process and then take care of the async callback */
up(&device->sem_async); up(&device->sem_async);
status = A_OK; status = 0;
} }
} while (FALSE); } while (false);
if (A_FAILED(status) && (request & HIF_ASYNCHRONOUS)) { if (status && (request & HIF_ASYNCHRONOUS)) {
pReq->CompletionStatus = status; pReq->CompletionStatus = status;
pReq->CompletionRoutine(pReq); pReq->CompletionRoutine(pReq);
status = A_OK; status = 0;
} }
return status; return status;
} }
/* setup of HIF scatter resources */ /* setup of HIF scatter resources */
A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_INFO *pInfo) int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_support_info *pInfo)
{ {
A_STATUS status = A_ERROR; int status = A_ERROR;
int i; int i;
HIF_SCATTER_REQ_PRIV *pReqPriv; struct hif_scatter_req_priv *pReqPriv;
BUS_REQUEST *busrequest; BUS_REQUEST *busrequest;
do { do {
...@@ -297,23 +297,23 @@ A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_I ...@@ -297,23 +297,23 @@ A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_I
for (i = 0; i < MAX_SCATTER_REQUESTS; i++) { for (i = 0; i < MAX_SCATTER_REQUESTS; i++) {
/* allocate the private request blob */ /* allocate the private request blob */
pReqPriv = (HIF_SCATTER_REQ_PRIV *)A_MALLOC(sizeof(HIF_SCATTER_REQ_PRIV)); pReqPriv = (struct hif_scatter_req_priv *)A_MALLOC(sizeof(struct hif_scatter_req_priv));
if (NULL == pReqPriv) { if (NULL == pReqPriv) {
break; break;
} }
A_MEMZERO(pReqPriv, sizeof(HIF_SCATTER_REQ_PRIV)); A_MEMZERO(pReqPriv, sizeof(struct hif_scatter_req_priv));
/* save the device instance*/ /* save the device instance*/
pReqPriv->device = device; pReqPriv->device = device;
/* allocate the scatter request */ /* allocate the scatter request */
pReqPriv->pHifScatterReq = (HIF_SCATTER_REQ *)A_MALLOC(sizeof(HIF_SCATTER_REQ) + pReqPriv->pHifScatterReq = (struct hif_scatter_req *)A_MALLOC(sizeof(struct hif_scatter_req) +
(MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(HIF_SCATTER_ITEM))); (MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item)));
if (NULL == pReqPriv->pHifScatterReq) { if (NULL == pReqPriv->pHifScatterReq) {
A_FREE(pReqPriv); A_FREE(pReqPriv);
break; break;
} }
/* just zero the main part of the scatter request */ /* just zero the main part of the scatter request */
A_MEMZERO(pReqPriv->pHifScatterReq, sizeof(HIF_SCATTER_REQ)); A_MEMZERO(pReqPriv->pHifScatterReq, sizeof(struct hif_scatter_req));
/* back pointer to the private struct */ /* back pointer to the private struct */
pReqPriv->pHifScatterReq->HIFPrivate[0] = pReqPriv; pReqPriv->pHifScatterReq->HIFPrivate[0] = pReqPriv;
/* allocate a bus request for this scatter request */ /* allocate a bus request for this scatter request */
...@@ -344,11 +344,11 @@ A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_I ...@@ -344,11 +344,11 @@ A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_I
pInfo->MaxScatterEntries = MAX_SCATTER_ENTRIES_PER_REQ; pInfo->MaxScatterEntries = MAX_SCATTER_ENTRIES_PER_REQ;
pInfo->MaxTransferSizePerScatterReq = MAX_SCATTER_REQ_TRANSFER_SIZE; pInfo->MaxTransferSizePerScatterReq = MAX_SCATTER_REQ_TRANSFER_SIZE;
status = A_OK; status = 0;
} while (FALSE); } while (false);
if (A_FAILED(status)) { if (status) {
CleanupHIFScatterResources(device); CleanupHIFScatterResources(device);
} }
...@@ -356,10 +356,10 @@ A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_I ...@@ -356,10 +356,10 @@ A_STATUS SetupHIFScatterSupport(HIF_DEVICE *device, HIF_DEVICE_SCATTER_SUPPORT_I
} }
/* clean up scatter support */ /* clean up scatter support */
void CleanupHIFScatterResources(HIF_DEVICE *device) void CleanupHIFScatterResources(struct hif_device *device)
{ {
HIF_SCATTER_REQ_PRIV *pReqPriv; struct hif_scatter_req_priv *pReqPriv;
HIF_SCATTER_REQ *pReq; struct hif_scatter_req *pReq;
/* empty the free list */ /* empty the free list */
...@@ -371,7 +371,7 @@ void CleanupHIFScatterResources(HIF_DEVICE *device) ...@@ -371,7 +371,7 @@ void CleanupHIFScatterResources(HIF_DEVICE *device)
break; break;
} }
pReqPriv = (HIF_SCATTER_REQ_PRIV *)pReq->HIFPrivate[0]; pReqPriv = (struct hif_scatter_req_priv *)pReq->HIFPrivate[0];
A_ASSERT(pReqPriv != NULL); A_ASSERT(pReqPriv != NULL);
if (pReqPriv->busrequest != NULL) { if (pReqPriv->busrequest != NULL) {
......
...@@ -43,40 +43,40 @@ ...@@ -43,40 +43,40 @@
//#define MBOXHW_UNIT_TEST 1 //#define MBOXHW_UNIT_TEST 1
#include "athstartpack.h" #include "athstartpack.h"
typedef PREPACK struct _AR6K_IRQ_PROC_REGISTERS { PREPACK struct ar6k_irq_proc_registers {
A_UINT8 host_int_status; u8 host_int_status;
A_UINT8 cpu_int_status; u8 cpu_int_status;
A_UINT8 error_int_status; u8 error_int_status;
A_UINT8 counter_int_status; u8 counter_int_status;
A_UINT8 mbox_frame; u8 mbox_frame;
A_UINT8 rx_lookahead_valid; u8 rx_lookahead_valid;
A_UINT8 host_int_status2; u8 host_int_status2;
A_UINT8 gmbox_rx_avail; u8 gmbox_rx_avail;
A_UINT32 rx_lookahead[2]; u32 rx_lookahead[2];
A_UINT32 rx_gmbox_lookahead_alias[2]; u32 rx_gmbox_lookahead_alias[2];
} POSTPACK AR6K_IRQ_PROC_REGISTERS; } POSTPACK;
#define AR6K_IRQ_PROC_REGS_SIZE sizeof(AR6K_IRQ_PROC_REGISTERS) #define AR6K_IRQ_PROC_REGS_SIZE sizeof(struct ar6k_irq_proc_registers)
typedef PREPACK struct _AR6K_IRQ_ENABLE_REGISTERS { PREPACK struct ar6k_irq_enable_registers {
A_UINT8 int_status_enable; u8 int_status_enable;
A_UINT8 cpu_int_status_enable; u8 cpu_int_status_enable;
A_UINT8 error_status_enable; u8 error_status_enable;
A_UINT8 counter_int_status_enable; u8 counter_int_status_enable;
} POSTPACK AR6K_IRQ_ENABLE_REGISTERS; } POSTPACK;
typedef PREPACK struct _AR6K_GMBOX_CTRL_REGISTERS { PREPACK struct ar6k_gmbox_ctrl_registers {
A_UINT8 int_status_enable; u8 int_status_enable;
} POSTPACK AR6K_GMBOX_CTRL_REGISTERS; } POSTPACK;
#include "athendpack.h" #include "athendpack.h"
#define AR6K_IRQ_ENABLE_REGS_SIZE sizeof(AR6K_IRQ_ENABLE_REGISTERS) #define AR6K_IRQ_ENABLE_REGS_SIZE sizeof(struct ar6k_irq_enable_registers)
#define AR6K_REG_IO_BUFFER_SIZE 32 #define AR6K_REG_IO_BUFFER_SIZE 32
#define AR6K_MAX_REG_IO_BUFFERS 8 #define AR6K_MAX_REG_IO_BUFFERS 8
#define FROM_DMA_BUFFER TRUE #define FROM_DMA_BUFFER true
#define TO_DMA_BUFFER FALSE #define TO_DMA_BUFFER false
#define AR6K_SCATTER_ENTRIES_PER_REQ 16 #define AR6K_SCATTER_ENTRIES_PER_REQ 16
#define AR6K_MAX_TRANSFER_SIZE_PER_SCATTER 16*1024 #define AR6K_MAX_TRANSFER_SIZE_PER_SCATTER 16*1024
#define AR6K_SCATTER_REQS 4 #define AR6K_SCATTER_REQS 4
...@@ -89,107 +89,107 @@ typedef PREPACK struct _AR6K_GMBOX_CTRL_REGISTERS { ...@@ -89,107 +89,107 @@ typedef PREPACK struct _AR6K_GMBOX_CTRL_REGISTERS {
#define AR6K_MIN_TRANSFER_SIZE_PER_SCATTER 4*1024 #define AR6K_MIN_TRANSFER_SIZE_PER_SCATTER 4*1024
/* buffers for ASYNC I/O */ /* buffers for ASYNC I/O */
typedef struct AR6K_ASYNC_REG_IO_BUFFER { struct ar6k_async_reg_io_buffer {
HTC_PACKET HtcPacket; /* we use an HTC packet as a wrapper for our async register-based I/O */ struct htc_packet HtcPacket; /* we use an HTC packet as a wrapper for our async register-based I/O */
A_UINT8 _Pad1[A_CACHE_LINE_PAD]; u8 _Pad1[A_CACHE_LINE_PAD];
A_UINT8 Buffer[AR6K_REG_IO_BUFFER_SIZE]; /* cache-line safe with pads around */ u8 Buffer[AR6K_REG_IO_BUFFER_SIZE]; /* cache-line safe with pads around */
A_UINT8 _Pad2[A_CACHE_LINE_PAD]; u8 _Pad2[A_CACHE_LINE_PAD];
} AR6K_ASYNC_REG_IO_BUFFER; };
typedef struct _AR6K_GMBOX_INFO { struct ar6k_gmbox_info {
void *pProtocolContext; void *pProtocolContext;
A_STATUS (*pMessagePendingCallBack)(void *pContext, A_UINT8 LookAheadBytes[], int ValidBytes); int (*pMessagePendingCallBack)(void *pContext, u8 LookAheadBytes[], int ValidBytes);
A_STATUS (*pCreditsPendingCallback)(void *pContext, int NumCredits, A_BOOL CreditIRQEnabled); int (*pCreditsPendingCallback)(void *pContext, int NumCredits, bool CreditIRQEnabled);
void (*pTargetFailureCallback)(void *pContext, A_STATUS Status); void (*pTargetFailureCallback)(void *pContext, int Status);
void (*pStateDumpCallback)(void *pContext); void (*pStateDumpCallback)(void *pContext);
A_BOOL CreditCountIRQEnabled; bool CreditCountIRQEnabled;
} AR6K_GMBOX_INFO; };
typedef struct _AR6K_DEVICE { struct ar6k_device {
A_MUTEX_T Lock; A_MUTEX_T Lock;
A_UINT8 _Pad1[A_CACHE_LINE_PAD]; u8 _Pad1[A_CACHE_LINE_PAD];
AR6K_IRQ_PROC_REGISTERS IrqProcRegisters; /* cache-line safe with pads around */ struct ar6k_irq_proc_registers IrqProcRegisters; /* cache-line safe with pads around */
A_UINT8 _Pad2[A_CACHE_LINE_PAD]; u8 _Pad2[A_CACHE_LINE_PAD];
AR6K_IRQ_ENABLE_REGISTERS IrqEnableRegisters; /* cache-line safe with pads around */ struct ar6k_irq_enable_registers IrqEnableRegisters; /* cache-line safe with pads around */
A_UINT8 _Pad3[A_CACHE_LINE_PAD]; u8 _Pad3[A_CACHE_LINE_PAD];
void *HIFDevice; void *HIFDevice;
A_UINT32 BlockSize; u32 BlockSize;
A_UINT32 BlockMask; u32 BlockMask;
HIF_DEVICE_MBOX_INFO MailBoxInfo; struct hif_device_mbox_info MailBoxInfo;
HIF_PENDING_EVENTS_FUNC GetPendingEventsFunc; HIF_PENDING_EVENTS_FUNC GetPendingEventsFunc;
void *HTCContext; void *HTCContext;
HTC_PACKET_QUEUE RegisterIOList; struct htc_packet_queue RegisterIOList;
AR6K_ASYNC_REG_IO_BUFFER RegIOBuffers[AR6K_MAX_REG_IO_BUFFERS]; struct ar6k_async_reg_io_buffer RegIOBuffers[AR6K_MAX_REG_IO_BUFFERS];
void (*TargetFailureCallback)(void *Context); void (*TargetFailureCallback)(void *Context);
A_STATUS (*MessagePendingCallback)(void *Context, int (*MessagePendingCallback)(void *Context,
A_UINT32 LookAheads[], u32 LookAheads[],
int NumLookAheads, int NumLookAheads,
A_BOOL *pAsyncProc, bool *pAsyncProc,
int *pNumPktsFetched); int *pNumPktsFetched);
HIF_DEVICE_IRQ_PROCESSING_MODE HifIRQProcessingMode; HIF_DEVICE_IRQ_PROCESSING_MODE HifIRQProcessingMode;
HIF_MASK_UNMASK_RECV_EVENT HifMaskUmaskRecvEvent; HIF_MASK_UNMASK_RECV_EVENT HifMaskUmaskRecvEvent;
A_BOOL HifAttached; bool HifAttached;
HIF_DEVICE_IRQ_YIELD_PARAMS HifIRQYieldParams; struct hif_device_irq_yield_params HifIRQYieldParams;
A_BOOL DSRCanYield; bool DSRCanYield;
int CurrentDSRRecvCount; int CurrentDSRRecvCount;
HIF_DEVICE_SCATTER_SUPPORT_INFO HifScatterInfo; struct hif_device_scatter_support_info HifScatterInfo;
DL_LIST ScatterReqHead; struct dl_list ScatterReqHead;
A_BOOL ScatterIsVirtual; bool ScatterIsVirtual;
int MaxRecvBundleSize; int MaxRecvBundleSize;
int MaxSendBundleSize; int MaxSendBundleSize;
AR6K_GMBOX_INFO GMboxInfo; struct ar6k_gmbox_info GMboxInfo;
A_BOOL GMboxEnabled; bool GMboxEnabled;
AR6K_GMBOX_CTRL_REGISTERS GMboxControlRegisters; struct ar6k_gmbox_ctrl_registers GMboxControlRegisters;
int RecheckIRQStatusCnt; int RecheckIRQStatusCnt;
} AR6K_DEVICE; };
#define LOCK_AR6K(p) A_MUTEX_LOCK(&(p)->Lock); #define LOCK_AR6K(p) A_MUTEX_LOCK(&(p)->Lock);
#define UNLOCK_AR6K(p) A_MUTEX_UNLOCK(&(p)->Lock); #define UNLOCK_AR6K(p) A_MUTEX_UNLOCK(&(p)->Lock);
#define REF_IRQ_STATUS_RECHECK(p) (p)->RecheckIRQStatusCnt = 1 /* note: no need to lock this, it only gets set */ #define REF_IRQ_STATUS_RECHECK(p) (p)->RecheckIRQStatusCnt = 1 /* note: no need to lock this, it only gets set */
A_STATUS DevSetup(AR6K_DEVICE *pDev); int DevSetup(struct ar6k_device *pDev);
void DevCleanup(AR6K_DEVICE *pDev); void DevCleanup(struct ar6k_device *pDev);
A_STATUS DevUnmaskInterrupts(AR6K_DEVICE *pDev); int DevUnmaskInterrupts(struct ar6k_device *pDev);
A_STATUS DevMaskInterrupts(AR6K_DEVICE *pDev); int DevMaskInterrupts(struct ar6k_device *pDev);
A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, int DevPollMboxMsgRecv(struct ar6k_device *pDev,
A_UINT32 *pLookAhead, u32 *pLookAhead,
int TimeoutMS); int TimeoutMS);
A_STATUS DevRWCompletionHandler(void *context, A_STATUS status); int DevRWCompletionHandler(void *context, int status);
A_STATUS DevDsrHandler(void *context); int DevDsrHandler(void *context);
A_STATUS DevCheckPendingRecvMsgsAsync(void *context); int DevCheckPendingRecvMsgsAsync(void *context);
void DevAsyncIrqProcessComplete(AR6K_DEVICE *pDev); void DevAsyncIrqProcessComplete(struct ar6k_device *pDev);
void DevDumpRegisters(AR6K_DEVICE *pDev, void DevDumpRegisters(struct ar6k_device *pDev,
AR6K_IRQ_PROC_REGISTERS *pIrqProcRegs, struct ar6k_irq_proc_registers *pIrqProcRegs,
AR6K_IRQ_ENABLE_REGISTERS *pIrqEnableRegs); struct ar6k_irq_enable_registers *pIrqEnableRegs);
#define DEV_STOP_RECV_ASYNC TRUE #define DEV_STOP_RECV_ASYNC true
#define DEV_STOP_RECV_SYNC FALSE #define DEV_STOP_RECV_SYNC false
#define DEV_ENABLE_RECV_ASYNC TRUE #define DEV_ENABLE_RECV_ASYNC true
#define DEV_ENABLE_RECV_SYNC FALSE #define DEV_ENABLE_RECV_SYNC false
A_STATUS DevStopRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); int DevStopRecv(struct ar6k_device *pDev, bool ASyncMode);
A_STATUS DevEnableRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode); int DevEnableRecv(struct ar6k_device *pDev, bool ASyncMode);
A_STATUS DevEnableInterrupts(AR6K_DEVICE *pDev); int DevEnableInterrupts(struct ar6k_device *pDev);
A_STATUS DevDisableInterrupts(AR6K_DEVICE *pDev); int DevDisableInterrupts(struct ar6k_device *pDev);
A_STATUS DevWaitForPendingRecv(AR6K_DEVICE *pDev,A_UINT32 TimeoutInMs,A_BOOL *pbIsRecvPending); int DevWaitForPendingRecv(struct ar6k_device *pDev,u32 TimeoutInMs,bool *pbIsRecvPending);
#define DEV_CALC_RECV_PADDED_LEN(pDev, length) (((length) + (pDev)->BlockMask) & (~((pDev)->BlockMask))) #define DEV_CALC_RECV_PADDED_LEN(pDev, length) (((length) + (pDev)->BlockMask) & (~((pDev)->BlockMask)))
#define DEV_CALC_SEND_PADDED_LEN(pDev, length) DEV_CALC_RECV_PADDED_LEN(pDev,length) #define DEV_CALC_SEND_PADDED_LEN(pDev, length) DEV_CALC_RECV_PADDED_LEN(pDev,length)
#define DEV_IS_LEN_BLOCK_ALIGNED(pDev, length) (((length) % (pDev)->BlockSize) == 0) #define DEV_IS_LEN_BLOCK_ALIGNED(pDev, length) (((length) % (pDev)->BlockSize) == 0)
static INLINE A_STATUS DevSendPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 SendLength) { static INLINE int DevSendPacket(struct ar6k_device *pDev, struct htc_packet *pPacket, u32 SendLength) {
A_UINT32 paddedLength; u32 paddedLength;
A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; bool sync = (pPacket->Completion == NULL) ? true : false;
A_STATUS status; int status;
/* adjust the length to be a multiple of block size if appropriate */ /* adjust the length to be a multiple of block size if appropriate */
paddedLength = DEV_CALC_SEND_PADDED_LEN(pDev, SendLength); paddedLength = DEV_CALC_SEND_PADDED_LEN(pDev, SendLength);
#if 0 #if 0
if (paddedLength > pPacket->BufferLength) { if (paddedLength > pPacket->BufferLength) {
A_ASSERT(FALSE); A_ASSERT(false);
if (pPacket->Completion != NULL) { if (pPacket->Completion != NULL) {
COMPLETE_HTC_PACKET(pPacket,A_EINVAL); COMPLETE_HTC_PACKET(pPacket,A_EINVAL);
return A_OK; return 0;
} }
return A_EINVAL; return A_EINVAL;
} }
...@@ -212,29 +212,29 @@ static INLINE A_STATUS DevSendPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_U ...@@ -212,29 +212,29 @@ static INLINE A_STATUS DevSendPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_U
pPacket->Status = status; pPacket->Status = status;
} else { } else {
if (status == A_PENDING) { if (status == A_PENDING) {
status = A_OK; status = 0;
} }
} }
return status; return status;
} }
static INLINE A_STATUS DevRecvPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 RecvLength) { static INLINE int DevRecvPacket(struct ar6k_device *pDev, struct htc_packet *pPacket, u32 RecvLength) {
A_UINT32 paddedLength; u32 paddedLength;
A_STATUS status; int status;
A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; bool sync = (pPacket->Completion == NULL) ? true : false;
/* adjust the length to be a multiple of block size if appropriate */ /* adjust the length to be a multiple of block size if appropriate */
paddedLength = DEV_CALC_RECV_PADDED_LEN(pDev, RecvLength); paddedLength = DEV_CALC_RECV_PADDED_LEN(pDev, RecvLength);
if (paddedLength > pPacket->BufferLength) { if (paddedLength > pPacket->BufferLength) {
A_ASSERT(FALSE); A_ASSERT(false);
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("DevRecvPacket, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n", ("DevRecvPacket, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n",
paddedLength,RecvLength,pPacket->BufferLength)); paddedLength,RecvLength,pPacket->BufferLength));
if (pPacket->Completion != NULL) { if (pPacket->Completion != NULL) {
COMPLETE_HTC_PACKET(pPacket,A_EINVAL); COMPLETE_HTC_PACKET(pPacket,A_EINVAL);
return A_OK; return 0;
} }
return A_EINVAL; return A_EINVAL;
} }
...@@ -272,27 +272,33 @@ static INLINE A_STATUS DevRecvPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_U ...@@ -272,27 +272,33 @@ static INLINE A_STATUS DevRecvPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_U
* *
*/ */
A_STATUS DevCopyScatterListToFromDMABuffer(HIF_SCATTER_REQ *pReq, A_BOOL FromDMA); int DevCopyScatterListToFromDMABuffer(struct hif_scatter_req *pReq, bool FromDMA);
/* copy any READ data back into scatter list */ /* copy any READ data back into scatter list */
#define DEV_FINISH_SCATTER_OPERATION(pR) \ #define DEV_FINISH_SCATTER_OPERATION(pR) \
if (A_SUCCESS((pR)->CompletionStatus) && \ do { \
if (!((pR)->CompletionStatus) && \
!((pR)->Request & HIF_WRITE) && \ !((pR)->Request & HIF_WRITE) && \
((pR)->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) { \ ((pR)->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) { \
(pR)->CompletionStatus = DevCopyScatterListToFromDMABuffer((pR),FROM_DMA_BUFFER); \ (pR)->CompletionStatus = \
} DevCopyScatterListToFromDMABuffer((pR), \
FROM_DMA_BUFFER); \
} \
} while (0)
/* copy any WRITE data to bounce buffer */ /* copy any WRITE data to bounce buffer */
static INLINE A_STATUS DEV_PREPARE_SCATTER_OPERATION(HIF_SCATTER_REQ *pReq) { static INLINE int DEV_PREPARE_SCATTER_OPERATION(struct hif_scatter_req *pReq) {
if ((pReq->Request & HIF_WRITE) && (pReq->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) { if ((pReq->Request & HIF_WRITE) && (pReq->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) {
return DevCopyScatterListToFromDMABuffer(pReq,TO_DMA_BUFFER); return DevCopyScatterListToFromDMABuffer(pReq,TO_DMA_BUFFER);
} else { } else {
return A_OK; return 0;
} }
} }
A_STATUS DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer); int DevSetupMsgBundling(struct ar6k_device *pDev, int MaxMsgsPerTransfer);
int DevCleanupMsgBundling(struct ar6k_device *pDev);
#define DEV_GET_MAX_MSG_PER_BUNDLE(pDev) (pDev)->HifScatterInfo.MaxScatterEntries #define DEV_GET_MAX_MSG_PER_BUNDLE(pDev) (pDev)->HifScatterInfo.MaxScatterEntries
#define DEV_GET_MAX_BUNDLE_LENGTH(pDev) (pDev)->HifScatterInfo.MaxTransferSizePerScatterReq #define DEV_GET_MAX_BUNDLE_LENGTH(pDev) (pDev)->HifScatterInfo.MaxTransferSizePerScatterReq
...@@ -305,25 +311,25 @@ A_STATUS DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer); ...@@ -305,25 +311,25 @@ A_STATUS DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer);
#define DEV_GET_MAX_BUNDLE_RECV_LENGTH(pDev) (pDev)->MaxRecvBundleSize #define DEV_GET_MAX_BUNDLE_RECV_LENGTH(pDev) (pDev)->MaxRecvBundleSize
#define DEV_GET_MAX_BUNDLE_SEND_LENGTH(pDev) (pDev)->MaxSendBundleSize #define DEV_GET_MAX_BUNDLE_SEND_LENGTH(pDev) (pDev)->MaxSendBundleSize
#define DEV_SCATTER_READ TRUE #define DEV_SCATTER_READ true
#define DEV_SCATTER_WRITE FALSE #define DEV_SCATTER_WRITE false
#define DEV_SCATTER_ASYNC TRUE #define DEV_SCATTER_ASYNC true
#define DEV_SCATTER_SYNC FALSE #define DEV_SCATTER_SYNC false
A_STATUS DevSubmitScatterRequest(AR6K_DEVICE *pDev, HIF_SCATTER_REQ *pScatterReq, A_BOOL Read, A_BOOL Async); int DevSubmitScatterRequest(struct ar6k_device *pDev, struct hif_scatter_req *pScatterReq, bool Read, bool Async);
#ifdef MBOXHW_UNIT_TEST #ifdef MBOXHW_UNIT_TEST
A_STATUS DoMboxHWTest(AR6K_DEVICE *pDev); int DoMboxHWTest(struct ar6k_device *pDev);
#endif #endif
/* completely virtual */ /* completely virtual */
typedef struct _DEV_SCATTER_DMA_VIRTUAL_INFO { struct dev_scatter_dma_virtual_info {
A_UINT8 *pVirtDmaBuffer; /* dma-able buffer - CPU accessible address */ u8 *pVirtDmaBuffer; /* dma-able buffer - CPU accessible address */
A_UINT8 DataArea[1]; /* start of data area */ u8 DataArea[1]; /* start of data area */
} DEV_SCATTER_DMA_VIRTUAL_INFO; };
void DumpAR6KDevState(AR6K_DEVICE *pDev); void DumpAR6KDevState(struct ar6k_device *pDev);
/**************************************************/ /**************************************************/
/****** GMBOX functions and definitions /****** GMBOX functions and definitions
...@@ -333,21 +339,21 @@ void DumpAR6KDevState(AR6K_DEVICE *pDev); ...@@ -333,21 +339,21 @@ void DumpAR6KDevState(AR6K_DEVICE *pDev);
#ifdef ATH_AR6K_ENABLE_GMBOX #ifdef ATH_AR6K_ENABLE_GMBOX
void DevCleanupGMbox(AR6K_DEVICE *pDev); void DevCleanupGMbox(struct ar6k_device *pDev);
A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev); int DevSetupGMbox(struct ar6k_device *pDev);
A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev); int DevCheckGMboxInterrupts(struct ar6k_device *pDev);
void DevNotifyGMboxTargetFailure(AR6K_DEVICE *pDev); void DevNotifyGMboxTargetFailure(struct ar6k_device *pDev);
#else #else
/* compiled out */ /* compiled out */
#define DevCleanupGMbox(p) #define DevCleanupGMbox(p)
#define DevCheckGMboxInterrupts(p) A_OK #define DevCheckGMboxInterrupts(p) 0
#define DevNotifyGMboxTargetFailure(p) #define DevNotifyGMboxTargetFailure(p)
static INLINE A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) { static INLINE int DevSetupGMbox(struct ar6k_device *pDev) {
pDev->GMboxEnabled = FALSE; pDev->GMboxEnabled = false;
return A_OK; return 0;
} }
#endif #endif
...@@ -355,12 +361,12 @@ static INLINE A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) { ...@@ -355,12 +361,12 @@ static INLINE A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) {
#ifdef ATH_AR6K_ENABLE_GMBOX #ifdef ATH_AR6K_ENABLE_GMBOX
/* GMBOX protocol modules must expose each of these internal APIs */ /* GMBOX protocol modules must expose each of these internal APIs */
HCI_TRANSPORT_HANDLE GMboxAttachProtocol(AR6K_DEVICE *pDev, HCI_TRANSPORT_CONFIG_INFO *pInfo); HCI_TRANSPORT_HANDLE GMboxAttachProtocol(struct ar6k_device *pDev, struct hci_transport_config_info *pInfo);
A_STATUS GMboxProtocolInstall(AR6K_DEVICE *pDev); int GMboxProtocolInstall(struct ar6k_device *pDev);
void GMboxProtocolUninstall(AR6K_DEVICE *pDev); void GMboxProtocolUninstall(struct ar6k_device *pDev);
/* API used by GMBOX protocol modules */ /* API used by GMBOX protocol modules */
AR6K_DEVICE *HTCGetAR6KDevice(void *HTCHandle); struct ar6k_device *HTCGetAR6KDevice(void *HTCHandle);
#define DEV_GMBOX_SET_PROTOCOL(pDev,recv_callback,credits_pending,failure,statedump,context) \ #define DEV_GMBOX_SET_PROTOCOL(pDev,recv_callback,credits_pending,failure,statedump,context) \
{ \ { \
(pDev)->GMboxInfo.pProtocolContext = (context); \ (pDev)->GMboxInfo.pProtocolContext = (context); \
...@@ -372,11 +378,11 @@ AR6K_DEVICE *HTCGetAR6KDevice(void *HTCHandle); ...@@ -372,11 +378,11 @@ AR6K_DEVICE *HTCGetAR6KDevice(void *HTCHandle);
#define DEV_GMBOX_GET_PROTOCOL(pDev) (pDev)->GMboxInfo.pProtocolContext #define DEV_GMBOX_GET_PROTOCOL(pDev) (pDev)->GMboxInfo.pProtocolContext
A_STATUS DevGMboxWrite(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 WriteLength); int DevGMboxWrite(struct ar6k_device *pDev, struct htc_packet *pPacket, u32 WriteLength);
A_STATUS DevGMboxRead(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 ReadLength); int DevGMboxRead(struct ar6k_device *pDev, struct htc_packet *pPacket, u32 ReadLength);
#define PROC_IO_ASYNC TRUE #define PROC_IO_ASYNC true
#define PROC_IO_SYNC FALSE #define PROC_IO_SYNC false
typedef enum GMBOX_IRQ_ACTION_TYPE { typedef enum GMBOX_IRQ_ACTION_TYPE {
GMBOX_ACTION_NONE = 0, GMBOX_ACTION_NONE = 0,
GMBOX_DISABLE_ALL, GMBOX_DISABLE_ALL,
...@@ -387,11 +393,11 @@ typedef enum GMBOX_IRQ_ACTION_TYPE { ...@@ -387,11 +393,11 @@ typedef enum GMBOX_IRQ_ACTION_TYPE {
GMBOX_CREDIT_IRQ_DISABLE, GMBOX_CREDIT_IRQ_DISABLE,
} GMBOX_IRQ_ACTION_TYPE; } GMBOX_IRQ_ACTION_TYPE;
A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE, A_BOOL AsyncMode); int DevGMboxIRQAction(struct ar6k_device *pDev, GMBOX_IRQ_ACTION_TYPE, bool AsyncMode);
A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCredits); int DevGMboxReadCreditCounter(struct ar6k_device *pDev, bool AsyncMode, int *pCredits);
A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize); int DevGMboxReadCreditSize(struct ar6k_device *pDev, int *pCreditSize);
A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer, int *pLookAheadBytes); int DevGMboxRecvLookAheadPeek(struct ar6k_device *pDev, u8 *pLookAheadBuffer, int *pLookAheadBytes);
A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int SignalNumber, int AckTimeoutMS); int DevGMboxSetTargetInterrupt(struct ar6k_device *pDev, int SignalNumber, int AckTimeoutMS);
#endif #endif
......
...@@ -33,17 +33,17 @@ ...@@ -33,17 +33,17 @@
#include "htc_packet.h" #include "htc_packet.h"
#include "ar6k.h" #include "ar6k.h"
extern void AR6KFreeIOPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket); extern void AR6KFreeIOPacket(struct ar6k_device *pDev, struct htc_packet *pPacket);
extern HTC_PACKET *AR6KAllocIOPacket(AR6K_DEVICE *pDev); extern struct htc_packet *AR6KAllocIOPacket(struct ar6k_device *pDev);
static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev); static int DevServiceDebugInterrupt(struct ar6k_device *pDev);
#define DELAY_PER_INTERVAL_MS 10 /* 10 MS delay per polling interval */ #define DELAY_PER_INTERVAL_MS 10 /* 10 MS delay per polling interval */
/* completion routine for ALL HIF layer async I/O */ /* completion routine for ALL HIF layer async I/O */
A_STATUS DevRWCompletionHandler(void *context, A_STATUS status) int DevRWCompletionHandler(void *context, int status)
{ {
HTC_PACKET *pPacket = (HTC_PACKET *)context; struct htc_packet *pPacket = (struct htc_packet *)context;
AR_DEBUG_PRINTF(ATH_DEBUG_RECV, AR_DEBUG_PRINTF(ATH_DEBUG_RECV,
("+DevRWCompletionHandler (Pkt:0x%lX) , Status: %d \n", ("+DevRWCompletionHandler (Pkt:0x%lX) , Status: %d \n",
...@@ -55,26 +55,26 @@ A_STATUS DevRWCompletionHandler(void *context, A_STATUS status) ...@@ -55,26 +55,26 @@ A_STATUS DevRWCompletionHandler(void *context, A_STATUS status)
AR_DEBUG_PRINTF(ATH_DEBUG_RECV, AR_DEBUG_PRINTF(ATH_DEBUG_RECV,
("-DevRWCompletionHandler\n")); ("-DevRWCompletionHandler\n"));
return A_OK; return 0;
} }
/* mailbox recv message polling */ /* mailbox recv message polling */
A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, int DevPollMboxMsgRecv(struct ar6k_device *pDev,
A_UINT32 *pLookAhead, u32 *pLookAhead,
int TimeoutMS) int TimeoutMS)
{ {
A_STATUS status = A_OK; int status = 0;
int timeout = TimeoutMS/DELAY_PER_INTERVAL_MS; int timeout = TimeoutMS/DELAY_PER_INTERVAL_MS;
A_ASSERT(timeout > 0); A_ASSERT(timeout > 0);
AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+DevPollMboxMsgRecv \n")); AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+DevPollMboxMsgRecv \n"));
while (TRUE) { while (true) {
if (pDev->GetPendingEventsFunc != NULL) { if (pDev->GetPendingEventsFunc != NULL) {
HIF_PENDING_EVENTS_INFO events; struct hif_pending_events_info events;
#ifdef THREAD_X #ifdef THREAD_X
events.Polling =1; events.Polling =1;
...@@ -85,7 +85,7 @@ A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, ...@@ -85,7 +85,7 @@ A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev,
status = pDev->GetPendingEventsFunc(pDev->HIFDevice, status = pDev->GetPendingEventsFunc(pDev->HIFDevice,
&events, &events,
NULL); NULL);
if (A_FAILED(status)) if (status)
{ {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to get pending events \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to get pending events \n"));
break; break;
...@@ -104,12 +104,12 @@ A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, ...@@ -104,12 +104,12 @@ A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev,
/* load the register table */ /* load the register table */
status = HIFReadWrite(pDev->HIFDevice, status = HIFReadWrite(pDev->HIFDevice,
HOST_INT_STATUS_ADDRESS, HOST_INT_STATUS_ADDRESS,
(A_UINT8 *)&pDev->IrqProcRegisters, (u8 *)&pDev->IrqProcRegisters,
AR6K_IRQ_PROC_REGS_SIZE, AR6K_IRQ_PROC_REGS_SIZE,
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if (A_FAILED(status)){ if (status){
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to read register table \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to read register table \n"));
break; break;
} }
...@@ -152,11 +152,11 @@ A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev, ...@@ -152,11 +152,11 @@ A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev,
return status; return status;
} }
static A_STATUS DevServiceCPUInterrupt(AR6K_DEVICE *pDev) static int DevServiceCPUInterrupt(struct ar6k_device *pDev)
{ {
A_STATUS status; int status;
A_UINT8 cpu_int_status; u8 cpu_int_status;
A_UINT8 regBuffer[4]; u8 regBuffer[4];
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("CPU Interrupt\n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("CPU Interrupt\n"));
cpu_int_status = pDev->IrqProcRegisters.cpu_int_status & cpu_int_status = pDev->IrqProcRegisters.cpu_int_status &
...@@ -187,16 +187,16 @@ static A_STATUS DevServiceCPUInterrupt(AR6K_DEVICE *pDev) ...@@ -187,16 +187,16 @@ static A_STATUS DevServiceCPUInterrupt(AR6K_DEVICE *pDev)
HIF_WR_SYNC_BYTE_FIX, HIF_WR_SYNC_BYTE_FIX,
NULL); NULL);
A_ASSERT(status == A_OK); A_ASSERT(status == 0);
return status; return status;
} }
static A_STATUS DevServiceErrorInterrupt(AR6K_DEVICE *pDev) static int DevServiceErrorInterrupt(struct ar6k_device *pDev)
{ {
A_STATUS status; int status;
A_UINT8 error_int_status; u8 error_int_status;
A_UINT8 regBuffer[4]; u8 regBuffer[4];
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error Interrupt\n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error Interrupt\n"));
error_int_status = pDev->IrqProcRegisters.error_int_status & 0x0F; error_int_status = pDev->IrqProcRegisters.error_int_status & 0x0F;
...@@ -241,14 +241,14 @@ static A_STATUS DevServiceErrorInterrupt(AR6K_DEVICE *pDev) ...@@ -241,14 +241,14 @@ static A_STATUS DevServiceErrorInterrupt(AR6K_DEVICE *pDev)
HIF_WR_SYNC_BYTE_FIX, HIF_WR_SYNC_BYTE_FIX,
NULL); NULL);
A_ASSERT(status == A_OK); A_ASSERT(status == 0);
return status; return status;
} }
static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev) static int DevServiceDebugInterrupt(struct ar6k_device *pDev)
{ {
A_UINT32 dummy; u32 dummy;
A_STATUS status; int status;
/* Send a target failure event to the application */ /* Send a target failure event to the application */
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Target debug interrupt\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Target debug interrupt\n"));
...@@ -266,18 +266,18 @@ static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev) ...@@ -266,18 +266,18 @@ static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev)
/* read counter to clear interrupt */ /* read counter to clear interrupt */
status = HIFReadWrite(pDev->HIFDevice, status = HIFReadWrite(pDev->HIFDevice,
COUNT_DEC_ADDRESS, COUNT_DEC_ADDRESS,
(A_UINT8 *)&dummy, (u8 *)&dummy,
4, 4,
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
A_ASSERT(status == A_OK); A_ASSERT(status == 0);
return status; return status;
} }
static A_STATUS DevServiceCounterInterrupt(AR6K_DEVICE *pDev) static int DevServiceCounterInterrupt(struct ar6k_device *pDev)
{ {
A_UINT8 counter_int_status; u8 counter_int_status;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Counter Interrupt\n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Counter Interrupt\n"));
...@@ -296,21 +296,21 @@ static A_STATUS DevServiceCounterInterrupt(AR6K_DEVICE *pDev) ...@@ -296,21 +296,21 @@ static A_STATUS DevServiceCounterInterrupt(AR6K_DEVICE *pDev)
return DevServiceDebugInterrupt(pDev); return DevServiceDebugInterrupt(pDev);
} }
return A_OK; return 0;
} }
/* callback when our fetch to get interrupt status registers completes */ /* callback when our fetch to get interrupt status registers completes */
static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) static void DevGetEventAsyncHandler(void *Context, struct htc_packet *pPacket)
{ {
AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; struct ar6k_device *pDev = (struct ar6k_device *)Context;
A_UINT32 lookAhead = 0; u32 lookAhead = 0;
A_BOOL otherInts = FALSE; bool otherInts = false;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGetEventAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGetEventAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev));
do { do {
if (A_FAILED(pPacket->Status)) { if (pPacket->Status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
(" GetEvents I/O request failed, status:%d \n", pPacket->Status)); (" GetEvents I/O request failed, status:%d \n", pPacket->Status));
/* bail out, don't unmask HIF interrupt */ /* bail out, don't unmask HIF interrupt */
...@@ -319,7 +319,7 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -319,7 +319,7 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
if (pDev->GetPendingEventsFunc != NULL) { if (pDev->GetPendingEventsFunc != NULL) {
/* the HIF layer collected the information for us */ /* the HIF layer collected the information for us */
HIF_PENDING_EVENTS_INFO *pEvents = (HIF_PENDING_EVENTS_INFO *)pPacket->pBuffer; struct hif_pending_events_info *pEvents = (struct hif_pending_events_info *)pPacket->pBuffer;
if (pEvents->Events & HIF_RECV_MSG_AVAIL) { if (pEvents->Events & HIF_RECV_MSG_AVAIL) {
lookAhead = pEvents->LookAhead; lookAhead = pEvents->LookAhead;
if (0 == lookAhead) { if (0 == lookAhead) {
...@@ -327,12 +327,12 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -327,12 +327,12 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
} }
} }
if (pEvents->Events & HIF_OTHER_EVENTS) { if (pEvents->Events & HIF_OTHER_EVENTS) {
otherInts = TRUE; otherInts = true;
} }
} else { } else {
/* standard interrupt table handling.... */ /* standard interrupt table handling.... */
AR6K_IRQ_PROC_REGISTERS *pReg = (AR6K_IRQ_PROC_REGISTERS *)pPacket->pBuffer; struct ar6k_irq_proc_registers *pReg = (struct ar6k_irq_proc_registers *)pPacket->pBuffer;
A_UINT8 host_int_status; u8 host_int_status;
host_int_status = pReg->host_int_status & pDev->IrqEnableRegisters.int_status_enable; host_int_status = pReg->host_int_status & pDev->IrqEnableRegisters.int_status_enable;
...@@ -349,7 +349,7 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -349,7 +349,7 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
if (host_int_status) { if (host_int_status) {
/* there are other interrupts to handle */ /* there are other interrupts to handle */
otherInts = TRUE; otherInts = true;
} }
} }
...@@ -363,7 +363,7 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -363,7 +363,7 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
HIFAckInterrupt(pDev->HIFDevice); HIFAckInterrupt(pDev->HIFDevice);
} else { } else {
int fetched = 0; int fetched = 0;
A_STATUS status; int status;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
(" DevGetEventAsyncHandler : detected another message, lookahead :0x%X \n", (" DevGetEventAsyncHandler : detected another message, lookahead :0x%X \n",
...@@ -372,14 +372,14 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -372,14 +372,14 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
* go get the next message */ * go get the next message */
status = pDev->MessagePendingCallback(pDev->HTCContext, &lookAhead, 1, NULL, &fetched); status = pDev->MessagePendingCallback(pDev->HTCContext, &lookAhead, 1, NULL, &fetched);
if (A_SUCCESS(status) && !fetched) { if (!status && !fetched) {
/* HTC layer could not pull out messages due to lack of resources, stop IRQ processing */ /* HTC layer could not pull out messages due to lack of resources, stop IRQ processing */
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("MessagePendingCallback did not pull any messages, force-ack \n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("MessagePendingCallback did not pull any messages, force-ack \n"));
DevAsyncIrqProcessComplete(pDev); DevAsyncIrqProcessComplete(pDev);
} }
} }
} while (FALSE); } while (false);
/* free this IO packet */ /* free this IO packet */
AR6KFreeIOPacket(pDev,pPacket); AR6KFreeIOPacket(pDev,pPacket);
...@@ -388,11 +388,11 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -388,11 +388,11 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
/* called by the HTC layer when it wants us to check if the device has any more pending /* called by the HTC layer when it wants us to check if the device has any more pending
* recv messages, this starts off a series of async requests to read interrupt registers */ * recv messages, this starts off a series of async requests to read interrupt registers */
A_STATUS DevCheckPendingRecvMsgsAsync(void *context) int DevCheckPendingRecvMsgsAsync(void *context)
{ {
AR6K_DEVICE *pDev = (AR6K_DEVICE *)context; struct ar6k_device *pDev = (struct ar6k_device *)context;
A_STATUS status = A_OK; int status = 0;
HTC_PACKET *pIOPacket; struct htc_packet *pIOPacket;
/* this is called in an ASYNC only context, we may NOT block, sleep or call any apis that can /* this is called in an ASYNC only context, we may NOT block, sleep or call any apis that can
* cause us to switch contexts */ * cause us to switch contexts */
...@@ -428,7 +428,7 @@ A_STATUS DevCheckPendingRecvMsgsAsync(void *context) ...@@ -428,7 +428,7 @@ A_STATUS DevCheckPendingRecvMsgsAsync(void *context)
/* there should be only 1 asynchronous request out at a time to read these registers /* there should be only 1 asynchronous request out at a time to read these registers
* so this should actually never happen */ * so this should actually never happen */
status = A_NO_MEMORY; status = A_NO_MEMORY;
A_ASSERT(FALSE); A_ASSERT(false);
break; break;
} }
...@@ -439,7 +439,7 @@ A_STATUS DevCheckPendingRecvMsgsAsync(void *context) ...@@ -439,7 +439,7 @@ A_STATUS DevCheckPendingRecvMsgsAsync(void *context)
if (pDev->GetPendingEventsFunc) { if (pDev->GetPendingEventsFunc) {
/* HIF layer has it's own mechanism, pass the IO to it.. */ /* HIF layer has it's own mechanism, pass the IO to it.. */
status = pDev->GetPendingEventsFunc(pDev->HIFDevice, status = pDev->GetPendingEventsFunc(pDev->HIFDevice,
(HIF_PENDING_EVENTS_INFO *)pIOPacket->pBuffer, (struct hif_pending_events_info *)pIOPacket->pBuffer,
pIOPacket); pIOPacket);
} else { } else {
...@@ -453,25 +453,25 @@ A_STATUS DevCheckPendingRecvMsgsAsync(void *context) ...@@ -453,25 +453,25 @@ A_STATUS DevCheckPendingRecvMsgsAsync(void *context)
} }
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,(" Async IO issued to get interrupt status...\n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,(" Async IO issued to get interrupt status...\n"));
} while (FALSE); } while (false);
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevCheckPendingRecvMsgsAsync \n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevCheckPendingRecvMsgsAsync \n"));
return status; return status;
} }
void DevAsyncIrqProcessComplete(AR6K_DEVICE *pDev) void DevAsyncIrqProcessComplete(struct ar6k_device *pDev)
{ {
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("DevAsyncIrqProcessComplete - forcing HIF IRQ ACK \n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("DevAsyncIrqProcessComplete - forcing HIF IRQ ACK \n"));
HIFAckInterrupt(pDev->HIFDevice); HIFAckInterrupt(pDev->HIFDevice);
} }
/* process pending interrupts synchronously */ /* process pending interrupts synchronously */
static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pASyncProcessing) static int ProcessPendingIRQs(struct ar6k_device *pDev, bool *pDone, bool *pASyncProcessing)
{ {
A_STATUS status = A_OK; int status = 0;
A_UINT8 host_int_status = 0; u8 host_int_status = 0;
A_UINT32 lookAhead = 0; u32 lookAhead = 0;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+ProcessPendingIRQs: (dev: 0x%lX)\n", (unsigned long)pDev)); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+ProcessPendingIRQs: (dev: 0x%lX)\n", (unsigned long)pDev));
...@@ -490,7 +490,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -490,7 +490,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
} }
if (pDev->GetPendingEventsFunc != NULL) { if (pDev->GetPendingEventsFunc != NULL) {
HIF_PENDING_EVENTS_INFO events; struct hif_pending_events_info events;
#ifdef THREAD_X #ifdef THREAD_X
events.Polling= 0; events.Polling= 0;
...@@ -501,7 +501,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -501,7 +501,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
&events, &events,
NULL); NULL);
if (A_FAILED(status)) { if (status) {
break; break;
} }
...@@ -545,12 +545,12 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -545,12 +545,12 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
#endif /* CONFIG_MMC_SDHCI_S3C */ #endif /* CONFIG_MMC_SDHCI_S3C */
status = HIFReadWrite(pDev->HIFDevice, status = HIFReadWrite(pDev->HIFDevice,
HOST_INT_STATUS_ADDRESS, HOST_INT_STATUS_ADDRESS,
(A_UINT8 *)&pDev->IrqProcRegisters, (u8 *)&pDev->IrqProcRegisters,
AR6K_IRQ_PROC_REGS_SIZE, AR6K_IRQ_PROC_REGS_SIZE,
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if (A_FAILED(status)) { if (status) {
break; break;
} }
...@@ -591,19 +591,19 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -591,19 +591,19 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
status = DevCheckGMboxInterrupts(pDev); status = DevCheckGMboxInterrupts(pDev);
} }
} while (FALSE); } while (false);
do { do {
/* did the interrupt status fetches succeed? */ /* did the interrupt status fetches succeed? */
if (A_FAILED(status)) { if (status) {
break; break;
} }
if ((0 == host_int_status) && (0 == lookAhead)) { if ((0 == host_int_status) && (0 == lookAhead)) {
/* nothing to process, the caller can use this to break out of a loop */ /* nothing to process, the caller can use this to break out of a loop */
*pDone = TRUE; *pDone = true;
break; break;
} }
...@@ -617,14 +617,14 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -617,14 +617,14 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
* completion routine of the callers read request. This can improve performance * completion routine of the callers read request. This can improve performance
* by reducing context switching when we rapidly pull packets */ * by reducing context switching when we rapidly pull packets */
status = pDev->MessagePendingCallback(pDev->HTCContext, &lookAhead, 1, pASyncProcessing, &fetched); status = pDev->MessagePendingCallback(pDev->HTCContext, &lookAhead, 1, pASyncProcessing, &fetched);
if (A_FAILED(status)) { if (status) {
break; break;
} }
if (!fetched) { if (!fetched) {
/* HTC could not pull any messages out due to lack of resources */ /* HTC could not pull any messages out due to lack of resources */
/* force DSR handler to ack the interrupt */ /* force DSR handler to ack the interrupt */
*pASyncProcessing = FALSE; *pASyncProcessing = false;
pDev->RecheckIRQStatusCnt = 0; pDev->RecheckIRQStatusCnt = 0;
} }
} }
...@@ -637,7 +637,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -637,7 +637,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
if (HOST_INT_STATUS_CPU_GET(host_int_status)) { if (HOST_INT_STATUS_CPU_GET(host_int_status)) {
/* CPU Interrupt */ /* CPU Interrupt */
status = DevServiceCPUInterrupt(pDev); status = DevServiceCPUInterrupt(pDev);
if (A_FAILED(status)){ if (status){
break; break;
} }
} }
...@@ -645,7 +645,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -645,7 +645,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
if (HOST_INT_STATUS_ERROR_GET(host_int_status)) { if (HOST_INT_STATUS_ERROR_GET(host_int_status)) {
/* Error Interrupt */ /* Error Interrupt */
status = DevServiceErrorInterrupt(pDev); status = DevServiceErrorInterrupt(pDev);
if (A_FAILED(status)){ if (status){
break; break;
} }
} }
...@@ -653,12 +653,12 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -653,12 +653,12 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
if (HOST_INT_STATUS_COUNTER_GET(host_int_status)) { if (HOST_INT_STATUS_COUNTER_GET(host_int_status)) {
/* Counter Interrupt */ /* Counter Interrupt */
status = DevServiceCounterInterrupt(pDev); status = DevServiceCounterInterrupt(pDev);
if (A_FAILED(status)){ if (status){
break; break;
} }
} }
} while (FALSE); } while (false);
/* an optimization to bypass reading the IRQ status registers unecessarily which can re-wake /* an optimization to bypass reading the IRQ status registers unecessarily which can re-wake
* the target, if upper layers determine that we are in a low-throughput mode, we can * the target, if upper layers determine that we are in a low-throughput mode, we can
...@@ -670,7 +670,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -670,7 +670,7 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
* messages from the mailbox before exiting the ISR routine. */ * messages from the mailbox before exiting the ISR routine. */
if (!(*pASyncProcessing) && (pDev->RecheckIRQStatusCnt == 0) && (pDev->GetPendingEventsFunc == NULL)) { if (!(*pASyncProcessing) && (pDev->RecheckIRQStatusCnt == 0) && (pDev->GetPendingEventsFunc == NULL)) {
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("Bypassing IRQ Status re-check, forcing done \n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("Bypassing IRQ Status re-check, forcing done \n"));
*pDone = TRUE; *pDone = true;
} }
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-ProcessPendingIRQs: (done:%d, async:%d) status=%d \n", AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-ProcessPendingIRQs: (done:%d, async:%d) status=%d \n",
...@@ -681,12 +681,12 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS ...@@ -681,12 +681,12 @@ static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pAS
/* Synchronousinterrupt handler, this handler kicks off all interrupt processing.*/ /* Synchronousinterrupt handler, this handler kicks off all interrupt processing.*/
A_STATUS DevDsrHandler(void *context) int DevDsrHandler(void *context)
{ {
AR6K_DEVICE *pDev = (AR6K_DEVICE *)context; struct ar6k_device *pDev = (struct ar6k_device *)context;
A_STATUS status = A_OK; int status = 0;
A_BOOL done = FALSE; bool done = false;
A_BOOL asyncProc = FALSE; bool asyncProc = false;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevDsrHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevDsrHandler: (dev: 0x%lX)\n", (unsigned long)pDev));
...@@ -697,13 +697,13 @@ A_STATUS DevDsrHandler(void *context) ...@@ -697,13 +697,13 @@ A_STATUS DevDsrHandler(void *context)
while (!done) { while (!done) {
status = ProcessPendingIRQs(pDev, &done, &asyncProc); status = ProcessPendingIRQs(pDev, &done, &asyncProc);
if (A_FAILED(status)) { if (status) {
break; break;
} }
if (HIF_DEVICE_IRQ_SYNC_ONLY == pDev->HifIRQProcessingMode) { if (HIF_DEVICE_IRQ_SYNC_ONLY == pDev->HifIRQProcessingMode) {
/* the HIF layer does not allow async IRQ processing, override the asyncProc flag */ /* the HIF layer does not allow async IRQ processing, override the asyncProc flag */
asyncProc = FALSE; asyncProc = false;
/* this will cause us to re-enter ProcessPendingIRQ() and re-read interrupt status registers. /* this will cause us to re-enter ProcessPendingIRQ() and re-read interrupt status registers.
* this has a nice side effect of blocking us until all async read requests are completed. * this has a nice side effect of blocking us until all async read requests are completed.
* This behavior is required on some HIF implementations that do not allow ASYNC * This behavior is required on some HIF implementations that do not allow ASYNC
...@@ -725,7 +725,7 @@ A_STATUS DevDsrHandler(void *context) ...@@ -725,7 +725,7 @@ A_STATUS DevDsrHandler(void *context)
} }
if (A_SUCCESS(status) && !asyncProc) { if (!status && !asyncProc) {
/* Ack the interrupt only if : /* Ack the interrupt only if :
* 1. we did not get any errors in processing interrupts * 1. we did not get any errors in processing interrupts
* 2. there are no outstanding async processing requests */ * 2. there are no outstanding async processing requests */
...@@ -744,26 +744,26 @@ A_STATUS DevDsrHandler(void *context) ...@@ -744,26 +744,26 @@ A_STATUS DevDsrHandler(void *context)
} }
#ifdef ATH_DEBUG_MODULE #ifdef ATH_DEBUG_MODULE
void DumpAR6KDevState(AR6K_DEVICE *pDev) void DumpAR6KDevState(struct ar6k_device *pDev)
{ {
A_STATUS status; int status;
AR6K_IRQ_ENABLE_REGISTERS regs; struct ar6k_irq_enable_registers regs;
AR6K_IRQ_PROC_REGISTERS procRegs; struct ar6k_irq_proc_registers procRegs;
LOCK_AR6K(pDev); LOCK_AR6K(pDev);
/* copy into our temp area */ /* copy into our temp area */
A_MEMCPY(&regs,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); memcpy(&regs,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE);
UNLOCK_AR6K(pDev); UNLOCK_AR6K(pDev);
/* load the register table from the device */ /* load the register table from the device */
status = HIFReadWrite(pDev->HIFDevice, status = HIFReadWrite(pDev->HIFDevice,
HOST_INT_STATUS_ADDRESS, HOST_INT_STATUS_ADDRESS,
(A_UINT8 *)&procRegs, (u8 *)&procRegs,
AR6K_IRQ_PROC_REGS_SIZE, AR6K_IRQ_PROC_REGS_SIZE,
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if (A_FAILED(status)) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("DumpAR6KDevState : Failed to read register table (%d) \n",status)); ("DumpAR6KDevState : Failed to read register table (%d) \n",status));
return; return;
......
...@@ -54,18 +54,18 @@ ...@@ -54,18 +54,18 @@
/* external APIs for allocating and freeing internal I/O packets to handle ASYNC I/O */ /* external APIs for allocating and freeing internal I/O packets to handle ASYNC I/O */
extern void AR6KFreeIOPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket); extern void AR6KFreeIOPacket(struct ar6k_device *pDev, struct htc_packet *pPacket);
extern HTC_PACKET *AR6KAllocIOPacket(AR6K_DEVICE *pDev); extern struct htc_packet *AR6KAllocIOPacket(struct ar6k_device *pDev);
/* callback when our fetch to enable/disable completes */ /* callback when our fetch to enable/disable completes */
static void DevGMboxIRQActionAsyncHandler(void *Context, HTC_PACKET *pPacket) static void DevGMboxIRQActionAsyncHandler(void *Context, struct htc_packet *pPacket)
{ {
AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; struct ar6k_device *pDev = (struct ar6k_device *)Context;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGMboxIRQActionAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGMboxIRQActionAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev));
if (A_FAILED(pPacket->Status)) { if (pPacket->Status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("IRQAction Operation (%d) failed! status:%d \n", pPacket->PktInfo.AsRx.HTCRxFlags,pPacket->Status)); ("IRQAction Operation (%d) failed! status:%d \n", pPacket->PktInfo.AsRx.HTCRxFlags,pPacket->Status));
} }
...@@ -74,26 +74,26 @@ static void DevGMboxIRQActionAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -74,26 +74,26 @@ static void DevGMboxIRQActionAsyncHandler(void *Context, HTC_PACKET *pPacket)
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGMboxIRQActionAsyncHandler \n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGMboxIRQActionAsyncHandler \n"));
} }
static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A_BOOL AsyncMode) static int DevGMboxCounterEnableDisable(struct ar6k_device *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, bool AsyncMode)
{ {
A_STATUS status = A_OK; int status = 0;
AR6K_IRQ_ENABLE_REGISTERS regs; struct ar6k_irq_enable_registers regs;
HTC_PACKET *pIOPacket = NULL; struct htc_packet *pIOPacket = NULL;
LOCK_AR6K(pDev); LOCK_AR6K(pDev);
if (GMBOX_CREDIT_IRQ_ENABLE == IrqAction) { if (GMBOX_CREDIT_IRQ_ENABLE == IrqAction) {
pDev->GMboxInfo.CreditCountIRQEnabled = TRUE; pDev->GMboxInfo.CreditCountIRQEnabled = true;
pDev->IrqEnableRegisters.counter_int_status_enable |= pDev->IrqEnableRegisters.counter_int_status_enable |=
COUNTER_INT_STATUS_ENABLE_BIT_SET(1 << AR6K_GMBOX_CREDIT_COUNTER); COUNTER_INT_STATUS_ENABLE_BIT_SET(1 << AR6K_GMBOX_CREDIT_COUNTER);
pDev->IrqEnableRegisters.int_status_enable |= INT_STATUS_ENABLE_COUNTER_SET(0x01); pDev->IrqEnableRegisters.int_status_enable |= INT_STATUS_ENABLE_COUNTER_SET(0x01);
} else { } else {
pDev->GMboxInfo.CreditCountIRQEnabled = FALSE; pDev->GMboxInfo.CreditCountIRQEnabled = false;
pDev->IrqEnableRegisters.counter_int_status_enable &= pDev->IrqEnableRegisters.counter_int_status_enable &=
~(COUNTER_INT_STATUS_ENABLE_BIT_SET(1 << AR6K_GMBOX_CREDIT_COUNTER)); ~(COUNTER_INT_STATUS_ENABLE_BIT_SET(1 << AR6K_GMBOX_CREDIT_COUNTER));
} }
/* copy into our temp area */ /* copy into our temp area */
A_MEMCPY(&regs,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); memcpy(&regs,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE);
UNLOCK_AR6K(pDev); UNLOCK_AR6K(pDev);
...@@ -105,12 +105,12 @@ static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION ...@@ -105,12 +105,12 @@ static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION
if (NULL == pIOPacket) { if (NULL == pIOPacket) {
status = A_NO_MEMORY; status = A_NO_MEMORY;
A_ASSERT(FALSE); A_ASSERT(false);
break; break;
} }
/* copy values to write to our async I/O buffer */ /* copy values to write to our async I/O buffer */
A_MEMCPY(pIOPacket->pBuffer,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE); memcpy(pIOPacket->pBuffer,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE);
/* stick in our completion routine when the I/O operation completes */ /* stick in our completion routine when the I/O operation completes */
pIOPacket->Completion = DevGMboxIRQActionAsyncHandler; pIOPacket->Completion = DevGMboxIRQActionAsyncHandler;
...@@ -135,9 +135,9 @@ static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION ...@@ -135,9 +135,9 @@ static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION
AR6K_IRQ_ENABLE_REGS_SIZE, AR6K_IRQ_ENABLE_REGS_SIZE,
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
} while (FALSE); } while (false);
if (A_FAILED(status)) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
(" IRQAction Operation (%d) failed! status:%d \n", IrqAction, status)); (" IRQAction Operation (%d) failed! status:%d \n", IrqAction, status));
} else { } else {
...@@ -155,11 +155,11 @@ static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION ...@@ -155,11 +155,11 @@ static A_STATUS DevGMboxCounterEnableDisable(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION
} }
A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A_BOOL AsyncMode) int DevGMboxIRQAction(struct ar6k_device *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, bool AsyncMode)
{ {
A_STATUS status = A_OK; int status = 0;
HTC_PACKET *pIOPacket = NULL; struct htc_packet *pIOPacket = NULL;
A_UINT8 GMboxIntControl[4]; u8 GMboxIntControl[4];
if (GMBOX_CREDIT_IRQ_ENABLE == IrqAction) { if (GMBOX_CREDIT_IRQ_ENABLE == IrqAction) {
return DevGMboxCounterEnableDisable(pDev, GMBOX_CREDIT_IRQ_ENABLE, AsyncMode); return DevGMboxCounterEnableDisable(pDev, GMBOX_CREDIT_IRQ_ENABLE, AsyncMode);
...@@ -192,7 +192,7 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A ...@@ -192,7 +192,7 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A
break; break;
case GMBOX_ACTION_NONE: case GMBOX_ACTION_NONE:
default: default:
A_ASSERT(FALSE); A_ASSERT(false);
break; break;
} }
...@@ -211,12 +211,12 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A ...@@ -211,12 +211,12 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A
if (NULL == pIOPacket) { if (NULL == pIOPacket) {
status = A_NO_MEMORY; status = A_NO_MEMORY;
A_ASSERT(FALSE); A_ASSERT(false);
break; break;
} }
/* copy values to write to our async I/O buffer */ /* copy values to write to our async I/O buffer */
A_MEMCPY(pIOPacket->pBuffer,GMboxIntControl,sizeof(GMboxIntControl)); memcpy(pIOPacket->pBuffer,GMboxIntControl,sizeof(GMboxIntControl));
/* stick in our completion routine when the I/O operation completes */ /* stick in our completion routine when the I/O operation completes */
pIOPacket->Completion = DevGMboxIRQActionAsyncHandler; pIOPacket->Completion = DevGMboxIRQActionAsyncHandler;
...@@ -242,9 +242,9 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A ...@@ -242,9 +242,9 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A
HIF_WR_SYNC_BYTE_FIX, HIF_WR_SYNC_BYTE_FIX,
NULL); NULL);
} while (FALSE); } while (false);
if (A_FAILED(status)) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
(" IRQAction Operation (%d) failed! status:%d \n", IrqAction, status)); (" IRQAction Operation (%d) failed! status:%d \n", IrqAction, status));
} else { } else {
...@@ -261,18 +261,18 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A ...@@ -261,18 +261,18 @@ A_STATUS DevGMboxIRQAction(AR6K_DEVICE *pDev, GMBOX_IRQ_ACTION_TYPE IrqAction, A
return status; return status;
} }
void DevCleanupGMbox(AR6K_DEVICE *pDev) void DevCleanupGMbox(struct ar6k_device *pDev)
{ {
if (pDev->GMboxEnabled) { if (pDev->GMboxEnabled) {
pDev->GMboxEnabled = FALSE; pDev->GMboxEnabled = false;
GMboxProtocolUninstall(pDev); GMboxProtocolUninstall(pDev);
} }
} }
A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) int DevSetupGMbox(struct ar6k_device *pDev)
{ {
A_STATUS status = A_OK; int status = 0;
A_UINT8 muxControl[4]; u8 muxControl[4];
do { do {
...@@ -285,7 +285,7 @@ A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) ...@@ -285,7 +285,7 @@ A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev)
status = DevGMboxIRQAction(pDev, GMBOX_DISABLE_ALL, PROC_IO_SYNC); status = DevGMboxIRQAction(pDev, GMBOX_DISABLE_ALL, PROC_IO_SYNC);
if (A_FAILED(status)) { if (status) {
break; break;
} }
...@@ -305,29 +305,29 @@ A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev) ...@@ -305,29 +305,29 @@ A_STATUS DevSetupGMbox(AR6K_DEVICE *pDev)
HIF_WR_SYNC_BYTE_FIX, /* hit this register 4 times */ HIF_WR_SYNC_BYTE_FIX, /* hit this register 4 times */
NULL); NULL);
if (A_FAILED(status)) { if (status) {
break; break;
} }
status = GMboxProtocolInstall(pDev); status = GMboxProtocolInstall(pDev);
if (A_FAILED(status)) { if (status) {
break; break;
} }
pDev->GMboxEnabled = TRUE; pDev->GMboxEnabled = true;
} while (FALSE); } while (false);
return status; return status;
} }
A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev) int DevCheckGMboxInterrupts(struct ar6k_device *pDev)
{ {
A_STATUS status = A_OK; int status = 0;
A_UINT8 counter_int_status; u8 counter_int_status;
int credits; int credits;
A_UINT8 host_int_status2; u8 host_int_status2;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("+DevCheckGMboxInterrupts \n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("+DevCheckGMboxInterrupts \n"));
...@@ -348,7 +348,7 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev) ...@@ -348,7 +348,7 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev)
status = A_ECOMM; status = A_ECOMM;
} }
if (A_FAILED(status)) { if (status) {
if (pDev->GMboxInfo.pTargetFailureCallback != NULL) { if (pDev->GMboxInfo.pTargetFailureCallback != NULL) {
pDev->GMboxInfo.pTargetFailureCallback(pDev->GMboxInfo.pProtocolContext, status); pDev->GMboxInfo.pTargetFailureCallback(pDev->GMboxInfo.pProtocolContext, status);
} }
...@@ -360,12 +360,12 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev) ...@@ -360,12 +360,12 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev)
A_ASSERT(pDev->GMboxInfo.pMessagePendingCallBack != NULL); A_ASSERT(pDev->GMboxInfo.pMessagePendingCallBack != NULL);
status = pDev->GMboxInfo.pMessagePendingCallBack( status = pDev->GMboxInfo.pMessagePendingCallBack(
pDev->GMboxInfo.pProtocolContext, pDev->GMboxInfo.pProtocolContext,
(A_UINT8 *)&pDev->IrqProcRegisters.rx_gmbox_lookahead_alias[0], (u8 *)&pDev->IrqProcRegisters.rx_gmbox_lookahead_alias[0],
pDev->IrqProcRegisters.gmbox_rx_avail); pDev->IrqProcRegisters.gmbox_rx_avail);
} }
} }
if (A_FAILED(status)) { if (status) {
break; break;
} }
...@@ -378,7 +378,7 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev) ...@@ -378,7 +378,7 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev)
/* do synchronous read */ /* do synchronous read */
status = DevGMboxReadCreditCounter(pDev, PROC_IO_SYNC, &credits); status = DevGMboxReadCreditCounter(pDev, PROC_IO_SYNC, &credits);
if (A_FAILED(status)) { if (status) {
break; break;
} }
...@@ -388,7 +388,7 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev) ...@@ -388,7 +388,7 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev)
pDev->GMboxInfo.CreditCountIRQEnabled); pDev->GMboxInfo.CreditCountIRQEnabled);
} }
} while (FALSE); } while (false);
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("-DevCheckGMboxInterrupts (%d) \n",status)); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("-DevCheckGMboxInterrupts (%d) \n",status));
...@@ -396,12 +396,12 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev) ...@@ -396,12 +396,12 @@ A_STATUS DevCheckGMboxInterrupts(AR6K_DEVICE *pDev)
} }
A_STATUS DevGMboxWrite(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 WriteLength) int DevGMboxWrite(struct ar6k_device *pDev, struct htc_packet *pPacket, u32 WriteLength)
{ {
A_UINT32 paddedLength; u32 paddedLength;
A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; bool sync = (pPacket->Completion == NULL) ? true : false;
A_STATUS status; int status;
A_UINT32 address; u32 address;
/* adjust the length to be a multiple of block size if appropriate */ /* adjust the length to be a multiple of block size if appropriate */
paddedLength = DEV_CALC_SEND_PADDED_LEN(pDev, WriteLength); paddedLength = DEV_CALC_SEND_PADDED_LEN(pDev, WriteLength);
...@@ -426,31 +426,31 @@ A_STATUS DevGMboxWrite(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 WriteLen ...@@ -426,31 +426,31 @@ A_STATUS DevGMboxWrite(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 WriteLen
pPacket->Status = status; pPacket->Status = status;
} else { } else {
if (status == A_PENDING) { if (status == A_PENDING) {
status = A_OK; status = 0;
} }
} }
return status; return status;
} }
A_STATUS DevGMboxRead(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 ReadLength) int DevGMboxRead(struct ar6k_device *pDev, struct htc_packet *pPacket, u32 ReadLength)
{ {
A_UINT32 paddedLength; u32 paddedLength;
A_STATUS status; int status;
A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE; bool sync = (pPacket->Completion == NULL) ? true : false;
/* adjust the length to be a multiple of block size if appropriate */ /* adjust the length to be a multiple of block size if appropriate */
paddedLength = DEV_CALC_RECV_PADDED_LEN(pDev, ReadLength); paddedLength = DEV_CALC_RECV_PADDED_LEN(pDev, ReadLength);
if (paddedLength > pPacket->BufferLength) { if (paddedLength > pPacket->BufferLength) {
A_ASSERT(FALSE); A_ASSERT(false);
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("DevGMboxRead, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n", ("DevGMboxRead, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n",
paddedLength,ReadLength,pPacket->BufferLength)); paddedLength,ReadLength,pPacket->BufferLength));
if (pPacket->Completion != NULL) { if (pPacket->Completion != NULL) {
COMPLETE_HTC_PACKET(pPacket,A_EINVAL); COMPLETE_HTC_PACKET(pPacket,A_EINVAL);
return A_OK; return 0;
} }
return A_EINVAL; return A_EINVAL;
} }
...@@ -477,7 +477,7 @@ A_STATUS DevGMboxRead(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 ReadLengt ...@@ -477,7 +477,7 @@ A_STATUS DevGMboxRead(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 ReadLengt
} }
static int ProcessCreditCounterReadBuffer(A_UINT8 *pBuffer, int Length) static int ProcessCreditCounterReadBuffer(u8 *pBuffer, int Length)
{ {
int credits = 0; int credits = 0;
...@@ -516,13 +516,13 @@ static int ProcessCreditCounterReadBuffer(A_UINT8 *pBuffer, int Length) ...@@ -516,13 +516,13 @@ static int ProcessCreditCounterReadBuffer(A_UINT8 *pBuffer, int Length)
/* callback when our fetch to enable/disable completes */ /* callback when our fetch to enable/disable completes */
static void DevGMboxReadCreditsAsyncHandler(void *Context, HTC_PACKET *pPacket) static void DevGMboxReadCreditsAsyncHandler(void *Context, struct htc_packet *pPacket)
{ {
AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context; struct ar6k_device *pDev = (struct ar6k_device *)Context;
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGMboxReadCreditsAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGMboxReadCreditsAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev));
if (A_FAILED(pPacket->Status)) { if (pPacket->Status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("Read Credit Operation failed! status:%d \n", pPacket->Status)); ("Read Credit Operation failed! status:%d \n", pPacket->Status));
} else { } else {
...@@ -539,10 +539,10 @@ static void DevGMboxReadCreditsAsyncHandler(void *Context, HTC_PACKET *pPacket) ...@@ -539,10 +539,10 @@ static void DevGMboxReadCreditsAsyncHandler(void *Context, HTC_PACKET *pPacket)
AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGMboxReadCreditsAsyncHandler \n")); AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGMboxReadCreditsAsyncHandler \n"));
} }
A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCredits) int DevGMboxReadCreditCounter(struct ar6k_device *pDev, bool AsyncMode, int *pCredits)
{ {
A_STATUS status = A_OK; int status = 0;
HTC_PACKET *pIOPacket = NULL; struct htc_packet *pIOPacket = NULL;
AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+DevGMboxReadCreditCounter (%s) \n", AsyncMode ? "ASYNC" : "SYNC")); AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+DevGMboxReadCreditCounter (%s) \n", AsyncMode ? "ASYNC" : "SYNC"));
...@@ -552,7 +552,7 @@ A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCr ...@@ -552,7 +552,7 @@ A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCr
if (NULL == pIOPacket) { if (NULL == pIOPacket) {
status = A_NO_MEMORY; status = A_NO_MEMORY;
A_ASSERT(FALSE); A_ASSERT(false);
break; break;
} }
...@@ -581,15 +581,15 @@ A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCr ...@@ -581,15 +581,15 @@ A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCr
AR6K_REG_IO_BUFFER_SIZE, AR6K_REG_IO_BUFFER_SIZE,
HIF_RD_SYNC_BYTE_FIX, HIF_RD_SYNC_BYTE_FIX,
NULL); NULL);
} while (FALSE); } while (false);
if (A_FAILED(status)) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
(" DevGMboxReadCreditCounter failed! status:%d \n", status)); (" DevGMboxReadCreditCounter failed! status:%d \n", status));
} }
if (pIOPacket != NULL) { if (pIOPacket != NULL) {
if (A_SUCCESS(status)) { if (!status) {
/* sync mode processing */ /* sync mode processing */
*pCredits = ProcessCreditCounterReadBuffer(pIOPacket->pBuffer, AR6K_REG_IO_BUFFER_SIZE); *pCredits = ProcessCreditCounterReadBuffer(pIOPacket->pBuffer, AR6K_REG_IO_BUFFER_SIZE);
} }
...@@ -602,10 +602,10 @@ A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCr ...@@ -602,10 +602,10 @@ A_STATUS DevGMboxReadCreditCounter(AR6K_DEVICE *pDev, A_BOOL AsyncMode, int *pCr
return status; return status;
} }
A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize) int DevGMboxReadCreditSize(struct ar6k_device *pDev, int *pCreditSize)
{ {
A_STATUS status; int status;
A_UINT8 buffer[4]; u8 buffer[4];
status = HIFReadWrite(pDev->HIFDevice, status = HIFReadWrite(pDev->HIFDevice,
AR6K_GMBOX_CREDIT_SIZE_ADDRESS, AR6K_GMBOX_CREDIT_SIZE_ADDRESS,
...@@ -614,7 +614,7 @@ A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize) ...@@ -614,7 +614,7 @@ A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize)
HIF_RD_SYNC_BYTE_FIX, /* hit the register 4 times to align the I/O */ HIF_RD_SYNC_BYTE_FIX, /* hit the register 4 times to align the I/O */
NULL); NULL);
if (A_SUCCESS(status)) { if (!status) {
if (buffer[0] == 0) { if (buffer[0] == 0) {
*pCreditSize = 256; *pCreditSize = 256;
} else { } else {
...@@ -626,7 +626,7 @@ A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize) ...@@ -626,7 +626,7 @@ A_STATUS DevGMboxReadCreditSize(AR6K_DEVICE *pDev, int *pCreditSize)
return status; return status;
} }
void DevNotifyGMboxTargetFailure(AR6K_DEVICE *pDev) void DevNotifyGMboxTargetFailure(struct ar6k_device *pDev)
{ {
/* Target ASSERTED!!! */ /* Target ASSERTED!!! */
if (pDev->GMboxInfo.pTargetFailureCallback != NULL) { if (pDev->GMboxInfo.pTargetFailureCallback != NULL) {
...@@ -634,17 +634,17 @@ void DevNotifyGMboxTargetFailure(AR6K_DEVICE *pDev) ...@@ -634,17 +634,17 @@ void DevNotifyGMboxTargetFailure(AR6K_DEVICE *pDev)
} }
} }
A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer, int *pLookAheadBytes) int DevGMboxRecvLookAheadPeek(struct ar6k_device *pDev, u8 *pLookAheadBuffer, int *pLookAheadBytes)
{ {
A_STATUS status = A_OK; int status = 0;
AR6K_IRQ_PROC_REGISTERS procRegs; struct ar6k_irq_proc_registers procRegs;
int maxCopy; int maxCopy;
do { do {
/* on entry the caller provides the length of the lookahead buffer */ /* on entry the caller provides the length of the lookahead buffer */
if (*pLookAheadBytes > sizeof(procRegs.rx_gmbox_lookahead_alias)) { if (*pLookAheadBytes > sizeof(procRegs.rx_gmbox_lookahead_alias)) {
A_ASSERT(FALSE); A_ASSERT(false);
status = A_EINVAL; status = A_EINVAL;
break; break;
} }
...@@ -654,12 +654,12 @@ A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer, ...@@ -654,12 +654,12 @@ A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer,
/* load the register table from the device */ /* load the register table from the device */
status = HIFReadWrite(pDev->HIFDevice, status = HIFReadWrite(pDev->HIFDevice,
HOST_INT_STATUS_ADDRESS, HOST_INT_STATUS_ADDRESS,
(A_UINT8 *)&procRegs, (u8 *)&procRegs,
AR6K_IRQ_PROC_REGS_SIZE, AR6K_IRQ_PROC_REGS_SIZE,
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if (A_FAILED(status)) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("DevGMboxRecvLookAheadPeek : Failed to read register table (%d) \n",status)); ("DevGMboxRecvLookAheadPeek : Failed to read register table (%d) \n",status));
break; break;
...@@ -667,20 +667,20 @@ A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer, ...@@ -667,20 +667,20 @@ A_STATUS DevGMboxRecvLookAheadPeek(AR6K_DEVICE *pDev, A_UINT8 *pLookAheadBuffer,
if (procRegs.gmbox_rx_avail > 0) { if (procRegs.gmbox_rx_avail > 0) {
int bytes = procRegs.gmbox_rx_avail > maxCopy ? maxCopy : procRegs.gmbox_rx_avail; int bytes = procRegs.gmbox_rx_avail > maxCopy ? maxCopy : procRegs.gmbox_rx_avail;
A_MEMCPY(pLookAheadBuffer,&procRegs.rx_gmbox_lookahead_alias[0],bytes); memcpy(pLookAheadBuffer,&procRegs.rx_gmbox_lookahead_alias[0],bytes);
*pLookAheadBytes = bytes; *pLookAheadBytes = bytes;
} }
} while (FALSE); } while (false);
return status; return status;
} }
A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int Signal, int AckTimeoutMS) int DevGMboxSetTargetInterrupt(struct ar6k_device *pDev, int Signal, int AckTimeoutMS)
{ {
A_STATUS status = A_OK; int status = 0;
int i; int i;
A_UINT8 buffer[4]; u8 buffer[4];
A_MEMZERO(buffer, sizeof(buffer)); A_MEMZERO(buffer, sizeof(buffer));
...@@ -701,14 +701,14 @@ A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int Signal, int AckTimeou ...@@ -701,14 +701,14 @@ A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int Signal, int AckTimeou
HIF_WR_SYNC_BYTE_FIX, /* hit the register 4 times to align the I/O */ HIF_WR_SYNC_BYTE_FIX, /* hit the register 4 times to align the I/O */
NULL); NULL);
if (A_FAILED(status)) { if (status) {
break; break;
} }
} while (FALSE); } while (false);
if (A_SUCCESS(status)) { if (!status) {
/* now read back the register to see if the bit cleared */ /* now read back the register to see if the bit cleared */
while (AckTimeoutMS) { while (AckTimeoutMS) {
status = HIFReadWrite(pDev->HIFDevice, status = HIFReadWrite(pDev->HIFDevice,
...@@ -718,7 +718,7 @@ A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int Signal, int AckTimeou ...@@ -718,7 +718,7 @@ A_STATUS DevGMboxSetTargetInterrupt(AR6K_DEVICE *pDev, int Signal, int AckTimeou
HIF_RD_SYNC_BYTE_FIX, HIF_RD_SYNC_BYTE_FIX,
NULL); NULL);
if (A_FAILED(status)) { if (status) {
break; break;
} }
......
此差异已折叠。
...@@ -57,7 +57,7 @@ extern "C" { ...@@ -57,7 +57,7 @@ extern "C" {
/* macro to make a module-specific masks */ /* macro to make a module-specific masks */
#define ATH_DEBUG_MAKE_MODULE_MASK(index) (1 << (ATH_DEBUG_MODULE_MASK_SHIFT + (index))) #define ATH_DEBUG_MAKE_MODULE_MASK(index) (1 << (ATH_DEBUG_MODULE_MASK_SHIFT + (index)))
void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription); void DebugDumpBytes(u8 *buffer, u16 length, char *pDescription);
/* Debug support on a per-module basis /* Debug support on a per-module basis
* *
...@@ -95,7 +95,7 @@ void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription); ...@@ -95,7 +95,7 @@ void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription);
* #define ATH_DEBUG_BMI ATH_DEBUG_MAKE_MODULE_MASK(0) * #define ATH_DEBUG_BMI ATH_DEBUG_MAKE_MODULE_MASK(0)
* *
* #ifdef DEBUG * #ifdef DEBUG
* static ATH_DEBUG_MASK_DESCRIPTION bmi_debug_desc[] = { * static struct ath_debug_mask_description bmi_debug_desc[] = {
* { ATH_DEBUG_BMI , "BMI Tracing"}, <== description of the module specific mask * { ATH_DEBUG_BMI , "BMI Tracing"}, <== description of the module specific mask
* }; * };
* *
...@@ -118,24 +118,24 @@ void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription); ...@@ -118,24 +118,24 @@ void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription);
#define ATH_DEBUG_MAX_MASK_DESC_LENGTH 32 #define ATH_DEBUG_MAX_MASK_DESC_LENGTH 32
#define ATH_DEBUG_MAX_MOD_DESC_LENGTH 64 #define ATH_DEBUG_MAX_MOD_DESC_LENGTH 64
typedef struct { struct ath_debug_mask_description {
A_UINT32 Mask; u32 Mask;
A_CHAR Description[ATH_DEBUG_MAX_MASK_DESC_LENGTH]; char Description[ATH_DEBUG_MAX_MASK_DESC_LENGTH];
} ATH_DEBUG_MASK_DESCRIPTION; };
#define ATH_DEBUG_INFO_FLAGS_REGISTERED (1 << 0) #define ATH_DEBUG_INFO_FLAGS_REGISTERED (1 << 0)
typedef struct _ATH_DEBUG_MODULE_DBG_INFO{ typedef struct _ATH_DEBUG_MODULE_DBG_INFO{
struct _ATH_DEBUG_MODULE_DBG_INFO *pNext; struct _ATH_DEBUG_MODULE_DBG_INFO *pNext;
A_CHAR ModuleName[16]; char ModuleName[16];
A_CHAR ModuleDescription[ATH_DEBUG_MAX_MOD_DESC_LENGTH]; char ModuleDescription[ATH_DEBUG_MAX_MOD_DESC_LENGTH];
A_UINT32 Flags; u32 Flags;
A_UINT32 CurrentMask; u32 CurrentMask;
int MaxDescriptions; int MaxDescriptions;
ATH_DEBUG_MASK_DESCRIPTION *pMaskDescriptions; /* pointer to array of descriptions */ struct ath_debug_mask_description *pMaskDescriptions; /* pointer to array of descriptions */
} ATH_DEBUG_MODULE_DBG_INFO; } ATH_DEBUG_MODULE_DBG_INFO;
#define ATH_DEBUG_DESCRIPTION_COUNT(d) (int)((sizeof((d))) / (sizeof(ATH_DEBUG_MASK_DESCRIPTION))) #define ATH_DEBUG_DESCRIPTION_COUNT(d) (int)((sizeof((d))) / (sizeof(struct ath_debug_mask_description)))
#define GET_ATH_MODULE_DEBUG_VAR_NAME(s) _XGET_ATH_MODULE_NAME_DEBUG_(s) #define GET_ATH_MODULE_DEBUG_VAR_NAME(s) _XGET_ATH_MODULE_NAME_DEBUG_(s)
#define GET_ATH_MODULE_DEBUG_VAR_MASK(s) _XGET_ATH_MODULE_NAME_DEBUG_(s).CurrentMask #define GET_ATH_MODULE_DEBUG_VAR_MASK(s) _XGET_ATH_MODULE_NAME_DEBUG_(s).CurrentMask
...@@ -181,9 +181,9 @@ void a_register_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo); ...@@ -181,9 +181,9 @@ void a_register_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo);
#endif #endif
A_STATUS a_get_module_mask(A_CHAR *module_name, A_UINT32 *pMask); int a_get_module_mask(char *module_name, u32 *pMask);
A_STATUS a_set_module_mask(A_CHAR *module_name, A_UINT32 Mask); int a_set_module_mask(char *module_name, u32 Mask);
void a_dump_module_debug_info_by_name(A_CHAR *module_name); void a_dump_module_debug_info_by_name(char *module_name);
void a_module_debug_support_init(void); void a_module_debug_support_init(void);
void a_module_debug_support_cleanup(void); void a_module_debug_support_cleanup(void);
......
...@@ -188,10 +188,10 @@ extern "C" { ...@@ -188,10 +188,10 @@ extern "C" {
ar6000_dbglog_event((ar), (dropped), (buffer), (length)); ar6000_dbglog_event((ar), (dropped), (buffer), (length));
#define A_WMI_STREAM_TX_ACTIVE(devt,trafficClass) \ #define A_WMI_STREAM_TX_ACTIVE(devt,trafficClass) \
ar6000_indicate_tx_activity((devt),(trafficClass), TRUE) ar6000_indicate_tx_activity((devt),(trafficClass), true)
#define A_WMI_STREAM_TX_INACTIVE(devt,trafficClass) \ #define A_WMI_STREAM_TX_INACTIVE(devt,trafficClass) \
ar6000_indicate_tx_activity((devt),(trafficClass), FALSE) ar6000_indicate_tx_activity((devt),(trafficClass), false)
#define A_WMI_Ac2EndpointID(devht, ac)\ #define A_WMI_Ac2EndpointID(devht, ac)\
ar6000_ac2_endpoint_id((devht), (ac)) ar6000_ac2_endpoint_id((devht), (ac))
......
...@@ -30,7 +30,7 @@ extern "C" { ...@@ -30,7 +30,7 @@ extern "C" {
typedef void (* RX_CALLBACK)(void * dev, void *osbuf); typedef void (* RX_CALLBACK)(void * dev, void *osbuf);
typedef void (* ALLOC_NETBUFS)(A_NETBUF_QUEUE_T *q, A_UINT16 num); typedef void (* ALLOC_NETBUFS)(A_NETBUF_QUEUE_T *q, u16 num);
/* /*
* aggr_init: * aggr_init:
...@@ -64,7 +64,7 @@ aggr_register_rx_dispatcher(void *cntxt, void * dev, RX_CALLBACK fn); ...@@ -64,7 +64,7 @@ aggr_register_rx_dispatcher(void *cntxt, void * dev, RX_CALLBACK fn);
* up to the indicated sequence number. * up to the indicated sequence number.
*/ */
void void
aggr_process_bar(void *cntxt, A_UINT8 tid, A_UINT16 seq_no); aggr_process_bar(void *cntxt, u8 tid, u16 seq_no);
/* /*
...@@ -82,7 +82,7 @@ aggr_process_bar(void *cntxt, A_UINT8 tid, A_UINT16 seq_no); ...@@ -82,7 +82,7 @@ aggr_process_bar(void *cntxt, A_UINT8 tid, A_UINT16 seq_no);
* in hold_q to OS. * in hold_q to OS.
*/ */
void void
aggr_recv_addba_req_evt(void * cntxt, A_UINT8 tid, A_UINT16 seq_no, A_UINT8 win_sz); aggr_recv_addba_req_evt(void * cntxt, u8 tid, u16 seq_no, u8 win_sz);
/* /*
...@@ -93,7 +93,7 @@ aggr_recv_addba_req_evt(void * cntxt, A_UINT8 tid, A_UINT16 seq_no, A_UINT8 win_ ...@@ -93,7 +93,7 @@ aggr_recv_addba_req_evt(void * cntxt, A_UINT8 tid, A_UINT16 seq_no, A_UINT8 win_
* aggr is not enabled on any tid. * aggr is not enabled on any tid.
*/ */
void void
aggr_recv_delba_req_evt(void * cntxt, A_UINT8 tid); aggr_recv_delba_req_evt(void * cntxt, u8 tid);
...@@ -108,7 +108,7 @@ aggr_recv_delba_req_evt(void * cntxt, A_UINT8 tid); ...@@ -108,7 +108,7 @@ aggr_recv_delba_req_evt(void * cntxt, A_UINT8 tid);
* callback may be called to deliver frames in order. * callback may be called to deliver frames in order.
*/ */
void void
aggr_process_recv_frm(void *cntxt, A_UINT8 tid, A_UINT16 seq_no, A_BOOL is_amsdu, void **osbuf); aggr_process_recv_frm(void *cntxt, u8 tid, u16 seq_no, bool is_amsdu, void **osbuf);
/* /*
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册