[PATCH 1/2] libertas: fix oops on the blackfin architecture

Dan Williams dcbw at redhat.com
Thu Sep 6 21:42:21 EDT 2007


On Fri, 2007-08-31 at 17:13 +0300, Vladimir Davydov wrote:
> Reserve two bytes to align pointer to the IP header.
> Initialize skb->dev pointer to current device.
> 
> Signed-off-by: Vladimir Davydov <vladimir.davydov at promwad.com>

Committed, thanks.  I didn't push the bit about skb->dev = priv->dev,
because I bet you're running in < 2.6.22, in which case you probably
want something more like this:

--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -138,10 +138,13 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
 {
 	lbs_deb_rx("skb->data %p\n", skb->data);
 
-	if (priv->mesh_dev && IS_MESH_FRAME(skb))
+	if (priv->mesh_dev && IS_MESH_FRAME(skb)) {
+		skb->dev = priv->mesh_dev;
 		skb->protocol = eth_type_trans(skb, priv->mesh_dev);
-	else
+	} else {
+		skb->dev = priv->dev;
 		skb->protocol = eth_type_trans(skb, priv->dev);
+	}
 	skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 	netif_rx(skb);


> ---
> 
> diff -Naur libertas.orig/if_cs.c libertas/if_cs.c
> --- libertas.orig/if_cs.c       2007-08-30 15:45:59.000000000 +0300
> +++ libertas/if_cs.c    2007-08-31 15:30:55.000000000 +0300
> @@ -398,10 +398,13 @@
>         }
> 
>         //TODO: skb = 
> dev_alloc_skb(len+ETH_FRAME_LEN+MRVDRV_SNAP_HEADER_LEN+EXTRA_LEN);
> -       skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE);
> +       skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + 2);
>         if (!skb)
>                 goto out;
> -       data = skb_put(skb, len);
> +       skb->dev = priv->dev;
> +       skb_put(skb, len);
> +       skb_reserve(skb, 2);/* 16 byte align */
> +       data = skb->data;
> 
>         /* read even number of bytes, then odd byte if necessary */
>         if_cs_read16_rep(priv->card, IF_CS_H_READ, data, len/sizeof(u16));
> 
> 




More information about the libertas-dev mailing list