1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-07-05 05:29:30 +03:00
Commit Graph

245 Commits

Author SHA1 Message Date
Werner Almesberger
7605d8c9c8 tools/atrf-txrx/atrf-txrx.c (main): removed endless loop in mode_hmac
That was for debugging. Oops.
2011-07-13 15:34:28 -03:00
Werner Almesberger
8f8c4140ac tools/lib/atusb-common.c (atusb_tx): wait for and receive the TX completion 2011-07-13 15:03:28 -03:00
Werner Almesberger
5621282eb8 tools/atrf-txrx/: added option -H to enter simple HardMAC mode
- atrf-txrx.c (receive_hmac, transmit_hmac): HardMAC send/receive
  functions
- atrf-txrx.c (usage, main): new option -H to use HardMAC
2011-07-12 17:46:24 -03:00
Werner Almesberger
49d6067e88 tools/lib/: added HardMAC functions to the atusb drivers 2011-07-12 17:46:11 -03:00
Werner Almesberger
862b554e2d libatrf: added HardMAC functions
This function set isn't really usable for real communication. Its main
purpose is to help with testing the firmware.

- tools/lib/driver.h (struct atrf_driver): added driver functions for
  HardMAC access
- tools/include/atrf.h (atrf_rx_mode, atrf_rx, atrf_tx),
  tools/lib/atrf.c: functions to enable/disable HardMAC mode and to
  send/receive frames
2011-07-12 17:45:59 -03:00
Werner Almesberger
97604d70f2 tools/usbperf/: measure the rate of control transfers a device can do 2011-07-09 23:14:41 -03:00
Werner Almesberger
50595979f5 Revert "tools/atrf-id/atrf-id.c: new option -D to read atusb debug log"
This reverts commit 391c37f587.

The log isn't so useful in its present state because we may have to
unplug/replug to get out of a troublesome condition.
2011-07-05 19:40:43 -03:00
Werner Almesberger
391c37f587 tools/atrf-id/atrf-id.c: new option -D to read atusb debug log 2011-07-05 18:53:32 -03:00
Werner Almesberger
f535a80c56 tools/lib/atben.c: check if the 8:10 slot is available and fail if it isn't
- atben.c (MMC_PATH, AT86RF230_PATH, find_file, slot_in_use): check
  if the MMC or AT86RF230 kernel driver uses the 8:10 card slot and
  print a detailed error message if it is
- atben.c (atben_open): fail if the 8:10 card slot is busy
2011-07-05 07:47:56 -03:00
Werner Almesberger
1615375dce tools/lib/atusb-common.c (atusb_open): give more detailed error message on EPERM 2011-07-05 00:17:20 -03:00
Werner Almesberger
10f618ac60 tools/atrf-rssi/gui.c (gui): accept keyboard input both from stdin and SDL 2011-07-04 20:29:22 -03:00
Werner Almesberger
56f8b2d038 tools/: moved get_key from atrf-path/gui.c to libatrf, for sharing
The old "raw" function becomes get_key_init. Calling get_key_init is
only necessary if one wants to control the moment standard input is
switched to raw mode. If get_key is invoked without a prior call to
get_key_init, it will initialize automatically.

- atrf-path/gui.c (raw, main): renamed "raw" to get_key_init
- atrf-path/gui.c (old_term, restore_term, get_key_init, get_key):
  moved to include/getkey.h and lib/getkey.c
- lib/getkey.c (get_key_init, get_key): made calling get_key_init
  optional
- lib/Makefile (OBJS): added getkey.o
2011-07-04 20:29:22 -03:00
Werner Almesberger
71f095d8de tools/Makefile (BEN_DIRS): add dirtpan iff its lowpan tools dependency is met 2011-07-04 20:29:22 -03:00
Werner Almesberger
ae348fb5cc switch linux-zigbee tools source from (old) tarball to git repository
- install/INSTALL-PC: updated build process of lowpan-tools to
  use the git repository
- tools/dirtpan/Makefile (CFLAGS): added include path for lowpan
  tools from git
2011-07-04 20:29:22 -03:00
Werner Almesberger
673d29a29a tools/Makefile (BEN_DIRS): comment out dirtpan again, to avoid hdr dependency 2011-06-30 15:56:54 -03:00
Werner Almesberger
0194dc1a05 tools/dirtpan/: added statistics collection, SIGUSR1 to dump, SIGUSR2 to reset
- dirtpan.c (stats, send_frame, send_more, send_ack, rx_pck, tx_pck,
  ack_timeout, reass_timeout): gather extensive statistics
- dirtpan.c (handle_usr1, main): if running in the foreground, dump
  statistics on standard error on SIGUSR1
- dirtpan.c (handle_usr2, main): if running in the foreground, reset
  statistics to zero on SIGUSR2
