PATCH: [SKBUFF] introduce x25_type_trans
Subsystems (4)
Hi David,
Please consider pulling from:
bk://kernel.bkbits.net/acme/sk_buff-2.6
Now there are six outstanding changesets in this tree.
Regards,
- Arnaldo
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
===================================================================
[email protected], 2004-10-03 23:01:56-03:00, [email protected]
[SKBUFF] introduce x25_type_trans
drivers/isdn/i4l/isdn_x25iface.c | 16 ++++------------ drivers/net/wan/cycx_x25.c | 8 +++----- drivers/net/wan/hdlc_x25.c | 14 ++++---------- drivers/net/wan/lapbether.c | 20 +++++--------------- drivers/net/wan/x25_asy.c | 18 +++++------------- include/net/x25device.h | 17 +++++++++++++++++ 6 files changed, 38 insertions(+), 55 deletions(-)
drivers/isdn/i4l/isdn_x25iface.c +4 -12
@@ -21,6 +21,7 @@#include <linux/netdevice.h> #include <linux/concap.h> #include <linux/wanrouter.h> +#include <net/x25device.h> #include "isdn_x25iface.h" /* for debugging messages not to cause an oops when device pointer is NULL*/
@@ -191,12 +192,9 @@IX25DEBUG ("isdn_x25iface_receive %s \n" ,MY_DEVNAME (cprot->net_dev) );if ( ( (ix25_pdata_t *) (cprot->proto_data) ) -> state ==WAN_CONNECTED ){ - skb -> dev = cprot -> net_dev; - skb -> protocol =htons (ETH_P_X25 ); - skb -> pkt_type =PACKET_HOST ;if (skb_push (skb,1 )){ skb -> data[0 ]=0x00 ; - skb -> mac.raw = skb -> data; + skb->protocol =x25_type_trans (skb, cprot->net_dev);netif_rx (skb);return 0 ; }
@@ -224,10 +222,7 @@ *state_p =WAN_CONNECTED ;if ( skb ){ *(skb_put (skb,1 ) ) =0x01 ; - skb -> mac.raw = skb -> data; - skb -> dev = cprot -> net_dev; - skb -> protocol =htons (ETH_P_X25 ); - skb -> pkt_type =PACKET_HOST ; + skb->protocol =x25_type_trans (skb, cprot->net_dev);netif_rx (skb);return 0 ; }else {
@@ -256,10 +251,7 @@ skb =dev_alloc_skb (1 );if ( skb ){ *(skb_put (skb,1 ) ) =0x02 ; - skb -> mac.raw = skb -> data; - skb -> dev = cprot -> net_dev; - skb -> protocol =htons (ETH_P_X25 ); - skb -> pkt_type =PACKET_HOST ; + skb->protocol =x25_type_trans (skb, cprot->net_dev);netif_rx (skb);return 0 ; }else {
drivers/net/wan/cycx_x25.c +3 -5
@@ -92,6 +92,8 @@#include <linux/cyclomx.h> /* Cyclom 2X common user API definitions */ #include <linux/cycx_x25.h> /* X.25 firmware API definitions */ +#include <net/x25device.h> +/* Defines & Macros */ #define CYCX_X25_MAX_CMD_RETRY 5#define CYCX_X25_CHAN_MTU 2048/* unfragmented logical channel MTU */
@@ -1486,11 +1488,7 @@ ptr =skb_put (skb,1 ); *ptr = event; - skb->dev = dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, dev);netif_rx (skb); dev->last_rx = jiffies;/* timestamp */ }
drivers/net/wan/hdlc_x25.c +4 -10
@@ -23,6 +23,8 @@#include <linux/rtnetlink.h> #include <linux/hdlc.h> +#include <net/x25device.h> +/* These functions are callbacks called by LAPB layer */ static void x25_connect_disconnect (struct net_device *dev,int reason,int code)
@@ -38,11 +40,7 @@ ptr =skb_put (skb,1 ); *ptr = code; - skb->dev = dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, dev);netif_rx (skb); }
@@ -74,11 +72,7 @@ ptr = skb->data; *ptr =0 ; - skb->dev = dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, dev);return netif_rx (skb); }
drivers/net/wan/lapbether.c +5 -15
@@ -43,6 +43,8 @@#include <linux/lapb.h> #include <linux/init.h> +#include <net/x25device.h> +static char bcast_addr[6 ] = {0xFF ,0xFF ,0xFF ,0xFF ,0xFF ,0xFF };/* If this number is made larger, check that the temporary string buffer
@@ -137,11 +139,7 @@ ptr = skb->data; *ptr =0x00 ; - skb->dev = dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, dev); skb->dev->last_rx = jiffies;return netif_rx (skb); }
@@ -233,11 +231,7 @@ ptr =skb_put (skb,1 ); *ptr =0x01 ; - skb->dev = dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, dev); skb->dev->last_rx = jiffies;netif_rx (skb); }
@@ -255,11 +249,7 @@ ptr =skb_put (skb,1 ); *ptr =0x02 ; - skb->dev = dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, dev); skb->dev->last_rx = jiffies;netif_rx (skb); }
drivers/net/wan/x25_asy.c +5 -13
@@ -34,6 +34,8 @@#include <linux/init.h> #include "x25_asy.h" +#include <net/x25device.h> +static struct net_device **x25_asy_devs;static int x25_asy_maxdev =SL_NRUNIT ;
@@ -209,10 +211,8 @@return ; }skb_push (skb,1 );/* LAPB internal control */ - skb->dev = sl->dev;memcpy (skb_put (skb,count), sl->rbuff, count); - skb->mac.raw=skb->data; - skb->protocol=htons (ETH_P_X25 ); + skb->protocol =x25_type_trans (skb, sl->dev);if ((err=lapb_data_received (skb->dev, skb))!=LAPB_OK ) {kfree_skb (skb);
@@ -419,11 +419,7 @@ ptr =skb_put (skb,1 ); *ptr =0x01 ; - skb->dev = sl->dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, sl->dev);netif_rx (skb); sl->dev->last_rx = jiffies; }
@@ -442,11 +438,7 @@ ptr =skb_put (skb,1 ); *ptr =0x02 ; - skb->dev = sl->dev; - skb->protocol =htons (ETH_P_X25 ); - skb->mac.raw = skb->data; - skb->pkt_type =PACKET_HOST ; - + skb->protocol =x25_type_trans (skb, sl->dev);netif_rx (skb); sl->dev->last_rx = jiffies; }
include/net/x25device.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef _X25DEVICE_H +#define _X25DEVICE_H + +#include <linux/if_ether.h> +#include <linux/if_packet.h> +#include <linux/skbuff.h> + +static inline unsigned short x25_type_trans (struct sk_buff *skb, +struct net_device *dev) +{ + skb->mac.raw = skb->data; + skb->input_dev = skb->dev = dev; + skb->pkt_type =PACKET_HOST ; + +return htons (ETH_P_X25 ); +} +#endif
===================================================================
This BitKeeper patch contains the following changesets:
1.2035
## Wrapped with gzip_uu ##
M'XL( #ZO8$$ ^596U/;.!1^1K]",[QL=S>.;KZEA:$%NC!LMPRTG<ZTG8PL MR\2-8V=L)\"N][_OD0T!0M+$Z?*$"7:PI*.C[WSG(K&-/Q8Z[VU)-=)H&Q]E M1=G;4EFJ51E/I:6RD17DT'"69=#0U5=E+KNF<S<8=HMA/YA$48=9#H(^I[)4 M SS5>=';HA:?O2FOQ[JW=7;XQ\<_7Y\AM+.#]P<RO=#GNL0[.ZC,\JE,PF)/ MEH,D2RV8(2U&NJQGKV9=*T8(@Q^;NIS83D4=(MQ*T9!2*:@."1.>(Y#1;4^. M0D=80YVG.ODNTQBF**PLOW@H35!".!6$$EHYPK,%.L#48H3;F(@N)5W",>,] M0GNVTR'PA>!:^CP\^#<'=PAZ@__?E>PCA;^<G[SY^/;M-QRG99Z%$Z7Q%;/[ M!M%^+1WZP.<\ODAUV,G %L%U#[_.4U CP_O2Z#/(<*CQ.YUD^-5"_7=O)90S M"0=R&H?XW,+OXB31.7X5RJD>[>4Z',C2#-M%)]AQ*$6G=\9$G9870D02M+L" MMS"/#:>Z<1&F]:T/$,215-I2]Z $.[**,8_Q2GE,DL"/M*.%$M)>;+8YP2)9 M)-QP1, $5(B*.XRX:ZL+<'8O9=HU]I+%]9RN0#E!'#"^$W+F.U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