Alan Ott | 23 Apr 2012 06:34
Picon
Favicon
Gravatar

[PATCH v1] ieee802154: MRF24J40 driver

Driver for the Microchip MRF24J40 802.15.4 WPAN module.

---

This is a first pass. All the places marked TODO contain things which I
think need to be fixed before merge. Some of these contain questions for
the Linux-Zigbee team. All comments appreciated.

I still plan change the structure of the SPI read functions to return an
error code.
---
 drivers/ieee802154/Kconfig    |    1 +
 drivers/ieee802154/mrf24j40.c |  747 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 748 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/mrf24j40.c

diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
index a9a6145..5703e7a 100644
--- a/drivers/ieee802154/Kconfig
+++ b/drivers/ieee802154/Kconfig
 <at>  <at>  -20,6 +20,7  <at>  <at>  config IEEE802154_FAKEHARD
           This driver can also be built as a module. To do so say M here.
 	  The module will be called 'fakehard'.

+<<<<<<< HEAD
 config IEEE802154_FAKELB
 	depends on IEEE802154_DRIVERS && MAC802154
 	tristate "Fake LR-WPAN driver with several interconnected devices"
diff --git a/drivers/ieee802154/mrf24j40.c b/drivers/ieee802154/mrf24j40.c
new file mode 100644
(Continue reading)

Alan Ott | 23 Apr 2012 08:26
Picon
Favicon
Gravatar

[PATCH v2] ieee802154: MRF24J40 driver

Driver for the Microchip MRF24J40 802.15.4 WPAN module.

---

This is a first pass. All the places marked TODO contain things which I
think need to be fixed before merge. Some of these contain questions for
the Linux-Zigbee team. All comments appreciated.

I still plan change the structure of the SPI read functions to return an
error code.

Changes in v2:
	fix checkpatch.pl issues.
	Properly add Makefile and Kconfig which weren't in the last one :(
---
 drivers/ieee802154/Kconfig    |   11 +
 drivers/ieee802154/Makefile   |    1 +
 drivers/ieee802154/mrf24j40.c |  745 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 757 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/mrf24j40.c

diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
index 05e1a13..56f34b8 100644
--- a/drivers/ieee802154/Kconfig
+++ b/drivers/ieee802154/Kconfig
 <at>  <at>  -48,3 +48,14  <at>  <at>  config IEEE802154_ADF7242
        tristate "ADF7242 transceiver driver"
        depends on IEEE802154_DRIVERS && MAC802154
        depends on SPI
+
(Continue reading)

Alan Ott | 14 Jun 2012 04:33
Picon
Favicon
Gravatar

[PATCH v3] ieee802154: MRF24J40 driver

Driver for the Microchip MRF24J40 802.15.4 WPAN module.

---

Changes in v3:
 changed MAX_SPEED logic.
 change all __u8 and __u16 to u8 and u16
 make read_short_reg() return status and take value pointer as parameter.
 change read_long_reg() to return status and take value pointer as a parameter.
 eliminate unnecessary casting.
 Fixed debugging printouts.
 Added additional TODO question
---
 drivers/ieee802154/Kconfig    |   11 +
 drivers/ieee802154/Makefile   |    1 +
 drivers/ieee802154/mrf24j40.c |  784 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 796 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/mrf24j40.c

diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
index b1f0ce8..7c8fde7 100644
--- a/drivers/ieee802154/Kconfig
+++ b/drivers/ieee802154/Kconfig
 <at>  <at>  -49,3 +49,14  <at>  <at>  config IEEE802154_ADF7242
        tristate "ADF7242 transceiver driver"
        depends on IEEE802154_DRIVERS && MAC802154
        depends on SPI
+
+config IEEE802154_MRF24J40
+       tristate "Microchip MRF24J40 transceiver driver"
(Continue reading)

Alexander Smirnov | 14 Jun 2012 09:22
Picon

Re: [PATCH v3] ieee802154: MRF24J40 driver

Hi,

just several trivial notes:

2012/6/14 Alan Ott <alan@...>:
> Driver for the Microchip MRF24J40 802.15.4 WPAN module.
>
> ---
>
> Changes in v3:
>  changed MAX_SPEED logic.
>  change all __u8 and __u16 to u8 and u16
>  make read_short_reg() return status and take value pointer as parameter.
>  change read_long_reg() to return status and take value pointer as a parameter.
>  eliminate unnecessary casting.
>  Fixed debugging printouts.
>  Added additional TODO question
> ---
>  drivers/ieee802154/Kconfig    |   11 +
>  drivers/ieee802154/Makefile   |    1 +
>  drivers/ieee802154/mrf24j40.c |  784 +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 796 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/ieee802154/mrf24j40.c
>
> diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
> index b1f0ce8..7c8fde7 100644
> --- a/drivers/ieee802154/Kconfig
> +++ b/drivers/ieee802154/Kconfig
>  <at>  <at>  -49,3 +49,14  <at>  <at>  config IEEE802154_ADF7242
>        tristate "ADF7242 transceiver driver"
(Continue reading)

