Commit cd098c4b authored by David S. Miller's avatar David S. Miller

Merge nuts.davemloft.net:/disk1/BK/network-2.6

into nuts.davemloft.net:/disk1/BK/net-2.6
parents e47c11be 9b0516d2
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/concap.h> #include <linux/concap.h>
#include <linux/wanrouter.h> #include <linux/wanrouter.h>
#include <net/x25device.h>
#include "isdn_x25iface.h" #include "isdn_x25iface.h"
/* for debugging messages not to cause an oops when device pointer is NULL*/ /* for debugging messages not to cause an oops when device pointer is NULL*/
...@@ -191,12 +192,9 @@ int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb) ...@@ -191,12 +192,9 @@ int isdn_x25iface_receive(struct concap_proto *cprot, struct sk_buff *skb)
IX25DEBUG( "isdn_x25iface_receive %s \n", MY_DEVNAME(cprot->net_dev) ); IX25DEBUG( "isdn_x25iface_receive %s \n", MY_DEVNAME(cprot->net_dev) );
if ( ( (ix25_pdata_t*) (cprot->proto_data) ) if ( ( (ix25_pdata_t*) (cprot->proto_data) )
-> state == WAN_CONNECTED ){ -> state == WAN_CONNECTED ){
skb -> dev = cprot -> net_dev;
skb -> protocol = htons(ETH_P_X25);
skb -> pkt_type = PACKET_HOST;
if( skb_push(skb, 1)){ if( skb_push(skb, 1)){
skb -> data[0]=0x00; skb -> data[0]=0x00;
skb -> mac.raw = skb -> data; skb->protocol = x25_type_trans(skb, cprot->net_dev);
netif_rx(skb); netif_rx(skb);
return 0; return 0;
} }
...@@ -224,10 +222,7 @@ int isdn_x25iface_connect_ind(struct concap_proto *cprot) ...@@ -224,10 +222,7 @@ int isdn_x25iface_connect_ind(struct concap_proto *cprot)
*state_p = WAN_CONNECTED; *state_p = WAN_CONNECTED;
if( skb ){ if( skb ){
*( skb_put(skb, 1) ) = 0x01; *( skb_put(skb, 1) ) = 0x01;
skb -> mac.raw = skb -> data; skb->protocol = x25_type_trans(skb, cprot->net_dev);
skb -> dev = cprot -> net_dev;
skb -> protocol = htons(ETH_P_X25);
skb -> pkt_type = PACKET_HOST;
netif_rx(skb); netif_rx(skb);
return 0; return 0;
} else { } else {
...@@ -256,10 +251,7 @@ int isdn_x25iface_disconn_ind(struct concap_proto *cprot) ...@@ -256,10 +251,7 @@ int isdn_x25iface_disconn_ind(struct concap_proto *cprot)
skb = dev_alloc_skb(1); skb = dev_alloc_skb(1);
if( skb ){ if( skb ){
*( skb_put(skb, 1) ) = 0x02; *( skb_put(skb, 1) ) = 0x02;
skb -> mac.raw = skb -> data; skb->protocol = x25_type_trans(skb, cprot->net_dev);
skb -> dev = cprot -> net_dev;
skb -> protocol = htons(ETH_P_X25);
skb -> pkt_type = PACKET_HOST;
netif_rx(skb); netif_rx(skb);
return 0; return 0;
} else { } else {
......
...@@ -124,7 +124,7 @@ static int ethertap_open(struct net_device *dev) ...@@ -124,7 +124,7 @@ static int ethertap_open(struct net_device *dev)
struct net_local *lp = netdev_priv(dev); struct net_local *lp = netdev_priv(dev);
if (ethertap_debug > 2) if (ethertap_debug > 2)
printk(KERN_DEBUG "%s: Doing ethertap_open()...", dev->name); printk(KERN_DEBUG "%s: Doing ethertap_open()...\n", dev->name);
lp->nl = netlink_kernel_create(dev->base_addr, ethertap_rx); lp->nl = netlink_kernel_create(dev->base_addr, ethertap_rx);
if (lp->nl == NULL) if (lp->nl == NULL)
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
#define DRV_MODULE_NAME "tg3" #define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.11" #define DRV_MODULE_VERSION "3.12"
#define DRV_MODULE_RELDATE "October 20, 2004" #define DRV_MODULE_RELDATE "October 28, 2004"
#define TG3_DEF_MAC_MODE 0 #define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0 #define TG3_DEF_RX_MODE 0
...@@ -418,6 +418,20 @@ static void tg3_enable_ints(struct tg3 *tp) ...@@ -418,6 +418,20 @@ static void tg3_enable_ints(struct tg3 *tp)
tg3_cond_int(tp); tg3_cond_int(tp);
} }
/* tg3_restart_ints
* similar to tg3_enable_ints, but it can return without flushing the
* PIO write which reenables interrupts
*/
static void tg3_restart_ints(struct tg3 *tp)
{
tw32(TG3PCI_MISC_HOST_CTRL,
(tp->misc_host_ctrl & ~MISC_HOST_CTRL_MASK_PCI_INT));
tw32_mailbox(MAILBOX_INTERRUPT_0 + TG3_64BIT_REG_LOW, 0x00000000);
mmiowb();
tg3_cond_int(tp);
}
static inline void tg3_netif_stop(struct tg3 *tp) static inline void tg3_netif_stop(struct tg3 *tp)
{ {
netif_poll_disable(tp->dev); netif_poll_disable(tp->dev);
...@@ -2730,6 +2744,7 @@ static int tg3_rx(struct tg3 *tp, int budget) ...@@ -2730,6 +2744,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW, tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
sw_idx); sw_idx);
} }
mmiowb();
return received; return received;
} }
...@@ -2788,7 +2803,7 @@ static int tg3_poll(struct net_device *netdev, int *budget) ...@@ -2788,7 +2803,7 @@ static int tg3_poll(struct net_device *netdev, int *budget)
if (done) { if (done) {
spin_lock_irqsave(&tp->lock, flags); spin_lock_irqsave(&tp->lock, flags);
__netif_rx_complete(netdev); __netif_rx_complete(netdev);
tg3_enable_ints(tp); tg3_restart_ints(tp);
spin_unlock_irqrestore(&tp->lock, flags); spin_unlock_irqrestore(&tp->lock, flags);
} }
...@@ -3177,6 +3192,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -3177,6 +3192,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
out_unlock: out_unlock:
mmiowb();
spin_unlock_irqrestore(&tp->tx_lock, flags); spin_unlock_irqrestore(&tp->tx_lock, flags);
dev->trans_start = jiffies; dev->trans_start = jiffies;
......
...@@ -92,6 +92,8 @@ ...@@ -92,6 +92,8 @@
#include <linux/cyclomx.h> /* Cyclom 2X common user API definitions */ #include <linux/cyclomx.h> /* Cyclom 2X common user API definitions */
#include <linux/cycx_x25.h> /* X.25 firmware API definitions */ #include <linux/cycx_x25.h> /* X.25 firmware API definitions */
#include <net/x25device.h>
/* Defines & Macros */ /* Defines & Macros */
#define CYCX_X25_MAX_CMD_RETRY 5 #define CYCX_X25_MAX_CMD_RETRY 5
#define CYCX_X25_CHAN_MTU 2048 /* unfragmented logical channel MTU */ #define CYCX_X25_CHAN_MTU 2048 /* unfragmented logical channel MTU */
...@@ -1486,11 +1488,7 @@ static void cycx_x25_chan_send_event(struct net_device *dev, u8 event) ...@@ -1486,11 +1488,7 @@ static void cycx_x25_chan_send_event(struct net_device *dev, u8 event)
ptr = skb_put(skb, 1); ptr = skb_put(skb, 1);
*ptr = event; *ptr = event;
skb->dev = dev; skb->protocol = x25_type_trans(skb, dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
netif_rx(skb); netif_rx(skb);
dev->last_rx = jiffies; /* timestamp */ dev->last_rx = jiffies; /* timestamp */
} }
......
...@@ -519,7 +519,6 @@ inline int try_get_rx_skb(struct dscc4_dev_priv *dpriv, struct net_device *dev) ...@@ -519,7 +519,6 @@ inline int try_get_rx_skb(struct dscc4_dev_priv *dpriv, struct net_device *dev)
dpriv->rx_skbuff[dirty] = skb; dpriv->rx_skbuff[dirty] = skb;
if (skb) { if (skb) {
skb->protocol = hdlc_type_trans(skb, dev); skb->protocol = hdlc_type_trans(skb, dev);
skb->mac.raw = skb->data;
rx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data, rx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data,
len, PCI_DMA_FROMDEVICE); len, PCI_DMA_FROMDEVICE);
} else { } else {
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/hdlc.h> #include <linux/hdlc.h>
#include <net/x25device.h>
/* These functions are callbacks called by LAPB layer */ /* These functions are callbacks called by LAPB layer */
static void x25_connect_disconnect(struct net_device *dev, int reason, int code) static void x25_connect_disconnect(struct net_device *dev, int reason, int code)
...@@ -38,11 +40,7 @@ static void x25_connect_disconnect(struct net_device *dev, int reason, int code) ...@@ -38,11 +40,7 @@ static void x25_connect_disconnect(struct net_device *dev, int reason, int code)
ptr = skb_put(skb, 1); ptr = skb_put(skb, 1);
*ptr = code; *ptr = code;
skb->dev = dev; skb->protocol = x25_type_trans(skb, dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
netif_rx(skb); netif_rx(skb);
} }
...@@ -74,11 +72,7 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb) ...@@ -74,11 +72,7 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb)
ptr = skb->data; ptr = skb->data;
*ptr = 0; *ptr = 0;
skb->dev = dev; skb->protocol = x25_type_trans(skb, dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
return netif_rx(skb); return netif_rx(skb);
} }
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include <linux/lapb.h> #include <linux/lapb.h>
#include <linux/init.h> #include <linux/init.h>
#include <net/x25device.h>
static char bcast_addr[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; static char bcast_addr[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
/* If this number is made larger, check that the temporary string buffer /* If this number is made larger, check that the temporary string buffer
...@@ -137,11 +139,7 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb) ...@@ -137,11 +139,7 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb)
ptr = skb->data; ptr = skb->data;
*ptr = 0x00; *ptr = 0x00;
skb->dev = dev; skb->protocol = x25_type_trans(skb, dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
skb->dev->last_rx = jiffies; skb->dev->last_rx = jiffies;
return netif_rx(skb); return netif_rx(skb);
} }
...@@ -233,11 +231,7 @@ static void lapbeth_connected(struct net_device *dev, int reason) ...@@ -233,11 +231,7 @@ static void lapbeth_connected(struct net_device *dev, int reason)
ptr = skb_put(skb, 1); ptr = skb_put(skb, 1);
*ptr = 0x01; *ptr = 0x01;
skb->dev = dev; skb->protocol = x25_type_trans(skb, dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
skb->dev->last_rx = jiffies; skb->dev->last_rx = jiffies;
netif_rx(skb); netif_rx(skb);
} }
...@@ -255,11 +249,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason) ...@@ -255,11 +249,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)
ptr = skb_put(skb, 1); ptr = skb_put(skb, 1);
*ptr = 0x02; *ptr = 0x02;
skb->dev = dev; skb->protocol = x25_type_trans(skb, dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
skb->dev->last_rx = jiffies; skb->dev->last_rx = jiffies;
netif_rx(skb); netif_rx(skb);
} }
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <linux/init.h> #include <linux/init.h>
#include "x25_asy.h" #include "x25_asy.h"
#include <net/x25device.h>
static struct net_device **x25_asy_devs; static struct net_device **x25_asy_devs;
static int x25_asy_maxdev = SL_NRUNIT; static int x25_asy_maxdev = SL_NRUNIT;
...@@ -209,10 +211,8 @@ static void x25_asy_bump(struct x25_asy *sl) ...@@ -209,10 +211,8 @@ static void x25_asy_bump(struct x25_asy *sl)
return; return;
} }
skb_push(skb,1); /* LAPB internal control */ skb_push(skb,1); /* LAPB internal control */
skb->dev = sl->dev;
memcpy(skb_put(skb,count), sl->rbuff, count); memcpy(skb_put(skb,count), sl->rbuff, count);
skb->mac.raw=skb->data; skb->protocol = x25_type_trans(skb, sl->dev);
skb->protocol=htons(ETH_P_X25);
if((err=lapb_data_received(skb->dev, skb))!=LAPB_OK) if((err=lapb_data_received(skb->dev, skb))!=LAPB_OK)
{ {
kfree_skb(skb); kfree_skb(skb);
...@@ -419,11 +419,7 @@ static void x25_asy_connected(struct net_device *dev, int reason) ...@@ -419,11 +419,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)
ptr = skb_put(skb, 1); ptr = skb_put(skb, 1);
*ptr = 0x01; *ptr = 0x01;
skb->dev = sl->dev; skb->protocol = x25_type_trans(skb, sl->dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
netif_rx(skb); netif_rx(skb);
sl->dev->last_rx = jiffies; sl->dev->last_rx = jiffies;
} }
...@@ -442,11 +438,7 @@ static void x25_asy_disconnected(struct net_device *dev, int reason) ...@@ -442,11 +438,7 @@ static void x25_asy_disconnected(struct net_device *dev, int reason)
ptr = skb_put(skb, 1); ptr = skb_put(skb, 1);
*ptr = 0x02; *ptr = 0x02;
skb->dev = sl->dev; skb->protocol = x25_type_trans(skb, sl->dev);
skb->protocol = htons(ETH_P_X25);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_HOST;
netif_rx(skb); netif_rx(skb);
sl->dev->last_rx = jiffies; sl->dev->last_rx = jiffies;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <asm/types.h> /* For __uXX types */ #include <asm/types.h> /* For __uXX types */
#define IP_VS_VERSION_CODE 0x010200 #define IP_VS_VERSION_CODE 0x010201
#define NVERSION(version) \ #define NVERSION(version) \
(version >> 16) & 0xFF, \ (version >> 16) & 0xFF, \
(version >> 8) & 0xFF, \ (version >> 8) & 0xFF, \
......
#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
...@@ -484,26 +484,13 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -484,26 +484,13 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
veth->h_vlan_proto, veth->h_vlan_TCI, veth->h_vlan_encapsulated_proto); veth->h_vlan_proto, veth->h_vlan_TCI, veth->h_vlan_encapsulated_proto);
#endif #endif
skb->dev = VLAN_DEV_INFO(dev)->real_dev; stats->tx_packets++; /* for statics only */
stats->tx_bytes += skb->len;
{
/* Please note, dev_queue_xmit consumes the pkt regardless of the
* error value. So, will copy the skb first and free if successful.
*/
struct sk_buff* skb2 = skb_get(skb);
int rv = dev_queue_xmit(skb2);
if (rv == 0) {
/* Was success, need to free the skb reference since we bumped up the
* user count above.
*/
stats->tx_packets++; /* for statics only */ skb->dev = VLAN_DEV_INFO(dev)->real_dev;
stats->tx_bytes += skb->len; dev_queue_xmit(skb);
kfree_skb(skb); return 0;
}
return rv;
}
} }
int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
......
...@@ -312,6 +312,7 @@ destroy_conntrack(struct nf_conntrack *nfct) ...@@ -312,6 +312,7 @@ destroy_conntrack(struct nf_conntrack *nfct)
} }
kmem_cache_free(ip_conntrack_expect_cachep, ct->master); kmem_cache_free(ip_conntrack_expect_cachep, ct->master);
} }
CONNTRACK_STAT_INC(delete);
WRITE_UNLOCK(&ip_conntrack_lock); WRITE_UNLOCK(&ip_conntrack_lock);
if (master) if (master)
...@@ -320,7 +321,6 @@ destroy_conntrack(struct nf_conntrack *nfct) ...@@ -320,7 +321,6 @@ destroy_conntrack(struct nf_conntrack *nfct)
DEBUGP("destroy_conntrack: returning ct=%p to slab\n", ct); DEBUGP("destroy_conntrack: returning ct=%p to slab\n", ct);
kmem_cache_free(ip_conntrack_cachep, ct); kmem_cache_free(ip_conntrack_cachep, ct);
atomic_dec(&ip_conntrack_count); atomic_dec(&ip_conntrack_count);
CONNTRACK_STAT_INC(delete);
} }
static void death_by_timeout(unsigned long ul_conntrack) static void death_by_timeout(unsigned long ul_conntrack)
......
...@@ -347,6 +347,7 @@ void x25_destroy_socket(struct sock *sk) ...@@ -347,6 +347,7 @@ void x25_destroy_socket(struct sock *sk)
/* Defer: outstanding buffers */ /* Defer: outstanding buffers */
sk->sk_timer.expires = jiffies + 10 * HZ; sk->sk_timer.expires = jiffies + 10 * HZ;
sk->sk_timer.function = x25_destroy_timer; sk->sk_timer.function = x25_destroy_timer;
sk->sk_timer.data = (unsigned long)sk;
add_timer(&sk->sk_timer); add_timer(&sk->sk_timer);
} else { } else {
/* drop last reference so sock_put will free */ /* drop last reference so sock_put will free */
......
...@@ -92,7 +92,9 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb) ...@@ -92,7 +92,9 @@ static int x25_receive_data(struct sk_buff *skb, struct x25_neigh *nb)
/* /*
x25_transmit_clear_request(nb, lci, 0x0D); x25_transmit_clear_request(nb, lci, 0x0D);
*/ */
printk(KERN_DEBUG "x25_receive_data(): unknown frame type %2x\n",frametype);
if (frametype != X25_CLEAR_CONFIRMATION)
printk(KERN_DEBUG "x25_receive_data(): unknown frame type %2x\n",frametype);
return 0; return 0;
} }
......
...@@ -32,10 +32,11 @@ static __inline__ struct x25_route *x25_get_route_idx(loff_t pos) ...@@ -32,10 +32,11 @@ static __inline__ struct x25_route *x25_get_route_idx(loff_t pos)
list_for_each(route_entry, &x25_route_list) { list_for_each(route_entry, &x25_route_list) {
rt = list_entry(route_entry, struct x25_route, node); rt = list_entry(route_entry, struct x25_route, node);
if (--pos) if (!pos--)
break; goto found;
} }
rt = NULL;
found:
return rt; return rt;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment