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 ? > +{ > + u8 lqi; > + struct sk_buff *skb; > + u8 rx_local_buf[AT86RF2XX_MAX_BUF]; memset() for rx_local_buf ? > + > + 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. > + if (!skb) { > + dev_vdbg(&lp->spi->dev, "failed to allocate sk_buff\n"); > + return; > + } > + > + memcpy(skb_put(skb, len), rx_local_buf, len); > + > + /* We do not put CRC into the frame */ > + skb_trim(skb, len - 2); > + > + ieee802154_rx_irqsafe(lp->dev, skb, lqi); > +} > + > -Varka Bhadram ------------------------------------------------------------------------------ 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