Re: [PATCH bluetooth-next 15/18] at86rf230: generate random perm extended address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Varka,

On Thu, Nov 06, 2014 at 11:05:52AM +0100, Alexander Aring wrote:
> On Thu, Nov 06, 2014 at 11:22:45AM +0530, Varka Bhadram wrote:
> > On Thursday 06 November 2014 01:21 AM, Alexander Aring wrote:
> > > This patch adds support for a random generated perm extended address for
> > > the at86rf230 driver.
> > >
> > > Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx>
> > > ---
> > >   drivers/net/ieee802154/at86rf230.c | 1 +
> > >   1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
> > > index bf47785..a6db768 100644
> > > --- a/drivers/net/ieee802154/at86rf230.c
> > > +++ b/drivers/net/ieee802154/at86rf230.c
> > > @@ -1534,6 +1534,7 @@ static int at86rf230_probe(struct spi_device *spi)
> > >   lp->spi = spi;
> > >   hw->parent = &spi->dev;
> > >   hw->vif_data_size = sizeof(*lp);
> > > + ieee802154_random_extended_addr(&hw->phy->perm_extended_addr);
> > >
> > >   lp->regmap = devm_regmap_init_spi(spi, &at86rf230_regmap_spi_config);
> > >   if (IS_ERR(lp->regmap)) {
> > 
> > You are getting this extended address here and configuring at the time
> > of iface add.
> > 
> > This change should be there for other drivers ( CC2520 & MRF24J40 ) also ..?
> > 
> 
> yes, but please refer before if these transceivers supports some eeprom
> or serial id where the extended addr could be generated from.
> 
> Otherwise we need to generate a random one. This value can also get from
> device tree or extended addr, but we are far away to support such
> behaviour. If somebody wants to implement this, please send patches to
> me and device tree ml.
> 

what's about this, to having a zero address perm_extended_addr address
is defintly a bug in your driver.

My respone here was more a (this is not really c, but mention what I
meant here):

switch (CC2520_supports)
case EEPROM_FOR_EUI64:
	perm_extended_addr = readout_eeprom;
	break;
case SERIAL_ID_REGISTERS_FOR_EUI64:
	perm_extended_addr = readout_registers;
	break;
default:
	perm_extended_addr = generate_random_one;
}

So if you don't have case 1 and 2, then generate a random one.

Also please check for reset values for phy settings like
current_channel, current_page...

Maybe wait some time when cca handling patches are in then you can
changes also the cca mode to the default value after reset.

- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux