Skip to contentSkip to conversation

at86rf230: various fixes

PATCH In review Alexander Aring 3 participants 4 messages Apr 14, 2014 – Apr 15, 2014 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Alexander Aring

author maintainer
#0 lore raw

v2 cover at86rf230: various fixes

Hi,

I currently working on a big cleanup for the at86rf230 and I detect some bugs in the current implementation. I will send patch stacks if net-next is open again.

It's funny to find the forgotten shift and mask in the __at86rf230_read_subreg function but it only makes trouble if csma is activated that's why it still works before for me.

- Alex

changes since v2:
- correct a few text corrections (Werner helped me there, thanks!)
- Add Reviewed by Werner Almesberger

Alexander Aring (2):
at86rf230: remove check if AVDD settled
at86rf230: fix __at86rf230_read_subreg function

 drivers/net/ieee802154/at86rf230.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
Signature · 1 line
1.9.2

A message that is not in the archive (sent off-list or not yet received): 1397494082-9394-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH v2 1/2 at86rf230: remove check if AVDD settled

The AVDD regulator is only enabled when the RF section is active TX_ON (PLL_ON) state. Since commit 7dcbd22a97eb0689e6c583ad630ae0e7341e34c1 ("ieee802154: ensure that first RF212 state comes from TRX_OFF"). We are in TRX_OFF state at the time at86rf230_hw_init is run.

Note that this test would only fail in case of a severe hardware malfunction (faulty/shorted power supply, etc.) so it wasn't all that useful in the first place.

---
 drivers/net/ieee802154/at86rf230.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/net/ieee802154/at86rf230.c +0 -8
index 430bb0d..e102eef 100644
@@ -1025,14 +1025,6 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
 		return -EINVAL;
 	}
 
-	rc = at86rf230_read_subreg(lp, SR_AVDD_OK, &status);
-	if (rc)
-		return rc;
-	if (!status) {
-		dev_err(&lp->spi->dev, "AVDD error\n");
-		return -EINVAL;
-	}
-
 	return 0;
 }
 
Signature · 9 lines
1.9.2


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
#3 lore raw

PATCH v2 2/2 at86rf230: fix __at86rf230_read_subreg function

In reply to a message not in the archive

The __at86rf230_read_subreg function don't mask and shift register contents which it should do. This patch adds the necessary masks and shift operations in this function.

Since we have csma support this can make some trouble on state changes. Since CSMA support turned on some bits in the TRX_STATUS register that used to be zero, not masking broke checking of the TRX_STATUS field after commanding a state change.

---
 drivers/net/ieee802154/at86rf230.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/at86rf230.c +1 -1
index e102eef..e36f194 100644
@@ -365,7 +365,7 @@ __at86rf230_read_subreg(struct at86rf230_local *lp,
 	dev_vdbg(&lp->spi->dev, "buf[1] = %02x\n", buf[1]);
 
 	if (status == 0)
-		*data = buf[1];
+		*data = (buf[1] & mask) >> shift;
 
 	return status;
 }
Signature · 9 lines
1.9.2


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
maintainer
#4 lore raw
In reply to Alexander Aring

From: Alexander Aring <[email protected]>
Date: Mon, 14 Apr 2014 18:48:00 +0200

Quoted 7 lines

I currently working on a big cleanup for the at86rf230 and I detect some bugs in the current implementation. I will send patch stacks if net-next is open again.

It's funny to find the forgotten shift and mask in the __at86rf230_read_subreg function but it only makes trouble if csma is activated that's why it still works before for me.

Series applied.