Discussion:
[Acx100-devel] [PATCH 01/29] common.c: add several BUILD_BUG_DECLs
Jim Cromie
2012-05-12 06:24:40 UTC
Permalink
hi Oliver,

Heres the next batch, on v20120509

0001-common.c-add-several-BUILD_BUG_DECLs.patch

- a series of style fixes, mostly // conversions to /* */
some brace placement cleanups

0002-common.c-style-fixes.patch
0003-style-convert-all-in-.c-to.patch
0004-merge.c-fix-comment-w-in-comment.patch
0005-usb.h-fix-comments.patch
0006-style-fix-comments-in-a-bunch-of-headers.patch
0007-acx_func.h-fix-comments-some-manually.patch
0008-style-fix-in-acx_struct_hw.h-inc-manual-fixes.patch
0009-acx_struct_dev.h-fix-inc-manual-tweaks.patch

- compile cleanups

0010-pci.h-add-ifdef-guard.patch
0011-pci.h-add-stubs-for-no-pci-compiles.patch

- move proc-files to debugfs

0012-debugfs.c-working-debugfs-file-reads.patch
0013-debugfs.c-write-now-works.patch
0014-debugfs-compat-and-integration.patch

- merge cleanups, etc

0015-merge-use-merge-copy-of-acxmem_proc_diag_output.patch
0016-pci.c-include-io-acx.h-drop-inline-IO_ACX1XX-defn.patch
0017-merge.c-cleanup-acx_validate_fw.patch
0018-common.c-clean-up-double-prefixes-in-log-messages.patch
0019-acx_compat-cleanup-ifdefs-in-op_add-remove_interface.patch
0020-update-TODO.patch

- new merges, drop duplicate functions

0021-merge-cleanup-write_phy_reg.patch
0022-mem.h-drop-some-obsolete-fn-protos-cleanup.patch
0023-mem.c-drop-acxmem_verify_init.patch
0024-merge.c-de-duplicate-acx-_s_write_eeprom.patch
0025-merge-drop-acx-pci-mem-_read_eeprom_area.patch
0026-merge-cleanup-acx-mem-pci-_reset_dev-refs.patch
0027-acx_func.h-cleanup-rubbish.patch
0028-io-acx.h-add-ifndef-guard.patch
0029-merge-banish-ACX_MAC80211_-w-o-the-CONFIG_.patch
Jim Cromie
2012-05-12 06:24:41 UTC
Permalink
Verify that several arrays are same size on acx111 and acx100:
- acx111_ie_len__VS__acx100_ie_len,
- acx111_ie_len_dot11__VS__acx100_ie_len_dot11,
- proc_files__VS__acx_proc_show_funcs,

These are unlikely to to get checked otherwize, except by involved
functional tests at multiple rates. OTOH, they dont actually test
anything fundamental, but just catch spurious errors which drop lines
in the array initializations. It may be appropriate at some point to
add entries, thus breaking this check, but its easy to fix the
resulting error (either by adding a corresponding entry, or removing
the check).

Signed-off-by: Jim Cromie <***@gmail.com>
---
common.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/common.c b/common.c
index 2f1b338..2986b9a 100644
--- a/common.c
+++ b/common.c
@@ -502,6 +502,8 @@ static const u16 acx111_ie_len[] = {
0,
ACX1FF_IE_EEPROM_VER_LEN,
};
+BUILD_BUG_DECL(acx111_ie_len__VS__acx100_ie_len,
+ ARRAY_SIZE(acx111_ie_len) != ARRAY_SIZE(acx100_ie_len));

static const u16 acx111_ie_len_dot11[] = {
0,
@@ -525,6 +527,8 @@ static const u16 acx111_ie_len_dot11[] = {
0,
0,
};
+BUILD_BUG_DECL(acx111_ie_len_dot11__VS__acx100_ie_len_dot11,
+ ARRAY_SIZE(acx111_ie_len_dot11) != ARRAY_SIZE(acx100_ie_len_dot11));

// BOM Rate and channel definition
// ---
@@ -687,6 +691,8 @@ static acx_proc_show_t *const
acx_proc_show_antenna,
acx_proc_show_reg_domain,
};
+BUILD_BUG_DECL(proc_files__VS__acx_proc_show_funcs,
+ ARRAY_SIZE(proc_files) != ARRAY_SIZE(acx_proc_show_funcs));

static acx_proc_write_t *const
acx_proc_write_funcs[] = {
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:45 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
usb.h | 56 +++++++++++++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 25 deletions(-)

diff --git a/usb.h b/usb.h
index 6312a2a..7e73564 100644
--- a/usb.h
+++ b/usb.h
@@ -1,5 +1,5 @@

-// usb.h - included directly by common.c
+/* usb.h - included directly by common.c */

/*
* BOM Prototypes
@@ -11,55 +11,61 @@

#include <linux/usb.h>

-// Logging
+/* Logging */

-// Data Access
+/* Data Access */

-// Firmware, EEPROM, Phy
+/* Firmware, EEPROM, Phy */
int acxusb_read_phy_reg(acx_device_t * adev, u32 reg, u8 * charbuf);
int acxusb_write_phy_reg(acx_device_t * adev, u32 reg, u8 value);
-// static void acxusb_read_eeprom_version(acx_device_t * adev);
-// static int acxusb_boot(struct usb_device *usbdev, int is_tnetw1450, int *radio_type);
-// static inline int acxusb_fw_needs_padding(firmware_image_t *fw_image, unsigned int usb_maxlen);
+/* static void acxusb_read_eeprom_version(acx_device_t * adev);
+ * static int acxusb_boot(struct usb_device *usbdev, int is_tnetw1450, int *radio_type);
+ * static inline int acxusb_fw_needs_padding(firmware_image_t *fw_image, unsigned int usb_maxlen);
+ */

-// CMDs (Control Path)
+/* CMDs (Control Path) */
int acxusb_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd, void *buffer, unsigned buflen, unsigned timeout, const char *cmdstr);

-// Init, Configure (Control Path)
-// static int acxusb_fill_configoption(acx_device_t * adev);
+/* Init, Configure (Control Path)
+ * static int acxusb_fill_configoption(acx_device_t * adev);
+ */

-// Other (Control Path)
+/* Other (Control Path) */

-// Proc, Debug
+/* Proc, Debug */
#ifdef UNUSED
static void dump_device(struct usb_device *usbdev);
static void dump_config_descriptor(struct usb_config_descriptor *cd);
static void dump_device_descriptor(struct usb_device_descriptor *dd);
#endif

-// Rx Path
-// static void acxusb_complete_rx(struct urb *);
-// static void acxusb_poll_rx(acx_device_t * adev, usb_rx_t * rx);
+/* Rx Path
+ * static void acxusb_complete_rx(struct urb *);
+ * static void acxusb_poll_rx(acx_device_t * adev, usb_rx_t * rx);
+ */

-// Tx Path
+/* Tx Path */
tx_t *acxusb_alloc_tx(acx_device_t *adev);
void acxusb_dealloc_tx(tx_t * tx_opaque);
void *acxusb_get_txbuf(acx_device_t * adev, tx_t * tx_opaque);
void acxusb_tx_data(acx_device_t *adev, tx_t *tx_opaque, int wlanpkt_len, struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);

-// Irq Handling, Timer
+/* Irq Handling, Timer */
void acxusb_irq_work(struct work_struct *work);

-// Mac80211 Ops
-// static int acxusb_op_start(struct ieee80211_hw *);
-// static void acxusb_op_stop(struct ieee80211_hw *);
+/* Mac80211 Ops
+ * static int acxusb_op_start(struct ieee80211_hw *);
+ * static void acxusb_op_stop(struct ieee80211_hw *);
+ */

-// Helpers
-// static void acxusb_unlink_urb(struct urb *urb);
+/* Helpers
+ * static void acxusb_unlink_urb(struct urb *urb);
+ */

-// Driver, Module
-// static int acxusb_probe(struct usb_interface *intf, const struct usb_device_id *devID);
-// static void acxusb_disconnect(struct usb_interface *intf);
+/* Driver, Module
+ * static int acxusb_probe(struct usb_interface *intf, const struct usb_device_id *devID);
+ * static void acxusb_disconnect(struct usb_interface *intf);
+ */

int __init acxusb_init_module(void);
void __exit acxusb_cleanup_module(void);
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:46 UTC
Permalink
skips a few where conversion (by script) creates compile errs.

Signed-off-by: Jim Cromie <***@gmail.com>
---
acx.h | 5 +++--
acx_compat.h | 2 +-
interrupt-masks.h | 12 ++++++------
io-acx.h | 5 +++--
mem-inlines.h | 2 +-
mem.h | 7 ++++---
pci.h | 26 ++++++++++++++------------
7 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/acx.h b/acx.h
index 5550efc..5f764a8 100644
--- a/acx.h
+++ b/acx.h
@@ -19,8 +19,9 @@
#define _ACX_H_

#define NONESSENTIAL_FEATURES 1 // acx_show_card_eeprom_id()
-//#define UNUSED 0 // lots of errs ifdefd
-//#define CONFIG_PM 0 // in include/generated/autoconf.h
+/* #define UNUSED 0 // lots of errs if defd
+ * #define CONFIG_PM 0 // in include/generated/autoconf.h
+ */

#include "acx_compat.h"
#include "acx_config.h"
diff --git a/acx_compat.h b/acx_compat.h
index c25d837..f839a06 100644
--- a/acx_compat.h
+++ b/acx_compat.h
@@ -13,7 +13,7 @@ do { \

#endif

-// may get into 3.4
+/* to be submitted to LKML */
#ifndef BUILD_BUG_DECL
#define BUILD_BUG_DECL(name, condition) \
static __initdata struct { \
diff --git a/interrupt-masks.h b/interrupt-masks.h
index 87947ca..db0912a 100644
--- a/interrupt-masks.h
+++ b/interrupt-masks.h
@@ -99,7 +99,7 @@ inline void interrupt_sanity_checks(void) {}
const char *devtype_names[] = { "PCI", "USB", "MEM" };
const char *chiptype_names[] = { "", "ACX100", "ACX111" };

-// defd to textually match #define table in acx-struct-hw (then reordered)
+/* defd to textually match #define table in acx-struct-hw (then reordered) */
struct interrupt_desc {
int flagval;
char *name;
@@ -166,17 +166,17 @@ void interrupt_show_flags(u16 flagval, u16 versus)
{
int i, mask, flagdiffs;

- // pr_info("flagval:0x%x versus:0x%x\n", flagval, versus);
+ /* pr_info("flagval:0x%x versus:0x%x\n", flagval, versus); */

flagdiffs = flagval ^ versus;

- // pr_info("flagdiffs:0x%x\n", flagdiffs);
+ /* pr_info("flagdiffs:0x%x\n", flagdiffs); */

if (!flagdiffs) return;

flagdiffs = ~flagdiffs; // flags are active low

- // pr_info("~flagdiffs:0x%x\n", flagdiffs);
+ /* pr_info("~flagdiffs:0x%x\n", flagdiffs); */

for (i = 0; i < 16; i++) {
mask = 1 << i;
@@ -200,7 +200,7 @@ inline void interrupt_sanity_checks(acx_device_t *adev)
for (d = 0; d < DEVTYPE_MAX; d++) {
for (c = 0; c < CHIPTYPE_MAX; c++) {

- // skip non-devices or no-flags (same condition really)
+ /* skip non-devices or no-flags (same condition really) */
if (!interrupt_masks[d][c]) continue;
if (!chiptype_names[c]) continue;

@@ -210,7 +210,7 @@ inline void interrupt_sanity_checks(acx_device_t *adev)

interrupt_show_flags(interrupt_masks[d][c], 0);

- // continue;
+ /* continue; */

/* see diffs */
pr_info("vs devtype:%d:%s chip:%d:%s val:0x%x\n",
diff --git a/io-acx.h b/io-acx.h
index 6213832..f120ea3 100644
--- a/io-acx.h
+++ b/io-acx.h
@@ -1,6 +1,7 @@

-// ick: shouldnt declare things in headers
-// cuz including it 2x is bad
+/* ick: shouldnt declare things in headers
+ * cuz including it 2x is bad
+ */

static const u16 IO_ACX100[] = {
0x0000, /* IO_ACX_SOFT_RESET */
diff --git a/mem-inlines.h b/mem-inlines.h
index 36cbfa9..a9052b6 100644
--- a/mem-inlines.h
+++ b/mem-inlines.h
@@ -84,7 +84,7 @@
#define acx_writel(v, r) writel((v), (r))
#define acx_writew(v, r) writew((v), (r))

-// This controls checking of spin-locking in the mem-interface
+/* This controls checking of spin-locking in the mem-interface */
#define ACXMEM_SPIN_CHECK 0

#if ACXMEM_SPIN_CHECK
diff --git a/mem.h b/mem.h
index 25f823d..a701f7e 100644
--- a/mem.h
+++ b/mem.h
@@ -14,7 +14,7 @@

#define DUMP_MEM_DEFINED 1 // to insure export of dump* fns too

-// Logging
+/* Logging */

#if DUMP_MEM_DEFINED > 0
void acxmem_dump_mem(acx_device_t *adev, u32 start, int length);
@@ -71,8 +71,9 @@ static inline void acxmem_chaincopy_from_slavemem(acx_device_t *adev,
u8 *destination, u32 source, int count)
{ }

-//inline int acxmem_upload_radio(acx_device_t *adev)
-//{ return 0; }
+/* inline int acxmem_upload_radio(acx_device_t *adev)
+ * { return 0; }
+ */

static inline int acxmem_write_fw(acx_device_t *adev,
const firmware_image_t *fw_image, u32 offset)
diff --git a/pci.h b/pci.h
index eca8a7f..50a6ae6 100644
--- a/pci.h
+++ b/pci.h
@@ -7,12 +7,12 @@
#define STATick /* ick - suppress static, and thus a raft of warnings
let linker find the fns in mem.o, pci.o */

-// Logging
+/* Logging */

void acxpci_free_coherent(struct pci_dev *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle);

-// Firmware, EEPROM, Phy
+/* Firmware, EEPROM, Phy */
int acxpci_upload_radio(acx_device_t *adev);

int acxpci_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
@@ -21,33 +21,35 @@ int acxpci_validate_fw(acx_device_t *adev, const firmware_image_t *fw_image,
u32 offset);
int acxpci_upload_fw(acx_device_t *adev);

-// CMDs (Control Path)
+/* CMDs (Control Path) */
int acxpci_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
void *buffer, unsigned buflen, unsigned cmd_timeout,
const char *cmdstr);

void acxpci_init_mboxes(acx_device_t *adev);

-// Init, Configuration (Control Path)
+/* Init, Configuration (Control Path) */
int acxpci_reset_dev(acx_device_t *adev);
void acxpci_reset_mac(acx_device_t *adev);

-// Other (Control Path)
+/* Other (Control Path) */

-// Proc, Debug
+/* Proc, Debug */
int acxpci_proc_diag_output(struct seq_file *file, acx_device_t *adev);

-// Rx Path
-// Tx Path
+/* Rx Path
+ * Tx Path
+ */
tx_t *acxpci_alloc_tx(acx_device_t *adev);

-// Irq Handling, Timer
+/* Irq Handling, Timer */

-// Helpers
+/* Helpers */
void acxpci_power_led(acx_device_t *adev, int enable);

-// Ioctls
-// Driver, Module
+/* Ioctls
+ * Driver, Module
+ */

int __init acxpci_init_module(void);
void __exit acxpci_cleanup_module(void);
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:47 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_func.h | 640 ++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 332 insertions(+), 308 deletions(-)

diff --git a/acx_func.h b/acx_func.h
index 7b5d993..493da96 100644
--- a/acx_func.h
+++ b/acx_func.h
@@ -20,13 +20,15 @@

#include <linux/version.h>

-// CONFIG_ACX_MAC80211_VERSION allows to specify the version of the used
-// wireless mac80211 api, in case it is different of the used kernel.
-// OpenWRT e.g. uses a version of compat-wireless, which is ahead of
-// the used kernel.
+/* CONFIG_ACX_MAC80211_VERSION allows to specify the version of the used
+ * wireless mac80211 api, in case it is different of the used kernel.
+ * OpenWRT e.g. uses a version of compat-wireless, which is ahead of
+ * the used kernel.
+ */
//
-// CONFIG_ACX_MAC80211_VERSION can be defined on the make command line by
-// passing EXTRA_CFLAGS="-DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(2,6,34)\""
+/* CONFIG_ACX_MAC80211_VERSION can be defined on the make command line by
+ * passing EXTRA_CFLAGS="-DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(2,6,34)\""
+ */

#ifndef CONFIG_ACX_MAC80211_VERSION
#define CONFIG_ACX_MAC80211_VERSION LINUX_VERSION_CODE
@@ -43,7 +45,7 @@
#define CMD_TIMEOUT_MS(n) (n)
#define ACX_CMD_TIMEOUT_DEFAULT CMD_TIMEOUT_MS(50)

-// Define ACX_GIT_VERSION with "undef" value, if undefined for some reason
+/* Define ACX_GIT_VERSION with "undef" value, if undefined for some reason */
#ifndef ACX_GIT_VERSION
#define ACX_GIT_VERSION "unknown"
#endif
@@ -53,8 +55,9 @@
* ==================================================
*/

-// BOM Locking (Common)
-// -----
+/* BOM Locking (Common)
+ * -----
+ */

/*
* Locking is done mainly using the adev->sem.
@@ -77,101 +80,101 @@
#ifdef OW_20100613_OBSELETE_ACXLOCK_REMOVE
#if defined(PARANOID_LOCKING) /* Lock debugging */

-//- void acx_lock_debug(acx_device_t *adev, const char* where);
-//- void acx_unlock_debug(acx_device_t *adev, const char* where);
+/* - void acx_lock_debug(acx_device_t *adev, const char* where);
+ * - void acx_unlock_debug(acx_device_t *adev, const char* where);
+ */
void acx_lock_unhold(void);
-//- void acx_sem_unhold(void);
-//-
-//- static inline void
-//- acx_lock_helper(acx_device_t *adev, unsigned long *fp, const char* where)
-//- {
-//- acx_lock_debug(adev, where);
-//- spin_lock_irqsave(&adev->spinlock, *fp);
-//- }
-//- static inline void
-//- acx_unlock_helper(acx_device_t *adev, unsigned long *fp, const char* where)
-//- {
-//- acx_unlock_debug(adev, where);
-//- spin_unlock_irqrestore(&adev->spinlock, *fp);
-//- }
+/* - void acx_sem_unhold(void);
+ * -
+ * - static inline void
+ * - acx_lock_helper(acx_device_t *adev, unsigned long *fp, const char* where)
+ * - {
+ * - acx_lock_debug(adev, where);
+ * - spin_lock_irqsave(&adev->spinlock, *fp);
+ * - }
+ * - static inline void
+ * - acx_unlock_helper(acx_device_t *adev, unsigned long *fp, const char* where)
+ * - {
+ * - acx_unlock_debug(adev, where);
+ * - spin_unlock_irqrestore(&adev->spinlock, *fp);
+ * - }
+ */

#ifdef OBSELETE_OW20100613
-//- #define acx_lock(adev, flags) acx_lock_helper(adev, &(flags), //- __FILE__ ":" STRING(__LINE__))
-//- #define acx_unlock(adev, flags) acx_unlock_helper(adev, &(flags), //- __FILE__ ":" STRING(__LINE__))
+/* - #define acx_lock(adev, flags) acx_lock_helper(adev, &(flags), * - __FILE__ ":" STRING(__LINE__))
+ * - #define acx_unlock(adev, flags) acx_unlock_helper(adev, &(flags), * - __FILE__ ":" STRING(__LINE__))
+ */
#endif
-//-
+/* - */
#elif defined(DO_LOCKING)

-//#define acx_lock(adev, flags) spin_lock_irqsave(&adev->spinlock, //- flags)
-//#define acx_unlock(adev, flags) //- spin_unlock_irqrestore(&adev->spinlock, flags)
-//- #define acx_lock(adev, flags) ((void)0)
-//- #define acx_unlock(adev, flags) ((void)0)
-//-
-//- #define acx_sem_lock(adev) mutex_lock(&(adev)->mutex)
-//- #define acx_sem_unlock(adev) mutex_unlock(&(adev)->mutex)
-//- #define acx_lock_unhold() ((void)0)
-//- #define acx_sem_unhold() ((void)0)
-//-
+/* #define acx_lock(adev, flags) spin_lock_irqsave(&adev->spinlock, * - flags)
+ * #define acx_unlock(adev, flags) * - spin_unlock_irqrestore(&adev->spinlock, flags)
+ * - #define acx_lock(adev, flags) ((void)0)
+ * - #define acx_unlock(adev, flags) ((void)0)
+ * -
+ * - #define acx_sem_lock(adev) mutex_lock(&(adev)->mutex)
+ * - #define acx_sem_unlock(adev) mutex_unlock(&(adev)->mutex)
+ * - #define acx_lock_unhold() ((void)0)
+ * - #define acx_sem_unhold() ((void)0)
+ * -
+ */
#else /* no locking! :( */
-//-
-//- #define acx_lock(adev, flags) ((void)0)
-//- #define acx_unlock(adev, flags) ((void)0)
-//- #define acx_sem_lock(adev) ((void)0)
-//- #define acx_sem_unlock(adev) ((void)0)
-//- #define acx_lock_unhold() ((void)0)
-//- #define acx_sem_unhold() ((void)0)
-//-
+/* -
+ * - #define acx_lock(adev, flags) ((void)0)
+ * - #define acx_unlock(adev, flags) ((void)0)
+ * - #define acx_sem_lock(adev) ((void)0)
+ * - #define acx_sem_unlock(adev) ((void)0)
+ * - #define acx_lock_unhold() ((void)0)
+ * - #define acx_sem_unhold() ((void)0)
+ * -
+ */
#endif
#endif
-//-
-//-
-// BOM Logging (Common)
-// -----
-//-
-//- /*
-//- * LOGGING
-//- *
-//- * - Avoid SHOUTING needlessly. Avoid excessive verbosity.
-//- * Gradually remove messages which are old debugging aids.
-//- *
-//- * - Use printk() for messages which are to be always logged.
-//- * Supply either 'acx:' or '<devname>:' prefix so that user
-//- * can figure out who's speaking among other kernel chatter.
-//- * acx: is for general issues (e.g. "acx: no firmware image!")
-//- * while <devname>: is related to a particular device
-//- * (think about multi-card setup). Double check that message
-//- * is not confusing to the average user.
-//- *
-//- * - use printk KERN_xxx level only if message is not a WARNING
-//- * but is INFO, ERR etc.
-//- *
-//- * - Use printk_ratelimited() for messages which may flood
-//- * (e.g. "rx DUP pkt!").
-//- *
-//- * - Use log() for messages which may be omitted (and they
-//- * _will_ be omitted in non-debug builds). Note that
-//- * message levels may be disabled at compile-time selectively,
-//- * thus select them wisely. Example: L_DEBUG is the lowest
-//- * (most likely to be compiled out) -> use for less important stuff.
-//- *
-//- * - Do not print important stuff with log(), or else people
-//- * will never build non-debug driver.
-//- *
-//- * Style:
-//- * hex: capital letters, zero filled (e.g. 0x02AC)
-//- * str: dont start from capitals, no trailing periods ("tx: queue is //- stopped")
-//- */
-//-
-// Debug build
+/*
+ * BOM Logging (Common)
+ *
+ * - Avoid SHOUTING needlessly. Avoid excessive verbosity.
+ * Gradually remove messages which are old debugging aids.
+ *
+ * - Use printk() for messages which are to be always logged.
+ * Supply either 'acx:' or '<devname>:' prefix so that user
+ * can figure out who's speaking among other kernel chatter.
+ * acx: is for general issues (e.g. "acx: no firmware image!")
+ * while <devname>: is related to a particular device
+ * (think about multi-card setup). Double check that message
+ * is not confusing to the average user.
+ *
+ * - use printk KERN_xxx level only if message is not a WARNING
+ * but is INFO, ERR etc.
+ *
+ * - Use printk_ratelimited() for messages which may flood
+ * (e.g. "rx DUP pkt!").
+ *
+ * - Use log() for messages which may be omitted (and they
+ * _will_ be omitted in non-debug builds). Note that
+ * message levels may be disabled at compile-time selectively,
+ * thus select them wisely. Example: L_DEBUG is the lowest
+ * (most likely to be compiled out) -> use for less important stuff.
+ *
+ * - Do not print important stuff with log(), or else people
+ * will never build non-debug driver.
+ *
+ * Style:
+ * hex: capital letters, zero filled (e.g. 0x02AC)
+ * str: dont start from capitals, no trailing periods ("tx: queue is * - stopped")
+ */
+
+/* Debug build */
#if ACX_DEBUG
-//-
void log_fn_enter(const char *funcname);
void log_fn_exit(const char *funcname);
void log_fn_exit_v(const char *funcname, int v);
-//-
-//- char *acx_print_mac(char *buf, const u8 *mac);
-//- void acx_print_mac2(const char *head, const u8 *mac, const char *tail);
-//- void acxlog_mac(int level, const char *head, const u8 *mac, const char //- *tail);
+/*
+ * char *acx_print_mac(char *buf, const u8 *mac);
+ * void acx_print_mac2(const char *head, const u8 *mac, const char *tail);
+ * void acxlog_mac(int level, const char *head, const u8 *mac, const char *tail);
+ */

void acx_dump_bytes(const void *data, int num);
const char *acx_cmd_status_str(unsigned int state);
@@ -202,14 +205,15 @@ const char *acx_cmd_status_str(unsigned int state);
pr_notice(args); \
} while (0)

-// Log with prefix "acx: __func__
+/* Log with prefix "acx: __func__ */
#define logf0(chan, msg) \
log(chan, "acx: %s: " msg, __func__);
#define logf1(chan, msg, args...) \
log(chan, "acx: %s: " msg, __func__, args);

-// None-Debug build
-// OW 20100405: An none-debug build is currently probably broken
+/* None-Debug build
+ * OW 20100405: An none-debug build is currently probably broken
+ */
#else

#define FN_ENTER do {} while(0)
@@ -225,44 +229,50 @@ do { \
} while (0)

#endif
-//---
+/* --- */

-#define TODO() \
- do { \
- printk(KERN_INFO "TODO: Incomplete code in %s() at %s:%d\n", \
- __FUNCTION__, __FILE__, __LINE__); \
+#define TODO() \
+ do { \
+ printk(KERN_INFO "TODO: Incomplete code in %s() at %s:%d\n", \
+ __FUNCTION__, __FILE__, __LINE__); \
} while (0)

-#define FIXME() \
- do { \
- printk(KERN_INFO "FIXME: Possibly broken code in %s() at %s:%d\n", \
- __FUNCTION__, __FILE__, __LINE__); \
+#define FIXME() \
+ do { \
+ printk(KERN_INFO "FIXME: Possibly broken code in %s() at %s:%d\n", \
+ __FUNCTION__, __FILE__, __LINE__); \
} while (0)

-// BOM Data Access (Common)
-// -----
+/* BOM Data Access (Common)
+ * -----
+ */

-// BOM Firmware, EEPROM, Phy (Common)
-// -----
+/* BOM Firmware, EEPROM, Phy (Common)
+ * -----
+ */
void acx_get_firmware_version(acx_device_t *adev);
void acx_display_hardware_details(acx_device_t *adev);
firmware_image_t *acx_read_fw(struct device *dev,
const char *file, u32 *size);
void acx_parse_configoption(acx_device_t *adev,
const acx111_ie_configoption_t *pcfg);
-//- int acx_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
-//- int acx_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
+/*
+ * int acx_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
+ * int acx_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
+ */
+
+/* BOM CMDs (Common:Control Path)
+ * -----
+ */

-// BOM CMDs (Common:Control Path)
-// -----
+/* int acx_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void //- *param, unsigned len, unsigned timeout, const char* cmdstr); */

-//- int acx_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void //- *param, unsigned len, unsigned timeout, const char* cmdstr);
#define acx_issue_cmd(adev,cmd,param,len) \
acx_issue_cmd_timeo_debug(adev,cmd,param,len,ACX_CMD_TIMEOUT_DEFAULT,#cmd)
#define acx_issue_cmd_timeo(adev,cmd,param,len,timeo) \
acx_issue_cmd_timeo_debug(adev,cmd,param,len,timeo,#cmd)

-//- int acx_configure_debug(acx_device_t *adev, void *pdr, int type, const char* str);
+/* int acx_configure_debug(acx_device_t *adev, void *pdr, int type, const char* str); */
#define acx_configure(adev,pdr,type) \
acx_configure_debug(adev,pdr,type,#type)

@@ -271,91 +281,103 @@ int acx_interrogate_debug(acx_device_t *adev, void *pdr,
#define acx_interrogate(adev,pdr,type) \
acx_interrogate_debug(adev,pdr,type,#type)

-//- int acx_cmd_join_bssid(acx_device_t *adev, const u8 *bssid);
+/* int acx_cmd_join_bssid(acx_device_t *adev, const u8 *bssid); */

-// BOM Configuration (Common:Control Path)
-// -----
+/* BOM Configuration (Common:Control Path)
+ * -----
+ */
void acx_set_defaults(acx_device_t * adev);
void acx_start(acx_device_t * adev);
-//- int acx_net_reset(struct ieee80211_hw *ieee);
+/* int acx_net_reset(struct ieee80211_hw *ieee); */
int acx_init_mac(acx_device_t * adev);
int acx_setup_modes(acx_device_t *adev);
-//- int acx_selectchannel(acx_device_t *adev, u8 channel, int freq);
-// void acx_update_capabilities(acx_device_t *adev);
+/* int acx_selectchannel(acx_device_t *adev, u8 channel, int freq);
+ * void acx_update_capabilities(acx_device_t *adev);
+ */

-// BOM Template (Common:Control Path)
-// -----
+/* BOM Template (Common:Control Path)
+ * -----
+ */

-// BOM Recalibration (Common:Control Path)
-// -----
+/* BOM Recalibration (Common:Control Path)
+ * -----
+ */

-// BOM Other (Common:Control Path)
-// -----
+/* BOM Other (Common:Control Path)
+ * -----
+ */

-// BOM Proc, Debug (Common)
-// -----
+/* BOM Proc, Debug (Common)
+ * -----
+ */
#ifdef CONFIG_PROC_FS
int acx_proc_register_entries(struct ieee80211_hw *ieee);
int acx_proc_unregister_entries(struct ieee80211_hw *ieee);
#else
-//- static inline int
-//- acx_proc_register_entries(const struct ieee80211_hw *ieee) { return OK; }
-//- static inline int
-//- acx_proc_unregister_entries(const struct ieee80211_hw *ieee) { return OK; }
+/* - static inline int
+ * - acx_proc_register_entries(const struct ieee80211_hw *ieee) { return OK; }
+ * - static inline int
+ * - acx_proc_unregister_entries(const struct ieee80211_hw *ieee) { return OK; }
+ */
#endif
-//-
-// BOM Rx Path (Common)
-// -----
+/* -
+ * BOM Rx Path (Common)
+ * -----
+ */
void acx_process_rxbuf(acx_device_t *adev, rxbuffer_t *rxbuf);


-// BOM Tx Path (Common)
-// -----
+/* BOM Tx Path (Common)
+ * -----
+ */
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39)
int acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
#else
void acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
#endif
-//-
+
void acx_tx_work(struct work_struct *work);
-//- void acx_tx_queue_go(acx_device_t *adev);
-//- int acx_tx_frame(acx_device_t *adev, struct sk_buff *skb);
+/* - void acx_tx_queue_go(acx_device_t *adev);
+ * - int acx_tx_frame(acx_device_t *adev, struct sk_buff *skb);
+ */
void acx_tx_queue_flush(acx_device_t *adev);
void acx_stop_queue(struct ieee80211_hw *hw, const char *msg);
int acx_queue_stopped(struct ieee80211_hw *ieee);
void acx_wake_queue(struct ieee80211_hw *hw, const char *msg);
-//- tx_t* acx_alloc_tx(acx_device_t *adev, unsigned int len);
+/* - tx_t* acx_alloc_tx(acx_device_t *adev, unsigned int len); */
void acxpcimem_handle_tx_error(acx_device_t *adev, u8 error,
unsigned int finger, struct ieee80211_tx_info *info);
u16 acx111_tx_build_rateset(acx_device_t *adev, txdesc_t *txdesc,
struct ieee80211_tx_info *info);
void acx111_tx_build_txstatus(acx_device_t *adev,
struct ieee80211_tx_info *txstatus, u16 r111, u8 ack_failures);
-//- u16 acx_rate111_hwvalue_to_bitrate(u16 hw_value);
-//- int acx_rate111_hwvalue_to_rateindex(u16 hw_value);
-//-
-//void acx_l_handle_txrate_auto(acx_device_t *adev, struct client *txc,
-// u16 intended_rate, u8 rate100, u16 rate111, u8 error,
-// int pkts_to_ignore);
-//-
-//-
-// BOM Crypto (Common)
-// -----
-//- int acx_clear_keys(acx_device_t * adev);
-//- int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm, const //- struct ieee80211_key_conf *key, const u8 *mac_addr);
-//-
-// BOM Irq Handling, Timer (Common)
-// -----
+/* - u16 acx_rate111_hwvalue_to_bitrate(u16 hw_value);
+ * - int acx_rate111_hwvalue_to_rateindex(u16 hw_value);
+ * -
+ * void acx_l_handle_txrate_auto(acx_device_t *adev, struct client *txc,
+ * u16 intended_rate, u8 rate100, u16 rate111, u8 error,
+ * int pkts_to_ignore);
+ * -
+ * -
+ * BOM Crypto (Common)
+ * -----
+ * - int acx_clear_keys(acx_device_t * adev);
+ * - int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm, const * - struct ieee80211_key_conf *key, const u8 *mac_addr);
+ * -
+ * BOM Irq Handling, Timer (Common)
+ * -----
+ */
void acx_init_task_scheduler(acx_device_t *adev);
void acx_after_interrupt_task(acx_device_t *adev);
void acx_schedule_task(acx_device_t *adev, unsigned int set_flag);
void acx_log_irq(u16 irqtype);
void acx_timer(unsigned long address);
-//- void acx_set_timer(acx_device_t * adev, int timeout_us);
-//-
-// BOM Mac80211 Ops (Common)
-// -----
-//-
+/* - void acx_set_timer(acx_device_t * adev, int timeout_us);
+ * -
+ * BOM Mac80211 Ops (Common)
+ * -----
+ * -
+ */
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
int acx_op_add_interface(struct ieee80211_hw* ieee,
struct ieee80211_if_init_conf *conf);
@@ -401,13 +423,15 @@ int acx_e_op_get_tx_stats(struct ieee80211_hw* ieee,
int acx_op_set_tim(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, bool set);

-//-
-// BOM Helpers (Common)
-// -----
+/* -
+ * BOM Helpers (Common)
+ * -----
+ */

void acx_mwait(int ms);
-//- u8 acx_signal_determine_quality(u8 signal, u8 noise);
-// void great_inquisitor(acx_device_t *adev);
+/* - u8 acx_signal_determine_quality(u8 signal, u8 noise);
+ * void great_inquisitor(acx_device_t *adev);
+ */

#if !ACX_DEBUG
static inline const char *acx_get_packet_type_string(u16 fc) { return ""; }
@@ -415,61 +439,53 @@ static inline const char *acx_get_packet_type_string(u16 fc) { return ""; }
const char *acx_get_packet_type_string(u16 fc);
#endif

-// MAC address helpers
-// ---
-static inline void
-MAC_COPY(u8 *mac, const u8 *src)
+/* MAC address helpers
+ * ---
+ */
+static inline void MAC_COPY(u8 *mac, const u8 *src)
{
memcpy(mac, src, ETH_ALEN);
}

-static inline void
-MAC_FILL(u8 *mac, u8 val)
+static inline void MAC_FILL(u8 *mac, u8 val)
{
memset(mac, val, ETH_ALEN);
}

-static inline void
-MAC_BCAST(u8 *mac)
+static inline void MAC_BCAST(u8 *mac)
{
((u16*)mac)[2] = *(u32*)mac = -1;
}

-static inline void
-MAC_ZERO(u8 *mac)
+static inline void MAC_ZERO(u8 *mac)
{
((u16*)mac)[2] = *(u32*)mac = 0;
}

-static inline int
-mac_is_equal(const u8 *a, const u8 *b)
+static inline int mac_is_equal(const u8 *a, const u8 *b)
{
/* can't beat this */
return memcmp(a, b, ETH_ALEN) == 0;
}

-static inline int
-mac_is_bcast(const u8 *mac)
+static inline int mac_is_bcast(const u8 *mac)
{
/* AND together 4 first bytes with sign-extended 2 last bytes
- ** Only bcast address gives 0xffffffff. +1 gives 0 */
+ * Only bcast address gives 0xffffffff. +1 gives 0 */
return ( *(s32*)mac & ((s16*)mac)[2] ) + 1 == 0;
}

-static inline int
-mac_is_zero(const u8 *mac)
+static inline int mac_is_zero(const u8 *mac)
{
return ( *(u32*)mac | ((u16*)mac)[2] ) == 0;
}

-static inline int
-mac_is_directed(const u8 *mac)
+static inline int mac_is_directed(const u8 *mac)
{
return (mac[0] & 1)==0;
}

-static inline int
-mac_is_mcast(const u8 *mac)
+static inline int mac_is_mcast(const u8 *mac)
{
return (mac[0] & 1) && !mac_is_bcast(mac);
}
@@ -484,8 +500,9 @@ mac_is_mcast(const u8 *mac)
((unsigned char *)bytevector)[5]


-// Random helpers
-// ---
+/* Random helpers
+ * ---
+ */
#define TO_STRING(x) #x
#define STRING(x) TO_STRING(x)

@@ -494,8 +511,7 @@ mac_is_mcast(const u8 *mac)
#define CHECK_BIT(val, mask) ((val) & (mask))

/* undefined if v==0 */
-static inline unsigned int
-lowest_bit(u16 v)
+static inline unsigned int lowest_bit(u16 v)
{
unsigned int n = 0;
while (!(v & 0xf)) { v>>=4; n+=4; }
@@ -504,8 +520,7 @@ lowest_bit(u16 v)
}

/* undefined if v==0 */
-static inline unsigned int
-highest_bit(u16 v)
+static inline unsigned int highest_bit(u16 v)
{
unsigned int n = 0;
while (v>0xf) { v>>=4; n+=4; }
@@ -514,30 +529,30 @@ highest_bit(u16 v)
}

/* undefined if v==0 */
-static inline int
-has_only_one_bit(u16 v)
+static inline int has_only_one_bit(u16 v)
{
return ((v-1) ^ v) >= v;
}


-static inline int
-is_hidden_essid(char *essid)
+static inline int is_hidden_essid(char *essid)
{
return (('\0' == essid[0]) ||
((' ' == essid[0]) && ('\0' == essid[1])));
}

-// More random helpers
-// ---
-static inline struct ieee80211_hdr*
-acx_get_wlan_hdr(acx_device_t *adev, const rxbuffer_t *rxbuf)
+/* More random helpers
+ * ---
+ */
+static inline struct ieee80211_hdr* acx_get_wlan_hdr(acx_device_t *adev,
+ const rxbuffer_t *rxbuf)
{
return (struct ieee80211_hdr *)((u8 *)&rxbuf->hdr_a3 + adev->phy_header_len);
}

-// BOM Driver, Module (Common)
-// -----
+/* BOM Driver, Module (Common)
+ * -----
+ */


/*
@@ -545,121 +560,130 @@ acx_get_wlan_hdr(acx_device_t *adev, const rxbuffer_t *rxbuf)
* ==================================================
*/

-// Data Access
+/* Data Access */

-//=int acxpci_create_hostdesc_queues(acx_device_t * adev);
-//=void acxpci_create_desc_queues(acx_device_t * adev, u32 tx_queue_start, u32 rx_queue_start);
-//=void acxpci_free_desc_queues(acx_device_t * adev);
+/* =int acxpci_create_hostdesc_queues(acx_device_t * adev);
+ * =void acxpci_create_desc_queues(acx_device_t * adev, u32 tx_queue_start, u32 rx_queue_start);
+ * =void acxpci_free_desc_queues(acx_device_t * adev);
+ */

-// Firmware, EEPROM, Phy
-//- int acxpci_upload_radio(acx_device_t * adev);
-//=int acxpci_read_eeprom_byte(acx_device_t * adev, u32 addr, u8 * charbuf);
-// int acxpci_s_write_eeprom(acx_device_t * adev, u32 addr, u32 len, const u8 * charbuf);
-//- int acxpci_read_phy_reg(acx_device_t * adev, u32 reg, u8 * charbuf);
-//- int acxpci_write_phy_reg(acx_device_t * adev, u32 reg, u8 value);
-//-
-// CMDs (Control Path)
+/* Firmware, EEPROM, Phy
+ * - int acxpci_upload_radio(acx_device_t * adev);
+ * =int acxpci_read_eeprom_byte(acx_device_t * adev, u32 addr, u8 * charbuf);
+ * int acxpci_s_write_eeprom(acx_device_t * adev, u32 addr, u32 len, const u8 * charbuf);
+ * - int acxpci_read_phy_reg(acx_device_t * adev, u32 reg, u8 * charbuf);
+ * - int acxpci_write_phy_reg(acx_device_t * adev, u32 reg, u8 value);
+ * -
+ * CMDs (Control Path)
+ */
int acx_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
void *buffer, unsigned buflen, unsigned cmd_timeout,
const char *cmdstr);
-//-
-// Init, Configuration (Control Path)
-//- int acxpci_reset_dev(acx_device_t * adev);
-//-
-// Other (Control Path)
-//-
-// Proc, Debug
-//- int acxpci_proc_diag_output(struct seq_file *file, acx_device_t *adev);
-//=char *acxpci_proc_eeprom_output(int *len, acx_device_t * adev);
-//-
-// Rx Path
-//-
-// Tx Path
-//- tx_t *acxpci_alloc_tx(acx_device_t * adev);
-//=void *acxpci_get_txbuf(acx_device_t * adev, tx_t * tx_opaque);
-//=void acxpci_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);
-//=unsigned int acxpci_tx_clean_txdesc(acx_device_t * adev);
-//=void acxpci_clean_txdesc_emergency(acx_device_t * adev);
-//- int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm);
-//-
-// Irq Handling, Timer
-//- void acxpci_irq_work(struct work_struct *work);
-//- void acxpci_set_interrupt_mask(acx_device_t * adev);
-//-
-// Mac80211 Ops
-//-
-// Helpers
-//- void acxpci_power_led(acx_device_t * adev, int enable);
-//-
-// Ioctls
-//- int acx111pci_ioctl_info(struct net_device *ndev, struct iw_request_info //- *info, struct iw_param *vwrq, char *extra);
-//- int acx100pci_ioctl_set_phy_amp_bias(struct net_device *ndev, struct //- iw_request_info *info, struct iw_param *vwrq, char *extra);
-//-
-// Driver, Module
-//-
-//- int __init acxpci_init_module(void);
-//- void __exit acxpci_cleanup_module(void);
-//-
-//- /*
-//- * BOM Mem prototypes
-//- * ==================================================
-//- */
-// Data Access
-//= int acxmem_create_hostdesc_queues(acx_device_t *adev);
-//= void acxmem_create_desc_queues(acx_device_t *adev, u32 tx_queue_start, //- u32 rx_queue_start);
-//=void acxmem_free_desc_queues(acx_device_t *adev);
-//-
-// Firmware, EEPROM, Phy
-//- int acxmem_upload_radio(acx_device_t *adev);
-//=int acxmem_read_eeprom_byte(acx_device_t *adev, u32 addr, u8 *charbuf);
+/* -
+ * Init, Configuration (Control Path)
+ * - int acxpci_reset_dev(acx_device_t * adev);
+ * -
+ * Other (Control Path)
+ * -
+ * Proc, Debug
+ * - int acxpci_proc_diag_output(struct seq_file *file, acx_device_t *adev);
+ * =char *acxpci_proc_eeprom_output(int *len, acx_device_t * adev);
+ * -
+ * Rx Path
+ * -
+ * Tx Path
+ * - tx_t *acxpci_alloc_tx(acx_device_t * adev);
+ * =void *acxpci_get_txbuf(acx_device_t * adev, tx_t * tx_opaque);
+ * =void acxpci_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);
+ * =unsigned int acxpci_tx_clean_txdesc(acx_device_t * adev);
+ * =void acxpci_clean_txdesc_emergency(acx_device_t * adev);
+ * - int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm);
+ * -
+ * Irq Handling, Timer
+ * - void acxpci_irq_work(struct work_struct *work);
+ * - void acxpci_set_interrupt_mask(acx_device_t * adev);
+ * -
+ * Mac80211 Ops
+ * -
+ * Helpers
+ * - void acxpci_power_led(acx_device_t * adev, int enable);
+ * -
+ * Ioctls
+ * - int acx111pci_ioctl_info(struct net_device *ndev, struct iw_request_info * - *info, struct iw_param *vwrq, char *extra);
+ * - int acx100pci_ioctl_set_phy_amp_bias(struct net_device *ndev, struct * - iw_request_info *info, struct iw_param *vwrq, char *extra);
+ * -
+ * Driver, Module
+ * -
+ * - int __init acxpci_init_module(void);
+ * - void __exit acxpci_cleanup_module(void);
+ * -
+ */
+
+/*
+ * BOM Mem prototypes
+ * ==================================================
+ */
+
+/* Data Access
+ * = int acxmem_create_hostdesc_queues(acx_device_t *adev);
+ * = void acxmem_create_desc_queues(acx_device_t *adev, u32 tx_queue_start, * - u32 rx_queue_start);
+ * =void acxmem_free_desc_queues(acx_device_t *adev);
+ * -
+ * Firmware, EEPROM, Phy
+ * - int acxmem_upload_radio(acx_device_t *adev);
+ * =int acxmem_read_eeprom_byte(acx_device_t *adev, u32 addr, u8 *charbuf);
+ */
#ifdef UNUSED
-//- int acxmem_s_write_eeprom(acx_device_t *adev, u32 addr, u32 len, const u8 //- *charbuf);
+/* - int acxmem_s_write_eeprom(acx_device_t *adev, u32 addr, u32 len, const u8 //- *charbuf); */
#endif
-//- int acxmem_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
-//- int acxmem_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
-//-
-// CMDs (Control Path)
+/* - int acxmem_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
+ * - int acxmem_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
+ * -
+ * CMDs (Control Path)
+ */
int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
void *buffer, unsigned buflen, unsigned cmd_timeout,
const char* cmdstr);
-//-
-// Init, Configure (Control Path)
-//- int acxmem_reset_dev(acx_device_t *adev);
-//-
-// Other (Control Path)
-//-
-// Proc, Debug
-//- int acxmem_proc_diag_output(struct seq_file *file, acx_device_t *adev);
-//=char *acxmem_proc_eeprom_output(int *len, acx_device_t *adev);
-//-
-// Rx Path
-//-
-// Tx Path
-//- tx_t *acxmem_alloc_tx(acx_device_t *adev, unsigned int len);
-//- void acxmem_dealloc_tx(acx_device_t *adev, tx_t *tx_opaque);
-//-
-//=void *acxmem_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
-//=void acxmem_init_acx_txbuf2(acx_device_t *adev);
-//-
-//=void acxmem_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, //- struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);
-//=unsigned int acxmem_tx_clean_txdesc(acx_device_t *adev);
-//= void acxmem_clean_txdesc_emergency(acx_device_t *adev);
-//-
-//- void acxmem_update_queue_indicator(acx_device_t *adev, int txqueue);
-//- int acx100mem_set_tx_level(acx_device_t *adev, u8 level_dbm);
-//-
-// Irq Handling, Timer
-//- void acxmem_irq_work(struct work_struct *work);
-//- void acxmem_set_interrupt_mask(acx_device_t *adev);
-//-
-// Helpers
-//- void acxmem_power_led(acx_device_t *adev, int enable);
-//-
-// Ioctls
-//int acx111pci_ioctl_info(struct ieee80211_hw *hw, struct iw_request_info *info, struct iw_param *vwrq, char *extra);
-//int acx100mem_ioctl_set_phy_amp_bias(struct ieee80211_hw *hw, struct iw_request_info *info, struct iw_param *vwrq, char *extra);
-
-//- int __init acxmem_init_module(void);
-//- void __exit acxmem_cleanup_module(void);
+/* -
+ * Init, Configure (Control Path)
+ * - int acxmem_reset_dev(acx_device_t *adev);
+ * -
+ * Other (Control Path)
+ * -
+ * Proc, Debug
+ * - int acxmem_proc_diag_output(struct seq_file *file, acx_device_t *adev);
+ * =char *acxmem_proc_eeprom_output(int *len, acx_device_t *adev);
+ * -
+ * Rx Path
+ * -
+ * Tx Path
+ * - tx_t *acxmem_alloc_tx(acx_device_t *adev, unsigned int len);
+ * - void acxmem_dealloc_tx(acx_device_t *adev, tx_t *tx_opaque);
+ * -
+ * =void *acxmem_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
+ * =void acxmem_init_acx_txbuf2(acx_device_t *adev);
+ * -
+ * =void acxmem_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, * - struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);
+ * =unsigned int acxmem_tx_clean_txdesc(acx_device_t *adev);
+ * = void acxmem_clean_txdesc_emergency(acx_device_t *adev);
+ * -
+ * - void acxmem_update_queue_indicator(acx_device_t *adev, int txqueue);
+ * - int acx100mem_set_tx_level(acx_device_t *adev, u8 level_dbm);
+ * -
+ * Irq Handling, Timer
+ * - void acxmem_irq_work(struct work_struct *work);
+ * - void acxmem_set_interrupt_mask(acx_device_t *adev);
+ * -
+ * Helpers
+ * - void acxmem_power_led(acx_device_t *adev, int enable);
+ * -
+ * Ioctls
+ * int acx111pci_ioctl_info(struct ieee80211_hw *hw, struct iw_request_info *info, struct iw_param *vwrq, char *extra);
+ * int acx100mem_ioctl_set_phy_amp_bias(struct ieee80211_hw *hw, struct iw_request_info *info, struct iw_param *vwrq, char *extra);
+ */
+
+/* - int __init acxmem_init_module(void);
+ * - void __exit acxmem_cleanup_module(void);
+ */

#endif /* _ACX_FUNC_H_ */
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:48 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_struct_hw.h | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)

diff --git a/acx_struct_hw.h b/acx_struct_hw.h
index 2c344cc..4096b35 100644
--- a/acx_struct_hw.h
+++ b/acx_struct_hw.h
@@ -540,12 +540,17 @@ typedef struct rxbuffer {
u8 phy_level; /* PHY stat */
u8 phy_snr; /* PHY stat */
u32 time; /* timestamp upon MAC rcv first byte */
-/* 4-byte (acx100) or 8-byte (acx111) phy header will be here
-** if RX_CFG1_INCLUDE_PHY_HDR is in effect:
-** phy_hdr_t phy */
+
+ /* 4-byte (acx100) or 8-byte (acx111) phy header will be here
+ * if RX_CFG1_INCLUDE_PHY_HDR is in effect:
+ */
+ /* phy_hdr_t phy; */
+
struct ieee80211_hdr hdr_a3;
/* maximally sized data part of wlan packet */
- // OW 20100513 u8 data_a3[30 + 2312 + 4 - 24]; /*WLAN_A4FR_MAXLEN_WEP_FCS - WLAN_HDR_A3_LEN]*/
+ /* OW 20100513 u8 data_a3[30 + 2312 + 4 - 24];
+ // WLAN_A4FR_MAXLEN_WEP_FCS - WLAN_HDR_A3_LEN]
+ */
u8 data_a3[WLAN_A4FR_MAXLEN_WEP_FCS - WLAN_HDR_A3_LEN];
/* can add hdr/data_a4 if needed */
} ACX_PACKED rxbuffer_t;
@@ -945,7 +950,7 @@ enum {
IO_ACX_ECPU_CTRL
};
/* ***** ABSOLUTELY ALWAYS KEEP OFFSETS IN SYNC WITH THE INITIALIZATION
-** OF THE I/O ARRAYS!!!! (grep for '^IO_ACX') ***** */
+ * OF THE I/O ARRAYS!!!! (grep for '^IO_ACX') ***** */

/* Values for IO_ACX_INT_TRIG register: */
/* inform hw that rxdesc in queue needs processing */
@@ -973,8 +978,9 @@ struct txhostdesc {
/*
Jim Cromie
2012-05-12 06:24:44 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
merge.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/merge.c b/merge.c
index de40ef3..468b7d3 100644
--- a/merge.c
+++ b/merge.c
@@ -899,7 +899,7 @@ int acx_s_write_eeprom(acx_device_t *adev, u32 addr, u32 len,
const u8 *charbuf)
{
u8 *data_verify = NULL;
- /* unsigned long flags; /* block warn unused */
+ /* unsigned long flags; // block warn unused */
int count, i;
int result = NOT_OK;
u16 gpio_orig;
@@ -4511,17 +4511,17 @@ int acx100mem_ioctl_set_phy_amp_bias(struct ieee80211_hw *hw,

log(L_DEBUG, "gpio_old: 0x%04X\n", gpio_old);
pr_acx("%s: PHY power amplifier bias: old:%d, new:%d\n",
- wiphy_name(adev->ieee->wiphy), (gpio_old & 0x0700) >> 8, (unsigned char) *extra);
+ wiphy_name(adev->ieee->wiphy), (gpio_old & 0x0700) >> 8,
+ (unsigned char) *extra);

acx_sem_unlock(adev);
-
return OK;
}
#endif

void acx_delete_dma_regions(acx_device_t *adev)
{
- /* unsigned long flags; /* see comment below */
+ /* unsigned long flags; // see comment below */

FN_ENTER;
/* disable radio Tx/Rx. Shouldn't we use the firmware commands
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:49 UTC
Permalink
mostly by script, with some fixups needed to compile,
plus some line-wrappish stuff.

Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_struct_dev.h | 94 +++++++++++++++++++++++++++++---------------------------
1 file changed, 49 insertions(+), 45 deletions(-)

diff --git a/acx_struct_dev.h b/acx_struct_dev.h
index 7ea1cc6..4e96389 100644
--- a/acx_struct_dev.h
+++ b/acx_struct_dev.h
@@ -49,7 +49,7 @@ extern unsigned int acx_debug;
enum { acx_debug = 0 };
#endif

-// BOM Operations by writing to acx_diag
+/* BOM Operations by writing to acx_diag */
enum {
ACX_DIAG_OP_RECALIB = 0x0001,
ACX_DIAG_OP_PROCESS_TX_RX = 0x0002,
@@ -113,8 +113,8 @@ enum {

/* Driver defaults */
#define DEFAULT_DTIM_INTERVAL 10
-/* used to be 2048, but FreeBSD driver changed it to 4096 to work properly
-** in noisy wlans */
+/* used to be 2048, but FreeBSD driver changed it to 4096 to work
+ * properly in noisy wlans */
#define DEFAULT_MSDU_LIFETIME 4096
#define DEFAULT_RTS_THRESHOLD 2312 /* max. size: disable RTS mechanism */
#define DEFAULT_BEACON_INTERVAL 100
@@ -123,7 +123,7 @@ enum {
#define ACX100_RID_GUESSING_MAXLEN 2048 /* I'm not really sure */
#define ACX100_RIDDATA_MAXLEN ACX100_RID_GUESSING_MAXLEN

-// BOM 'After Interrupt' Commands
+/* BOM 'After Interrupt' Commands */
#define ACX_AFTER_IRQ_CMD_RADIO_RECALIB 0x01
#define ACX_AFTER_IRQ_UPDATE_TIM 0x02
#define ACX_AFTER_IRQ_COMPLETE_SCAN 0x04
@@ -183,8 +183,8 @@ enum {
#define ACX_MODE_2_STA 2
#define ACX_MODE_3_AP 3
/* These are our own inventions. Sending these to firmware
-** makes it stop emitting beacons, which is exactly what we want
-** for these modes */
+ * makes it stop emitting beacons, which is exactly what we want
+ * for these modes */
#define ACX_MODE_MONITOR 0xfe
#define ACX_MODE_OFF 0xff
/* 'Submode': identifies exact status of ADHOC/STA host */
@@ -223,12 +223,12 @@ struct desc_info {
rxhostdesc_t *rxstart;
void *start;
};
- unsigned int size; // hostdesc_area_size;
- dma_addr_t phy; // hostdesc_startphy;
+ unsigned int size; /* hostdesc_area_size; */
+ dma_addr_t phy; /* hostdesc_startphy; */
};

/* tx fields refactored */
-struct tx_desc_pair2 {
+struct tx_desc_pair {
unsigned int tail;
txdesc_t *desc_start;
unsigned int desc_size; /* size of txdesc */
@@ -236,7 +236,7 @@ struct tx_desc_pair2 {
struct desc_info host;
struct desc_info buf;
};
-struct rx_desc_pair2 {
+struct rx_desc_pair {
unsigned int tail;
rxdesc_t *desc_start;
unsigned int desc_size; /* size of rxdesc */
@@ -245,8 +245,8 @@ struct rx_desc_pair2 {
struct desc_info buf;
};

-/* FIXME: this should be named something like struct acx_priv (typedef'd to
- * acx_priv_t) */
+/* FIXME: this should be named something like struct acx_priv
+ * (typedef'd to acx_priv_t) */

/* non-firmware struct, no packing necessary */
struct acx_device {
@@ -266,19 +266,20 @@ struct acx_device {
#endif

/*** Linux network device ***/
- //struct device *dev; /* pointer to linux netdevice */
+ /* struct device *dev; // pointer to linux netdevice */

- /*** Device statistics ***/
- struct ieee80211_low_level_stats ieee_stats; /* wireless device statistics */
+ /* wireless device statistics */
+ struct ieee80211_low_level_stats ieee_stats;

- /*** Device statistics ***/
- struct net_device_stats stats; /* net device statistics */
+ /* net device statistics */
+ struct net_device_stats stats;

#ifdef WIRELESS_EXT
-// struct iw_statistics wstats; /* wireless statistics */
+/* struct iw_statistics wstats; // wireless statistics */
#endif
struct ieee80211_hw *ieee;
- // FIXME OW 20100616 rx_status is reported for each skb. Check if this field is really required
+ /* FIXME OW 20100616 rx_status is reported for each skb. Check
+ * if this field is really required */
struct ieee80211_rx_status rx_status;
struct ieee80211_vif *vif;

@@ -307,9 +308,9 @@ struct acx_device {

/*** Device state ***/
u16 dev_state_mask;
- u8 led_power; /* power LED status */
- u32 get_mask; /* mask of settings to fetch from the card */
- u32 set_mask; /* mask of settings to write to the card */
+ u8 led_power; /* power LED status */
+ u32 get_mask; /* mask of settings to fetch from the card */
+ u32 set_mask; /* mask of settings to write to the card */
u32 initialized:1;
/* Barely used in USB case */
u16 irq_status;
@@ -324,28 +325,31 @@ struct acx_device {
unsigned int irq;

/*** scanning ***/
- u16 scan_count; /* number of times to do channel scan */
- u8 scan_mode; /* 0 == active, 1 == passive, 2 == background */
+ u16 scan_count; /* number of times to do channel scan */
+ u8 scan_mode; /* 0 == active, 1 == passive, 2 == background */
u8 scan_rate;
u16 scan_duration;
u16 scan_probe_delay;
#if WIRELESS_EXT > 15
-// struct iw_spy_data spy_data; /* FIXME: needs to be implemented! */
+/* struct iw_spy_data spy_data; // FIXME: needs to be implemented! */
#endif

- // TODO FIXME Fields previously defined in acx_mac80211.h. Review usage what and how
+ /* TODO FIXME Fields previously defined in
+ * acx_mac80211.h. Review usage what and how */
int vif_type;
- /* Counter of active monitor interfaces. */
- // TODO FIXME Review if required / usage
- int vif_monitor;
- /* Is the card operating in AP, STA or IBSS mode? */
- // TODO FIXME Review if required / usage
- unsigned int vif_operating:1;
+
+ /* Counter of active monitor interfaces. */
+ /* TODO FIXME Review if required / usage */
+ int vif_monitor;
+
+ /* Is the card operating in AP, STA or IBSS mode? */
+ /* TODO FIXME Review if required / usage */
+ unsigned int vif_operating:1;

/*** Wireless network settings ***/
/* copy of the device address (ifconfig hw ether) that we actually use
- ** for 802.11; copied over from the network device's MAC address
- ** (ifconfig) when it makes sense only */
+ * for 802.11; copied over from the network device's MAC address
+ * (ifconfig) when it makes sense only */
u8 dev_addr[MAX_ADDR_LEN];
u8 bssid[ETH_ALEN]; /* the BSSID after having joined */
u8 ap[ETH_ALEN]; /* The AP we want, FF:FF:FF:FF:FF:FF is any */
@@ -374,11 +378,12 @@ struct acx_device {
#endif

/* stations known to us (if we're an ap) */
-// client_t sta_list[32]; /* tab is larger than list, so that */
-// client_t *sta_hash_tab[64]; /* hash collisions are not likely */
-// client_t *ap_client; /* this one is our AP (STA mode only) */
+/* client_t sta_list[32]; // tab is larger than list, so that
+ * client_t *sta_hash_tab[64]; // hash collisions are not likely
+ * client_t *ap_client; // this one is our AP (STA mode only)
+ */

- // Mac80211 Tx_queue
+ /* Mac80211 Tx_queue */
struct sk_buff_head tx_queue;
struct work_struct tx_work;

@@ -469,8 +474,8 @@ struct acx_device {
#if (1 || defined(CONFIG_ACX_MAC80211_MEM))
u32 acx_txbuf_start;
int acx_txbuf_numblocks;
- u32 acx_txbuf_free; /* addr of head of free list */
- int acx_txbuf_blocks_free; /* how many are still open */
+ u32 acx_txbuf_free; /* addr of head of free list */
+ int acx_txbuf_blocks_free; /* how many are still open */
queueindicator_t *acx_queue_indicator;
#endif

@@ -480,8 +485,8 @@ struct acx_device {
/* pointers to tx buffers, tx host descriptors (in host
* memory) and tx descs in device memory, same for rx
*/
- struct tx_desc_pair2 tx;
- struct rx_desc_pair2 rx;
+ struct tx_desc_pair tx;
+ struct rx_desc_pair rx;

u8 need_radio_fw;
u8 irqs_active; /* whether irq sending is activated */
@@ -529,10 +534,9 @@ struct acx_device {
#endif

};
-// ---
+/* --- */

-static inline
-acx_device_t* ieee2adev(struct ieee80211_hw *hw)
+static inline acx_device_t* ieee2adev(struct ieee80211_hw *hw)
{
return hw->priv;
}
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:42 UTC
Permalink
various style fixes, comment rewraps, line wraps, etc.

Signed-off-by: Jim Cromie <***@gmail.com>
---
common.c | 1204 ++++++++++++++++++++++++++++++--------------------------------
1 file changed, 576 insertions(+), 628 deletions(-)

diff --git a/common.c b/common.c
index 2986b9a..198be87 100644
--- a/common.c
+++ b/common.c
@@ -576,17 +576,17 @@ static struct ieee80211_channel channels[] = {
};

static struct ieee80211_supported_band acx100_band_2GHz = {
- .channels = channels,
- .n_channels = ARRAY_SIZE(channels),
- .bitrates = acx100_rates,
- .n_bitrates = ARRAY_SIZE(acx100_rates),
+ .channels = channels,
+ .n_channels = ARRAY_SIZE(channels),
+ .bitrates = acx100_rates,
+ .n_bitrates = ARRAY_SIZE(acx100_rates),
};

static struct ieee80211_supported_band acx111_band_2GHz = {
- .channels = channels,
- .n_channels = ARRAY_SIZE(channels),
- .bitrates = acx111_rates,
- .n_bitrates = ARRAY_SIZE(acx111_rates),
+ .channels = channels,
+ .n_channels = ARRAY_SIZE(channels),
+ .bitrates = acx111_rates,
+ .n_bitrates = ARRAY_SIZE(acx111_rates),
};

static const u8 bitpos2genframe_txrate[] = {
@@ -673,14 +673,15 @@ u16 acx_rate111_hwvalue_to_bitrate(u16 hw_value)
// Proc
#ifdef CONFIG_PROC_FS

-static const char *const
- proc_files[] = { "info", "diag", "eeprom", "phy", "debug", "sensitivity", "tx_level", "antenna", "reg_domain",};
+static const char *const proc_files[] = {
+ "info", "diag", "eeprom", "phy", "debug",
+ "sensitivity", "tx_level", "antenna", "reg_domain",
+};

typedef int acx_proc_show_t(struct seq_file *file, void *v);
typedef ssize_t (acx_proc_write_t)(struct file *, const char __user *, size_t, loff_t *);

-static acx_proc_show_t *const
- acx_proc_show_funcs[] = {
+static acx_proc_show_t *const acx_proc_show_funcs[] = {
acx_proc_show_acx,
acx_proc_show_diag,
acx_proc_show_eeprom,
@@ -709,7 +710,7 @@ static acx_proc_write_t *const
BUILD_BUG_DECL(SHOW, ARRAY_SIZE(acx_proc_show_funcs)
!= ARRAY_SIZE(acx_proc_write_funcs));

-static struct file_operations acx_e_proc_ops[ARRAY_SIZE(proc_files)] ;
+static struct file_operations acx_e_proc_ops[ARRAY_SIZE(proc_files)];

#endif
// -----
@@ -819,6 +820,7 @@ void log_fn_enter(const char *funcname)

acx_debug_func_indent += ACX_DEBUG_FUNC_INDENT_INCREMENT;
}
+
void log_fn_exit(const char *funcname)
{
int indent;
@@ -838,6 +840,7 @@ void log_fn_exit(const char *funcname)
acx_debug_spaces + (sizeof(acx_debug_spaces) - 1) - indent,
funcname);
}
+
void log_fn_exit_v(const char *funcname, int v)
{
int indent;
@@ -868,9 +871,8 @@ void acx_print_mac2(const char *head, const u8 *mac, const char *tail)

void acxlog_mac(int level, const char *head, const u8 *mac, const char *tail)
{
- if (acx_debug & level) {
+ if (acx_debug & level)
acx_print_mac2(head, mac, tail);
- }
}

void acx_dump_bytes(const void *data, int num)
@@ -934,8 +936,8 @@ const char *acx_cmd_status_str(unsigned int state)
* ==================================================
*/

-static int
-acx100_init_memory_pools(acx_device_t * adev, const acx_ie_memmap_t * mmt)
+static int acx100_init_memory_pools(acx_device_t *adev,
+ const acx_ie_memmap_t *mmt)
{
acx100_ie_memblocksize_t MemoryBlockSize;
acx100_ie_memconfigoption_t MemoryConfigOption;
@@ -953,9 +955,8 @@ acx100_init_memory_pools(acx_device_t * adev, const acx_ie_memmap_t * mmt)
MemoryBlockSize.size = cpu_to_le16(adev->memblocksize);

/* Then we alert the card to our decision of block size */
- if (OK != acx_configure(adev, &MemoryBlockSize, ACX100_IE_BLOCK_SIZE)) {
+ if (OK != acx_configure(adev, &MemoryBlockSize, ACX100_IE_BLOCK_SIZE))
goto bad;
- }

/* We figure out how many total blocks we can create, using
the block size we chose, and the beginning and ending
@@ -999,9 +1000,8 @@ acx100_init_memory_pools(acx_device_t * adev, const acx_ie_memmap_t * mmt)
(long)adev->rx.host.phy);
#endif
}
- else {
+ else
MemoryConfigOption.DMA_config = cpu_to_le32(0x20000);
- }

/* 50% of the allotment of memory blocks go to tx descriptors */
TxBlockNum = TotalMemoryBlocks / 2;
@@ -1018,7 +1018,6 @@ acx100_init_memory_pools(acx_device_t * adev, const acx_ie_memmap_t * mmt)
"TotalTxBlockSize %u\n", TxBlockNum, RxBlockNum,
TotalTxBlockSize, TotalRxBlockSize);

-
/* align the tx descriptor queue to an alignment of 0x20 (32 bytes) */
MemoryConfigOption.rx_mem =
cpu_to_le32((le32_to_cpu(mmt->PoolStart) + 0x1f) & ~0x1f);
@@ -1034,14 +1033,12 @@ acx100_init_memory_pools(acx_device_t * adev, const acx_ie_memmap_t * mmt)
/* alert the device to our decision */
if (OK !=
acx_configure(adev, &MemoryConfigOption,
- ACX1xx_IE_MEMORY_CONFIG_OPTIONS)) {
+ ACX1xx_IE_MEMORY_CONFIG_OPTIONS))
goto bad;
- }

/* and tell the device to kick it into gear */
- if (OK != acx_issue_cmd(adev, ACX100_CMD_INIT_MEMORY, NULL, 0)) {
+ if (OK != acx_issue_cmd(adev, ACX100_CMD_INIT_MEMORY, NULL, 0))
goto bad;
- }

#ifdef CONFIG_ACX_MAC80211_MEM
/*
@@ -1052,10 +1049,9 @@ acx100_init_memory_pools(acx_device_t * adev, const acx_ie_memmap_t * mmt)
adev->acx_txbuf_numblocks = MemoryConfigOption.TxBlockNum;
#endif

-
FN_EXIT1(OK);
return OK;
- bad:
+bad:
FN_EXIT1(NOT_OK);
return NOT_OK;
}
@@ -1078,9 +1074,8 @@ static int acx100_create_dma_regions(acx_device_t * adev)
FN_ENTER;

/* read out the acx100 physical start address for the queues */
- if (OK != acx_interrogate(adev, &memmap, ACX1xx_IE_MEMORY_MAP)) {
+ if (OK != acx_interrogate(adev, &memmap, ACX1xx_IE_MEMORY_MAP))
goto fail;
- }

tx_queue_start = le32_to_cpu(memmap.QueueStart);
rx_queue_start = tx_queue_start + TX_CNT * sizeof(txdesc_t);
@@ -1111,20 +1106,22 @@ static int acx100_create_dma_regions(acx_device_t * adev)
/* sets the beginning of the next queue */
queueconf.HostQueueEnd =
cpu_to_le32(le32_to_cpu(queueconf.QueueEnd) + 8);
- if (OK != acx_configure(adev, &queueconf, ACX1xx_IE_QUEUE_CONFIG)) {
+ if (OK != acx_configure(adev, &queueconf, ACX1xx_IE_QUEUE_CONFIG))
goto fail;
- }

if (IS_PCI(adev)) {
- /* sets the beginning of the rx descriptor queue, after the tx descrs */
+ /* sets the beginning of the rx descriptor queue,
+ * after the tx descrs */
if (OK != acx_create_hostdesc_queues(adev))
goto fail;
acx_create_desc_queues(adev, tx_queue_start, rx_queue_start);
}
#ifdef CONFIG_ACX_MAC80211_MEM
else if (IS_MEM(adev)) {
- /* sets the beginning of the rx descriptor queue, after the tx descrs */
- adev->acx_queue_indicator = (queueindicator_t *) le32_to_cpu (queueconf.QueueEnd);
+ /* sets the beginning of the rx descriptor queue,
+ * after the tx descrs */
+ adev->acx_queue_indicator = (queueindicator_t *)
+ le32_to_cpu (queueconf.QueueEnd);

if (OK != acx_create_hostdesc_queues(adev))
goto fail;
@@ -1133,30 +1130,27 @@ static int acx100_create_dma_regions(acx_device_t * adev)
}
#endif

- if (OK != acx_interrogate(adev, &memmap, ACX1xx_IE_MEMORY_MAP)) {
+ if (OK != acx_interrogate(adev, &memmap, ACX1xx_IE_MEMORY_MAP))
goto fail;
- }

memmap.PoolStart = cpu_to_le32((le32_to_cpu(memmap.QueueEnd) + 4 +
0x1f) & ~0x1f);

- if (OK != acx_configure(adev, &memmap, ACX1xx_IE_MEMORY_MAP)) {
+ if (OK != acx_configure(adev, &memmap, ACX1xx_IE_MEMORY_MAP))
goto fail;
- }

- if (OK != acx100_init_memory_pools(adev, &memmap)) {
+ if (OK != acx100_init_memory_pools(adev, &memmap))
goto fail;
- }

res = OK;
goto end;

- fail:
+fail:
acx_mwait(1000); /* ? */

if (IS_PCI(adev) || IS_MEM(adev))
acx_free_desc_queues(adev);
- end:
+end:
FN_EXIT1(res);
return res;
}
@@ -1168,7 +1162,7 @@ static int acx100_create_dma_regions(acx_device_t * adev)
* Note that this fn messes heavily with hardware, but we cannot
* lock it (we need to sleep). Not a problem since IRQs can't happen
*/
-static int acx111_create_dma_regions(acx_device_t * adev)
+static int acx111_create_dma_regions(acx_device_t *adev)
{
struct acx111_ie_memoryconfig memconf;
struct acx111_ie_queueconfig queueconf;
@@ -1183,16 +1177,15 @@ static int acx111_create_dma_regions(acx_device_t * adev)
if (OK != acx_create_hostdesc_queues(adev))
goto fail;
}
- else if (IS_MEM(adev)) {
+ else if (IS_MEM(adev))
if (OK != acx_create_hostdesc_queues(adev))
goto fail;
- }
-

memset(&memconf, 0, sizeof(memconf));
/* the number of STAs (STA contexts) to support
** NB: was set to 1 and everything seemed to work nevertheless... */
- memconf.no_of_stations = 1; //cpu_to_le16(ARRAY_SIZE(adev->sta_list));
+ memconf.no_of_stations = 1; //cpu_to_le16(ARRAY_SIZE(adev->sta_list));
+
/* specify the memory block size. Default is 256 */
memconf.memory_block_size = cpu_to_le16(adev->memblocksize);
/* let's use 50%/50% for tx/rx (specify percentage, units of 5%) */
@@ -1202,8 +1195,8 @@ static int acx111_create_dma_regions(acx_device_t * adev)
** if we ever will switch to more than one rx and/or tx queue */
memconf.count_rx_queues = 1;
memconf.count_tx_queues = 1;
- /* 0 == Busmaster Indirect Memory Organization, which is what we want
- * (using linked host descs with their allocated mem).
+ /* 0 == Busmaster Indirect Memory Organization, which is what
+ * we want (using linked host descs with their allocated mem).
* 2 == Generic Bus Slave */
/* done by memset: memconf.options = 0; */
/* let's use 25% for fragmentations and 75% for frame transfers
@@ -1231,14 +1224,15 @@ static int acx111_create_dma_regions(acx_device_t * adev)
/* done by memset: memconf.tx_queue1_attributes = 0; lowest priority */

/* NB1: this looks wrong: (memconf,ACX1xx_IE_QUEUE_CONFIG),
- ** (queueconf,ACX1xx_IE_MEMORY_CONFIG_OPTIONS) look swapped, eh?
- ** But it is actually correct wrt IE numbers.
- ** NB2: sizeof(memconf) == 28 == 0x1c but configure(ACX1xx_IE_QUEUE_CONFIG)
- ** writes 0x20 bytes (because same IE for acx100 uses struct acx100_ie_queueconfig
- ** which is 4 bytes larger. what a mess. TODO: clean it up) */
- if (OK != acx_configure(adev, &memconf, ACX1xx_IE_QUEUE_CONFIG)) {
+ * (queueconf,ACX1xx_IE_MEMORY_CONFIG_OPTIONS) look swapped, eh?
+ * But it is actually correct wrt IE numbers.
+ * NB2: sizeof(memconf) == 28 == 0x1c but
+ *configure(ACX1xx_IE_QUEUE_CONFIG) * writes 0x20 bytes
+ *(because same IE for acx100 uses struct
+ *acx100_ie_queueconfig * which is 4 bytes larger. what a
+ *mess. TODO: clean it up) */
+ if (OK != acx_configure(adev, &memconf, ACX1xx_IE_QUEUE_CONFIG))
goto fail;
- }

acx_interrogate(adev, &queueconf, ACX1xx_IE_MEMORY_CONFIG_OPTIONS);

@@ -1261,7 +1255,7 @@ static int acx111_create_dma_regions(acx_device_t * adev)
FN_EXIT1(OK);
return OK;

- fail:
+fail:
if (IS_PCI(adev) || IS_MEM(adev))
acx_free_desc_queues(adev);

@@ -1303,7 +1297,7 @@ void acx_get_firmware_version(acx_device_t * adev)
c = *num++;
if ((c == '.') || (c == '\0')) {
hexarr[hexidx++] = val;
- if ((hexidx > 3) || (c == '\0')) /* end? */
+ if ((hexidx > 3) || (c == '\0')) /* end? */
break;
val = 0;
continue;
@@ -1318,7 +1312,8 @@ void acx_get_firmware_version(acx_device_t * adev)
adev->firmware_numver = (u32) ((hexarr[0] << 24) |
(hexarr[1] << 16)
| (hexarr[2] << 8) | hexarr[3]);
- log(L_DEBUG, "firmware_numver 0x%08X\n", adev->firmware_numver);
+ log(L_DEBUG, "firmware_numver 0x%08X\n",
+ adev->firmware_numver);
}
if (IS_ACX111(adev)) {
if (adev->firmware_numver == 0x00010011) {
@@ -1351,7 +1346,6 @@ void acx_get_firmware_version(acx_device_t * adev)
"please report\n", adev->firmware_id);
break;
}
-
FN_EXIT0;
}

@@ -1360,7 +1354,7 @@ void acx_get_firmware_version(acx_device_t * adev)
*
* Displays hw/fw version, radio type etc...
*/
-void acx_display_hardware_details(acx_device_t * adev)
+void acx_display_hardware_details(acx_device_t *adev)
{
const char *radio_str, *form_str;

@@ -1482,9 +1476,8 @@ firmware_image_t *acx_read_fw(struct device *dev, const char *file,
*
* FIXME: logging should be removed here and added to a /proc file instead
*/
-void
-acx_parse_configoption(acx_device_t * adev,
- const acx111_ie_configoption_t * pcfg)
+void acx_parse_configoption(acx_device_t *adev,
+ const acx111_ie_configoption_t *pcfg)
{
const u8 *pEle;
struct eeprom_cfg *acfg = &adev->cfgopt;
@@ -1570,17 +1563,18 @@ acx_parse_configoption(acx_device_t * adev,

pEle++; /* skip table_count (6) */

- if (IS_MEM(adev) && IS_ACX100(adev))
- {
- /*
- * For iPaq hx4700 Generic Slave F/W 1.10.7.K. I'm not sure if these
- * 4 extra bytes are before the dot11 things above or after, so I'm just
- * going to guess after. If someone sees these aren't reasonable numbers,
- * please fix this.
- * The area from which the dot11 values above are read contains:
- * 04 01 01 01 00 05 01 06 00 02 01 02
- * the 8 dot11 reads above take care of 8 of them, but which 8...
- */
+ if (IS_MEM(adev) && IS_ACX100(adev)) {
+ /*
+ * For iPaq hx4700 Generic Slave F/W 1.10.7.K. I'm
+ * not sure if these 4 extra bytes are before the
+ * dot11 things above or after, so I'm just going to
+ * guess after. If someone sees these aren't
+ * reasonable numbers, please fix this.
+ * The area from which the dot11 values above are read
+ * contains: 04 01 01 01 00 05 01 06 00 02 01 02 the 8
+ * dot11 reads above take care of 8 of them, but which
+ * 8...
+ */
pEle += 4;
}

@@ -1621,15 +1615,15 @@ acx_parse_configoption(acx_device_t * adev,
acfg->domains.type = pEle[0];
acfg->domains.len = pEle[1];

- if (IS_MEM(adev) && IS_ACX100(adev))
- {
- /*
- * For iPaq hx4700 Generic Slave F/W 1.10.7.K.
- * There's an extra byte between this structure and the next
- * that is not accounted for with this structure's length. It's
- * most likely a bug in the firmware, but we can fix it here
- * by bumping the length of this field by 1.
- */
+ if (IS_MEM(adev) && IS_ACX100(adev)) {
+ /*
+ * For iPaq hx4700 Generic Slave F/W 1.10.7.K.
+ * There's an extra byte between this structure and
+ * the next that is not accounted for with this
+ * structure's length. It's most likely a bug in the
+ * firmware, but we can fix it here by bumping the
+ * length of this field by 1.
+ */
acfg->domains.len++;
}

@@ -1644,9 +1638,9 @@ acx_parse_configoption(acx_device_t * adev,
pEle += acfg->domains.len + 2;
acfg->product_id.type = pEle[0];
acfg->product_id.len = pEle[1];
- for (i = 0; i < pEle[1]; i++) {
+ for (i = 0; i < pEle[1]; i++)
acfg->product_id.list[i] = pEle[i + 2];
- }
+
pr_info("ProductID:%02X Len:%02X Data:%.*s\n",
acfg->product_id.type, acfg->product_id.len,
acfg->product_id.len,
@@ -1655,20 +1649,20 @@ acx_parse_configoption(acx_device_t * adev,
pEle += pEle[1] + 2;
acfg->manufacturer.type = pEle[0];
acfg->manufacturer.len = pEle[1];
- for (i = 0; i < pEle[1]; i++) {
+ for (i = 0; i < pEle[1]; i++)
acfg->manufacturer.list[i] = pEle[i + 2];
- }
+
pr_info("ManufacturerID:%02X Len:%02X Data:%.*s\n",
acfg->manufacturer.type, acfg->manufacturer.len,
acfg->manufacturer.len,
(char *)acfg->manufacturer.list);
-/*
+ /*
pr_info("EEPROM part:\n");
for (i=0; i<58; i++) {
printk("%02X =======> 0x%02X\n",
i, (u8 *)acfg->NVSv[i-2]);
}
-*/
+ */
}

int acx_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf)
@@ -1697,24 +1691,25 @@ int acx_write_phy_reg(acx_device_t *adev, u32 reg, u8 value)
return (NOT_OK);
}

-
/*
* BOM CMDs (Control Path)
* ==================================================
*/
-
-int
-acx_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param,
+int acx_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param,
unsigned len, unsigned timeout, const char* cmdstr)
{
if (IS_PCI(adev))
- return acxpci_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
+ return acxpci_issue_cmd_timeo_debug(adev, cmd, param, len,
+ timeout, cmdstr);
if (IS_USB(adev))
- return acxusb_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
+ return acxusb_issue_cmd_timeo_debug(adev, cmd, param, len,
+ timeout, cmdstr);
if (IS_MEM(adev))
- return acxmem_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
+ return acxmem_issue_cmd_timeo_debug(adev, cmd, param, len,
+ timeout, cmdstr);

- log(L_ANY, "%s: Unsupported dev_type=%i\n", __func__, (adev)->dev_type);
+ log(L_ANY, "%s: Unsupported dev_type=%i\n", __func__,
+ (adev)->dev_type);
return (NOT_OK);
}

@@ -1732,10 +1727,9 @@ int acx_configure_debug(acx_device_t *adev, void *pdr, int type,
else
len = adev->ie_len_dot11[type - 0x1000];

- if (unlikely(!len)) {
+ if (unlikely(!len))
log(L_DEBUG, "%s: zero-length type %s?!\n",
__func__, typestr);
- }

((acx_ie_generic_t *) pdr)->type = cpu_to_le16(type);
((acx_ie_generic_t *) pdr)->len = cpu_to_le16(len);
@@ -1753,18 +1747,15 @@ int acx_configure_debug(acx_device_t *adev, void *pdr, int type,
return res;
}

-
-static int
-acx111_get_feature_config(acx_device_t * adev,
- u32 * feature_options, u32 * data_flow_options)
+static int acx111_get_feature_config(acx_device_t *adev,
+ u32 *feature_options, u32 *data_flow_options)
{
struct acx111_ie_feature_config feat;

FN_ENTER;

- if (!IS_ACX111(adev)) {
+ if (!IS_ACX111(adev))
return NOT_OK;
- }

memset(&feat, 0, sizeof(feat));

@@ -1785,15 +1776,12 @@ acx111_get_feature_config(acx_device_t * adev,
return OK;
}

-
-static int
-acx111_set_feature_config(acx_device_t * adev,
+static int acx111_set_feature_config(acx_device_t *adev,
u32 feature_options, u32 data_flow_options,
unsigned int mode
/* 0 == remove, 1 == add, 2 == set */ )
{
struct acx111_ie_feature_config feat;
-
int i;

FN_ENTER;
@@ -1812,9 +1800,9 @@ acx111_set_feature_config(acx_device_t * adev,
/* need to modify old data */
i = acx111_get_feature_config(adev, &feat.feature_options,
&feat.data_flow_options);
- if (i != OK)
- {
- printk("%s: acx111_s_get_feature_config: NOT_OK\n", __FUNCTION__);
+ if (i != OK) {
+ printk("%s: acx111_s_get_feature_config: NOT_OK\n",
+ __FUNCTION__);
return i;
}
}
@@ -1830,7 +1818,8 @@ acx111_set_feature_config(acx_device_t * adev,
cpu_to_le32(data_flow_options));
} else { /* add or set */
SET_BIT(feat.feature_options, cpu_to_le32(feature_options));
- SET_BIT(feat.data_flow_options, cpu_to_le32(data_flow_options));
+ SET_BIT(feat.data_flow_options,
+ cpu_to_le32(data_flow_options));
}

log(L_DEBUG,
@@ -1844,26 +1833,24 @@ acx111_set_feature_config(acx_device_t * adev,
FN_EXIT1(NOT_OK);
return NOT_OK;
}
-
FN_EXIT0;
return OK;
}

-static inline int acx111_feature_off(acx_device_t * adev, u32 f, u32 d)
+static inline int acx111_feature_off(acx_device_t *adev, u32 f, u32 d)
{
return acx111_set_feature_config(adev, f, d, 0);
}
-static inline int acx111_feature_on(acx_device_t * adev, u32 f, u32 d)
+static inline int acx111_feature_on(acx_device_t *adev, u32 f, u32 d)
{
return acx111_set_feature_config(adev, f, d, 1);
}
-static inline int acx111_feature_set(acx_device_t * adev, u32 f, u32 d)
+static inline int acx111_feature_set(acx_device_t *adev, u32 f, u32 d)
{
return acx111_set_feature_config(adev, f, d, 2);
}

-int
-acx_interrogate_debug(acx_device_t * adev, void *pdr, int type,
+int acx_interrogate_debug(acx_device_t *adev, void *pdr, int type,
const char *typestr)
{
u16 len;
@@ -1885,15 +1872,16 @@ acx_interrogate_debug(acx_device_t * adev, void *pdr, int type,
res = acx_issue_cmd(adev, ACX1xx_CMD_INTERROGATE, pdr, len + 4);
if (unlikely(OK != res)) {
#if ACX_DEBUG
- pr_info("%s: %s: (type:%s) FAILED\n", __func__, wiphy_name(adev->ieee->wiphy),
- typestr);
+ pr_info("%s: %s: (type:%s) FAILED\n", __func__,
+ wiphy_name(adev->ieee->wiphy),
+ typestr);
#else
- pr_info("%s: %s: (type:0x%X) FAILED\n", __func__, wiphy_name(adev->ieee->wiphy),
- type);
+ pr_info("%s: %s: (type:0x%X) FAILED\n", __func__,
+ wiphy_name(adev->ieee->wiphy),
+ type);
#endif
/* dump_stack() is already done in issue_cmd() */
}
-
FN_EXIT1(res);
return res;
}
@@ -1938,29 +1926,31 @@ int acx_cmd_join_bssid(acx_device_t *adev, const u8 *bssid)

tmp.beacon_interval = cpu_to_le16(adev->beacon_interval);

- /* Basic rate set. Control frame responses (such as ACK or CTS frames)
- ** are sent with one of these rates */
+ /* Basic rate set. Control frame responses (such as ACK or CTS
+ * frames) are sent with one of these rates */
if (IS_ACX111(adev)) {
/* It was experimentally determined that rates_basic
- ** can take 11g rates as well, not only rates
- ** defined with JOINBSS_RATES_BASIC111_nnn.
- ** Just use RATE111_nnn constants... */
+ * can take 11g rates as well, not only rates defined
+ * with JOINBSS_RATES_BASIC111_nnn. Just use
+ * RATE111_nnn constants... */
tmp.u.acx111.dtim_interval = dtim_interval;
tmp.u.acx111.rates_basic = cpu_to_le16(adev->rate_basic);
log(L_ASSOC, "rates_basic:%04X, rates_supported:%04X\n",
adev->rate_basic, adev->rate_oper);
} else {
tmp.u.acx100.dtim_interval = dtim_interval;
- tmp.u.acx100.rates_basic = acx_rate111to5bits(adev->rate_basic);
- tmp.u.acx100.rates_supported = acx_rate111to5bits(adev->rate_oper);
+ tmp.u.acx100.rates_basic =
+ acx_rate111to5bits(adev->rate_basic);
+ tmp.u.acx100.rates_supported =
+ acx_rate111to5bits(adev->rate_oper);
log(L_ASSOC, "rates_basic:%04X->%02X, "
"rates_supported:%04X->%02X\n",
adev->rate_basic, tmp.u.acx100.rates_basic,
adev->rate_oper, tmp.u.acx100.rates_supported);
}

- /* Setting up how Beacon, Probe Response, RTS, and PS-Poll frames
- ** will be sent (rate/modulation/preamble) */
+ /* Setting up how Beacon, Probe Response, RTS, and PS-Poll
+ * frames will be sent (rate/modulation/preamble) */
tmp.genfrm_txrate = bitpos2genframe_txrate[lowest_bit(adev->rate_basic)];
tmp.genfrm_mod_pre = 0;
/* FIXME: was = adev->capab_short (which was always 0); */
@@ -1969,11 +1959,12 @@ int acx_cmd_join_bssid(acx_device_t *adev, const u8 *bssid)
/* FIXME #2: we need to correctly set PBCC/OFDM bits here too */

/* we switch fw to STA mode in MONITOR mode, it seems to be
- ** the only mode where fw does not emit beacons by itself
- ** but allows us to send anything (we really want to retain
- ** ability to tx arbitrary frames in MONITOR mode)
- */
- tmp.macmode = (adev->mode != ACX_MODE_MONITOR ? adev->mode : ACX_MODE_2_STA);
+ * the only mode where fw does not emit beacons by itself but
+ * allows us to send anything (we really want to retain
+ * ability to tx arbitrary frames in MONITOR mode)
+ */
+ tmp.macmode = (adev->mode != ACX_MODE_MONITOR
+ ? adev->mode : ACX_MODE_2_STA);
tmp.channel = adev->channel;
tmp.essid_len = adev->essid_len;

@@ -1983,7 +1974,7 @@ int acx_cmd_join_bssid(acx_device_t *adev, const u8 *bssid)
log(L_ASSOC|L_DEBUG, "BSS_Type = %u\n", tmp.macmode);
acxlog_mac(L_ASSOC|L_DEBUG, "JoinBSSID MAC:", adev->bssid, "\n");

-/* acx_update_capabilities(adev); */
+ /* acx_update_capabilities(adev); */
FN_EXIT0;
return res;
}
@@ -1993,7 +1984,7 @@ int acx_cmd_join_bssid(acx_device_t *adev, const u8 *bssid)
* ==================================================
*/

-void acx_set_defaults(acx_device_t * adev)
+void acx_set_defaults(acx_device_t *adev)
{
struct eeprom_cfg *acfg = &adev->cfgopt;
FN_ENTER;
@@ -2013,8 +2004,7 @@ void acx_set_defaults(acx_device_t * adev)
acx_get_reg_domain(adev);

/* Only ACX100 supports ED and CCA */
- if (IS_ACX100(adev))
- {
+ if (IS_ACX100(adev)) {
acx1xx_get_cca(adev);
acx1xx_get_ed_threshold(adev);
}
@@ -2029,16 +2019,16 @@ void acx_set_defaults(acx_device_t * adev)
adev->brange_max_quality = 60; /* LED blink max quality is 60 */
adev->brange_time_last_state_change = jiffies;

- /* copy the MAC address we just got from the card
- * into our MAC address used during current 802.11 session */
+ /* copy the MAC address we just got from the card into our MAC
+ * address used during current 802.11 session */
SET_IEEE80211_PERM_ADDR(adev->ieee, adev->dev_addr);
MAC_BCAST(adev->ap);

MAC_COPY(adev->bssid, adev->dev_addr);

adev->essid_len =
- snprintf(adev->essid, sizeof(adev->essid), "ACXSTA%02X%02X%02X",
- adev->dev_addr[3], adev->dev_addr[4], adev->dev_addr[5]);
+ snprintf(adev->essid, sizeof(adev->essid), "ACXSTA%02X%02X%02X",
+ adev->dev_addr[3], adev->dev_addr[4], adev->dev_addr[5]);
adev->essid_active = 1;

/* we have a nick field to waste, so why not abuse it
@@ -2046,23 +2036,26 @@ void acx_set_defaults(acx_device_t * adev)
strncpy(adev->nick, "acx " ACX_RELEASE, IW_ESSID_MAX_SIZE);

if (IS_PCI(adev)) { /* FIXME: this should be made to apply to USB, too! */
- /* first regulatory domain entry in EEPROM == default reg. domain */
+ /* first regulatory domain entry in EEPROM == default
+ * reg. domain */
adev->reg_dom_id = acfg->domains.list[0];
} else if(IS_MEM(adev)){
- /* first regulatory domain entry in EEPROM == default reg. domain */
+ /* first regulatory domain entry in EEPROM == default
+ * reg. domain */
adev->reg_dom_id = acfg->domains.list[0];
}

- /* 0xffff would be better, but then we won't get a "scan complete"
- * interrupt, so our current infrastructure will fail: */
+ /* 0xffff would be better, but then we won't get a "scan
+ * complete" interrupt, so our current infrastructure will
+ * fail: */
adev->scan_count = 1;
adev->scan_mode = ACX_SCAN_OPT_ACTIVE;
adev->scan_duration = 100;
adev->scan_probe_delay = 200;
- /* reported to break scanning: adev->scan_probe_delay = acfg->probe_delay; */
+ /* reported to break scanning: adev->scan_probe_delay =
+ * acfg->probe_delay; */
adev->scan_rate = ACX_SCAN_RATE_1;

-
adev->mode = ACX_MODE_2_STA;
adev->listen_interval = 100;
adev->beacon_interval = DEFAULT_BEACON_INTERVAL;
@@ -2084,24 +2077,23 @@ void acx_set_defaults(acx_device_t * adev)
adev->rate_bcast100 = RATE100_1;
adev->rate_basic = RATE111_1 | RATE111_2;
adev->rate_auto = 1;
- if (IS_ACX111(adev)) {
+ if (IS_ACX111(adev))
adev->rate_oper = RATE111_ALL;
- } else {
+ else
adev->rate_oper = RATE111_ACX100_COMPAT;
- }

- /* Supported Rates element - the rates here are given in units of
- * 500 kbit/s, plus 0x80 added. See 802.11-1999.pdf item 7.3.2.2 */
+ /* Supported Rates element - the rates here are given in units
+ * of 500 kbit/s, plus 0x80 added. See 802.11-1999.pdf item
+ * 7.3.2.2 */
acx_update_ratevector(adev);

// Get current tx-power setting
acx1xx_get_tx_level(adev);

// Sensitivity settings
- if (IS_ACX111(adev)) {
+ if (IS_ACX111(adev))
/* start with sensitivity level 2 out of 3: */
adev->sensitivity = 2;
- }

/* #define ENABLE_POWER_SAVE */
#ifdef ENABLE_POWER_SAVE
@@ -2118,11 +2110,10 @@ void acx_set_defaults(acx_device_t * adev)
adev->ps_hangover_period = 0;
adev->ps_enhanced_transition_time = 0;
#endif
-
FN_EXIT0;
}

-void acx_start(acx_device_t * adev)
+void acx_start(acx_device_t *adev)
{
FN_ENTER;

@@ -2146,8 +2137,8 @@ void acx_start(acx_device_t * adev)

acx_update_mode(adev);

- // For the acx100, we leave the firmware sensitivity
- // and it doesn't support auto recalib, so don't set it
+ /* For the acx100, we leave the firmware sensitivity and it
+ doesn't support auto recalib, so don't set it */
if (IS_ACX111(adev)) {
acx_update_sensitivity(adev);
acx111_set_recalib_auto(adev, 1);
@@ -2198,9 +2189,8 @@ int acx_init_mac(acx_device_t * adev)
* external radio module */
acxmem_upload_radio(adev);
}
- else {
+ else
adev->memblocksize = 128;
- }

if (IS_ACX111(adev)) {
/* for ACX111, the order is different from ACX100
@@ -2229,8 +2219,7 @@ int acx_init_mac(acx_device_t * adev)

SET_IEEE80211_PERM_ADDR(adev->ieee, adev->dev_addr);
result = OK;
-
- fail:
+fail:
if (result)
pr_info("init_mac() FAILED\n");
FN_EXIT1(result);
@@ -2241,16 +2230,18 @@ int acx_setup_modes(acx_device_t *adev)
{
FN_ENTER;

- if (IS_ACX100(adev)) {
- adev->ieee->wiphy->bands[IEEE80211_BAND_2GHZ] = &acx100_band_2GHz;
- } else
- if (IS_ACX111(adev))
- adev->ieee->wiphy->bands[IEEE80211_BAND_2GHZ] = &acx111_band_2GHz;
- else {
- logf0(L_ANY, "Error: Unknown device");
- return -1;
- }
-
+ if (IS_ACX100(adev)) {
+ adev->ieee->wiphy->bands[IEEE80211_BAND_2GHZ] =
+ &acx100_band_2GHz;
+ } else {
+ if (IS_ACX111(adev))
+ adev->ieee->wiphy->bands[IEEE80211_BAND_2GHZ] =
+ &acx111_band_2GHz;
+ else {
+ logf0(L_ANY, "Error: Unknown device");
+ return -1;
+ }
+ }
FN_EXIT0;
return 0;
}
@@ -2260,7 +2251,6 @@ static int acx_set_mode(acx_device_t *adev, u16 mode)
{
adev->mode = mode;
return acx_update_mode(adev);
-
}

static int acx_update_mode(acx_device_t *adev)
@@ -2298,7 +2288,6 @@ static int acx_update_mode(acx_device_t *adev)
}

FN_EXIT0;
-
return res ? NOT_OK : OK;
}

@@ -2322,7 +2311,6 @@ int acx_selectchannel(acx_device_t *adev, u8 channel, int freq)
acx_wake_queue(adev->ieee, NULL);

FN_EXIT0;
-
return res ? NOT_OK : OK;
}

@@ -2330,8 +2318,8 @@ static void acx_get_sensitivity(acx_device_t *adev)
{

if ( (RADIO_11_RFMD == adev->radio_type) ||
- (RADIO_0D_MAXIM_MAX2820 == adev->radio_type) ||
- (RADIO_15_RALINK == adev->radio_type))
+ (RADIO_0D_MAXIM_MAX2820 == adev->radio_type) ||
+ (RADIO_15_RALINK == adev->radio_type))
{
acx_read_phy_reg(adev, 0x30, &adev->sensitivity);
} else {
@@ -2339,7 +2327,6 @@ static void acx_get_sensitivity(acx_device_t *adev)
"for radio type 0x%02X\n", adev->radio_type);
return;
}
-
log(L_INIT, "got sensitivity value %u\n", adev->sensitivity);
}

@@ -2352,14 +2339,13 @@ static void acx_set_sensitivity(acx_device_t *adev, u8 sensitivity)

static void acx_update_sensitivity(acx_device_t *adev)
{
-
- if (IS_USB(adev) && IS_ACX100(adev)){
+ if (IS_USB(adev) && IS_ACX100(adev)) {
log(L_ANY, "Updating sensitivity on usb acx100 doesn't work yet.\n");
return;
}

log(L_INIT, "updating sensitivity value: %u\n",
- adev->sensitivity);
+ adev->sensitivity);
switch (adev->radio_type) {
case RADIO_0D_MAXIM_MAX2820:
case RADIO_11_RFMD:
@@ -2368,14 +2354,14 @@ static void acx_update_sensitivity(acx_device_t *adev)
break;
case RADIO_16_RADIA_RC2422:
case RADIO_17_UNKNOWN:
- /* TODO: check whether RADIO_1B (ex-Radia!) has same behaviour */
+ /* TODO: check whether RADIO_1B (ex-Radia!) has same
+ * behaviour */
acx111_sens_radio_16_17(adev);
break;
default:
log(L_INIT, "don't know how to modify the sensitivity "
- "for radio type 0x%02X\n", adev->radio_type);
+ "for radio type 0x%02X\n", adev->radio_type);
}
-
}

static void acx_get_reg_domain(acx_device_t *adev)
@@ -2383,7 +2369,7 @@ static void acx_get_reg_domain(acx_device_t *adev)
acx_ie_generic_t dom;

acx_interrogate(adev, &dom,
- ACX1xx_IE_DOT11_CURRENT_REG_DOMAIN);
+ ACX1xx_IE_DOT11_CURRENT_REG_DOMAIN);
adev->reg_dom_id = dom.m.bytes[0];
log(L_INIT, "Got regulatory domain 0x%02X\n", adev->reg_dom_id);
}
@@ -2407,8 +2393,8 @@ static int acx1xx_set_tx_level_dbm(acx_device_t *adev, int level_dbm)
return acx1xx_update_tx_level_dbm(adev);
}

-static int acx1xx_update_tx_level_dbm(acx_device_t *adev) {
-
+static int acx1xx_update_tx_level_dbm(acx_device_t *adev)
+{
u8 level_val;
// Number of level of device
int numl;
@@ -2419,37 +2405,39 @@ static int acx1xx_update_tx_level_dbm(acx_device_t *adev) {
// Helper for modulo dpl, ...
int helper;

- /* The acx is working with power levels, which shift the tx-power
- * in partitioned steps and also depending on the configured regulatory
- * domain.
+ /* The acx is working with power levels, which shift the
+ * tx-power in partitioned steps and also depending on the
+ * configured regulatory domain.
*
* The acx111 has five tx_power levels, the acx100 we assume two.
*
- * The acx100 also displays them in co_powerlevels_t config options. We
- * could use this info for a more precise matching, but for the time being,
- * we assume there two levels by default.
+ * The acx100 also displays them in co_powerlevels_t config
+ * options. We could use this info for a more precise
+ * matching, but for the time being, we assume there two
+ * levels by default.
*
- * The approach here to set the corresponding tx-power level here, is to
- * translate the requested tx-power in dbm onto a scale of 0-20dbm, with an
- * assumed maximum of 20dbm. The maximum would normally vary depending on
- * the regulatory domain.
+ * The approach here to set the corresponding tx-power level
+ * here, is to translate the requested tx-power in dbm onto a
+ * scale of 0-20dbm, with an assumed maximum of 20dbm. The
+ * maximum would normally vary depending on the regulatory
+ * domain.
*
- * The the value on the 0-20dbm scale is then matched onto the available
- * levels.
+ * The the value on the 0-20dbm scale is then matched onto the
+ * available levels.
*/

if (adev->tx_level_dbm > TX_CFG_MAX_DBM_POWER) {
- logf1(L_ANY, "Err: Setting tx-power > %d dbm not supported\n", TX_CFG_MAX_DBM_POWER);
+ logf1(L_ANY, "Err: Setting tx-power > %d dbm not supported\n",
+ TX_CFG_MAX_DBM_POWER);
return (NOT_OK);
}

- if (IS_ACX111(adev)) {
+ if (IS_ACX111(adev))
numl = TX_CFG_ACX111_NUM_POWER_LEVELS;
- } else if (IS_ACX100(adev)) {
+ else if (IS_ACX100(adev))
numl = TX_CFG_ACX100_NUM_POWER_LEVELS;
- } else {
+ else
return (NOT_OK);
- }

dpl = TX_CFG_MAX_DBM_POWER / numl;

@@ -2474,11 +2462,9 @@ static int acx1xx_update_tx_level_dbm(acx_device_t *adev) {
adev->tx_level_dbm = nlr * dpl;
log(L_ANY, "Tx-power adjusted from %d to %d dbm (tx-power-level: %d)\n", helper, adev->tx_level_dbm, level_val);
}
-
return acx1xx_set_tx_level(adev, level_val);
}

-
static int acx1xx_get_tx_level(acx_device_t *adev)
{
struct acx1xx_ie_tx_level tx_level;
@@ -2492,14 +2478,14 @@ static int acx1xx_get_tx_level(acx_device_t *adev)

memset(&tx_level, 0, sizeof(tx_level));

- if (OK != acx_interrogate(adev, &tx_level, ACX1xx_IE_DOT11_TX_POWER_LEVEL)) {
+ if (OK != acx_interrogate(adev, &tx_level,
+ ACX1xx_IE_DOT11_TX_POWER_LEVEL)) {
FN_EXIT1(NOT_OK);
return NOT_OK;
}
adev->tx_level_val= tx_level.level;
log(L_ANY, "Got tx-power-level: %d\n", adev->tx_level_val);
-
- end:
+end:
FN_EXIT0;
return OK;
}
@@ -2522,6 +2508,7 @@ static int acx1xx_update_tx_level(acx_device_t *adev)
log(L_ANY, "Updating tx-power-level to: %d\n", adev->tx_level_val);
memset(&tx_level, 0, sizeof(tx_level));
tx_level.level=adev->tx_level_val;
+
return acx_configure(adev, &tx_level, ACX1xx_IE_DOT11_TX_POWER_LEVEL);
}

@@ -2570,17 +2557,18 @@ int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm)
* assumed that these values drive the DAC responsible for
* setting the linear Tx level, I'd guess that these values
* should be the corresponding linear values for a dBm value,
- * in other words: calculate the values from that formula:
+ * in other words:
+ * calculate the values from that formula:
* Y [dBm] = 10 * log (X [mW])
- * then scale the 0..63 value range onto the 1..100mW range (0..20 dBm)
- * and you're done...
+ * then scale the 0..63 value range onto the 1..100mW range
+ * (0..20 dBm) and you're done...
* Hopefully that's ok, but you never know if we're actually
* right... (especially since Windows XP doesn't seem to show
* actual Tx dBm values :-P) */

- /* NOTE: on Maxim, value 30 IS 30mW, and value 10 IS 10mW - so the
- * values are EXACTLY mW!!! Not sure about RFMD and others,
- * though... */
+ /* NOTE: on Maxim, value 30 IS 30mW, and value 10 IS 10mW - so
+ * the values are EXACTLY mW!!! Not sure about RFMD and
+ * others, though... */
static const u8 dbm2val_maxim[21] = {
63, 63, 63, 62,
61, 61, 60, 60,
@@ -2609,7 +2597,8 @@ int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm)
break;
default:
pr_info("%s: unknown/unsupported radio type, "
- "cannot modify tx power level yet!\n", wiphy_name(adev->ieee->wiphy));
+ "cannot modify tx power level yet!\n",
+ wiphy_name(adev->ieee->wiphy));
return NOT_OK;
}
pr_info("%s: changing radio power level to %u dBm (%u)\n",
@@ -2618,28 +2607,32 @@ int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm)
return OK;
}

-// Comment int acx100mem_set_tx_level(acx_device_t *adev, u8 level_dbm)
-// Otherwise equal with int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm)
+/* Comment int acx100mem_set_tx_level(acx_device_t *adev, u8
+ level_dbm) Otherwise equal with int
+ acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm) */
/*
- * The hx4700 EEPROM, at least, only supports 1 power setting. The configure
- * routine matches the PA bias with the gain, so just use its default value.
- * The values are: 0x2b for the gain and 0x03 for the PA bias. The firmware
- * writes the gain level to the Tx gain control DAC and the PA bias to the Maxim
- * radio's PA bias register. The firmware limits itself to 0 - 64 when writing to the
- * gain control DAC.
+ * The hx4700 EEPROM, at least, only supports 1 power setting. The
+ * configure routine matches the PA bias with the gain, so just use
+ * its default value. The values are: 0x2b for the gain and 0x03 for
+ * the PA bias. The firmware writes the gain level to the Tx gain
+ * control DAC and the PA bias to the Maxim radio's PA bias register.
+ * The firmware limits itself to 0 - 64 when writing to the gain
+ * control DAC.
*
- * Physically between the ACX and the radio, higher Tx gain control DAC values result
- * in less power output; 0 volts to the Maxim radio results in the highest output power
- * level, which I'm assuming matches up with 0 in the Tx Gain DAC register.
+ * Physically between the ACX and the radio, higher Tx gain control
+ * DAC values result in less power output; 0 volts to the Maxim radio
+ * results in the highest output power level, which I'm assuming
+ * matches up with 0 in the Tx Gain DAC register.
*
- * Although there is only the 1 power setting, one of the radio firmware functions adjusts
- * the transmit power level up and down. That function is called by the ACX FIQ handler
- * under certain conditions.
+ * Although there is only the 1 power setting, one of the radio
+ * firmware functions adjusts the transmit power level up and down.
+ * That function is called by the ACX FIQ handler under certain
+ * conditions.
*/
#endif

-static int acx1xx_get_antenna(acx_device_t *adev) {
-
+static int acx1xx_get_antenna(acx_device_t *adev)
+{
int res;
u8 antenna[4 + ACX1xx_IE_DOT11_CURRENT_ANTENNA_LEN];

@@ -2653,14 +2646,11 @@ static int acx1xx_get_antenna(acx_device_t *adev) {
log(L_INIT, "Got antenna[0,1]: 0x%02X 0x%02X\n", adev->antenna[0], adev->antenna[1]);

FN_EXIT0;
-
return res;
-
}

-
-static int acx1xx_set_antenna(acx_device_t *adev, u8 val0, u8 val1) {
-
+static int acx1xx_set_antenna(acx_device_t *adev, u8 val0, u8 val1)
+{
int res;

FN_ENTER;
@@ -2670,19 +2660,18 @@ static int acx1xx_set_antenna(acx_device_t *adev, u8 val0, u8 val1) {
res=acx1xx_update_antenna(adev);

FN_EXIT0;
-
return res;
-
}

-static int acx1xx_update_antenna(acx_device_t *adev) {
-
+static int acx1xx_update_antenna(acx_device_t *adev)
+{
int res;
u8 antenna[4 + ACX1xx_IE_DOT11_CURRENT_ANTENNA_LEN];

FN_ENTER;

- log(L_INIT, "Updating antenna[0,1]: 0x%02X 0x%02X\n", adev->antenna[0], adev->antenna[1]);
+ log(L_INIT, "Updating antenna[0,1]: 0x%02X 0x%02X\n",
+ adev->antenna[0], adev->antenna[1]);
memset(antenna, 0, sizeof(antenna));
antenna[4] = adev->antenna[0];
antenna[5] = adev->antenna[1];
@@ -2690,7 +2679,6 @@ static int acx1xx_update_antenna(acx_device_t *adev) {
ACX1xx_IE_DOT11_CURRENT_ANTENNA);

FN_EXIT0;
-
return res;
}

@@ -2699,8 +2687,8 @@ static int acx1xx_update_antenna(acx_device_t *adev) {
/*
* 0 = antenna1; 1 = antenna2; 2 = full diversity; 3 = partial diversity
*/
-static int acx100_set_rx_antenna(acx_device_t *adev, u8 val) {
-
+static int acx100_set_rx_antenna(acx_device_t *adev, u8 val)
+{
int result;

FN_ENTER;
@@ -2721,8 +2709,7 @@ static int acx100_set_rx_antenna(acx_device_t *adev, u8 val) {
result = acx1xx_update_antenna(adev);

acx_sem_unlock(adev);
-
- end:
+end:
FN_EXIT1(result);
return result;
}
@@ -2731,8 +2718,8 @@ static int acx100_set_rx_antenna(acx_device_t *adev, u8 val) {
* Arguments: 0 == antenna1; 1 == antenna2;
* Could anybody test which antenna is the external one?
*/
-static int acx100_set_tx_antenna(acx_device_t *adev, u8 val) {
-
+static int acx100_set_tx_antenna(acx_device_t *adev, u8 val)
+{
int result;
u8 val2;

@@ -2767,7 +2754,7 @@ static int acx100_set_tx_antenna(acx_device_t *adev, u8 val) {
result = acx1xx_update_antenna(adev);

acx_sem_unlock(adev);
- end:
+end:
FN_EXIT1(result);
return result;
}
@@ -2788,25 +2775,24 @@ void acx_update_capabilities(acx_device_t * adev)
/* other types of stations do not emit beacons */
}

- if (adev->wep_restricted) {
+ if (adev->wep_restricted)
SET_BIT(cap, WF_MGMT_CAP_PRIVACY);
- }
- if (acfg->dot11ShortPreambleOption) {
+
+ if (acfg->dot11ShortPreambleOption)
SET_BIT(cap, WF_MGMT_CAP_SHORT);
- }
- if (acfg->dot11PBCCOption) {
+
+ if (acfg->dot11PBCCOption)
SET_BIT(cap, WF_MGMT_CAP_PBCC);
- }
- if (acfg->dot11ChannelAgility) {
+
+ if (acfg->dot11ChannelAgility)
SET_BIT(cap, WF_MGMT_CAP_AGILITY);
- }
+
log(L_DEBUG, "caps updated from 0x%04X to 0x%04X\n",
adev->capabilities, cap);
adev->capabilities = cap;
}
#endif

-
static int acx1xx_get_station_id(acx_device_t *adev)
{
u8 stationID[4 + ACX1xx_IE_DOT11_STATION_ID_LEN];
@@ -2818,9 +2804,8 @@ static int acx1xx_get_station_id(acx_device_t *adev)
res=acx_interrogate(adev, &stationID, ACX1xx_IE_DOT11_STATION_ID);
paddr = &stationID[4];
for (i = 0; i < ETH_ALEN; i++) {
- /* we copy the MAC address (reversed in
- * the card) to the netdevice's MAC
- * address, and on ifup it will be
+ /* we copy the MAC address (reversed in the card) to
+ * the netdevice's MAC address, and on ifup it will be
* copied into iwadev->dev_addr */
adev->dev_addr[ETH_ALEN - 1 - i] = paddr[i];
}
@@ -2852,14 +2837,14 @@ static int acx1xx_update_station_id(acx_device_t *adev)

FN_ENTER;

- log(L_INIT, "Updating station_id to: " MACSTR "\n", MAC(adev->dev_addr));
+ log(L_INIT, "Updating station_id to: " MACSTR "\n",
+ MAC(adev->dev_addr));

paddr = &stationID[4];
for (i = 0; i < ETH_ALEN; i++) {
/* copy the MAC address we obtained when we noticed
- * that the ethernet iface's MAC changed
- * to the card (reversed in
- * the card!) */
+ * that the ethernet iface's MAC changed to the card
+ * (reversed in the card!) */
paddr[i] = adev->dev_addr[ETH_ALEN - 1 - i];
}
res=acx_configure(adev, &stationID, ACX1xx_IE_DOT11_STATION_ID);
@@ -2870,7 +2855,7 @@ static int acx1xx_update_station_id(acx_device_t *adev)

static int acx1xx_get_ed_threshold(acx_device_t *adev)
{
- int res=NOT_OK;
+ int res = NOT_OK;

FN_ENTER;

@@ -2925,11 +2910,10 @@ static int acx1xx_update_ed_threshold(acx_device_t *adev)
log(L_INIT, "Updating the Energy Detect (ED) threshold: %u\n",
adev->ed_threshold);

- if (IS_ACX100(adev)) {
+ if (IS_ACX100(adev))
res=acx100_update_ed_threshold(adev);
- } else {
+ else
log(L_INIT, "acx111 doesn't support ED threshold\n");
- }

FN_EXIT0;
return res;
@@ -2955,14 +2939,14 @@ static int acx1xx_get_cca(acx_device_t *adev)
int res = NOT_OK;

FN_ENTER;
- if (IS_ACX100(adev)) {
+ if (IS_ACX100(adev))
acx100_get_cca(adev);
- } else {
+ else {
log(L_INIT, "acx111 doesn't support CCA\n");
adev->cca = 0;
- }log(
- L_INIT,
- "acx: Got Channel Clear Assessment (CCA) value %u\n", adev->cca);
+ }
+ log(L_INIT, "Got Channel Clear Assessment (CCA) value %u\n",
+ adev->cca);

FN_EXIT0;
return res;
@@ -2978,8 +2962,8 @@ static int acx100_get_cca(acx_device_t *adev)
res = acx_interrogate(adev, cca,
ACX1xx_IE_DOT11_CURRENT_CCA_MODE);
adev->cca = cca[4];
- FN_EXIT0;

+ FN_EXIT0;
return res;
}

@@ -3005,9 +2989,9 @@ static int acx1xx_update_cca(acx_device_t *adev)
FN_ENTER;
log(L_INIT, "Updating the Channel Clear Assessment (CCA) value: "
"0x%02X\n", adev->cca);
- if (IS_ACX100(adev)) {
+ if (IS_ACX100(adev))
res = acx100_update_cca(adev);
- } else
+ else
log(L_INIT, "acx111 doesn't support CCA\n");

FN_EXIT0;
@@ -3033,7 +3017,7 @@ static int acx100_update_cca(acx_device_t *adev)
#ifdef UNUSED
static int acx1xx_get_rate_fallback(acx_device_t *adev)
{
- int res=NOT_OK;
+ int res = NOT_OK;
u8 rate[4 + ACX1xx_IE_RATE_FALLBACK_LEN];

FN_ENTER;
@@ -3051,7 +3035,7 @@ static int acx1xx_set_rate_fallback(acx_device_t *adev, u8 rate_auto)
int res;
FN_ENTER;
adev->rate_auto = rate_auto;
- res=acx1xx_update_rate_fallback(adev);
+ res = acx1xx_update_rate_fallback(adev);
FN_EXIT0;
return res;
}
@@ -3064,7 +3048,8 @@ static int acx1xx_update_rate_fallback(acx_device_t *adev)

FN_ENTER;
/* configure to not do fallbacks when not in auto rate mode */
- rate[4] = (adev->rate_auto) ? /* adev->txrate_fallback_retries */1 : 0;
+ rate[4] = (adev->rate_auto) /* adev->txrate_fallback_retries */
+ ? 1 : 0;
log(L_INIT, "Updating Tx fallback to %u retries\n", rate[4]);

res = acx_configure(adev, &rate, ACX1xx_IE_RATE_FALLBACK);
@@ -3122,7 +3107,6 @@ static int acx1xx_set_rx_enable(acx_device_t *adev, u8 rx_enabled)
return res;
}

-
static int acx1xx_update_rx(acx_device_t *adev)
{
int res;
@@ -3166,7 +3150,7 @@ static int acx1xx_update_retry(acx_device_t *adev)

static int acx1xx_update_msdu_lifetime(acx_device_t *adev)
{
- int res=NOT_OK;
+ int res = NOT_OK;
u8 xmt_msdu_lifetime[4 + ACX1xx_IE_DOT11_MAX_XMIT_MSDU_LIFETIME_LEN];
FN_ENTER;

@@ -3271,7 +3255,6 @@ static int acx_update_rx_config(acx_device_t *adev)
res = acx_configure(adev, &cfg, ACX1xx_IE_RXCONFIG);

FN_EXIT0;
-
return res;
}

@@ -3362,10 +3345,12 @@ static int acx_set_beacon(acx_device_t *adev, struct sk_buff *beacon)
/* The TIM template handling between ACX100 and ACX111 works
* differently:
*
- * ACX111: Needs TIM in dedicated template via ACX1xx_CMD_CONFIG_TIM
+ * ACX111: Needs TIM in dedicated template via
+ * ACX1xx_CMD_CONFIG_TIM
*
- * ACX100: Needs TIM included into the beacon, however space for TIM
- * template needs to be configured during memory-map setup
+ * ACX100: Needs TIM included into the beacon, however space
+ * for TIM template needs to be configured during memory-map
+ * setup
*/

// TODO Use pos provided by ieee80211_beacon_get_tim instead
@@ -3373,8 +3358,8 @@ static int acx_set_beacon(acx_device_t *adev, struct sk_buff *beacon)
if (tim_pos == NULL)
logf0(L_DEBUG, "No tim contained in beacon skb");

- /* ACX111: If beacon contains tim, only configure beacon-template
- * until tim
+ /* ACX111: If beacon contains tim, only configure
+ * beacon-template until tim
*/
if (IS_ACX111(adev) && tim_pos)
len_wo_tim = tim_pos - beacon->data;
@@ -3396,11 +3381,11 @@ static int acx_set_beacon(acx_device_t *adev, struct sk_buff *beacon)
}

/* BTW acx111 firmware would not send probe responses if probe
- ** request does not have all basic rates flagged by 0x80!
- ** Thus firmware does not conform to 802.11, it should ignore
- ** 0x80 bit in ratevector from STA. We can 'fix' it by not
- ** using this template and sending probe responses by
- ** hand. TODO --vda */
+ * request does not have all basic rates flagged by 0x80!
+ * Thus firmware does not conform to 802.11, it should ignore
+ * 0x80 bit in ratevector from STA. We can 'fix' it by not
+ * using this template and sending probe responses by
+ * hand. TODO --vda */
res = acx_set_probe_response_template(adev, beacon->data, len_wo_tim);
if (res)
goto out;
@@ -3419,9 +3404,7 @@ static int acx_set_beacon(acx_device_t *adev, struct sk_buff *beacon)
* BOM Templates (Control Path)
* ==================================================
*/
-
-static int
-acx_init_max_template_generic(acx_device_t * adev, unsigned int len,
+static int acx_init_max_template_generic(acx_device_t *adev, unsigned int len,
unsigned int cmd)
{
int res;
@@ -3439,7 +3422,7 @@ acx_init_max_template_generic(acx_device_t * adev, unsigned int len,
return res;
}

-static int acx_init_max_null_data_template(acx_device_t * adev)
+static int acx_init_max_null_data_template(acx_device_t *adev)
{
/* OW hh version:
* issue_cmd(cmd:cmd,buflen:26,timeout:50ms,type:0x0018)
@@ -3455,28 +3438,28 @@ static int acx_init_max_null_data_template(acx_device_t * adev)
}


-static int acx_init_max_beacon_template(acx_device_t * adev)
+static int acx_init_max_beacon_template(acx_device_t *adev)
{
return acx_init_max_template_generic(adev,
sizeof(acx_template_beacon_t),
ACX1xx_CMD_CONFIG_BEACON);
}

-static int acx_init_max_tim_template(acx_device_t * adev)
+static int acx_init_max_tim_template(acx_device_t *adev)
{
return acx_init_max_template_generic(adev,
sizeof(acx_template_tim_t),
ACX1xx_CMD_CONFIG_TIM);
}

-static int acx_init_max_probe_response_template(acx_device_t * adev)
+static int acx_init_max_probe_response_template(acx_device_t *adev)
{
return acx_init_max_template_generic(adev,
sizeof(acx_template_proberesp_t),
ACX1xx_CMD_CONFIG_PROBE_RESPONSE);
}

-static int acx_init_max_probe_request_template(acx_device_t * adev)
+static int acx_init_max_probe_request_template(acx_device_t *adev)
{
return acx_init_max_template_generic(adev,
sizeof(acx_template_probereq_t),
@@ -3549,8 +3532,8 @@ static int acx_set_tim_template(acx_device_t *adev, u8 *data, int len)
}

#ifdef UNUSED_BUT_USEFULL
-static int acx_s_set_tim_template_off(acx_device_t *adev) {
-
+static int acx_s_set_tim_template_off(acx_device_t *adev)
+{
acx_template_nullframe_t templ;
int result;

@@ -3566,9 +3549,8 @@ static int acx_s_set_tim_template_off(acx_device_t *adev) {
}
#endif

-
#if POWER_SAVE_80211
-static int acx_s_set_null_data_template(acx_device_t * adev)
+static int acx_s_set_null_data_template(acx_device_t *adev)
{
struct acx_template_nullframe b;
int result;
@@ -3593,7 +3575,6 @@ static int acx_s_set_null_data_template(acx_device_t * adev)
}
#endif

-
static int acx_set_beacon_template(acx_device_t *adev, u8 *data, int len)
{
struct acx_template_beacon templ;
@@ -3618,8 +3599,8 @@ static int acx_set_beacon_template(acx_device_t *adev, u8 *data, int len)
return res;
}

-static int
-acx_set_probe_response_template(acx_device_t *adev, u8* data, int len)
+static int acx_set_probe_response_template(acx_device_t *adev, u8* data,
+ int len)
{
struct acx_template_proberesp templ;
int res;
@@ -3640,8 +3621,8 @@ acx_set_probe_response_template(acx_device_t *adev, u8* data, int len)
}

#ifdef UNUSED_BUT_USEFULL
-static int acx_s_set_probe_response_template_off(acx_device_t *adev) {
-
+static int acx_s_set_probe_response_template_off(acx_device_t *adev)
+{
acx_template_nullframe_t templ;
int result;

@@ -3664,7 +3645,7 @@ static int acx_s_set_probe_response_template_off(acx_device_t *adev) {
* layout! init templates: max Probe Request (station mode), max NULL
* data, max Beacon, max TIM, max Probe Response.
*/
-static int acx_init_packet_templates(acx_device_t * adev)
+static int acx_init_packet_templates(acx_device_t *adev)
{
acx_ie_memmap_t mm; /* ACX100 only */
int result = NOT_OK;
@@ -3713,7 +3694,7 @@ static int acx_init_packet_templates(acx_device_t * adev)
result = OK;
goto success;

- failed_acx100:
+failed_acx100:
log(L_DEBUG | L_INIT,
/* "cb=0x%X\n" */
"acx: ACXMemoryMap:\n"
@@ -3722,7 +3703,7 @@ static int acx_init_packet_templates(acx_device_t * adev)
"acx: .WEPCacheStart=0x%X\n"
"acx: .WEPCacheEnd=0x%X\n"
"acx: .PacketTemplateStart=0x%X\n"
- "acx: .PacketTemplateEnd=0x%X\n",
+ "acx: .PacketTemplateEnd=0x%X\n",
/* len, */
le32_to_cpu(mm.CodeStart),
le32_to_cpu(mm.CodeEnd),
@@ -3731,18 +3712,17 @@ static int acx_init_packet_templates(acx_device_t * adev)
le32_to_cpu(mm.PacketTemplateStart),
le32_to_cpu(mm.PacketTemplateEnd));

- failed:
+failed:
pr_info("%s: %s() FAILED\n",
wiphy_name(adev->ieee->wiphy), __func__);

- success:
+success:
FN_EXIT1(result);
return result;
}

#ifdef UNUSED_BUT_USEFULL
-static int
-acx_s_set_probe_request_template(acx_device_t *adev)
+static int acx_s_set_probe_request_template(acx_device_t *adev)
{
struct acx_template_probereq probereq;
char *p;
@@ -3774,19 +3754,18 @@ acx_s_set_probe_request_template(acx_device_t *adev)
}
#endif

-
/*
* BOM Recalibration (Control Path)
* ==================================================
*/
-
-static int acx111_set_recalib_auto(acx_device_t *adev, int enable) {
+static int acx111_set_recalib_auto(acx_device_t *adev, int enable)
+{
adev->recalib_auto=enable;
return(acx111_update_recalib_auto(adev));
}

-static int acx111_update_recalib_auto(acx_device_t *adev) {
-
+static int acx111_update_recalib_auto(acx_device_t *adev)
+{
acx111_cmd_radiocalib_t cal;

if (!IS_ACX111(adev)) {
@@ -3813,44 +3792,45 @@ static int acx111_update_recalib_auto(acx_device_t *adev) {
CMD_TIMEOUT_MS(100));
}

-static int acx_recalib_radio(acx_device_t *adev) {
-
+static int acx_recalib_radio(acx_device_t *adev)
+{
if (IS_ACX100(adev)) {
logf0(L_INIT, "acx100: Doing radio re-calibration.\n");
/* On ACX100, we need to recalibrate the radio
* by issuing a GETSET_TX|GETSET_RX */
- if (
- /* (OK == acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_TX, NULL, 0)) &&
- (OK == acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_RX, NULL, 0)) && */
- (acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_TX, &adev->channel, 1) == OK)
- && (acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_RX, &adev->channel, 1)
- == OK))
+
+ /* (OK == acx_s_issue_cmd(adev, ACX1xx_CMD_DISABLE_TX,
+ NULL, 0)) && (OK == acx_s_issue_cmd(adev,
+ ACX1xx_CMD_DISABLE_RX, NULL, 0)) && */
+ if ((acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_TX, &adev->channel,
+ 1) == OK)
+ && (acx_issue_cmd(adev, ACX1xx_CMD_ENABLE_RX,
+ &adev->channel, 1) == OK))
return OK;

return NOT_OK;
} else {
logf0(L_INIT, "acx111: Enabling auto radio re-calibration.\n");
- return(acx111_set_recalib_auto(adev, 1));
+ return(acx111_set_recalib_auto(adev, 1));
}

}

-static void acx_after_interrupt_recalib(acx_device_t * adev)
+static void acx_after_interrupt_recalib(acx_device_t *adev)
{
int res;

- /* this helps with ACX100 at least;
- * hopefully ACX111 also does a
- * recalibration here */
+ /* this helps with ACX100 at least; hopefully ACX111 also does
+ * a recalibration here */

- /* clear flag beforehand, since we want to make sure
- * it's cleared; then only set it again on specific circumstances */
+ /* clear flag beforehand, since we want to make sure it's
+ * cleared; then only set it again on specific
+ * circumstances */
CLEAR_BIT(adev->after_interrupt_jobs, ACX_AFTER_IRQ_CMD_RADIO_RECALIB);

- /* better wait a bit between recalibrations to
- * prevent overheating due to torturing the card
- * into working too long despite high temperature
- * (just a safety measure) */
+ /* better wait a bit between recalibrations to prevent
+ * overheating due to torturing the card into working too long
+ * despite high temperature (just a safety measure) */
if (adev->recalib_time_last_success
&& time_before(jiffies, adev->recalib_time_last_success
+ RECALIB_PAUSE * 60 * HZ)) {
@@ -3868,8 +3848,8 @@ static void acx_after_interrupt_recalib(acx_device_t * adev)

adev->recalib_msg_ratelimit = 0;

- /* note that commands sometimes fail (card busy),
- * so only clear flag if we were fully successful */
+ /* note that commands sometimes fail (card busy), so only
+ * clear flag if we were fully successful */
res = acx_recalib_radio(adev);
if (res == OK) {
pr_info("%s: successfully recalibrated radio\n",
@@ -3877,21 +3857,21 @@ static void acx_after_interrupt_recalib(acx_device_t * adev)
adev->recalib_time_last_success = jiffies;
adev->recalib_failure_count = 0;
} else {
- /* failed: resubmit, but only limited
- * amount of times within some time range
- * to prevent endless loop */
+ /* failed: resubmit, but only limited amount of times
+ * within some time range to prevent endless loop */

adev->recalib_time_last_success = 0; /* we failed */

- /* if some time passed between last
- * attempts, then reset failure retry counter
- * to be able to do next recalib attempt */
+ /* if some time passed between last attempts, then
+ * reset failure retry counter to be able to do next
+ * recalib attempt */
if (time_after
(jiffies, adev->recalib_time_last_attempt + 5 * HZ))
adev->recalib_failure_count = 0;

if (adev->recalib_failure_count < 5) {
- /* increment inside only, for speedup of outside path */
+ /* increment inside only, for speedup of
+ * outside path */
adev->recalib_failure_count++;
adev->recalib_time_last_attempt = jiffies;
acx_schedule_task(adev,
@@ -3900,12 +3880,10 @@ static void acx_after_interrupt_recalib(acx_device_t * adev)
}
}

-
/*
* BOM Other (Control Path)
* ==================================================
*/
-
#if POWER_SAVE_80211
static void acx_s_update_80211_powersave_mode(acx_device_t * adev)
{
@@ -3969,7 +3947,6 @@ static void acx_s_update_80211_powersave_mode(acx_device_t * adev)
#if 0

/** Rate values **/
-
#define ACX_CCK_RATE_1MB 0
#define ACX_CCK_RATE_2MB 1
#define ACX_CCK_RATE_5MB 2
@@ -4035,9 +4012,9 @@ static void acx_set_sane_reg_domain(acx_device_t *adev, int do_set)

if (sizeof(acx_reg_domain_ids) == i) {
log(L_INIT, "Invalid or unsupported regulatory domain"
- " 0x%02X specified, falling back to FCC (USA)!"
- " Please report if this sounds fishy!\n",
- adev->reg_dom_id);
+ " 0x%02X specified, falling back to FCC (USA)!"
+ " Please report if this sounds fishy!\n",
+ adev->reg_dom_id);
i = 0;
adev->reg_dom_id = acx_reg_domain_ids[i];

@@ -4057,7 +4034,7 @@ static void acx_set_sane_reg_domain(acx_device_t *adev, int do_set)

mask = (1 << (adev->channel - 1));
if (!(adev->reg_dom_chanmask & mask)) {
- /* hmm, need to adjust our channel to reside within domain */
+ /* hmm, need to adjust our channel to reside within domain */
mask = 1;
for (i = 1; i <= 14; i++) {
if (adev->reg_dom_chanmask & mask) {
@@ -4072,7 +4049,7 @@ static void acx_set_sane_reg_domain(acx_device_t *adev, int do_set)
}
}

-static void acx111_sens_radio_16_17(acx_device_t * adev)
+static void acx111_sens_radio_16_17(acx_device_t *adev)
{
u32 feature1, feature2;

@@ -4095,7 +4072,7 @@ static void acx111_sens_radio_16_17(acx_device_t * adev)
*
* Updates adev->rate_supported[_len] according to rate_{basic,oper}
*/
-static void acx_update_ratevector(acx_device_t * adev)
+static void acx_update_ratevector(acx_device_t *adev)
{
u16 bcfg = adev->rate_basic;
u16 ocfg = adev->rate_oper;
@@ -4196,24 +4173,28 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
seq_printf(file, "tx_queue len: %d\n", skb_queue_len(&adev->tx_queue));

seq_printf(file, "\n" "** PHY status **\n"
- "tx_enabled %d, tx_level_dbm %d, tx_level_val %d,\n "/* "tx_level_auto %d\n" */
- "sensitivity %d, antenna[0,1] 0x%02X 0x%02X, ed_threshold %d, cca %d, preamble_mode %d\n"
- "rate_basic 0x%04X, rate_oper 0x%04X\n"
- "rts_threshold %d, frag_threshold %d, short_retry %d, long_retry %d\n"
- "msdu_lifetime %d, listen_interval %d, beacon_interval %d\n",
- adev->tx_enabled, adev->tx_level_dbm, adev->tx_level_val, /* adev->tx_level_auto, */
- adev->sensitivity, adev->antenna[0], adev->antenna[1], adev->ed_threshold,
- adev->cca, adev->preamble_mode, adev->rate_basic, adev->rate_oper, adev->rts_threshold,
- adev->frag_threshold, adev->short_retry, adev->long_retry,
- adev->msdu_lifetime, adev->listen_interval,
- adev->beacon_interval);
+ "tx_enabled %d, tx_level_dbm %d, tx_level_val %d,\n "
+ /* "tx_level_auto %d\n" */
+ "sensitivity %d, antenna[0,1] 0x%02X 0x%02X, ed_threshold %d, cca %d, preamble_mode %d\n"
+ "rate_basic 0x%04X, rate_oper 0x%04X\n"
+ "rts_threshold %d, frag_threshold %d, short_retry %d, long_retry %d\n"
+ "msdu_lifetime %d, listen_interval %d, beacon_interval %d\n",
+ adev->tx_enabled, adev->tx_level_dbm, adev->tx_level_val,
+ /* adev->tx_level_auto, */
+ adev->sensitivity, adev->antenna[0], adev->antenna[1],
+ adev->ed_threshold,
+ adev->cca, adev->preamble_mode, adev->rate_basic,
+ adev->rate_oper, adev->rts_threshold,
+ adev->frag_threshold, adev->short_retry, adev->long_retry,
+ adev->msdu_lifetime, adev->listen_interval,
+ adev->beacon_interval);

seq_printf(file,
- "\n"
- "** Firmware **\n"
- "NOTE: version dependent statistics layout, "
- "please report if you suspect wrong parsing!\n"
- "\n" "version \"%s\"\n", adev->firmware_version);
+ "\n"
+ "** Firmware **\n"
+ "NOTE: version dependent statistics layout, "
+ "please report if you suspect wrong parsing!\n"
+ "\n" "version \"%s\"\n", adev->firmware_version);

fw_stats = kzalloc(sizeof(*fw_stats), GFP_KERNEL);
if (!fw_stats) {
@@ -4232,8 +4213,9 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)

if (len > sizeof(*fw_stats)) {
seq_printf(file,
- "firmware version with bigger fw_stats struct detected\n"
- "(%zu vs. %zu), please report\n", len, sizeof(fw_stats_t));
+ "firmware version with bigger fw_stats struct detected\n"
+ "(%zu vs. %zu), please report\n", len,
+ sizeof(fw_stats_t));
if (len > sizeof(*fw_stats)) {
seq_printf(file, "struct size exceeded allocation!\n");
len = sizeof(*fw_stats);
@@ -4283,18 +4265,18 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
}

seq_printf(file,
- "%s:\n"
- " tx_desc_overfl %u\n"
- " rx_OutOfMem %u, rx_hdr_overfl %u, rx_hw_stuck %u\n"
- " rx_dropped_frame %u, rx_frame_ptr_err %u, rx_xfr_hint_trig %u\n"
- " rx_aci_events %u, rx_aci_resets %u\n",
- part_str,
- tx->tx_desc_of,
- rx->rx_oom,
- rx->rx_hdr_of,
- rx->rx_hw_stuck,
- rx->rx_dropped_frame,
- rx->rx_frame_ptr_err, rx->rx_xfr_hint_trig, temp1, temp2);
+ "%s:\n"
+ " tx_desc_overfl %u\n"
+ " rx_OutOfMem %u, rx_hdr_overfl %u, rx_hw_stuck %u\n"
+ " rx_dropped_frame %u, rx_frame_ptr_err %u, rx_xfr_hint_trig %u\n"
+ " rx_aci_events %u, rx_aci_resets %u\n",
+ part_str,
+ tx->tx_desc_of,
+ rx->rx_oom,
+ rx->rx_hdr_of,
+ rx->rx_hw_stuck,
+ rx->rx_dropped_frame,
+ rx->rx_frame_ptr_err, rx->rx_xfr_hint_trig, temp1, temp2);

part_str = "DMA";

@@ -4309,12 +4291,12 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
goto fw_stats_fail;

seq_printf(file,
- "%s:\n"
- " rx_dma_req %u, rx_dma_err %u, tx_dma_req %u, tx_dma_err %u\n",
- part_str,
- dma->rx_dma_req,
- dma->rx_dma_err, dma->tx_dma_req, dma->tx_dma_err);
-
+ "%s:\n"
+ " rx_dma_req %u, rx_dma_err %u, tx_dma_req %u, tx_dma_err %u\n",
+ part_str,
+ dma->rx_dma_req,
+ dma->rx_dma_err, dma->tx_dma_req, dma->tx_dma_err);
+
part_str = "IRQ";

if (st == st_end)
@@ -4328,30 +4310,30 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
goto fw_stats_fail;

seq_printf(file,
- "%s:\n"
- " cmd_cplt %u, fiq %u\n"
- " rx_hdrs %u, rx_cmplt %u, rx_mem_overfl %u, rx_rdys %u\n"
- " irqs %u, tx_procs %u, decrypt_done %u\n"
- " dma_0_done %u, dma_1_done %u, tx_exch_complet %u\n"
- " commands %u, rx_procs %u, hw_pm_mode_changes %u\n"
- " host_acks %u, pci_pm %u, acm_wakeups %u\n",
- part_str,
- irq->cmd_cplt,
- irq->fiq,
- irq->rx_hdrs,
- irq->rx_cmplt,
- irq->rx_mem_of,
- irq->rx_rdys,
- irq->irqs,
- irq->tx_procs,
- irq->decrypt_done,
- irq->dma_0_done,
- irq->dma_1_done,
- irq->tx_exch_complet,
- irq->commands,
- irq->rx_procs,
- irq->hw_pm_mode_changes,
- irq->host_acks, irq->pci_pm, irq->acm_wakeups);
+ "%s:\n"
+ " cmd_cplt %u, fiq %u\n"
+ " rx_hdrs %u, rx_cmplt %u, rx_mem_overfl %u, rx_rdys %u\n"
+ " irqs %u, tx_procs %u, decrypt_done %u\n"
+ " dma_0_done %u, dma_1_done %u, tx_exch_complet %u\n"
+ " commands %u, rx_procs %u, hw_pm_mode_changes %u\n"
+ " host_acks %u, pci_pm %u, acm_wakeups %u\n",
+ part_str,
+ irq->cmd_cplt,
+ irq->fiq,
+ irq->rx_hdrs,
+ irq->rx_cmplt,
+ irq->rx_mem_of,
+ irq->rx_rdys,
+ irq->irqs,
+ irq->tx_procs,
+ irq->decrypt_done,
+ irq->dma_0_done,
+ irq->dma_1_done,
+ irq->tx_exch_complet,
+ irq->commands,
+ irq->rx_procs,
+ irq->hw_pm_mode_changes,
+ irq->host_acks, irq->pci_pm, irq->acm_wakeups);

part_str = "WEP";

@@ -4378,17 +4360,17 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
}

seq_printf(file,
- "%s:\n"
- " wep_key_count %u, wep_default_key_count %u, dot11_def_key_mib %u\n"
- " wep_key_not_found %u, wep_decrypt_fail %u\n"
- " wep_pkt_decrypt %u, wep_decrypt_irqs %u\n",
- part_str,
- wep->wep_key_count,
- wep->wep_default_key_count,
- wep->dot11_def_key_mib,
- wep->wep_key_not_found,
- wep->wep_decrypt_fail, temp1, temp2);
-
+ "%s:\n"
+ " wep_key_count %u, wep_default_key_count %u, dot11_def_key_mib %u\n"
+ " wep_key_not_found %u, wep_decrypt_fail %u\n"
+ " wep_pkt_decrypt %u, wep_decrypt_irqs %u\n",
+ part_str,
+ wep->wep_key_count,
+ wep->wep_default_key_count,
+ wep->dot11_def_key_mib,
+ wep->wep_key_not_found,
+ wep->wep_decrypt_fail, temp1, temp2);
+
part_str = "power";

if (st == st_end)
@@ -4402,19 +4384,19 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
goto fw_stats_fail;

seq_printf(file,
- "%s:\n"
- " tx_start_ctr %u, no_ps_tx_too_short %u\n"
- " rx_start_ctr %u, no_ps_rx_too_short %u\n"
- " lppd_started %u\n"
- " no_lppd_too_noisy %u, no_lppd_too_short %u, no_lppd_matching_frame %u\n",
- part_str,
- pwr->tx_start_ctr,
- pwr->no_ps_tx_too_short,
- pwr->rx_start_ctr,
- pwr->no_ps_rx_too_short,
- pwr->lppd_started,
- pwr->no_lppd_too_noisy,
- pwr->no_lppd_too_short, pwr->no_lppd_matching_frame);
+ "%s:\n"
+ " tx_start_ctr %u, no_ps_tx_too_short %u\n"
+ " rx_start_ctr %u, no_ps_rx_too_short %u\n"
+ " lppd_started %u\n"
+ " no_lppd_too_noisy %u, no_lppd_too_short %u, no_lppd_matching_frame %u\n",
+ part_str,
+ pwr->tx_start_ctr,
+ pwr->no_ps_tx_too_short,
+ pwr->rx_start_ctr,
+ pwr->no_ps_rx_too_short,
+ pwr->lppd_started,
+ pwr->no_lppd_too_noisy,
+ pwr->no_lppd_too_short, pwr->no_lppd_matching_frame);

part_str = "MIC";

@@ -4429,12 +4411,12 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
goto fw_stats_fail;

seq_printf(file,
- "%s:\n"
- " mic_rx_pkts %u, mic_calc_fail %u\n",
- part_str, mic->mic_rx_pkts, mic->mic_calc_fail);
-
+ "%s:\n"
+ " mic_rx_pkts %u, mic_calc_fail %u\n",
+ part_str, mic->mic_rx_pkts, mic->mic_calc_fail);
+
part_str = "AES";
-
+
if (st == st_end)
goto fw_stats_end;

@@ -4446,15 +4428,15 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
goto fw_stats_fail;

seq_printf(file,
- "%s:\n"
- " aes_enc_fail %u, aes_dec_fail %u\n"
- " aes_enc_pkts %u, aes_dec_pkts %u\n"
- " aes_enc_irq %u, aes_dec_irq %u\n",
- part_str,
- aes->aes_enc_fail,
- aes->aes_dec_fail,
- aes->aes_enc_pkts,
- aes->aes_dec_pkts, aes->aes_enc_irq, aes->aes_dec_irq);
+ "%s:\n"
+ " aes_enc_fail %u, aes_dec_fail %u\n"
+ " aes_enc_pkts %u, aes_dec_pkts %u\n"
+ " aes_enc_irq %u, aes_dec_irq %u\n",
+ part_str,
+ aes->aes_enc_fail,
+ aes->aes_dec_fail,
+ aes->aes_enc_pkts,
+ aes->aes_dec_pkts, aes->aes_enc_irq, aes->aes_dec_irq);

part_str = "event";

@@ -4469,18 +4451,18 @@ static int acx_proc_show_diag(struct seq_file *file, void *v)
goto fw_stats_fail;

seq_printf(file,
- "%s:\n"
- " heartbeat %u, calibration %u\n"
- " rx_mismatch %u, rx_mem_empty %u, rx_pool %u\n"
- " oom_late %u\n"
- " phy_tx_err %u, tx_stuck %u\n",
- part_str,
- evt->heartbeat,
- evt->calibration,
- evt->rx_mismatch,
- evt->rx_mem_empty,
- evt->rx_pool,
- evt->oom_late, evt->phy_tx_err, evt->tx_stuck);
+ "%s:\n"
+ " heartbeat %u, calibration %u\n"
+ " rx_mismatch %u, rx_mem_empty %u, rx_pool %u\n"
+ " oom_late %u\n"
+ " phy_tx_err %u, tx_stuck %u\n",
+ part_str,
+ evt->heartbeat,
+ evt->calibration,
+ evt->rx_mismatch,
+ evt->rx_mem_empty,
+ evt->rx_pool,
+ evt->oom_late, evt->phy_tx_err, evt->tx_stuck);

if (st < st_end)
goto fw_stats_bigger;
@@ -4527,11 +4509,10 @@ static ssize_t acx_proc_write_diag(struct file *file, const char __user *buf,
val = (unsigned int) simple_strtoul(buf, &after, 0);
size = after - buf + 1;

- if (count == size) {
+ if (count == size)
ret = count;
- } else {
+ else
goto exit_unlock;
- }

logf1(L_ANY, "acx_diag: 0x%04x\n", val);

@@ -4545,34 +4526,30 @@ static ssize_t acx_proc_write_diag(struct file *file, const char __user *buf,
if (val & ACX_DIAG_OP_PROCESS_TX_RX) {
logf0(L_ANY, "ACX_DIAG_OP_PROCESS_TX_RX: Scheduling immediate Rx, Tx processing\n");

- if (IS_PCI(adev)) {
+ if (IS_PCI(adev))
SET_BIT(adev->irq_reason, HOST_INT_RX_COMPLETE);
- }
- if (IS_MEM(adev)) {
+ else if (IS_MEM(adev))
SET_BIT(adev->irq_reason, HOST_INT_RX_DATA);
- }
+
SET_BIT(adev->irq_reason, HOST_INT_TX_COMPLETE);
acx_schedule_task(adev, 0);
} else
// Execute operation
if (val & ACX_DIAG_OP_REINIT_TX_BUF) {
- if (IS_MEM(adev)){
+ if (IS_MEM(adev)) {
logf0(L_ANY, "ACX_DIAG_OP_REINIT_TX_BUF\n");
acxmem_init_acx_txbuf2(adev);
- } else{
+ } else
logf0(L_ANY, "ACX_DIAG_OP_REINIT_TX_BUF: Only valid for mem device\n");
- }
}
// Unknown
- else {
+ else
logf1(L_ANY, "Unknown command: 0x%04x\n", val);
- }

- exit_unlock:
+exit_unlock:
acx_sem_unlock(adev);
FN_EXIT0;
return ret;
-
}

/*
@@ -4594,22 +4571,22 @@ static int acx_proc_show_acx(struct seq_file *file, void *v)
acx_sem_lock(adev);

seq_printf(file,
- "acx driver version:\t\t%s (git: %s)\n"
- "Wireless extension version:\t%s\n"
- "chip name:\t\t\t%s (0x%08X)\n"
- "radio type:\t\t\t0x%02X\n"
- "form factor:\t\t\t0x%02X\n"
+ "acx driver version:\t\t%s (git: %s)\n"
+ "Wireless extension version:\t%s\n"
+ "chip name:\t\t\t%s (0x%08X)\n"
+ "radio type:\t\t\t0x%02X\n"
+ "form factor:\t\t\t0x%02X\n"
"EEPROM version:\t\t\t0x%02X\n"
- "firmware version:\t\t%s (0x%08X)\n",
- ACX_RELEASE,
- strlen(ACX_GIT_VERSION) ? ACX_GIT_VERSION : "unknown",
- STRING(WIRELESS_EXT),
- adev->chip_name, adev->firmware_id,
- adev->radio_type,
- adev->form_factor,
- adev->eeprom_version,
- adev->firmware_version, adev->firmware_numver);
-
+ "firmware version:\t\t%s (0x%08X)\n",
+ ACX_RELEASE,
+ strlen(ACX_GIT_VERSION) ? ACX_GIT_VERSION : "unknown",
+ STRING(WIRELESS_EXT),
+ adev->chip_name, adev->firmware_id,
+ adev->radio_type,
+ adev->form_factor,
+ adev->eeprom_version,
+ adev->firmware_version, adev->firmware_numver);
+
acx_sem_unlock(adev);
FN_EXIT0;
return 0;
@@ -4687,7 +4664,6 @@ static int acx_proc_show_debug(struct seq_file *file, void *v)
seq_printf(file, "acx_debug: 0x%04x\n", acx_debug);

FN_EXIT0;
-
return 0;
}

@@ -4711,7 +4687,6 @@ static ssize_t acx_proc_write_debug(struct file *file, const char __user *buf,

FN_EXIT0;
return ret;
-
}

static int acx_proc_show_sensitivity(struct seq_file *file, void *v)
@@ -4726,13 +4701,13 @@ static int acx_proc_show_sensitivity(struct seq_file *file, void *v)

acx_sem_unlock(adev);
FN_EXIT0;
-
return 0;
}

-static ssize_t
-acx_proc_write_sensitivity(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t acx_proc_write_sensitivity(struct file *file,
+ const char __user *buf,
+ size_t count, loff_t *ppos)
+
{
acx_device_t *adev = (acx_device_t *)
PDE(file->f_path.dentry->d_inode)->data;
@@ -4759,11 +4734,9 @@ acx_proc_write_sensitivity(struct file *file, const char __user *buf,
out:
acx_sem_unlock(adev);
FN_EXIT0;
-
return ret;
}

-
static int acx_proc_show_tx_level(struct seq_file *file, void *v)
{
acx_device_t *adev = (acx_device_t *) file->private;
@@ -4776,13 +4749,12 @@ static int acx_proc_show_tx_level(struct seq_file *file, void *v)

acx_sem_unlock(adev);
FN_EXIT0;
-
return 0;
}

-static ssize_t
-acx111_proc_write_tx_level(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t acx111_proc_write_tx_level(struct file *file,
+ const char __user *buf,
+ size_t count, loff_t *ppos)
{
acx_device_t *adev = (acx_device_t *)
PDE(file->f_path.dentry->d_inode)->data;
@@ -4809,7 +4781,6 @@ acx111_proc_write_tx_level(struct file *file, const char __user *buf,
out:
acx_sem_unlock(adev);
FN_EXIT0;
-
return ret;
}

@@ -4824,14 +4795,13 @@ static int acx_proc_show_reg_domain(struct seq_file *file, void *v)
seq_printf(file, "reg_dom_id: 0x%02x\n", adev->reg_dom_id);

acx_sem_unlock(adev);
-
FN_EXIT0;
return 0;
}

-static ssize_t
-acx_proc_write_reg_domain(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t acx_proc_write_reg_domain(struct file *file,
+ const char __user *buf,
+ size_t count, loff_t *ppos)
{
acx_device_t *adev = (acx_device_t *)
PDE(file->f_path.dentry->d_inode)->data;
@@ -4856,7 +4826,6 @@ acx_proc_write_reg_domain(struct file *file, const char __user *buf,

out:
acx_sem_unlock(adev);
-
FN_EXIT0;
return ret;
}
@@ -4874,14 +4843,13 @@ static int acx_proc_show_antenna(struct seq_file *file, void *v)
adev->antenna[0], adev->antenna[1]);

acx_sem_unlock(adev);
-
FN_EXIT0;
return 0;
}

-static ssize_t
-acx_proc_write_antenna(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t acx_proc_write_antenna(struct file *file,
+ const char __user *buf,
+ size_t count, loff_t *ppos)
{
acx_device_t *adev = (acx_device_t *)
PDE(file->f_path.dentry->d_inode)->data;
@@ -4909,9 +4877,7 @@ acx_proc_write_antenna(struct file *file, const char __user *buf,

out:
acx_sem_unlock(adev);
-
FN_EXIT0;
-
return ret;
}

@@ -4929,8 +4895,8 @@ static int acx_proc_open(struct inode *inode, struct file *file)
return single_open(file, acx_proc_show_funcs[i], PDE(inode)->data);
}

-static void acx_proc_init(void) {
-
+static void acx_proc_init(void)
+{
int i;

// acx_e_proc_ops init
@@ -4944,7 +4910,8 @@ static void acx_proc_init(void) {
}
}

-int acx_proc_register_entries(struct ieee80211_hw *hw) {
+int acx_proc_register_entries(struct ieee80211_hw *hw)
+{
acx_device_t *adev = ieee2adev(hw);
char procbuf[80];
char procbuf2[80];
@@ -4986,9 +4953,7 @@ int acx_proc_register_entries(struct ieee80211_hw *hw) {
return NOT_OK;
}
pe->data = adev;
-
}
-
FN_EXIT0;
return OK;
}
@@ -5031,7 +4996,7 @@ int acx_proc_unregister_entries(struct ieee80211_hw *hw)
*
* NB: used by USB code also
*/
-void acx_process_rxbuf(acx_device_t * adev, rxbuffer_t * rxbuf)
+void acx_process_rxbuf(acx_device_t *adev, rxbuffer_t *rxbuf)
{
struct ieee80211_hdr *hdr;
u16 fc, buf_len;
@@ -5069,12 +5034,11 @@ void acx_process_rxbuf(acx_device_t * adev, rxbuffer_t * rxbuf)

acx_rx(adev, rxbuf);

- /* Now check Rx quality level, AFTER processing packet.
- * I tried to figure out how to map these levels to dBm
- * values, but for the life of me I really didn't
- * manage to get it. Either these values are not meant to
- * be expressed in dBm, or it's some pretty complicated
- * calculation. */
+ /* Now check Rx quality level, AFTER processing packet. I
+ * tried to figure out how to map these levels to dBm values,
+ * but for the life of me I really didn't manage to get
+ * it. Either these values are not meant to be expressed in
+ * dBm, or it's some pretty complicated calculation. */

// FIXME OW 20100619 Is this still required. Only for adev local use.
// Mac80211 signal level is reported in acx_l_rx for each skb.
@@ -5092,7 +5056,6 @@ void acx_process_rxbuf(acx_device_t * adev, rxbuffer_t * rxbuf)
*/
static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf)
{
-
struct ieee80211_rx_status *status;

struct ieee80211_hdr *w_hdr;
@@ -5110,9 +5073,7 @@ static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf)
w_hdr = acx_get_wlan_hdr(adev, rxbuf);
buflen = RXBUF_BYTES_USED(rxbuf) - ((u8*)w_hdr - (u8*)rxbuf);

- /*
- * Allocate our skb
- */
+ /* Allocate our skb */
skb = dev_alloc_skb(buflen + 2);
if (!skb) {
pr_info("skb allocation FAILED\n");
@@ -5146,14 +5107,12 @@ static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf)
// this didn't made a difference. Maybe compare what other drivers do.
// TODO Verify translation to rate_idx.
#if 0
- if (rxbuf->phy_stat_baseband & (1 << 3)) { /* Uses OFDM */
+ if (rxbuf->phy_stat_baseband & (1 << 3)) /* Uses OFDM */
status->rate_idx =
acx_plcp_get_bitrate_ofdm(rxbuf->phy_plcp_signal);
- }
- else {
+ else
status->rate_idx =
acx_plcp_get_bitrate_cck(rxbuf->phy_plcp_signal);
- }
#endif

if (IS_PCI(adev)) {
@@ -5173,7 +5132,6 @@ static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf)

adev->stats.rx_packets++;
adev->stats.rx_bytes += skb->len;
-
out:
FN_EXIT0;
}
@@ -5183,11 +5141,16 @@ out:
* ==================================================
*/

+/* TODO: consider defining OP_TX_RET_TYPE, OP_TX_RET_VAL in
+ * acx_compat, and hiding this #if/else. OTOH, inclusion doesnt care
+ * about old kernels
+ */
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39)
-int acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
+int
#else
-void acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
+void
#endif
+acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
{
acx_device_t *adev = ieee2adev(hw);

@@ -5205,8 +5168,8 @@ void acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
#endif
}

-void acx_tx_work(struct work_struct *work) {
-
+void acx_tx_work(struct work_struct *work)
+{
acx_device_t *adev = container_of(work, struct acx_device, tx_work);

FN_ENTER;
@@ -5223,16 +5186,14 @@ void acx_tx_work(struct work_struct *work) {
goto out;

acx_tx_queue_go(adev);
-
out:
acx_sem_unlock(adev);
-
FN_EXIT0;
return;
}

-void acx_tx_queue_go(acx_device_t *adev) {
-
+void acx_tx_queue_go(acx_device_t *adev)
+{
struct sk_buff *skb;
int ret;

@@ -5267,8 +5228,8 @@ out:
return;
}

-int acx_tx_frame(acx_device_t *adev, struct sk_buff *skb) {
-
+int acx_tx_frame(acx_device_t *adev, struct sk_buff *skb)
+{
tx_t *tx;
void *txbuf;
struct ieee80211_tx_info *ctl;
@@ -5306,7 +5267,8 @@ int acx_tx_frame(acx_device_t *adev, struct sk_buff *skb) {
return 0;
}

-void acx_tx_queue_flush(acx_device_t *adev) {
+void acx_tx_queue_flush(acx_device_t *adev)
+{
struct sk_buff *skb;
struct ieee80211_tx_info *info;

@@ -5346,8 +5308,8 @@ void acx_wake_queue(struct ieee80211_hw *hw, const char *msg)
}

/*
- * OW Included skb->len to check required blocks upfront in acx_l_alloc_tx
- * This should perhaps also go into pci and usb ?
+ * OW Included skb->len to check required blocks upfront in
+ * acx_l_alloc_tx This should perhaps also go into pci and usb ?
*/
tx_t* acx_alloc_tx(acx_device_t *adev, unsigned int len)
{
@@ -5387,8 +5349,7 @@ static void* acx_get_txbuf(acx_device_t *adev, tx_t *tx_opaque)
return (NULL);
}

-static void
-acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,
+static void acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,
struct ieee80211_tx_info *ieeectl, struct sk_buff *skb)
{
if (IS_PCI(adev))
@@ -5606,17 +5567,18 @@ void acxpcimem_handle_tx_error(acx_device_t *adev, u8 error,
* auto (0x00ff == 18Mbit or any lower value),
* and code handles any bitmask (0x1081 == try 54Mbit,18Mbit,1Mbit _only_).
*
- * client->rate_cur is a value for rate111 field in tx descriptor.
- * It is always set to txrate_cfg sans zero or more most significant
- * bits. This routine handles selection of new rate_cur value depending on
- * outcome of last tx event.
+ * client->rate_cur is a value for rate111 field in tx descriptor. It
+ * is always set to txrate_cfg sans zero or more most significant
+ * bits. This routine handles selection of new rate_cur value
+ * depending on outcome of last tx event.
*
- * client->rate_100 is a precalculated rate value for acx100
- * (we can do without it, but will need to calculate it on each tx).
+ * client->rate_100 is a precalculated rate value for acx100 (we can
+ * do without it, but will need to calculate it on each tx).
*
- * You cannot configure mixed usage of 5.5 and/or 11Mbit rate
- * with PBCC and CCK modulation. Either both at CCK or both at PBCC.
- * In theory you can implement it, but so far it is considered not worth doing.
+ * You cannot configure mixed usage of 5.5 and/or 11Mbit rate with
+ * PBCC and CCK modulation. Either both at CCK or both at PBCC. In
+ * theory you can implement it, but so far it is considered not worth
+ * doing.
*
* 22Mbit, of course, is PBCC always.
*/
@@ -5652,7 +5614,7 @@ static u16 rate100to111(u8 r)
* ==================================================
*/
#ifdef UNUSED
-static void acx100_set_wepkey(acx_device_t * adev)
+static void acx100_set_wepkey(acx_device_t *adev)
{
ie_dot11WEPDefaultKey_t dk;
int i;
@@ -5712,8 +5674,8 @@ static void acx_set_wepkey(acx_device_t * adev)
* acx100_s_init_wep
*
* FIXME: this should probably be moved into the new card settings
- * management, but since we're also modifying the memory map layout here
- * due to the WEP key space we want, we should take care...
+ * management, but since we're also modifying the memory map layout
+ * here due to the WEP key space we want, we should take care...
*/
static int acx100_init_wep(acx_device_t * adev)
{
@@ -5738,12 +5700,13 @@ static int acx100_init_wep(acx_device_t * adev)
/* OW: This disables WEP by not configuring the WEP cache and leaving
* WEPCacheStart=WEPCacheEnd.
*
- * When doing the crypto by mac80211 it is required, that the acx is not doing
- * any WEP crypto himself. Otherwise TX "WEP key not found" errors occure.
+ * When doing the crypto by mac80211 it is required, that the acx is
+ * not doing any WEP crypto himself. Otherwise TX "WEP key not found"
+ * errors occure.
*
- * By disabling WEP using WEPCacheStart=WEPCacheStart the acx not trying any
- * own crypto anymore. All crypto (including WEP) is pushed to mac80211 for the
- * moment.
+ * By disabling WEP using WEPCacheStart=WEPCacheStart the acx not
+ * trying any own crypto anymore. All crypto (including WEP) is pushed
+ * to mac80211 for the moment.
*
*/
#if 0
@@ -5806,7 +5769,7 @@ fail:

// OW, 20100704, Obselete, TBC for cleanup
#if 0
-static void acx_keymac_write(acx_device_t * adev, u16 index, const u32 * addr)
+static void acx_keymac_write(acx_device_t *adev, u16 index, const u32 *addr)
{
/* for keys 0-3 there is no associated mac address */
if (index < 4)
@@ -5835,7 +5798,7 @@ static void acx_keymac_write(acx_device_t * adev, u16 index, const u32 * addr)
}
}

-int acx_clear_keys(acx_device_t * adev)
+int acx_clear_keys(acx_device_t *adev)
{
static const u32 zero_mac[2] = { 0 };
unsigned int i, j, nr_keys = 54;
@@ -5974,8 +5937,6 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm,

FN_EXIT1(result);
return result;
-
-
}
#endif

@@ -5983,8 +5944,8 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm,
* BOM Irq Handling, Timer
* ==================================================
*/
-void acx_init_task_scheduler(acx_device_t *adev) {
-
+void acx_init_task_scheduler(acx_device_t *adev)
+{
/* configure task scheduler */
#if defined(CONFIG_ACX_MAC80211_PCI)
if (IS_PCI(adev)) {
@@ -6034,7 +5995,7 @@ void acx_after_interrupt_task(acx_device_t *adev)
}

/* 1) we detected that no Scan_Complete IRQ came from fw, or
- ** 2) we found too many STAs */
+ * 2) we found too many STAs */
if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_CMD_STOP_SCAN) {
log(L_IRQ, "sending a stop scan cmd...\n");

@@ -6043,8 +6004,8 @@ void acx_after_interrupt_task(acx_device_t *adev)
acx_unlock(adev, flags);
acx_issue_cmd(adev, ACX1xx_CMD_STOP_SCAN, NULL, 0);
acx_lock(adev, flags);
- /* HACK: set the IRQ bit, since we won't get a
- * scan complete IRQ any more on ACX111 (works on ACX100!),
+ /* HACK: set the IRQ bit, since we won't get a scan
+ * complete IRQ any more on ACX111 (works on ACX100!),
* since _we_, not a fw, have stopped the scan */
SET_BIT(adev->irq_status, HOST_INT_SCAN_COMPLETE);
#endif
@@ -6052,17 +6013,17 @@ void acx_after_interrupt_task(acx_device_t *adev)
ACX_AFTER_IRQ_CMD_STOP_SCAN);
}

- /* either fw sent Scan_Complete or we detected that
- ** no Scan_Complete IRQ came from fw. Finish scanning,
- ** pick join partner if any */
+ /* either fw sent Scan_Complete or we detected that no
+ * Scan_Complete IRQ came from fw. Finish scanning, pick join
+ * partner if any */
if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_COMPLETE_SCAN) {
/* + scan kills current join status - restore it
- ** (do we need it for STA?) */
+ * (do we need it for STA?) */
/* + does it happen only with active scans?
- ** active and passive scans? ALL scans including
- ** background one? */
+ * active and passive scans? ALL scans including
+ * background one? */
/* + was not verified that everything is restored
- ** (but at least we start to emit beacons again) */
+ * (but at least we start to emit beacons again) */
CLEAR_BIT(adev->after_interrupt_jobs,
ACX_AFTER_IRQ_COMPLETE_SCAN);
}
@@ -6076,7 +6037,8 @@ void acx_after_interrupt_task(acx_device_t *adev)
if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_UPDATE_TIM) {
log(L_IRQ, "ACX_AFTER_IRQ_UPDATE_TIM\n");
acx_do_job_update_tim(adev);
- CLEAR_BIT(adev->after_interrupt_jobs, ACX_AFTER_IRQ_UPDATE_TIM);
+ CLEAR_BIT(adev->after_interrupt_jobs,
+ ACX_AFTER_IRQ_UPDATE_TIM);
}

/* others */
@@ -6086,9 +6048,7 @@ void acx_after_interrupt_task(acx_device_t *adev)
__func__, adev->after_interrupt_jobs);
adev->after_interrupt_jobs = 0;
}
-
- end_no_lock:
-
+end_no_lock:
FN_EXIT0;
}

@@ -6147,14 +6107,14 @@ void acx_log_irq(u16 irqtype)
pr_info(": IRQ(s)\n");
}

-
/*
* acx_schedule_task
*
* Schedule the call of the after_interrupt method after leaving
* the interrupt context.
*/
-void acx_schedule_task(acx_device_t *adev, unsigned int set_flag) {
+void acx_schedule_task(acx_device_t *adev, unsigned int set_flag)
+{
SET_BIT(adev->after_interrupt_jobs, set_flag);
ieee80211_queue_work(adev->ieee, &adev->irq_work);
}
@@ -6180,7 +6140,7 @@ void acx_timer(unsigned long address)
* Sets the 802.11 state management timer's timeout.
*
*/
-void acx_set_timer(acx_device_t * adev, int timeout_us)
+void acx_set_timer(acx_device_t *adev, int timeout_us)
{
FN_ENTER;

@@ -6247,7 +6207,6 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,
mac_vif = vif->addr;
#endif

-
switch (adev->vif_type) {
case NL80211_IFTYPE_AP:
logf0(L_ANY, "NL80211_IFTYPE_AP\n");
@@ -6300,7 +6259,6 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,

out_unlock:
acx_sem_unlock(adev);
-
FN_EXIT0;
return err;
}
@@ -6351,7 +6309,6 @@ void acx_op_remove_interface(struct ieee80211_hw *hw,
);

acx_sem_unlock(adev);
-
FN_EXIT0;
}

@@ -6359,7 +6316,8 @@ void acx_op_remove_interface(struct ieee80211_hw *hw,
// The function_grep script can get confused with multiple "{"" opening braces
// due e.g. due to #ifdefs. This tag reset the parser state of the script.

-int acx_op_config(struct ieee80211_hw *hw, u32 changed) {
+int acx_op_config(struct ieee80211_hw *hw, u32 changed)
+{
acx_device_t *adev = ieee2adev(hw);
struct ieee80211_conf *conf = &hw->conf;

@@ -6401,13 +6359,12 @@ change_channel_done:
end_sem_unlock:
acx_sem_unlock(adev);
FN_EXIT0;
-
return 0;
}

// Find position of TIM IE
-static u8* acx_beacon_find_tim(struct sk_buff *beacon_skb) {
-
+static u8* acx_beacon_find_tim(struct sk_buff *beacon_skb)
+{
u8 *p1, *p2, *tim;
int len1;

@@ -6436,8 +6393,7 @@ static u8* acx_beacon_find_tim(struct sk_buff *beacon_skb) {
return tim;
}

-void
-acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+void acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info, u32 changed)
{
acx_device_t *adev = ieee2adev(hw);
@@ -6479,14 +6435,13 @@ acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
end_sem_unlock:
acx_sem_unlock(adev);
FN_EXIT1(err);
-
return;
}

int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
- struct ieee80211_key_conf *key) {
-
+ struct ieee80211_key_conf *key)
+{
struct acx_device *adev = ieee2adev(hw);
// unsigned long flags;
u8 algorithm;
@@ -6615,14 +6570,10 @@ int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
acx_update_card_settings(adev);
//acx_schedule_task(adev, ACX_AFTER_IRQ_UPDATE_CARD_CFG);
}
-
- out:
-
+out:
FN_EXIT0;
-
return err;
#endif
-
}

void acx_op_configure_filter(struct ieee80211_hw *hw,
@@ -6645,9 +6596,9 @@ void acx_op_configure_filter(struct ieee80211_hw *hw,
logf1(L_DEBUG, "2: *total_flags=0x%08x\n", *total_flags);

acx_sem_unlock(adev);
-
FN_EXIT0;
}
+
#if CONFIG_ACX_MAC80211_VERSION >= KERNEL_VERSION(3, 2, 0)
int acx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u16 queue, const struct ieee80211_tx_queue_params *params)
@@ -6707,7 +6658,6 @@ static int acx_do_job_update_tim(acx_device_t *adev)
tim_offset = acx_beacon_find_tim(beacon) - beacon->data;
out:
#endif
-
if (!beacon) {
logf0(L_ANY, "Error: beacon==NULL");
return NOT_OK;
@@ -6723,7 +6673,6 @@ out:
return (ret);
}

-
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
int acx_e_op_get_tx_stats(struct ieee80211_hw *hw,
struct ieee80211_tx_queue_stats *stats)
@@ -6744,7 +6693,6 @@ int acx_e_op_get_tx_stats(struct ieee80211_hw *hw,
}
#endif

-
/*
* BOM Helpers
* ==================================================
@@ -6760,7 +6708,6 @@ void acx_mwait(int ms)
FN_EXIT0;
}

-static u8 acx_signal_to_winlevel(u8 rawlevel);
/*
* Calculate level like the feb 2003 windows driver seems to do
*
@@ -6977,6 +6924,7 @@ static int acx_debug_flag_get(char *buf, const struct kernel_param *kp)
}
return p - buf;
}
+
static int acx_debug_flag_set(const char *val, const struct kernel_param *kp)
{
TODO();
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:50 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
pci.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/pci.h b/pci.h
index 50a6ae6..31e4fb0 100644
--- a/pci.h
+++ b/pci.h
@@ -1,3 +1,5 @@
+#ifndef _PCI_H_
+#define _PCI_H_

/* This file provides prototypes for functions defined in pci.c which
* are used by common.c etc. It also forward declares functions
@@ -58,3 +60,5 @@ void acxpci_reset_mac(acx_device_t *adev);
u32 acxpci_read_cmd_type_status(acx_device_t *adev);
void acxpci_write_cmd_type_status(acx_device_t *adev, u16 type,
u16 status);
+
+#endif /* _PCI_H_ */
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:51 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
pci.h | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/pci.h b/pci.h
index 31e4fb0..4262285 100644
--- a/pci.h
+++ b/pci.h
@@ -21,7 +21,6 @@ int acxpci_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
u32 offset);
int acxpci_validate_fw(acx_device_t *adev, const firmware_image_t *fw_image,
u32 offset);
-int acxpci_upload_fw(acx_device_t *adev);

/* CMDs (Control Path) */
int acxpci_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
@@ -32,7 +31,6 @@ void acxpci_init_mboxes(acx_device_t *adev);

/* Init, Configuration (Control Path) */
int acxpci_reset_dev(acx_device_t *adev);
-void acxpci_reset_mac(acx_device_t *adev);

/* Other (Control Path) */

@@ -56,9 +54,22 @@ void acxpci_power_led(acx_device_t *adev, int enable);
int __init acxpci_init_module(void);
void __exit acxpci_cleanup_module(void);

-void acxpci_reset_mac(acx_device_t *adev);
u32 acxpci_read_cmd_type_status(acx_device_t *adev);
void acxpci_write_cmd_type_status(acx_device_t *adev, u16 type,
u16 status);

+#if defined(CONFIG_ACX_MAC80211_PCI)
+
+void acxpci_reset_mac(acx_device_t *adev);
+int acxpci_upload_fw(acx_device_t *adev);
+
+#else /* !CONFIG_ACX_MAC80211_PCI */
+
+static inline void acxpci_reset_mac(acx_device_t *adev)
+{}
+
+static inline int acxpci_upload_fw(acx_device_t *adev)
+{ return 0; }
+
+#endif /* CONFIG_ACX_MAC80211_PCI */
#endif /* _PCI_H_ */
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:43 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
common.c | 234 +++++++++++++++++++++++++++++++++------------------------------
mem.c | 115 ++++++++++++++++---------------
merge.c | 180 +++++++++++++++++++++++++-----------------------
pci.c | 126 ++++++++++++++++++----------------
4 files changed, 343 insertions(+), 312 deletions(-)

diff --git a/common.c b/common.c
index 198be87..db14e23 100644
--- a/common.c
+++ b/common.c
@@ -54,7 +54,7 @@
* ==================================================
*/

-// Locking
+/* Locking */
#ifdef OW_20100613_OBSELETE_ACXLOCK_REMOVE
void acx_lock_unhold(void);
void acx_sem_unhold(void);
@@ -63,7 +63,7 @@ void acx_unlock_debug(acx_device_t * adev, const char *where);
static inline const char *acx_sanitize_str(const char *s);
#endif

-// Logging
+/* Logging */
void log_fn_enter(const char *funcname);
void log_fn_exit(const char *funcname);
void log_fn_exit_v(const char *funcname, int v);
@@ -73,12 +73,12 @@ void acxlog_mac(int level, const char *head, const u8 *mac, const char *tail);
void acx_dump_bytes(const void *data, int num);
const char *acx_cmd_status_str(unsigned int state);

-// Data Access
+/* Data Access */
static int acx100_init_memory_pools(acx_device_t * adev, const acx_ie_memmap_t * mmt);
static int acx100_create_dma_regions(acx_device_t * adev);
static int acx111_create_dma_regions(acx_device_t * adev);

-// Firmware, EEPROM, Phy
+/* Firmware, EEPROM, Phy */
MODULE_FIRMWARE("tiacx111");
MODULE_FIRMWARE("tiacx111c16");
MODULE_FIRMWARE("tiacx111r16");
@@ -90,7 +90,7 @@ void acx_parse_configoption(acx_device_t * adev, const acx111_ie_configoption_t
int acx_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
int acx_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);

-// CMDs (Control Path)
+/* CMDs (Control Path) */
int acx_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr);
int acx_configure_debug(acx_device_t *adev, void *pdr, int type, const char *typestr);
static int acx111_get_feature_config(acx_device_t * adev, u32 * feature_options, u32 * data_flow_options);
@@ -102,7 +102,7 @@ int acx_interrogate_debug(acx_device_t * adev, void *pdr, int type, const char *
static inline unsigned int acx_rate111to5bits(unsigned int rate);
int acx_cmd_join_bssid(acx_device_t *adev, const u8 *bssid);

-// Configuration (Control Path)
+/* Configuration (Control Path) */
void acx_set_defaults(acx_device_t * adev);
void acx_update_card_settings(acx_device_t *adev);
void acx_start(acx_device_t * adev);
@@ -181,7 +181,7 @@ static int acx_update_wep_options(acx_device_t *adev);
static int acx100_update_wep_options(acx_device_t *adev);
#endif

-// Templates
+/* Templates */
static int acx_set_beacon(acx_device_t *adev, struct sk_buff *beacon);
static int acx_set_beacon_template(acx_device_t *adev, u8 *data, int len);
static int acx_set_tim_template(acx_device_t *adev, u8 *data, int len);
@@ -206,13 +206,13 @@ static int acx_s_set_tim_template_off(acx_device_t *adev);
static int acx_s_set_null_data_template(acx_device_t * adev);
#endif

-// Recalibration (Control Path)
+/* Recalibration (Control Path) */
static int acx111_set_recalib_auto(acx_device_t *adev, int enable);
static int acx111_update_recalib_auto(acx_device_t *adev);
static int acx_recalib_radio(acx_device_t *adev);
static void acx_after_interrupt_recalib(acx_device_t * adev);

-// Other (Control Path)
+/* Other (Control Path) */
#if 0
static u8 acx_plcp_get_bitrate_cck(u8 plcp);
static u8 acx_plcp_get_bitrate_ofdm(u8 plcp);
@@ -225,7 +225,7 @@ static void acx_update_ratevector(acx_device_t * adev);
static void acx_s_update_80211_powersave_mode(acx_device_t * adev)
#endif

-// Proc, Debug
+/* Proc, Debug */
#ifdef CONFIG_PROC_FS
static int acx_proc_show_diag(struct seq_file *file, void *v);
static ssize_t acx_proc_write_diag(struct file *file, const char __user *buf, size_t count, loff_t *ppos);
@@ -248,11 +248,11 @@ int acx_proc_register_entries(struct ieee80211_hw *ieee);
int acx_proc_unregister_entries(struct ieee80211_hw *ieee);
#endif

-// Rx Path
+/* Rx Path */
void acx_process_rxbuf(acx_device_t * adev, rxbuffer_t * rxbuf);
static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf);

-// Tx Path
+/* Tx Path */
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 39)
int acx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
#else
@@ -272,11 +272,11 @@ static void *acx_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
static void acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);
void acxpcimem_handle_tx_error(acx_device_t *adev, u8 error, unsigned int finger, struct ieee80211_tx_info *info);
u16 acx111_tx_build_rateset(acx_device_t *adev, txdesc_t *txdesc, struct ieee80211_tx_info *info);
-void acx111_tx_build_txstatus(acx_device_t *adev, struct ieee80211_tx_info *txstatus, u16 r111, u8 ack_failures);
+void acx111_tx_build_txstatus(acx_device_t *adev, struct ieee80211_tx_info *txstatus, u16 r111, u8 ack_failures);
u16 acx_rate111_hwvalue_to_bitrate(u16 hw_value);
int acx_rate111_hwvalue_to_rateindex(u16 hw_value);

-// Crypto
+/* Crypto */
#ifdef UNUSED
static void acx100_set_wepkey(acx_device_t * adev);
static void acx111_set_wepkey(acx_device_t * adev);
@@ -284,14 +284,14 @@ static void acx_set_wepkey(acx_device_t * adev);
#endif
static int acx100_init_wep(acx_device_t * adev);

-// // OW, 20100704, Obselete, TBC for cleanup
+/* OW, 20100704, Obselete, TBC for cleanup */
#if 0
static void acx_keymac_write(acx_device_t * adev, u16 index, const u32 * addr);
int acx_clear_keys(acx_device_t * adev);
int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm, const struct ieee80211_key_conf *key, const u8 *mac_addr);
#endif

-// Irq Handling, Timer
+/* Irq Handling, Timer */
void acx_init_task_scheduler(acx_device_t *adev);
void acx_after_interrupt_task(acx_device_t *adev);
void acx_schedule_task(acx_device_t *adev, unsigned int set_flag);
@@ -299,7 +299,7 @@ void acx_log_irq(u16 irqtype);
void acx_timer(unsigned long address);
void acx_set_timer(acx_device_t * adev, int timeout_us);

-// Mac80211 Ops
+/* Mac80211 Ops */
int acx_op_config(struct ieee80211_hw *hw, u32 changed);
void acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u32 changed);
int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_key_conf *key);
@@ -320,15 +320,15 @@ int acx_e_op_get_tx_stats(struct ieee80211_hw *hw, struct ieee80211_tx_queue_sta
int acx_op_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set);
static int acx_do_job_update_tim(acx_device_t *adev);

-// Helpers
+/* Helpers */
void acx_mwait(int ms);
static u8 acx_signal_to_winlevel(u8 rawlevel);
static u8 acx_signal_to_winlevel(u8 rawlevel);
u8 acx_signal_determine_quality(u8 signal, u8 noise);
const char *acx_get_packet_type_string(u16 fc);
-//void great_inquisitor(acx_device_t * adev);
+/* void great_inquisitor(acx_device_t * adev); */

-// Driver, Module
+/* Driver, Module */
static int __init acx_init_module(void);
static void __exit acx_cleanup_module(void);

@@ -349,7 +349,7 @@ static void __exit acx_cleanup_module(void);
/* minutes to wait until next radio recalibration: */
#define RECALIB_PAUSE 5

-// Maximum tx_power assumed from ieee80211_ops->config / IEEE80211_CONF_CHANGE_POWER
+/* Maximum tx_power assumed from ieee80211_ops->config / IEEE80211_CONF_CHANGE_POWER */
#define TX_CFG_MAX_DBM_POWER 20

/* Please keep acx_reg_domain_ids_len in sync... */
@@ -358,7 +358,7 @@ const u8 acx_reg_domain_ids[acx_reg_domain_ids_len] =
static const u16 reg_domain_channel_masks[acx_reg_domain_ids_len] =
{ 0x07ff, 0x07ff, 0x1fff, 0x0600, 0x1e00, 0x2000, 0x3fff, 0x01fc };

-// in crda ??
+/* in crda ?? */
const char *const
acx_reg_domain_strings[] = {
[0] = " 1-11 FCC (USA)",
@@ -530,10 +530,11 @@ static const u16 acx111_ie_len_dot11[] = {
BUILD_BUG_DECL(acx111_ie_len_dot11__VS__acx100_ie_len_dot11,
ARRAY_SIZE(acx111_ie_len_dot11) != ARRAY_SIZE(acx100_ie_len_dot11));

-// BOM Rate and channel definition
-// ---
+/* BOM Rate and channel definition
+ * ---
+ */

-// We define rates without short-preamble support fo now
+/* We define rates without short-preamble support fo now */

static struct ieee80211_rate acx100_rates[] = {
{ .bitrate = 10, .hw_value = RATE100_1, },
@@ -670,7 +671,7 @@ u16 acx_rate111_hwvalue_to_bitrate(u16 hw_value)
return (bitrate);
}

-// Proc
+/* Proc */
#ifdef CONFIG_PROC_FS

static const char *const proc_files[] = {
@@ -713,7 +714,7 @@ BUILD_BUG_DECL(SHOW, ARRAY_SIZE(acx_proc_show_funcs)
static struct file_operations acx_e_proc_ops[ARRAY_SIZE(proc_files)];

#endif
-// -----
+/* ----- */

/*
* BOM Locking
@@ -798,7 +799,7 @@ void acx_unlock_debug(acx_device_t * adev, const char *where)
* ==================================================
*/

-// -----
+/* ----- */
#if ACX_DEBUG > 1

static int acx_debug_func_indent;
@@ -826,7 +827,7 @@ void log_fn_exit(const char *funcname)
int indent;
TIMESTAMP(d);

- // OW Handle underflow
+ /* OW Handle underflow */
if (acx_debug_func_indent >= ACX_DEBUG_FUNC_INDENT_INCREMENT)
acx_debug_func_indent -= ACX_DEBUG_FUNC_INDENT_INCREMENT;
else
@@ -1886,7 +1887,7 @@ int acx_interrogate_debug(acx_device_t *adev, void *pdr, int type,
return res;
}

-// OW TODO Helper for acx_s_cmd_join_bssid below
+/* OW TODO Helper for acx_s_cmd_join_bssid below */
/* Looks scary, eh?
** Actually, each one compiled into one AND and one SHIFT,
** 31 bytes in x86 asm (more if uints are replaced by u16/u8) */
@@ -2087,10 +2088,10 @@ void acx_set_defaults(acx_device_t *adev)
* 7.3.2.2 */
acx_update_ratevector(adev);

- // Get current tx-power setting
+ /* Get current tx-power setting */
acx1xx_get_tx_level(adev);

- // Sensitivity settings
+ /* Sensitivity settings */
if (IS_ACX111(adev))
/* start with sensitivity level 2 out of 3: */
adev->sensitivity = 2;
@@ -2396,13 +2397,13 @@ static int acx1xx_set_tx_level_dbm(acx_device_t *adev, int level_dbm)
static int acx1xx_update_tx_level_dbm(acx_device_t *adev)
{
u8 level_val;
- // Number of level of device
+ /* Number of level of device */
int numl;
- // Dbm per level
+ /* Dbm per level */
int dpl;
- // New level reverse
+ /* New level reverse */
int nlr;
- // Helper for modulo dpl, ...
+ /* Helper for modulo dpl, ... */
int helper;

/* The acx is working with power levels, which shift the
@@ -2441,22 +2442,22 @@ static int acx1xx_update_tx_level_dbm(acx_device_t *adev)

dpl = TX_CFG_MAX_DBM_POWER / numl;

- // Find closest match
+ /* Find closest match */
nlr = adev->tx_level_dbm / dpl;
helper = adev->tx_level_dbm % dpl;
if (helper > dpl - helper)
nlr++;

- // Adjust to boundaries (level zero doesn't exists, adjust to 1)
+ /* Adjust to boundaries (level zero doesn't exists, adjust to 1) */
if (nlr < 1)
nlr = 1;
if (nlr > numl)
nlr = numl;

- // Translate to final level_val
+ /* Translate to final level_val */
level_val = numl - nlr + 1;

- // Inform of adjustments
+ /* Inform of adjustments */
if (nlr * dpl != adev->tx_level_dbm) {
helper = adev->tx_level_dbm;
adev->tx_level_dbm = nlr * dpl;
@@ -2512,7 +2513,7 @@ static int acx1xx_update_tx_level(acx_device_t *adev)
return acx_configure(adev, &tx_level, ACX1xx_IE_DOT11_TX_POWER_LEVEL);
}

-// OW: Previously included tx-power related functions, kept for documentation
+/* OW: Previously included tx-power related functions, kept for documentation */
#if 0
/*
* FIXME: this should be solved in a general way for all radio types
@@ -2682,7 +2683,7 @@ static int acx1xx_update_antenna(acx_device_t *adev)
return res;
}

-// OW: Transfered from the acx-20080210 ioctl calls, but didn't test of verify
+/* OW: Transfered from the acx-20080210 ioctl calls, but didn't test of verify */
#if 0
/*
* 0 = antenna1; 1 = antenna2; 2 = full diversity; 3 = partial diversity
@@ -2734,7 +2735,7 @@ static int acx100_set_tx_antenna(acx_device_t *adev, u8 val)

acx_sem_lock(adev);

- // swap antenna 1/2 values
+ /* swap antenna 1/2 values */
switch (val) {
case 0:
val2 = 1;
@@ -3353,7 +3354,7 @@ static int acx_set_beacon(acx_device_t *adev, struct sk_buff *beacon)
* setup
*/

- // TODO Use pos provided by ieee80211_beacon_get_tim instead
+ /* TODO Use pos provided by ieee80211_beacon_get_tim instead */
tim_pos = acx_beacon_find_tim(beacon);
if (tim_pos == NULL)
logf0(L_DEBUG, "No tim contained in beacon skb");
@@ -3389,7 +3390,7 @@ static int acx_set_beacon(acx_device_t *adev, struct sk_buff *beacon)
res = acx_set_probe_response_template(adev, beacon->data, len_wo_tim);
if (res)
goto out;
- //acx_s_set_probe_response_template_off(adev);
+ /* acx_s_set_probe_response_template_off(adev); */

/* Needed if generated frames are to be emitted at different
* tx rate now */
@@ -3943,7 +3944,7 @@ static void acx_s_update_80211_powersave_mode(acx_device_t * adev)
}
#endif

-// TODO Verify these functions: translation rxbuffer.phy_plcp_signal to rate_idx
+/* TODO Verify these functions: translation rxbuffer.phy_plcp_signal to rate_idx */
#if 0

/** Rate values **/
@@ -4516,13 +4517,13 @@ static ssize_t acx_proc_write_diag(struct file *file, const char __user *buf,

logf1(L_ANY, "acx_diag: 0x%04x\n", val);

- // Execute operation
+ /* Execute operation */
if (val == ACX_DIAG_OP_RECALIB) {
logf0(L_ANY, "ACX_DIAG_OP_RECALIB: Scheduling immediate radio recalib\n");
adev->recalib_time_last_success = jiffies - RECALIB_PAUSE * 60 * HZ;
acx_schedule_task(adev, ACX_AFTER_IRQ_CMD_RADIO_RECALIB);
} else
- // Execute operation
+ /* Execute operation */
if (val & ACX_DIAG_OP_PROCESS_TX_RX) {
logf0(L_ANY, "ACX_DIAG_OP_PROCESS_TX_RX: Scheduling immediate Rx, Tx processing\n");

@@ -4534,7 +4535,7 @@ static ssize_t acx_proc_write_diag(struct file *file, const char __user *buf,
SET_BIT(adev->irq_reason, HOST_INT_TX_COMPLETE);
acx_schedule_task(adev, 0);
} else
- // Execute operation
+ /* Execute operation */
if (val & ACX_DIAG_OP_REINIT_TX_BUF) {
if (IS_MEM(adev)) {
logf0(L_ANY, "ACX_DIAG_OP_REINIT_TX_BUF\n");
@@ -4542,7 +4543,7 @@ static ssize_t acx_proc_write_diag(struct file *file, const char __user *buf,
} else
logf0(L_ANY, "ACX_DIAG_OP_REINIT_TX_BUF: Only valid for mem device\n");
}
- // Unknown
+ /* Unknown */
else
logf1(L_ANY, "Unknown command: 0x%04x\n", val);

@@ -4623,7 +4624,7 @@ static int acx_proc_show_phy(struct seq_file *file, void *v)

int i;
char *buf, *p;
- // OW Hopefully enough
+ /* OW Hopefully enough */
const int buf_size = 1024*64;

FN_ENTER;
@@ -4659,7 +4660,7 @@ static int acx_proc_show_phy(struct seq_file *file, void *v)
static int acx_proc_show_debug(struct seq_file *file, void *v)
{
FN_ENTER;
- // No sem locking required, since debug is global for all devices
+ /* No sem locking required, since debug is global for all devices */

seq_printf(file, "acx_debug: 0x%04x\n", acx_debug);

@@ -4676,7 +4677,7 @@ static ssize_t acx_proc_write_debug(struct file *file, const char __user *buf,
size_t size = after - buf + 1;

FN_ENTER;
- // No sem locking required, since debug is global for all devices
+ /* No sem locking required, since debug is global for all devices */

if (count == size) {
ret = count;
@@ -4890,7 +4891,7 @@ static int acx_proc_open(struct inode *inode, struct file *file)
file->f_path.dentry->d_name.name))
break;
}
- // log(L_ANY, "%s: proc filename=%s\n", __func__, proc_files[i]);
+ /* log(L_ANY, "%s: proc filename=%s\n", __func__, proc_files[i]); */

return single_open(file, acx_proc_show_funcs[i], PDE(inode)->data);
}
@@ -4899,7 +4900,7 @@ static void acx_proc_init(void)
{
int i;

- // acx_e_proc_ops init
+ /* acx_e_proc_ops init */
for (i = 0; i < ARRAY_SIZE(proc_files); i++) {
acx_e_proc_ops[i].owner = THIS_MODULE;
acx_e_proc_ops[i].open = acx_proc_open;
@@ -4920,14 +4921,15 @@ int acx_proc_register_entries(struct ieee80211_hw *hw)

FN_ENTER;

- // Sub-dir for this acx_phy[0-9] instance
+ /* Sub-dir for this acx_phy[0-9] instance */

- // I tried to create a /proc/driver/acx sub-dir in acx_proc_init()
- // to put the phy[0-9] into, but for some bizarre reason the proc-fs
- // refuses then to create the phy[0-9] dirs in /proc/driver/acx !?
- // It only works, if /proc/driver/acx is created here in
- // acx_proc_register_entries().
- // ... Anyway, we should swap to sysfs.
+ /* I tried to create a /proc/driver/acx sub-dir in acx_proc_init()
+ * to put the phy[0-9] into, but for some bizarre reason the proc-fs
+ * refuses then to create the phy[0-9] dirs in /proc/driver/acx !?
+ * It only works, if /proc/driver/acx is created here in
+ * acx_proc_register_entries().
+ * ... Anyway, we should swap to sysfs.
+ */
snprintf(procbuf2, sizeof(procbuf2), "driver/acx_%s",
wiphy_name(adev->ieee->wiphy));

@@ -4938,11 +4940,11 @@ int acx_proc_register_entries(struct ieee80211_hw *hw)
procbuf2, proc_files[i]);
log(L_INIT, "creating proc entry /proc/%s\n", procbuf);

- // Read-only
+ /* Read-only */
if (acx_proc_write_funcs[i] == NULL)
pe = proc_create(procbuf, 0444, NULL,
&acx_e_proc_ops[i]);
- // Read-Write
+ /* Read-Write */
else
pe = proc_create(procbuf, 0644, NULL,
&acx_e_proc_ops[i]);
@@ -4967,7 +4969,7 @@ int acx_proc_unregister_entries(struct ieee80211_hw *hw)

FN_ENTER;

- // Subdir for this acx instance
+ /* Subdir for this acx instance */
snprintf(procbuf2, sizeof(procbuf2), "driver/acx_%s",
wiphy_name(adev->ieee->wiphy));

@@ -5008,7 +5010,7 @@ void acx_process_rxbuf(acx_device_t *adev, rxbuffer_t *rxbuf)
/* length of frame from control field to first byte of FCS */
buf_len = RXBUF_BYTES_RCVD(adev, rxbuf);

- // For debugging
+ /* For debugging */
if (((IEEE80211_FCTL_STYPE & fc) != IEEE80211_STYPE_BEACON)
&& (acx_debug & (L_XFER|L_DATA))) {

@@ -5040,8 +5042,9 @@ void acx_process_rxbuf(acx_device_t *adev, rxbuffer_t *rxbuf)
* it. Either these values are not meant to be expressed in
* dBm, or it's some pretty complicated calculation. */

- // FIXME OW 20100619 Is this still required. Only for adev local use.
- // Mac80211 signal level is reported in acx_l_rx for each skb.
+ /* FIXME OW 20100619 Is this still required. Only for adev local use.
+ * Mac80211 signal level is reported in acx_l_rx for each skb.
+ */
/* TODO: only the RSSI seems to be reported */
adev->rx_status.signal = acx_signal_to_winlevel(rxbuf->phy_level);

@@ -5090,10 +5093,11 @@ static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf)
status->mactime = rxbuf->time;

level = acx_signal_to_winlevel(rxbuf->phy_level);
- // FIXME cleanup ?: noise = acx_signal_to_winlevel(rxbuf->phy_snr);
+ /* FIXME cleanup ?: noise = acx_signal_to_winlevel(rxbuf->phy_snr); */

- //status->signal = acx_signal_determine_quality(level, noise);
- // TODO OW 20100619 On ACX100 seem to be always zero (seen during hx4700 tests ?!)
+ /* status->signal = acx_signal_determine_quality(level, noise);
+ * TODO OW 20100619 On ACX100 seem to be always zero (seen during hx4700 tests ?!)
+ */
status->signal = level;

status->flag = 0;
@@ -5103,9 +5107,10 @@ static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf)

status->antenna = 1;

- // TODO I'm not sure whether this is (currently) really required. In tests
- // this didn't made a difference. Maybe compare what other drivers do.
- // TODO Verify translation to rate_idx.
+ /* TODO I'm not sure whether this is (currently) really required. In tests
+ * this didn't made a difference. Maybe compare what other drivers do.
+ * TODO Verify translation to rate_idx.
+ */
#if 0
if (rxbuf->phy_stat_baseband & (1 << 3)) /* Uses OFDM */
status->rate_idx =
@@ -5124,7 +5129,7 @@ static void acx_rx(acx_device_t *adev, rxbuffer_t *rxbuf)
ieee80211_rx_ni(adev->ieee, skb);
#endif
}
- // Usb Rx is happening in_interupt()
+ /* Usb Rx is happening in_interupt() */
else if (IS_USB(adev) || IS_MEM(adev))
ieee80211_rx_irqsafe(adev->ieee, skb);
else
@@ -5249,13 +5254,14 @@ int acx_tx_frame(acx_device_t *adev, struct sk_buff *skb)
logf0(L_BUF, "Txbuf==NULL. (Card was removed ?!):"
" Stop queue. Dealloc skb.\n");

- // OW only USB implemented
+ /* OW only USB implemented */
acx_dealloc_tx(adev, tx);
return (-ENXIO);
}

- // OW, 20100930: FIXME: Is this required for mem. txbuf is actually not containing to the data
- // for the, but actually "addr = acxmem_allocate_acx_txbuf_space in acxmem_tx_data().
+ /* OW, 20100930: FIXME: Is this required for mem. txbuf is actually not containing to the data
+ * for the, but actually "addr = acxmem_allocate_acx_txbuf_space in acxmem_tx_data().
+ */

memcpy(txbuf, skb->data, skb->len);

@@ -5516,7 +5522,7 @@ void acxpcimem_handle_tx_error(acx_device_t *adev, u8 error,
"Disabling above message\n");
}

- // On the acx111, we would normally have auto radio-recalibration enabled
+ /* On the acx111, we would normally have auto radio-recalibration enabled */
if (!adev->recalib_auto){
logf0(L_ANY, "Scheduling radio recalibration after high tx retries.\n");
acx_schedule_task(adev,
@@ -5679,8 +5685,9 @@ static void acx_set_wepkey(acx_device_t * adev)
*/
static int acx100_init_wep(acx_device_t * adev)
{
- // acx100_ie_wep_options_t options;
- // ie_dot11WEPDefaultKeyID_t dk;
+ /* acx100_ie_wep_options_t options;
+ * ie_dot11WEPDefaultKeyID_t dk;
+ */
acx_ie_memmap_t pt;
int res = NOT_OK;

@@ -5767,7 +5774,7 @@ fail:
return res;
}

-// OW, 20100704, Obselete, TBC for cleanup
+/* OW, 20100704, Obselete, TBC for cleanup */
#if 0
static void acx_keymac_write(acx_device_t *adev, u16 index, const u32 *addr)
{
@@ -5806,7 +5813,7 @@ int acx_clear_keys(acx_device_t *adev)

/* FixMe:Check for Number of Keys available */

-// assert(nr_keys <= ARRAY_SIZE(adev->key));
+/* assert(nr_keys <= ARRAY_SIZE(adev->key)); */

for (i = 0; i < nr_keys; i++) {
adev->key[i].enabled = 0;
@@ -5836,12 +5843,13 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm,

FN_ENTER;

-// log(L_IOCTL, "set encoding flags=0x%04X, size=%d, key: %s\n",
-// dwrq->flags, dwrq->length, extra ? "set" : "No key");
+/* log(L_IOCTL, "set encoding flags=0x%04X, size=%d, key: %s\n",
+ * dwrq->flags, dwrq->length, extra ? "set" : "No key");
+ */

-// acx_sem_lock(adev);
+/* acx_sem_lock(adev); */

- // index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
+ /* index = (dwrq->flags & IW_ENCODE_INDEX) - 1; */
if (key->keylen > 0) {

/* if index is 0 or invalid, use default key */
@@ -5855,7 +5863,7 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm,
case 40 / 8:
/* WEP 40-bit =
40-bit entered key + 24 bit IV = 64-bit */
- //adev->wep_keys[index].size = 13;
+ /* adev->wep_keys[index].size = 13; */

adev->wep_keys[index].size = 5;
break;
@@ -5863,7 +5871,7 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm,
case 104 / 8:
/* WEP 104-bit =
104-bit entered key + 24-bit IV = 128-bit */
- // adev->wep_keys[index].size = 29;
+ /* adev->wep_keys[index].size = 29; */
adev->wep_keys[index].size = 13;
break;

@@ -5908,7 +5916,7 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm,
adev->wep_restricted = 1;
}
*/
-// adev->auth_alg = algorithm;
+/* adev->auth_alg = algorithm; */
/* set flag to make sure the card WEP settings get updated */

/* OW
@@ -5933,7 +5941,7 @@ int acx_key_write(acx_device_t *adev, u16 index, u8 algorithm,
*/

result = -EINPROGRESS;
-// acx_sem_unlock(adev);
+/* acx_sem_unlock(adev); */

FN_EXIT1(result);
return result;
@@ -5972,7 +5980,7 @@ void acx_init_task_scheduler(acx_device_t *adev)
logf0(L_ANY, "Unhandled adev device type!\n");
BUG();

- // OW TODO Interrupt handling ...
+ /* OW TODO Interrupt handling ... */
/* OW In case of of tasklet ... but workqueues seem to be prefered
tasklet_init(&adev->interrupt_tasklet,
(void(*)(unsigned long)) acx_interrupt_tasklet,
@@ -5999,7 +6007,7 @@ void acx_after_interrupt_task(acx_device_t *adev)
if (adev->after_interrupt_jobs & ACX_AFTER_IRQ_CMD_STOP_SCAN) {
log(L_IRQ, "sending a stop scan cmd...\n");

- // OW Scanning is done by mac80211
+ /* OW Scanning is done by mac80211 */
#if 0
acx_unlock(adev, flags);
acx_issue_cmd(adev, ACX1xx_CMD_STOP_SCAN, NULL, 0);
@@ -6124,7 +6132,7 @@ void acx_schedule_task(acx_device_t *adev, unsigned int set_flag)
*/
void acx_timer(unsigned long address)
{
- //acx_device_t *adev = (acx_device_t *) address;
+ /* acx_device_t *adev = (acx_device_t *) address; */

FN_ENTER;

@@ -6238,7 +6246,7 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,
break;
}

- // Reconfigure mac-address globally, affecting all vifs
+ /* Reconfigure mac-address globally, affecting all vifs */
if (!mac_is_equal(mac_vif, adev->dev_addr)) {

acx1xx_set_station_id(adev, mac_vif);
@@ -6312,9 +6320,10 @@ void acx_op_remove_interface(struct ieee80211_hw *hw,
FN_EXIT0;
}

-// FUNCTION_GREP_RESET
-// The function_grep script can get confused with multiple "{"" opening braces
-// due e.g. due to #ifdefs. This tag reset the parser state of the script.
+/* FUNCTION_GREP_RESET
+ * The function_grep script can get confused with multiple "{"" opening braces
+ * due e.g. due to #ifdefs. This tag reset the parser state of the script.
+ */

int acx_op_config(struct ieee80211_hw *hw, u32 changed)
{
@@ -6331,15 +6340,16 @@ int acx_op_config(struct ieee80211_hw *hw, u32 changed)

logf1(L_DEBUG, "changed=%08X\n", changed);

- // Tx-Power
- // power_level: requested transmit power (in dBm)
+ /* Tx-Power
+ * power_level: requested transmit power (in dBm)
+ */
if (changed & IEEE80211_CONF_CHANGE_POWER) {
logf1(L_DEBUG, "IEEE80211_CONF_CHANGE_POWER: %d\n",
conf->power_level);
acx1xx_set_tx_level_dbm(adev, conf->power_level);
}

- // IEEE80211_CONF_CHANGE_CHANNEL
+ /* IEEE80211_CONF_CHANGE_CHANNEL */
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
changed_not_done &= ~IEEE80211_CONF_CHANGE_CHANNEL;

@@ -6362,7 +6372,7 @@ end_sem_unlock:
return 0;
}

-// Find position of TIM IE
+/* Find position of TIM IE */
static u8* acx_beacon_find_tim(struct sk_buff *beacon_skb)
{
u8 *p1, *p2, *tim;
@@ -6414,10 +6424,10 @@ void acx_op_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
MAC_COPY(adev->bssid, info->bssid);
}

- // BOM BSS_CHANGED_BEACON
+ /* BOM BSS_CHANGED_BEACON */
if (changed & BSS_CHANGED_BEACON) {

- // TODO Use ieee80211_beacon_get_tim instead
+ /* TODO Use ieee80211_beacon_get_tim instead */
beacon = ieee80211_beacon_get(hw, vif);
if (!beacon) {
logf0(L_ANY,
@@ -6443,9 +6453,9 @@ int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_key_conf *key)
{
struct acx_device *adev = ieee2adev(hw);
- // unsigned long flags;
+ /* unsigned long flags; */
u8 algorithm;
- // u16 index;
+ /* u16 index; */
int err = -EINVAL;

FN_ENTER;
@@ -6475,7 +6485,7 @@ int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
log(L_INIT, "%s: algorithm=%i: %s\n",
__func__, algorithm, "ACX_SEC_ALGO_WEP104");
}
- // OW Let's try WEP in mac80211 sw
+ /* OW Let's try WEP in mac80211 sw */
err = -EOPNOTSUPP;
break;
#else
@@ -6526,7 +6536,7 @@ int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
FN_EXIT0;
return err;

- // OW Everything below this lines, doesn't matter anymore for the moment.
+ /* OW Everything below this lines, doesn't matter anymore for the moment. */
#if 0
index = (u8) (key->keyidx);
if (index >= ARRAY_SIZE(adev->key))
@@ -6568,7 +6578,7 @@ int acx_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
if (adev->wep_enabled) {
SET_BIT(adev->set_mask, GETSET_WEP);
acx_update_card_settings(adev);
- //acx_schedule_task(adev, ACX_AFTER_IRQ_UPDATE_CARD_CFG);
+ /* acx_schedule_task(adev, ACX_AFTER_IRQ_UPDATE_CARD_CFG); */
}
out:
FN_EXIT0;
@@ -6589,7 +6599,7 @@ void acx_op_configure_filter(struct ieee80211_hw *hw,
logf1(L_DEBUG, "1: changed_flags=0x%08x, *total_flags=0x%08x\n",
changed_flags, *total_flags);

- // OWI TODO: Set also FIF_PROBE_REQ ?
+ /* OWI TODO: Set also FIF_PROBE_REQ ? */
*total_flags &= (FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL
| FIF_CONTROL | FIF_OTHER_BSS);

@@ -6610,7 +6620,7 @@ int acx_conf_tx(struct ieee80211_hw *hw, u16 queue,
acx_device_t *adev = ieee2adev(hw);
FN_ENTER;
acx_sem_lock(adev);
- // TODO
+ /* TODO */
acx_sem_unlock(adev);
FN_EXIT0;
return 0;
@@ -6871,7 +6881,7 @@ static int __init acx_init_module(void)

static void __exit acx_cleanup_module(void)
{
- // TODO Check, that interface isn't still up
+ /* TODO Check, that interface isn't still up */

#if defined(CONFIG_ACX_MAC80211_PCI)
acxpci_cleanup_module();
diff --git a/mem.c b/mem.c
index 437747a..1b694f5 100644
--- a/mem.c
+++ b/mem.c
@@ -80,7 +80,7 @@
* ==================================================
*/

-// OW PM for later
+/* OW PM for later */
#undef CONFIG_PM

/*
@@ -92,7 +92,7 @@
#define DUMP_MEM_DURING_DIAG 0
#define DUMP_IF_SLOW 0

-// OW #define PATCH_AROUND_BAD_SPOTS 1
+/* OW #define PATCH_AROUND_BAD_SPOTS 1 */
#define PATCH_AROUND_BAD_SPOTS 1
#define HX4700_FIRMWARE_CHECKSUM 0x0036862e
#define HX4700_ALTERNATE_FIRMWARE_CHECKSUM 0x00368a75
@@ -108,7 +108,7 @@
*/

#if DUMP_MEM_DEFINED > 0
-//= static
+/* = static */
void acxmem_dump_mem(acx_device_t *adev, u32 start, int length);
#endif

@@ -127,10 +127,10 @@ char acxmem_printable(char c);
#define CARD_EEPROM_ID_SIZE 6
#define REG_ACX_VENDOR_ID 0x900

-// This is the vendor id on the HX4700, anyway
+/* This is the vendor id on the HX4700, anyway */
#define ACX_VENDOR_ID 0x8400104c

-//OW 20090815 #define WLAN_A4FR_MAXLEN_WEP_FCS (30 + 2312 + 4)
+/* OW 20090815 #define WLAN_A4FR_MAXLEN_WEP_FCS (30 + 2312 + 4) */

#define RX_BUFFER_SIZE (sizeof(rxbuffer_t) + 32)

@@ -144,7 +144,7 @@ char acxmem_printable(char c);
#include "mem-inlines.h"

#if DUMP_MEM_DEFINED > 0
-//= static
+/* = static */
void acxmem_dump_mem(acx_device_t *adev, u32 start, int length)
{
int i;
@@ -178,7 +178,7 @@ void acxmem_dump_mem(acx_device_t *adev, u32 start, int length)
*
* TODO - rewrite using address autoincrement, handle partial words
*/
-//= static
+/* = static */
void acxmem_copy_from_slavemem(acx_device_t *adev, u8 *destination,
u32 source, int count)
{
@@ -225,7 +225,7 @@ void acxmem_copy_from_slavemem(acx_device_t *adev, u8 *destination,
*
* TODO - rewrite using autoincrement, handle partial words
*/
-//= static
+/* = static */
void acxmem_copy_to_slavemem(acx_device_t *adev, u32 destination,
u8 *source, int count)
{
@@ -284,7 +284,7 @@ void acxmem_copy_to_slavemem(acx_device_t *adev, u32 destination,
* to the ACX transmit buffer structure with minimal intervention on
* our part. Interrupts should be disabled when calling this.
*/
-//=static
+/* =static */
void acxmem_chaincopy_to_slavemem(acx_device_t *adev, u32 destination,
u8 *source, int count)
{
@@ -352,7 +352,7 @@ void acxmem_chaincopy_to_slavemem(acx_device_t *adev, u32 destination,
* intervention on our part. Interrupts should be disabled when
* calling this.
*/
-//= static
+/* = static */
void acxmem_chaincopy_from_slavemem(acx_device_t *adev, u8 *destination,
u32 source, int count)
{
@@ -374,7 +374,7 @@ void acxmem_chaincopy_from_slavemem(acx_device_t *adev, u8 *destination,
acxmem_dump_mem(adev, 0, 0x10000);
}
if ((ulong) destination & 3) {
- //printk ("acx chaincopy: data destination not word aligned!\n");
+ /* printk ("acx chaincopy: data destination not word aligned!\n"); */
data = (u32 *) aligned_destination;
if (count > sizeof aligned_destination) {
pr_err("chaincopy_from_slavemem overflow!\n");
@@ -897,7 +897,7 @@ STATick void acxmem_reset_mac(acx_device_t *adev)
int count;
FN_ENTER;

- // OW Bit setting done differently in pci.c
+ /* OW Bit setting done differently in pci.c */
/* halt eCPU */
set_regbits(adev, IO_ACX_ECPU_CTRL, 0x1);

@@ -1013,7 +1013,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
else
seq_printf(file, "%02u (%02x) empty%-10s", i, Ctl_8, rtl);

- //seq_printf(file, "\n");
+ /* seq_printf(file, "\n"); */

acxmem_copy_from_slavemem(adev, (u8 *) &rxd, (ulong) rxdesc, sizeof(rxd));
seq_printf(file,
@@ -1077,7 +1077,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
tmp = read_slavemem32(adev, (ulong) & (txdesc->AcxMemPtr));
seq_printf(file, " %04x: ", tmp);

- // Output allocated tx-buffer chain
+ /* Output allocated tx-buffer chain */
#if 1
if (tmp) {
while ((tmp2 = read_slavemem32(adev, (u32) tmp)) != 0x02000000) {
@@ -1112,7 +1112,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
}

#if 1
- // Tx-buffer list dump
+ /* Tx-buffer list dump */
seq_printf(file, "\n");
seq_printf(file, "* Tx-buffer list dump\n");
seq_printf(file, "acx_txbuf_numblocks=%d, acx_txbuf_blocks_free=%d, \n"
@@ -1128,7 +1128,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
tmp += adev->memblocksize;
}
seq_printf(file, "\n");
- // ---
+ /* --- */
#endif

seq_printf(file, "\n"
@@ -1136,7 +1136,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
"irq_mask 0x%04x irq_status 0x%04x irq on acx 0x%04x\n"

"txbuf_start 0x%p, txbuf_area_size %u\n"
- // OW TODO Add also the acx tx_buf size available
+ /* OW TODO Add also the acx tx_buf size available */
"txdesc_size %u, txdesc_start 0x%p\n"
"txhostdesc_start 0x%p, txhostdesc_area_size %u\n"
"txbuf start 0x%04x, txbuf size %d\n"
@@ -1467,11 +1467,11 @@ void acxmem_init_acx_txbuf2(acx_device_t *adev)
for (i = 0; i < adev->acx_txbuf_numblocks; i++) {
next_adr = adr + adev->memblocksize;

- // Last block is marked with 0x02000000
+ /* Last block is marked with 0x02000000 */
if (i == adev->acx_txbuf_numblocks - 1) {
write_slavemem32(adev, adr, 0x02000000);
}
- // Else write pointer to next block
+ /* Else write pointer to next block */
else {
write_slavemem32(adev, adr, (next_adr >> 5));
}
@@ -1607,14 +1607,14 @@ void acxmem_update_queue_indicator(acx_device_t *adev, int txqueue)
}
#endif

-// OW TODO See if this is usable with mac80211
+/* OW TODO See if this is usable with mac80211 */
/***********************************************************************
** acxmem_i_tx_timeout
**
** Called from network core. Must not sleep!
*/
#if 0 // or mem.c:3242:3: warning: passing argument 1 of 'acx_wake_queue'
- // from incompatible pointer type [enabled by default]
+ /* from incompatible pointer type [enabled by default] */
STATick void acxmem_i_tx_timeout(struct net_device *ndev)
{
acx_device_t *adev = ndev2adev(ndev);
@@ -1685,8 +1685,9 @@ STATick void acxmem_i_tx_timeout(struct net_device *ndev)
after we set it once. Let's hope this will be fixed in firmware someday
*/

-// OW FIXME Old interrupt handler
-// ---
+/* OW FIXME Old interrupt handler
+ * ---
+ */
#if 0 // or mem.c:3579:4: error: implicit declaration of function 'acxmem_log_unusual_irq'
STATick irqreturn_t acxmem_interrupt(int irq, void *dev_id)
{
@@ -1746,9 +1747,10 @@ STATick irqreturn_t acxmem_interrupt(int irq, void *dev_id)

/* Handle most important IRQ types first */

- // OW 20091123 FIXME Rx path stops under load problem:
- // Maybe the RX rings fills up to fast, we are missing an irq and
- // then we are then not getting rx irqs anymore
+ /* OW 20091123 FIXME Rx path stops under load problem:
+ * Maybe the RX rings fills up to fast, we are missing an irq and
+ * then we are then not getting rx irqs anymore
+ */
if (irqtype & HOST_INT_RX_DATA) {
log(L_IRQ, "got Rx_Data IRQ\n");
acxmem_process_rxdesc(adev);
@@ -1835,15 +1837,16 @@ STATick irqreturn_t acxmem_interrupt(int irq, void *dev_id)
}
#endif

- // OW 20091129 TODO Currently breaks mem.c ...
- // If sleeping is required like for update card settings, this is usefull
- // For now I replaced sleeping for command handling by mdelays.
-// if (adev->after_interrupt_jobs){
-// acx_e_after_interrupt_task(adev);
-// }
+ /* OW 20091129 TODO Currently breaks mem.c ...
+ * If sleeping is required like for update card settings, this is usefull
+ * For now I replaced sleeping for command handling by mdelays.
+ * if (adev->after_interrupt_jobs){
+ * acx_e_after_interrupt_task(adev);
+ * }
+ */


-// OW TODO
+/* OW TODO */
#if 0
/* Routine to perform blink with range */
if (unlikely(adev->led_power == 2))
@@ -1862,7 +1865,7 @@ STATick irqreturn_t acxmem_interrupt(int irq, void *dev_id)
return IRQ_NONE;
}
#endif
-// ---
+/* --- */


/*
@@ -1926,7 +1929,7 @@ STATick char acxmem_printable(char c)
return ((c >= 20) && (c < 127)) ? c : '.';
}

-// OW TODO
+/* OW TODO */
#if 0 // or mem.c:3695:42: error: 'acx_device_t' has no member named 'wstats'
STATick void update_link_quality_led(acx_device_t *adev)
{
@@ -1952,7 +1955,7 @@ STATick void update_link_quality_led(acx_device_t *adev)
* ==================================================
*/

-// OW TODO Not used in pci either !?
+/* OW TODO Not used in pci either !? */
#if 0 // or mem.c:3717:5: error: conflicting types for 'acx111pci_ioctl_info'
int acx111pci_ioctl_info(struct ieee80211_hw *hw,
struct iw_request_info *info,
@@ -2244,7 +2247,7 @@ int acx100mem_ioctl_set_phy_amp_bias(struct ieee80211_hw *hw,
struct iw_request_info *info,
struct iw_param *vwrq, char *extra)
{
- // OW
+ /* OW */
acx_device_t *adev = ieee2adev(hw);
unsigned long flags;
u16 gpio_old;
@@ -2340,7 +2343,7 @@ STATick int __devinit acxmem_probe(struct platform_device *pdev)
ieee->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION)
| BIT(NL80211_IFTYPE_ADHOC);
ieee->queues = 1;
- // OW TODO Check if RTS/CTS threshold can be included here
+ /* OW TODO Check if RTS/CTS threshold can be included here */

/* TODO: although in the original driver the maximum value was
* 100, the OpenBSD driver assigns maximum values depending on
@@ -2361,8 +2364,9 @@ STATick int __devinit acxmem_probe(struct platform_device *pdev)
* now, as they do not seem to be supported or how to acquire
* them is still unknown. */

- // We base signal quality on winlevel approach of previous driver
- // TODO OW 20100615 This should into a common init code
+ /* We base signal quality on winlevel approach of previous driver
+ * TODO OW 20100615 This should into a common init code
+ */
ieee->flags |= IEEE80211_HW_SIGNAL_UNSPEC;
ieee->max_signal = 100;

@@ -2456,7 +2460,7 @@ STATick int __devinit acxmem_probe(struct platform_device *pdev)
irq_set_irq_type(adev->irq, IRQF_TRIGGER_FALLING);
#endif
log(L_ANY, "request_irq %d successful\n", adev->irq);
- // Acx irqs shall be off and are enabled later in acxpci_s_up
+ /* Acx irqs shall be off and are enabled later in acxpci_s_up */
acxmem_lock();
acx_irq_disable(adev);
acxmem_unlock();
@@ -2470,15 +2474,15 @@ STATick int __devinit acxmem_probe(struct platform_device *pdev)
#endif /* NONESSENTIAL_FEATURES */

/* Device setup is finished, now start initializing the card */
- // ---
+ /* --- */

acx_init_task_scheduler(adev);

- // Mac80211 Tx_queue
+ /* Mac80211 Tx_queue */
INIT_WORK(&adev->tx_work, acx_tx_work);
skb_queue_head_init(&adev->tx_queue);

- // OK init parts from pci.c are done in acxmem_complete_hw_reset(adev)
+ /* OK init parts from pci.c are done in acxmem_complete_hw_reset(adev) */
if (OK != acxmem_complete_hw_reset(adev))
goto fail_complete_hw_reset;

@@ -2499,8 +2503,9 @@ STATick int __devinit acxmem_probe(struct platform_device *pdev)
* to send packets even though we're not associated to a
* network yet */

-// OW FIXME Check if acx_stop_queue, acx_carrier_off should be included
-// OW Rest can be cleaned up
+/* OW FIXME Check if acx_stop_queue, acx_carrier_off should be included
+ * OW Rest can be cleaned up
+ */
#if 0
acx_stop_queue(ndev, "on probe");
acx_carrier_off(ndev, "on probe");
@@ -2516,7 +2521,7 @@ STATick int __devinit acxmem_probe(struct platform_device *pdev)

/* need to be able to restore PCI state after a suspend */
#ifdef CONFIG_PM
- // pci_save_state(pdev);
+ /* pci_save_state(pdev); */
#endif

err = acx_setup_modes(adev);
@@ -2591,7 +2596,7 @@ STATick int __devexit acxmem_remove(struct platform_device *pdev)
goto end_no_lock;
}

- // Unregister ieee80211 device
+ /* Unregister ieee80211 device */
log(L_INIT, "removing device %s\n", wiphy_name(adev->ieee->wiphy));
ieee80211_unregister_hw(adev->ieee);
CLEAR_BIT(adev->dev_state_mask, ACX_STATE_IFACE_UP);
@@ -2637,10 +2642,10 @@ STATick int __devexit acxmem_remove(struct platform_device *pdev)
acxmem_unlock();
}

- // Proc
+ /* Proc */
acx_proc_unregister_entries(adev->ieee);

- // IRQs
+ /* IRQs */
acxmem_lock();
acx_irq_disable(adev);
acxmem_unlock();
@@ -2703,8 +2708,9 @@ acxmem_e_suspend(struct platform_device *pdev, pm_message_t state)
/*
* Turn the ACX chip off.
*/
- // This should be done by the corresponding platform module, e.g. hx4700_acx.c
- // hwdata->stop_hw();
+ /* This should be done by the corresponding platform module, e.g. hx4700_acx.c
+ * hwdata->stop_hw();
+ */

acx_sem_unlock(adev);

@@ -2735,8 +2741,9 @@ STATick int acxmem_e_resume(struct platform_device *pdev)
/*
* Turn on the ACX.
*/
- // This should be done by the corresponding platform module, e.g. hx4700_acx.c
- // hwdata->start_hw();
+ /* This should be done by the corresponding platform module, e.g. hx4700_acx.c
+ * hwdata->start_hw();
+ */

acxmem_complete_hw_reset(adev);

diff --git a/merge.c b/merge.c
index d276ad5..de40ef3 100644
--- a/merge.c
+++ b/merge.c
@@ -35,21 +35,21 @@
MEM and PCI includes. Punt for now..
*/
#define ACX_MAC80211_MEM
-// #define ACX_MAC80211_PCI
+/* #define ACX_MAC80211_PCI */

#include "acx.h"
#include "merge.h"

-// merge adaptation help
+/* merge adaptation help */
#include "pci.h"
#include "mem.h"
#include "io-acx.h"
#include "mem-inlines.h"

-// from mem.c:98
+/* from mem.c:98 */
#define FW_NO_AUTO_INCREMENT 1

-// identical from pci.c, mem.c
+/* identical from pci.c, mem.c */
irqreturn_t acx_interrupt(int irq, void *dev_id)
{
acx_device_t *adev = dev_id;
@@ -60,7 +60,7 @@ irqreturn_t acx_interrupt(int irq, void *dev_id)
if (!adev)
return IRQ_NONE;

- // On a shared irq line, irqs should only be for us, when enabled them
+ /* On a shared irq line, irqs should only be for us, when enabled them */
if (!adev->irqs_active)
return IRQ_NONE;

@@ -142,7 +142,7 @@ static int acx_upload_radio(acx_device_t *adev, char *filename)
acx_issue_cmd(adev, ACX1xx_CMD_SLEEP, NULL, 0);

for (try = 1; try <= 5; try++) {
- // JC: merge mem vs pci here.
+ /* JC: merge mem vs pci here. */
acxmem_lock();
if (IS_MEM(adev))
res = acx_write_fw(adev, radio_image, offset);
@@ -186,7 +186,7 @@ fail:
return res;
}

-// exported wrapper for acx_upload_radio()
+/* exported wrapper for acx_upload_radio() */
int acxmem_upload_radio(acx_device_t *adev)
{
char filename[sizeof("RADIONN.BIN")];
@@ -196,7 +196,7 @@ int acxmem_upload_radio(acx_device_t *adev)
return acx_upload_radio(adev, filename);
}

-// exported wrapper for acx_upload_radio()
+/* exported wrapper for acx_upload_radio() */
int acxpci_upload_radio(acx_device_t *adev)
{
char filename[sizeof("tiacx1NNrNN")];
@@ -738,7 +738,7 @@ void acx_free_desc_queues(acx_device_t *adev)
FN_EXIT0;
}

-//##########################################
+/* ########################################## */
/* irq stuff */

void acx_irq_enable(acx_device_t * adev)
@@ -765,7 +765,7 @@ void acx_irq_disable(acx_device_t * adev)
FN_EXIT0;
}

-//##########################################
+/* ########################################## */
/* logging stuff */

void acx_log_rxbuffer(const acx_device_t *adev)
@@ -815,7 +815,7 @@ void acx_log_txbuffer(acx_device_t *adev)
}


-//#######################################################################
+/* ####################################################################### */

/*
* acx_read_eeprom_byte
@@ -893,13 +893,13 @@ char *acx_proc_eeprom_output(int *length, acx_device_t *adev)
* We don't lock hw accesses here since we never r/w eeprom in IRQ
* Note: this function sleeps only because of GFP_KERNEL alloc
*/
-// unused in mem, used in pci
+/* unused in mem, used in pci */
#if 0 //
int acx_s_write_eeprom(acx_device_t *adev, u32 addr, u32 len,
const u8 *charbuf)
{
u8 *data_verify = NULL;
- // unsigned long flags; // block warn unused
+ /* unsigned long flags; /* block warn unused */
int count, i;
int result = NOT_OK;
u16 gpio_orig;
@@ -1021,7 +1021,7 @@ int _acx_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf)
write_reg32(adev, IO_ACX_PHY_CTL, 2);

count = 0xffff;
- // todo moe while to fn, reuse
+ /* todo moe while to fn, reuse */
while (read_reg32(adev, IO_ACX_PHY_CTL)) {
/* scheduling away instead of CPU burning loop doesn't
* seem to work here at all: awful delay, sometimes
@@ -1070,8 +1070,9 @@ int _acx_write_phy_reg(acx_device_t *adev, u32 reg, u8 value)
if (IS_PCI(adev))
goto skip_mem_wait_loop;

- // todo recode as fn
- // this not present for pci
+ /* todo recode as fn
+ * this not present for pci
+ */
count = 0xffff;
while (read_reg32(adev, IO_ACX_PHY_CTL)) {
/* scheduling away instead of CPU burning loop doesn't
@@ -1107,14 +1108,14 @@ fail:
* 1 firmware image corrupted
* 0 success
*/
-// static
+/* static */
#if 1 // needs work, but it compiles
int acx_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
u32 offset)
{
int len, size;
u32 sum, v32;
- // mem.c ars
+ /* mem.c ars */
int checkMismatch = -1;
u32 tmp, id;

@@ -1172,7 +1173,7 @@ int acx_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
write_reg32(adev, IO_ACX_SLV_MEM_DATA, v32);
write_flush(adev);
#endif
-// mem.c only, til ..
+/* mem.c only, til .. */
write_slavemem32(adev, offset + len - 4, v32);

id = read_id_register(adev);
@@ -1214,7 +1215,7 @@ int acx_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
* NOT_OK firmware image corrupted or not correctly written
* OK success
*/
-// static
+/* static */
#if 1 // compiles
int acx_validate_fw(acx_device_t *adev,
const firmware_image_t *fw_image, u32 offset)
@@ -1532,7 +1533,7 @@ u32 acx_read_cmd_type_status(acx_device_t *adev)
}
#endif // acxmem_read_cmd_type_status()

-// static inline
+/* static inline */
void acx_write_cmd_type_status(acx_device_t *adev, u16 type, u16 status)
{
FN_ENTER;
@@ -1548,7 +1549,7 @@ void acx_write_cmd_type_status(acx_device_t *adev, u16 type, u16 status)
}

#if 1 //
-// static inline
+/* static inline */
void acx_init_mboxes(acx_device_t *adev)
{
u32 cmd_offs, info_offs;
@@ -1566,7 +1567,7 @@ void acx_init_mboxes(acx_device_t *adev)
adev->cmd_area = (u8 *) adev->iobase2 + cmd_offs;
adev->info_area = (u8 *) adev->iobase2 + info_offs;
}
- // OW iobase2 not used in mem.c, in pci.c it is
+ /* OW iobase2 not used in mem.c, in pci.c it is */
log(L_DEBUG, "iobase2=%p cmd_mbox_offset=%X cmd_area=%p"
"info_mbox_offset=%X info_area=%p\n",
adev->iobase2, cmd_offs, adev->cmd_area,
@@ -1639,7 +1640,7 @@ int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,

/* wait for firmware to become idle for our command submission */
counter = 199; /* in ms */
- // from pci.c
+ /* from pci.c */
timeout = HZ / 5;
counter = (timeout * 1000 / HZ) - 1;
timeout += jiffies;
@@ -1647,7 +1648,7 @@ int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
do {
cmd_status = acx_read_cmd_type_status(adev);
/* Test for IDLE state */
- // pci.c had more complicated timeout code here.
+ /* pci.c had more complicated timeout code here. */
if (!cmd_status)
break;

@@ -1848,7 +1849,7 @@ static void acxmem_reset_mac(acx_device_t *adev)
int count;
FN_ENTER;

- // OW Bit setting done differently in pci.c
+ /* OW Bit setting done differently in pci.c */
/* halt eCPU */
set_regbits(adev, IO_ACX_ECPU_CTRL, 0x1);

@@ -2093,7 +2094,7 @@ int acx_verify_init(acx_device_t *adev)
FN_ENTER;

timeout = jiffies + 2 * HZ;
- // if-then differ primarily by irqstat size
+ /* if-then differ primarily by irqstat size */
if (IS_PCI(adev))
for (;;) {
u16 irqstat = read_reg16(adev,
@@ -2313,7 +2314,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
else
seq_printf(file, "%02u (%02x) empty%-10s", i, Ctl_8, rtl);

- //seq_printf(file, "\n");
+ /* seq_printf(file, "\n"); */

acxmem_copy_from_slavemem(adev, (u8 *) &rxd,
(u32) rxdesc, sizeof(rxd));
@@ -2379,7 +2380,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
(u32) & (txdesc->AcxMemPtr));
seq_printf(file, " %04x: ", tmp);

- // Output allocated tx-buffer chain
+ /* Output allocated tx-buffer chain */
#if 1
if (tmp) {
while ((tmp2 = read_slavemem32(adev,
@@ -2416,7 +2417,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
}

#if 1
- // Tx-buffer list dump
+ /* Tx-buffer list dump */
seq_printf(file, "\n");
seq_printf(file, "* Tx-buffer list dump\n");
seq_printf(file, "acx_txbuf_numblocks=%d, acx_txbuf_blocks_free=%d, \n"
@@ -2434,7 +2435,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
tmp += adev->memblocksize;
}
seq_printf(file, "\n");
- // ---
+ /* --- */
#endif

seq_printf(file, "\n"
@@ -2442,7 +2443,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
"irq_mask 0x%04x irq_status 0x%04x irq on acx 0x%04x\n"

"txbuf_start 0x%p, txbuf_area_size %u\n"
- // OW TODO Add also the acx tx_buf size available
+ /* OW TODO Add also the acx tx_buf size available */
"txdesc_size %u, txdesc_start 0x%p\n"
"txhostdesc_start 0x%p, txhostdesc_area_size %u\n"
"txbuf start 0x%04x, txbuf size %d\n"
@@ -2675,7 +2676,7 @@ txdesc_t* acxmem_get_txdesc(acx_device_t *adev, int index)
* after figuring out how many we need and whether we still have
* sufficiently many.
*/
- // OW TODO Align with pci.c
+ /* OW TODO Align with pci.c */
#if 1 // acxmem_alloc_tx()
tx_t *acxmem_alloc_tx(acx_device_t *adev, unsigned int len) {
struct txdesc *txdesc;
@@ -2765,8 +2766,9 @@ tx_t *acxmem_alloc_tx(acx_device_t *adev, unsigned int len) {
* ACX. In that case, HOSTOWN and ACXDONE will both be set.
*/

- // TODO OW Check if this is correct
- // TODO 20100115 Changed to DESC_CTL_ACXDONE_HOSTOWN like in pci.c
+ /* TODO OW Check if this is correct
+ * TODO 20100115 Changed to DESC_CTL_ACXDONE_HOSTOWN like in pci.c
+ */
if (unlikely(DESC_CTL_HOSTOWN != (ctl8 & DESC_CTL_ACXDONE_HOSTOWN))) {
/* whoops, descr at current index is not free, so probably
* ring buffer already full */
@@ -3022,7 +3024,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,
* txdesc is the address on the ACX
*/
txdesc_t *txdesc = (txdesc_t*) tx_opaque;
- // FIXME Cleanup?: struct ieee80211_hdr *wireless_header;
+ /* FIXME Cleanup?: struct ieee80211_hdr *wireless_header; */
txhostdesc_t *hostdesc1, *hostdesc2;
int rateset;
u8 Ctl_8, Ctl2_8;
@@ -3040,9 +3042,9 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,

hostdesc1 = acx_get_txhostdesc(adev, txdesc);

- // FIXME Cleanup?: wireless_header = (struct ieee80211_hdr *) hostdesc1->data;
+ /* FIXME Cleanup?: wireless_header = (struct ieee80211_hdr *) hostdesc1->data; */

- // wlhdr_len = ieee80211_hdrlen(le16_to_cpu(wireless_header->frame_control));
+ /* wlhdr_len = ieee80211_hdrlen(le16_to_cpu(wireless_header->frame_control)); */
wlhdr_len = WLAN_HDR_A3_LEN;

/* modify flag status in separate variable to be able to write
@@ -3072,7 +3074,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,
/* let chip do RTS/CTS handshaking before sending
* in case packet size exceeds threshold */

- // if (len > adev->rts_threshold)
+ /* if (len > adev->rts_threshold) */
if (info->flags & IEEE80211_TX_RC_USE_RTS_CTS)
SET_BIT(Ctl2_8, DESC_CTL2_RTS);
else
@@ -3081,7 +3083,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,
/* ACX111 */
if (IS_ACX111(adev)) {

- // Build rateset for acx111
+ /* Build rateset for acx111 */
rateset=acx111_tx_build_rateset(adev, txdesc, info);

/* note that if !txdesc->do_auto, txrate->cur has only
@@ -3106,7 +3108,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,
/* ACX100 */
else {

- // Get rate for acx100, single rate only for acx100
+ /* Get rate for acx100, single rate only for acx100 */
rateset = ieee80211_get_tx_rate(adev->ieee, info)->hw_value;
logf1(L_BUFT, "rateset=%u\n", rateset);

@@ -3170,7 +3172,7 @@ void _acx_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len,
* to its original value and back up our head
* pointer to point back to this entry.
*/
- // OW FIXME Logging
+ /* OW FIXME Logging */
pr_info("Bummer. Not enough room in the txbuf_space.\n");
hostdesc1->hd.length = 0;
hostdesc2->hd.length = 0;
@@ -3205,7 +3207,7 @@ is_pci_branch:
CLEAR_BIT(hostdesc2->hd.Ctl_16, cpu_to_le16(DESC_CTL_HOSTOWN));
}
/* write back modified flags */
- //At this point Ctl_8 should just be FIRSTFRAG
+ /* At this point Ctl_8 should just be FIRSTFRAG */
CLEAR_BIT(Ctl2_8, DESC_CTL2_WEP);
if (IS_MEM(adev)) {
write_slavemem8(adev, (ulong) &(txdesc->Ctl2_8), Ctl2_8);
@@ -3236,7 +3238,7 @@ is_pci_branch:

end_of_chain:

- // Debugging
+ /* Debugging */
if (unlikely(acx_debug & (L_XFER|L_DATA))) {
u16 fc = ((struct ieee80211_hdr *)
hostdesc1->data)->frame_control;
@@ -3280,7 +3282,7 @@ end_of_chain:
* txdescs. Everytime we get called we know where the next packet to
* be cleaned is.
*/
-// OW TODO Very similar with pci: possible merging.
+/* OW TODO Very similar with pci: possible merging. */
unsigned int acx_tx_clean_txdesc(acx_device_t *adev)
{
txdesc_t *txdesc;
@@ -3334,7 +3336,7 @@ unsigned int acx_tx_clean_txdesc(acx_device_t *adev)
? read_slavemem8(adev, (ulong) &(txdesc->Ctl_8))
: txdesc->Ctl_8;

- // OW FIXME Check against pci.c
+ /* OW FIXME Check against pci.c */
if ((Ctl_8 & DESC_CTL_ACXDONE_HOSTOWN)
!= DESC_CTL_ACXDONE_HOSTOWN) {
/* maybe remove if wrapper */
@@ -3353,7 +3355,7 @@ unsigned int acx_tx_clean_txdesc(acx_device_t *adev)
rts_failures = read_slavemem8(adev,
(ulong) &(txdesc->rts_failures));
rts_ok = read_slavemem8(adev, (ulong) &(txdesc->rts_ok));
- // OW FIXME does this also require le16_to_cpu()?
+ /* OW FIXME does this also require le16_to_cpu()? */
r100 = read_slavemem8(adev,
(ulong) &(txdesc->u.r1.rate));
r111 = le16_to_cpu(read_slavemem16(adev,
@@ -3363,11 +3365,11 @@ unsigned int acx_tx_clean_txdesc(acx_device_t *adev)
ack_failures = txdesc->ack_failures;
rts_failures = txdesc->rts_failures;
rts_ok = txdesc->rts_ok;
- // OW FIXME does this also require le16_to_cpu()?
+ /* OW FIXME does this also require le16_to_cpu()? */
r100 = txdesc->u.r1.rate;
r111 = le16_to_cpu(txdesc->u.r2.rate111);
}
- // mem.c gated this with ack_failures > 0, unimportant
+ /* mem.c gated this with ack_failures > 0, unimportant */
log(L_BUFT,
"acx: tx: cleaned %u: !ACK=%u !RTS=%u RTS=%u"
" r100=%u r111=%04X tx_free=%u\n",
@@ -3498,7 +3500,7 @@ void acx_clean_txdesc_emergency(acx_device_t *adev)
}

#if defined(CONFIG_ACX_MAC80211_MEM)
-// probly should move this back to merge.c
+/* probly should move this back to merge.c */
void acxmem_update_queue_indicator(acx_device_t *adev, int txqueue)
{
#ifdef USING_MORE_THAN_ONE_TRANSMIT_QUEUE
@@ -3562,7 +3564,7 @@ void acxmem_update_queue_indicator(acx_device_t *adev, int txqueue)
}
#endif // CONFIG_ACX_MAC80211_MEM) acxmem_update_queue_indicator()

-// OW TODO See if this is usable with mac80211
+/* OW TODO See if this is usable with mac80211 */
#if 0
/***********************************************************************
** acxmem_i_tx_timeout
@@ -3700,7 +3702,7 @@ void acx_irq_work(struct work_struct *work)
*/
acx_tx_clean_txdesc(adev);

- // Restart queue if stopped and enough tx-descr free
+ /* Restart queue if stopped and enough tx-descr free */
if ((adev->tx_free >= TX_START_QUEUE)
&& acx_queue_stopped(adev->ieee)) {
log(L_BUF,
@@ -3756,7 +3758,7 @@ void acx_irq_work(struct work_struct *work)
* update_link_quality_led(adev);
*/

- // Renable irq-signal again for irqs we are interested in
+ /* Renable irq-signal again for irqs we are interested in */
write_reg16(adev, IO_ACX_IRQ_MASK, adev->irq_mask);
write_flush(adev);

@@ -3871,8 +3873,9 @@ void acx_set_interrupt_mask(acx_device_t *adev)
FN_EXIT0;
}

-// OW FIXME Old interrupt handler
-// ---
+/* OW FIXME Old interrupt handler
+ * ---
+ */
#if 0
static irqreturn_t acxmem_interrupt(int irq, void *dev_id)
{
@@ -3932,9 +3935,10 @@ static irqreturn_t acxmem_interrupt(int irq, void *dev_id)

/* Handle most important IRQ types first */

- // OW 20091123 FIXME Rx path stops under load problem:
- // Maybe the RX rings fills up to fast, we are missing an irq and
- // then we are then not getting rx irqs anymore
+ /* OW 20091123 FIXME Rx path stops under load problem:
+ * Maybe the RX rings fills up to fast, we are missing an irq and
+ * then we are then not getting rx irqs anymore
+ */
if (irqtype & HOST_INT_RX_DATA) {
log(L_IRQ, "got Rx_Data IRQ\n");
acx_process_rxdesc(adev);
@@ -4021,15 +4025,16 @@ static irqreturn_t acxmem_interrupt(int irq, void *dev_id)
}
#endif

- // OW 20091129 TODO Currently breaks mem.c ...
- // If sleeping is required like for update card settings, this is usefull
- // For now I replaced sleeping for command handling by mdelays.
-// if (adev->after_interrupt_jobs){
-// acx_e_after_interrupt_task(adev);
-// }
+ /* OW 20091129 TODO Currently breaks mem.c ...
+ * If sleeping is required like for update card settings, this is usefull
+ * For now I replaced sleeping for command handling by mdelays.
+ * if (adev->after_interrupt_jobs){
+ * acx_e_after_interrupt_task(adev);
+ * }
+ */


-// OW TODO
+/* OW TODO */
#if 0
/* Routine to perform blink with range */
if (unlikely(adev->led_power == 2))
@@ -4048,7 +4053,7 @@ static irqreturn_t acxmem_interrupt(int irq, void *dev_id)
return IRQ_NONE;
}
#endif
-// ---
+/* --- */


/*
@@ -4149,7 +4154,7 @@ void acxmem_power_led(acx_device_t *adev, int enable) {
}
#endif

-// identical
+/* identical */
INLINE_IO int acxmem_adev_present(acx_device_t *adev)
{
/* fast version (accesses the first register, IO_ACX_SOFT_RESET,
@@ -4157,7 +4162,7 @@ INLINE_IO int acxmem_adev_present(acx_device_t *adev)
return acx_readl(adev->iobase) != 0xffffffff;
}

-// OW TODO
+/* OW TODO */
#if 0
static void update_link_quality_led(acx_device_t *adev) {
int qual;
@@ -4182,7 +4187,7 @@ static void update_link_quality_led(acx_device_t *adev) {
* ==================================================
*/

-// OW TODO Not used in pci either !?
+/* OW TODO Not used in pci either !? */
#if 0
int acx111pci_ioctl_info(struct ieee80211_hw *hw, struct iw_request_info *info,
struct iw_param *vwrq, char *extra) {
@@ -4473,7 +4478,7 @@ int acx111pci_ioctl_info(struct ieee80211_hw *hw, struct iw_request_info *info,
int acx100mem_ioctl_set_phy_amp_bias(struct ieee80211_hw *hw,
struct iw_request_info *info,
struct iw_param *vwrq, char *extra) {
- // OW
+ /* OW */
acx_device_t *adev = ieee2adev(hw);
unsigned long flags;
u16 gpio_old;
@@ -4516,7 +4521,7 @@ int acx100mem_ioctl_set_phy_amp_bias(struct ieee80211_hw *hw,

void acx_delete_dma_regions(acx_device_t *adev)
{
- // unsigned long flags; // see comment below
+ /* unsigned long flags; /* see comment below */

FN_ENTER;
/* disable radio Tx/Rx. Shouldn't we use the firmware commands
@@ -4593,7 +4598,7 @@ static int __devinit acxmem_probe(struct platform_device *pdev) {
ieee->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION)
| BIT(NL80211_IFTYPE_ADHOC);
ieee->queues = 1;
- // OW TODO Check if RTS/CTS threshold can be included here
+ /* OW TODO Check if RTS/CTS threshold can be included here */

/* TODO: although in the original driver the maximum value was
* 100, the OpenBSD driver assigns maximum values depending on
@@ -4614,8 +4619,9 @@ static int __devinit acxmem_probe(struct platform_device *pdev) {
* now, as they do not seem to be supported or how to acquire
* them is still unknown. */

- // We base signal quality on winlevel approach of previous driver
- // TODO OW 20100615 This should into a common init code
+ /* We base signal quality on winlevel approach of previous driver
+ * TODO OW 20100615 This should into a common init code
+ */
ieee->flags |= IEEE80211_HW_SIGNAL_UNSPEC;
ieee->max_signal = 100;

@@ -4708,7 +4714,7 @@ static int __devinit acxmem_probe(struct platform_device *pdev) {
irq_set_irq_type(adev->irq, IRQF_TRIGGER_FALLING);
#endif
log(L_ANY, "request_irq %d successful\n", adev->irq);
- // Acx irqs shall be off and are enabled later in acxpci_s_up
+ /* Acx irqs shall be off and are enabled later in acxpci_s_up */
acxmem_lock();
acxmem_irq_disable(adev);
acxmem_unlock();
@@ -4720,15 +4726,15 @@ static int __devinit acxmem_probe(struct platform_device *pdev) {
acx_show_card_eeprom_id(adev);

/* Device setup is finished, now start initializing the card */
- // ---
+ /* --- */

acx_init_task_scheduler(adev);

- // Mac80211 Tx_queue
+ /* Mac80211 Tx_queue */
INIT_WORK(&adev->tx_work, acx_tx_work);
skb_queue_head_init(&adev->tx_queue);

- // OK init parts from pci.c are done in acxmem_complete_hw_reset(adev)
+ /* OK init parts from pci.c are done in acxmem_complete_hw_reset(adev) */
if (OK != acxmem_complete_hw_reset(adev))
goto fail_complete_hw_reset;

@@ -4749,8 +4755,9 @@ static int __devinit acxmem_probe(struct platform_device *pdev) {
* to send packets even though we're not associated to a
* network yet */

-// OW FIXME Check if acx_stop_queue, acx_carrier_off should be included
-// OW Rest can be cleaned up
+/* OW FIXME Check if acx_stop_queue, acx_carrier_off should be included
+ * OW Rest can be cleaned up
+ */
#if 0
acx_stop_queue(ndev, "on probe");
acx_carrier_off(ndev, "on probe");
@@ -4766,7 +4773,7 @@ static int __devinit acxmem_probe(struct platform_device *pdev) {

/* need to be able to restore PCI state after a suspend */
#ifdef CONFIG_PM
- // pci_save_state(pdev);
+ /* pci_save_state(pdev); */
#endif

err = acx_setup_modes(adev);
@@ -4844,7 +4851,7 @@ static int __devexit acxmem_remove(struct platform_device *pdev)
goto end_no_lock;
}

- // Unregister ieee80211 device
+ /* Unregister ieee80211 device */
log(L_INIT, "removing device %s\n", wiphy_name(adev->ieee->wiphy));
ieee80211_unregister_hw(adev->ieee);
CLEAR_BIT(adev->dev_state_mask, ACX_STATE_IFACE_UP);
@@ -4890,10 +4897,10 @@ static int __devexit acxmem_remove(struct platform_device *pdev)
acxmem_unlock();
}

- // Proc
+ /* Proc */
acx_proc_unregister_entries(adev->ieee);

- // IRQs
+ /* IRQs */
acxmem_lock();
acxmem_irq_disable(adev);
acxmem_unlock();
@@ -4958,8 +4965,9 @@ acxmem_e_suspend(struct platform_device *pdev, pm_message_t state)
/*
* Turn the ACX chip off.
*/
- // This should be done by the corresponding platform module, e.g. hx4700_acx.c
- // hwdata->stop_hw();
+ /* This should be done by the corresponding platform module, e.g. hx4700_acx.c
+ * hwdata->stop_hw();
+ */

acx_sem_unlock(adev);

diff --git a/pci.c b/pci.c
index 001c056..484e90c 100644
--- a/pci.c
+++ b/pci.c
@@ -80,8 +80,9 @@ static void vlynq_remove(struct vlynq_device *vdev);
* ==================================================
*/

-// PCI
-// -----
+/* PCI
+ * -----
+ */
#ifdef CONFIG_PCI
#define PCI_TYPE (PCI_USES_MEM | PCI_ADDR0 | PCI_NO_ACPI_WAKE)
#define PCI_ACX100_REGION1 0x01
@@ -132,7 +133,7 @@ static void vlynq_remove(struct vlynq_device *vdev);

#include "pci-inlines.h"

-// -----
+/* ----- */

/*
* acxpci_s_create_rx_host_desc_queue
@@ -142,7 +143,7 @@ static void vlynq_remove(struct vlynq_device *vdev);
*/


-// static inline
+/* static inline */
void acxpci_free_coherent(struct pci_dev *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
@@ -248,7 +249,7 @@ end:
}
#endif /* UNUSED */

-//static
+/* static */
inline void acxpci_read_eeprom_area(acx_device_t * adev)
{
#if ACX_DEBUG > 1
@@ -272,7 +273,7 @@ inline void acxpci_read_eeprom_area(acx_device_t * adev)
*
* Origin: Derived from FW dissection
*/
-// static
+/* static */
int acxpci_upload_fw(acx_device_t *adev)
{
firmware_image_t *fw_image = NULL;
@@ -478,7 +479,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
break;

if (counter % 8 == 0) {
- // Timeout
+ /* Timeout */
if (time_after(jiffies, timeout)) {
counter = -1;
break;
@@ -554,7 +555,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
buffer ? le16_to_cpu(((acx_ie_generic_t *) buffer)->type) : -1,
acx_cmd_status_str(cmd_status)
);
- // dump_stack();
+ /* dump_stack(); */
FN_EXIT1(NOT_OK);

return NOT_OK;
@@ -575,7 +576,7 @@ acxpci_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
*
* Origin: Standard Read/Write to IO
*/
-//static
+/* static */
void acxpci_reset_mac(acx_device_t * adev)
{
u16 temp;
@@ -749,7 +750,7 @@ tx_t* acxpci_alloc_tx(acx_device_t * adev)
/* 2005-10-11: there were several bug reports on this
* happening but now cause seems to be understood & fixed */

- // TODO OW Check if this is correct
+ /* TODO OW Check if this is correct */
if (unlikely(DESC_CTL_HOSTOWN != (ctl8 & DESC_CTL_ACXDONE_HOSTOWN))) {
/* whoops, descr at current index is not free, so
* probably ring buffer already full */
@@ -1291,7 +1292,7 @@ static const u16 IO_ACX111[] = {
};

#ifdef CONFIG_PCI
-// static
+/* static */
int __devinit
acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
@@ -1334,7 +1335,7 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_AP);
ieee->queues = 1;
- // OW TODO Check if RTS/CTS threshold can be included here
+ /* OW TODO Check if RTS/CTS threshold can be included here */

/* TODO: although in the original driver the maximum value was
* 100, the OpenBSD driver assigns maximum values depending on
@@ -1355,8 +1356,9 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
* now, as they do not seem to be supported or how to acquire
* them is still unknown. */

- // We base signal quality on winlevel approach of previous driver
- // TODO OW 20100615 This should into a common init code
+ /* We base signal quality on winlevel approach of previous driver
+ * TODO OW 20100615 This should into a common init code
+ */
ieee->flags |= IEEE80211_HW_SIGNAL_UNSPEC;
ieee->max_signal = 100;

@@ -1488,7 +1490,7 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
}
log(L_IRQ | L_INIT, "using IRQ %d: OK\n", pdev->irq);

- // Acx irqs shall be off and are enabled later in acxpci_s_up
+ /* Acx irqs shall be off and are enabled later in acxpci_s_up */
acx_irq_disable(adev);

/* to find crashes due to weird driver access
@@ -1502,11 +1504,11 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id)


/* PCI setup is finished, now start initializing the card */
- // -----
+ /* ----- */

acx_init_task_scheduler(adev);

- // Mac80211 Tx_queue
+ /* Mac80211 Tx_queue */
INIT_WORK(&adev->tx_work, acx_tx_work);
skb_queue_head_init(&adev->tx_queue);

@@ -1581,65 +1583,66 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id)

/* error paths: undo everything in reverse order... */

- // TODO FIXME OW 20100507
- // Check if reverse doing is correct. e.g. if alloc failed, no dealloc is required !!
- // => See vlynq probe
+ /* TODO FIXME OW 20100507
+ * Check if reverse doing is correct. e.g. if alloc failed, no dealloc is required !!
+ * => See vlynq probe
+ */

- // err = ieee80211_register_hw(ieee);
+ /* err = ieee80211_register_hw(ieee); */
fail_ieee80211_register_hw:
ieee80211_unregister_hw(ieee);

- // err = acx_setup_modes(adev)
+ /* err = acx_setup_modes(adev) */
fail_setup_modes:

- // acx_proc_register_entries(ieee, 0)
+ /* acx_proc_register_entries(ieee, 0) */
fail_proc_register_entries:
acx_proc_unregister_entries(ieee);

- // acxpci_read_eeprom_byte(adev, 0x05, &adev->eeprom_version)
+ /* acxpci_read_eeprom_byte(adev, 0x05, &adev->eeprom_version) */
fail_read_eeprom_byte:

- // acx_s_init_mac(adev)
+ /* acx_s_init_mac(adev) */
fail_init_mac:

- // acxpci_s_reset_dev(adev)
+ /* acxpci_s_reset_dev(adev) */
fail_reset_dev:

- // request_irq(adev->irq, acxpci_i_interrupt, IRQF_SHARED, KBUILD_MODNAME,
+ /* request_irq(adev->irq, acxpci_i_interrupt, IRQF_SHARED, KBUILD_MODNAME, */
fail_request_irq:
free_irq(adev->irq, adev);

fail_no_irq:

- // pci_iomap(pdev, mem_region2, 0)
+ /* pci_iomap(pdev, mem_region2, 0) */
fail_iomap2:
pci_iounmap(pdev, mem2);

- // pci_iomap(pdev, mem_region1, 0)
+ /* pci_iomap(pdev, mem_region1, 0) */
fail_iomap1:
pci_iounmap(pdev, mem1);

- // err = pci_request_region(pdev, mem_region2, "acx_2");
+ /* err = pci_request_region(pdev, mem_region2, "acx_2"); */
fail_request_mem_region2:
pci_release_region(pdev, mem_region2);

- // err = pci_request_region(pdev, mem_region1, "acx_1");
+ /* err = pci_request_region(pdev, mem_region1, "acx_1"); */
fail_request_mem_region1:
pci_release_region(pdev, mem_region1);

fail_unknown_chiptype:

- // pci_enable_device(pdev)
+ /* pci_enable_device(pdev) */
fail_pci_enable_device:
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);

- // OW TODO Check if OK for PM
+ /* OW TODO Check if OK for PM */
#ifdef CONFIG_PM
pci_set_power_state(pdev, PCI_D3hot);
#endif

- // ieee80211_alloc_hw
+ /* ieee80211_alloc_hw */
fail_ieee80211_alloc_hw:
ieee80211_free_hw(ieee);

@@ -1657,7 +1660,7 @@ acxpci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
*
* pdev - ptr to PCI device structure containing info about pci configuration
*/
-// static
+/* static */
void __devexit acxpci_remove(struct pci_dev *pdev)
{
struct ieee80211_hw *hw = (struct ieee80211_hw *)pci_get_drvdata(pdev);
@@ -1672,7 +1675,7 @@ void __devexit acxpci_remove(struct pci_dev *pdev)
goto end_no_lock;
}

- // Unregister ieee80211 device
+ /* Unregister ieee80211 device */
log(L_INIT, "removing device %s\n", wiphy_name(adev->ieee->wiphy));
ieee80211_unregister_hw(adev->ieee);
CLEAR_BIT(adev->dev_state_mask, ACX_STATE_IFACE_UP);
@@ -1712,15 +1715,15 @@ void __devexit acxpci_remove(struct pci_dev *pdev)

}

- // Proc
+ /* Proc */
acx_proc_unregister_entries(adev->ieee);

- // IRQs
+ /* IRQs */
acx_irq_disable(adev);
synchronize_irq(adev->irq);
free_irq(adev->irq, adev);

- // Mem regions
+ /* Mem regions */
if (IS_ACX100(adev)) {
mem_region1 = PCI_ACX100_REGION1;
mem_region2 = PCI_ACX100_REGION2;
@@ -1763,7 +1766,7 @@ void __devexit acxpci_remove(struct pci_dev *pdev)
** TODO: PM code needs to be fixed / debugged / tested.
*/
#ifdef CONFIG_PM
-// static
+/* static */
int acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
@@ -1782,7 +1785,7 @@ int acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state)
acx_sem_lock(adev);

ieee80211_unregister_hw(hw); /* this one cannot sleep */
- // OW 20100603 FIXME acxpci_s_down(hw);
+ /* OW 20100603 FIXME acxpci_s_down(hw); */
/* down() does not set it to 0xffff, but here we really want that */
write_reg16(adev, IO_ACX_IRQ_MASK, 0xffff);
write_reg16(adev, IO_ACX_FEMR, 0x0);
@@ -1795,7 +1798,7 @@ int acxpci_e_suspend(struct pci_dev *pdev, pm_message_t state)
return OK;
}

-//static
+/* static */
int acxpci_e_resume(struct pci_dev *pdev)
{
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
@@ -1832,7 +1835,7 @@ int acxpci_e_resume(struct pci_dev *pdev)
* :-) */
if (ACX_STATE_IFACE_UP & adev->dev_state_mask) {
adev->set_mask = GETSET_ALL;
- //acx_update_card_settings(adev);
+ /* acx_update_card_settings(adev); */
pr_acx("rsm: settings updated\n");
}
ieee80211_register_hw(hw);
@@ -1885,15 +1888,16 @@ static struct pci_driver acxpci_driver = {
.resume = acxpci_e_resume
#endif /* CONFIG_PM */
};
-//#else
-//#error "compiled pci.c w/o CONFIG_PCI !!"
+/* #else
+ * #error "compiled pci.c w/o CONFIG_PCI !!"
+ */
#endif /* CONFIG_PCI */


/*
* VLYNQ support
*/
-// TODO Check section mismatch warning vlynq
+/* TODO Check section mismatch warning vlynq */

#ifdef CONFIG_VLYNQ
struct vlynq_reg_config {
@@ -1969,8 +1973,9 @@ static struct vlynq_known vlynq_known_devices[] = {

static struct vlynq_device_id acx_vlynq_id[] = {
{ CHIP_TNETW1130, vlynq_div_auto, 0 },
- // TNETW1350 not supported by the acx driver, therefore don't claim it anymore
- // { CHIP_TNETW1350, vlynq_div_auto, 1 },
+ /* TNETW1350 not supported by the acx driver, therefore don't claim it anymore
+ * { CHIP_TNETW1350, vlynq_div_auto, 1 },
+ */
{ 0, 0, 0 },
};

@@ -1995,7 +2000,7 @@ static __devinit int vlynq_probe(struct vlynq_device *vdev,
goto fail_vlynq_ieee80211_alloc_hw;
}

- // Initialize driver private data
+ /* Initialize driver private data */
SET_IEEE80211_DEV(ieee, &vdev->dev);
ieee->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;

@@ -2005,8 +2010,9 @@ static __devinit int vlynq_probe(struct vlynq_device *vdev,
BIT(NL80211_IFTYPE_AP);
ieee->queues = 1;

- // We base signal quality on winlevel approach of previous driver
- // TODO OW 20100615 This should into a common init code
+ /* We base signal quality on winlevel approach of previous driver
+ * TODO OW 20100615 This should into a common init code
+ */
ieee->flags |= IEEE80211_HW_SIGNAL_UNSPEC;
ieee->max_signal = 100;

@@ -2026,9 +2032,9 @@ static __devinit int vlynq_probe(struct vlynq_device *vdev,
adev->bus_dev = &vdev->dev;
adev->dev_type = DEVTYPE_PCI;

- // Finished with private interface
+ /* Finished with private interface */

- // Begin board specific inits
+ /* Begin board specific inits */
result = vlynq_enable_device(vdev);
if (result)
goto fail_vlynq_enable_device;
@@ -2103,7 +2109,7 @@ static __devinit int vlynq_probe(struct vlynq_device *vdev,
}
log(L_IRQ | L_INIT, "using IRQ %d\n", adev->irq);

- // Acx irqs shall be off and are enabled later in acxpci_s_up
+ /* Acx irqs shall be off and are enabled later in acxpci_s_up */
acx_irq_disable(adev);

/* to find crashes due to weird driver access
@@ -2111,11 +2117,11 @@ static __devinit int vlynq_probe(struct vlynq_device *vdev,
adev->mgmt_timer.function = (void (*)(unsigned long))0x0000dead;

/* PCI setup is finished, now start initializing the card */
- // -----
+ /* ----- */

acx_init_task_scheduler(adev);

- // Mac80211 Tx_queue
+ /* Mac80211 Tx_queue */
INIT_WORK(&adev->tx_work, acx_tx_work);
skb_queue_head_init(&adev->tx_queue);

@@ -2234,7 +2240,7 @@ static void vlynq_remove(struct vlynq_device *vdev)
}


- // Unregister ieee80211 device
+ /* Unregister ieee80211 device */
log(L_INIT, "removing device %s\n", wiphy_name(adev->ieee->wiphy));
ieee80211_unregister_hw(adev->ieee);
CLEAR_BIT(adev->dev_state_mask, ACX_STATE_IFACE_UP);
@@ -2253,13 +2259,13 @@ static void vlynq_remove(struct vlynq_device *vdev)
acxpci_power_led(adev, 0);

/* stop our eCPU */
- // OW PCI still does something here (although also need to be reviewed).
+ /* OW PCI still does something here (although also need to be reviewed). */
}

- // Proc
+ /* Proc */
acx_proc_unregister_entries(adev->ieee);

- // IRQs
+ /* IRQs */
acx_irq_disable(adev);
synchronize_irq(adev->irq);
free_irq(adev->irq, adev);
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:52 UTC
Permalink
With this patch, debugfs.c works for reads.

debugfs files are created under $DBGMNT/acx_mac80211/phyX by
acx_debugfs_add_adev(), where phyX is the vif of each wlanY ifupd on
the driver. The acx_device *ptr is attached to the phyX directory.
acx_debugfs_add_adev() is called by acx_op_add_interface(); this may be
the wrong lifecyle, but is close, and works for now. Each file gets a
file_index, attached by debugfs_create_file() to the inode's private
data.

A single open() handler uses the attached file_index to select the
right read callback, this avoids a linear scan of filenames to
match/strcmp against the callback. The acx_device *ptr is retrieved
from the file's parent's private data, and passed to the callback so
it knows what vif to print data for.

In common.c, drop static from acx_proc_show_funcs[], and declare it
extern in debugfs.c; this is used in acx_debugfs_open() to dispatch to
the right _show_ function. The array serves to "export" the functions
without fussing with fn-protos.

In acx_struct_dev.h: add a dentry *debugfs_dir to acx_device_t;
acx_op_add_interface() saves the acx_device specific dir here, so that
on ifdown, acx_op_remove_interface() can clean it up.

For non debugfs configs, stubs are provide for the 4 functions. These
are at the top of the file, to also serve as API documentation.

TBC: Add debugfs.h to contain the internal API: init/exit and
add/remove functions, and externed array(s). Maybe rename the
acx_proc_(show|write)_*() functions, and relocate them to debugfs.c

Signed-off-by: Jim Cromie <***@gmail.com>
---
Makefile | 2 +-
acx_struct_dev.h | 2 +-
common.c | 15 +++++-
debugfs.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 167 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index e979c28..dee4cd7 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ ifneq ($(KERNELRELEASE),)
acx-mac80211-obj-$(CONFIG_ACX_MAC80211_PCI) += pci.o
acx-mac80211-obj-$(CONFIG_ACX_MAC80211_USB) += usb.o
acx-mac80211-obj-$(CONFIG_ACX_MAC80211_MEM) += mem.o
- acx-mac80211-objs := common.o $(acx-mac80211-obj-y) $(acx-mac80211-obj-m) merge.o
+ acx-mac80211-objs := common.o $(acx-mac80211-obj-y) $(acx-mac80211-obj-m) merge.o debugfs.o

else
# Otherwise we were called directly from the command line: the kernel build
diff --git a/acx_struct_dev.h b/acx_struct_dev.h
index 4e96389..f6ab6ba 100644
--- a/acx_struct_dev.h
+++ b/acx_struct_dev.h
@@ -532,7 +532,7 @@ struct acx_device {
int bulkoutep; /* bulk-out endpoint */
int rxtruncsize;
#endif
-
+ struct dentry *debugfs_dir;
};
/* --- */

diff --git a/common.c b/common.c
index db14e23..5e3f77b 100644
--- a/common.c
+++ b/common.c
@@ -682,7 +682,7 @@ static const char *const proc_files[] = {
typedef int acx_proc_show_t(struct seq_file *file, void *v);
typedef ssize_t (acx_proc_write_t)(struct file *, const char __user *, size_t, loff_t *);

-static acx_proc_show_t *const acx_proc_show_funcs[] = {
+acx_proc_show_t *const acx_proc_show_funcs[] = {
acx_proc_show_acx,
acx_proc_show_diag,
acx_proc_show_eeprom,
@@ -6172,6 +6172,8 @@ end:
* BOM Mac80211 Ops
* ==================================================
*/
+int acx_debugfs_add_adev(struct acx_device *adev);
+void acx_debugfs_remove_adev(struct acx_device *adev);

#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
int acx_op_add_interface(struct ieee80211_hw *ieee,
@@ -6254,6 +6256,7 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,
}

acx_update_mode(adev);
+ acx_debugfs_add_adev(adev);

pr_info("Virtual interface added (type: 0x%08X, MAC: %s)\n",
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
@@ -6285,6 +6288,7 @@ void acx_op_remove_interface(struct ieee80211_hw *hw,

FN_ENTER;
acx_sem_lock(adev);
+ acx_debugfs_remove_adev(adev);

#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
if (conf->type == NL80211_IFTYPE_MONITOR)
@@ -6833,6 +6837,8 @@ void great_inquisitor(acx_device_t * adev)
* BOM Driver, Module
* ==================================================
*/
+int __init acx_debugfs_init(void);
+void __init acx_debugfs_exit(void);

static int __init acx_init_module(void)
{
@@ -6876,12 +6882,17 @@ static int __init acx_init_module(void)
}

acx_proc_init();
- return 0; // at least one succeeded
+ acx_debugfs_init();
+
+ /* return success if at least one succeeded */
+ return 0;
}

+void acx_debugfs_exit(void);
static void __exit acx_cleanup_module(void)
{
/* TODO Check, that interface isn't still up */
+ acx_debugfs_exit();

#if defined(CONFIG_ACX_MAC80211_PCI)
acxpci_cleanup_module();
diff --git a/debugfs.c b/debugfs.c
new file mode 100644
index 0000000..45572a3
--- /dev/null
+++ b/debugfs.c
@@ -0,0 +1,152 @@
+
+#ifndef CONFIG_PROC_FS
+
+/* API: not static inline - must be available for linking */
+int __init acx_debugfs_init(void) { return 0; }
+void __exit acx_debugfs_exit(void) {}
+int acx_debugfs_add_adev (struct acx_device *adev) { return 0; }
+void acx_debugfs_remove_adev(struct acx_device *adev) { return 0; }
+
+#else /* CONFIG_PROC_FS */
+
+#define pr_fmt(fmt) "acx.%s: " fmt, __func__
+
+#include <linux/version.h>
+#include <linux/wireless.h>
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+#include <net/mac80211.h>
+#include "acx.h"
+
+struct acx_device;
+typedef int acx_proc_show_t(struct seq_file *file, void *v);
+extern acx_proc_show_t *const acx_proc_show_funcs[];
+
+/*
+ * debugfs files are created under $DBGMNT/acx_mac80211/phyX by
+ * acx_debugfs_add_dev(), where phyX is the vif of each wlanY ifupd on
+ * the driver. The acx_device *ptr is attached to the phyX directory.
+ * acx_debugfs_add_dev() is called by acx_op_add_interface(); this
+ * may be the wrong lifecyle, but is close, and works for now.
+ * Each file gets a file_index, attached by debugfs_create_file() to
+ * the inode's private data.
+ *
+ * A single open() handler uses the attached file_index to select the
+ * right read callback, this avoids a linear scan of filenames to
+ * match/strcmp against the callback. The acx_device *ptr is
+ * retrieved from the file's parent's private data, and passed to the
+ * callback so it knows what vif to print data for.
+ */
+
+enum file_index {
+ INFO, DIAG, EEPROM, PHY, DEBUG,
+ SENSITIVITY, TX_LEVEL, ANTENNA, REG_DOMAIN,
+};
+static const char *const dbgfs_files[] = {
+ [INFO] = "info",
+ [DIAG] = "diag",
+ [EEPROM] = "eeprom",
+ [PHY] = "phy",
+ [DEBUG] = "debug",
+ [SENSITIVITY] = "sensitivity",
+ [TX_LEVEL] = "tx_level",
+ [ANTENNA] = "antenna",
+ [REG_DOMAIN] = "reg_domain",
+};
+
+static int acx_dbgfs_open(struct inode *inode, struct file *file)
+{
+ int fidx = (int) inode->i_private;
+ struct acx_device *adev = (struct acx_device *)
+ file->f_path.dentry->d_parent->d_inode->i_private;
+
+ switch (fidx) {
+ case INFO:
+ case DIAG:
+ case EEPROM:
+ case PHY:
+ case DEBUG:
+ case SENSITIVITY:
+ case TX_LEVEL:
+ case ANTENNA:
+ case REG_DOMAIN:
+ pr_info("opening filename=%s fmode=%o fidx=%d adev=%p\n",
+ dbgfs_files[fidx], file->f_mode, fidx, adev);
+ break;
+ default:
+ pr_err("unknown file @ %d: %s\n", fidx,
+ file->f_path.dentry->d_name.name);
+ return -ENOENT;
+ }
+ return single_open(file, acx_proc_show_funcs[fidx], adev);
+}
+
+const struct file_operations acx_fops = {
+ .read = seq_read,
+ //.write = default_write_file,
+ .open = acx_dbgfs_open,
+ .llseek = noop_llseek,
+};
+
+static struct dentry *acx_dbgfs_dir;
+
+int acx_debugfs_add_adev(struct acx_device *adev)
+{
+ int i;
+ fmode_t fmode;
+ struct dentry *file;
+ const char *devname = wiphy_name(adev->ieee->wiphy);
+ struct dentry *acx_dbgfs_devdir
+ = debugfs_create_dir(devname, acx_dbgfs_dir);
+
+ if (!acx_dbgfs_devdir) {
+ pr_err("debugfs_create_dir() failed\n");
+ return -ENOMEM;
+ }
+ pr_info("adev:%p nm:%s dirp:%p\n", adev, devname, acx_dbgfs_devdir);
+
+ if (acx_dbgfs_devdir->d_inode->i_private) {
+ /* this shouldnt happen */
+ pr_err("dentry->d_inode->i_private already set: %p\n",
+ acx_dbgfs_devdir->d_inode->i_private);
+ goto fail;
+ }
+ acx_dbgfs_devdir->d_inode->i_private = (void*) adev;
+
+ for (i = 0; i < ARRAY_SIZE(dbgfs_files); i++) {
+
+ fmode = 0644;
+ file = debugfs_create_file(dbgfs_files[i], fmode, acx_dbgfs_devdir,
+ (void*) i, &acx_fops);
+ if (!file)
+ goto fail;
+ }
+ adev->debugfs_dir = acx_dbgfs_devdir;
+ return 0;
+fail:
+ debugfs_remove_recursive(acx_dbgfs_devdir);
+ return -ENOENT;
+}
+
+void acx_debugfs_remove_adev(struct acx_device *adev)
+{
+ debugfs_remove_recursive(adev->debugfs_dir);
+ pr_info("%s %p\n", wiphy_name(adev->ieee->wiphy), adev->debugfs_dir);
+ adev->debugfs_dir = NULL;
+}
+
+int __init acx_debugfs_init(void)
+{
+ acx_dbgfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
+ if (!acx_dbgfs_dir)
+ return -ENOMEM;
+
+ return 0;
+}
+
+void __exit acx_debugfs_exit(void)
+{
+ debugfs_remove_recursive(acx_dbgfs_dir);
+}
+
+#endif /* CONFIG_PROC_FS */
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:53 UTC
Permalink
Add single write handler: acx_debugfs_write(), which dispatches to
acx_proc_write_*() the same way acx_debugfs_open() does for the read
side; the only difference is that file-index is obtained from the
struct file instead of inode (which is unavailable).

The only thing missing is lifecycle fixes (based upon
acx_proc_register_entries), and #if0ing proc-fs interface code.

Signed-off-by: Jim Cromie <***@gmail.com>
---
common.c | 3 +--
debugfs.c | 38 +++++++++++++++++++++++++++++++++++---
2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/common.c b/common.c
index 5e3f77b..b8022e9 100644
--- a/common.c
+++ b/common.c
@@ -696,8 +696,7 @@ acx_proc_show_t *const acx_proc_show_funcs[] = {
BUILD_BUG_DECL(proc_files__VS__acx_proc_show_funcs,
ARRAY_SIZE(proc_files) != ARRAY_SIZE(acx_proc_show_funcs));

-static acx_proc_write_t *const
- acx_proc_write_funcs[] = {
+acx_proc_write_t *const acx_proc_write_funcs[] = {
NULL,
acx_proc_write_diag,
NULL,
diff --git a/debugfs.c b/debugfs.c
index 45572a3..79a6fd5 100644
--- a/debugfs.c
+++ b/debugfs.c
@@ -18,9 +18,12 @@ void acx_debugfs_remove_adev(struct acx_device *adev) { return 0; }
#include <net/mac80211.h>
#include "acx.h"

-struct acx_device;
typedef int acx_proc_show_t(struct seq_file *file, void *v);
+typedef ssize_t (acx_proc_write_t)(struct file *, const char __user *,
+ size_t, loff_t *);
+
extern acx_proc_show_t *const acx_proc_show_funcs[];
+extern acx_proc_write_t *const acx_proc_write_funcs[];

/*
* debugfs files are created under $DBGMNT/acx_mac80211/phyX by
@@ -81,9 +84,37 @@ static int acx_dbgfs_open(struct inode *inode, struct file *file)
return single_open(file, acx_proc_show_funcs[fidx], adev);
}

+static int acx_dbgfs_write(struct file *file, const char __user *buf,
+ size_t count, loff_t *ppos)
+{
+ int fidx = (int) file->f_path.dentry->d_inode->i_private;
+ struct acx_device *adev = (struct acx_device *)
+ file->f_path.dentry->d_parent->d_inode->i_private;
+
+ switch (fidx) {
+ case INFO:
+ case DIAG:
+ case EEPROM:
+ case PHY:
+ case DEBUG:
+ case SENSITIVITY:
+ case TX_LEVEL:
+ case ANTENNA:
+ case REG_DOMAIN:
+ pr_info("opening filename=%s fmode=%o fidx=%d adev=%p\n",
+ dbgfs_files[fidx], file->f_mode, fidx, adev);
+ break;
+ default:
+ pr_err("unknown file @ %d: %s\n", fidx,
+ file->f_path.dentry->d_name.name);
+ return -ENOENT;
+ }
+ return (acx_proc_write_funcs[fidx])(file, buf, count, ppos);
+}
+
const struct file_operations acx_fops = {
.read = seq_read,
- //.write = default_write_file,
+ .write = acx_dbgfs_write,
.open = acx_dbgfs_open,
.llseek = noop_llseek,
};
@@ -115,7 +146,8 @@ int acx_debugfs_add_adev(struct acx_device *adev)

for (i = 0; i < ARRAY_SIZE(dbgfs_files); i++) {

- fmode = 0644;
+ fmode = (acx_proc_write_funcs[i])
+ ? 0644 : 0444;
file = debugfs_create_file(dbgfs_files[i], fmode, acx_dbgfs_devdir,
(void*) i, &acx_fops);
if (!file)
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:54 UTC
Permalink
debugfs.c:
- add compatibility versions of acx_proc_(un)?register_entries() which
call acx_debugfs_(add|remove)_adev()
- change #ifdef CONFIG_PROC_FS to CONFIG_DEBUG_FS

common.c:
- comment out acx_proc_* fn-protos (maybe should be ifdefd)
- hide acx_e_proc_ops[] in #ifndef CONFIG_DEBUG_FS, to fix unused warning
- #if0 procfs interface code

I was mildly surprised that this commit worked; acx_debugfs_add_adev()
is now called from both op_add_interface() and indirectly by
acx*_probe(), via acx_proc_register_entries() compatibity funcs.
Lets see how it tests, and fixup if required.

Signed-off-by: Jim Cromie <***@gmail.com>
---
common.c | 18 +++++++++++++-----
debugfs.c | 25 +++++++++++++++++++++----
2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/common.c b/common.c
index b8022e9..1887495 100644
--- a/common.c
+++ b/common.c
@@ -242,10 +242,13 @@ static int acx_proc_show_reg_domain(struct seq_file *file, void *v);
static ssize_t acx_proc_write_reg_domain(struct file *file, const char __user *buf, size_t count, loff_t *ppos);
static int acx_proc_show_antenna(struct seq_file *file, void *v);
static ssize_t acx_proc_write_antenna(struct file *file, const char __user *buf, size_t count, loff_t *ppos);
+/*
+ obsoleted by debugfs.c
static int acx_proc_open(struct inode *inode, struct file *file);
static void acx_proc_init(void);
int acx_proc_register_entries(struct ieee80211_hw *ieee);
int acx_proc_unregister_entries(struct ieee80211_hw *ieee);
+*/
#endif

/* Rx Path */
@@ -710,10 +713,12 @@ acx_proc_write_t *const acx_proc_write_funcs[] = {
BUILD_BUG_DECL(SHOW, ARRAY_SIZE(acx_proc_show_funcs)
!= ARRAY_SIZE(acx_proc_write_funcs));

+#ifndef CONFIG_DEBUG_FS
+/* obsoleted */
static struct file_operations acx_e_proc_ops[ARRAY_SIZE(proc_files)];
-
#endif
-/* ----- */
+
+#endif /* CONFIG_PROC_FS */

/*
* BOM Locking
@@ -4116,7 +4121,7 @@ static u8 acx_rate111to100(u16 r)
* ==================================================
*/

-#ifdef CONFIG_PROC_FS
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_DEBUGC_FS)

static int acx_proc_show_diag(struct seq_file *file, void *v)
{
@@ -4881,6 +4886,7 @@ out:
return ret;
}

+#if 0 /* now in debugfs.c */
static int acx_proc_open(struct inode *inode, struct file *file)
{
int i;
@@ -4983,9 +4989,11 @@ int acx_proc_unregister_entries(struct ieee80211_hw *hw)
FN_EXIT0;
return OK;
}
+#else /* now in debugfs.c */
+void acx_proc_init(void) { } /* stub */
+#endif /* now in debugfs.c */

-
-#endif /* CONFIG_PROC_FS */
+#endif /* defined(CONFIG_PROC_FS) || defined(CONFIG_DEBUGC_FS) */

/*
* BOM Rx Path
diff --git a/debugfs.c b/debugfs.c
index 79a6fd5..7e97ea0 100644
--- a/debugfs.c
+++ b/debugfs.c
@@ -1,5 +1,5 @@

-#ifndef CONFIG_PROC_FS
+#ifndef CONFIG_DEBUG_FS

/* API: not static inline - must be available for linking */
int __init acx_debugfs_init(void) { return 0; }
@@ -7,7 +7,7 @@ void __exit acx_debugfs_exit(void) {}
int acx_debugfs_add_adev (struct acx_device *adev) { return 0; }
void acx_debugfs_remove_adev(struct acx_device *adev) { return 0; }

-#else /* CONFIG_PROC_FS */
+#else /* CONFIG_DEBUG_FS */

#define pr_fmt(fmt) "acx.%s: " fmt, __func__

@@ -148,7 +148,8 @@ int acx_debugfs_add_adev(struct acx_device *adev)

fmode = (acx_proc_write_funcs[i])
? 0644 : 0444;
- file = debugfs_create_file(dbgfs_files[i], fmode, acx_dbgfs_devdir,
+ file = debugfs_create_file(dbgfs_files[i], fmode,
+ acx_dbgfs_devdir,
(void*) i, &acx_fops);
if (!file)
goto fail;
@@ -167,6 +168,22 @@ void acx_debugfs_remove_adev(struct acx_device *adev)
adev->debugfs_dir = NULL;
}

+/* compat funcs, also address lifecycle issues */
+int acx_proc_register_entries(struct ieee80211_hw *hw)
+{
+ acx_device_t *adev = ieee2adev(hw);
+ pr_info("compat wrapper\n");
+ return acx_debugfs_add_adev(adev);
+}
+
+int acx_proc_unregister_entries(struct ieee80211_hw *hw)
+{
+ acx_device_t *adev = ieee2adev(hw);
+ pr_info("compat wrapper\n");
+ acx_debugfs_remove_adev(adev);
+ return 0;
+}
+
int __init acx_debugfs_init(void)
{
acx_dbgfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
@@ -181,4 +198,4 @@ void __exit acx_debugfs_exit(void)
debugfs_remove_recursive(acx_dbgfs_dir);
}

-#endif /* CONFIG_PROC_FS */
+#endif /* CONFIG_DEBUG_FS */
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:56 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
pci.c | 84 +------------------------------------------------------------------
1 file changed, 1 insertion(+), 83 deletions(-)

diff --git a/pci.c b/pci.c
index 295a52a..9184709 100644
--- a/pci.c
+++ b/pci.c
@@ -52,6 +52,7 @@
#include "acx.h"
#include "pci.h"
#include "merge.h"
+#include "io-acx.h"

/*
* BOM Config
@@ -1208,89 +1209,6 @@ acx100pci_ioctl_set_phy_amp_bias(struct net_device *ndev,
* pdev - ptr to pci device structure containing info about pci configuration
* id - ptr to the device id entry that matched this device
*/
-static const u16 IO_ACX100[] = {
- 0x0000, /* IO_ACX_SOFT_RESET */
-
- 0x0014, /* IO_ACX_SLV_MEM_ADDR */
- 0x0018, /* IO_ACX_SLV_MEM_DATA */
- 0x001c, /* IO_ACX_SLV_MEM_CTL */
- 0x0020, /* IO_ACX_SLV_END_CTL */
-
- 0x0034, /* IO_ACX_FEMR */
-
- 0x007c, /* IO_ACX_INT_TRIG */
- 0x0098, /* IO_ACX_IRQ_MASK */
- 0x00a4, /* IO_ACX_IRQ_STATUS_NON_DES */
- 0x00a8, /* IO_ACX_IRQ_REASON */
- 0x00ac, /* IO_ACX_IRQ_ACK */
- 0x00b0, /* IO_ACX_HINT_TRIG */
-
- 0x0104, /* IO_ACX_ENABLE */
-
- 0x0250, /* IO_ACX_EEPROM_CTL */
- 0x0254, /* IO_ACX_EEPROM_ADDR */
- 0x0258, /* IO_ACX_EEPROM_DATA */
- 0x025c, /* IO_ACX_EEPROM_CFG */
-
- 0x0268, /* IO_ACX_PHY_ADDR */
- 0x026c, /* IO_ACX_PHY_DATA */
- 0x0270, /* IO_ACX_PHY_CTL */
-
- 0x0290, /* IO_ACX_GPIO_OE */
-
- 0x0298, /* IO_ACX_GPIO_OUT */
-
- 0x02a4, /* IO_ACX_CMD_MAILBOX_OFFS */
- 0x02a8, /* IO_ACX_INFO_MAILBOX_OFFS */
- 0x02ac, /* IO_ACX_EEPROM_INFORMATION */
-
- 0x02d0, /* IO_ACX_EE_START */
- 0x02d4, /* IO_ACX_SOR_CFG */
- 0x02d8 /* IO_ACX_ECPU_CTRL */
-};
-
-static const u16 IO_ACX111[] = {
- 0x0000, /* IO_ACX_SOFT_RESET */
-
- 0x0014, /* IO_ACX_SLV_MEM_ADDR */
- 0x0018, /* IO_ACX_SLV_MEM_DATA */
- 0x001c, /* IO_ACX_SLV_MEM_CTL */
- 0x0020, /* IO_ACX_SLV_END_CTL */
-
- 0x0034, /* IO_ACX_FEMR */
-
- 0x00b4, /* IO_ACX_INT_TRIG */
- 0x00d4, /* IO_ACX_IRQ_MASK */
- /* we do mean NON_DES (0xf0), not NON_DES_MASK which is at 0xe0: */
- 0x00f0, /* IO_ACX_IRQ_STATUS_NON_DES */
- 0x00e4, /* IO_ACX_IRQ_REASON */
- 0x00e8, /* IO_ACX_IRQ_ACK */
- 0x00ec, /* IO_ACX_HINT_TRIG */
-
- 0x01d0, /* IO_ACX_ENABLE */
-
- 0x0338, /* IO_ACX_EEPROM_CTL */
- 0x033c, /* IO_ACX_EEPROM_ADDR */
- 0x0340, /* IO_ACX_EEPROM_DATA */
- 0x0344, /* IO_ACX_EEPROM_CFG */
-
- 0x0350, /* IO_ACX_PHY_ADDR */
- 0x0354, /* IO_ACX_PHY_DATA */
- 0x0358, /* IO_ACX_PHY_CTL */
-
- 0x0374, /* IO_ACX_GPIO_OE */
-
- 0x037c, /* IO_ACX_GPIO_OUT */
-
- 0x0388, /* IO_ACX_CMD_MAILBOX_OFFS */
- 0x038c, /* IO_ACX_INFO_MAILBOX_OFFS */
- 0x0390, /* IO_ACX_EEPROM_INFORMATION */
-
- 0x0100, /* IO_ACX_EE_START */
- 0x0104, /* IO_ACX_SOR_CFG */
- 0x0108, /* IO_ACX_ECPU_CTRL */
-};
-
#ifdef CONFIG_PCI
/* static */
int __devinit
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:55 UTC
Permalink
wrap some lines in mem.c merge.c - for easier sdiff comparison.

Signed-off-by: Jim Cromie <***@gmail.com>
---
mem.c | 34 +++++++++++++++++++++-------------
merge.c | 51 +++++++++++++++++++++++++++++----------------------
pci.c | 6 +++---
3 files changed, 53 insertions(+), 38 deletions(-)

diff --git a/mem.c b/mem.c
index 1b694f5..7b74121 100644
--- a/mem.c
+++ b/mem.c
@@ -979,7 +979,7 @@ STATick void acxmem_i_set_multicast_list(struct net_device *ndev)
* BOM Proc, Debug
* ==================================================
*/
-#if 1 // copied to merge, but needs work
+#if 0 // copied to merge, but needs work
int acxmem_proc_diag_output(struct seq_file *file,
acx_device_t *adev)
{
@@ -1007,15 +1007,19 @@ int acxmem_proc_diag_output(struct seq_file *file,
if (rxdesc)
for (i = 0; i < RX_CNT; i++) {
rtl = (i == adev->rx.tail) ? " [tail]" : "";
- Ctl_8 = read_slavemem8(adev, (ulong) &(rxdesc->Ctl_8));
+ Ctl_8 = read_slavemem8(adev, (ulong)
+ &(rxdesc->Ctl_8));
if (Ctl_8 & DESC_CTL_HOSTOWN)
- seq_printf(file, "%02u (%02x) FULL %-10s", i, Ctl_8, rtl);
+ seq_printf(file, "%02u (%02x) FULL %-10s",
+ i, Ctl_8, rtl);
else
- seq_printf(file, "%02u (%02x) empty%-10s", i, Ctl_8, rtl);
+ seq_printf(file, "%02u (%02x) empty%-10s",
+ i, Ctl_8, rtl);

/* seq_printf(file, "\n"); */

- acxmem_copy_from_slavemem(adev, (u8 *) &rxd, (ulong) rxdesc, sizeof(rxd));
+ acxmem_copy_from_slavemem(adev, (u8 *) &rxd,
+ (ulong) rxdesc, sizeof(rxd));
seq_printf(file,
"%0lx: %04x %04x %04x %04x %04x %04x %04x Ctl_8=%04x %04x %04x %04x %04x %04x %04x %04x\n",
(ulong) rxdesc,
@@ -1038,8 +1042,8 @@ int acxmem_proc_diag_output(struct seq_file *file,
}

seq_printf(file, "** Tx buf (free %d, Ieee80211 queue: %s) **\n",
- adev->acx_txbuf_free, acx_queue_stopped(adev->ieee)
- ? "STOPPED" : "Running");
+ adev->acx_txbuf_free,
+ acx_queue_stopped(adev->ieee) ? "STOPPED" : "Running");

seq_printf(file,
"** Tx buf %d blocks total, %d available, free list head %04x\n",
@@ -1056,11 +1060,14 @@ int acxmem_proc_diag_output(struct seq_file *file,

Ctl_8 = read_slavemem8(adev, (ulong) &(txdesc->Ctl_8));
if (Ctl_8 & DESC_CTL_ACXDONE)
- seq_printf(file, "%02u ready to free (%02X)%-7s%-7s", i, Ctl_8, thd, ttl);
+ seq_printf(file, "%02u ready to free (%02X)%-7s%-7s",
+ i, Ctl_8, thd, ttl);
else if (Ctl_8 & DESC_CTL_HOSTOWN)
- seq_printf(file, "%02u available (%02X)%-7s%-7s", i, Ctl_8, thd, ttl);
+ seq_printf(file, "%02u available (%02X)%-7s%-7s",
+ i, Ctl_8, thd, ttl);
else
- seq_printf(file, "%02u busy (%02X)%-7s%-7s", i, Ctl_8, thd, ttl);
+ seq_printf(file, "%02u busy (%02X)%-7s%-7s",
+ i, Ctl_8, thd, ttl);

seq_printf(file,
"%0lx: %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %02x %02x %02x %02x "
@@ -1074,7 +1081,8 @@ int acxmem_proc_diag_output(struct seq_file *file,
txd.rts_ok, txd.u.r1.rate,
txd.u.r1.queue_ctrl, txd.queue_info);

- tmp = read_slavemem32(adev, (ulong) & (txdesc->AcxMemPtr));
+ tmp = read_slavemem32(adev,
+ (ulong) & (txdesc->AcxMemPtr));
seq_printf(file, " %04x: ", tmp);

/* Output allocated tx-buffer chain */
@@ -1117,8 +1125,8 @@ int acxmem_proc_diag_output(struct seq_file *file,
seq_printf(file, "* Tx-buffer list dump\n");
seq_printf(file, "acx_txbuf_numblocks=%d, acx_txbuf_blocks_free=%d, \n"
"acx_txbuf_start==%04x, acx_txbuf_free=%04x, memblocksize=%d\n",
- adev->acx_txbuf_numblocks, adev->acx_txbuf_blocks_free,
- adev->acx_txbuf_start, adev->acx_txbuf_free, adev->memblocksize);
+ adev->acx_txbuf_numblocks, adev->acx_txbuf_blocks_free,
+ adev->acx_txbuf_start, adev->acx_txbuf_free, adev->memblocksize);

tmp = adev->acx_txbuf_start;
for (i = 0; i < adev->acx_txbuf_numblocks; i++) {
diff --git a/merge.c b/merge.c
index 468b7d3..c9bd366 100644
--- a/merge.c
+++ b/merge.c
@@ -2280,7 +2280,7 @@ static void acxmem_i_set_multicast_list(struct net_device *ndev)
* BOM Proc, Debug
* ==================================================
*/
-#if 0 // needs work
+#if 1 // real close
int acxmem_proc_diag_output(struct seq_file *file,
acx_device_t *adev)
{
@@ -2308,11 +2308,14 @@ int acxmem_proc_diag_output(struct seq_file *file,
if (rxdesc)
for (i = 0; i < RX_CNT; i++) {
rtl = (i == adev->rx.tail) ? " [tail]" : "";
- Ctl_8 = read_slavemem8(adev, (u32) &(rxdesc->Ctl_8));
+ Ctl_8 = read_slavemem8(adev, (ulong)
+ &(rxdesc->Ctl_8));
if (Ctl_8 & DESC_CTL_HOSTOWN)
- seq_printf(file, "%02u (%02x) FULL %-10s", i, Ctl_8, rtl);
+ seq_printf(file, "%02u (%02x) FULL %-10s",
+ i, Ctl_8, rtl);
else
- seq_printf(file, "%02u (%02x) empty%-10s", i, Ctl_8, rtl);
+ seq_printf(file, "%02u (%02x) empty%-10s",
+ i, Ctl_8, rtl);

/* seq_printf(file, "\n"); */

@@ -2320,7 +2323,7 @@ int acxmem_proc_diag_output(struct seq_file *file,
(u32) rxdesc, sizeof(rxd));
seq_printf(file,
"%04x: %04x %04x %04x %04x %04x %04x %04x Ctl_8=%04x %04x %04x %04x %04x %04x %04x %04x\n",
- (u32) rxdesc,
+ (uint) rxdesc,
rxd.pNextDesc.v,
rxd.HostMemPtr.v,
rxd.ACXMemPtr.v,
@@ -2340,8 +2343,8 @@ int acxmem_proc_diag_output(struct seq_file *file,
}

seq_printf(file, "** Tx buf (free %d, Ieee80211 queue: %s) **\n",
- adev->acx_txbuf_free, acx_queue_stopped(adev->ieee) ? "STOPPED"
- : "Running");
+ adev->acx_txbuf_free,
+ acx_queue_stopped(adev->ieee) ? "STOPPED" : "Running");

seq_printf(file,
"** Tx buf %d blocks total, %d available, free list head %04x\n",
@@ -2358,15 +2361,19 @@ int acxmem_proc_diag_output(struct seq_file *file,

Ctl_8 = read_slavemem8(adev, (u32) &(txdesc->Ctl_8));
if (Ctl_8 & DESC_CTL_ACXDONE)
- seq_printf(file, "%02u ready to free (%02X)%-7s%-7s", i, Ctl_8, thd, ttl);
+ seq_printf(file, "%02u ready to free (%02X)%-7s%-7s",
+ i, Ctl_8, thd, ttl);
else if (Ctl_8 & DESC_CTL_HOSTOWN)
- seq_printf(file, "%02u available (%02X)%-7s%-7s", i, Ctl_8, thd, ttl);
+ seq_printf(file, "%02u available (%02X)%-7s%-7s",
+ i, Ctl_8, thd, ttl);
else
- seq_printf(file, "%02u busy (%02X)%-7s%-7s", i, Ctl_8, thd, ttl);
+ seq_printf(file, "%02u busy (%02X)%-7s%-7s",
+ i, Ctl_8, thd, ttl);

seq_printf(file,
"%04x: %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %02x %02x %02x %02x "
- "%02x %02x %02x %02x %04x: ", (u32) txdesc,
+ "%02x %02x %02x %02x %04x: ",
+ (uint) txdesc,
txd.pNextDesc.v, txd.HostMemPtr.v,
txd.AcxMemPtr.v,
txd.tx_time, txd.total_length, txd.Reserved,
@@ -2377,14 +2384,14 @@ int acxmem_proc_diag_output(struct seq_file *file,
txd.u.r1.queue_ctrl, txd.queue_info);

tmp = read_slavemem32(adev,
- (u32) & (txdesc->AcxMemPtr));
+ (ulong) & (txdesc->AcxMemPtr));
seq_printf(file, " %04x: ", tmp);

/* Output allocated tx-buffer chain */
#if 1
if (tmp) {
- while ((tmp2 = read_slavemem32(adev,
- (u32) tmp)) != 0x02000000) {
+ while ((tmp2 = read_slavemem32(adev, (u32) tmp))
+ != 0x02000000) {
tmp2 = tmp2 << 5;
seq_printf(file, "%04x=%04x,", tmp, tmp2);
tmp = tmp2;
@@ -2400,7 +2407,7 @@ int acxmem_proc_diag_output(struct seq_file *file,

if (txd.AcxMemPtr.v) {
acxmem_copy_from_slavemem(adev, buf,
- txd.AcxMemPtr.v, sizeof(buf));
+ txd.AcxMemPtr.v, sizeof(buf));
for (j = 0; (j < txd.total_length) && (j < (sizeof(buf) - 4)); j
+= 16) {
seq_printf(file, " ");
@@ -4138,19 +4145,19 @@ void acx_op_stop(struct ieee80211_hw *hw)
void acxmem_power_led(acx_device_t *adev, int enable) {
u16 gpio_pled = IS_ACX111(adev) ? 0x0040 : 0x0800;

- /* A hack. Not moving message rate limiting to adev->xxx
- * (it's only a debug message after all) */
+ /* A hack. Not moving message rate limiting to adev->xxx (it's
+ * only a debug message after all) */
static int rate_limit = 0;

if (rate_limit++ < 3)
log(L_IOCTL, "Please report in case toggling the power "
- "LED doesn't work for your card!\n");
+ "LED doesn't work for your card!\n");
if (enable)
- write_reg16(adev, IO_ACX_GPIO_OUT, read_reg16(adev, IO_ACX_GPIO_OUT)
- & ~gpio_pled);
+ write_reg16(adev, IO_ACX_GPIO_OUT,
+ read_reg16(adev, IO_ACX_GPIO_OUT) & ~gpio_pled);
else
- write_reg16(adev, IO_ACX_GPIO_OUT, read_reg16(adev, IO_ACX_GPIO_OUT)
- | gpio_pled);
+ write_reg16(adev, IO_ACX_GPIO_OUT,
+ read_reg16(adev, IO_ACX_GPIO_OUT) | gpio_pled);
}
#endif

diff --git a/pci.c b/pci.c
index 484e90c..295a52a 100644
--- a/pci.c
+++ b/pci.c
@@ -846,13 +846,13 @@ void acxpci_power_led(acx_device_t * adev, int enable)

if (rate_limit++ < 3)
log(L_IOCTL, "Please report in case toggling the power "
- "LED doesn't work for your card\n");
+ "LED doesn't work for your card\n");
if (enable)
write_reg16(adev, IO_ACX_GPIO_OUT,
- read_reg16(adev, IO_ACX_GPIO_OUT) & ~gpio_pled);
+ read_reg16(adev, IO_ACX_GPIO_OUT) & ~gpio_pled);
else
write_reg16(adev, IO_ACX_GPIO_OUT,
- read_reg16(adev, IO_ACX_GPIO_OUT) | gpio_pled);
+ read_reg16(adev, IO_ACX_GPIO_OUT) | gpio_pled);
}

INLINE_IO int acxpci_adev_present(acx_device_t *adev)
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:57 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
merge.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/merge.c b/merge.c
index c9bd366..42b1e8d 100644
--- a/merge.c
+++ b/merge.c
@@ -1202,7 +1202,7 @@ int acx_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
#endif

/*
- * acxmem_s_validate_fw
+ * acx_validate_fw
*
* Compare the firmware image given with
* the firmware image written into the card.
@@ -1215,10 +1215,8 @@ int acx_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
* NOT_OK firmware image corrupted or not correctly written
* OK success
*/
-/* static */
-#if 1 // compiles
-int acx_validate_fw(acx_device_t *adev,
- const firmware_image_t *fw_image, u32 offset)
+int acx_validate_fw(acx_device_t *adev, const firmware_image_t *fw_image,
+ u32 offset)
{
u32 sum, v32, w32;
int len, size;
@@ -1294,9 +1292,8 @@ int acx_validate_fw(acx_device_t *adev,
FN_EXIT1(result);
return result;
}
-#endif // acxmem_validate_fw()

-#if 1 // use for mem.c only
+#if 1 /* used for mem.c only */

#ifdef PATCH_AROUND_BAD_SPOTS
/*
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:58 UTC
Permalink
Since log() and friends have been using pr_info() with a pr_fmt() that
adds the __func__ automatically, there are a few spots where its
printed 2x; either by logf1(), logf0(), or manually via "%s..",
__func__. This fixes a handfull in acx_op_(add|remove)_interface().

Signed-off-by: Jim Cromie <***@gmail.com>
---
common.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/common.c b/common.c
index 1887495..9a8561f 100644
--- a/common.c
+++ b/common.c
@@ -6207,7 +6207,7 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,
vif_type = vif->type;
#endif
adev->vif_type = vif_type;
- logf1(L_ANY, "vif_type=%04X\n", vif_type);
+ log(L_ANY, "vif_type=%04X\n", vif_type);


if (vif_type == NL80211_IFTYPE_MONITOR)
@@ -6226,17 +6226,17 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,

switch (adev->vif_type) {
case NL80211_IFTYPE_AP:
- logf0(L_ANY, "NL80211_IFTYPE_AP\n");
+ log(L_ANY, "NL80211_IFTYPE_AP\n");
adev->mode = ACX_MODE_3_AP;
break;

case NL80211_IFTYPE_ADHOC:
- logf0(L_ANY, "NL80211_IFTYPE_ADHOC\n");
+ log(L_ANY, "NL80211_IFTYPE_ADHOC\n");
adev->mode = ACX_MODE_0_ADHOC;
break;

case NL80211_IFTYPE_STATION:
- logf0(L_ANY, "NL80211_IFTYPE_STATION\n");
+ log(L_ANY, "NL80211_IFTYPE_STATION\n");
adev->mode = ACX_MODE_2_STA;
break;

@@ -6311,15 +6311,13 @@ void acx_op_remove_interface(struct ieee80211_hw *hw,
acx_set_mode(adev, ACX_MODE_OFF);

#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
- log(L_DEBUG, "%s: vif_operating=%d, conf->type=%d\n",
- __func__, adev->vif_operating, conf->type);
+ log(L_DEBUG, "vif_operating=%d, conf->type=%d\n",
+ adev->vif_operating, conf->type);
#else
- log(L_DEBUG, "%s: vif_operating=%d, vif->type=%d\n",
- __func__, adev->vif_operating, vif->type);
+ log(L_DEBUG, "vif_operating=%d, vif->type=%d\n",
+ adev->vif_operating, vif->type);
#endif
- log(L_ANY, "acx: Virtual interface removed: "
- "type=%d, MAC=%s\n",
-
+ log(L_ANY, "Virtual interface removed: type=%d, MAC=%s\n",
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
conf->type, acx_print_mac(mac, conf->mac_addr)
#else
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:24:59 UTC
Permalink
In acx_compat.h, add a kernel-version dependent macro (2.6.34) which
maps ieee80211_vif --> ieee80211_if_init_conf.

This is a rather bold rename, and hasnt been tested on an old kernel,
but the old name on longer exists in 3.4-rc, so its a reasonable bet.

The rename allows to hide version diffs affecting the fn-prototypes
(in subject), and buries the var-name diff, which allows deletion of
several #if/#else/#end chunks in the fn-bodies. One is left, cuz it
has a different field-name in the 2 version.

Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_compat.h | 9 +++++++++
common.c | 49 +++++++------------------------------------------
2 files changed, 16 insertions(+), 42 deletions(-)

diff --git a/acx_compat.h b/acx_compat.h
index f839a06..b9f73b3 100644
--- a/acx_compat.h
+++ b/acx_compat.h
@@ -28,3 +28,12 @@ do { \
#else
#include <generated/utsrelease.h>
#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+/*
+ Unsure about this one, its rather unselective.
+ Done to fix up acx_op_add_interface(..) in main code,
+ leaning towards mainline. TBD
+*/
+# define ieee80211_vif ieee80211_if_init_conf
+#endif
diff --git a/common.c b/common.c
index 9a8561f..a4b6e27 100644
--- a/common.c
+++ b/common.c
@@ -6182,13 +6182,7 @@ end:
int acx_debugfs_add_adev(struct acx_device *adev);
void acx_debugfs_remove_adev(struct acx_device *adev);

-#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
-int acx_op_add_interface(struct ieee80211_hw *ieee,
- struct ieee80211_if_init_conf *conf)
-#else
-int acx_op_add_interface(struct ieee80211_hw *ieee,
- struct ieee80211_vif *vif)
-#endif
+int acx_op_add_interface(struct ieee80211_hw *ieee, struct ieee80211_vif *vif)
{
acx_device_t *adev = ieee2adev(ieee);
int err = -EOPNOTSUPP;
@@ -6201,15 +6195,10 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,
FN_ENTER;
acx_sem_lock(adev);

-#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
- vif_type = conf->type;
-#else
vif_type = vif->type;
-#endif
adev->vif_type = vif_type;
log(L_ANY, "vif_type=%04X\n", vif_type);

-
if (vif_type == NL80211_IFTYPE_MONITOR)
adev->vif_monitor++;
else if (adev->vif_operating)
@@ -6217,8 +6206,8 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,

adev->vif_operating = 1;
#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
- adev->vif = conf->vif;
- mac_vif = conf->mac_addr;
+ adev->vif = vif->vif;
+ mac_vif = vif->mac_addr;
#else
adev->vif = vif;
mac_vif = vif->addr;
@@ -6266,12 +6255,7 @@ int acx_op_add_interface(struct ieee80211_hw *ieee,
acx_debugfs_add_adev(adev);

pr_info("Virtual interface added (type: 0x%08X, MAC: %s)\n",
-#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
- adev->vif_type, acx_print_mac(mac, conf->mac_addr)
-#else
- adev->vif_type, acx_print_mac(mac, vif->addr)
-#endif
- );
+ adev->vif_type, acx_print_mac(mac, vif->addr));

err = 0;

@@ -6281,13 +6265,7 @@ out_unlock:
return err;
}

-#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
-void acx_op_remove_interface(struct ieee80211_hw *hw,
- struct ieee80211_if_init_conf *conf)
-#else
-void acx_op_remove_interface(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
-#endif
+void acx_op_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
acx_device_t *adev = ieee2adev(hw);

@@ -6297,11 +6275,7 @@ void acx_op_remove_interface(struct ieee80211_hw *hw,
acx_sem_lock(adev);
acx_debugfs_remove_adev(adev);

-#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
- if (conf->type == NL80211_IFTYPE_MONITOR)
-#else
if (vif->type == NL80211_IFTYPE_MONITOR)
-#endif
adev->vif_monitor--;
else {
adev->vif_operating = 0;
@@ -6310,20 +6284,11 @@ void acx_op_remove_interface(struct ieee80211_hw *hw,

acx_set_mode(adev, ACX_MODE_OFF);

-#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
- log(L_DEBUG, "vif_operating=%d, conf->type=%d\n",
- adev->vif_operating, conf->type);
-#else
log(L_DEBUG, "vif_operating=%d, vif->type=%d\n",
adev->vif_operating, vif->type);
-#endif
+
log(L_ANY, "Virtual interface removed: type=%d, MAC=%s\n",
-#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(2, 6, 34)
- conf->type, acx_print_mac(mac, conf->mac_addr)
-#else
- vif->type, acx_print_mac(mac, vif->addr)
-#endif
- );
+ vif->type, acx_print_mac(mac, vif->addr));

acx_sem_unlock(adev);
FN_EXIT0;
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:00 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
TODO | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/TODO b/TODO
index e63ad0b..727427c 100644
--- a/TODO
+++ b/TODO
@@ -86,25 +86,24 @@ acx(pci|mem)_get_txbuf(): DONE

acx(pci|mem)_process_rxdesc(): DONE

-acx(pci|mem)_delete_dma_regions(): DONE, pending
-acx(pci|mem)_reset_dev(): DONE, pending
-acx(pci|mem)_verify_init(): DONE, pending
+acx(pci|mem)_delete_dma_regions(): DONE
+acx(pci|mem)_reset_dev(): DONE
+acx(pci|mem)_verify_init(): DONE
- kinda pointless; though structurally identical, nothing is shared

acx(mem|pci)_tx_clean_txdesc_emergency(): DONE
acx(mem|pci)_write_phy_reg(): DONE

-
-acx(pci|mem)_irq_work():
+acx(pci|mem)_irq_work(): DONE
diffs around ITERATE
-
slave_mem - need wrappers
slave-mem
-
- slave-mem
maybe make a helper for above.
grody diffs

+acx(pci|mem)_reset_dev(): DONE
+acx(pci|mem)_s_validate_fw(): DONE except for few stray comments
+
OTHERS

acxmem_issue_cmd_timeo_debug():
@@ -115,7 +114,8 @@ acxmem_issue_cmd_timeo_debug():
VS acxmem_write_cmd_type_status(adev, ACX1xx_CMD_RESET, 0);


-acxpci_init_mboxes():
+acx(pci|mem)_init_mboxes(): DONE, old are cleaned
+acx(pci|mem)_s_write_fw(): DONE, only header left.

acxmem_proc_diag_output():
grody diffs
@@ -125,22 +125,18 @@ acx(pci|mem)_write_phy_reg()

acx(pci|mem)_write_eeprom_byte() (UNUSED)

-acx(pci|mem)_s_write_fw()
-acx(pci|mem)_s_validate_fw()
acx(pci|mem)_issue_cmd_timeo_debug() fair divergence
-acx(pci|mem)_init_mboxes()
-acx(pci|mem)_reset_dev()
acx(pci|mem)_interrupt() (comment diffs)
acx111(pci|mem)_ioctl_info() (extra printks in mem

---------
-refactor struct acx_device
+refactor struct acx_device: DONE

move (tx|rx)(host)?desc to sub-structure.
this will allow simplification of code doing buffer allocs and frees.

---------
-move or copy (tbd) all proc files to debugfs
+move or copy (tbd) all proc files to debugfs: DONE

---------
acx_proc_show_eeprom(struct seq_file *file, void *v)
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:01 UTC
Permalink
fix call to acxpci_write_phy_reg (in #if0d code), remove comments
reffing it, remove #if1 around merge.c:_acx_write_phy_reg()

Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_func.h | 2 --
common.c | 2 +-
merge.c | 2 --
3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/acx_func.h b/acx_func.h
index 493da96..0482e5b 100644
--- a/acx_func.h
+++ b/acx_func.h
@@ -571,8 +571,6 @@ static inline struct ieee80211_hdr* acx_get_wlan_hdr(acx_device_t *adev,
* - int acxpci_upload_radio(acx_device_t * adev);
* =int acxpci_read_eeprom_byte(acx_device_t * adev, u32 addr, u8 * charbuf);
* int acxpci_s_write_eeprom(acx_device_t * adev, u32 addr, u32 len, const u8 * charbuf);
- * - int acxpci_read_phy_reg(acx_device_t * adev, u32 reg, u8 * charbuf);
- * - int acxpci_write_phy_reg(acx_device_t * adev, u32 reg, u8 value);
* -
* CMDs (Control Path)
*/
diff --git a/common.c b/common.c
index a4b6e27..36a933e 100644
--- a/common.c
+++ b/common.c
@@ -2608,7 +2608,7 @@ int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm)
}
pr_info("%s: changing radio power level to %u dBm (%u)\n",
wiphy_name(adev->ieee->wiphy), level_dbm, table[level_dbm]);
- acxpci_write_phy_reg(adev, 0x11, table[level_dbm]);
+ acx_write_phy_reg(adev, 0x11, table[level_dbm]);
return OK;
}

diff --git a/merge.c b/merge.c
index 42b1e8d..144c75a 100644
--- a/merge.c
+++ b/merge.c
@@ -1048,7 +1048,6 @@ fail:
return result;
}

-#if 1 // use mem.c til later
int _acx_write_phy_reg(acx_device_t *adev, u32 reg, u8 value)
{
int count;
@@ -1093,7 +1092,6 @@ fail:
FN_EXIT1(OK); // FN_EXIT0 in pci
return OK;
}
-#endif // acxmem_write_phy_reg()

/*
* acx_write_fw
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:02 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
mem.h | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/mem.h b/mem.h
index a701f7e..4dbe303 100644
--- a/mem.h
+++ b/mem.h
@@ -31,11 +31,6 @@ void acxmem_chaincopy_to_slavemem(acx_device_t *adev, u32 destination,
void acxmem_chaincopy_from_slavemem(acx_device_t *adev, u8 *destination,
u32 source, int count);

-int acxmem_write_fw(acx_device_t *adev, const firmware_image_t *fw_image,
- u32 offset);
-int acxmem_validate_fw(acx_device_t *adev, const firmware_image_t *fw_image,
- u32 offset);
-
void acxmem_reset_mac(acx_device_t *adev);

int acxmem_proc_diag_output(struct seq_file *file, acx_device_t *adev);
@@ -59,8 +54,12 @@ void acxmem_init_mboxes(acx_device_t *adev);

static inline void acxmem_dump_mem(acx_device_t *adev, u32 start, int length) { }

-static inline void acxmem_copy_to_slavemem(acx_device_t *adev, u32 destination,
- u8 *source, int count)
+static inline void acxmem_copy_to_slavemem(acx_device_t *adev,
+ u32 destination, u8 *source, int count)
+{ }
+
+static inline void acxmem_copy_from_slavemem(acx_device_t *adev,
+ u8 *destination, u32 source, int count)
{ }

static inline void acxmem_chaincopy_to_slavemem(acx_device_t *adev,
@@ -75,14 +74,10 @@ static inline void acxmem_chaincopy_from_slavemem(acx_device_t *adev,
* { return 0; }
*/

-static inline int acxmem_write_fw(acx_device_t *adev,
- const firmware_image_t *fw_image, u32 offset)
-{ return 0; }
+//static inline int acxmem_write_fw(acx_device_t *adev,
+// const firmware_image_t *fw_image, u32 offset)
+//{ return 0; }

-static inline int acxmem_validate_fw(acx_device_t *adev,
- const firmware_image_t *fw_image, u32 offset)
-{ return 0; }
-
static inline void acxmem_reset_mac(acx_device_t *adev)
{ }
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:03 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
mem.c | 33 ---------------------------------
1 file changed, 33 deletions(-)

diff --git a/mem.c b/mem.c
index 7b74121..22c18f3 100644
--- a/mem.c
+++ b/mem.c
@@ -791,39 +791,6 @@ acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
* ==================================================
*/

-
-STATick int acxmem_verify_init(acx_device_t *adev)
-{
- int result = NOT_OK;
- unsigned long timeout;
- u32 irqstat;
-
- acxmem_lock_flags;
-
- FN_ENTER;
-
- timeout = jiffies + 2 * HZ;
- for (;;) {
- acxmem_lock();
- irqstat = read_reg32(adev, IO_ACX_IRQ_STATUS_NON_DES);
- if ((irqstat != 0xFFFFFFFF) && (irqstat & HOST_INT_FCS_THRESHOLD)) {
- result = OK;
- write_reg32(adev, IO_ACX_IRQ_ACK, HOST_INT_FCS_THRESHOLD);
- acxmem_unlock();
- break;
- }
- acxmem_unlock();
-
- if (time_after(jiffies, timeout))
- break;
- /* Init may take up to ~0.5 sec total */
- acx_mwait(50);
- }
-
- FN_EXIT1(result);
- return result;
-}
-
/*
* Most of the acx specific pieces of hardware reset.
*/
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:04 UTC
Permalink
Drop acx(pci|mem)_s_write_eeprom(), keep merge.c copy, changing

Also remove #if1/#endif around merge.c:acx_proc_eeprom_output(),
and fiddle with BOM comment.

Signed-off-by: Jim Cromie <***@gmail.com>
---
mem.c | 93 -----------------------------------------------------------------
merge.c | 15 +++++------
pci.c | 93 -----------------------------------------------------------------
3 files changed, 6 insertions(+), 195 deletions(-)

diff --git a/mem.c b/mem.c
index 22c18f3..37ee7c1 100644
--- a/mem.c
+++ b/mem.c
@@ -437,99 +437,6 @@ void acxmem_chaincopy_from_slavemem(acx_device_t *adev, u8 *destination,
* ==================================================
*/

-/*
- * We don't lock hw accesses here since we never r/w eeprom in IRQ
- * Note: this function sleeps only because of GFP_KERNEL alloc
- */
-#ifdef UNUSED
-int
-acxmem_s_write_eeprom(acx_device_t *adev, u32 addr, u32 len,
- const u8 *charbuf)
-{
- u8 *data_verify = NULL;
- unsigned long flags;
- int count, i;
- int result = NOT_OK;
- u16 gpio_orig;
-
- pr_acx("WARNING! I would write to EEPROM now. "
- "Since I really DON'T want to unless you know "
- "what you're doing (THIS CODE WILL PROBABLY "
- "NOT WORK YET!), I will abort that now. And "
- "definitely make sure to make a "
- "/proc/driver/acx_wlan0_eeprom backup copy first!!! "
- "(the EEPROM content includes the PCI config header!! "
- "If you kill important stuff, then you WILL "
- "get in trouble and people DID get in trouble already)\n");
- return OK;
-
- FN_ENTER;
-
- data_verify = kmalloc(len, GFP_KERNEL);
- if (!data_verify)
- goto end;
-
- /* first we need to enable the OE (EEPROM Output Enable) GPIO
- * line to be able to write to the EEPROM. NOTE: an EEPROM
- * writing success has been reported, but you probably have to
- * modify GPIO_OUT, too, and you probably need to activate a
- * different GPIO line instead! */
- gpio_orig = read_reg16(adev, IO_ACX_GPIO_OE);
- write_reg16(adev, IO_ACX_GPIO_OE, gpio_orig & ~1);
- write_flush(adev);
-
- /* ok, now start writing the data out */
- for (i = 0; i < len; i++) {
- write_reg32(adev, IO_ACX_EEPROM_CFG, 0);
- write_reg32(adev, IO_ACX_EEPROM_ADDR, addr + i);
- write_reg32(adev, IO_ACX_EEPROM_DATA, *(charbuf + i));
- write_flush(adev);
- write_reg32(adev, IO_ACX_EEPROM_CTL, 1);
-
- count = 0xffff;
- while (read_reg16(adev, IO_ACX_EEPROM_CTL)) {
- if (unlikely(!--count)) {
- pr_acx("WARNING, DANGER!!! "
- "Timeout waiting for EEPROM write\n");
- goto end;
- }
- cpu_relax();
- }
- }
-
- /* disable EEPROM writing */
- write_reg16(adev, IO_ACX_GPIO_OE, gpio_orig);
- write_flush(adev);
-
- /* now start a verification run */
- for (i = 0; i < len; i++) {
- write_reg32(adev, IO_ACX_EEPROM_CFG, 0);
- write_reg32(adev, IO_ACX_EEPROM_ADDR, addr + i);
- write_flush(adev);
- write_reg32(adev, IO_ACX_EEPROM_CTL, 2);
-
- count = 0xffff;
- while (read_reg16(adev, IO_ACX_EEPROM_CTL)) {
- if (unlikely(!--count)) {
- pr_acx("timeout waiting for EEPROM read\n");
- goto end;
- }
- cpu_relax();
- }
-
- data_verify[i] = read_reg16(adev, IO_ACX_EEPROM_DATA);
- }
-
- if (0 == memcmp(charbuf, data_verify, len))
- result = OK; /* read data matches, success */
-
- end:
- kfree(data_verify);
- FN_EXIT1(result);
- return result;
-}
-#endif /* UNUSED */
-
STATick inline void acxmem_read_eeprom_area(acx_device_t *adev)
{
#if ACX_DEBUG > 1
diff --git a/merge.c b/merge.c
index 144c75a..9aa1625 100644
--- a/merge.c
+++ b/merge.c
@@ -814,9 +814,9 @@ void acx_log_txbuffer(acx_device_t *adev)
printk("\n");
}

-
-/* ####################################################################### */
-
+/* ####################################################################
+ * BOM Firmware, EEPROM, Phy
+ */
/*
* acx_read_eeprom_byte
*
@@ -867,7 +867,6 @@ fail:
return result;
}

-#if 1 // from mem.c, has extra locking, apparently harmless
char *acx_proc_eeprom_output(int *length, acx_device_t *adev)
{
char *p, *buf;
@@ -887,15 +886,13 @@ char *acx_proc_eeprom_output(int *length, acx_device_t *adev)
FN_EXIT1(p - buf);
return buf;
}
-#endif // acx_proc_eeprom_output()

/*
* We don't lock hw accesses here since we never r/w eeprom in IRQ
* Note: this function sleeps only because of GFP_KERNEL alloc
*/
-/* unused in mem, used in pci */
-#if 0 //
-int acx_s_write_eeprom(acx_device_t *adev, u32 addr, u32 len,
+#ifdef UNUSED /* acx_write_eeprom() */
+int acx_write_eeprom(acx_device_t *adev, u32 addr, u32 len,
const u8 *charbuf)
{
u8 *data_verify = NULL;
@@ -980,7 +977,7 @@ end:
FN_EXIT1(result);
return result;
}
-#endif // acx_s_write_eeprom()
+#endif /* acx_write_eeprom() */

static inline void acx_read_eeprom_area(acx_device_t *adev)
{
diff --git a/pci.c b/pci.c
index 9184709..887ffa9 100644
--- a/pci.c
+++ b/pci.c
@@ -157,99 +157,6 @@ void acxpci_free_coherent(struct pci_dev *hwdev, size_t size,
* ==================================================
*/

-/*
- * We don't lock hw accesses here since we never r/w eeprom in IRQ
- * Note: this function sleeps only because of GFP_KERNEL alloc
- */
-#ifdef UNUSED
-int
-acxpci_s_write_eeprom(acx_device_t * adev, u32 addr, u32 len,
- const u8 * charbuf)
-{
- u8 *data_verify = NULL;
- unsigned long flags;
- int count, i;
- int result = NOT_OK;
- u16 gpio_orig;
-
- pr_acx("WARNING! I would write to EEPROM now. "
- "Since I really DON'T want to unless you know "
- "what you're doing (THIS CODE WILL PROBABLY "
- "NOT WORK YET!), I will abort that now. And "
- "definitely make sure to make a "
- "/proc/driver/acx_wlan0_eeprom backup copy first!!! "
- "(the EEPROM content includes the PCI config header!! "
- "If you kill important stuff, then you WILL "
- "get in trouble and people DID get in trouble already)\n");
- return OK;
-
- FN_ENTER;
-
- /* first we need to enable the OE (EEPROM Output Enable) GPIO
- * line to be able to write to the EEPROM. NOTE: an EEPROM
- * writing success has been reported, but you probably have to
- * modify GPIO_OUT, too, and you probably need to activate a
- * different GPIO line instead! */
- gpio_orig = read_reg16(adev, IO_ACX_GPIO_OE);
- write_reg16(adev, IO_ACX_GPIO_OE, gpio_orig & ~1);
- write_flush(adev);
-
- /* ok, now start writing the data out */
- for (i = 0; i < len; i++) {
- write_reg32(adev, IO_ACX_EEPROM_CFG, 0);
- write_reg32(adev, IO_ACX_EEPROM_ADDR, addr + i);
- write_reg32(adev, IO_ACX_EEPROM_DATA, *(charbuf + i));
- write_flush(adev);
- write_reg32(adev, IO_ACX_EEPROM_CTL, 1);
-
- count = 0xffff;
- while (read_reg16(adev, IO_ACX_EEPROM_CTL)) {
- if (unlikely(!--count)) {
- pr_acx("WARNING, DANGER!!! "
- "Timeout waiting for EEPROM write\n");
- goto end;
- }
- cpu_relax();
- }
- }
-
- /* disable EEPROM writing */
- write_reg16(adev, IO_ACX_GPIO_OE, gpio_orig);
- write_flush(adev);
-
- data_verify = kmalloc(len, GFP_KERNEL);
- if (!data_verify)
- goto end;
-
- /* now start a verification run */
- for (i = 0; i < len; i++) {
- write_reg32(adev, IO_ACX_EEPROM_CFG, 0);
- write_reg32(adev, IO_ACX_EEPROM_ADDR, addr + i);
- write_flush(adev);
- write_reg32(adev, IO_ACX_EEPROM_CTL, 2);
-
- count = 0xffff;
- while (read_reg16(adev, IO_ACX_EEPROM_CTL)) {
- if (unlikely(!--count)) {
- pr_acx("timeout waiting for EEPROM read\n");
- goto end;
- }
- cpu_relax();
- }
-
- data_verify[i] = read_reg16(adev, IO_ACX_EEPROM_DATA);
- }
-
- if (0 == memcmp(charbuf, data_verify, len))
- result = OK; /* read data matches, success */
-
- kfree(data_verify);
-end:
- FN_EXIT1(result);
- return result;
-}
-#endif /* UNUSED */
-
/* static */
inline void acxpci_read_eeprom_area(acx_device_t * adev)
{
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:05 UTC
Permalink
Drop redundant code in mem.c, pci.c, keep merge.c copy. Its static
inline, and called only from acx_reset_dev(), which is already merged.

Signed-off-by: Jim Cromie <***@gmail.com>
---
mem.c | 18 ------------------
pci.c | 17 -----------------
2 files changed, 35 deletions(-)

diff --git a/mem.c b/mem.c
index 37ee7c1..a165986 100644
--- a/mem.c
+++ b/mem.c
@@ -437,24 +437,6 @@ void acxmem_chaincopy_from_slavemem(acx_device_t *adev, u8 *destination,
* ==================================================
*/

-STATick inline void acxmem_read_eeprom_area(acx_device_t *adev)
-{
-#if ACX_DEBUG > 1
- int offs;
- u8 tmp;
-
- FN_ENTER;
-
- for (offs = 0x8c; offs < 0xb9; offs++)
- acx_read_eeprom_byte(adev, offs, &tmp);
-
- FN_EXIT0;
-
-#endif
-}
-
-
-
/*
* BOM CMDs (Control Path)
* ==================================================
diff --git a/pci.c b/pci.c
index 887ffa9..f5f3ddf 100644
--- a/pci.c
+++ b/pci.c
@@ -157,23 +157,6 @@ void acxpci_free_coherent(struct pci_dev *hwdev, size_t size,
* ==================================================
*/

-/* static */
-inline void acxpci_read_eeprom_area(acx_device_t * adev)
-{
-#if ACX_DEBUG > 1
- int offs;
- u8 tmp;
-
- FN_ENTER;
-
- for (offs = 0x8c; offs < 0xb9; offs++)
- acx_read_eeprom_byte(adev, offs, &tmp);
-
- FN_EXIT0;
-#endif // ACX_DEBUG > 1 acxpci_read_eeprom_area() body
-}
-
-
/*
* acxpci_s_upload_fw
*
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:06 UTC
Permalink
delete obsolete fn-protos, comments, and #if1 wrappers.

Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_func.h | 2 --
merge.c | 3 +--
pci.h | 9 ++-------
3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/acx_func.h b/acx_func.h
index 0482e5b..bedf78c 100644
--- a/acx_func.h
+++ b/acx_func.h
@@ -579,7 +579,6 @@ int acx_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
const char *cmdstr);
/* -
* Init, Configuration (Control Path)
- * - int acxpci_reset_dev(acx_device_t * adev);
* -
* Other (Control Path)
* -
@@ -644,7 +643,6 @@ int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
const char* cmdstr);
/* -
* Init, Configure (Control Path)
- * - int acxmem_reset_dev(acx_device_t *adev);
* -
* Other (Control Path)
* -
diff --git a/merge.c b/merge.c
index 9aa1625..3f16b1f 100644
--- a/merge.c
+++ b/merge.c
@@ -1919,7 +1919,7 @@ void acx_up(struct ieee80211_hw *hw)
* as well as uploads and verifies the firmware to the card
*/
int acx_verify_init(acx_device_t *adev);
-#if 1 // needs work
+
int acx_reset_dev(acx_device_t *adev)
{
const char* msg = "";
@@ -2075,7 +2075,6 @@ end:
FN_EXIT1(result);
return result;
}
-#endif // acxmem_reset_dev()

int acx_verify_init(acx_device_t *adev)
{
diff --git a/pci.h b/pci.h
index 4262285..d7478c0 100644
--- a/pci.h
+++ b/pci.h
@@ -24,16 +24,11 @@ int acxpci_validate_fw(acx_device_t *adev, const firmware_image_t *fw_image,

/* CMDs (Control Path) */
int acxpci_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
- void *buffer, unsigned buflen, unsigned cmd_timeout,
- const char *cmdstr);
+ void *buffer, unsigned buflen, unsigned cmd_timeout,
+ const char *cmdstr);

void acxpci_init_mboxes(acx_device_t *adev);

-/* Init, Configuration (Control Path) */
-int acxpci_reset_dev(acx_device_t *adev);
-
-/* Other (Control Path) */
-
/* Proc, Debug */
int acxpci_proc_diag_output(struct seq_file *file, acx_device_t *adev);
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:07 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_func.h | 48 ++++++------------------------------------------
1 file changed, 6 insertions(+), 42 deletions(-)

diff --git a/acx_func.h b/acx_func.h
index bedf78c..ae00a46 100644
--- a/acx_func.h
+++ b/acx_func.h
@@ -560,13 +560,6 @@ static inline struct ieee80211_hdr* acx_get_wlan_hdr(acx_device_t *adev,
* ==================================================
*/

-/* Data Access */
-
-/* =int acxpci_create_hostdesc_queues(acx_device_t * adev);
- * =void acxpci_create_desc_queues(acx_device_t * adev, u32 tx_queue_start, u32 rx_queue_start);
- * =void acxpci_free_desc_queues(acx_device_t * adev);
- */
-
/* Firmware, EEPROM, Phy
* - int acxpci_upload_radio(acx_device_t * adev);
* =int acxpci_read_eeprom_byte(acx_device_t * adev, u32 addr, u8 * charbuf);
@@ -584,20 +577,13 @@ int acx_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
* -
* Proc, Debug
* - int acxpci_proc_diag_output(struct seq_file *file, acx_device_t *adev);
- * =char *acxpci_proc_eeprom_output(int *len, acx_device_t * adev);
* -
* Rx Path
- * -
* Tx Path
* - tx_t *acxpci_alloc_tx(acx_device_t * adev);
- * =void *acxpci_get_txbuf(acx_device_t * adev, tx_t * tx_opaque);
- * =void acxpci_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);
- * =unsigned int acxpci_tx_clean_txdesc(acx_device_t * adev);
- * =void acxpci_clean_txdesc_emergency(acx_device_t * adev);
* - int acx100pci_set_tx_level(acx_device_t * adev, u8 level_dbm);
* -
* Irq Handling, Timer
- * - void acxpci_irq_work(struct work_struct *work);
* - void acxpci_set_interrupt_mask(acx_device_t * adev);
* -
* Mac80211 Ops
@@ -609,11 +595,6 @@ int acx_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
* - int acx111pci_ioctl_info(struct net_device *ndev, struct iw_request_info * - *info, struct iw_param *vwrq, char *extra);
* - int acx100pci_ioctl_set_phy_amp_bias(struct net_device *ndev, struct * - iw_request_info *info, struct iw_param *vwrq, char *extra);
* -
- * Driver, Module
- * -
- * - int __init acxpci_init_module(void);
- * - void __exit acxpci_cleanup_module(void);
- * -
*/

/*
@@ -621,21 +602,17 @@ int acx_issue_cmd_timeo_debug(acx_device_t * adev, unsigned cmd,
* ==================================================
*/

-/* Data Access
- * = int acxmem_create_hostdesc_queues(acx_device_t *adev);
- * = void acxmem_create_desc_queues(acx_device_t *adev, u32 tx_queue_start, * - u32 rx_queue_start);
- * =void acxmem_free_desc_queues(acx_device_t *adev);
- * -
+/*
* Firmware, EEPROM, Phy
* - int acxmem_upload_radio(acx_device_t *adev);
- * =int acxmem_read_eeprom_byte(acx_device_t *adev, u32 addr, u8 *charbuf);
*/
#ifdef UNUSED
-/* - int acxmem_s_write_eeprom(acx_device_t *adev, u32 addr, u32 len, const u8 //- *charbuf); */
+/*
+ * int acx_write_eeprom(acx_device_t *adev, u32 addr, u32 len,
+ * const u8 *charbuf);
+ */
#endif
-/* - int acxmem_read_phy_reg(acx_device_t *adev, u32 reg, u8 *charbuf);
- * - int acxmem_write_phy_reg(acx_device_t *adev, u32 reg, u8 value);
- * -
+/*
* CMDs (Control Path)
*/
int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
@@ -648,26 +625,17 @@ int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
* -
* Proc, Debug
* - int acxmem_proc_diag_output(struct seq_file *file, acx_device_t *adev);
- * =char *acxmem_proc_eeprom_output(int *len, acx_device_t *adev);
* -
* Rx Path
- * -
* Tx Path
- * - tx_t *acxmem_alloc_tx(acx_device_t *adev, unsigned int len);
- * - void acxmem_dealloc_tx(acx_device_t *adev, tx_t *tx_opaque);
- * -
- * =void *acxmem_get_txbuf(acx_device_t *adev, tx_t *tx_opaque);
* =void acxmem_init_acx_txbuf2(acx_device_t *adev);
* -
* =void acxmem_tx_data(acx_device_t *adev, tx_t *tx_opaque, int len, * - struct ieee80211_tx_info *ieeectl, struct sk_buff *skb);
- * =unsigned int acxmem_tx_clean_txdesc(acx_device_t *adev);
- * = void acxmem_clean_txdesc_emergency(acx_device_t *adev);
* -
* - void acxmem_update_queue_indicator(acx_device_t *adev, int txqueue);
* - int acx100mem_set_tx_level(acx_device_t *adev, u8 level_dbm);
* -
* Irq Handling, Timer
- * - void acxmem_irq_work(struct work_struct *work);
* - void acxmem_set_interrupt_mask(acx_device_t *adev);
* -
* Helpers
@@ -678,8 +646,4 @@ int acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
* int acx100mem_ioctl_set_phy_amp_bias(struct ieee80211_hw *hw, struct iw_request_info *info, struct iw_param *vwrq, char *extra);
*/

-/* - int __init acxmem_init_module(void);
- * - void __exit acxmem_cleanup_module(void);
- */
-
#endif /* _ACX_FUNC_H_ */
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:08 UTC
Permalink
Signed-off-by: Jim Cromie <***@gmail.com>
---
io-acx.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/io-acx.h b/io-acx.h
index f120ea3..2cca321 100644
--- a/io-acx.h
+++ b/io-acx.h
@@ -1,7 +1,6 @@

-/* ick: shouldnt declare things in headers
- * cuz including it 2x is bad
- */
+#ifndef _IO_ACX_H_
+#define _IO_ACX_H_

static const u16 IO_ACX100[] = {
0x0000, /* IO_ACX_SOFT_RESET */
@@ -85,3 +84,5 @@ static const u16 IO_ACX111[] = {
0x0104, /* IO_ACX_SOR_CFG */
0x0108, /* IO_ACX_ECPU_CTRL */
};
+
+#endif /* _IO_ACX_H_ */
--
1.7.10.1.487.ga3935e6
Jim Cromie
2012-05-12 06:25:09 UTC
Permalink
Use only the CONFIG_ACX_MAC80211_* symbols, the others add indirection
and confusion. The critical fixes are those in acx_struct{hw,dev}.h,
without these changes, the C files *MUST* define the non-CONFIG_*
symbols to correctly control what symbols and fields are defined.
And the C files are using the CONFIG_ACX_MAC80211_* symbols
exclusively anyway. With the headers converted, we can remove the
ACX_MAC80211_* defined in the C files without massive breakage.

Signed-off-by: Jim Cromie <***@gmail.com>
---
acx_struct_dev.h | 2 +-
acx_struct_hw.h | 4 ++--
mem.c | 2 --
pci.c | 1 -
usb.c | 9 ++++-----
5 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/acx_struct_dev.h b/acx_struct_dev.h
index f6ab6ba..4aa8058 100644
--- a/acx_struct_dev.h
+++ b/acx_struct_dev.h
@@ -520,7 +520,7 @@ struct acx_device {
#endif

/*** USB stuff ***/
-#ifdef ACX_MAC80211_USB
+#ifdef CONFIG_ACX_MAC80211_USB
struct usb_device *usbdev;

rxbuffer_t rxtruncbuf;
diff --git a/acx_struct_hw.h b/acx_struct_hw.h
index 4096b35..3630145 100644
--- a/acx_struct_hw.h
+++ b/acx_struct_hw.h
@@ -892,7 +892,7 @@ struct rxdesc {
} ACX_PACKED; /* size 52 = 0x34 */


-#if defined(ACX_MAC80211_PCI) || defined(ACX_MAC80211_MEM)
+#if defined(CONFIG_ACX_MAC80211_PCI) || defined(CONFIG_ACX_MAC80211_MEM)

/* Register I/O offsets */
#define ACX100_EEPROM_ID_OFFSET 0x380
@@ -999,7 +999,7 @@ struct rxhostdesc {
/***********************************************************************
* BOM USB structures and constants
*/
-#ifdef ACX_MAC80211_USB
+#ifdef CONFIG_ACX_MAC80211_USB

/* Used for usb_txbuffer.desc field */
#define USB_TXBUF_TXDESC 0xA
diff --git a/mem.c b/mem.c
index a165986..dbabcfd 100644
--- a/mem.c
+++ b/mem.c
@@ -36,8 +36,6 @@
** Eric McCorkle - Shadowsun
*/

-#define ACX_MAC80211_MEM 1
-
#include "acx_debug.h"

#define pr_acx pr_info
diff --git a/pci.c b/pci.c
index f5f3ddf..8d0cc49 100644
--- a/pci.c
+++ b/pci.c
@@ -15,7 +15,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#define ACX_MAC80211_PCI 1

#include "acx_debug.h"

diff --git a/usb.c b/usb.c
index 829d89d..9fc9bb4 100644
--- a/usb.c
+++ b/usb.c
@@ -15,18 +15,17 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * USB support for TI ACX100/TNETW1450 based devices. Many parts are taken from
- * the PCI driver.
+ * USB support for TI ACX100/TNETW1450 based devices. Many parts are
+ * taken from the PCI driver.
*
* Authors:
* Martin Wawro <martin.wawro AT uni-dortmund.de>
* Andreas Mohr <andi AT lisas.de>
*
* LOCKING
- * callback functions called by USB core are running in interrupt context
- * and thus have names with _i_.
+ * callback functions called by USB core are running in interrupt
+ * context and thus have names with _i_.
*/
-#define ACX_MAC80211_USB 1

#define pr_fmt(fmt) "acxusb.%s: " fmt, __FUNCTION__
#include "acx_debug.h"
--
1.7.10.1.487.ga3935e6
Loading...