Alan Ott | 15 Jun 2012 00:23
Picon
Favicon
Gravatar

Re: [PATCH v3] ieee802154: MRF24J40 driver

Hi Alexander,

Thanks for the notes. Responses inline:

On 06/14/2012 03:22 AM, Alexander Smirnov wrote:
> Hi,
>
> just several trivial notes:
>
> 2012/6/14 Alan Ott <alan@...>:
>> Driver for the Microchip MRF24J40 802.15.4 WPAN module.
>>
>> ---
>>
>> Changes in v3:
>>  changed MAX_SPEED logic.
>>  change all __u8 and __u16 to u8 and u16
>>  make read_short_reg() return status and take value pointer as parameter.
>>  change read_long_reg() to return status and take value pointer as a parameter.
>>  eliminate unnecessary casting.
>>  Fixed debugging printouts.
>>  Added additional TODO question
>> ---
>>  drivers/ieee802154/Kconfig    |   11 +
>>  drivers/ieee802154/Makefile   |    1 +
>>  drivers/ieee802154/mrf24j40.c |  784 +++++++++++++++++++++++++++++++++++++++++
>>  3 files changed, 796 insertions(+), 0 deletions(-)
>>  create mode 100644 drivers/ieee802154/mrf24j40.c
>>
>> diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
(Continue reading)

Alan Ott | 15 Jun 2012 00:36
Picon
Favicon
Gravatar

Re: [PATCH v3] ieee802154: MRF24J40 driver

