On Fri, Jun 27, 2014 at 05:35:00PM +0530, Varka Bhadram wrote:
> Hi Alex,
> 
> 
> On 06/27/2014 04:16 PM, Alexander Aring wrote:
> > +
> > +static void
> > +at86rf230_rx(struct at86rf230_local *lp,
> > +        const u8 *data, u8 len)
> 
> const u8 len ?
> 

len will be changed during runtime above, because the transceiver
doesn't filter if len > IEEE802154_MTU, then I will change it to
IEEE802154_MTU. See above.

> > +{
> > +   u8 lqi;
> > +   struct sk_buff *skb;
> > +   u8 rx_local_buf[AT86RF2XX_MAX_BUF];
> 
> memset() for rx_local_buf ?
> 

This can of course random data. I only want to have a fast enable_irq
here to ensure we can receive other package and I don't want to do this
after alloc_skb.

> > +
> > +   memcpy(rx_local_buf, data, len);
> > +   enable_irq(lp->spi->irq);
> > +
> > +   /* read full frame buffer and invalid lqi value to lowest
> > +    * indicator if frame was is in a corrupted state.
> > +    */
> > +   if (len < 2 || len > IEEE802154_MTU) {
> > +           lqi = 0;
> > +           len = IEEE802154_MTU;
> > +           dev_vdbg(&lp->spi->dev, "corrupted frame received\n");
> > +   } else {
> > +           lqi = rx_local_buf[len];
> > +   }
> > +
> > +   skb = alloc_skb(IEEE802154_MTU, GFP_ATOMIC);
> 
> Why IEEE802154_MTU ?.. why don't you use the len directly here.
> We may save some memory. The memory for the skbs will allocate
> from the memory pool, its better to save.
> 

mhh, I need to think about this. Maybe there are some other handling
with this skb and need to run skb_push or other functions which adds dataroom
and then we don't have this space. I would prefer to allocate the maximum
of the possible MTU.


btw:
You know we talking about 127 bytes and we live in the 21 century? :-)

- Alex

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to