2011-06-26 00:03:56 -03:00
Werner Almesberger
417d12ce05 tools/Makefile (BEN_DIRS): added "dirtpan", so it's now included by default 2011-06-26 00:03:07 -03:00
Werner Almesberger
5392401c0a tools/atrf-rssi/: added menu for regulation area selection
- gui.c (area_off, gui): don't show a regulation area by default
- letter.h, letter.c: drawing of limited character set
- Makefile (OBJS_host, OBJS_ben_jlime): added letter.o
- gui.c (print, area_selector, gui): show regulation area selector
2011-06-24 22:29:17 -03:00
Werner Almesberger
9af0f937de tools/atrf-rssi/: added WLAN channel display (US, EU, and JP)
- gui.c (wlan_area): the currently displayed regulation domain
- gui.c (wlan_channels): return the number of WLAN channels
- gui.c (show_wlan_channel): determine whether the specified channel
  should be used in the currently displayed regulation domain
- gui.c (label_wlan_channels): show WLAN channel numbers and their
  width
- gui.c (gui): switch regulation domain with E (Europe), J (Japan),
  and U (US)
- gui.c (gui): quit now only if Q is pressed instead of any key
- gui.c (gui): call label_wlan_channels to display the WLAN channels
2011-06-24 21:50:28 -03:00
Werner Almesberger
7c12bf02c1 tools/atrf-xmit/atrf-xmit.c: cleaned up timeouts and interrupt polling
- atrf-xmit.c (xfer_one): wait 10 ms for the packet to be sent (1 ms
  was clearly too short)
- atrf-xmit.c (xfer_one): use wait_for_interrupt instead of
  atrf_interrupt_wait, so that the retry logic can do its work
2011-06-23 13:21:25 -03:00
Werner Almesberger
d8363d853c tools/lib/misctxrx.c (wait_for_interrupt): enforce a minimum timeout of 10 ms
Seems that just one millisecond isn't enough to get a byte from
the USB device, even if the byte is already waiting in the endpoint
FIFO there.
2011-06-23 13:21:05 -03:00
Werner Almesberger
8a2d80a93c tools/lib/atusb-common.c: updated for new interrupt handling in firmware
- atusb-common.c (atusb_interrupt_wait): the atusb firmware no longer
  reads and accumulates IRQs for us. We now just wait for the
  notification, then read IRQ_STATUS. Let higher layers take care of
  retries and all that.
- atusb-common.c (atusb_open): clear any pending interrupts
2011-06-23 13:14:39 -03:00
Werner Almesberger
b0b04ed226 tools/atrf-gpio/atusb.c (restore_gpios): send ATUSB_GPIO_CLEANUP 2011-06-20 23:15:30 -03:00
Werner Almesberger
f8f2f890d9 tools/lib/atusb-common.c (atusb_interrupt_wait): don't try to pull more irqs
ausb_bulk_read may lose data when timing out. We therefore try to
minimize the number of times we time out. Reading until no more
interrupts arrive may have looked like a good idea, but it just
causes trouble for now.
2011-06-20 22:58:46 -03:00
Werner Almesberger
cb20c55231 tools/lib/misctxrx.c (wait_for_interrupt): don't fragment timeouts
usb_bulk_read may lose data when timing out. We therefore try to
minimize the number of times we time out.
2011-06-20 22:56:59 -03:00
Werner Almesberger
f4ca3aed63 tools/atrf-proxy/: make WAIT 0 wait forever
- PROTOCOL: corrected obsolete part of WAIT behaviour
- PROTOCOL: mention that WAIT 0 waits forever
- atrf-proxy.c (cmd_more): don't convert WAIT argument 0 to 1
2011-06-20 22:14:52 -03:00
Werner Almesberger
70715a15d9 tools/lib/atben.c (atben_interrupt_wait): don't time out if timeout_ms == 0 2011-06-20 22:11:29 -03:00
Werner Almesberger
10b6d88af9 libatrf: simplify use of atrf_interrupt_wait now this it is mandatory
- lib/atrf.c (atrf_interrupt_wait): interrupt_wait is no longer
  optional
- atrf-proxy/atrf-proxy.c (cmd_more): we no longer need to handle
  atrf_interrupt_wait being unsupported
- lib/atusb-common.c (atusb_interrupt_wait): clarify what we don't
  want to return -1 on error
2011-06-20 21:14:14 -03:00
Werner Almesberger
d0fb1a8992 tools/: the great removal of atrf_interrupt
- atrf-proxy/PROTOCOL, atrf-proxy/atrf-proxy.c (cmd_zero): removed the
  POLL command
- lib/atben.c (atben_driver): don't export atben_interrupt anymore (we
  still use it internally)
