TODO
====

Code Maintenance and Style Fixing
=================================

These are in in priority order, top is highest.
Once they're DONE, move to bottom, and edit or delete.

---------
finish printk cleanup

most now converted, at least partly:
- printk("acx: ...")		to pr_acx("...")	[1]
- printk("acxusb: ...")		to pr_acxusb("...")	[1]
- printk("acxmem: ...")		to pr_acxmem("...")	[1]
- printk("...")			to pr_info("...")

[1] these defined to pr_info separately, allowing separate treatment

---------
de-duplicate pci.c & mem.c

diff -wbB --ifdef=FOO pci.c mem.c > uni-pci-mem.c
produces an ugly but possibly usable file.

jimc@chumly:~/projects/lx/acx-mac80211$ diff mem.c pci.c |wc
   6775   28665  206590
jimc@chumly:~/projects/lx/acx-mac80211$ diff -wb mem.c pci.c |wc
   5730   23760  170424
jimc@chumly:~/projects/lx/acx-mac80211$ diff -wbB mem.c pci.c |wc
   5642   23672  169865
jimc@chumly:~/projects/lx/acx-mac80211$ diff -wbBE mem.c pci.c |wc
   5642   23672  169865

sdiff -WbBE -w150 -l pci.c mem.c  # shows it more clearly:
overlaps in top-down order:

// Data Access - whitespace
static void acxpci_log_rxbuffer(const acx_device_t * adev)
static void acxpci_log_txbuffer(const acx_device_t * adev)

BOM Data Access
INLINE_IO - mem has additional blocks.

acx(pci|mem)_log_(rx|tx)buffer(): DONE

acx(pci|mem)_upload_radio(): DONE
	filename diffs only, #if0d in pci|mem, done
	called from common.c:acx_init_mac
	calls acx(pci|mem)_write_fw - TODO		     

acx(pci|mem)_read_phy_reg(): DONE
	Note: define acxdev_lock() mem ? acxmem_lock " void 0
	Later: look at acxusb_read_phy_reg()

acx(pci|mem)_irq_(enable|disable): DONE

acx(pci|mem)_op_(start|stop): DONE

acx(pci|mem)_read_eeprom_byte(): DONE
acx(pci|mem)_proc_eeprom_output(): DONE
acx(pci|mem)_up(): DONE

DONE: #if1d in mem.c, #if0d in merge.c pending proper merging
  int acxmem_write_fw(acx_device_t *adev,
  acxmem_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd,
  int acxmem_reset_dev(acx_device_t *adev)

acx(pci|mem)_up(): DONE
acx(pci|mem)_handle_info_irq(): DONE
acx(pci|mem)_set_interrupt_mask(): DONE
acx_show_card_eeprom_id(): DONE

acx(mem|pci)_create_(tx|tx)_desc_queue(): DONE
   maybe later, refactor IS_MEM|PCI branches into _helpers
					  
acx(mem|pci)_tx_clean_txdesc(): DONE
   maybe later, refactor IS_MEM|PCI branches into _helpers

acx(pci|mem)_get_txdesc(): DONE
acx(pci|mem)_advance_txdesc(): DONE
acx(pci|mem)_tx_data(): DONE
acx(mem|pci)_get_txhostdesc(): DONE
acx(pci|mem)_get_txbuf(): DONE

acx(pci|mem)_process_rxdesc(): DONE

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(): DONE
  diffs around ITERATE
  slave_mem - need wrappers 
  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():
  has locking adds
  counter goofiness, cruft
  copy-to-slave
  acxpci_write_cmd_type_status(adev, 0, 0);
    VS acxmem_write_cmd_type_status(adev, ACX1xx_CMD_RESET, 0);


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

acx(pci|mem)_write_phy_reg()
  copied from mem.c, but needs work before use

acx(pci|mem)_write_eeprom_byte()  (UNUSED)

acx(pci|mem)_issue_cmd_timeo_debug() fair divergence
acx(pci|mem)_interrupt()   (comment diffs)
acx111(pci|mem)_ioctl_info() (extra printks in mem

---------
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: DONE

---------
acx_proc_show_eeprom(struct seq_file *file, void *v)

does seq_putc for buf, prbly a better/faster way.

---------
acxpci_read_eeprom_byte(acx_device_t * adev, u32 addr, u32 len,

add cpu-burn counter to assess wait-loop,
recode wait-loop to helper, replace multiple uses.

---------
compare load-firmware code to in-tree uses.
pci & mem both do this (see above)

---------
Make CONFIG_PCI check in acx_reset_dev():acxpci_reset_mac(); a runtime check.

DONE
---------
in acx_proc_show_eeprom(struct seq_file *file, void *v)
	// OW Hopefully enough. TODO see if eeprom fns can size it
	const int buf_size = 1024*64;

large malloc.  can push sizing down to callees, and return *buf

acxpci_proc_eeprom_output(buf, adev);
  only uses 0x400, so yes, here.

acxmem_proc_eeprom_output(buf, adev);
  uses 0xffff


Functional
==========

* Acx100: Add STA PS support (TIM updates)

* Add Monitor Mode support (Acx1xx)

* Fix/add runtime device full-reset (Acx1xx)

- Specifically acx100 can get into a state, where only a full reset can recover
things (emergency cleanup of descriptors/buffer show no effect)
- Integrate with mac80211 functionality, to re-initialize resetted hw
- Build a kind of watchdog, is-alive test, to determine a stuck device and
trigger reset (exact criteria TBC, could be e.g. rx/tx-complete activity/irqs
within a typical period)
- In this context the the startup logging with the initial card config could be
reviewed

* TBC: Use ether-addr from eeprom (Acx1xx)
- Currently it can happen, that devices use the same ether-addr, which is
not ideal (obviously). Check if the eeprom contains a factory ether-addr, that
could then be used

* Add HW-scan support (Acx1xx)
- Hw-scanning is possibly faster/less stress-full for device

* Add device suspend / resume support (Acx1xx, mem/pci/usb)
- Can probably well combined with full reset support, see above

* Refine Rx-Filter config (Acx1xx):
- Refine translation of mac80211 rx-filter config into corresponding hw
configuration

* Signal strength: Check if signal strengtg is correctly reported (Acx1xx):
- FW value correct / plausible
- Reported value in correct form ? (abs,rel,dBm*100,etc?)

* Regulatory-Domain (Acx1xx): Improve intergration/setting of reg-domain with
mac80211

* Multi-vif support (Acx1xx)
- TBC: Support multiple ethernet addresses
- TBC: How to trade-off between multiple vifs and available hw/fw support
resources (e.g. templates, crypto, auto-ack)
. Rx-configs to use

* HW crypto (Acx1xx): Port-back WEP HW crypto support (start with WEP, even if
technically not much relevant anymore, it could maybe help to achieve TKIP
after)

* Add WDS support

Fixes
===

* Writing to tx_level in debugfs (e.g. echo 1>/debug/acx_mac80211/phy14/tx_level)
---
[ 6876.976340] BUG: unable to handle kernel NULL pointer dereference at 00000034
[ 6876.980018] IP: [<f8bc66f2>] acx111_proc_write_tx_level+0x28/0xed [acx_mac80211]
---
