1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-16 22:22:49 +02:00
Commit Graph

23 Commits

Author SHA1 Message Date
Werner Almesberger
2961482cac tools: atrf-id option -s to retrieve driver spec, with necessary infrastructure
- include/atrf.h (atrf_driver_spec), lib/atrf.c (atrf_driver_spec):
  new function to retrieve the local or remote/final driver spec
- lib/atrf.c (struct atrf_dsc, atrf_open, atrf_close): record the local
  driver spec
- lib/driver.h (struct atrf_driver): new driver function "driver_spec"
  to retrieve the driver spec
- lib/atnet.c (struct atnet_dsc, atnet_open, atnet_close): maintain a
  cache for the driver spec
- lib/atnet.c (atnet_driver_spec, atnet_driver): added support for the
  "driver_spec" function
- atrf-proxy/PROTOCOL, atrf-proxy/atrf-proxy.c (cmd_zero): added command
  SPEC to retrieve the (final) driver spec
- atrf-id/atrf-id.c (usage, main): added option -s to retrieve the
  driver spec. One -s retrieves the local spec, -s -s the remote/final.
2011-04-20 08:58:17 -03:00
Werner Almesberger
4fa909debc libatrf: renamed driver specification argument from "arg" to "spec"
- tools/include/atrf.h (atrf_open), tools/lib/atrf.c (select_driver,
  atrf_open): renamed "arg" argument to "spec"
2011-04-20 08:15:19 -03:00
Werner Almesberger
a15ab43b1c tools/lib/atrf.c (select_driver): "default" selects the default driver 2011-04-19 23:37:44 -03:00
Werner Almesberger
95c8fce729 tools/lib/atusb.c: eliminated global variable to allow for multiple sessions
- atusb.c: introduced descriptor structure, replacing direct USB device
  handle
- atusb.c (error): moved global variable into descriptor
- driver.h (atusb_dev_handle), atusb.c (atusb_dev_handle), atrf.c
  (atrf_usb_handle): call driver to perform the no longer trivial
  translation
2011-04-12 09:22:40 -03:00
Werner Almesberger
39319e145a tools/lib/: added network proxy-based driver (in progress)
- atnet.c: driver "net", which accessed hardware via atrf-proxy
- Makefile (OBJS): added atnet.o
- driver.h (atnet_driver), atrf.c (drivers): added the atnet driver
- atrf.c (drivers): moved the driver list closer to the top
2011-04-10 19:55:48 -03:00
Werner Almesberger
7be700df11 tools/lib/atrf.c: perform driver-specific operations only if using that driver
- atrf.c (atrf_usb_handle): only return the handle if using the atusb
  driver
- atrf.c (atrf_ben_regs): only call atben_regs if using the atben driver
2011-04-10 19:55:48 -03:00
Werner Almesberger
641567e393 tools/lib/atrf.c: moved declaration of driver operations to driver.h 2011-04-10 19:55:47 -03:00
Werner Almesberger
1a27e590d9 tools/: cleaned up the gross layering violation in atrf-xtal/atben.c
- include/atrf.h (atrf_ben_regs), lib/atrf.c (atrf_ben_regs),
  lib/driver.h (atben_regs), lib/atben.c (atben_regs): new function to
  get the mmap'ed registers in a less disgusting way
- atrf-xtal/atben.c (base, ben_setup): cleaned up the horrible layering
  violation
2011-04-10 07:28:27 -03:00
Werner Almesberger
1175923df7 tools/lib/atrf.c (select_driver): fixed name length calculation 2011-04-09 22:38:46 -03:00
Werner Almesberger
54edf17a1e libatrf: new function atrf_default_driver_name to get the default driver name
- include/atrf.h (atrf_default_driver_name),
  lib/atrf.c (atrf_default_driver_name): return the name of the default
  driver, or "none" if no drivers are defined
2011-04-09 22:35:29 -03:00
Werner Almesberger
adc14c4742 tools/lib/: make driver name matching case-sensitive and lower-case names
Case-sensitive is the Unix way, and so is avoiding unnecessary upper-case.

- atben.c (atben_driver): changed name from "Ben" to "ben"
- atusb.c (atusb_driver): changed name from "USB" to "usb"
- atrf.c (select_driver): made driver name matching case-sensitive
2011-04-09 21:18:31 -03:00
Werner Almesberger
5296fc8cf5 tools/: API change - atrf_open now requires a string argument (can be NULL)
atrf_open(NULL) maintains the old behaviour. To select a driver, use
atrf_open("name") or atrf_open("name:driver-specific-arguments")
The driver name is "ben" or "usb".

- include/atrf.h (atrf_open), lib/atrf.c (do_atrf_open, atrf_open):
  atrf_open now requires the string argument for driver selection
- atrf-id/atrf-id.c (main), atrf-reset/atrf-reset.c (main),
  atrf-rssi/atrf-rssi.c (main), atrf-trim/atrf-trim.c (main),
  atrf-txrx/atrf-txrx.c (main), atrf-xtal/atrf-xtal.c (main):
  changed atrf_open() to atrf_open(NULL)
2011-04-09 21:13:11 -03:00
Werner Almesberger
c18d3e58d2 tools/lib/: added driver selection and driver-specific parameters to backend
- atrf.c (atrf_open, select_driver, do_atrf_open): added infrastructure
  for passing the driver name and further parameters to atrf_open
- atrf.c (struct atrf_dsc): made "driver" constant
- driver.h (struct atrf_driver), atben.c (atben_open), atusb.c
  (atusb_open): added string argument to the "open" function
- atusb.c (atusb_driver): corrected unterminated comment
2011-04-09 21:00:48 -03:00
Werner Almesberger
fe2720e63a tools/: new libatrf function atrf_slp_tr to control SLP_TR (for now only atben)
- include/atrf.h, lib/atrf.c (atrf_slp_tr): new function to set the SLP_TR
  line
- lib/driver.h (struct atrf_driver): added driver function slp_tr
- lib/atusb.c (atusb_driver): we dont support slp_tr yet
- lib/atben.c (atben_slp_tr, atben_driver): implement SLP_TR control
2011-04-03 20:13:38 -03:00
Werner Almesberger
b0c15b7e7c tools: give the driver control over CLKM (for ATmega32U2 boards)
- include/atrf.h (atrf_set_clkm), lib/atrf.c (atrf_set_clkm): set or
  disable CLKM
- lib/driver.h (atrf_set_clkm_generic), lib/atrf.c (atrf_set_clkm_generic):
  generic function to set CLKM without restrictions
- lib/driver.h (struct atrf_driver): added driver operation "set_clkm"
  to set CLKM
- lib/atusb.c (atusb_set_clkm, atusb_driver): restrict CLKM on ATmega32U2
  boards
- atrf-txrx/atrf-txrx.c (init_txrx): use atrf_set_clkm to set CLKM
- atrf-txrx/atrf-txrx.c (init_txrx, main): pass CLKM frequency in MHz
  instead of code point
2011-02-10 23:11:34 -03:00
Werner Almesberger
e73ca5fcd5 tools/lib: cache chip ID in the descriptor
- atrf.c (struct atrf_dsc): added field "chip_id" to cache chip ID
- atrf.c (identify, atrf_identify): moved identification logic to new
  function
- atrf.c (atrf_open, atrf_identify): cache chip ID when opening the
  device and return ID from cache
2011-02-10 21:15:05 -03:00
Werner Almesberger
1cd079ee82 great atusd -> atben renaming: changed remaining references in tools/
- Makefile.common (MACROS_ben_jlime, MACROS_ben_openwrt), lib/atrf.c
  (atrf_open): changed HAVE_USD to HAVE_BEN
- lib/atben.c: changed "uSD version" in title to "Ben 8:10 card version"
- lib/atrf.c, lib/atben.c: changed all occurrences of "atusd" to "atben"
2011-01-17 12:06:16 -03:00
Werner Almesberger
a9321cea7c libatrf: new function atrf_identify to identify the chip
- tools/lib/atrf.h, tools/lib/atrf.c (atrf_identify): added chip
  identification function to library
- tools/atrf-id/atrf-id.c (show_info): print information returned by
  atrf_identify
- tools/atrf-id/atrf-id.c (show_info): decode JEDEC manufacturer ID
2011-01-07 12:35:51 -03:00
Werner Almesberger
a8a898e202 The Great ATSPI Renaming, part 9: update comments as well
- Makefile.common, lib/atrf.c, lib/atusd.c: change ATSPI to ATRF in title
  comment
- include/atrf.h: comment still referred to atrf-id as "atspi-id"
2010-11-11 10:30:37 -03:00
Werner Almesberger
bcd3691c8a The Great ATSPI Renaming, part 6: change atrf API from atspi_* to atrf_*
- include/atrf.h, lib/atrf.c (struct atspi_dsc): renamed to "struct
  atrf_dsc"
- include/atrf.h, lib/atrf.c (atspi_*): renamed all functions to atrf_*
- include/misctxrx.h, lib/misctxrx.c (wait_for_interrupt): updated for API
  name change
- atspi-id/atspi-id.c (show_usb_info, show_info, main),
  atspi-reset/atspi-reset.c (main), atspi-rssi/atspi-rssi.c (sweep, main),
  atspi-rssi/gui.h (gui), atspi-rssi/gui.c (sweep, gui),
  atspi-trim/atspi-trim.c (main), atspi-txrx/atspi-txrx.c (init_txrx,
  set_channel, set_power, receive, transmit, test_mode, main):
  updated for API name change
2010-11-11 10:10:13 -03:00
Werner Almesberger
688df9771d The Great ATSPI Renaming, part 5: rename "struct atspi_driver" to "atrf_driver"
- lib/driver.h: rename "struct atspi_driver" to "struct atrf_driver"
- lib/atrf.c, lib/atusb.c, lib/atusd.c: track above change
2010-11-11 09:04:36 -03:00
Werner Almesberger
cf23ac6128 The Great ATSPI Renaming, part 4: rename include/atspi.h to include/atrf.h
- include/atspi.h: renamed to include/atrf.h
- include/misctxrx.h, lib/atrf.c, lib/misctxrx.c, atspi-id/atspi-id.c,
  atspi-reset/atspi-reset.c, atspi-rssi/atspi-rssi.c, atspi-rssi/gui.c,
  atspi-rssi/gui.h, atspi-trim/atspi-trim.c, atspi-txrx/atspi-txrx.c:
  change  #include "atspi.h"  to  #include "atrf.h"
2010-11-11 08:58:47 -03:00
Werner Almesberger
84b61f35f2 The Great ATSPI Renaming, part 3: rename libatspi.a to libatrf.a
- tools/lib/atspi.c: renamed to atrf.c
- tools/lib/Makefile (OBJS): track above change
- tools/Makefile.common (LDLIBS), tools/lib/Makefile (LIB): rename the
  whole library from libatspi to libatrf
2010-11-11 08:48:08 -03:00