- lib/atnet.c (atnet_interrupt, atnet_driver): removed atnet_interrupt
- lib/atusb-common.h (atusb_interrupt), lib/atusb-common.h
  (atusb_interrupt), lib/atusb-spi.c (atusb_spi_driver),
  lib/atusb.c (atusb_driver): removed atusb_interrupt
- lib/driver.h (struct atrf_driver): removed "interrupt"
- include/atrf.h (atrf_interrupt), lib/atrf.c (atrf_interrupt): removed
2011-06-20 21:10:41 -03:00
Werner Almesberger
76707d6b37 tools/lib/misctxrx.c (flush_interrupts): don't fall back to reading IRQ_STATUS
We now implement atrf_interrupt_wait in all drivers and don't need
the dubious fallback anymore.
2011-06-20 20:48:15 -03:00
Werner Almesberger
9952a20fda tools/lib/atben.c (atben_interrupt_wait): complain about stray interrupts
If INT_RF is high but IRQ_STATUS is clear, something strange is
happening. We complain but continue waiting.
2011-06-20 20:46:52 -03:00
Werner Almesberger
b7276d282a atrf-xmit/atrf-xmit.c: updated to no longer use atrf_interrupt
- atrf-xmit.c (xfer_one): use atrf_interrupt_wait instead of
  atrf_interrupt to pull the interrupt line
- atrf-xmit.c (xfer_one): removed delay-based wait to interrupt
- atrf-xmit.c (xfer_one): use atrf_interrupt_wait instead of reading
  REG_IRQ_STATUS directly
2011-06-20 20:41:30 -03:00
Werner Almesberger
b4a6e8ef46 tools/: major overhaul of wait_for_interrupt; uses atrf_interrupt_wait now
- include/misctxrx.h (wait_for_interrupt), lib/misctxrx.c
  (wait_for_interrupt): replaced sleep_us*timeout limiting mechanism
  with a single timeout value in milliseconds
- lib/misctxrx.c (wait_for_interrupt): use atrf_interrupt_wait instead
  of polling
- lib/misctxrx.c (wait_for_interrupt): cleaned up control flow
- lib/misctxrx.c (run, die, wait_for_interrupt): renamed variable "run"
  to more specific "sigint"
- atrf-txrx/atrf-txrx.c (ping_rx, ping): pass timeout in milliseconds,
  not deciseconds
- atrf-rssi/atrf-rssi.c (sweep), atrf-rssi/gui.c (sweep),
  atrf-txrx/atrf-txrx.c (init_txrx, receive_message, receive_pcap,
  receive, transmit, transmit_pattern, ping_tx, ping_rx),
  atrf-xmit/atrf-xmit.c (init_tx, init_rx, xfer_one),
  lib/cwtest.c (enter_test_mode_230, start_test_mode_231):
  updated use of wait_for_interrupt
2011-06-20 20:08:42 -03:00
Werner Almesberger
55354c7f91 tools/lib/atben.c: added support for interrupt_wait (polled)
- atben.c (atben_interrupt_wait): loop until either the timeout has
  been reached or an interrupt has occurred
- atben.c (atben_driver): added atben_interrupt_wait
2011-06-20 20:08:42 -03:00
Werner Almesberger
4d4cec6a67 tools/lib/timeout.h, tools/lib/timeout.c: added timeout/deadline functions 2011-06-20 19:11:51 -03:00
Werner Almesberger
106ef7ff7f tools/atrf-xmit/atrf-xmit.c: corrected title comment 2011-06-20 18:22:29 -03:00
Werner Almesberger
668d8c61cf tools/: added interrupt_wait support to atnet and atrf-proxy (untested)
- atrf-proxy/PROTOCOL: WAIT is now implemented and takes a timeout
  argument
- atrf-proxy/atrf-proxy.c (cmd_more): implemented WAIT command using
  atrf_interrupt_wait
- lib/atnet.c (atnet_interrupt_wait, atnet_driver): added
  interrupt_wait (using WAIT)
2011-06-20 17:42:48 -03:00
Werner Almesberger
b0dd5ced20 tools/: updated tools to use flush_interrupts
- atrf-txrx/atrf-txrx.c (init_txrx), atrf-xmit/atrf-xmit.c
  (init_common): instead of reading REG_IRQ_STATUS, use
  flush_interrupts to flush interrupts
2011-06-20 17:27:19 -03:00
Werner Almesberger
620709a20a libatrf: new function to reliably flush interrupts
- misctxrx.h (flush_interrupts), misctxrx.c: reliably flush interrupts
  on all drivers (with the exception of atnet talking to an atusb)
2011-06-20 17:21:40 -03:00
Werner Almesberger
110ecf67a1 tools/lib/: added interrupt_wait support to atusb and atusb-spi driver
- atusb-common.c (atusb_open): claim interface, so that we can do bulk
  I/O without complaints from the kernel
