From patchwork Mon Nov 10 16:11:48 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Villac=C3=AD=C2=ADs_Lasso?= X-Patchwork-Id: 8020 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 63F07DDDE3 for ; Tue, 11 Nov 2008 03:12:43 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753380AbYKJQMi (ORCPT ); Mon, 10 Nov 2008 11:12:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752991AbYKJQMi (ORCPT ); Mon, 10 Nov 2008 11:12:38 -0500 Received: from host-200-93-199-98.telconet.net ([200.93.199.98]:58408 "EHLO elastix.palosanto.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752837AbYKJQMh (ORCPT ); Mon, 10 Nov 2008 11:12:37 -0500 Received: by elastix.palosanto.com (Postfix, from userid 501) id 02C9C1B08F21; Mon, 10 Nov 2008 11:12:36 -0500 (ECT) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on elastix.palosanto.com X-Spam-Level: X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from srv64.palosanto.com (unknown [192.168.1.64]) by elastix.palosanto.com (Postfix) with ESMTP id 4B5451B08C82; Mon, 10 Nov 2008 11:12:35 -0500 (ECT) Message-ID: <49185D44.8080809@ceibo.fiec.espol.edu.ec> Date: Mon, 10 Nov 2008 11:11:48 -0500 From: =?ISO-8859-1?Q?Alex_Villac=ED=ADs_Lasso?= User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: irda-users@lists.sourceforge.net, netdev@vger.kernel.org Subject: [2/3] IRDA stack should call irda_get_skb_cb (tx_extra implementation) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org A rewrite of the original patch by Samuel Ortiz, for the tx_extra implementation. Does away with irda_alloc_skb which is irrelevant for this implementation. Based on a patch by Samuel Ortiz Signed-off-by: Alex VillacĂ­s Lasso diff -ur linux-2.6.28-rc3-git-orig/include/net/irda/irda_device.h linux-2.6.28-rc3-git/include/net/irda/irda_device.h --- linux-2.6.28-rc3-git-orig/include/net/irda/irda_device.h 2008-11-08 12:05:58.000000000 -0500 +++ linux-2.6.28-rc3-git/include/net/irda/irda_device.h 2008-11-08 12:07:35.000000000 -0500 @@ -244,7 +244,7 @@ */ static inline __u16 irda_get_mtt(const struct sk_buff *skb) { - const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb; + const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->tx_extra; return (cb->magic == LAP_MAGIC) ? cb->mtt : 10000; } @@ -257,7 +257,7 @@ */ static inline __u32 irda_get_next_speed(const struct sk_buff *skb) { - const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb; + const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->tx_extra; return (cb->magic == LAP_MAGIC) ? cb->next_speed : -1; } @@ -270,7 +270,7 @@ */ static inline __u16 irda_get_xbofs(const struct sk_buff *skb) { - const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb; + const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->tx_extra; return (cb->magic == LAP_MAGIC) ? cb->xbofs : 10; } @@ -283,7 +283,7 @@ */ static inline __u16 irda_get_next_xbofs(const struct sk_buff *skb) { - const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->cb; + const struct irda_skb_cb *cb = (const struct irda_skb_cb *) skb->tx_extra; return (cb->magic == LAP_MAGIC) ? cb->next_xbofs : -1; } #endif /* IRDA_DEVICE_H */ diff -ur linux-2.6.28-rc3-git-orig/net/irda/ircomm/ircomm_lmp.c linux-2.6.28-rc3-git/net/irda/ircomm/ircomm_lmp.c --- linux-2.6.28-rc3-git-orig/net/irda/ircomm/ircomm_lmp.c 2008-11-06 19:44:23.000000000 -0500 +++ linux-2.6.28-rc3-git/net/irda/ircomm/ircomm_lmp.c 2008-11-08 12:09:49.000000000 -0500 @@ -146,7 +146,7 @@ IRDA_ASSERT(skb != NULL, return;); - cb = (struct irda_skb_cb *) skb->cb; + cb = irda_get_skb_cb(skb); IRDA_DEBUG(2, "%s()\n", __func__ ); @@ -187,7 +187,7 @@ IRDA_ASSERT(skb != NULL, return -1;); - cb = (struct irda_skb_cb *) skb->cb; + cb = irda_get_skb_cb(skb); cb->line = self->line; diff -ur linux-2.6.28-rc3-git-orig/net/irda/irlap_frame.c linux-2.6.28-rc3-git/net/irda/irlap_frame.c --- linux-2.6.28-rc3-git-orig/net/irda/irlap_frame.c 2008-11-06 19:44:23.000000000 -0500 +++ linux-2.6.28-rc3-git/net/irda/irlap_frame.c 2008-11-08 12:09:49.000000000 -0500 @@ -56,7 +56,9 @@ static inline void irlap_insert_info(struct irlap_cb *self, struct sk_buff *skb) { - struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb; + struct irda_skb_cb *cb; + + cb = irda_get_skb_cb(skb); /* * Insert MTT (min. turn time) and speed into skb, so that the diff -ur linux-2.6.28-rc3-git-orig/net/irda/wrapper.c linux-2.6.28-rc3-git/net/irda/wrapper.c --- linux-2.6.28-rc3-git-orig/net/irda/wrapper.c 2008-11-06 19:44:23.000000000 -0500 +++ linux-2.6.28-rc3-git/net/irda/wrapper.c 2008-11-08 12:09:49.000000000 -0500 @@ -82,7 +82,7 @@ */ int async_wrap_skb(struct sk_buff *skb, __u8 *tx_buff, int buffsize) { - struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb; + struct irda_skb_cb *cb; int xbofs; int i; int n; @@ -91,6 +91,8 @@ __u8 bytes[2]; } fcs; + cb = irda_get_skb_cb(skb); + /* Initialize variables */ fcs.value = INIT_FCS; n = 0;