Hello, 
I am trying to understand the at86rf230.c source code, but unfortunately
I am stuck with understanding the purpose of some variables and pointers
that are handed over in some functions. 
For example the function "at86rf230_state(struct ieee802154_dev *dev,
int state)", which is supposed to change the status of the register to
"state". 

At the beginning it invokes the function "atrf230_read_subreg(lp,
SR_TRX_STATUS, &val)", to read the status before writing it. So far so
good. But when I go back and take a deeper look at
"__atrf230_read_subreg" it seems to me that "SR_TRX_STATUS" and "val"
are only used for debugging reasons and "val" is actually only filled
with 0xff. (Similar applies to at86rf230_write_subreg.) 
It appears to me that the actual information which results of reading in
the register is stored in lp, since eventually "spi_message msg" points
on the buffer of "lp". "msg" is handed over in the function "spi_sync",
which corresponds to the actual spi-transmission, as I believe. 
This all doesn't make sense to me because a few lines below I find this
"if (val == state)" 
If "val" is always 0xFF (11111111) this condition will always be false
and thus there is no point in writing such a condition.  

Apparently I am missing something. Can anyone help me understand what
the variables and pointers are good for? (I am new linux drivers)
thanks and regards
Gerrit 





------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Linux-zigbee-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to