On 06/14/2012 06:23 PM, Alan Ott wrote:
> On 06/14/2012 03:22 AM, Alexander Smirnov wrote:
>> 2012/6/14 Alan Ott <alan@...>:
>>> +
>>> +       /* Get the length of the data in the RX FIFO. */
>>> +       ret = read_long_reg(devrec, REG_RX_FIFO, &val);
>>> +       if (ret)
>>> +               goto out;
>>> +
>>> +       if (val > 143) {
>> What's the magic number?
>>
> The comment right below it describes it. Should I move that comment up
> to before the if statement?

Upon further inspection, you're right, this is messed up.

Alan.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Alexander Smirnov | 18 Jun 2012 08:24
Picon

Re: [PATCH v3] ieee802154: MRF24J40 driver

Hi Alan,

just one comment at the moment:

>>> +               dev_err(printdev(devrec),
>>> +                       "SPI write Failed for short register 0x%hhx\n", reg);
>>> +               goto out;
>> Hmmm, what does this goto mean?
>
> I could change the "out" labels if you prefer. Some other ieee802154
> drivers (serial.c) use "out", others (cc2420) use "err_ret", and other
> use "err" or "fail" for this kind of single-error exit-the-function-now
> kind of condition.
>
> I'll make them whichever you prefer :)

I mean that it hasn't any sense due to the label "out" goes right
after this goto.

>

Currently I have no time to review your updated patch, I'll do it
during this week.

With best regards,
Alexander

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
(Continue reading)

Alan Ott | 18 Jun 2012 21:12
Picon
Favicon
Gravatar

Re: [PATCH v3] ieee802154: MRF24J40 driver

On 06/18/2012 02:24 AM, Alexander Smirnov wrote:
>>>> +               dev_err(printdev(devrec),
>>>> +                       "SPI write Failed for short register 0x%hhx\n", reg);
>>>> +               goto out;
> I mean that it hasn't any sense due to the label "out" goes right
> after this goto.
>

Ok, I see what you mean. I see about 4 places like that in the code.
I'll fix it up. Thanks for the clarification.

> Currently I have no time to review your updated patch, I'll do it
> during this week.

Sounds good, and thanks for letting me know. I'll get v4 posted soon
with the goto fix.

As far as the BUG_ON() issue goes, the bad values should never actually
happen, because the driver gives the channel mask to the mac80211 layer
and it would be a bug if the mac80211 layer then called .set_channel()
with a channel that wasn't in the mask. Since maybe BUG_ON() is too
severe here, how about WARN_ON() instead?

Alan.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
(Continue reading)

Alan Ott | 15 Jun 2012 06:31
Picon
Favicon
Gravatar

[PATCH v4] ieee802154: MRF24J40 driver

Driver for the Microchip MRF24J40 802.15.4 WPAN module.

Changes in v4
  Remove unnecessary #includes.
  Fix comment style.
  Fix hard-coded magic FIFO size
  Fix C99 comment style.
  Fix BUG_ON() for TX buffer length.
  Added blank lines for readability.
  use print_hex_dump() instead of printk().
  Remove magic number 192us.
  remove sizeof(*devrec) in call to iee802154_alloc_device().
  rename mutex to buffer_mutex
  Remove extra read of interrupt status register.
---
 drivers/ieee802154/Kconfig    |   11 +
 drivers/ieee802154/Makefile   |    1 +
 drivers/ieee802154/mrf24j40.c |  780 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 792 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/mrf24j40.c

diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
index b1f0ce8..7c8fde7 100644
--- a/drivers/ieee802154/Kconfig
+++ b/drivers/ieee802154/Kconfig
 <at>  <at>  -49,3 +49,14  <at>  <at>  config IEEE802154_ADF7242
        tristate "ADF7242 transceiver driver"
        depends on IEEE802154_DRIVERS && MAC802154
        depends on SPI
+
(Continue reading)

Alan Ott | 15 Jun 2012 06:34
Picon
Favicon
Gravatar

Re: [PATCH v4] ieee802154: MRF24J40 driver

On 06/15/2012 12:31 AM, Alan Ott wrote:
> Driver for the Microchip MRF24J40 802.15.4 WPAN module.
>
> Changes in v4
>   Remove unnecessary #includes.
>   Fix comment style.
>   Fix hard-coded magic FIFO size
>   Fix C99 comment style.
>   Fix BUG_ON() for TX buffer length.
>   Added blank lines for readability.
>   use print_hex_dump() instead of printk().
>   Remove magic number 192us.
>   remove sizeof(*devrec) in call to iee802154_alloc_device().
>   rename mutex to buffer_mutex
>   Remove extra read of interrupt status register.

The issues from Alexander which are still to be addressed are:
    1. What to change the "out" labels to.
    2. BUG_ON() for set_channel()

Alan.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Alan Ott | 25 Jun 2012 01:14
Picon
Favicon
Gravatar

[PATCH v5] ieee802154: MRF24J40 driver

Driver for the Microchip MRF24J40 802.15.4 WPAN module.

Signed-off-by: Alan Ott <alan@...>
---

Changes in v5:
    remove unnecessary gotos
    change BUG_ON to WARN_ON
---
 drivers/ieee802154/Kconfig    |   11 +
 drivers/ieee802154/Makefile   |    1 +
 drivers/ieee802154/mrf24j40.c |  767 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 779 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/mrf24j40.c

diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
index b1f0ce8..7c8fde7 100644
--- a/drivers/ieee802154/Kconfig
+++ b/drivers/ieee802154/Kconfig
 <at>  <at>  -49,3 +49,14  <at>  <at>  config IEEE802154_ADF7242
        tristate "ADF7242 transceiver driver"
        depends on IEEE802154_DRIVERS && MAC802154
        depends on SPI
+
+config IEEE802154_MRF24J40
+       tristate "Microchip MRF24J40 transceiver driver"
+       depends on IEEE802154_DRIVERS && MAC802154
+       depends on SPI
+       ---help---
+         Say Y here to enable the MRF24J20 SPI 802.15.4 wireless
(Continue reading)

Alan Ott | 30 Aug 2012 06:16
Picon
Favicon
Gravatar

[PATCH v6 0/1] Driver for Microchip MRF24J40

This is a driver for the Microchip MRF24J40 802.15.4 transceiver.

Versions 1-5 and discussion can be found on the archives of the linux-zigbee
mailing list:

http://www.mail-archive.com/linux-zigbee-devel <at> lists.sourceforge.net/msg01014.html

Alan Ott (1):
  ieee802154: MRF24J40 driver

 drivers/ieee802154/Kconfig    |   11 +
 drivers/ieee802154/Makefile   |    1 +
 drivers/ieee802154/mrf24j40.c |  767 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 779 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/mrf24j40.c

Alan Ott | 3 Sep 2012 03:44
Picon
Favicon
Gravatar

[PATCH v7 0/1] Driver for Microchip MRF24J40

This is a driver for the Microchip MRF24J40 802.15.4 transceiver.

This is the same as v6 except that it now puts the driver in
drivers/net/ieee802154 instead of drivers/ieee802154, since
drivers/ieee802154 was recently moved to drivers/net/ieee802154 in
0739d643b8dda866d1011bcf

Full history and discussion can be found on the archives of the linux-zigbee
mailing list:

http://www.mail-archive.com/linux-zigbee-devel <at> lists.sourceforge.net/msg01014.html

Alan Ott (1):
  ieee802154: MRF24J40 driver

 drivers/net/ieee802154/Kconfig    |  11 +
 drivers/net/ieee802154/Makefile   |   1 +
 drivers/net/ieee802154/mrf24j40.c | 767 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 779 insertions(+)
 create mode 100644 drivers/net/ieee802154/mrf24j40.c

--

-- 
1.7.11.2

Alan Ott | 3 Sep 2012 03:44
Picon
Favicon
Gravatar

[PATCH v7 1/1] ieee802154: MRF24J40 driver

Driver for the Microchip MRF24J40 802.15.4 WPAN module.

Signed-off-by: Alan Ott <alan@...>
---
 drivers/net/ieee802154/Kconfig    |  11 +
 drivers/net/ieee802154/Makefile   |   1 +
 drivers/net/ieee802154/mrf24j40.c | 767 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 779 insertions(+)
 create mode 100644 drivers/net/ieee802154/mrf24j40.c

diff --git a/drivers/net/ieee802154/Kconfig b/drivers/net/ieee802154/Kconfig
index 1fc4eef..08ae465 100644
--- a/drivers/net/ieee802154/Kconfig
+++ b/drivers/net/ieee802154/Kconfig
 <at>  <at>  -34,3 +34,14  <at>  <at>  config IEEE802154_AT86RF230
         depends on IEEE802154_DRIVERS && MAC802154
         tristate "AT86RF230/231 transceiver driver"
         depends on SPI
+
+config IEEE802154_MRF24J40
+       tristate "Microchip MRF24J40 transceiver driver"
+       depends on IEEE802154_DRIVERS && MAC802154
+       depends on SPI
+       ---help---
+         Say Y here to enable the MRF24J20 SPI 802.15.4 wireless
+         controller.
+
+         This driver can also be built as a module. To do so, say M here.
+         the module will be called 'mrf24j40'.
diff --git a/drivers/net/ieee802154/Makefile b/drivers/net/ieee802154/Makefile
(Continue reading)

David Miller | 4 Sep 2012 20:46
Favicon

Re: [PATCH v7 1/1] ieee802154: MRF24J40 driver

From: Alan Ott <alan <at> signal11.us>
Date: Sun,  2 Sep 2012 21:44:13 -0400

> Driver for the Microchip MRF24J40 802.15.4 WPAN module.
> 
> Signed-off-by: Alan Ott <alan <at> signal11.us>

Applied to net-next, thanks.
Alexander Smirnov | 5 Sep 2012 10:05
Picon

Re: [PATCH v7 1/1] ieee802154: MRF24J40 driver

Dear colleagues,

2012/9/4 David Miller <davem@...>:
> From: Alan Ott <alan@...>
> Date: Sun,  2 Sep 2012 21:44:13 -0400
>
>> Driver for the Microchip MRF24J40 802.15.4 WPAN module.

I wan on vacation so had no possibility to review the code.
Alan, thank you for the contribution!

>>
>> Signed-off-by: Alan Ott <alan@...>
>
> Applied to net-next, thanks.

Thanks David.

Alex

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Alan Ott | 30 Aug 2012 06:16
Picon
Favicon
Gravatar

[PATCH v6 1/1] ieee802154: MRF24J40 driver

Driver for the Microchip MRF24J40 802.15.4 WPAN module.

Signed-off-by: Alan Ott <alan@...>
---
 drivers/ieee802154/Kconfig    |   11 +
 drivers/ieee802154/Makefile   |    1 +
 drivers/ieee802154/mrf24j40.c |  767 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 779 insertions(+), 0 deletions(-)
 create mode 100644 drivers/ieee802154/mrf24j40.c

diff --git a/drivers/ieee802154/Kconfig b/drivers/ieee802154/Kconfig
index 1fc4eef..08ae465 100644
--- a/drivers/ieee802154/Kconfig
+++ b/drivers/ieee802154/Kconfig
 <at>  <at>  -34,3 +34,14  <at>  <at>  config IEEE802154_AT86RF230
         depends on IEEE802154_DRIVERS && MAC802154
         tristate "AT86RF230/231 transceiver driver"
         depends on SPI
+
+config IEEE802154_MRF24J40
+       tristate "Microchip MRF24J40 transceiver driver"
+       depends on IEEE802154_DRIVERS && MAC802154
+       depends on SPI
+       ---help---
+         Say Y here to enable the MRF24J20 SPI 802.15.4 wireless
+         controller.
+
+         This driver can also be built as a module. To do so, say M here.
+         the module will be called 'mrf24j40'.
diff --git a/drivers/ieee802154/Makefile b/drivers/ieee802154/Makefile
(Continue reading)


Gmane