- atusb-common.h (atusb_interrupt_wait), atusb-common.c: blocking read
  for interrupt status byte on EP1
- atusb.c (atusb_driver), atusb-spi.c (atusb_spi_driver): provide the
  interrupt_wait operation
2011-06-20 17:10:29 -03:00
Werner Almesberger
e6f0a1d410 libatrf: new function atrf_interrupt_wait for interrupt-driven wait for interrupt
- tools/lib/driver.h (struct atrf_driver): new driver operation
  interrupt_wait
- include/atrf.h (atrf_interrupt_wait), atrf.c: new function to
  wait for a transceiver interrupt without polling
2011-06-20 17:10:29 -03:00
Werner Almesberger
a37bba8755 tools/lib: added USB-SPI driver for ATUSB
- atusb-spi.c: ATUSB driver that uses the ATUSB_SPI_* functions instead
  of ATUSB_{REG,BUF,SRAM}_*
- driver.h, atrf.c (drivers, atrf_usb_handle): added atusb_spi_driver
- Makefile (OBJS): added atusb-spi.o
2011-06-19 15:50:50 -03:00
Werner Almesberger
13f031be25 tools/lib/: split non-SPI code from atusb.c in preparation for SPI-based driver
- atusb.c (atusb_error, atusb_clear_error, atusb_open, atusb_close,
  atusb_reset, atusb_reset_rf, atusb_test_mode, atusb_slp_tr,
  atusb_interrupt, atusb_set_clkm, atusb_dev_handle): moved to
  atusb-common.c
- atusb-common.c (atusb_set_clkm): pass atusb_reg_write via
  atusb_driver.reg_write instead
- atusb.c (FROM_DEV, TO_DEV, struct atusb_dsc): moved to atusb-common.h
- Makefile (OBJS): added atusb-common.o
2011-06-19 14:06:00 -03:00
Werner Almesberger
9746205fd9 tools/lib/atusb.c: added missing standard #includes 2011-06-19 13:09:45 -03:00
Werner Almesberger
e77658fe26 tools/dirtpan/dirtpan.c: cleaned up embarrassing explanation of control byte
- dirtpan.c: changed control byte from innovative 7 bit layout to the
  more common 8 bits. My, haven't we had our morning coffee yet ?
- dirtpan.c: added explanation that the two highest bits of the
  control byte have to be zero, to avoid conflicting with RFC4944
2011-06-19 08:40:56 -03:00
Werner Almesberger
a800eb8794 tools/dirtpan/dirtpan.c: added missing #include "daemon.h", oops 2011-06-13 20:01:31 -03:00
Werner Almesberger
9ef447865b tools/: rearranged cwtest/atrf-path to be more clear about reset and do re-init
- include/cwtest.h (cw_test_needs_reset), lib/cwtest.c
  (cw_test_needs_reset): new function to indicate all cases where the
  transceiver needs to be reset (instead of using SLP_TR)
- lib/cwtest.c (cw_test_end): use cw_test_needs_reset instead of
  open-coding the decision
- lib/cwtest.c (enter_test_mode_230, start_test_mode_231): always wait
  for the PLL to lock. Contrary to the assumption in the previous
  commit, we should always see this interrupt.
- atrf-path/atrf-path.c (sample): initialize the transceiver if we had
  to reset it
- atrf-path/atrf-path.c (sample), atrf-path/atrf-path.c (do_half_sweep):
  moved the tTR19 delay to "sweep", so that all branches share it and it
  is taken only once
2011-06-13 14:24:59 -03:00
Werner Almesberger
8c00833542 lib/cwtest.c (start_test_mode_231): don't insist on IRQ_PLL_LOCK
We seem to have a path where the PLL is already locked when we get
there. We thus never get an interrupt and hang.

Pending further investigation, just use a timeout that is longer
than the worst-case PLL lock time.
2011-06-13 12:37:42 -03:00
Werner Almesberger
4d4e132f0a atrf-xmit: tightened checking of interrupt behaviour
- atrf-xmit.c (xfer_one): also check that also the sender has no
  pending interrupts before we start sending
- atrf-xmit.c (xfer_one): interrupt poll loop (now disabled) checked
  the sender, not the receiver. oops.
- atrf-xmit.c (xfer_one): upon reception, check that the sender has
  finished (IRQ_TRX_END) as well
2011-06-09 21:08:14 -03:00
Werner Almesberger
78ab017990 tools/atrf-proxy/atrf-proxy.c (cmd_zero): reduce poll delay from 100 ms to 2 ms
The overly generous delay has the effect of encouraging dubious
optimizations elsewhere. Not a good idea.
2011-06-09 20:54:07 -03:00