* [PATCH 3/12] NET/ROM statistics fix
From: Ralf Baechle DL5RB @ 2005-09-11 22:18 UTC (permalink / raw)
To: David S. Miller, netdev, linux-hams
Calling an incoming NET/ROM-encapsulated IP packet an error if the interface
isn't up is probably a bit over the top, so count it as dropped instead of
an error.
Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
net/netrom/nr_dev.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: net-2.6.git/net/netrom/nr_dev.c
===================================================================
--- net-2.6.git.orig/net/netrom/nr_dev.c
+++ net-2.6.git/net/netrom/nr_dev.c
@@ -47,7 +47,7 @@ int nr_rx_ip(struct sk_buff *skb, struct
struct net_device_stats *stats = netdev_priv(dev);
if (!netif_running(dev)) {
- stats->rx_errors++;
+ stats->rx_dropped++;
return 0;
}
^ permalink raw reply
* [PATCH 2/12] Add more AX.25 PIDs
From: Ralf Baechle DL5RB @ 2005-09-11 22:18 UTC (permalink / raw)
To: David S. Miller, netdev, linux-hams
Add a few more PID definitions. AX.25 PIDs are the equivalent to IP
protocol numbers.
Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
include/net/ax25.h | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
Index: linux-cvs/include/net/ax25.h
===================================================================
--- linux-cvs.orig/include/net/ax25.h
+++ linux-cvs/include/net/ax25.h
@@ -26,11 +26,20 @@
/* AX.25 Protocol IDs */
#define AX25_P_ROSE 0x01
-#define AX25_P_IP 0xCC
-#define AX25_P_ARP 0xCD
-#define AX25_P_TEXT 0xF0
-#define AX25_P_NETROM 0xCF
-#define AX25_P_SEGMENT 0x08
+#define AX25_P_VJCOMP 0x06 /* Compressed TCP/IP packet */
+ /* Van Jacobsen (RFC 1144) */
+#define AX25_P_VJUNCOMP 0x07 /* Uncompressed TCP/IP packet */
+ /* Van Jacobsen (RFC 1144) */
+#define AX25_P_SEGMENT 0x08 /* Segmentation fragment */
+#define AX25_P_TEXNET 0xc3 /* TEXTNET datagram protocol */
+#define AX25_P_LQ 0xc4 /* Link Quality Protocol */
+#define AX25_P_ATALK 0xca /* Appletalk */
+#define AX25_P_ATALK_ARP 0xcb /* Appletalk ARP */
+#define AX25_P_IP 0xcc /* ARPA Internet Protocol */
+#define AX25_P_ARP 0xcd /* ARPA Adress Resolution */
+#define AX25_P_FLEXNET 0xce /* FlexNet */
+#define AX25_P_NETROM 0xcf /* NET/ROM */
+#define AX25_P_TEXT 0xF0 /* No layer 3 protocol impl. */
/* AX.25 Segment control values */
#define AX25_SEG_REM 0x7F
^ permalink raw reply
* [PATCH 1/12] Fix NET/ROM rebuild header mess
From: Ralf Baechle DL5RB @ 2005-09-11 22:18 UTC (permalink / raw)
To: David S. Miller, netdev, linux-hams
For reason that probably nobody recalls NET/ROM does it's actual packet
transmission in nr_rebuild_header and even treats invocation of it's
hard_start_xmit method nr_xmit as a bug. Fix that by splitting the
job done by nr_rebuild_header into two halves. Along with that we now
also can get rid of the silly clone of the skb on transmit.
Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
net/netrom/nr_dev.c | 44 +++++++++++++++-----------------------------
1 files changed, 15 insertions(+), 29 deletions(-)
Index: linux-cvs/net/netrom/nr_dev.c
===================================================================
--- linux-cvs.orig/net/netrom/nr_dev.c
+++ linux-cvs/net/netrom/nr_dev.c
@@ -71,15 +71,10 @@ int nr_rx_ip(struct sk_buff *skb, struct
static int nr_rebuild_header(struct sk_buff *skb)
{
- struct net_device *dev = skb->dev;
- struct net_device_stats *stats = netdev_priv(dev);
- struct sk_buff *skbn;
unsigned char *bp = skb->data;
- int len;
- if (arp_find(bp + 7, skb)) {
+ if (arp_find(bp + 7, skb))
return 1;
- }
bp[6] &= ~AX25_CBIT;
bp[6] &= ~AX25_EBIT;
@@ -90,27 +85,7 @@ static int nr_rebuild_header(struct sk_b
bp[6] |= AX25_EBIT;
bp[6] |= AX25_SSSID_SPARE;
- if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
- kfree_skb(skb);
- return 1;
- }
-
- if (skb->sk != NULL)
- skb_set_owner_w(skbn, skb->sk);
-
- kfree_skb(skb);
-
- len = skbn->len;
-
- if (!nr_route_frame(skbn, NULL)) {
- kfree_skb(skbn);
- stats->tx_errors++;
- }
-
- stats->tx_packets++;
- stats->tx_bytes += len;
-
- return 1;
+ return 0;
}
#else
@@ -186,8 +161,19 @@ static int nr_close(struct net_device *d
static int nr_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct net_device_stats *stats = netdev_priv(dev);
- dev_kfree_skb(skb);
- stats->tx_errors++;
+ unsigned int len;
+
+ len = skb->len;
+
+ if (!nr_route_frame(skb, NULL)) {
+ kfree_skb(skb);
+ stats->tx_errors++;
+ return 0;
+ }
+
+ stats->tx_packets++;
+ stats->tx_bytes += len;
+
return 0;
}
^ permalink raw reply
* [PATCH 11/12] Implement G8PZT Circuit reset for NET/ROM
From: Ralf Baechle DL5RB @ 2005-09-11 22:12 UTC (permalink / raw)
To: David S. Miller, netdev, linux-hams
NET/ROM is lacking a connection reset like TCP's RST flag which at times
may result in a connecting having to slowly timing out instead of just being
reset. An earlier attempt to reset the connection by sending a
NR_CONNACK | NR_CHOKE_FLAG transport was inacceptable as it did result in
crashes of BPQ systems. An alternative approach of introducing a new
transport type 7 (NR_RESET) has be implemented several years ago in
Paula Jayne Dowie G8PZT's Xrouter.
Implement NR_RESET for Linux's NET/ROM but like any messing with the state
engine consider this experimental for now and thus control it by a sysctl
(net.netrom.reset) which for the time being defaults to off.
Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
include/linux/sysctl.h | 3 ++-
include/net/netrom.h | 27 ++++++++++++++++++++++++++-
net/netrom/af_netrom.c | 21 +++++++++++----------
net/netrom/nr_in.c | 15 +++++++++++++++
net/netrom/nr_subr.c | 7 +++----
net/netrom/sysctl_net_netrom.c | 12 ++++++++++++
6 files changed, 69 insertions(+), 16 deletions(-)
Index: linux-cvs/include/net/netrom.h
===================================================================
--- linux-cvs.orig/include/net/netrom.h
+++ linux-cvs/include/net/netrom.h
@@ -22,6 +22,7 @@
#define NR_DISCACK 0x04
#define NR_INFO 0x05
#define NR_INFOACK 0x06
+#define NR_RESET 0x07
#define NR_CHOKE_FLAG 0x80
#define NR_NAK_FLAG 0x40
@@ -51,6 +52,7 @@ enum {
#define NR_DEFAULT_TTL 16 /* Default Time To Live - 16 */
#define NR_DEFAULT_ROUTING 1 /* Is routing enabled ? */
#define NR_DEFAULT_FAILS 2 /* Link fails until route fails */
+#define NR_DEFAULT_RESET 0 /* Sent / accept reset cmds? */
#define NR_MODULUS 256
#define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */
@@ -176,6 +178,8 @@ extern int sysctl_netrom_transport_requ
extern int sysctl_netrom_transport_no_activity_timeout;
extern int sysctl_netrom_routing_control;
extern int sysctl_netrom_link_fails_count;
+extern int sysctl_netrom_reset_circuit;
+
extern int nr_rx_frame(struct sk_buff *, struct net_device *);
extern void nr_destroy_socket(struct sock *);
@@ -218,7 +222,28 @@ extern void nr_requeue_frames(struct soc
extern int nr_validate_nr(struct sock *, unsigned short);
extern int nr_in_rx_window(struct sock *, unsigned short);
extern void nr_write_internal(struct sock *, int);
-extern void nr_transmit_refusal(struct sk_buff *, int);
+
+extern void __nr_transmit_reply(struct sk_buff *skb, int mine,
+ unsigned char cmdflags);
+
+/*
+ * This routine is called when a Connect Acknowledge with the Choke Flag
+ * set is needed to refuse a connection.
+ */
+#define nr_transmit_refusal(skb, mine) \
+do { \
+ __nr_transmit_reply((skb), (mine), NR_CONNACK | NR_CHOKE_FLAG); \
+} while (0)
+
+/*
+ * This routine is called when we don't have a circuit matching an incoming
+ * NET/ROM packet. This is an G8PZT Xrouter extension.
+ */
+#define nr_transmit_reset(skb, mine) \
+do { \
+ __nr_transmit_reply((skb), (mine), NR_RESET); \
+} while (0)
+
extern void nr_disconnect(struct sock *, int);
/* nr_timer.c */
Index: linux-cvs/net/netrom/af_netrom.c
===================================================================
--- linux-cvs.orig/net/netrom/af_netrom.c
+++ linux-cvs/net/netrom/af_netrom.c
@@ -56,6 +56,7 @@ int sysctl_netrom_transport_requested_wi
int sysctl_netrom_transport_no_activity_timeout = NR_DEFAULT_IDLE;
int sysctl_netrom_routing_control = NR_DEFAULT_ROUTING;
int sysctl_netrom_link_fails_count = NR_DEFAULT_FAILS;
+int sysctl_netrom_reset_circuit = NR_DEFAULT_RESET;
static unsigned short circuit = 0x101;
@@ -908,17 +909,17 @@ int nr_rx_frame(struct sk_buff *skb, str
if (frametype != NR_CONNREQ) {
/*
* Here it would be nice to be able to send a reset but
- * NET/ROM doesn't have one. The following hack would
- * have been a way to extend the protocol but apparently
- * it kills BPQ boxes... :-(
+ * NET/ROM doesn't have one. We've tried to extend the protocol
+ * by sending NR_CONNACK | NR_CHOKE_FLAGS replies but that
+ * apparently kills BPQ boxes... :-(
+ * So now we try to follow the established behaviour of
+ * G8PZT's Xrouter which is sending packets with command type 7
+ * as an extension of the protocol.
*/
-#if 0
- /*
- * Never reply to a CONNACK/CHOKE.
- */
- if (frametype != NR_CONNACK || flags != NR_CHOKE_FLAG)
- nr_transmit_refusal(skb, 1);
-#endif
+ if (sysctl_netrom_reset_circuit &&
+ (frametype != NR_RESET || flags != 0))
+ nr_transmit_reset(skb, 1);
+
return 0;
}
Index: linux-cvs/net/netrom/nr_in.c
===================================================================
--- linux-cvs.orig/net/netrom/nr_in.c
+++ linux-cvs/net/netrom/nr_in.c
@@ -98,6 +98,11 @@ static int nr_state1_machine(struct sock
nr_disconnect(sk, ECONNREFUSED);
break;
+ case NR_RESET:
+ if (sysctl_netrom_reset_circuit);
+ nr_disconnect(sk, ECONNRESET);
+ break;
+
default:
break;
}
@@ -124,6 +129,11 @@ static int nr_state2_machine(struct sock
nr_disconnect(sk, 0);
break;
+ case NR_RESET:
+ if (sysctl_netrom_reset_circuit);
+ nr_disconnect(sk, ECONNRESET);
+ break;
+
default:
break;
}
@@ -254,6 +264,11 @@ static int nr_state3_machine(struct sock
}
break;
+ case NR_RESET:
+ if (sysctl_netrom_reset_circuit);
+ nr_disconnect(sk, ECONNRESET);
+ break;
+
default:
break;
}
Index: linux-cvs/include/linux/sysctl.h
===================================================================
--- linux-cvs.orig/include/linux/sysctl.h
+++ linux-cvs/include/linux/sysctl.h
@@ -544,7 +544,8 @@ enum {
NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
NET_NETROM_ROUTING_CONTROL=10,
- NET_NETROM_LINK_FAILS_COUNT=11
+ NET_NETROM_LINK_FAILS_COUNT=11,
+ NET_NETROM_RESET=12
};
/* /proc/sys/net/ax25 */
Index: linux-cvs/net/netrom/sysctl_net_netrom.c
===================================================================
--- linux-cvs.orig/net/netrom/sysctl_net_netrom.c
+++ linux-cvs/net/netrom/sysctl_net_netrom.c
@@ -30,6 +30,7 @@ static int min_idle[] = {0 * HZ};
static int max_idle[] = {65535 * HZ};
static int min_route[] = {0}, max_route[] = {1};
static int min_fails[] = {1}, max_fails[] = {10};
+static int min_reset[] = {0}, max_reset[] = {1};
static struct ctl_table_header *nr_table_header;
@@ -155,6 +156,17 @@ static ctl_table nr_table[] = {
.extra1 = &min_fails,
.extra2 = &max_fails
},
+ {
+ .ctl_name = NET_NETROM_RESET,
+ .procname = "reset",
+ .data = &sysctl_netrom_reset_circuit,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec_minmax,
+ .strategy = &sysctl_intvec,
+ .extra1 = &min_reset,
+ .extra2 = &max_reset
+ },
{ .ctl_name = 0 }
};
Index: linux-cvs/net/netrom/nr_subr.c
===================================================================
--- linux-cvs.orig/net/netrom/nr_subr.c
+++ linux-cvs/net/netrom/nr_subr.c
@@ -210,10 +210,9 @@ void nr_write_internal(struct sock *sk,
}
/*
- * This routine is called when a Connect Acknowledge with the Choke Flag
- * set is needed to refuse a connection.
+ * This routine is called to send an error reply.
*/
-void nr_transmit_refusal(struct sk_buff *skb, int mine)
+void __nr_transmit_reply(struct sk_buff *skb, int mine, unsigned char cmdflags)
{
struct sk_buff *skbn;
unsigned char *dptr;
@@ -254,7 +253,7 @@ void nr_transmit_refusal(struct sk_buff
*dptr++ = 0;
}
- *dptr++ = NR_CONNACK | NR_CHOKE_FLAG;
+ *dptr++ = cmdflags;
*dptr++ = 0;
if (!nr_route_frame(skbn, NULL))
^ permalink raw reply
* [AX.25] Rename ax25_encapsulate to ax25_hard_header
From: Ralf Baechle @ 2005-09-11 21:37 UTC (permalink / raw)
To: David S. Miller, Jeff Garzik; +Cc: netdev, linux-hams
Rename ax25_encapsulate to ax25_hard_header which these days more accurately
describes what the function is supposed to do.
Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
drivers/net/hamradio/6pack.c | 4 ++--
drivers/net/hamradio/baycom_epp.c | 2 +-
drivers/net/hamradio/bpqether.c | 2 +-
drivers/net/hamradio/dmascc.c | 2 +-
drivers/net/hamradio/hdlcdrv.c | 2 +-
drivers/net/hamradio/mkiss.c | 2 +-
drivers/net/hamradio/scc.c | 2 +-
drivers/net/hamradio/yam.c | 2 +-
include/net/ax25.h | 2 +-
net/ax25/af_ax25.c | 2 +-
net/ax25/ax25_ip.c | 6 +++---
11 files changed, 14 insertions(+), 14 deletions(-)
Index: net-2.6.git/drivers/net/hamradio/6pack.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/6pack.c
+++ net-2.6.git/drivers/net/hamradio/6pack.c
@@ -416,7 +416,7 @@ static void sp_setup(struct net_device *
dev->open = sp_open_dev;
dev->destructor = free_netdev;
dev->stop = sp_close;
- dev->hard_header = ax25_encapsulate;
+ dev->hard_header = ax25_hard_header;
dev->get_stats = sp_get_stats;
dev->set_mac_address = sp_set_mac_address;
dev->hard_header_len = AX25_MAX_HEADER_LEN;
Index: net-2.6.git/drivers/net/hamradio/baycom_epp.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/baycom_epp.c
+++ net-2.6.git/drivers/net/hamradio/baycom_epp.c
@@ -1171,7 +1171,7 @@ static void baycom_probe(struct net_devi
/* Fill in the fields of the device structure */
bc->skb = NULL;
- dev->hard_header = ax25_encapsulate;
+ dev->hard_header = ax25_hard_header;
dev->rebuild_header = ax25_rebuild_header;
dev->set_mac_address = baycom_set_mac_address;
Index: net-2.6.git/drivers/net/hamradio/bpqether.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/bpqether.c
+++ net-2.6.git/drivers/net/hamradio/bpqether.c
@@ -488,7 +488,7 @@ static void bpq_setup(struct net_device
dev->flags = 0;
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
- dev->hard_header = ax25_encapsulate;
+ dev->hard_header = ax25_hard_header;
dev->rebuild_header = ax25_rebuild_header;
#endif
Index: net-2.6.git/drivers/net/hamradio/dmascc.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/dmascc.c
+++ net-2.6.git/drivers/net/hamradio/dmascc.c
@@ -600,7 +600,7 @@ static int __init setup_adapter(int card
dev->do_ioctl = scc_ioctl;
dev->hard_start_xmit = scc_send_packet;
dev->get_stats = scc_get_stats;
- dev->hard_header = ax25_encapsulate;
+ dev->hard_header = ax25_hard_header;
dev->rebuild_header = ax25_rebuild_header;
dev->set_mac_address = scc_set_mac_address;
}
Index: net-2.6.git/drivers/net/hamradio/hdlcdrv.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/hdlcdrv.c
+++ net-2.6.git/drivers/net/hamradio/hdlcdrv.c
@@ -701,7 +701,7 @@ static void hdlcdrv_setup(struct net_dev
s->skb = NULL;
- dev->hard_header = ax25_encapsulate;
+ dev->hard_header = ax25_hard_header;
dev->rebuild_header = ax25_rebuild_header;
dev->set_mac_address = hdlcdrv_set_mac_address;
Index: net-2.6.git/drivers/net/hamradio/mkiss.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/mkiss.c
+++ net-2.6.git/drivers/net/hamradio/mkiss.c
@@ -500,7 +500,7 @@ static int ax_header(struct sk_buff *skb
{
#ifdef CONFIG_INET
if (type != htons(ETH_P_AX25))
- return ax25_encapsulate(skb, dev, type, daddr, saddr, len);
+ return ax25_hard_header(skb, dev, type, daddr, saddr, len);
#endif
return 0;
}
Index: net-2.6.git/drivers/net/hamradio/scc.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/scc.c
+++ net-2.6.git/drivers/net/hamradio/scc.c
@@ -1557,7 +1557,7 @@ static void scc_net_setup(struct net_dev
dev->stop = scc_net_close;
dev->hard_start_xmit = scc_net_tx;
- dev->hard_header = ax25_encapsulate;
+ dev->hard_header = ax25_hard_header;
dev->rebuild_header = ax25_rebuild_header;
dev->set_mac_address = scc_net_set_mac_address;
dev->get_stats = scc_net_get_stats;
Index: net-2.6.git/drivers/net/hamradio/yam.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/yam.c
+++ net-2.6.git/drivers/net/hamradio/yam.c
@@ -1108,7 +1108,7 @@ static void yam_setup(struct net_device
skb_queue_head_init(&yp->send_queue);
- dev->hard_header = ax25_encapsulate;
+ dev->hard_header = ax25_hard_header;
dev->rebuild_header = ax25_rebuild_header;
dev->set_mac_address = yam_set_mac_address;
Index: net-2.6.git/include/net/ax25.h
===================================================================
--- net-2.6.git.orig/include/net/ax25.h
+++ net-2.6.git/include/net/ax25.h
@@ -328,7 +328,7 @@ extern int ax25_rx_iframe(ax25_cb *, st
extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
/* ax25_ip.c */
-extern int ax25_encapsulate(struct sk_buff *, struct net_device *, unsigned short, void *, void *, unsigned int);
+extern int ax25_hard_header(struct sk_buff *, struct net_device *, unsigned short, void *, void *, unsigned int);
extern int ax25_rebuild_header(struct sk_buff *);
/* ax25_out.c */
Index: net-2.6.git/net/ax25/af_ax25.c
===================================================================
--- net-2.6.git.orig/net/ax25/af_ax25.c
+++ net-2.6.git/net/ax25/af_ax25.c
@@ -1980,7 +1980,7 @@ static struct notifier_block ax25_dev_no
.notifier_call =ax25_device_event,
};
-EXPORT_SYMBOL(ax25_encapsulate);
+EXPORT_SYMBOL(ax25_hard_header);
EXPORT_SYMBOL(ax25_rebuild_header);
EXPORT_SYMBOL(ax25_findbyuid);
EXPORT_SYMBOL(ax25_find_cb);
Index: net-2.6.git/net/ax25/ax25_ip.c
===================================================================
--- net-2.6.git.orig/net/ax25/ax25_ip.c
+++ net-2.6.git/net/ax25/ax25_ip.c
@@ -47,7 +47,7 @@
#ifdef CONFIG_INET
-int ax25_encapsulate(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len)
+int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len)
{
unsigned char *buff;
@@ -88,7 +88,7 @@ int ax25_encapsulate(struct sk_buff *skb
*buff++ = AX25_P_ARP;
break;
default:
- printk(KERN_ERR "AX.25: ax25_encapsulate - wrong protocol type 0x%2.2x\n", type);
+ printk(KERN_ERR "AX.25: ax25_hard_header - wrong protocol type 0x%2.2x\n", type);
*buff++ = 0;
break;
}
@@ -209,7 +209,7 @@ put:
#else /* INET */
-int ax25_encapsulate(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len)
+int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len)
{
return -AX25_HEADER_LEN;
}
^ permalink raw reply
* Hamradio driver cleanups
From: Ralf Baechle @ 2005-09-11 21:29 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-hams, netdev
Misc related cleanups in hamradio drivers:
o Use symbolic constants instead of magic numbers
o Don't try to handle the case where AX.25 isn't configured - the kernel
configuration doesn't permit that.
o Remove useless headers
Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
drivers/net/hamradio/baycom_epp.c | 15 ++-------------
drivers/net/hamradio/dmascc.c | 8 ++++----
drivers/net/hamradio/hdlcdrv.c | 14 +-------------
drivers/net/hamradio/yam.c | 26 ++++++--------------------
4 files changed, 13 insertions(+), 50 deletions(-)
Index: net-2.6.git/drivers/net/hamradio/hdlcdrv.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/hdlcdrv.c
+++ net-2.6.git/drivers/net/hamradio/hdlcdrv.c
@@ -42,7 +42,6 @@
/*****************************************************************************/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/net.h>
@@ -52,20 +51,14 @@
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/bitops.h>
-#include <asm/uaccess.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
-#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/hdlcdrv.h>
-/* prototypes for ax25_encapsulate and ax25_rebuild_header */
#include <net/ax25.h>
+#include <asm/uaccess.h>
-/* make genksyms happy */
-#include <linux/ip.h>
-#include <linux/udp.h>
-#include <linux/tcp.h>
#include <linux/crc-ccitt.h>
/* --------------------------------------------------------------------- */
@@ -708,13 +701,8 @@ static void hdlcdrv_setup(struct net_dev
s->skb = NULL;
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
dev->hard_header = ax25_encapsulate;
dev->rebuild_header = ax25_rebuild_header;
-#else /* CONFIG_AX25 || CONFIG_AX25_MODULE */
- dev->hard_header = NULL;
- dev->rebuild_header = NULL;
-#endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */
dev->set_mac_address = hdlcdrv_set_mac_address;
dev->type = ARPHRD_AX25; /* AF_AX25 device */
Index: net-2.6.git/drivers/net/hamradio/baycom_epp.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/baycom_epp.c
+++ net-2.6.git/drivers/net/hamradio/baycom_epp.c
@@ -40,7 +40,7 @@
/*****************************************************************************/
-#include <linux/config.h>
+#include <linux/crc-ccitt.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -48,18 +48,12 @@
#include <linux/workqueue.h>
#include <linux/fs.h>
#include <linux/parport.h>
-#include <linux/smp_lock.h>
-#include <asm/uaccess.h>
#include <linux/if_arp.h>
-#include <linux/kmod.h>
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
#include <linux/jiffies.h>
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
-/* prototypes for ax25_encapsulate and ax25_rebuild_header */
#include <net/ax25.h>
-#endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */
-#include <linux/crc-ccitt.h>
+#include <asm/uaccess.h>
/* --------------------------------------------------------------------- */
@@ -1177,13 +1171,8 @@ static void baycom_probe(struct net_devi
/* Fill in the fields of the device structure */
bc->skb = NULL;
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
dev->hard_header = ax25_encapsulate;
dev->rebuild_header = ax25_rebuild_header;
-#else /* CONFIG_AX25 || CONFIG_AX25_MODULE */
- dev->hard_header = NULL;
- dev->rebuild_header = NULL;
-#endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */
dev->set_mac_address = baycom_set_mac_address;
dev->type = ARPHRD_AX25; /* AF_AX25 device */
Index: net-2.6.git/drivers/net/hamradio/yam.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/yam.c
+++ net-2.6.git/drivers/net/hamradio/yam.c
@@ -60,15 +60,7 @@
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
-/* prototypes for ax25_encapsulate and ax25_rebuild_header */
#include <net/ax25.h>
-#endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */
-
-/* make genksyms happy */
-#include <linux/ip.h>
-#include <linux/udp.h>
-#include <linux/tcp.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
@@ -1116,23 +1108,17 @@ static void yam_setup(struct net_device
skb_queue_head_init(&yp->send_queue);
-#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
dev->hard_header = ax25_encapsulate;
dev->rebuild_header = ax25_rebuild_header;
-#else /* CONFIG_AX25 || CONFIG_AX25_MODULE */
- dev->hard_header = NULL;
- dev->rebuild_header = NULL;
-#endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */
dev->set_mac_address = yam_set_mac_address;
- dev->type = ARPHRD_AX25; /* AF_AX25 device */
- dev->hard_header_len = 73; /* We do digipeaters now */
- dev->mtu = 256; /* AX25 is the default */
- dev->addr_len = 7; /* sizeof an ax.25 address */
- memcpy(dev->broadcast, ax25_bcast, 7);
- memcpy(dev->dev_addr, ax25_test, 7);
-
+ dev->type = ARPHRD_AX25;
+ dev->hard_header_len = AX25_MAX_HEADER_LEN;
+ dev->mtu = AX25_MTU;
+ dev->addr_len = AX25_ADDR_LEN;
+ memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN);
+ memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN);
}
static int __init yam_init_driver(void)
Index: net-2.6.git/drivers/net/hamradio/dmascc.c
===================================================================
--- net-2.6.git.orig/drivers/net/hamradio/dmascc.c
+++ net-2.6.git/drivers/net/hamradio/dmascc.c
@@ -449,12 +449,12 @@ module_exit(dmascc_exit);
static void dev_setup(struct net_device *dev)
{
dev->type = ARPHRD_AX25;
- dev->hard_header_len = 73;
+ dev->hard_header_len = AX25_MAX_HEADER_LEN;
dev->mtu = 1500;
- dev->addr_len = 7;
+ dev->addr_len = AX25_ADDR_LEN;
dev->tx_queue_len = 64;
- memcpy(dev->broadcast, ax25_broadcast, 7);
- memcpy(dev->dev_addr, ax25_test, 7);
+ memcpy(dev->broadcast, ax25_broadcast, AX25_ADDR_LEN);
+ memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN);
}
static int __init setup_adapter(int card_base, int type, int n)
^ permalink raw reply
* Re: Very strange Marvell/Yukon Gigabit NIC networking problems
From: Daniel Drake @ 2005-09-11 15:24 UTC (permalink / raw)
To: Steve Kieu; +Cc: Stephen Hemminger, linux-kernel, Netdev List
In-Reply-To: <20050901212110.19192.qmail@web53605.mail.yahoo.com>
Hi,
Steve Kieu wrote:
> If run 2.6.13 and up the NIC, it is working. Shuttdown
> or reboot using /sbin/halt (means power completely off
> and on) or /sbin/reboot all other OSs failed to enable
> the NIC except 2.6.13.
>
> to restore the normal working of the NIC, boot 2.6.13
> and do a hot power reset. (press the reset button)
Stephen recently posted a patch which looks like it might solve this issue.
Steve, maybe you could test it out? I have attached it to this Gentoo bug:
http://bugs.gentoo.org/100258
Stephen, thanks for your hard work!
Daniel
^ permalink raw reply
* Re: Fw: masquerading failure for at least icmp and tcp+sack on amd64
From: Patrick McHardy @ 2005-09-11 14:10 UTC (permalink / raw)
To: Marc Lehmann
Cc: Andrew Morton, netdev, Netfilter Development Mailinglist,
Stephen Hemminger
In-Reply-To: <20050911131943.GC9865@schmorp.de>
Marc Lehmann wrote:
> On Fri, Sep 09, 2005 at 01:41:34PM +0200, Patrick McHardy <kaber@trash.net> wrote:
>
>>What network driver are you using?
>
> Happens with both skge and sk98.
Are you sure the same checksum error happens? sk98_lin never sets
ip_summed to CHECKSUM_HW, it uses either CHECKSUM_UNNECESSARY for
HW checksummed packets, in which case the check is skipped in
ip_conntrack, or it uses CHECKSUM_NONE, in which case the checksum
in the packet must be invalid if the check fails and the packet
wouldn't be accepted by the final receipient anyway. skge uses
CHECKSUM_HW for every packet, so they have nothing in common wrt.
HW checksumming. This would normally mean we can rule out HW
checksumming, but for some reason turning it off on skge seems
to help in your case. Stephen, you're more familiar with the
sk* drivers than me, anything I'm missing here?
>>Please also send a list of loaded
>>modules and iptables rules. Thanks.
>
>
> sch_htb 16448 2
> sch_ingress 4420 2
> nvidia 4378188 12
> mga 60096 0
> drm 76136 1 mga
> agpgart 29864 2 nvidia,drm
> sch_sfq 5568 4
> tun 9664 1
> powernow_k8 9616 0
> processor 20432 1 powernow_k8
> sco 12552 2
> ztdummy 3360 0
> zaptel 197760 5 ztdummy
> crc_ccitt 2112 1 zaptel
> lirc_i2c 10180 1
> lirc_dev 14336 1 lirc_i2c
> budget 10240 0
> s5h1420 8900 1 budget
> l64781 7236 1 budget
> ves1820 5892 1 budget
> budget_core 8516 1 budget
> saa7146 15624 2 budget,budget_core
> ttpci_eeprom 2432 1 budget_core
> stv0299 11272 1 budget
> tda8083 5764 1 budget
> ves1x93 6404 1 budget
> dvb_core 82812 2 budget,budget_core
> parport_pc 39472 1
> lp 10880 0
> parport 37964 2 parport_pc,lp
> tuner 24096 0
> ivtv 202388 2
> i2c_algo_bit 9032 1 ivtv
> videodev 9792 1 ivtv
> saa7115 13200 0
> saa7127 11668 0
> msp3400 27980 0
> tveeprom 14560 0
> v4l1_compat 12804 0
> loop 57688 4
> w83627hf 32616 0
> i2c_sensor 3136 1 w83627hf
> i2c_isa 2624 0
> i2c_core 19800 19 lirc_i2c,budget,s5h1420,l64781,ves1820,budget_core,ttpci_eeprom,stv0299,tda8083,ves1x93,tuner,i2c_algo_bit,saa7115,saa7127,msp3400,tveeprom,w83627hf,i2c_sensor,i2c_isa
> snd_seq_oss 33316 0
> snd_seq_midi 7616 0
> snd_seq_midi_event 7488 2 snd_seq_oss,snd_seq_midi
> snd_seq 55128 5 snd_seq_oss,snd_seq_midi,snd_seq_midi_event
> snd_via82xx 25280 2
> snd_ac97_codec 88900 1 snd_via82xx
> snd_mpu401_uart 7040 1 snd_via82xx
> snd_rawmidi 24224 2 snd_seq_midi,snd_mpu401_uart
> snd_seq_device 7824 4 snd_seq_oss,snd_seq_midi,snd_seq,snd_rawmidi
> fcusb2 683148 3
> capidrv 30168 1
> isdn 109160 2 capidrv
> capi 16112 8
> kernelcapi 48736 3 fcusb2,capidrv,capi
> rfcomm 35952 8
> l2cap 24520 7 rfcomm
> hci_usb 14728 3
> bluetooth 46404 8 sco,rfcomm,l2cap,hci_usb
> cls_u32 7624 8
> skge 34256 0
> ipt_hashlimit 8024 1
> ipv6 254848 22
> ehci_hcd 31816 0
> uhci_hcd 31968 0
> capifs 4880 2 capi
> nfsd 107656 17
> lockd 64912 2 nfsd
> nfs_acl 3136 1 nfsd
> sunrpc 142632 13 nfsd,lockd,nfs_acl
>
> However, it happens with init=/bin/bash and loading the single iptables
> rule I sent in the original report, for either eth0/1 or the ppp
> interface. I can send you my 278 other rules if you want, but they have
> had no effect on the problem here.
No, thanks. But your entire .config might help ..
^ permalink raw reply
* Re: Fw: masquerading failure for at least icmp and tcp+sack on amd64
From: Marc Lehmann @ 2005-09-11 13:19 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Andrew Morton, netdev, Netfilter Development Mailinglist
In-Reply-To: <432174EE.80306@trash.net>
On Fri, Sep 09, 2005 at 01:41:34PM +0200, Patrick McHardy <kaber@trash.net> wrote:
> > And ICMP, TCP etc. starts working again.
> >
> > Thanks for the analysis and the hint, I guess that verifies that its hw
> > checksumming. (Weird that hw checksumming on the underlying device somehow
> > changes the ppp packets, but nevertheless).
>
> I tried reproducing the problem without any luck. Its odd that its
> happening on both eth and ppp devices, if it was just ppp I would
> suspect some missing checksum update/invalidation in the ppp driver.
> What network driver are you using?
Happens with both skge and sk98.
> Please also send a list of loaded
> modules and iptables rules. Thanks.
sch_htb 16448 2
sch_ingress 4420 2
nvidia 4378188 12
mga 60096 0
drm 76136 1 mga
agpgart 29864 2 nvidia,drm
sch_sfq 5568 4
tun 9664 1
powernow_k8 9616 0
processor 20432 1 powernow_k8
sco 12552 2
ztdummy 3360 0
zaptel 197760 5 ztdummy
crc_ccitt 2112 1 zaptel
lirc_i2c 10180 1
lirc_dev 14336 1 lirc_i2c
budget 10240 0
s5h1420 8900 1 budget
l64781 7236 1 budget
ves1820 5892 1 budget
budget_core 8516 1 budget
saa7146 15624 2 budget,budget_core
ttpci_eeprom 2432 1 budget_core
stv0299 11272 1 budget
tda8083 5764 1 budget
ves1x93 6404 1 budget
dvb_core 82812 2 budget,budget_core
parport_pc 39472 1
lp 10880 0
parport 37964 2 parport_pc,lp
tuner 24096 0
ivtv 202388 2
i2c_algo_bit 9032 1 ivtv
videodev 9792 1 ivtv
saa7115 13200 0
saa7127 11668 0
msp3400 27980 0
tveeprom 14560 0
v4l1_compat 12804 0
loop 57688 4
w83627hf 32616 0
i2c_sensor 3136 1 w83627hf
i2c_isa 2624 0
i2c_core 19800 19 lirc_i2c,budget,s5h1420,l64781,ves1820,budget_core,ttpci_eeprom,stv0299,tda8083,ves1x93,tuner,i2c_algo_bit,saa7115,saa7127,msp3400,tveeprom,w83627hf,i2c_sensor,i2c_isa
snd_seq_oss 33316 0
snd_seq_midi 7616 0
snd_seq_midi_event 7488 2 snd_seq_oss,snd_seq_midi
snd_seq 55128 5 snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_via82xx 25280 2
snd_ac97_codec 88900 1 snd_via82xx
snd_mpu401_uart 7040 1 snd_via82xx
snd_rawmidi 24224 2 snd_seq_midi,snd_mpu401_uart
snd_seq_device 7824 4 snd_seq_oss,snd_seq_midi,snd_seq,snd_rawmidi
fcusb2 683148 3
capidrv 30168 1
isdn 109160 2 capidrv
capi 16112 8
kernelcapi 48736 3 fcusb2,capidrv,capi
rfcomm 35952 8
l2cap 24520 7 rfcomm
hci_usb 14728 3
bluetooth 46404 8 sco,rfcomm,l2cap,hci_usb
cls_u32 7624 8
skge 34256 0
ipt_hashlimit 8024 1
ipv6 254848 22
ehci_hcd 31816 0
uhci_hcd 31968 0
capifs 4880 2 capi
nfsd 107656 17
lockd 64912 2 nfsd
nfs_acl 3136 1 nfsd
sunrpc 142632 13 nfsd,lockd,nfs_acl
However, it happens with init=/bin/bash and loading the single iptables
rule I sent in the original report, for either eth0/1 or the ppp
interface. I can send you my 278 other rules if you want, but they have
had no effect on the problem here.
--
The choice of a
-----==- _GNU_
----==-- _ generation Marc Lehmann
---==---(_)__ __ ____ __ pcg@goof.com
--==---/ / _ \/ // /\ \/ / http://schmorp.de/
-=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE
^ permalink raw reply
* Check out FUSIONPHP.NET today!!!
From: NOT SPAM @ 2005-09-11 3:14 UTC (permalink / raw)
To: netdev
Hey man/woman,
I'm here to tell you that FusionPHP.NET is a REALLY great website and you should please visit them today!!!! Visit us today, fullfilling your PHP needs!!!
http://www.fusionphp.net/
We have the BEST free php news script in the world. There is no substitution.
Please spread the word about our website and our scripts!!! Forward this email to 250 people and we'll pay you $5.00 US dollars via paypal.
Thank you,
Patatten Boerken
http://fusionphp.net/
patattenboerken@gmail.com
webmaster@fusionphp.net
NOTE: THIS MESSAGE IS NOT SPAM and your email was obtained from legal sources.
121
^ permalink raw reply
* Re: 2.6.13-mm2
From: Patrick McHardy @ 2005-09-11 1:25 UTC (permalink / raw)
To: J.A. Magallon; +Cc: Linux-Kernel Lista, Andrew Morton, netdev
In-Reply-To: <1126401757l.6556l.0l@werewolf.able.es>
J.A. Magallon wrote:
> On 09.11, Patrick McHardy wrote:
>
>>[NETFILTER]: Don't exclude local packets from MASQUERADING
>>
> Thanks, reverting this made things work again.
>
> Are you confident in fixing this shortly, or should I just drop pump ?
I should have a fix within the next couple of days.
^ permalink raw reply
* Re: 2.6.13-mm2
From: J.A. Magallon @ 2005-09-11 1:22 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Linux-Kernel Lista, Andrew Morton, netdev
In-Reply-To: <43238259.505@trash.net>
On 09.11, Patrick McHardy wrote:
> J.A. Magallon wrote:
> > And I also get this on syslog:
> >
> > Sep 11 02:56:58 werewolf kernel: MASQUERADE: eth0 ate my IP address
> > Sep 11 02:56:58 werewolf kernel: MASQUERADE: eth0 ate my IP address
>
> Thanks, I'm pretty sure its caused by this patch. The problem is that
> pump uses a regular UDP socket (some other dhcp clients use AF_PACKET
> sockets), and packet sent by it are also handled by iptables. The
> MASQUERADE rule can't find a local IP address and drops the packet.
> I'm not sure how to fix it yet, reverting the patch is not a good
> option.
>
>
> [NETFILTER]: Don't exclude local packets from MASQUERADING
>
> Increases consistency in source-address selection.
>
> Signed-off-by: Patrick McHardy <kaber@trash.net>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> ---
> commit 9baa5c67ff4ce57b6b9f68c90714a1bb876fccd7
> tree 27f2c48e12e1bb5e3e6d5f8320651c213892ed20
> parent fb13ab2849074244a51ae5147483610529a29ced
> author Patrick McHardy <kaber@trash.net> Sun, 14 Aug 2005 17:32:50 -0700
> committer David S. Miller <davem@sunset.davemloft.net> Mon, 29 Aug 2005 15:58:36 -0700
>
> net/ipv4/netfilter/ipt_MASQUERADE.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
> --- a/net/ipv4/netfilter/ipt_MASQUERADE.c
> +++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
> @@ -86,11 +86,6 @@ masquerade_target(struct sk_buff **pskb,
>
> IP_NF_ASSERT(hooknum == NF_IP_POST_ROUTING);
>
> - /* FIXME: For the moment, don't do local packets, breaks
> - testsuite for 2.3.49 --RR */
> - if ((*pskb)->sk)
> - return NF_ACCEPT;
> -
> ct = ip_conntrack_get(*pskb, &ctinfo);
> IP_NF_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED
> || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY));
>
Thanks, reverting this made things work again.
Are you confident in fixing this shortly, or should I just drop pump ?
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.13-jam3 (gcc 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0))
^ permalink raw reply
* Re: 2.6.13-mm2
From: Patrick McHardy @ 2005-09-11 1:03 UTC (permalink / raw)
To: J.A. Magallon; +Cc: Linux-Kernel Lista, Andrew Morton, netdev
In-Reply-To: <1126400288l.6300l.3l@werewolf.able.es>
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
J.A. Magallon wrote:
> And I also get this on syslog:
>
> Sep 11 02:56:58 werewolf kernel: MASQUERADE: eth0 ate my IP address
> Sep 11 02:56:58 werewolf kernel: MASQUERADE: eth0 ate my IP address
Thanks, I'm pretty sure its caused by this patch. The problem is that
pump uses a regular UDP socket (some other dhcp clients use AF_PACKET
sockets), and packet sent by it are also handled by iptables. The
MASQUERADE rule can't find a local IP address and drops the packet.
I'm not sure how to fix it yet, reverting the patch is not a good
option.
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1219 bytes --]
[NETFILTER]: Don't exclude local packets from MASQUERADING
Increases consistency in source-address selection.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
commit 9baa5c67ff4ce57b6b9f68c90714a1bb876fccd7
tree 27f2c48e12e1bb5e3e6d5f8320651c213892ed20
parent fb13ab2849074244a51ae5147483610529a29ced
author Patrick McHardy <kaber@trash.net> Sun, 14 Aug 2005 17:32:50 -0700
committer David S. Miller <davem@sunset.davemloft.net> Mon, 29 Aug 2005 15:58:36 -0700
net/ipv4/netfilter/ipt_MASQUERADE.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/net/ipv4/netfilter/ipt_MASQUERADE.c b/net/ipv4/netfilter/ipt_MASQUERADE.c
--- a/net/ipv4/netfilter/ipt_MASQUERADE.c
+++ b/net/ipv4/netfilter/ipt_MASQUERADE.c
@@ -86,11 +86,6 @@ masquerade_target(struct sk_buff **pskb,
IP_NF_ASSERT(hooknum == NF_IP_POST_ROUTING);
- /* FIXME: For the moment, don't do local packets, breaks
- testsuite for 2.3.49 --RR */
- if ((*pskb)->sk)
- return NF_ACCEPT;
-
ct = ip_conntrack_get(*pskb, &ctinfo);
IP_NF_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED
|| ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY));
^ permalink raw reply
* Re: 2.6.13-mm2
From: J.A. Magallon @ 2005-09-11 0:58 UTC (permalink / raw)
To: Linux-Kernel Lista; +Cc: Patrick McHardy, Andrew Morton, netdev
In-Reply-To: <1126399776l.6300l.2l@werewolf.able.es>
On 09.11, J.A. Magallon wrote:
>
> On 09.11, Patrick McHardy wrote:
> > Andrew Morton wrote:
> > > "J.A. Magallon" <jamagallon@able.es> wrote:
> > >
> > >>I can not ifup an interface while iptables is using it.
> > >>Is this expected behaviour ?
> > >
> > > Maybe it's expected, but breaking existing userspace is a serious issue.
> >
> > No, its not expected.
> >
> > >>There is a possible bug (IMHO) in Mandrake initscripts, that start iptables
> > >>before network interfaces, but this had always worked.
> > >>
> > >>Any ideas ?
> >
> > What's happening when you try to set the interface up? Please
> > provide output of ifup and strace of the failing command. Thanks.
>
> werewolf:~# ifdown eth0
> werewolf:~# service iptables start
> Applying iptables firewall rules:
> [ OK ]
> werewolf:~# iptables -v -t nat -L
> Chain PREROUTING (policy ACCEPT 2 packets, 156 bytes)
> pkts bytes target prot opt in out source destination
>
> Chain POSTROUTING (policy ACCEPT 5 packets, 300 bytes)
> pkts bytes target prot opt in out source destination
> 0 0 MASQUERADE all -- any eth0 anywhere anywhere
>
> Chain OUTPUT (policy ACCEPT 5 packets, 300 bytes)
> pkts bytes target prot opt in out source destination
> werewolf:~# iptables -v -t filter -L
> Chain INPUT (policy ACCEPT 257 packets, 51631 bytes)
> pkts bytes target prot opt in out source destination
>
> Chain FORWARD (policy DROP 0 packets, 0 bytes)
> pkts bytes target prot opt in out source destination
> 0 0 ACCEPT all -- eth0 eth1 anywhere anywhere state RELATED,ESTABLISHED
> 0 0 ACCEPT all -- eth1 eth0 anywhere anywhere
>
> Chain OUTPUT (policy ACCEPT 251 packets, 51163 bytes)
> pkts bytes target prot opt in out source destination
>
> werewolf:~# ifup eth0
>
> Determining IP information for eth0...Operation failed.
> failed.
>
> I traced the problem to pump, and I did a diff between strace of pump
> when it works and when it doesnt (witout and with iptables started):
>
> socket(PF_FILE, SOCK_STREAM, 0) = 3
> connect(3, {sa_family=AF_FILE, path="/var/run/pump.sock"}, 20) = 0
> write(3, "\0\0\0\0eth0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\300"..., 4280) = 4280
> -read(3, "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4280) = 4280
> -exit_group(0) = ?
> -Process 7931 detached
> +read(3, "\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4280) = 4280
> +socket(PF_FILE, SOCK_STREAM, 0) = 4
> +connect(4, {sa_family=AF_FILE, path="/var/run/pump.sock"}, 20) = 0
> +write(4, "\0\0\0\0eth0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\300"..., 4280) = 4280
> +read(4, "\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4280) = 4280
> +write(2, "Operation failed.\n", 18Operation failed.
> +) = 18
> +exit_group(1) = ?
> +Process 7822 detached
>
> pump seems to write something in the socket, try to read it again and gets
> different results.
>
> Note, my iptables are modular and I did not unload the modules, just stopped
> them with 'service iptables stop'. Digging further, if I just do
> iptables -t nat -F, pump works again.
>
> Hope this helps.
>
And I also get this on syslog:
Sep 11 02:56:58 werewolf kernel: MASQUERADE: eth0 ate my IP address
Sep 11 02:56:58 werewolf kernel: MASQUERADE: eth0 ate my IP address
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.13-jam3 (gcc 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0))
^ permalink raw reply
* Re: 2.6.13-mm2
From: J.A. Magallon @ 2005-09-11 0:49 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Andrew Morton, linux-kernel, netdev
In-Reply-To: <4323753D.9030007@trash.net>
On 09.11, Patrick McHardy wrote:
> Andrew Morton wrote:
> > "J.A. Magallon" <jamagallon@able.es> wrote:
> >
> >>I can not ifup an interface while iptables is using it.
> >>Is this expected behaviour ?
> >
> > Maybe it's expected, but breaking existing userspace is a serious issue.
>
> No, its not expected.
>
> >>There is a possible bug (IMHO) in Mandrake initscripts, that start iptables
> >>before network interfaces, but this had always worked.
> >>
> >>Any ideas ?
>
> What's happening when you try to set the interface up? Please
> provide output of ifup and strace of the failing command. Thanks.
werewolf:~# ifdown eth0
werewolf:~# service iptables start
Applying iptables firewall rules:
[ OK ]
werewolf:~# iptables -v -t nat -L
Chain PREROUTING (policy ACCEPT 2 packets, 156 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 5 packets, 300 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- any eth0 anywhere anywhere
Chain OUTPUT (policy ACCEPT 5 packets, 300 bytes)
pkts bytes target prot opt in out source destination
werewolf:~# iptables -v -t filter -L
Chain INPUT (policy ACCEPT 257 packets, 51631 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- eth0 eth1 anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- eth1 eth0 anywhere anywhere
Chain OUTPUT (policy ACCEPT 251 packets, 51163 bytes)
pkts bytes target prot opt in out source destination
werewolf:~# ifup eth0
Determining IP information for eth0...Operation failed.
failed.
I traced the problem to pump, and I did a diff between strace of pump
when it works and when it doesnt (witout and with iptables started):
socket(PF_FILE, SOCK_STREAM, 0) = 3
connect(3, {sa_family=AF_FILE, path="/var/run/pump.sock"}, 20) = 0
write(3, "\0\0\0\0eth0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\300"..., 4280) = 4280
-read(3, "\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4280) = 4280
-exit_group(0) = ?
-Process 7931 detached
+read(3, "\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4280) = 4280
+socket(PF_FILE, SOCK_STREAM, 0) = 4
+connect(4, {sa_family=AF_FILE, path="/var/run/pump.sock"}, 20) = 0
+write(4, "\0\0\0\0eth0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\300"..., 4280) = 4280
+read(4, "\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4280) = 4280
+write(2, "Operation failed.\n", 18Operation failed.
+) = 18
+exit_group(1) = ?
+Process 7822 detached
pump seems to write something in the socket, try to read it again and gets
different results.
Note, my iptables are modular and I did not unload the modules, just stopped
them with 'service iptables stop'. Digging further, if I just do
iptables -t nat -F, pump works again.
Hope this helps.
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.13-jam3 (gcc 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0))
^ permalink raw reply
* Re: 2.6.13-mm2
From: Patrick McHardy @ 2005-09-11 0:07 UTC (permalink / raw)
To: Andrew Morton; +Cc: J.A. Magallon, linux-kernel, netdev
In-Reply-To: <20050910165659.5eea90d0.akpm@osdl.org>
Andrew Morton wrote:
> "J.A. Magallon" <jamagallon@able.es> wrote:
>
>>I can not ifup an interface while iptables is using it.
>>Is this expected behaviour ?
>
> Maybe it's expected, but breaking existing userspace is a serious issue.
No, its not expected.
>>There is a possible bug (IMHO) in Mandrake initscripts, that start iptables
>>before network interfaces, but this had always worked.
>>
>>Any ideas ?
What's happening when you try to set the interface up? Please
provide output of ifup and strace of the failing command. Thanks.
^ permalink raw reply
* Re: 2.6.13-mm2
From: Andrew Morton @ 2005-09-10 23:56 UTC (permalink / raw)
To: J.A. Magallon; +Cc: linux-kernel, netdev
In-Reply-To: <1126396015l.6300l.1l@werewolf.able.es>
"J.A. Magallon" <jamagallon@able.es> wrote:
>
>
> On 09.08, Andrew Morton wrote:
> >
> > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.13/2.6.13-mm2/
> >
> > (kernel.org propagation is slow. There's a temp copy at
> > http://www.zip.com.au/~akpm/linux/patches/stuff/2.6.13-mm2.bz2)
> >
> >
>
> I can not ifup an interface while iptables is using it.
> Is this expected behaviour ?
Maybe it's expected, but breaking existing userspace is a serious issue.
> There is a possible bug (IMHO) in Mandrake initscripts, that start iptables
> before network interfaces, but this had always worked.
>
> Any ideas ?
Please always cc netdev@vger.kernel.org on networking matters.
^ permalink raw reply
* [PATCH] af_packet: Allow for > 8 byte hardware addresses.
From: Eric W. Biederman @ 2005-09-10 17:25 UTC (permalink / raw)
To: David S. Miller; +Cc: openib-general, netdev
In-Reply-To: <20050811.124916.77057824.davem@davemloft.net>
Does this approach look sound?
The convention it adopts is that longer addresses will simply extend
the hardeware address byte arrays at the end of sockaddr_ll and
packet_mreq.
In making this change a small information leak was also closed.
The code only initializes the hardware address bytes that are
used, but all of struct sockaddr_ll was copied to userspace.
Now we just copy sockaddr_ll to the last byte of the hardware
address used.
Hopefully for the common case of ethernet returning a value that is
2 bytes smaller than sockaddr_ll won't break anything. Given that it
simplifies the code and removes an information leak I thought
the small chance of breakage was worth it. If not this can
be easily fixed.
For error checking larger structures than our internal
maximums continue to be allowed but an error is signaled if we can
not fit the hardware address into our internal structure.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
net/packet/af_packet.c | 64 +++++++++++++++++++++++++++++++++++-------------
1 files changed, 47 insertions(+), 17 deletions(-)
39a41e0363bab6661f40f24b404416b99de0c15a
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -36,6 +36,11 @@
* Michal Ostrowski : Module initialization cleanup.
* Ulises Alonso : Frame number limit removal and
* packet_set_ring memory leak.
+ * Eric Biederman : Allow for > 8 byte hardware addresses.
+ * The convention is that longer addresses
+ * will simply extend the hardware address
+ * byte arrays at the end of sockaddr_ll
+ * and packet_mreq.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -161,7 +166,17 @@ struct packet_mclist
int count;
unsigned short type;
unsigned short alen;
- unsigned char addr[8];
+ unsigned char addr[MAX_ADDR_LEN];
+};
+/* identical to struct packet_mreq except it has
+ * a longer address field.
+ */
+struct packet_mreq_max
+{
+ int mr_ifindex;
+ unsigned short mr_type;
+ unsigned short mr_alen;
+ unsigned char mr_address[MAX_ADDR_LEN];
};
#endif
#ifdef CONFIG_PACKET_MMAP
@@ -716,6 +731,8 @@ static int packet_sendmsg(struct kiocb *
err = -EINVAL;
if (msg->msg_namelen < sizeof(struct sockaddr_ll))
goto out;
+ if (msg->msg_namelen < (saddr->sll_halen + offsetof(struct sockaddr_ll, sll_addr)))
+ goto out;
ifindex = saddr->sll_ifindex;
proto = saddr->sll_protocol;
addr = saddr->sll_addr;
@@ -744,6 +761,12 @@ static int packet_sendmsg(struct kiocb *
if (dev->hard_header) {
int res;
err = -EINVAL;
+ if (saddr) {
+ if (saddr->sll_halen != dev->addr_len)
+ goto out_free;
+ if (saddr->sll_hatype != dev->type)
+ goto out_free;
+ }
res = dev->hard_header(skb, dev, ntohs(proto), addr, NULL, len);
if (sock->type != SOCK_DGRAM) {
skb->tail = skb->data;
@@ -1045,6 +1068,7 @@ static int packet_recvmsg(struct kiocb *
struct sock *sk = sock->sk;
struct sk_buff *skb;
int copied, err;
+ struct sockaddr_ll *sll;
err = -EINVAL;
if (flags & ~(MSG_PEEK|MSG_DONTWAIT|MSG_TRUNC|MSG_CMSG_COMPAT))
@@ -1057,16 +1081,6 @@ static int packet_recvmsg(struct kiocb *
#endif
/*
- * If the address length field is there to be filled in, we fill
- * it in now.
- */
-
- if (sock->type == SOCK_PACKET)
- msg->msg_namelen = sizeof(struct sockaddr_pkt);
- else
- msg->msg_namelen = sizeof(struct sockaddr_ll);
-
- /*
* Call the generic datagram receiver. This handles all sorts
* of horrible races and re-entrancy so we can forget about it
* in the protocol layers.
@@ -1087,6 +1101,17 @@ static int packet_recvmsg(struct kiocb *
goto out;
/*
+ * If the address length field is there to be filled in, we fill
+ * it in now.
+ */
+
+ sll = (struct sockaddr_ll*)skb->cb;
+ if (sock->type == SOCK_PACKET)
+ msg->msg_namelen = sizeof(struct sockaddr_pkt);
+ else
+ msg->msg_namelen = sll->sll_halen + offsetof(struct sockaddr_ll, sll_addr);
+
+ /*
* You lose any data beyond the buffer you gave. If it worries a
* user program they can ask the device for its MTU anyway.
*/
@@ -1166,7 +1191,7 @@ static int packet_getname(struct socket
sll->sll_hatype = 0; /* Bad: we have no ARPHRD_UNSPEC */
sll->sll_halen = 0;
}
- *uaddr_len = sizeof(*sll);
+ *uaddr_len = offsetof(struct sockaddr_ll, sll_addr) + sll->sll_halen;
return 0;
}
@@ -1199,7 +1224,7 @@ static void packet_dev_mclist(struct net
}
}
-static int packet_mc_add(struct sock *sk, struct packet_mreq *mreq)
+static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq)
{
struct packet_sock *po = pkt_sk(sk);
struct packet_mclist *ml, *i;
@@ -1249,7 +1274,7 @@ done:
return err;
}
-static int packet_mc_drop(struct sock *sk, struct packet_mreq *mreq)
+static int packet_mc_drop(struct sock *sk, struct packet_mreq_max *mreq)
{
struct packet_mclist *ml, **mlp;
@@ -1315,11 +1340,16 @@ packet_setsockopt(struct socket *sock, i
case PACKET_ADD_MEMBERSHIP:
case PACKET_DROP_MEMBERSHIP:
{
- struct packet_mreq mreq;
- if (optlen<sizeof(mreq))
+ struct packet_mreq_max mreq;
+ int len = optlen;
+ if (len < sizeof(struct packet_mreq))
return -EINVAL;
- if (copy_from_user(&mreq,optval,sizeof(mreq)))
+ if (len > sizeof(mreq))
+ len = sizeof(mreq);
+ if (copy_from_user(&mreq,optval,len))
return -EFAULT;
+ if (len < (mreq.mr_alen + offsetof(struct packet_mreq, mr_address)))
+ return -EINVAL;
if (optname == PACKET_ADD_MEMBERSHIP)
ret = packet_mc_add(sk, &mreq);
else
^ permalink raw reply
* [PATCH 1/3] sunrpc: add endian annotations
From: Alexey Dobriyan @ 2005-09-10 16:40 UTC (permalink / raw)
To: Trond Myklebust; +Cc: Al Viro, netdev, linux-kernel
Minimal patch to remove junk endianness warnings from net/sunrpc/*.
* usual s/u32/__be32/.
* add svc_getnl():
Take network-endian value from buffer, convert to host-endian
and return it.
* add svc_putnl():
Take host-endian value, convert to network-endian and put it
into a buffer.
* convert to svc_getnl(), svc_putnl().
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
include/linux/sunrpc/auth.h | 16 +++++-----
include/linux/sunrpc/svc.h | 23 +++++++++++++--
include/linux/sunrpc/svcauth.h | 4 +-
include/linux/sunrpc/xdr.h | 20 ++++++-------
include/linux/sunrpc/xprt.h | 8 ++---
net/sunrpc/auth.c | 12 ++++----
net/sunrpc/auth_gss/auth_gss.c | 26 +++++++++--------
net/sunrpc/auth_gss/gss_krb5_seal.c | 4 +-
net/sunrpc/auth_gss/svcauth_gss.c | 54 ++++++++++++++++++------------------
net/sunrpc/auth_null.c | 8 ++---
net/sunrpc/auth_unix.c | 10 +++---
net/sunrpc/clnt.c | 23 ++++++++-------
net/sunrpc/pmap_clnt.c | 6 ++--
net/sunrpc/svc.c | 50 ++++++++++++++++-----------------
net/sunrpc/svcauth.c | 4 +-
net/sunrpc/svcauth_unix.c | 16 +++++-----
net/sunrpc/svcsock.c | 2 -
net/sunrpc/xdr.c | 28 +++++++++---------
net/sunrpc/xprt.c | 9 +++---
19 files changed, 172 insertions(+), 151 deletions(-)
diff -uprN linux-vanilla/include/linux/sunrpc/auth.h linux-001/include/linux/sunrpc/auth.h
--- linux-vanilla/include/linux/sunrpc/auth.h 2005-09-10 10:52:29.000000000 +0400
+++ linux-001/include/linux/sunrpc/auth.h 2005-09-10 11:24:40.000000000 +0400
@@ -103,13 +103,13 @@ struct rpc_credops {
void (*crdestroy)(struct rpc_cred *);
int (*crmatch)(struct auth_cred *, struct rpc_cred *, int);
- u32 * (*crmarshal)(struct rpc_task *, u32 *);
+ __be32 * (*crmarshal)(struct rpc_task *, __be32 *);
int (*crrefresh)(struct rpc_task *);
- u32 * (*crvalidate)(struct rpc_task *, u32 *);
+ __be32 * (*crvalidate)(struct rpc_task *, __be32 *);
int (*crwrap_req)(struct rpc_task *, kxdrproc_t,
- void *, u32 *, void *);
+ void *, __be32 *, void *);
int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t,
- void *, u32 *, void *);
+ void *, __be32 *, void *);
};
extern struct rpc_authops authunix_ops;
@@ -128,10 +128,10 @@ struct rpc_cred * rpcauth_bindcred(struc
void rpcauth_holdcred(struct rpc_task *);
void put_rpccred(struct rpc_cred *);
void rpcauth_unbindcred(struct rpc_task *);
-u32 * rpcauth_marshcred(struct rpc_task *, u32 *);
-u32 * rpcauth_checkverf(struct rpc_task *, u32 *);
-int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, u32 *data, void *obj);
-int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, u32 *data, void *obj);
+__be32 * rpcauth_marshcred(struct rpc_task *, __be32 *);
+__be32 * rpcauth_checkverf(struct rpc_task *, __be32 *);
+int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj);
+int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj);
int rpcauth_refreshcred(struct rpc_task *);
void rpcauth_invalcred(struct rpc_task *);
int rpcauth_uptodatecred(struct rpc_task *);
diff -uprN linux-vanilla/include/linux/sunrpc/svc.h linux-001/include/linux/sunrpc/svc.h
--- linux-vanilla/include/linux/sunrpc/svc.h 2005-09-10 10:52:29.000000000 +0400
+++ linux-001/include/linux/sunrpc/svc.h 2005-09-10 12:10:29.000000000 +0400
@@ -78,6 +78,23 @@ struct svc_serv {
*/
#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
+static inline u32 svc_getnl(struct kvec *iov)
+{
+ __be32 val, *vp;
+ vp = iov->iov_base;
+ val = *vp++;
+ iov->iov_base = (void*)vp;
+ iov->iov_len -= sizeof(__be32);
+ return ntohl(val);
+}
+
+static inline void svc_putnl(struct kvec *iov, u32 val)
+{
+ __be32 *vp = iov->iov_base + iov->iov_len;
+ *vp = htonl(val);
+ iov->iov_len += sizeof(__be32);
+}
+
static inline u32 svc_getu32(struct kvec *iov)
{
u32 val, *vp;
@@ -175,7 +192,7 @@ xdr_argsize_check(struct svc_rqst *rqstp
}
static inline int
-xdr_ressize_check(struct svc_rqst *rqstp, u32 *p)
+xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p)
{
struct kvec *vec = &rqstp->rq_res.head[0];
char *cp = (char*)p;
@@ -279,13 +296,13 @@ struct svc_version {
* A return value of 0 means drop the request.
* vs_dispatch == NULL means use default dispatcher.
*/
- int (*vs_dispatch)(struct svc_rqst *, u32 *);
+ int (*vs_dispatch)(struct svc_rqst *, __be32 *);
};
/*
* RPC procedure info
*/
-typedef int (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp);
+typedef __be32 (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp);
struct svc_procedure {
svc_procfunc pc_func; /* process the request */
kxdrproc_t pc_decode; /* XDR decode args */
diff -uprN linux-vanilla/include/linux/sunrpc/svcauth.h linux-001/include/linux/sunrpc/svcauth.h
--- linux-vanilla/include/linux/sunrpc/svcauth.h 2005-09-10 10:52:29.000000000 +0400
+++ linux-001/include/linux/sunrpc/svcauth.h 2005-09-10 11:50:02.000000000 +0400
@@ -91,7 +91,7 @@ struct auth_ops {
char * name;
struct module *owner;
int flavour;
- int (*accept)(struct svc_rqst *rq, u32 *authp);
+ int (*accept)(struct svc_rqst *rq, __be32 *authp);
int (*release)(struct svc_rqst *rq);
void (*domain_release)(struct auth_domain *);
int (*set_client)(struct svc_rqst *rq);
@@ -108,7 +108,7 @@ struct auth_ops {
#define SVC_COMPLETE 9
-extern int svc_authenticate(struct svc_rqst *rqstp, u32 *authp);
+extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp);
extern int svc_authorise(struct svc_rqst *rqstp);
extern int svc_set_client(struct svc_rqst *rqstp);
extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops);
diff -uprN linux-vanilla/include/linux/sunrpc/xdr.h linux-001/include/linux/sunrpc/xdr.h
--- linux-vanilla/include/linux/sunrpc/xdr.h 2005-09-10 10:52:29.000000000 +0400
+++ linux-001/include/linux/sunrpc/xdr.h 2005-09-10 11:59:48.000000000 +0400
@@ -32,7 +32,7 @@ struct xdr_netobj {
* side) or svc_rqst pointer (server side).
* Encode functions always assume there's enough room in the buffer.
*/
-typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj);
+typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj);
/*
* Basic structure for transmission/reception of a client XDR message.
@@ -88,20 +88,20 @@ struct xdr_buf {
/*
* Miscellaneous XDR helper functions
*/
-u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len);
-u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len);
-u32 * xdr_encode_string(u32 *p, const char *s);
-u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen);
-u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen);
-u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *);
-u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *);
+__be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int len);
+__be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int len);
+__be32 *xdr_encode_string(__be32 *p, const char *s);
+__be32 *xdr_decode_string(__be32 *p, char **sp, int *lenp, int maxlen);
+__be32 *xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen);
+__be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *);
+__be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *);
void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int,
unsigned int);
void xdr_inline_pages(struct xdr_buf *, unsigned int,
struct page **, unsigned int, unsigned int);
-static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len)
+static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len)
{
return xdr_encode_opaque(p, s, len);
}
@@ -129,7 +129,7 @@ xdr_decode_hyper(u32 *p, __u64 *valp)
* Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
*/
static inline int
-xdr_adjust_iovec(struct kvec *iov, u32 *p)
+xdr_adjust_iovec(struct kvec *iov, __be32 *p)
{
return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base);
}
diff -uprN linux-vanilla/include/linux/sunrpc/xprt.h linux-001/include/linux/sunrpc/xprt.h
--- linux-vanilla/include/linux/sunrpc/xprt.h 2005-09-10 10:52:29.000000000 +0400
+++ linux-001/include/linux/sunrpc/xprt.h 2005-09-10 11:19:38.000000000 +0400
@@ -91,7 +91,7 @@ struct rpc_rqst {
* This is the private part
*/
struct rpc_task * rq_task; /* RPC task data */
- __u32 rq_xid; /* request XID */
+ __be32 rq_xid; /* request XID */
int rq_cong; /* has incremented xprt->cong */
int rq_received; /* receive completed */
u32 rq_seqno; /* gss seq no. used on req. */
@@ -164,9 +164,9 @@ struct rpc_xprt {
/*
* State of TCP reply receive stuff
*/
- u32 tcp_recm, /* Fragment header */
- tcp_xid, /* Current XID */
- tcp_reclen, /* fragment length */
+ __be32 tcp_recm, /* Fragment header */
+ tcp_xid; /* Current XID */
+ u32 tcp_reclen, /* fragment length */
tcp_offset; /* fragment offset */
unsigned long tcp_copied, /* copied to request */
tcp_flags;
diff -uprN linux-vanilla/net/sunrpc/auth.c linux-001/net/sunrpc/auth.c
--- linux-vanilla/net/sunrpc/auth.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/auth.c 2005-09-10 11:23:33.000000000 +0400
@@ -310,8 +310,8 @@ rpcauth_unbindcred(struct rpc_task *task
task->tk_msg.rpc_cred = NULL;
}
-u32 *
-rpcauth_marshcred(struct rpc_task *task, u32 *p)
+__be32 *
+rpcauth_marshcred(struct rpc_task *task, __be32 *p)
{
struct rpc_auth *auth = task->tk_auth;
struct rpc_cred *cred = task->tk_msg.rpc_cred;
@@ -321,8 +321,8 @@ rpcauth_marshcred(struct rpc_task *task,
return cred->cr_ops->crmarshal(task, p);
}
-u32 *
-rpcauth_checkverf(struct rpc_task *task, u32 *p)
+__be32 *
+rpcauth_checkverf(struct rpc_task *task, __be32 *p)
{
struct rpc_auth *auth = task->tk_auth;
struct rpc_cred *cred = task->tk_msg.rpc_cred;
@@ -334,7 +334,7 @@ rpcauth_checkverf(struct rpc_task *task,
int
rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp,
- u32 *data, void *obj)
+ __be32 *data, void *obj)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;
@@ -348,7 +348,7 @@ rpcauth_wrap_req(struct rpc_task *task,
int
rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
- u32 *data, void *obj)
+ __be32 *data, void *obj)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;
diff -uprN linux-vanilla/net/sunrpc/auth_gss/auth_gss.c linux-001/net/sunrpc/auth_gss/auth_gss.c
--- linux-vanilla/net/sunrpc/auth_gss/auth_gss.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/auth_gss/auth_gss.c 2005-09-10 12:08:09.000000000 +0400
@@ -814,14 +814,14 @@ gss_match(struct auth_cred *acred, struc
* Marshal credentials.
* Maybe we should keep a cached credential for performance reasons.
*/
-static u32 *
-gss_marshal(struct rpc_task *task, u32 *p)
+static __be32 *
+gss_marshal(struct rpc_task *task, __be32 *p)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;
struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
gc_base);
struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
- u32 *cred_len;
+ __be32 *cred_len;
struct rpc_rqst *req = task->tk_rqstp;
u32 maj_stat = 0;
struct xdr_netobj mic;
@@ -886,14 +886,15 @@ gss_refresh(struct rpc_task *task)
return 0;
}
-static u32 *
-gss_validate(struct rpc_task *task, u32 *p)
+static __be32 *
+gss_validate(struct rpc_task *task, __be32 *p)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;
struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
gc_base);
struct gss_cl_ctx *ctx = gss_cred_get_ctx(cred);
- u32 seq, qop_state;
+ __be32 seq;
+ u32 qop_state;
struct kvec iov;
struct xdr_buf verf_buf;
struct xdr_netobj mic;
@@ -943,13 +944,14 @@ out_bad:
static inline int
gss_wrap_req_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx,
- kxdrproc_t encode, struct rpc_rqst *rqstp, u32 *p, void *obj)
+ kxdrproc_t encode, struct rpc_rqst *rqstp, __be32 *p, void *obj)
{
struct xdr_buf *snd_buf = &rqstp->rq_snd_buf;
struct xdr_buf integ_buf;
- u32 *integ_len = NULL;
+ __be32 *integ_len = NULL;
struct xdr_netobj mic;
- u32 offset, *q;
+ u32 offset;
+ __be32 *q;
struct kvec *iov;
u32 maj_stat = 0;
int status = -EIO;
@@ -992,7 +994,7 @@ gss_wrap_req_integ(struct rpc_cred *cred
static int
gss_wrap_req(struct rpc_task *task,
- kxdrproc_t encode, void *rqstp, u32 *p, void *obj)
+ kxdrproc_t encode, void *rqstp, __be32 *p, void *obj)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;
struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
@@ -1027,7 +1029,7 @@ out:
static inline int
gss_unwrap_resp_integ(struct rpc_cred *cred, struct gss_cl_ctx *ctx,
- struct rpc_rqst *rqstp, u32 **p)
+ struct rpc_rqst *rqstp, __be32 **p)
{
struct xdr_buf *rcv_buf = &rqstp->rq_rcv_buf;
struct xdr_buf integ_buf;
@@ -1065,7 +1067,7 @@ gss_unwrap_resp_integ(struct rpc_cred *c
static int
gss_unwrap_resp(struct rpc_task *task,
- kxdrproc_t decode, void *rqstp, u32 *p, void *obj)
+ kxdrproc_t decode, void *rqstp, __be32 *p, void *obj)
{
struct rpc_cred *cred = task->tk_msg.rpc_cred;
struct gss_cred *gss_cred = container_of(cred, struct gss_cred,
diff -uprN linux-vanilla/net/sunrpc/auth_gss/gss_krb5_seal.c linux-001/net/sunrpc/auth_gss/gss_krb5_seal.c
--- linux-vanilla/net/sunrpc/auth_gss/gss_krb5_seal.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/auth_gss/gss_krb5_seal.c 2005-09-10 12:17:04.000000000 +0400
@@ -131,10 +131,10 @@ krb5_make_token(struct krb5_ctx *ctx, in
krb5_hdr = ptr - 2;
msg_start = krb5_hdr + 24;
- *(u16 *)(krb5_hdr + 2) = htons(ctx->signalg);
+ *(__be16 *)(krb5_hdr + 2) = htons(ctx->signalg);
memset(krb5_hdr + 4, 0xff, 4);
if (toktype == KG_TOK_WRAP_MSG)
- *(u16 *)(krb5_hdr + 4) = htons(ctx->sealalg);
+ *(__be16 *)(krb5_hdr + 4) = htons(ctx->sealalg);
if (toktype == KG_TOK_WRAP_MSG) {
/* XXX removing support for now */
diff -uprN linux-vanilla/net/sunrpc/auth_gss/svcauth_gss.c linux-001/net/sunrpc/auth_gss/svcauth_gss.c
--- linux-vanilla/net/sunrpc/auth_gss/svcauth_gss.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/auth_gss/svcauth_gss.c 2005-09-10 12:16:42.000000000 +0400
@@ -508,7 +508,7 @@ svc_safe_getnetobj(struct kvec *argv, st
if (argv->iov_len < 4)
return -1;
- o->len = ntohl(svc_getu32(argv));
+ o->len = svc_getnl(argv);
l = round_up_to_quad(o->len);
if (argv->iov_len < l)
return -1;
@@ -525,7 +525,7 @@ svc_safe_putnetobj(struct kvec *resv, st
if (resv->iov_len + 4 > PAGE_SIZE)
return -1;
- svc_putu32(resv, htonl(o->len));
+ svc_putnl(resv, o->len);
p = resv->iov_base + resv->iov_len;
resv->iov_len += round_up_to_quad(o->len);
if (resv->iov_len > PAGE_SIZE)
@@ -541,7 +541,7 @@ svc_safe_putnetobj(struct kvec *resv, st
*/
static int
gss_verify_header(struct svc_rqst *rqstp, struct rsc *rsci,
- u32 *rpcstart, struct rpc_gss_wire_cred *gc, u32 *authp)
+ u32 *rpcstart, struct rpc_gss_wire_cred *gc, __be32 *authp)
{
struct gss_ctx *ctx_id = rsci->mechctx;
struct xdr_buf rpchdr;
@@ -558,7 +558,7 @@ gss_verify_header(struct svc_rqst *rqstp
*authp = rpc_autherr_badverf;
if (argv->iov_len < 4)
return SVC_DENIED;
- flavor = ntohl(svc_getu32(argv));
+ flavor = svc_getnl(argv);
if (flavor != RPC_AUTH_GSS)
return SVC_DENIED;
if (svc_safe_getnetobj(argv, &checksum))
@@ -589,14 +589,14 @@ gss_verify_header(struct svc_rqst *rqstp
static int
gss_write_verf(struct svc_rqst *rqstp, struct gss_ctx *ctx_id, u32 seq)
{
- u32 xdr_seq;
+ __be32 xdr_seq;
u32 maj_stat;
struct xdr_buf verf_data;
struct xdr_netobj mic;
- u32 *p;
+ __be32 *p;
struct kvec iov;
- svc_putu32(rqstp->rq_res.head, htonl(RPC_AUTH_GSS));
+ svc_putnl(rqstp->rq_res.head, RPC_AUTH_GSS);
xdr_seq = htonl(seq);
iov.iov_base = &xdr_seq;
@@ -670,7 +670,7 @@ EXPORT_SYMBOL(svcauth_gss_register_pseud
static inline int
read_u32_from_xdr_buf(struct xdr_buf *buf, int base, u32 *obj)
{
- u32 raw;
+ __be32 raw;
int status;
status = read_bytes_from_xdr_buf(buf, base, &raw, sizeof(*obj));
@@ -693,7 +693,7 @@ unwrap_integ_data(struct xdr_buf *buf, u
struct xdr_netobj mic;
struct xdr_buf integ_buf;
- integ_len = ntohl(svc_getu32(&buf->head[0]));
+ integ_len = svc_getnl(&buf->head[0]);
if (integ_len & 3)
goto out;
if (integ_len > buf->len)
@@ -713,7 +713,7 @@ unwrap_integ_data(struct xdr_buf *buf, u
maj_stat = gss_verify_mic(ctx, &integ_buf, &mic, NULL);
if (maj_stat != GSS_S_COMPLETE)
goto out;
- if (ntohl(svc_getu32(&buf->head[0])) != seq)
+ if (svc_getnl(&buf->head[0]) != seq)
goto out;
stat = 0;
out:
@@ -725,7 +725,7 @@ struct gss_svc_data {
struct rpc_gss_wire_cred clcred;
/* pointer to the beginning of the procedure-specific results,
* which may be encrypted/checksummed in svcauth_gss_release: */
- u32 *body_start;
+ __be32 *body_start;
struct rsc *rsci;
};
@@ -751,7 +751,7 @@ svcauth_gss_set_client(struct svc_rqst *
* response here and return SVC_COMPLETE.
*/
static int
-svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
+svcauth_gss_accept(struct svc_rqst *rqstp, __be32 *authp)
{
struct kvec *argv = &rqstp->rq_arg.head[0];
struct kvec *resv = &rqstp->rq_res.head[0];
@@ -762,7 +762,7 @@ svcauth_gss_accept(struct svc_rqst *rqst
struct rsc *rsci = NULL;
struct rsi *rsip, rsikey;
u32 *rpcstart;
- u32 *reject_stat = resv->iov_base + resv->iov_len;
+ __be32 *reject_stat = resv->iov_base + resv->iov_len;
int ret;
dprintk("RPC: svcauth_gss: argv->iov_len = %zd\n",argv->iov_len);
@@ -790,12 +790,12 @@ svcauth_gss_accept(struct svc_rqst *rqst
if (argv->iov_len < 5 * 4)
goto auth_err;
- crlen = ntohl(svc_getu32(argv));
- if (ntohl(svc_getu32(argv)) != RPC_GSS_VERSION)
+ crlen = svc_getnl(argv);
+ if (svc_getnl(argv) != RPC_GSS_VERSION)
goto auth_err;
- gc->gc_proc = ntohl(svc_getu32(argv));
- gc->gc_seq = ntohl(svc_getu32(argv));
- gc->gc_svc = ntohl(svc_getu32(argv));
+ gc->gc_proc = svc_getnl(argv);
+ gc->gc_seq = svc_getnl(argv);
+ gc->gc_svc = svc_getnl(argv);
if (svc_safe_getnetobj(argv, &gc->gc_ctx))
goto auth_err;
if (crlen != round_up_to_quad(gc->gc_ctx.len) + 5 * 4)
@@ -821,9 +821,9 @@ svcauth_gss_accept(struct svc_rqst *rqst
case RPC_GSS_PROC_CONTINUE_INIT:
if (argv->iov_len < 2 * 4)
goto auth_err;
- if (ntohl(svc_getu32(argv)) != RPC_AUTH_NULL)
+ if (svc_getnl(argv) != RPC_AUTH_NULL)
goto auth_err;
- if (ntohl(svc_getu32(argv)) != 0)
+ if (svc_getnl(argv) != 0)
goto auth_err;
break;
case RPC_GSS_PROC_DATA:
@@ -885,14 +885,14 @@ svcauth_gss_accept(struct svc_rqst *rqst
goto drop;
if (resv->iov_len + 4 > PAGE_SIZE)
goto drop;
- svc_putu32(resv, rpc_success);
+ svc_putnl(resv, RPC_SUCCESS);
if (svc_safe_putnetobj(resv, &rsip->out_handle))
goto drop;
if (resv->iov_len + 3 * 4 > PAGE_SIZE)
goto drop;
- svc_putu32(resv, htonl(rsip->major_status));
- svc_putu32(resv, htonl(rsip->minor_status));
- svc_putu32(resv, htonl(GSS_SEQ_WIN));
+ svc_putnl(resv, rsip->major_status);
+ svc_putnl(resv, rsip->minor_status);
+ svc_putnl(resv, GSS_SEQ_WIN);
if (svc_safe_putnetobj(resv, &rsip->out_token))
goto drop;
rqstp->rq_client = NULL;
@@ -902,7 +902,7 @@ svcauth_gss_accept(struct svc_rqst *rqst
set_bit(CACHE_NEGATIVE, &rsci->h.flags);
if (resv->iov_len + 4 > PAGE_SIZE)
goto drop;
- svc_putu32(resv, rpc_success);
+ svc_putnl(resv, RPC_SUCCESS);
goto complete;
case RPC_GSS_PROC_DATA:
*authp = rpcsec_gsserr_ctxproblem;
@@ -958,7 +958,7 @@ svcauth_gss_release(struct svc_rqst *rqs
struct xdr_buf integ_buf;
struct xdr_netobj mic;
struct kvec *resv;
- u32 *p;
+ __be32 *p;
int integ_offset, integ_len;
int stat = -EINVAL;
@@ -1014,7 +1014,7 @@ svcauth_gss_release(struct svc_rqst *rqs
mic.data = (u8 *)resv->iov_base + resv->iov_len + 4;
if (gss_get_mic(gsd->rsci->mechctx, 0, &integ_buf, &mic))
goto out_err;
- svc_putu32(resv, htonl(mic.len));
+ svc_putnl(resv, mic.len);
memset(mic.data + mic.len, 0,
round_up_to_quad(mic.len) - mic.len);
resv->iov_len += XDR_QUADLEN(mic.len) << 2;
diff -uprN linux-vanilla/net/sunrpc/auth_null.c linux-001/net/sunrpc/auth_null.c
--- linux-vanilla/net/sunrpc/auth_null.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/auth_null.c 2005-09-10 11:25:36.000000000 +0400
@@ -62,8 +62,8 @@ nul_match(struct auth_cred *acred, struc
/*
* Marshal credential.
*/
-static u32 *
-nul_marshal(struct rpc_task *task, u32 *p)
+static __be32 *
+nul_marshal(struct rpc_task *task, __be32 *p)
{
*p++ = htonl(RPC_AUTH_NULL);
*p++ = 0;
@@ -83,8 +83,8 @@ nul_refresh(struct rpc_task *task)
return 0;
}
-static u32 *
-nul_validate(struct rpc_task *task, u32 *p)
+static __be32 *
+nul_validate(struct rpc_task *task, __be32 *p)
{
rpc_authflavor_t flavor;
u32 size;
diff -uprN linux-vanilla/net/sunrpc/auth_unix.c linux-001/net/sunrpc/auth_unix.c
--- linux-vanilla/net/sunrpc/auth_unix.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/auth_unix.c 2005-09-10 11:28:54.000000000 +0400
@@ -139,12 +139,12 @@ unx_match(struct auth_cred *acred, struc
* Marshal credentials.
* Maybe we should keep a cached credential for performance reasons.
*/
-static u32 *
-unx_marshal(struct rpc_task *task, u32 *p)
+static __be32 *
+unx_marshal(struct rpc_task *task, __be32 *p)
{
struct rpc_clnt *clnt = task->tk_client;
struct unx_cred *cred = (struct unx_cred *) task->tk_msg.rpc_cred;
- u32 *base, *hold;
+ __be32 *base, *hold;
int i;
*p++ = htonl(RPC_AUTH_UNIX);
@@ -180,8 +180,8 @@ unx_refresh(struct rpc_task *task)
return 0;
}
-static u32 *
-unx_validate(struct rpc_task *task, u32 *p)
+static __be32 *
+unx_validate(struct rpc_task *task, __be32 *p)
{
rpc_authflavor_t flavor;
u32 size;
diff -uprN linux-vanilla/net/sunrpc/clnt.c linux-001/net/sunrpc/clnt.c
--- linux-vanilla/net/sunrpc/clnt.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/clnt.c 2005-09-10 11:24:17.000000000 +0400
@@ -60,8 +60,8 @@ static void call_refreshresult(struct rp
static void call_timeout(struct rpc_task *task);
static void call_connect(struct rpc_task *task);
static void call_connect_status(struct rpc_task *task);
-static u32 * call_header(struct rpc_task *task);
-static u32 * call_verify(struct rpc_task *task);
+static __be32 * call_header(struct rpc_task *task);
+static __be32 * call_verify(struct rpc_task *task);
static int
@@ -692,7 +692,7 @@ call_encode(struct rpc_task *task)
unsigned int bufsiz;
kxdrproc_t encode;
int status;
- u32 *p;
+ __be32 *p;
dprintk("RPC: %4d call_encode (status %d)\n",
task->tk_pid, task->tk_status);
@@ -925,7 +925,7 @@ call_decode(struct rpc_task *task)
struct rpc_clnt *clnt = task->tk_client;
struct rpc_rqst *req = task->tk_rqstp;
kxdrproc_t decode = task->tk_msg.rpc_proc->p_decode;
- u32 *p;
+ __be32 *p;
dprintk("RPC: %4d call_decode (status %d)\n",
task->tk_pid, task->tk_status);
@@ -1016,13 +1016,13 @@ call_refreshresult(struct rpc_task *task
/*
* Call header serialization
*/
-static u32 *
+static __be32 *
call_header(struct rpc_task *task)
{
struct rpc_clnt *clnt = task->tk_client;
struct rpc_xprt *xprt = clnt->cl_xprt;
struct rpc_rqst *req = task->tk_rqstp;
- u32 *p = req->rq_svec[0].iov_base;
+ __be32 *p = req->rq_svec[0].iov_base;
/* FIXME: check buffer size? */
if (xprt->stream)
@@ -1041,12 +1041,13 @@ call_header(struct rpc_task *task)
/*
* Reply header verification
*/
-static u32 *
+static __be32 *
call_verify(struct rpc_task *task)
{
struct kvec *iov = &task->tk_rqstp->rq_rcv_buf.head[0];
int len = task->tk_rqstp->rq_rcv_buf.len >> 2;
- u32 *p = iov->iov_base, n;
+ __be32 *p = iov->iov_base;
+ u32 n;
int error = -EACCES;
if ((len -= 3) < 0)
@@ -1112,7 +1113,7 @@ call_verify(struct rpc_task *task)
printk(KERN_WARNING "call_verify: auth check failed\n");
goto out_retry; /* bad verifier, retry */
}
- len = p - (u32 *)iov->iov_base - 1;
+ len = p - (__be32 *)iov->iov_base - 1;
if (len < 0)
goto out_overflow;
switch ((n = ntohl(*p++))) {
@@ -1166,12 +1167,12 @@ out_overflow:
goto out_retry;
}
-static int rpcproc_encode_null(void *rqstp, u32 *data, void *obj)
+static int rpcproc_encode_null(void *rqstp, __be32 *data, void *obj)
{
return 0;
}
-static int rpcproc_decode_null(void *rqstp, u32 *data, void *obj)
+static int rpcproc_decode_null(void *rqstp, __be32 *data, void *obj)
{
return 0;
}
diff -uprN linux-vanilla/net/sunrpc/pmap_clnt.c linux-001/net/sunrpc/pmap_clnt.c
--- linux-vanilla/net/sunrpc/pmap_clnt.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/pmap_clnt.c 2005-09-10 11:54:54.000000000 +0400
@@ -225,7 +225,7 @@ pmap_create(char *hostname, struct socka
* XDR encode/decode functions for PMAP
*/
static int
-xdr_encode_mapping(struct rpc_rqst *req, u32 *p, struct rpc_portmap *map)
+xdr_encode_mapping(struct rpc_rqst *req, __be32 *p, struct rpc_portmap *map)
{
dprintk("RPC: xdr_encode_mapping(%d, %d, %d, %d)\n",
map->pm_prog, map->pm_vers, map->pm_prot, map->pm_port);
@@ -239,14 +239,14 @@ xdr_encode_mapping(struct rpc_rqst *req,
}
static int
-xdr_decode_port(struct rpc_rqst *req, u32 *p, unsigned short *portp)
+xdr_decode_port(struct rpc_rqst *req, __be32 *p, unsigned short *portp)
{
*portp = (unsigned short) ntohl(*p++);
return 0;
}
static int
-xdr_decode_bool(struct rpc_rqst *req, u32 *p, unsigned int *boolp)
+xdr_decode_bool(struct rpc_rqst *req, __be32 *p, unsigned int *boolp)
{
*boolp = (unsigned int) ntohl(*p++);
return 0;
diff -uprN linux-vanilla/net/sunrpc/svc.c linux-001/net/sunrpc/svc.c
--- linux-vanilla/net/sunrpc/svc.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/svc.c 2005-09-10 12:10:54.000000000 +0400
@@ -262,11 +262,11 @@ svc_process(struct svc_serv *serv, struc
struct kvec * argv = &rqstp->rq_arg.head[0];
struct kvec * resv = &rqstp->rq_res.head[0];
kxdrproc_t xdr;
- u32 *statp;
- u32 dir, prog, vers, proc,
- auth_stat, rpc_stat;
+ __be32 *statp;
+ u32 dir, prog, vers, proc;
+ __be32 auth_stat, rpc_stat;
int auth_res;
- u32 *accept_statp;
+ __be32 *accept_statp;
rpc_stat = rpc_success;
@@ -292,11 +292,11 @@ svc_process(struct svc_serv *serv, struc
rqstp->rq_xid = svc_getu32(argv);
svc_putu32(resv, rqstp->rq_xid);
- dir = ntohl(svc_getu32(argv));
- vers = ntohl(svc_getu32(argv));
+ dir = svc_getnl(argv);
+ vers = svc_getnl(argv);
/* First words of reply: */
- svc_putu32(resv, xdr_one); /* REPLY */
+ svc_putnl(resv, 1); /* REPLY */
if (dir != 0) /* direction != CALL */
goto err_bad_dir;
@@ -306,11 +306,11 @@ svc_process(struct svc_serv *serv, struc
/* Save position in case we later decide to reject: */
accept_statp = resv->iov_base + resv->iov_len;
- svc_putu32(resv, xdr_zero); /* ACCEPT */
+ svc_putnl(resv, 0); /* ACCEPT */
- rqstp->rq_prog = prog = ntohl(svc_getu32(argv)); /* program number */
- rqstp->rq_vers = vers = ntohl(svc_getu32(argv)); /* version number */
- rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */
+ rqstp->rq_prog = prog = svc_getnl(argv); /* program number */
+ rqstp->rq_vers = vers = svc_getnl(argv); /* version number */
+ rqstp->rq_proc = proc = svc_getnl(argv); /* procedure number */
progp = serv->sv_program;
/*
@@ -362,7 +362,7 @@ svc_process(struct svc_serv *serv, struc
/* Build the reply header. */
statp = resv->iov_base +resv->iov_len;
- svc_putu32(resv, rpc_success); /* RPC_SUCCESS */
+ svc_putnl(resv, RPC_SUCCESS);
/* Bump per-procedure stats counter */
procp->pc_count++;
@@ -440,10 +440,10 @@ err_bad_dir:
err_bad_rpc:
serv->sv_stats->rpcbadfmt++;
- svc_putu32(resv, xdr_one); /* REJECT */
- svc_putu32(resv, xdr_zero); /* RPC_MISMATCH */
- svc_putu32(resv, xdr_two); /* Only RPCv2 supported */
- svc_putu32(resv, xdr_two);
+ svc_putnl(resv, 1); /* REJECT */
+ svc_putnl(resv, 0); /* RPC_MISMATCH */
+ svc_putnl(resv, 2); /* Only RPCv2 supported */
+ svc_putnl(resv, 2);
goto sendit;
err_bad_auth:
@@ -451,15 +451,15 @@ err_bad_auth:
serv->sv_stats->rpcbadauth++;
/* Restore write pointer to location of accept status: */
xdr_ressize_check(rqstp, accept_statp);
- svc_putu32(resv, xdr_one); /* REJECT */
- svc_putu32(resv, xdr_one); /* AUTH_ERROR */
- svc_putu32(resv, auth_stat); /* status */
+ svc_putnl(resv, 1); /* REJECT */
+ svc_putnl(resv, 1); /* AUTH_ERROR */
+ svc_putnl(resv, ntohl(auth_stat)); /* status */
goto sendit;
err_bad_prog:
dprintk("svc: unknown program %d\n", prog);
serv->sv_stats->rpcbadfmt++;
- svc_putu32(resv, rpc_prog_unavail);
+ svc_putnl(resv, RPC_PROG_UNAVAIL);
goto sendit;
err_bad_vers:
@@ -467,9 +467,9 @@ err_bad_vers:
printk("svc: unknown version (%d)\n", vers);
#endif
serv->sv_stats->rpcbadfmt++;
- svc_putu32(resv, rpc_prog_mismatch);
- svc_putu32(resv, htonl(progp->pg_lovers));
- svc_putu32(resv, htonl(progp->pg_hivers));
+ svc_putnl(resv, RPC_PROG_MISMATCH);
+ svc_putnl(resv, progp->pg_lovers);
+ svc_putnl(resv, progp->pg_hivers);
goto sendit;
err_bad_proc:
@@ -477,7 +477,7 @@ err_bad_proc:
printk("svc: unknown procedure (%d)\n", proc);
#endif
serv->sv_stats->rpcbadfmt++;
- svc_putu32(resv, rpc_proc_unavail);
+ svc_putnl(resv, RPC_PROC_UNAVAIL);
goto sendit;
err_garbage:
@@ -487,6 +487,6 @@ err_garbage:
rpc_stat = rpc_garbage_args;
err_bad:
serv->sv_stats->rpcbadfmt++;
- svc_putu32(resv, rpc_stat);
+ svc_putnl(resv, ntohl(rpc_stat));
goto sendit;
}
diff -uprN linux-vanilla/net/sunrpc/svcauth.c linux-001/net/sunrpc/svcauth.c
--- linux-vanilla/net/sunrpc/svcauth.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/svcauth.c 2005-09-10 11:49:49.000000000 +0400
@@ -35,14 +35,14 @@ static struct auth_ops *authtab[RPC_AUTH
};
int
-svc_authenticate(struct svc_rqst *rqstp, u32 *authp)
+svc_authenticate(struct svc_rqst *rqstp, __be32 *authp)
{
rpc_authflavor_t flavor;
struct auth_ops *aops;
*authp = rpc_auth_ok;
- flavor = ntohl(svc_getu32(&rqstp->rq_arg.head[0]));
+ flavor = svc_getnl(&rqstp->rq_arg.head[0]);
dprintk("svc: svc_authenticate (%d)\n", flavor);
diff -uprN linux-vanilla/net/sunrpc/svcauth_unix.c linux-001/net/sunrpc/svcauth_unix.c
--- linux-vanilla/net/sunrpc/svcauth_unix.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/svcauth_unix.c 2005-09-10 11:53:34.000000000 +0400
@@ -129,7 +129,7 @@ static void ip_map_request(struct cache_
{
char text_addr[20];
struct ip_map *im = container_of(h, struct ip_map, h);
- __u32 addr = im->m_addr.s_addr;
+ __be32 addr = im->m_addr.s_addr;
snprintf(text_addr, 20, "%u.%u.%u.%u",
ntohl(addr) >> 24 & 0xff,
@@ -357,7 +357,7 @@ svcauth_unix_set_client(struct svc_rqst
}
static int
-svcauth_null_accept(struct svc_rqst *rqstp, u32 *authp)
+svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp)
{
struct kvec *argv = &rqstp->rq_arg.head[0];
struct kvec *resv = &rqstp->rq_res.head[0];
@@ -419,7 +419,7 @@ struct auth_ops svcauth_null = {
static int
-svcauth_unix_accept(struct svc_rqst *rqstp, u32 *authp)
+svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp)
{
struct kvec *argv = &rqstp->rq_arg.head[0];
struct kvec *resv = &rqstp->rq_res.head[0];
@@ -435,22 +435,22 @@ svcauth_unix_accept(struct svc_rqst *rqs
svc_getu32(argv); /* length */
svc_getu32(argv); /* time stamp */
- slen = XDR_QUADLEN(ntohl(svc_getu32(argv))); /* machname length */
+ slen = XDR_QUADLEN(svc_getnl(argv)); /* machname length */
if (slen > 64 || (len -= (slen + 3)*4) < 0)
goto badcred;
argv->iov_base = (void*)((u32*)argv->iov_base + slen); /* skip machname */
argv->iov_len -= slen*4;
- cred->cr_uid = ntohl(svc_getu32(argv)); /* uid */
- cred->cr_gid = ntohl(svc_getu32(argv)); /* gid */
- slen = ntohl(svc_getu32(argv)); /* gids length */
+ cred->cr_uid = svc_getnl(argv); /* uid */
+ cred->cr_gid = svc_getnl(argv); /* gid */
+ slen = svc_getnl(argv); /* gids length */
if (slen > 16 || (len -= (slen + 2)*4) < 0)
goto badcred;
cred->cr_group_info = groups_alloc(slen);
if (cred->cr_group_info == NULL)
return SVC_DROP;
for (i = 0; i < slen; i++)
- GROUP_AT(cred->cr_group_info, i) = ntohl(svc_getu32(argv));
+ GROUP_AT(cred->cr_group_info, i) = svc_getnl(argv);
if (svc_getu32(argv) != RPC_AUTH_NULL || svc_getu32(argv) != 0) {
*authp = rpc_autherr_badverf;
diff -uprN linux-vanilla/net/sunrpc/svcsock.c linux-001/net/sunrpc/svcsock.c
--- linux-vanilla/net/sunrpc/svcsock.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/svcsock.c 2005-09-10 11:49:10.000000000 +0400
@@ -1051,7 +1051,7 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
{
struct xdr_buf *xbufp = &rqstp->rq_res;
int sent;
- u32 reclen;
+ __be32 reclen;
/* Set up the first element of the reply kvec.
* Any other kvecs that may be in use have been taken
diff -uprN linux-vanilla/net/sunrpc/xdr.c linux-001/net/sunrpc/xdr.c
--- linux-vanilla/net/sunrpc/xdr.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/xdr.c 2005-09-10 12:02:47.000000000 +0400
@@ -21,8 +21,8 @@
/*
* XDR functions for basic NFS types
*/
-u32 *
-xdr_encode_netobj(u32 *p, const struct xdr_netobj *obj)
+__be32 *
+xdr_encode_netobj(__be32 *p, const struct xdr_netobj *obj)
{
unsigned int quadlen = XDR_QUADLEN(obj->len);
@@ -32,8 +32,8 @@ xdr_encode_netobj(u32 *p, const struct x
return p + XDR_QUADLEN(obj->len);
}
-u32 *
-xdr_decode_netobj(u32 *p, struct xdr_netobj *obj)
+__be32 *
+xdr_decode_netobj(__be32 *p, struct xdr_netobj *obj)
{
unsigned int len;
@@ -58,7 +58,7 @@ xdr_decode_netobj(u32 *p, struct xdr_net
* Returns the updated current XDR buffer position
*
*/
-u32 *xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int nbytes)
+__be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int nbytes)
{
if (likely(nbytes != 0)) {
unsigned int quadlen = XDR_QUADLEN(nbytes);
@@ -82,21 +82,21 @@ EXPORT_SYMBOL(xdr_encode_opaque_fixed);
*
* Returns the updated current XDR buffer position
*/
-u32 *xdr_encode_opaque(u32 *p, const void *ptr, unsigned int nbytes)
+__be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int nbytes)
{
*p++ = htonl(nbytes);
return xdr_encode_opaque_fixed(p, ptr, nbytes);
}
EXPORT_SYMBOL(xdr_encode_opaque);
-u32 *
-xdr_encode_string(u32 *p, const char *string)
+__be32 *
+xdr_encode_string(__be32 *p, const char *string)
{
return xdr_encode_array(p, string, strlen(string));
}
-u32 *
-xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen)
+__be32 *
+xdr_decode_string(__be32 *p, char **sp, int *lenp, int maxlen)
{
unsigned int len;
char *string;
@@ -116,8 +116,8 @@ xdr_decode_string(u32 *p, char **sp, int
return p + XDR_QUADLEN(len);
}
-u32 *
-xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen)
+__be32 *
+xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen)
{
unsigned int len;
@@ -916,7 +916,7 @@ out:
int
xdr_decode_word(struct xdr_buf *buf, int base, u32 *obj)
{
- u32 raw;
+ __be32 raw;
int status;
status = read_bytes_from_xdr_buf(buf, base, &raw, sizeof(*obj));
@@ -929,7 +929,7 @@ xdr_decode_word(struct xdr_buf *buf, int
int
xdr_encode_word(struct xdr_buf *buf, int base, u32 obj)
{
- u32 raw = htonl(obj);
+ __be32 raw = htonl(obj);
return write_bytes_to_xdr_buf(buf, base, &raw, sizeof(obj));
}
diff -uprN linux-vanilla/net/sunrpc/xprt.c linux-001/net/sunrpc/xprt.c
--- linux-vanilla/net/sunrpc/xprt.c 2005-09-10 10:52:34.000000000 +0400
+++ linux-001/net/sunrpc/xprt.c 2005-09-10 11:21:17.000000000 +0400
@@ -616,7 +616,7 @@ xprt_connect_status(struct rpc_task *tas
* Look up the RPC request corresponding to a reply, and then lock it.
*/
static inline struct rpc_rqst *
-xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid)
+xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid)
{
struct list_head *pos;
struct rpc_rqst *req = NULL;
@@ -758,7 +758,8 @@ udp_data_ready(struct sock *sk, int len)
struct rpc_rqst *rovr;
struct sk_buff *skb;
int err, repsize, copied;
- u32 _xid, *xp;
+ u32 _xid;
+ __be32 *xp;
read_lock(&sk->sk_callback_lock);
dprintk("RPC: udp_data_ready...\n");
@@ -1224,7 +1225,7 @@ xprt_transmit(struct rpc_task *task)
/* set up everything as needed. */
/* Write the record marker */
if (xprt->stream) {
- u32 *marker = req->rq_svec[0].iov_base;
+ __be32 *marker = req->rq_svec[0].iov_base;
*marker = htonl(0x80000000|(req->rq_slen-sizeof(*marker)));
}
@@ -1378,7 +1379,7 @@ xprt_reserve(struct rpc_task *task)
/*
* Allocate a 'unique' XID
*/
-static inline u32 xprt_alloc_xid(struct rpc_xprt *xprt)
+static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt)
{
return xprt->xid++;
}
^ permalink raw reply
* 2nd Try - [PATCH Linus Git] README.ipw2200 does not contain firmware information.
From: Alejandro Bonilla Beeche @ 2005-09-10 8:35 UTC (permalink / raw)
To: Jeff Garzik, Andrew Morton, Linus Torvalds; +Cc: netdev, linux-kernel, jketreno
In-Reply-To: <1126057717.5165.9.camel@localhost.localdomain>
Hi,
I was wondering why this change hasn't made it into the Linus Git so
far.
Thanks.
On Tue, 2005-09-06 at 19:48 -0600, Alejandro Bonilla Beeche wrote:
> Hi,
>
> The kconfig from net/wireless says to look at the README.ipw2200 for
> further installation of the firmware file. We have that information unde
> INSTALL not under README.ipw2200, still I just added a part that talks
> about installing the firmware file. This because README.ipw2200 is
> already in the Documentation/networking/.
>
> I'm still spamming everyone cause I have not been told where to send
> this directly. :-)
>
> Signed-off-by: Alejandro Bonilla <abonilla@linuxwireless.org>
>
> Pasted and attached.
>
> debian:~/linux-2.6# diff -usr Documentation/networking/README.ipw2200~
> Documentation/networking/README.ipw2200
>
> --- Documentation/networking/README.ipw2200~ 2005-09-06
> 19:33:24.000000000 -0600
> +++ Documentation/networking/README.ipw2200 2005-09-06
> 19:33:24.000000000 -0600
> @@ -27,7 +27,8 @@
> 1.4. Sysfs Helper Files
> 2. About the Version Numbers
> 3. Support
> -4. License
> +4. Firmware installation
> +5. License
>
>
> 1. Introduction
> @@ -272,7 +273,18 @@
> http://ipw2200.sf.net/
>
>
> -4. License
> +4. Firmware installation
> +----------------------------------------------
> +
> +The driver requires a firmware image, download it and extract the files
> +under /lib/firmware
> +
> +The firmware can be downloaded from the following URL:
> +
> + http://ipw2200.sf.net/
> +
> +
> +5. License
> -----------------------------------------------
>
> Copyright(c) 2003 - 2005 Intel Corporation. All rights reserved.
>
^ permalink raw reply
* clarification required on UDP sendfile()
From: Ananda Raju @ 2005-09-10 1:37 UTC (permalink / raw)
To: netdev; +Cc: 'Leonid Grossman', ravinandan.arakali
Hi,
We are implementing UDP Large send offload (USO) feature for our Xframe-II
10g Ethernet adapter. We are facing problem in using sendfile().
we have written a client server program which uses sendfile() over udp. We
are facing a problem in which the last sendfile() operation fails to reach
server. This behavior is irrespective of USO feature.
Client.c has following code. Size of file iperf-2.0.1.tar.gz used for
transfer is 222957
--------------------------------------------------
Main()
{
portno=16000;
fd1 = open("iperf-2.0.1.tar.gz",O_RDWR);
fd = socket(AF_INET,SOCK_DGRAM,0);
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(portno);
serv_addr.sin_addr.s_addr = inet_addr("172.10.1.227");
ret = connect(fd,&serv_addr,sizeof(serv_addr));
len = sizeof(client_addr);
off=0;
while (1) {
size = 40*1024;
ret = sendfile(fd,fd1,NULL,size);
printf("size %d \n",ret);
sleep(1);
if (ret<=0)
exit(0);
}
close(fd);
close(fd1);
}
--------------------------------------------
Server.c has following code
--------------------------------------------
int portno=16000;
char buf[65000];
main()
{
fd = socket(AF_INET,SOCK_DGRAM,0);
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
serv_addr.sin_port = htons(portno);
ret = bind(fd,(struct sockaddr*)&serv_addr,sizeof(serv_addr));
len = sizeof(client_addr);
while (1){
ret = recvfrom(fd,&buf,sizeof(buf),0,(struct
sockaddr*)&client_addr,&len);
printf("size %d \n",ret);
}
}
-------------------------------------------
# ls -l |grep iperf-2.0.1.tar.gz
-rw-r--r-- 1 root root 222957 Sep 8 08:31 iperf-2.0.1.tar.gz
#
#./client
size 40960
size 40960
size 40960
size 40960
size 40960
size 18157 <<< Didn't reach server
size 0
#
#./server
size 40960
size 40960
size 40960
size 40960
size 40960
The last transmit of 18157 bytes didn't reach the server, any reason why
this happens. Also some time the middle frames also won't reach the server.
We did tcpdump and observed that the packets are not put on the wire. The
packets are getting lost in the host network stack. Is this behavior is
expected or We are doing wrong somewhere?
Regards,
Ananda
^ permalink raw reply
* [PATCH 3/3] orinoco: Remove conditionals that are useless in the kernel
From: Pavel Roskin @ 2005-09-09 22:46 UTC (permalink / raw)
To: Orinoco Development List, netdev-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>
diff-tree 2f9196a9a825b97b2b9b3471da22682cf2720def (from ec36f4b4e7671a87861d06b5a86143c9e9152eaa)
Author: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>
Date: Fri Sep 9 18:29:50 2005 -0400
Remove conditionals that are useless in the kernel.
We are not compiling the drivers against pcmcia-cs package.
We are not embedding any firmware.
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -14,9 +14,6 @@
#define PFX DRIVER_NAME ": "
#include <linux/config.h>
-#ifdef __IN_PCMCIA_PACKAGE__
-#include <pcmcia/k_compat.h>
-#endif /* __IN_PCMCIA_PACKAGE__ */
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -22,9 +22,6 @@
#define PFX DRIVER_NAME ": "
#include <linux/config.h>
-#ifdef __IN_PCMCIA_PACKAGE__
-#include <pcmcia/k_compat.h>
-#endif /* __IN_PCMCIA_PACKAGE__ */
#include <linux/module.h>
#include <linux/kernel.h>
@@ -38,6 +35,7 @@
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
#include <linux/wireless.h>
+#include <linux/firmware.h>
#include <pcmcia/cs_types.h>
#include <pcmcia/cs.h>
@@ -51,29 +49,10 @@
#include "orinoco.h"
-/*
- * If SPECTRUM_FW_INCLUDED is defined, the firmware is hardcoded into
- * the driver. Use get_symbol_fw script to generate spectrum_fw.h and
- * copy it to the same directory as spectrum_cs.c.
- *
- * If SPECTRUM_FW_INCLUDED is not defined, the firmware is loaded at the
- * runtime using hotplug. Use the same get_symbol_fw script to generate
- * files symbol_sp24t_prim_fw symbol_sp24t_sec_fw, copy them to the
- * hotplug firmware directory (typically /usr/lib/hotplug/firmware) and
- * make sure that you have hotplug installed and enabled in the kernel.
- */
-/* #define SPECTRUM_FW_INCLUDED 1 */
-
-#ifdef SPECTRUM_FW_INCLUDED
-/* Header with the firmware */
-#include "spectrum_fw.h"
-#else /* !SPECTRUM_FW_INCLUDED */
-#include <linux/firmware.h>
static unsigned char *primsym;
static unsigned char *secsym;
static const char primary_fw_name[] = "symbol_sp24t_prim_fw";
static const char secondary_fw_name[] = "symbol_sp24t_sec_fw";
-#endif /* !SPECTRUM_FW_INCLUDED */
/********************************************************************/
/* Module stuff */
@@ -571,8 +550,6 @@ spectrum_dl_firmware(hermes_t *hw, dev_l
{
int ret;
client_handle_t handle = link->handle;
-
-#ifndef SPECTRUM_FW_INCLUDED
const struct firmware *fw_entry;
if (request_firmware(&fw_entry, primary_fw_name,
@@ -592,7 +569,6 @@ spectrum_dl_firmware(hermes_t *hw, dev_l
secondary_fw_name);
return -ENOENT;
}
-#endif
/* Load primary firmware */
ret = spectrum_dl_image(hw, link, primsym);
--
Regards,
Pavel Roskin
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply
* [PATCH 2/3] orinoco: Update PCMCIA ID's
From: Pavel Roskin @ 2005-09-09 22:45 UTC (permalink / raw)
To: Orinoco Development List, netdev-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>
diff-tree ec36f4b4e7671a87861d06b5a86143c9e9152eaa (from 9cd99739afa14e22f75a4940f53116aa8f8247d8)
Author: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>
Date: Fri Sep 9 18:24:50 2005 -0400
Update PCMCIA ID's.
Intel Pro/Wireless 2011 and 2011B have the same numeric ID, so use strings.
Incorporate all entries from *.conf for Orinoco, HostAP and linux-wlan-ng
with minimal changes (e.g. we don't need all 4 strings if the second string
identifies the chipset).
Add comments to all numeric entries.
diff --git a/drivers/net/wireless/orinoco_cs.c b/drivers/net/wireless/orinoco_cs.c
--- a/drivers/net/wireless/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco_cs.c
@@ -601,52 +601,88 @@ orinoco_cs_event(event_t event, int prio
static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
" (David Gibson <hermes-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>, "
"Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>, et al)";
static struct pcmcia_device_id orinoco_cs_ids[] = {
- PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300),
- PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0x01eb, 0x080a),
- PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001),
- PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305),
- PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613),
- PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0673),
- PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0x14ea, 0xb001),
- PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300),
- PCMCIA_DEVICE_MANF_CARD(0x9005, 0x0021),
- PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002),
- PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005),
+ PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100), /* SonicWALL Long Range Wireless Card */
+ PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300), /* Sohoware NCP110, Philips 802.11b */
+ PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0002), /* AnyPoint(TM) Wireless II PC Card */
+ PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), /* 3Com AirConnect PCI 777A */
+ PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000), /* PROXIM RangeLAN-DS/LAN PC CARD */
+ PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), /* Compaq WL100 11 Mbps Wireless Adapter */
+ PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), /* Lucent Orinoco and old Intersil */
+ PCMCIA_DEVICE_MANF_CARD(0x016b, 0x0001), /* Ericsson WLAN Card C11 */
+ PCMCIA_DEVICE_MANF_CARD(0x01eb, 0x080a), /* Nortel Networks eMobility 802.11 Wireless Adapter */
+ PCMCIA_DEVICE_MANF_CARD(0x01ff, 0x0008), /* Intermec MobileLAN 11Mbps 802.11b WLAN Card */
+ PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */
+ PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */
+ PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */
+ PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */
+ PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */
+ PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */
+ PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002), /* Compaq HNW-100 11 Mbps Wireless Adapter */
+ PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0673), /* Linksys WCF12 Wireless CompactFlash Card */
+ PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002), /* ASUS SpaceLink WL-100 */
+ PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x0002), /* SpeedStream SS1021 Wireless Adapter */
+ PCMCIA_DEVICE_MANF_CARD(0x14ea, 0xb001), /* PLANEX RoadLannerWave GW-NS11H */
+ PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300), /* Airvast WN-100 */
+ PCMCIA_DEVICE_MANF_CARD(0x9005, 0x0021), /* Adaptec Ultra Wireless ANW-8030 */
+ PCMCIA_DEVICE_MANF_CARD(0xc001, 0x0008), /* CONTEC FLEXSCAN/FX-DDS110-PCC */
+ PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002), /* Conceptronic CON11Cpro, EMTAC A2424i */
+ PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), /* Safeway 802.11b, ZCOMAX AirRunner/XI-300 */
+ PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), /* D-Link DCF660, Sandisk Connect SDWCFB-000 */
+ PCMCIA_DEVICE_PROD_ID12(" ", "IEEE 802.11 Wireless LAN/PC Card", 0x3b6e20c8, 0xefccafe9),
PCMCIA_DEVICE_PROD_ID12("3Com", "3CRWE737A AirConnect Wireless LAN PC Card", 0x41240e5b, 0x56010af3),
- PCMCIA_DEVICE_PROD_ID123("Instant Wireless ", " Network PC CARD", "Version 01.02", 0x11d901af, 0x6e9bd926, 0x4b74baa0),
PCMCIA_DEVICE_PROD_ID12("ACTIONTEC", "PRISM Wireless LAN PC Card", 0x393089da, 0xa71e69d5),
+ PCMCIA_DEVICE_PROD_ID12("Addtron", "AWP-100 Wireless PCMCIA", 0xe6ec52ce, 0x08649af2),
+ PCMCIA_DEVICE_PROD_ID123("AIRVAST", "IEEE 802.11b Wireless PCMCIA Card", "HFA3863", 0xea569531, 0x4bcb9645, 0x355cb092),
+ PCMCIA_DEVICE_PROD_ID12("Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", 0x5cd01705, 0x4271660f),
+ PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11b_PC_CARD_25", 0x78fc06ee, 0xdb9aa842),
+ PCMCIA_DEVICE_PROD_ID12("ASUS", "802_11B_CF_CARD_25", 0x78fc06ee, 0x45a50c1e),
PCMCIA_DEVICE_PROD_ID12("Avaya Communication", "Avaya Wireless PC Card", 0xd8a43b78, 0x0d341169),
+ PCMCIA_DEVICE_PROD_ID12("BENQ", "AWL100 PCMCIA ADAPTER", 0x35dadc74, 0x01f7fedb),
PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-PCM-L11G", 0x2decece3, 0xf57ca4b3),
+ PCMCIA_DEVICE_PROD_ID12("BUFFALO", "WLI-CF-S11G", 0x2decece3, 0x82067c18),
PCMCIA_DEVICE_PROD_ID12("Cabletron", "RoamAbout 802.11 DS", 0x32d445f5, 0xedeffd90),
+ PCMCIA_DEVICE_PROD_ID12("Compaq", "WL200_11Mbps_Wireless_PCI_Card", 0x54f7c49c, 0x15a75e5b),
+ PCMCIA_DEVICE_PROD_ID123("corega", "WL PCCL-11", "ISL37300P", 0x0a21501a, 0x59868926, 0xc9049a39),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCC-11", 0x5261440f, 0xa6405584),
PCMCIA_DEVICE_PROD_ID12("corega K.K.", "Wireless LAN PCCA-11", 0x5261440f, 0xdf6115f9),
PCMCIA_DEVICE_PROD_ID12("D", "Link DRC-650 11Mbps WLAN Card", 0x71b18589, 0xf144e3ac),
PCMCIA_DEVICE_PROD_ID12("D", "Link DWL-650 11Mbps WLAN Card", 0x71b18589, 0xb6f1b0ab),
+ PCMCIA_DEVICE_PROD_ID12("D-Link Corporation", "D-Link DWL-650H 11Mbps WLAN Adapter", 0xef544d24, 0xcd8ea916),
+ PCMCIA_DEVICE_PROD_ID12("Digital Data Communications", "WPC-0100", 0xfdd73470, 0xe0b6f146),
PCMCIA_DEVICE_PROD_ID12("ELSA", "AirLancer MC-11", 0x4507a33a, 0xef54f0e3),
PCMCIA_DEVICE_PROD_ID12("HyperLink", "Wireless PC Card 11Mbps", 0x56cc3f1a, 0x0bcf220c),
+ PCMCIA_DEVICE_PROD_ID123("Instant Wireless ", " Network PC CARD", "Version 01.02", 0x11d901af, 0x6e9bd926, 0x4b74baa0),
+ PCMCIA_DEVICE_PROD_ID12("Intel", "PRO/Wireless 2011 LAN PC Card", 0x816cc815, 0x07f58077),
PCMCIA_DEVICE_PROD_ID12("INTERSIL", "HFA384x/IEEE", 0x74c5e40d, 0xdb472a18),
+ PCMCIA_DEVICE_PROD_ID12("INTERSIL", "I-GATE 11M PC Card / PC Card plus", 0x74c5e40d, 0x8304ff77),
+ PCMCIA_DEVICE_PROD_ID12("Intersil", "PRISM 2_5 PCMCIA ADAPTER", 0x4b801a17, 0x6345a0bf),
+ PCMCIA_DEVICE_PROD_ID123("Intersil", "PRISM Freedom PCMCIA Adapter", "ISL37100P", 0x4b801a17, 0xf222ec2d, 0x630d52b2),
+ PCMCIA_DEVICE_PROD_ID12("LeArtery", "SYNCBYAIR 11Mbps Wireless LAN PC Card", 0x7e3b326a, 0x49893e92),
+ PCMCIA_DEVICE_PROD_ID12("Linksys", "Wireless CompactFlash Card", 0x0733cc81, 0x0c52f395),
PCMCIA_DEVICE_PROD_ID12("Lucent Technologies", "WaveLAN/IEEE", 0x23eb9949, 0xc562e72a),
PCMCIA_DEVICE_PROD_ID12("MELCO", "WLI-PCM-L11", 0x481e0094, 0x7360e410),
PCMCIA_DEVICE_PROD_ID12("MELCO", "WLI-PCM-L11G", 0x481e0094, 0xf57ca4b3),
PCMCIA_DEVICE_PROD_ID12("Microsoft", "Wireless Notebook Adapter MN-520", 0x5961bf85, 0x6eec8c01),
PCMCIA_DEVICE_PROD_ID12("NCR", "WaveLAN/IEEE", 0x24358cd4, 0xc562e72a),
+ PCMCIA_DEVICE_PROD_ID12("NETGEAR MA401 Wireless PC", "Card", 0xa37434e9, 0x9762e8f1),
PCMCIA_DEVICE_PROD_ID12("NETGEAR MA401RA Wireless PC", "Card", 0x0306467f, 0x9762e8f1),
+ PCMCIA_DEVICE_PROD_ID12("Nortel Networks", "emobility 802.11 Wireless LAN PC Card", 0x2d617ea0, 0x88cd5767),
+ PCMCIA_DEVICE_PROD_ID12("OEM", "PRISM2 IEEE 802.11 PC-Card", 0xfea54c90, 0x48f2bdd6),
+ PCMCIA_DEVICE_PROD_ID12("OTC", "Wireless AirEZY 2411-PCC WLAN Card", 0x4ac44287, 0x235a6bed),
+ PCMCIA_DEVICE_PROD_ID123("PCMCIA", "11M WLAN Card v2.5", "ISL37300P", 0x281f1c5d, 0x6e440487, 0xc9049a39),
PCMCIA_DEVICE_PROD_ID12("PLANEX", "GeoWave/GW-CF110", 0x209f40ab, 0xd9715264),
+ PCMCIA_DEVICE_PROD_ID12("PLANEX", "GeoWave/GW-NS110", 0x209f40ab, 0x46263178),
PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PC CARD HARMONY 80211B", 0xc6536a5e, 0x090c3cd9),
PCMCIA_DEVICE_PROD_ID12("PROXIM", "LAN PCI CARD HARMONY 80211B", 0xc6536a5e, 0x9f494e26),
PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "11Mbps WLAN Card", 0x43d74cb4, 0x579bd91b),
- PCMCIA_DEVICE_PROD_ID1("Symbol Technologies", 0x3f02b4d6),
+ PCMCIA_DEVICE_PROD_ID12("SMC", "SMC2632W", 0xc4f8b18b, 0x474a1f2a),
+ PCMCIA_DEVICE_PROD_ID12("Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", 0x3f02b4d6, 0x3663cb0e),
+ PCMCIA_DEVICE_PROD_ID123("The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", 0xa5f472c2, 0x590eb502, 0xc9049a39),
+ PCMCIA_DEVICE_PROD_ID12("ZoomAir 11Mbps High", "Rate wireless Networking", 0x273fe3db, 0x32a1eaee),
PCMCIA_DEVICE_NULL,
};
MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_ids);
static struct pcmcia_driver orinoco_driver = {
diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -1083,11 +1083,11 @@ static char version[] __initdata = DRIVE
" David Gibson <hermes-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>, et al)";
static struct pcmcia_device_id spectrum_cs_ids[] = {
PCMCIA_DEVICE_MANF_CARD(0x026c, 0x0001), /* Symbol Spectrum24 LA4100 */
PCMCIA_DEVICE_MANF_CARD(0x0104, 0x0001), /* Socket Communications CF */
- PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0001), /* Intel PRO/Wireless 2011B */
+ PCMCIA_DEVICE_PROD_ID12("Intel", "PRO/Wireless LAN PC Card", 0x816cc815, 0x6fbf459a), /* 2011B, not 2011 */
PCMCIA_DEVICE_NULL,
};
MODULE_DEVICE_TABLE(pcmcia, spectrum_cs_ids);
static struct pcmcia_driver orinoco_driver = {
--
Regards,
Pavel Roskin
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply
* [PATCH 1/3] orinoco: WE-18 support
From: Pavel Roskin @ 2005-09-09 22:43 UTC (permalink / raw)
To: Orinoco Development List, netdev-u79uwXL29TY76Z2rM5mHXA; +Cc: Jean Tourrilhes
Author: Jean Tourrilhes <jt-sDzT885Ts8HQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>
Use new Wireless Extension API for wireless stats.
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -137,7 +137,7 @@ MODULE_PARM_DESC(force_monitor, "Allow m
/* We do this this way to avoid ifdefs in the actual code */
#ifdef WIRELESS_SPY
-#define SPY_NUMBER(priv) (priv->spy_number)
+#define SPY_NUMBER(priv) (priv->spy_data.spy_number)
#else
#define SPY_NUMBER(priv) 0
#endif /* WIRELESS_SPY */
@@ -396,10 +396,10 @@ static struct iw_statistics *orinoco_get
/* If a spy address is defined, we report stats of the
* first spy address - Jean II */
if (SPY_NUMBER(priv)) {
- wstats->qual.qual = priv->spy_stat[0].qual;
- wstats->qual.level = priv->spy_stat[0].level;
- wstats->qual.noise = priv->spy_stat[0].noise;
- wstats->qual.updated = priv->spy_stat[0].updated;
+ wstats->qual.qual = priv->spy_data.spy_stat[0].qual;
+ wstats->qual.level = priv->spy_data.spy_stat[0].level;
+ wstats->qual.noise = priv->spy_data.spy_stat[0].noise;
+ wstats->qual.updated = priv->spy_data.spy_stat[0].updated;
}
} else {
struct {
@@ -718,18 +718,13 @@ static inline int is_ethersnap(void *_hd
static inline void orinoco_spy_gather(struct net_device *dev, u_char *mac,
int level, int noise)
{
- struct orinoco_private *priv = netdev_priv(dev);
- int i;
-
- /* Gather wireless spy statistics: for each packet, compare the
- * source address with out list, and if match, get the stats... */
- for (i = 0; i < priv->spy_number; i++)
- if (!memcmp(mac, priv->spy_address[i], ETH_ALEN)) {
- priv->spy_stat[i].level = level - 0x95;
- priv->spy_stat[i].noise = noise - 0x95;
- priv->spy_stat[i].qual = (level > noise) ? (level - noise) : 0;
- priv->spy_stat[i].updated = 7;
- }
+ struct iw_quality wstats;
+ wstats.level = level - 0x95;
+ wstats.noise = noise - 0x95;
+ wstats.qual = (level > noise) ? (level - noise) : 0;
+ wstats.updated = 7;
+ /* Update spy records */
+ wireless_spy_update(dev, mac, &wstats);
}
static void orinoco_stat_gather(struct net_device *dev,
@@ -2458,8 +2453,11 @@ struct net_device *alloc_orinocodev(int
dev->watchdog_timeo = HZ; /* 1 second timeout */
dev->get_stats = orinoco_get_stats;
dev->ethtool_ops = &orinoco_ethtool_ops;
- dev->get_wireless_stats = orinoco_get_wireless_stats;
dev->wireless_handlers = (struct iw_handler_def *)&orinoco_handler_def;
+#ifdef WIRELESS_SPY
+ priv->wireless_data.spy_data = &priv->spy_data;
+ dev->wireless_data = &priv->wireless_data;
+#endif
dev->change_mtu = orinoco_change_mtu;
dev->set_multicast_list = orinoco_set_multicast_list;
/* we use the default eth_mac_addr for setting the MAC addr */
@@ -2831,7 +2829,7 @@ static int orinoco_ioctl_getiwrange(stru
}
}
- if ((priv->iw_mode == IW_MODE_ADHOC) && (priv->spy_number == 0)){
+ if ((priv->iw_mode == IW_MODE_ADHOC) && (!SPY_NUMBER(priv))){
/* Quality stats meaningless in ad-hoc mode */
} else {
range->max_qual.qual = 0x8b - 0x2f;
@@ -2878,6 +2876,14 @@ static int orinoco_ioctl_getiwrange(stru
range->min_r_time = 0;
range->max_r_time = 65535 * 1000; /* ??? */
+ /* Event capability (kernel) */
+ IW_EVENT_CAPA_SET_KERNEL(range->event_capa);
+ /* Event capability (driver) */
+ IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWTHRSPY);
+ IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP);
+ IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN);
+ IW_EVENT_CAPA_SET(range->event_capa, IWEVTXDROP);
+
TRACE_EXIT(dev->name);
return 0;
@@ -3837,92 +3843,6 @@ static int orinoco_ioctl_getrid(struct n
return err;
}
-/* Spy is used for link quality/strength measurements in Ad-Hoc mode
- * Jean II */
-static int orinoco_ioctl_setspy(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *srq,
- char *extra)
-
-{
- struct orinoco_private *priv = netdev_priv(dev);
- struct sockaddr *address = (struct sockaddr *) extra;
- int number = srq->length;
- int i;
- unsigned long flags;
-
- /* Make sure nobody mess with the structure while we do */
- if (orinoco_lock(priv, &flags) != 0)
- return -EBUSY;
-
- /* orinoco_lock() doesn't disable interrupts, so make sure the
- * interrupt rx path don't get confused while we copy */
- priv->spy_number = 0;
-
- if (number > 0) {
- /* Extract the addresses */
- for (i = 0; i < number; i++)
- memcpy(priv->spy_address[i], address[i].sa_data,
- ETH_ALEN);
- /* Reset stats */
- memset(priv->spy_stat, 0,
- sizeof(struct iw_quality) * IW_MAX_SPY);
- /* Set number of addresses */
- priv->spy_number = number;
- }
-
- /* Now, let the others play */
- orinoco_unlock(priv, &flags);
-
- /* Do NOT call commit handler */
- return 0;
-}
-
-static int orinoco_ioctl_getspy(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *srq,
- char *extra)
-{
- struct orinoco_private *priv = netdev_priv(dev);
- struct sockaddr *address = (struct sockaddr *) extra;
- int number;
- int i;
- unsigned long flags;
-
- if (orinoco_lock(priv, &flags) != 0)
- return -EBUSY;
-
- number = priv->spy_number;
- /* Create address struct */
- for (i = 0; i < number; i++) {
- memcpy(address[i].sa_data, priv->spy_address[i], ETH_ALEN);
- address[i].sa_family = AF_UNIX;
- }
- if (number > 0) {
- /* Create address struct */
- for (i = 0; i < number; i++) {
- memcpy(address[i].sa_data, priv->spy_address[i],
- ETH_ALEN);
- address[i].sa_family = AF_UNIX;
- }
- /* Copy stats */
- /* In theory, we should disable irqs while copying the stats
- * because the rx path might update it in the middle...
- * Bah, who care ? - Jean II */
- memcpy(extra + (sizeof(struct sockaddr) * number),
- priv->spy_stat, sizeof(struct iw_quality) * number);
- }
- /* Reset updated flags. */
- for (i = 0; i < number; i++)
- priv->spy_stat[i].updated = 0;
-
- orinoco_unlock(priv, &flags);
-
- srq->length = number;
-
- return 0;
-}
-
/* Trigger a scan (look for other cells in the vicinity */
static int orinoco_ioctl_setscan(struct net_device *dev,
struct iw_request_info *info,
@@ -4353,8 +4273,10 @@ static const iw_handler orinoco_handler[
[SIOCSIWSENS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setsens,
[SIOCGIWSENS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getsens,
[SIOCGIWRANGE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getiwrange,
- [SIOCSIWSPY -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setspy,
- [SIOCGIWSPY -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getspy,
+ [SIOCSIWSPY -SIOCIWFIRST] = (iw_handler) iw_handler_set_spy,
+ [SIOCGIWSPY -SIOCIWFIRST] = (iw_handler) iw_handler_get_spy,
+ [SIOCSIWTHRSPY-SIOCIWFIRST] = (iw_handler) iw_handler_set_thrspy,
+ [SIOCGIWTHRSPY-SIOCIWFIRST] = (iw_handler) iw_handler_get_thrspy,
[SIOCSIWAP -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setwap,
[SIOCGIWAP -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getwap,
[SIOCSIWSCAN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setscan,
@@ -4399,6 +4321,7 @@ static const struct iw_handler_def orino
.standard = orinoco_handler,
.private = orinoco_private_handler,
.private_args = orinoco_privtab,
+ .get_wireless_stats = orinoco_get_wireless_stats,
};
static void orinoco_get_drvinfo(struct net_device *dev,
diff --git a/drivers/net/wireless/orinoco.h b/drivers/net/wireless/orinoco.h
--- a/drivers/net/wireless/orinoco.h
+++ b/drivers/net/wireless/orinoco.h
@@ -13,6 +13,7 @@
#include <linux/spinlock.h>
#include <linux/netdevice.h>
#include <linux/wireless.h>
+#include <net/iw_handler.h>
#include <linux/version.h>
#include "hermes.h"
@@ -112,9 +113,8 @@ struct orinoco_private {
u16 pm_on, pm_mcast, pm_period, pm_timeout;
u16 preamble;
#ifdef WIRELESS_SPY
- int spy_number;
- u_char spy_address[IW_MAX_SPY][ETH_ALEN];
- struct iw_quality spy_stat[IW_MAX_SPY];
+ struct iw_spy_data spy_data; /* iwspy support */
+ struct iw_public_data wireless_data;
#endif
/* Configuration dependent variables */
--
Regards,
Pavel Roskin
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply
* Re: [PATCH 8/8] orinoco: New driver - spectrum_cs.
From: Pavel Roskin @ 2005-09-09 22:40 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Orinoco Development List, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20050906112424.GA5309-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
On Tue, 2005-09-06 at 12:24 +0100, Christoph Hellwig wrote:
> > +#ifdef __IN_PCMCIA_PACKAGE__
> > +#include <pcmcia/k_compat.h>
> > +#endif /* __IN_PCMCIA_PACKAGE__ */
>
> this doesn't make sense for a 2.6 driver.
Fixed in my tree, thanks. Patches will be sent shortly.
> > +#ifdef SPECTRUM_FW_INCLUDED
> > +/* Header with the firmware */
> > +#include "spectrum_fw.h"
> > +#else /* !SPECTRUM_FW_INCLUDED */
>
> While I see the point of this for the standalone orinoco driver package
> it doesn't make sense for the version in the kernel tree.
Likewise.
>
> > +#define CS_CHECK(fn, ret) \
> > + do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
>
> I don't think this macro abuse helps anyone..
Sure, but it's abused by many drivers. Maybe next time.
--
Regards,
Pavel Roskin
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox