I looked at the use of RX_SAFE_MODE and I came across two things
that look like bugs/misunderstandings:

- at86rf230_rx seems to assume that at86rf230_read_fbuf clears
  SR_RX_SAFE_MODE. The documentation is a bit ambiguous about this
  (uses "The Dynamic Frame Buffer Protection is enabled" and
  "Dynamic Frame Buffer Protection is released" in section 11.8.2).

  My understanding is that RX_SAFE_MODE is a flag that only changes
  when commanded by the host, while there's an invisible internal
  flag that gets set when a frame has been received and reset when
  the first buffer read has completed.

  I added instrumentation to at86rf230_read_fbuf to check
  TRX_CTRL_2, and RX_SAFE_MODE always stays on. I've also commented
  out the setting of RX_SAFE_MODE in at86rf230_read_fbuf and didn't
  see it get turned off.

- at86rf230_read_fbuf does two frame buffer read accesses to retrieve
  the frame. If my understanding of how RX_SAFE_MODE works is
  correct, frame buffer protection will be removed after the first
  read, and we'll race with incoming frames after that.

  A way to avoid this should be to retrieve the PHR with an SRAM
  read and to use the frame buffer read only for the payload.

Comments ? I still have to construct a proper test case for this ...

- Werner

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to