* Re: [PATCH]bluetooth: rfcomm_init bug fix
From: David Miller @ 2009-08-05 16:31 UTC (permalink / raw)
To: marcel; +Cc: hidave.darkstar, oliver, alan, netdev, linux-bluetooth,
linux-kernel
In-Reply-To: <1249486555.3094.38.camel@localhost.localdomain>
From: Marcel Holtmann <marcel@holtmann.org>
Date: Wed, 05 Aug 2009 08:35:55 -0700
> Lets me make this perfectly clear here. Bluetooth patches are sent to
> the linux-bluetooth mailing list. There is no need to send them to
> netdev and/or LKML at the same time. Stop this cross-posting. They don't
> get more review there anyway. I take care of sending them for net-2.6
> inclusion if I feel that they are appropriate.
Some of that isn't true, I was reading over his patches as he
posted them. So cross-posting to netdev is absolutely not a
waste of time IMHO.
^ permalink raw reply
* [PATCH, RFC] bonding: prevent outgoing packets on inactive slaves
From: Jiri Bohac @ 2009-08-05 16:24 UTC (permalink / raw)
To: fubar; +Cc: davem, netdev
Applications exist that broadcast/multicast packets on all
devices in the system (e.g. avahi-mdns).
When a device is an inactive slave of a bond in active-backup
mode, its MAC address may be set identical to other divecies in
the bond. The broadcast/multicast packets may then confuse
switches to direct packets to the inactive slave, rather than the
active one.
This patch makes sure the TX queues on inactive slaves are
deactivated.
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -20,6 +20,7 @@
#include <linux/if_bonding.h>
#include <linux/kobject.h>
#include <linux/in6.h>
+#include <net/sch_generic.h>
#include "bond_3ad.h"
#include "bond_alb.h"
@@ -291,12 +292,21 @@ static inline void bond_set_slave_inactive_flags(struct slave *slave)
slave->dev->priv_flags |= IFF_SLAVE_INACTIVE;
if (slave_do_arp_validate(bond, slave))
slave->dev->priv_flags |= IFF_SLAVE_NEEDARP;
+
+ /* prevent outgoing frames on inactive slaves from confusing switches */
+ if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
+ dev_deactivate_tx(slave->dev);
}
static inline void bond_set_slave_active_flags(struct slave *slave)
{
+ struct bonding *bond = netdev_priv(slave->dev->master);
+
slave->state = BOND_STATE_ACTIVE;
slave->dev->priv_flags &= ~(IFF_SLAVE_INACTIVE | IFF_SLAVE_NEEDARP);
+
+ if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
+ dev_activate_tx(slave->dev);
}
static inline void bond_set_master_3ad_flags(struct bonding *bond)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 964ffa0..eee006a 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -296,6 +296,8 @@ extern void dev_init_scheduler(struct net_device *dev);
extern void dev_shutdown(struct net_device *dev);
extern void dev_activate(struct net_device *dev);
extern void dev_deactivate(struct net_device *dev);
+extern void dev_activate_tx(struct net_device *dev);
+extern void dev_deactivate_tx(struct net_device *dev);
extern void qdisc_reset(struct Qdisc *qdisc);
extern void qdisc_destroy(struct Qdisc *qdisc);
extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 27d0381..514c73d 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -628,7 +628,7 @@ static void transition_one_qdisc(struct net_device *dev,
}
}
-void dev_activate(struct net_device *dev)
+void dev_activate_tx(struct net_device *dev)
{
int need_watchdog;
@@ -647,13 +647,19 @@ void dev_activate(struct net_device *dev)
need_watchdog = 0;
netdev_for_each_tx_queue(dev, transition_one_qdisc, &need_watchdog);
- transition_one_qdisc(dev, &dev->rx_queue, NULL);
if (need_watchdog) {
dev->trans_start = jiffies;
dev_watchdog_up(dev);
}
}
+EXPORT_SYMBOL(dev_activate_tx);
+
+void dev_activate(struct net_device *dev)
+{
+ dev_activate_tx(dev);
+ transition_one_qdisc(dev, &dev->rx_queue, NULL);
+}
static void dev_deactivate_queue(struct net_device *dev,
struct netdev_queue *dev_queue,
@@ -703,12 +709,18 @@ static bool some_qdisc_is_busy(struct net_device *dev)
return false;
}
-void dev_deactivate(struct net_device *dev)
+void dev_deactivate_tx(struct net_device *dev)
{
netdev_for_each_tx_queue(dev, dev_deactivate_queue, &noop_qdisc);
- dev_deactivate_queue(dev, &dev->rx_queue, &noop_qdisc);
dev_watchdog_down(dev);
+}
+EXPORT_SYMBOL(dev_deactivate_tx);
+
+void dev_deactivate(struct net_device *dev)
+{
+ dev_deactivate_tx(dev);
+ dev_deactivate_queue(dev, &dev->rx_queue, &noop_qdisc);
/* Wait for outstanding qdisc-less dev_queue_xmit calls. */
synchronize_rcu();
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ
^ permalink raw reply related
* Confirmation +447035970367
From: INFO @ 2009-08-05 15:44 UTC (permalink / raw)
To: ukl
You have WON.Confirm this receipt by replying the due process unit officer:Fill the details: FullName,Address,Tel,Occupation,etc,Reply to cgnlpaycenter@9.cn
^ permalink raw reply
* Re: [PATCH] net: Fix spinlock use in alloc_netdev_mq()
From: David Miller @ 2009-08-05 15:37 UTC (permalink / raw)
To: jpirko; +Cc: mingo, a.p.zijlstra, torvalds, akpm, netdev, linux-kernel
In-Reply-To: <20090805084746.GA3897@psychotron.englab.brq.redhat.com>
From: Jiri Pirko <jpirko@redhat.com>
Date: Wed, 5 Aug 2009 10:47:47 +0200
>>Signed-off-by: Ingo Molnar <mingo@elte.hu>
> Acked-by: Jiri Pirko <jpirko@redhat.com>
Applied, thanks everyone.
^ permalink raw reply
* [GIT]: Networking
From: David Miller @ 2009-08-05 15:37 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
Ingo found and fixed a lockdep regression added in yesterday's
networking fixes that several people are hitting now.
Please pull, thanks a lot!
The following changes since commit 90bc1a658a53f8832ee799685703977a450e5af9:
Linus Torvalds (1):
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Ingo Molnar (1):
net: Fix spinlock use in alloc_netdev_mq()
net/core/dev.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
^ permalink raw reply
* Re: [PATCH]bluetooth: rfcomm_init bug fix
From: Marcel Holtmann @ 2009-08-05 15:35 UTC (permalink / raw)
To: Dave Young
Cc: David Miller, oliver-fJ+pQTUTwRTk1uMJSBkQmQ,
alan-qBU/x9rampVanCEyBjwyrvXRex20P6io,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <a8e1da0908042216u16037395k96cce0746baa504e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Dave,
> >> >> do you mind at least waiting for an ACK from my side. I haven't even
> >> >> looked at the final patch.
> >> >
> >> > Sure, I haven't pushed it out yet, so now's your chance :)
> >>
> >> Grumble, I accidently pushed my net-2.6 queue out before you
> >> had a chance to reply, sorry :-(
> >
> > not a big deal. Just have to send a cleanup patch. The patch itself is
> > fine, but from a style perspective it is different than everything else
> > in the Bluetooth subsystem and I would have liked to fix that before
> > pushing it. I wait with that for 2.6.32 since it is not important.
>
> Marcel, could you publish the bluetooth subsystem coding style
> somewhere? People including me are confused about it. I remembered I
> asked it from you, but it is still not very clear for me.
it is kernel coding style like everything else, but some variable naming
should be consistent. And that is nothing that is published, that is
something that has been done since Max wrote it. Check the rest of the
code.
> > The other Dave, please send patches to linux-bluetooth only and lets
> > follow the normal path to get them merged into Linus' tree. Skipping
> > bluetooth-2.6 is not an option. You have to use the same process than
> > everybody else.
>
> Why linux-bluetooth only? IMHO there could be more people to comment
> and review if I send patches to both lkml and subsystem mailing list.
Lets me make this perfectly clear here. Bluetooth patches are sent to
the linux-bluetooth mailing list. There is no need to send them to
netdev and/or LKML at the same time. Stop this cross-posting. They don't
get more review there anyway. I take care of sending them for net-2.6
inclusion if I feel that they are appropriate.
Regards
Marcel
^ permalink raw reply
* net: mark read-only arrays as const
From: Jan Engelhardt @ 2009-08-05 15:10 UTC (permalink / raw)
To: davem; +Cc: netdev
I took the freedom to just make one commit out of it, as it is
relatively simple cosmetic change.
Please consider for davem/net-next-2.6.
--->8---
parent 71cedacf9a406ab66511eb5764e4cd6b26df8c6b (v2.6.31-rc1-105-g71cedac)
commit 8728b591fc89b7913026ab1e03f370f9cf3b9c18
Author: Jan Engelhardt <jengelh@medozas.de>
Date: Wed Aug 5 17:07:55 2009 +0200
net: mark read-only arrays as const
String literals are constant, and usually, we can also tag the array
of pointers const too, moving it to the .rodata section.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
include/net/ip_vs.h | 3 ++-
include/net/irda/ircomm_event.h | 2 +-
include/net/irda/ircomm_tty_attach.h | 4 ++--
include/net/irda/irlap_event.h | 2 +-
include/net/irda/irlmp_event.h | 4 ++--
include/net/sctp/constants.h | 4 +++-
net/8021q/vlanproc.c | 2 +-
net/atm/lec.c | 9 +++++----
net/atm/proc.c | 9 +++++----
net/bluetooth/af_bluetooth.c | 4 ++--
net/bridge/br_stp.c | 2 +-
net/core/dev.c | 2 +-
net/core/net-sysfs.c | 2 +-
net/core/sock.c | 6 +++---
net/dccp/ccids/ccid3.c | 4 ++--
net/dccp/feat.c | 7 ++++---
net/dccp/proto.c | 4 ++--
net/ipv4/fib_trie.c | 2 +-
net/ipv6/proc.c | 4 ++--
net/irda/ircomm/ircomm_event.c | 4 ++--
net/irda/ircomm/ircomm_tty_attach.c | 4 ++--
net/irda/iriap.c | 4 ++--
net/irda/irlan/irlan_common.c | 4 ++--
net/irda/irlap.c | 2 +-
net/irda/irlap_event.c | 4 ++--
net/irda/irlmp_event.c | 6 +++---
net/llc/llc_proc.c | 2 +-
net/netfilter/ipvs/ip_vs_proto.c | 3 ++-
net/netfilter/ipvs/ip_vs_proto_tcp.c | 2 +-
net/netfilter/ipvs/ip_vs_proto_udp.c | 2 +-
net/rds/ib_stats.c | 2 +-
net/rds/iw_stats.c | 2 +-
net/rds/rds.h | 3 ++-
net/rds/stats.c | 4 ++--
net/rxrpc/ar-ack.c | 2 +-
net/sctp/debug.c | 14 +++++++-------
36 files changed, 74 insertions(+), 66 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index bbae1e8..a191232 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -740,7 +740,8 @@ extern void ip_vs_protocol_cleanup(void);
extern void ip_vs_protocol_timeout_change(int flags);
extern int *ip_vs_create_timeout_table(int *table, int size);
extern int
-ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to);
+ip_vs_set_state_timeout(int *table, int num, const char *const *names,
+ const char *name, int to);
extern void
ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
int offset, const char *msg);
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h
index c290447..bc0c6f3 100644
--- a/include/net/irda/ircomm_event.h
+++ b/include/net/irda/ircomm_event.h
@@ -74,7 +74,7 @@ struct ircomm_info {
struct qos_info *qos;
};
-extern char *ircomm_state[];
+extern const char *const ircomm_state[];
struct ircomm_cb; /* Forward decl. */
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index f91a569..0a63bbb 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -66,8 +66,8 @@ struct ircomm_tty_info {
__u8 dlsap_sel;
};
-extern char *ircomm_state[];
-extern char *ircomm_tty_state[];
+extern const char *const ircomm_state[];
+extern const char *const ircomm_tty_state[];
int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,
struct sk_buff *skb, struct ircomm_tty_info *info);
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index 2ae2e11..4c90824 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -120,7 +120,7 @@ typedef enum { /* FIXME check the two first reason codes */
LAP_PRIMARY_CONFLICT,
} LAP_REASON;
-extern const char *irlap_state[];
+extern const char *const irlap_state[];
void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event,
struct sk_buff *skb, struct irlap_info *info);
diff --git a/include/net/irda/irlmp_event.h b/include/net/irda/irlmp_event.h
index e03ae4a..9e4ec17 100644
--- a/include/net/irda/irlmp_event.h
+++ b/include/net/irda/irlmp_event.h
@@ -79,8 +79,8 @@ typedef enum {
LM_LAP_IDLE_TIMEOUT,
} IRLMP_EVENT;
-extern const char *irlmp_state[];
-extern const char *irlsap_state[];
+extern const char *const irlmp_state[];
+extern const char *const irlsap_state[];
void irlmp_watchdog_timer_expired(void *data);
void irlmp_discovery_timer_expired(void *data);
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index b05b055..8bc25f7 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -241,7 +241,9 @@ const char *sctp_tname(const sctp_subtype_t); /* timeouts */
const char *sctp_pname(const sctp_subtype_t); /* primitives */
/* This is a table of printable names of sctp_state_t's. */
-extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[];
+extern const char *const sctp_state_tbl[];
+extern const char *const sctp_evttype_tbl[];
+extern const char *const sctp_status_tbl[];
/* Maximum chunk length considering padding requirements. */
enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) };
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index b55a091..6262c33 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -107,7 +107,7 @@ static const struct file_operations vlandev_fops = {
*/
/* Strings */
-static const char *vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = {
+static const char *const vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = {
[VLAN_NAME_TYPE_RAW_PLUS_VID] = "VLAN_NAME_TYPE_RAW_PLUS_VID",
[VLAN_NAME_TYPE_PLUS_VID_NO_PAD] = "VLAN_NAME_TYPE_PLUS_VID_NO_PAD",
[VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD] = "VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD",
diff --git a/net/atm/lec.c b/net/atm/lec.c
index ff2e594..ab2b0e9 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -935,9 +935,9 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
}
#ifdef CONFIG_PROC_FS
-static char *lec_arp_get_status_string(unsigned char status)
+static const char *lec_arp_get_status_string(unsigned char status)
{
- static char *lec_arp_status_string[] = {
+ static const char *const lec_arp_status_string[] = {
"ESI_UNKNOWN ",
"ESI_ARP_PENDING ",
"ESI_VC_PENDING ",
@@ -1121,7 +1121,8 @@ static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static int lec_seq_show(struct seq_file *seq, void *v)
{
- static char lec_banner[] = "Itf MAC ATM destination"
+ static const char lec_banner[] =
+ "Itf MAC ATM destination"
" Status Flags "
"VPI/VCI Recv VPI/VCI\n";
@@ -1505,7 +1506,7 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove)
}
#if DEBUG_ARP_TABLE
-static char *get_status_string(unsigned char st)
+static const char *get_status_string(unsigned char st)
{
switch (st) {
case ESI_UNKNOWN:
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 38de5ff..ab8419a 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -151,8 +151,9 @@ static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
{
- static const char *class_name[] = { "off","UBR","CBR","VBR","ABR" };
- static const char *aal_name[] = {
+ static const char *const class_name[] =
+ {"off","UBR","CBR","VBR","ABR"};
+ static const char *const aal_name[] = {
"---", "1", "2", "3/4", /* 0- 3 */
"???", "5", "???", "???", /* 4- 7 */
"???", "???", "???", "???", /* 8-11 */
@@ -178,7 +179,7 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc)
static const char *vcc_state(struct atm_vcc *vcc)
{
- static const char *map[] = { ATM_VS2TXT_MAP };
+ static const char *const map[] = { ATM_VS2TXT_MAP };
return map[ATM_VF2VS(vcc->flags)];
}
@@ -335,7 +336,7 @@ static const struct file_operations vcc_seq_fops = {
static int svc_seq_show(struct seq_file *seq, void *v)
{
- static char atm_svc_banner[] =
+ static const char atm_svc_banner[] =
"Itf VPI VCI State Remote\n";
if (v == SEQ_START_TOKEN)
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index 0250e06..8cfb5a8 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -49,7 +49,7 @@ static struct net_proto_family *bt_proto[BT_MAX_PROTO];
static DEFINE_RWLOCK(bt_proto_lock);
static struct lock_class_key bt_lock_key[BT_MAX_PROTO];
-static const char *bt_key_strings[BT_MAX_PROTO] = {
+static const char *const bt_key_strings[BT_MAX_PROTO] = {
"sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP",
"sk_lock-AF_BLUETOOTH-BTPROTO_HCI",
"sk_lock-AF_BLUETOOTH-BTPROTO_SCO",
@@ -61,7 +61,7 @@ static const char *bt_key_strings[BT_MAX_PROTO] = {
};
static struct lock_class_key bt_slock_key[BT_MAX_PROTO];
-static const char *bt_slock_key_strings[BT_MAX_PROTO] = {
+static const char *const bt_slock_key_strings[BT_MAX_PROTO] = {
"slock-AF_BLUETOOTH-BTPROTO_L2CAP",
"slock-AF_BLUETOOTH-BTPROTO_HCI",
"slock-AF_BLUETOOTH-BTPROTO_SCO",
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index 0660515..fd3f8d6 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -21,7 +21,7 @@
*/
#define MESSAGE_AGE_INCR ((HZ < 256) ? 1 : (HZ/256))
-static const char *br_port_state_names[] = {
+static const char *const br_port_state_names[] = {
[BR_STATE_DISABLED] = "disabled",
[BR_STATE_LISTENING] = "listening",
[BR_STATE_LEARNING] = "learning",
diff --git a/net/core/dev.c b/net/core/dev.c
index 60b5728..5864260 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -272,7 +272,7 @@ static const unsigned short netdev_lock_type[] =
ARPHRD_PHONET_PIPE, ARPHRD_IEEE802154, ARPHRD_IEEE802154_PHY,
ARPHRD_VOID, ARPHRD_NONE};
-static const char *netdev_lock_name[] =
+static const char *const netdev_lock_name[] =
{"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25",
"_xmit_PRONET", "_xmit_CHAOS", "_xmit_IEEE802", "_xmit_ARCNET",
"_xmit_APPLETLK", "_xmit_DLCI", "_xmit_ATM", "_xmit_METRICOM",
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 3994680..ad91e9e 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -141,7 +141,7 @@ static ssize_t show_dormant(struct device *dev,
return -EINVAL;
}
-static const char *operstates[] = {
+static const char *const operstates[] = {
"unknown",
"notpresent", /* currently unused */
"down",
diff --git a/net/core/sock.c b/net/core/sock.c
index 025317f..97ae816 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -142,7 +142,7 @@ static struct lock_class_key af_family_slock_keys[AF_MAX];
* strings build-time, so that runtime initialization of socket
* locks is fast):
*/
-static const char *af_family_key_strings[AF_MAX+1] = {
+static const char *const af_family_key_strings[AF_MAX+1] = {
"sk_lock-AF_UNSPEC", "sk_lock-AF_UNIX" , "sk_lock-AF_INET" ,
"sk_lock-AF_AX25" , "sk_lock-AF_IPX" , "sk_lock-AF_APPLETALK",
"sk_lock-AF_NETROM", "sk_lock-AF_BRIDGE" , "sk_lock-AF_ATMPVC" ,
@@ -158,7 +158,7 @@ static const char *af_family_key_strings[AF_MAX+1] = {
"sk_lock-AF_IEEE802154",
"sk_lock-AF_MAX"
};
-static const char *af_family_slock_key_strings[AF_MAX+1] = {
+static const char *const af_family_slock_key_strings[AF_MAX+1] = {
"slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" ,
"slock-AF_AX25" , "slock-AF_IPX" , "slock-AF_APPLETALK",
"slock-AF_NETROM", "slock-AF_BRIDGE" , "slock-AF_ATMPVC" ,
@@ -174,7 +174,7 @@ static const char *af_family_slock_key_strings[AF_MAX+1] = {
"slock-AF_IEEE802154",
"slock-AF_MAX"
};
-static const char *af_family_clock_key_strings[AF_MAX+1] = {
+static const char *const af_family_clock_key_strings[AF_MAX+1] = {
"clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" ,
"clock-AF_AX25" , "clock-AF_IPX" , "clock-AF_APPLETALK",
"clock-AF_NETROM", "clock-AF_BRIDGE" , "clock-AF_ATMPVC" ,
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index a27b7f4..f596ce1 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -52,7 +52,7 @@ static int ccid3_debug;
#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state)
{
- static char *ccid3_state_names[] = {
+ static const char *const ccid3_state_names[] = {
[TFRC_SSTATE_NO_SENT] = "NO_SENT",
[TFRC_SSTATE_NO_FBACK] = "NO_FBACK",
[TFRC_SSTATE_FBACK] = "FBACK",
@@ -646,7 +646,7 @@ enum ccid3_fback_type {
#ifdef CONFIG_IP_DCCP_CCID3_DEBUG
static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state)
{
- static char *ccid3_rx_state_names[] = {
+ static const char *const ccid3_rx_state_names[] = {
[TFRC_RSTATE_NO_DATA] = "NO_DATA",
[TFRC_RSTATE_DATA] = "DATA",
[TFRC_RSTATE_TERM] = "TERM",
diff --git a/net/dccp/feat.c b/net/dccp/feat.c
index b04160a..972b8dc 100644
--- a/net/dccp/feat.c
+++ b/net/dccp/feat.c
@@ -213,7 +213,7 @@ static int dccp_feat_default_value(u8 feat_num)
*/
static const char *dccp_feat_fname(const u8 feat)
{
- static const char *feature_names[] = {
+ static const char *const feature_names[] = {
[DCCPF_RESERVED] = "Reserved",
[DCCPF_CCID] = "CCID",
[DCCPF_SHORT_SEQNOS] = "Allow Short Seqnos",
@@ -236,8 +236,9 @@ static const char *dccp_feat_fname(const u8 feat)
return feature_names[feat];
}
-static const char *dccp_feat_sname[] = { "DEFAULT", "INITIALISING", "CHANGING",
- "UNSTABLE", "STABLE" };
+static const char *const dccp_feat_sname[] = {
+ "DEFAULT", "INITIALISING", "CHANGING", "UNSTABLE", "STABLE",
+};
#ifdef CONFIG_IP_DCCP_DEBUG
static const char *dccp_feat_oname(const u8 opt)
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 314a1b5..af65f02 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(dccp_done);
const char *dccp_packet_name(const int type)
{
- static const char *dccp_packet_names[] = {
+ static const char *const dccp_packet_names[] = {
[DCCP_PKT_REQUEST] = "REQUEST",
[DCCP_PKT_RESPONSE] = "RESPONSE",
[DCCP_PKT_DATA] = "DATA",
@@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(dccp_packet_name);
const char *dccp_state_name(const int state)
{
- static char *dccp_state_names[] = {
+ static const char *const dccp_state_names[] = {
[DCCP_OPEN] = "OPEN",
[DCCP_REQUESTING] = "REQUESTING",
[DCCP_PARTOPEN] = "PARTOPEN",
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 012cf5a..f9dca9d 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2388,7 +2388,7 @@ static inline const char *rtn_scope(char *buf, size_t len, enum rt_scope_t s)
}
}
-static const char *rtn_type_names[__RTN_MAX] = {
+static const char *const rtn_type_names[__RTN_MAX] = {
[RTN_UNSPEC] = "UNSPEC",
[RTN_UNICAST] = "UNICAST",
[RTN_LOCAL] = "LOCAL",
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 590ddef..c9605c3 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -101,7 +101,7 @@ static struct snmp_mib snmp6_icmp6_list[] = {
};
/* RFC 4293 v6 ICMPMsgStatsTable; named items for RFC 2466 compatibility */
-static char *icmp6type2name[256] = {
+static const char *const icmp6type2name[256] = {
[ICMPV6_DEST_UNREACH] = "DestUnreachs",
[ICMPV6_PKT_TOOBIG] = "PktTooBigs",
[ICMPV6_TIME_EXCEED] = "TimeExcds",
@@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
/* print by name -- deprecated items */
for (i = 0; i < ICMP6MSG_MIB_MAX; i++) {
int icmptype;
- char *p;
+ const char *p;
icmptype = i & 0xff;
p = icmp6type2name[icmptype];
diff --git a/net/irda/ircomm/ircomm_event.c b/net/irda/ircomm/ircomm_event.c
index c35b3ef..d78554f 100644
--- a/net/irda/ircomm/ircomm_event.c
+++ b/net/irda/ircomm/ircomm_event.c
@@ -49,7 +49,7 @@ static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event,
static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event,
struct sk_buff *skb, struct ircomm_info *info);
-char *ircomm_state[] = {
+const char *const ircomm_state[] = {
"IRCOMM_IDLE",
"IRCOMM_WAITI",
"IRCOMM_WAITR",
@@ -57,7 +57,7 @@ char *ircomm_state[] = {
};
#ifdef CONFIG_IRDA_DEBUG
-static char *ircomm_event[] = {
+static const char *const ircomm_event[] = {
"IRCOMM_CONNECT_REQUEST",
"IRCOMM_CONNECT_RESPONSE",
"IRCOMM_TTP_CONNECT_INDICATION",
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c
index 9032a1d..eafc010 100644
--- a/net/irda/ircomm/ircomm_tty_attach.c
+++ b/net/irda/ircomm/ircomm_tty_attach.c
@@ -80,7 +80,7 @@ static int ircomm_tty_state_ready(struct ircomm_tty_cb *self,
struct sk_buff *skb,
struct ircomm_tty_info *info);
-char *ircomm_tty_state[] = {
+const char *const ircomm_tty_state[] = {
"IRCOMM_TTY_IDLE",
"IRCOMM_TTY_SEARCH",
"IRCOMM_TTY_QUERY_PARAMETERS",
@@ -91,7 +91,7 @@ char *ircomm_tty_state[] = {
};
#ifdef CONFIG_IRDA_DEBUG
-static char *ircomm_tty_event[] = {
+static const char *const ircomm_tty_event[] = {
"IRCOMM_TTY_ATTACH_CABLE",
"IRCOMM_TTY_DETACH_CABLE",
"IRCOMM_TTY_DATA_REQUEST",
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 4a105dc..294e34d 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -44,7 +44,7 @@
#ifdef CONFIG_IRDA_DEBUG
/* FIXME: This one should go in irlmp.c */
-static const char *ias_charset_types[] = {
+static const char *const ias_charset_types[] = {
"CS_ASCII",
"CS_ISO_8859_1",
"CS_ISO_8859_2",
@@ -966,7 +966,7 @@ static void iriap_watchdog_timer_expired(void *data)
#ifdef CONFIG_PROC_FS
-static const char *ias_value_types[] = {
+static const char *const ias_value_types[] = {
"IAS_MISSING",
"IAS_INTEGER",
"IAS_OCT_SEQ",
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index 774d73a..6211682 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -69,14 +69,14 @@ static int eth; /* Use "eth" or "irlan" name for devices */
static int access = ACCESS_PEER; /* PEER, DIRECT or HOSTED */
#ifdef CONFIG_PROC_FS
-static const char *irlan_access[] = {
+static const char *const irlan_access[] = {
"UNKNOWN",
"DIRECT",
"PEER",
"HOSTED"
};
-static const char *irlan_media[] = {
+static const char *const irlan_media[] = {
"UNKNOWN",
"802.3",
"802.5"
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index e4965b7..356e65b 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -63,7 +63,7 @@ static void irlap_init_qos_capabilities(struct irlap_cb *self,
struct qos_info *qos_user);
#ifdef CONFIG_IRDA_DEBUG
-static char *lap_reasons[] = {
+static const char *const lap_reasons[] = {
"ERROR, NOT USED",
"LAP_DISC_INDICATION",
"LAP_NO_RESPONSE",
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c
index 16c4ef0..c5c5195 100644
--- a/net/irda/irlap_event.c
+++ b/net/irda/irlap_event.c
@@ -78,7 +78,7 @@ static int irlap_state_reset_check(struct irlap_cb *, IRLAP_EVENT event,
struct sk_buff *, struct irlap_info *);
#ifdef CONFIG_IRDA_DEBUG
-static const char *irlap_event[] = {
+static const char *const irlap_event[] = {
"DISCOVERY_REQUEST",
"CONNECT_REQUEST",
"CONNECT_RESPONSE",
@@ -120,7 +120,7 @@ static const char *irlap_event[] = {
};
#endif /* CONFIG_IRDA_DEBUG */
-const char *irlap_state[] = {
+const char *const irlap_state[] = {
"LAP_NDM",
"LAP_QUERY",
"LAP_REPLY",
diff --git a/net/irda/irlmp_event.c b/net/irda/irlmp_event.c
index 78cce0c..c1fb5db 100644
--- a/net/irda/irlmp_event.c
+++ b/net/irda/irlmp_event.c
@@ -33,13 +33,13 @@
#include <net/irda/irlmp_frame.h>
#include <net/irda/irlmp_event.h>
-const char *irlmp_state[] = {
+const char *const irlmp_state[] = {
"LAP_STANDBY",
"LAP_U_CONNECT",
"LAP_ACTIVE",
};
-const char *irlsap_state[] = {
+const char *const irlsap_state[] = {
"LSAP_DISCONNECTED",
"LSAP_CONNECT",
"LSAP_CONNECT_PEND",
@@ -49,7 +49,7 @@ const char *irlsap_state[] = {
};
#ifdef CONFIG_IRDA_DEBUG
-static const char *irlmp_event[] = {
+static const char *const irlmp_event[] = {
"LM_CONNECT_REQUEST",
"LM_CONNECT_CONFIRM",
"LM_CONNECT_RESPONSE",
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index f97be47..be47ac4 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -143,7 +143,7 @@ out:
return 0;
}
-static char *llc_conn_state_names[] = {
+static const char *const llc_conn_state_names[] = {
[LLC_CONN_STATE_ADM] = "adm",
[LLC_CONN_STATE_SETUP] = "setup",
[LLC_CONN_STATE_NORMAL] = "normal",
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index a01520e..3ce9809 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -124,7 +124,8 @@ ip_vs_create_timeout_table(int *table, int size)
* Set timeout value for state specified by name
*/
int
-ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to)
+ip_vs_set_state_timeout(int *table, int num, const char *const *names,
+ const char *name, int to)
{
int i;
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index 8cba418..82742b3 100644
--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c
@@ -374,7 +374,7 @@ static int tcp_timeouts[IP_VS_TCP_S_LAST+1] = {
[IP_VS_TCP_S_LAST] = 2*HZ,
};
-static char * tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
+static const char *const tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
[IP_VS_TCP_S_NONE] = "NONE",
[IP_VS_TCP_S_ESTABLISHED] = "ESTABLISHED",
[IP_VS_TCP_S_SYN_SENT] = "SYN_SENT",
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c
index d2930a7..b24e2f0 100644
--- a/net/netfilter/ipvs/ip_vs_proto_udp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c
@@ -469,7 +469,7 @@ static int udp_timeouts[IP_VS_UDP_S_LAST+1] = {
[IP_VS_UDP_S_LAST] = 2*HZ,
};
-static char * udp_state_name_table[IP_VS_UDP_S_LAST+1] = {
+static const char *const udp_state_name_table[IP_VS_UDP_S_LAST+1] = {
[IP_VS_UDP_S_NORMAL] = "UDP",
[IP_VS_UDP_S_LAST] = "BUG!",
};
diff --git a/net/rds/ib_stats.c b/net/rds/ib_stats.c
index 02e3e3d..8d84883 100644
--- a/net/rds/ib_stats.c
+++ b/net/rds/ib_stats.c
@@ -39,7 +39,7 @@
DEFINE_PER_CPU(struct rds_ib_statistics, rds_ib_stats) ____cacheline_aligned;
-static char *rds_ib_stat_names[] = {
+static const char *const rds_ib_stat_names[] = {
"ib_connect_raced",
"ib_listen_closed_stale",
"ib_tx_cq_call",
diff --git a/net/rds/iw_stats.c b/net/rds/iw_stats.c
index ccc7e8f..d33ea79 100644
--- a/net/rds/iw_stats.c
+++ b/net/rds/iw_stats.c
@@ -39,7 +39,7 @@
DEFINE_PER_CPU(struct rds_iw_statistics, rds_iw_stats) ____cacheline_aligned;
-static char *rds_iw_stat_names[] = {
+static const char *const rds_iw_stat_names[] = {
"iw_connect_raced",
"iw_listen_closed_stale",
"iw_tx_cq_call",
diff --git a/net/rds/rds.h b/net/rds/rds.h
index dbe1112..290566c 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -652,7 +652,8 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats);
int __init rds_stats_init(void);
void rds_stats_exit(void);
void rds_stats_info_copy(struct rds_info_iterator *iter,
- uint64_t *values, char **names, size_t nr);
+ uint64_t *values, const char *const *names,
+ size_t nr);
/* sysctl.c */
int __init rds_sysctl_init(void);
diff --git a/net/rds/stats.c b/net/rds/stats.c
index 6371468..91d8c58 100644
--- a/net/rds/stats.c
+++ b/net/rds/stats.c
@@ -40,7 +40,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats);
/* :.,$s/unsigned long\>.*\<s_\(.*\);/"\1",/g */
-static char *rds_stat_names[] = {
+static const char *const rds_stat_names[] = {
"conn_reset",
"recv_drop_bad_checksum",
"recv_drop_old_seq",
@@ -77,7 +77,7 @@ static char *rds_stat_names[] = {
};
void rds_stats_info_copy(struct rds_info_iterator *iter,
- uint64_t *values, char **names, size_t nr)
+ uint64_t *values, const char *const *names, size_t nr)
{
struct rds_info_counter ctr;
size_t i;
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c
index 3ac1672..c9f1f0a 100644
--- a/net/rxrpc/ar-ack.c
+++ b/net/rxrpc/ar-ack.c
@@ -20,7 +20,7 @@
static unsigned rxrpc_ack_defer = 1;
-static const char *rxrpc_acks[] = {
+static const char *const rxrpc_acks[] = {
"---", "REQ", "DUP", "OOS", "WIN", "MEM", "PNG", "PNR", "DLY", "IDL",
"-?-"
};
diff --git a/net/sctp/debug.c b/net/sctp/debug.c
index 7ff548a..bf24fa6 100644
--- a/net/sctp/debug.c
+++ b/net/sctp/debug.c
@@ -52,7 +52,7 @@ int sctp_debug_flag = 1; /* Initially enable DEBUG */
#endif /* SCTP_DEBUG */
/* These are printable forms of Chunk ID's from section 3.1. */
-static const char *sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = {
+static const char *const sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = {
"DATA",
"INIT",
"INIT_ACK",
@@ -97,7 +97,7 @@ const char *sctp_cname(const sctp_subtype_t cid)
}
/* These are printable forms of the states. */
-const char *sctp_state_tbl[SCTP_STATE_NUM_STATES] = {
+const char *const sctp_state_tbl[SCTP_STATE_NUM_STATES] = {
"STATE_EMPTY",
"STATE_CLOSED",
"STATE_COOKIE_WAIT",
@@ -110,7 +110,7 @@ const char *sctp_state_tbl[SCTP_STATE_NUM_STATES] = {
};
/* Events that could change the state of an association. */
-const char *sctp_evttype_tbl[] = {
+const char *const sctp_evttype_tbl[] = {
"EVENT_T_unknown",
"EVENT_T_CHUNK",
"EVENT_T_TIMEOUT",
@@ -119,7 +119,7 @@ const char *sctp_evttype_tbl[] = {
};
/* Return value of a state function */
-const char *sctp_status_tbl[] = {
+const char *const sctp_status_tbl[] = {
"DISPOSITION_DISCARD",
"DISPOSITION_CONSUME",
"DISPOSITION_NOMEM",
@@ -132,7 +132,7 @@ const char *sctp_status_tbl[] = {
};
/* Printable forms of primitives */
-static const char *sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = {
+static const char *const sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = {
"PRIMITIVE_ASSOCIATE",
"PRIMITIVE_SHUTDOWN",
"PRIMITIVE_ABORT",
@@ -149,7 +149,7 @@ const char *sctp_pname(const sctp_subtype_t id)
return "unknown_primitive";
}
-static const char *sctp_other_tbl[] = {
+static const char *const sctp_other_tbl[] = {
"NO_PENDING_TSN",
"ICMP_PROTO_UNREACH",
};
@@ -162,7 +162,7 @@ const char *sctp_oname(const sctp_subtype_t id)
return "unknown 'other' event";
}
-static const char *sctp_timer_tbl[] = {
+static const char *const sctp_timer_tbl[] = {
"TIMEOUT_NONE",
"TIMEOUT_T1_COOKIE",
"TIMEOUT_T1_INIT",
--
# Created with git-export-patch
^ permalink raw reply related
* Re: [PATCH] Add IDs for 3C905B-TX Fast Etherlink XL PCI
From: Steffen Klassert @ 2009-08-05 14:41 UTC (permalink / raw)
To: Pascal Terjan; +Cc: netdev
In-Reply-To: <1249481499-9560-1-git-send-email-pterjan@mandriva.com>
On Wed, Aug 05, 2009 at 04:11:39PM +0200, Pascal Terjan wrote:
> We found this old card which was not supported, and physically
> looks similar to the other 3C905B we have (9055).
>
> After adding the IDs it seems to work fine (MII report, dhcp, scp, ...)
The patch looks sane.
Btw. you should add a Signed-off-by line to your patches.
Acked-by: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
^ permalink raw reply
* [PATCH] Add IDs for 3C905B-TX Fast Etherlink XL PCI
From: Pascal Terjan @ 2009-08-05 14:11 UTC (permalink / raw)
To: Steffen Klassert; +Cc: netdev, Pascal Terjan
We found this old card which was not supported, and physically
looks similar to the other 3C905B we have (9055).
After adding the IDs it seems to work fine (MII report, dhcp, scp, ...)
---
drivers/net/3c59x.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index c204168..4567588 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -235,6 +235,7 @@ enum vortex_chips {
CH_3C900B_FL,
CH_3C905_1,
CH_3C905_2,
+ CH_3C905B_TX,
CH_3C905B_1,
CH_3C905B_2,
@@ -307,6 +308,8 @@ static struct vortex_chip_info {
PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
{"3c905 Boomerang 100baseT4",
PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
+ {"3C905B-TX Fast Etherlink XL PCI",
+ PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
{"3c905B Cyclone 100baseTx",
PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
@@ -389,6 +392,7 @@ static struct pci_device_id vortex_pci_tbl[] = {
{ 0x10B7, 0x900A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C900B_FL },
{ 0x10B7, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905_1 },
{ 0x10B7, 0x9051, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905_2 },
+ { 0x10B7, 0x9054, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_TX },
{ 0x10B7, 0x9055, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_1 },
{ 0x10B7, 0x9058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_2 },
--
1.6.4
^ permalink raw reply related
* Re: [RFC PATCH v1 1/2] lsm: Add hooks to the TUN driver
From: Serge E. Hallyn @ 2009-08-05 14:13 UTC (permalink / raw)
To: Paul Moore; +Cc: netdev, linux-security-module, selinux
In-Reply-To: <20090804212158.10798.34592.stgit@flek.lan>
Quoting Paul Moore (paul.moore@hp.com):
...
> static int tun_attach(struct tun_struct *tun, struct file *file)
> {
> struct tun_file *tfile = file->private_data;
> - const struct cred *cred = current_cred();
> - int err;
> + int err = 0;
>
> ASSERT_RTNL();
>
> - /* Check permissions */
> - if (((tun->owner != -1 && cred->euid != tun->owner) ||
> - (tun->group != -1 && !in_egroup_p(tun->group))) &&
> - !capable(CAP_NET_ADMIN))
> - return -EPERM;
...
> @@ -935,6 +930,13 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
> else
> return -EINVAL;
>
> + if ((tun->owner != -1 && cred->euid != tun->owner) ||
> + (tun->group != -1 && !in_egroup_p(tun->group)))
> + return -EPERM;
> + err = security_tun_dev_attach(tun->sk);
> + if (err < 0)
> + return err;
> +
...
> +/**
> + * cap_tun_dev_attach - Determine if attaching to an TUN device is allowed
> + *
> + * Determine if the user is allowed to attach to an existing persistent TUN
> + * device, historically this has always required the CAP_NET_ADMIN permission.
> + */
> +int cap_tun_dev_attach(void)
> +{
> + if (!capable(CAP_NET_ADMIN))
> + return -EPERM;
> + return 0;
> +}
The checks before and after this patch are not equivalent. Post-patch,
one must always have CAP_NET_ADMIN to do the attach, whereas pre-patch
you only needed those if current_cred() did not own the tun device. Is
that intentional?
Also as Eric said this patch needs to set the cap_ hooks. This patch
isn't yet introducing the selinux hooks, so iiuc actually this patch should
always oops if CONFIG_SECURITY=y.
-serge
^ permalink raw reply
* Re: [PATCH] pxaficp-ir - remove incorrect net_device_ops
From: Marek Vasut @ 2009-08-05 14:02 UTC (permalink / raw)
To: Alexander Beregalov
Cc: Eric Miao, linux-arm-kernel, Russell King - ARM Linux, samuel,
netdev
In-Reply-To: <a4423d670907290416h4a0796c2s665d3f8ca0755e67@mail.gmail.com>
Dne St 29. července 2009 13:16:25 Alexander Beregalov napsal(a):
> 2009/7/28 Eric Miao <eric.y.miao@gmail.com>:
> > Marek Vasut wrote:
> >> Hi!
> >>
> >> This patch fixes broken pxaficp-ir. The problem was in incorrect
> >> net_device_ops being specified which prevented the driver from
> >> operating. The symptoms were:
> >> - failing ifconfig for IrLAN, resulting in
> >> SIOCSIFFLAGS: Cannot assign requested address
> >> - irattach working for IrCOMM, but the port stayed disabled
> >>
> >> Moreover this patch corrects missing sysfs device link.
> >>
> >> btw. guys, be honest, when did you last tested pxaficp-ir on real
> >> hardware? ;-)
> >
> > Well, this seems to be brought by the net_device_ops change, which seems
> > to happen silently without any of us being notified.
> >
> > OK, netdev and Alex are copied, so that we can look into this issue a bit
> > deeper:
> >
> > 1. it looks to me that SIOCSIFFLAGS actually returned -EADDRNOTAVAIL,
> > which is likely caused by eth_validate_addr, the default eth_addr comes
> > with irda should be "00:00:00:00:00:00" if not explicitly specified
> > (kzalloc), and this should be the problem, solution ? Either give a
> > valid address to the irda net_device or remove this 'ndo_validate_addr'.
> > And which is a correct fix will impact on the .ndo_set_mac_address
> >
> > 2. '.ndo_change_mtu' ? It looks to me that Irda device doesn't care too
> > much about the MTU, eth_change_mtu is supposed to work just fine and not
> > to cause any side effects, and may just benefit later irda device drivers
> > if there is a weird device happens to care about MTU
> >
> > - eric
> >
> > Marek's original patch in attachment.
>
> Sorry about that and thanks.
> Then we should fix the rest of irda drivers in the same way.
Hi!
Was my patch applied or what's the current status? Thanks
^ permalink raw reply
* Re: Boot lockups triggered by 'net: restore the original spinlock to protect unicast list'
From: Mark Brown @ 2009-08-05 13:49 UTC (permalink / raw)
To: Jiri Pirko; +Cc: Meelis Roos, David S. Miller, netdev
In-Reply-To: <20090805134004.GG3897@psychotron.englab.brq.redhat.com>
On Wed, Aug 05, 2009 at 03:40:05PM +0200, Jiri Pirko wrote:
> Try this patch
> http://marc.info/?l=linux-kernel&m=124945666109347&w=2
> That should fix this.
It does indeed, thanks. FWIW
Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply
* Re: Boot lockups triggered by 'net: restore the original spinlock to protect unicast list'
From: Jiri Pirko @ 2009-08-05 13:40 UTC (permalink / raw)
To: Mark Brown; +Cc: Meelis Roos, David S. Miller, netdev
In-Reply-To: <20090805133659.GA3740@rakim.wolfsonmicro.main>
Wed, Aug 05, 2009 at 03:36:59PM CEST, broonie@opensource.wolfsonmicro.com wrote:
>I'm experiencing lockups at boot in -next with the loopback interface on
>my SMDK6410. These appear to be triggered by commit
>a6ac65db2329e7685299666f5f7b6093c7b0f3a0 (net: restore the original
>spinlock to protect unicast list) - the code change is suspicious and
>reverting the change allows my system to boot. I've not yet tried to
>understand the failure, I'm just reporting it.
Try this patch
http://marc.info/?l=linux-kernel&m=124945666109347&w=2
That should fix this.
>
>The console trace I get on failure is:
>
>[ 1.830000] BUG: spinlock bad magic on CPU#0, swapper/1
>[ 1.830000] lock: c7852508, .magic: 00000000, .owner: <none>/-1, .owner_cpu0
>[ 1.840000] [<c002fdc8>] (unwind_backtrace+0x0/0xe0) from [<c01679fc>] (_raw)
>[ 1.850000] [<c01679fc>] (_raw_spin_lock+0x20/0x98) from [<c020ac40>] (dev_u)
>[ 1.860000] [<c020ac40>] (dev_unicast_init+0x18/0x3c) from [<c020ebf8>] (all)
>[ 1.860000] [<c020ebf8>] (alloc_netdev_mq+0xbc/0x13c) from [<c001b210>] (loo)
>[ 1.870000] [<c001b210>] (loopback_net_init+0x1c/0x70) from [<c02096e4>] (re)
>[ 1.880000] [<c02096e4>] (register_pernet_operations+0x20/0x2c) from [<c0209)
>[ 1.890000] [<c0209778>] (register_pernet_device+0x20/0x54) from [<c001cbbc>)
>[ 1.900000] [<c001cbbc>] (net_dev_init+0xd0/0x15c) from [<c0029274>] (do_one)
>[ 1.910000] [<c0029274>] (do_one_initcall+0x4c/0x174) from [<c0008640>] (do_)
>[ 1.920000] [<c0008640>] (do_initcalls+0x1c/0x38) from [<c0008a04>] (kernel_)
>[ 1.930000] [<c0008a04>] (kernel_init+0x3c/0x8c) from [<c002ac98>] (kernel_t)
>[ 9.930000] BUG: spinlock lockup on CPU#0, swapper/1, c7852508
>[ 9.930000] [<c002fdc8>] (unwind_backtrace+0x0/0xe0) from [<c01679c8>] (__sp)
>[ 9.940000] [<c01679c8>] (__spin_lock_debug+0x88/0x9c) from [<c0167a54>] (_r)
>[ 9.940000] [<c0167a54>] (_raw_spin_lock+0x78/0x98) from [<c020ac40>] (dev_u)
>[ 9.950000] [<c020ac40>] (dev_unicast_init+0x18/0x3c) from [<c020ebf8>] (all)
>[ 9.960000] [<c020ebf8>] (alloc_netdev_mq+0xbc/0x13c) from [<c001b210>] (loo)
>[ 9.970000] [<c001b210>] (loopback_net_init+0x1c/0x70) from [<c02096e4>] (re)
>[ 9.980000] [<c02096e4>] (register_pernet_operations+0x20/0x2c) from [<c0209)
>[ 9.990000] [<c0209778>] (register_pernet_device+0x20/0x54) from [<c001cbbc>)
>[ 10.000000] [<c001cbbc>] (net_dev_init+0xd0/0x15c) from [<c0029274>] (do_one)
>[ 10.010000] [<c0029274>] (do_one_initcall+0x4c/0x174) from [<c0008640>] (do_)
>[ 10.020000] [<c0008640>] (do_initcalls+0x1c/0x38) from [<c0008a04>] (kernel_)
>[ 10.030000] [<c0008a04>] (kernel_init+0x3c/0x8c) from [<c002ac98>] (kernel_t)
^ permalink raw reply
* Boot lockups triggered by 'net: restore the original spinlock to protect unicast list'
From: Mark Brown @ 2009-08-05 13:36 UTC (permalink / raw)
To: Jiri Pirko, Meelis Roos, David S. Miller; +Cc: netdev
I'm experiencing lockups at boot in -next with the loopback interface on
my SMDK6410. These appear to be triggered by commit
a6ac65db2329e7685299666f5f7b6093c7b0f3a0 (net: restore the original
spinlock to protect unicast list) - the code change is suspicious and
reverting the change allows my system to boot. I've not yet tried to
understand the failure, I'm just reporting it.
The console trace I get on failure is:
[ 1.830000] BUG: spinlock bad magic on CPU#0, swapper/1
[ 1.830000] lock: c7852508, .magic: 00000000, .owner: <none>/-1, .owner_cpu0
[ 1.840000] [<c002fdc8>] (unwind_backtrace+0x0/0xe0) from [<c01679fc>] (_raw)
[ 1.850000] [<c01679fc>] (_raw_spin_lock+0x20/0x98) from [<c020ac40>] (dev_u)
[ 1.860000] [<c020ac40>] (dev_unicast_init+0x18/0x3c) from [<c020ebf8>] (all)
[ 1.860000] [<c020ebf8>] (alloc_netdev_mq+0xbc/0x13c) from [<c001b210>] (loo)
[ 1.870000] [<c001b210>] (loopback_net_init+0x1c/0x70) from [<c02096e4>] (re)
[ 1.880000] [<c02096e4>] (register_pernet_operations+0x20/0x2c) from [<c0209)
[ 1.890000] [<c0209778>] (register_pernet_device+0x20/0x54) from [<c001cbbc>)
[ 1.900000] [<c001cbbc>] (net_dev_init+0xd0/0x15c) from [<c0029274>] (do_one)
[ 1.910000] [<c0029274>] (do_one_initcall+0x4c/0x174) from [<c0008640>] (do_)
[ 1.920000] [<c0008640>] (do_initcalls+0x1c/0x38) from [<c0008a04>] (kernel_)
[ 1.930000] [<c0008a04>] (kernel_init+0x3c/0x8c) from [<c002ac98>] (kernel_t)
[ 9.930000] BUG: spinlock lockup on CPU#0, swapper/1, c7852508
[ 9.930000] [<c002fdc8>] (unwind_backtrace+0x0/0xe0) from [<c01679c8>] (__sp)
[ 9.940000] [<c01679c8>] (__spin_lock_debug+0x88/0x9c) from [<c0167a54>] (_r)
[ 9.940000] [<c0167a54>] (_raw_spin_lock+0x78/0x98) from [<c020ac40>] (dev_u)
[ 9.950000] [<c020ac40>] (dev_unicast_init+0x18/0x3c) from [<c020ebf8>] (all)
[ 9.960000] [<c020ebf8>] (alloc_netdev_mq+0xbc/0x13c) from [<c001b210>] (loo)
[ 9.970000] [<c001b210>] (loopback_net_init+0x1c/0x70) from [<c02096e4>] (re)
[ 9.980000] [<c02096e4>] (register_pernet_operations+0x20/0x2c) from [<c0209)
[ 9.990000] [<c0209778>] (register_pernet_device+0x20/0x54) from [<c001cbbc>)
[ 10.000000] [<c001cbbc>] (net_dev_init+0xd0/0x15c) from [<c0029274>] (do_one)
[ 10.010000] [<c0029274>] (do_one_initcall+0x4c/0x174) from [<c0008640>] (do_)
[ 10.020000] [<c0008640>] (do_initcalls+0x1c/0x38) from [<c0008a04>] (kernel_)
[ 10.030000] [<c0008a04>] (kernel_init+0x3c/0x8c) from [<c002ac98>] (kernel_t)
^ permalink raw reply
* Re: [PATCH 5/5] c/r: Add AF_UNIX support (v7)
From: Serge E. Hallyn @ 2009-08-05 13:29 UTC (permalink / raw)
To: Dan Smith; +Cc: containers, Alexey Dobriyan, netdev
In-Reply-To: <8763d3dwmx.fsf@caffeine.danplanet.com>
Quoting Dan Smith (danms@us.ibm.com):
> SH> why only free iov_base if ret!=0?
>
> Because I was diagnosing a crash that only seemed to happen when I
> free()'d the buffer after it was used by sendmsg() and I forgot to
> remove this :(
>
> >> + a->sk_peercred.pid = task_tgid_vnr(current);
> >> + a->sk_peercred.uid = ctx->realcred->uid;
>
> SH> I don't know how much it matters, but of course root could be
> SH> restarting a set of tasks owned by several non-root uids, and the
> SH> peercred.uid's might need to be something other than
> ctx-> realcred->uid. Or not?
>
> Oh, so you're suggesting I use ctx->ecred instead? I didn't actually
> notice the double declaration in the ckpt_ctx, but I guess that would
> be better.
No, I'm suggesting that the checkpointed application might have had
tasks owned by uids 0, 3, 55, and 1001, and a.peercred.uid might have
been 1001, right? current, ctx->realcred->uid, and ctx->ecred might
all be different uids. I think you just need to checkpoint the uid
(eventually an objref to a checkpointed user struct so we can also
catch the user namespace).
-serge
^ permalink raw reply
* Confirmed Receipt
From: pdacjoyce @ 2009-08-05 13:14 UTC (permalink / raw)
To: unl
You are among the lucky people.Confirm this receipt by replying the due process unit officer:Fill the details: FullName,Address,Tel,Occupation,etc,Reply to nelsonwhitedesk004@btinternet.com
^ permalink raw reply
* Re: [RFC PATCH v1 2/2] selinux: Support for the new TUN LSM hooks
From: Eric Paris @ 2009-08-05 13:06 UTC (permalink / raw)
To: Paul Moore; +Cc: netdev, linux-security-module, selinux
In-Reply-To: <20090804212204.10798.53727.stgit@flek.lan>
On Tue, Aug 4, 2009 at 5:22 PM, Paul Moore<paul.moore@hp.com> wrote:
> Add support for the new TUN LSM hooks: security_tun_dev_create(),
> security_tun_dev_post_create() and security_tun_dev_attach(). This includes
> the addition of a new object class, tun_socket, which represents the socks
> associated with TUN devices. The _tun_dev_create() and _tun_dev_post_create()
> hooks are fairly similar to the standard socket functions but _tun_dev_attach()
> is a bit special. The _tun_dev_attach() is unique because it involves a
> domain attaching to an existing TUN device and its associated tun_socket
> object, an operation which does not exist with standard sockets and most
> closely resembles a relabel operation.
>
> This patch also includes a new policy capability, tun_perms, to ensure that
> the new access controls do not affect older SELinux policies.
I think we finally have the first patch where the 'handle_unknown'
stuff fits better than the policy capabilities work! First time for
everything! I'd suggest dropping the policy capability all together
and the checks will be applied when the class and perm is defined in
the loaded policy. If the class+perm isn't defined in policy the
policy handle_unknown setting will define the result of the security
check.
whoo hoo, saves 32bits of memory and 2 branches on low use operations!
-Eric
^ permalink raw reply
* Re: [PATCH net-next-2.6] net: Changes to support the "-f" option of ethtool.
From: Ben Hutchings @ 2009-08-05 13:06 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: davem, jgarzik, netdev
In-Reply-To: <20090805123704.GC6592@serverengines.com>
On Wed, 2009-08-05 at 18:07 +0530, Ajit Khaparde wrote:
> The patch intends to use the request_firmware() interface to pick the
> firmware image file.
> I had missed this in the original post. Thanks.
[...]
Thanks for the clarification.
request_firmware() is meant for loading firmware that is stored in
volatile memory (RAM) on the device and therefore needs to be installed
on the host.
When the firmware is stored in flash on the device, updates only need to
be used once, and there should be no need to install them on the host.
So request_firmware() does not seem suitable.
I believe the ethtool EEPROM commands were meant for updating firmware
on NICs. Although they assume random access and so are unsuitable for
flash-based firmware, they might be a better model for adding flash
update commands. However, this command set is already available through
the MTD device class, which is what we use for firmware update as far as
possible. Not only does this allow for an arbitrary number of separate
firmware partitions per network device, but it can be used in an
out-of-tree driver for older kernel versions.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [RFC PATCH v1 1/2] lsm: Add hooks to the TUN driver
From: Eric Paris @ 2009-08-05 13:03 UTC (permalink / raw)
To: Paul Moore; +Cc: netdev, linux-security-module, selinux
In-Reply-To: <20090804212158.10798.34592.stgit@flek.lan>
On Tue, Aug 4, 2009 at 5:21 PM, Paul Moore<paul.moore@hp.com> wrote:
> The TUN driver lacks any LSM hooks which makes it difficult for LSM modules,
> such as SELinux, to enforce access controls on network traffic generated by
> TUN users; this is particularly problematic for virtualization apps such as
> QEMU and KVM. This patch adds three new LSM hooks designed to control the
> creation and attachment of TUN devices, the hooks are:
>
> diff --git a/security/commoncap.c b/security/commoncap.c
> index 48b7e02..07125a6 100644
> --- a/security/commoncap.c
> +++ b/security/commoncap.c
> @@ -984,3 +984,29 @@ int cap_vm_enough_memory(struct mm_struct *mm, long pages)
> cap_sys_admin = 1;
> return __vm_enough_memory(mm, pages, cap_sys_admin);
> }
> +
> +/**
> + * cap_tun_dev_create - Determine if creation of a new TUN device is allowed
> + *
> + * Determine if the user is allowed to create a new TUN device, historically
> + * this has always required the CAP_NET_ADMIN permission.
> + */
> +int cap_tun_dev_create(void)
> +{
> + if (!capable(CAP_NET_ADMIN))
> + return -EPERM;
> + return 0;
> +}
> +
> +/**
> + * cap_tun_dev_attach - Determine if attaching to an TUN device is allowed
> + *
> + * Determine if the user is allowed to attach to an existing persistent TUN
> + * device, historically this has always required the CAP_NET_ADMIN permission.
> + */
> +int cap_tun_dev_attach(void)
> +{
> + if (!capable(CAP_NET_ADMIN))
> + return -EPERM;
> + return 0;
> +}
> diff --git a/security/security.c b/security/security.c
> index dc7674f..14ebf82 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -1112,6 +1112,24 @@ void security_inet_conn_established(struct sock *sk,
> security_ops->inet_conn_established(sk, skb);
> }
>
> +int security_tun_dev_create(void)
> +{
> + return security_ops->tun_dev_create();
> +}
> +EXPORT_SYMBOL(security_tun_dev_create);
> +
> +void security_tun_dev_post_create(struct sock *tun_sk)
> +{
> + return security_ops->tun_dev_post_create(tun_sk);
> +}
> +EXPORT_SYMBOL(security_tun_dev_post_create);
> +
> +int security_tun_dev_attach(struct sock *tun_sk)
> +{
> + return security_ops->tun_dev_attach(tun_sk);
> +}
> +EXPORT_SYMBOL(security_tun_dev_attach);
> +
> #endif /* CONFIG_SECURITY_NETWORK */
>
> #ifdef CONFIG_SECURITY_NETWORK_XFRM
You also must add cap_tun_dev_post_create in security/capability.c and
you need to call set_to_cap_if_null() for all 3 of these new
functions. I believe you'll see a wonderful null pointer panic if you
tried with selinux=0.....
-Eric
^ permalink raw reply
* Re: [PATCH] ethtool: Add "-f" option to flash firmware image to a network device.
From: Ben Hutchings @ 2009-08-05 12:48 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: davem, jgarzik, netdev
In-Reply-To: <20090805123143.GA6592@serverengines.com>
On Wed, 2009-08-05 at 18:01 +0530, Ajit Khaparde wrote:
> Attached is a patch for ethtool utility to add a new "-f" option.
> This will enable flashing a firmware image to a network interface.
Which firmware? There can be several firmware images for controller,
PHY, host boot "ROM" and others.
[...]
> @@ -2398,6 +2404,20 @@ static int do_grxclass(int fd, struct ifreq
> *ifr)
> return 0;
> }
>
> +static int do_flash(int fd, struct ifreq *ifr)
> +{
> + int err;
> + struct ethtool_value ecmd;
> +
> + ecmd.cmd = ETHTOOL_FLASHDEV;
> + ifr->ifr_data = (caddr_t)&ecmd;
> + err = send_ioctl(fd, ifr);
> + if (err < 0)
> + perror("Flashing failed");
[..]
Where does the image come from? The running code? What about static
variables that have changed since startup?
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next-2.6] net: Changes to support the "-f" option of ethtool.
From: Ajit Khaparde @ 2009-08-05 12:37 UTC (permalink / raw)
To: davem, jgarzik, netdev
In-Reply-To: <20090805123211.GB6592@serverengines.com>
The patch intends to use the request_firmware() interface to pick the
firmware image file.
I had missed this in the original post. Thanks.
On 05/08/09 18:02 +0530, Ajit Khaparde wrote:
> This patch adds kernel support for the new "-f" option in ethtool,
> This will allow a firmware image to be flashed to a network device.
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
> ---
> include/linux/ethtool.h | 3 +++
> net/core/ethtool.c | 13 +++++++++++++
> 2 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 90c4a36..9b92f44 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -489,6 +489,7 @@ struct ethtool_ops {
> int (*get_stats_count)(struct net_device *);/* use get_sset_count */
> int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *);
> int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
> + int (*flash_device)(struct net_device *);
> };
> #endif /* __KERNEL__ */
>
> @@ -545,6 +546,8 @@ struct ethtool_ops {
> #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
> #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
> #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
> +#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device
> + * (ethtool_value). */
>
> /* compatibility with older code */
> #define SPARC_ETH_GSET ETHTOOL_GSET
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 44e5711..0524201 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -898,6 +898,16 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr,
> return actor(dev, edata.data);
> }
>
> +static int ethtool_flash_device(struct net_device *dev)
> +{
> + int err;
> +
> + if (!dev->ethtool_ops->flash_device)
> + return -EOPNOTSUPP;
> +
> + return dev->ethtool_ops->flash_device(dev);
> +}
> +
> /* The main entry point in this file. Called from net/core/dev.c */
>
> int dev_ethtool(struct net *net, struct ifreq *ifr)
> @@ -1111,6 +1121,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
> case ETHTOOL_SGRO:
> rc = ethtool_set_gro(dev, useraddr);
> break;
> + case ETHTOOL_FLASHDEV:
> + rc = ethtool_flash_device(dev);
> + break;
> default:
> rc = -EOPNOTSUPP;
> }
> --
> 1.6.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 1/2] net/rds: Use AF_INET for sin_family field
From: Julia Lawall @ 2009-08-05 12:34 UTC (permalink / raw)
To: David S. Miller, Andy Grover, netdev, rds-devel, linux-kernel,
kernel-janitors
From: Julia Lawall <julia@diku.dk>
Elsewhere the sin_family field holds a value with a name of the form
AF_..., so it seems reasonable to do so here as well. Also the values of
PF_INET and AF_INET are the same.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
struct sockaddr_in sip;
@@
(
sip.sin_family ==
- PF_INET
+ AF_INET
|
sip.sin_family !=
- PF_INET
+ AF_INET
|
sip.sin_family =
- PF_INET
+ AF_INET
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
net/rds/rdma_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -u -p a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -137,7 +137,7 @@ static int __init rds_rdma_listen_init(v
goto out;
}
- sin.sin_family = PF_INET,
+ sin.sin_family = AF_INET,
sin.sin_addr.s_addr = (__force u32)htonl(INADDR_ANY);
sin.sin_port = (__force u16)htons(RDS_PORT);
^ permalink raw reply
* [PATCH net-next-2.6] net: Changes to support the "-f" option of ethtool.
From: Ajit Khaparde @ 2009-08-05 12:32 UTC (permalink / raw)
To: davem, jgarzik, netdev
This patch adds kernel support for the new "-f" option in ethtool,
This will allow a firmware image to be flashed to a network device.
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
include/linux/ethtool.h | 3 +++
net/core/ethtool.c | 13 +++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 90c4a36..9b92f44 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -489,6 +489,7 @@ struct ethtool_ops {
int (*get_stats_count)(struct net_device *);/* use get_sset_count */
int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *);
int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
+ int (*flash_device)(struct net_device *);
};
#endif /* __KERNEL__ */
@@ -545,6 +546,8 @@ struct ethtool_ops {
#define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
+#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device
+ * (ethtool_value). */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 44e5711..0524201 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -898,6 +898,16 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr,
return actor(dev, edata.data);
}
+static int ethtool_flash_device(struct net_device *dev)
+{
+ int err;
+
+ if (!dev->ethtool_ops->flash_device)
+ return -EOPNOTSUPP;
+
+ return dev->ethtool_ops->flash_device(dev);
+}
+
/* The main entry point in this file. Called from net/core/dev.c */
int dev_ethtool(struct net *net, struct ifreq *ifr)
@@ -1111,6 +1121,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
case ETHTOOL_SGRO:
rc = ethtool_set_gro(dev, useraddr);
break;
+ case ETHTOOL_FLASHDEV:
+ rc = ethtool_flash_device(dev);
+ break;
default:
rc = -EOPNOTSUPP;
}
--
1.6.0.4
^ permalink raw reply related
* [PATCH] ethtool: Add "-f" option to flash firmware image to a network device.
From: Ajit Khaparde @ 2009-08-05 12:31 UTC (permalink / raw)
To: davem, jgarzik, netdev
Attached is a patch for ethtool utility to add a new "-f" option.
This will enable flashing a firmware image to a network interface.
Usage:
ethtool -f <interface name>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
ethtool-copy.h | 1 +
ethtool.c | 22 +++++++++++++++++++++-
2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 3ca4e2c..49b741b 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -338,6 +338,7 @@ struct ethtool_rxnfc {
#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
#define ETHTOOL_GGRO 0x0000002b /* Get GRO enable (ethtool_value) */
#define ETHTOOL_SGRO 0x0000002c /* Set GRO enable (ethtool_value) */
+#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware (ethtool_value) */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/ethtool.c b/ethtool.c
index 0110682..fedb3a2 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -77,6 +77,7 @@ static char *unparse_rxfhashopts(u64 opts);
static int dump_rxfhash(int fhash, u64 val);
static int do_srxclass(int fd, struct ifreq *ifr);
static int do_grxclass(int fd, struct ifreq *ifr);
+static int do_flash(int fd, struct ifreq *ifr);
static int send_ioctl(int fd, struct ifreq *ifr);
static enum {
@@ -101,6 +102,7 @@ static enum {
MODE_GSTATS,
MODE_GNFC,
MODE_SNFC,
+ MODE_FLASHDEV,
} mode = MODE_GSET;
static struct option {
@@ -192,6 +194,7 @@ static struct option {
"classification options",
" [ rx-flow-hash tcp4|udp4|ah4|sctp4|"
"tcp6|udp6|ah6|sctp6 p|m|v|t|s|d|f|n|r... ]\n" },
+ { "-f", "--flash", MODE_FLASHDEV, "Flash firmware to device" },
{ "-h", "--help", MODE_HELP, "Show this help" },
{}
};
@@ -496,7 +499,8 @@ static void parse_cmdline(int argc, char **argp)
(mode == MODE_GSTATS) ||
(mode == MODE_GNFC) ||
(mode == MODE_SNFC) ||
- (mode == MODE_PHYS_ID)) {
+ (mode == MODE_PHYS_ID) ||
+ (mode == MODE_FLASHDEV)) {
devname = argp[i];
break;
}
@@ -1504,6 +1508,8 @@ static int doit(void)
return do_grxclass(fd, &ifr);
} else if (mode == MODE_SNFC) {
return do_srxclass(fd, &ifr);
+ } else if (mode == MODE_FLASHDEV) {
+ return do_flash(fd, &ifr);
}
return 69;
@@ -2398,6 +2404,20 @@ static int do_grxclass(int fd, struct ifreq *ifr)
return 0;
}
+static int do_flash(int fd, struct ifreq *ifr)
+{
+ int err;
+ struct ethtool_value ecmd;
+
+ ecmd.cmd = ETHTOOL_FLASHDEV;
+ ifr->ifr_data = (caddr_t)&ecmd;
+ err = send_ioctl(fd, ifr);
+ if (err < 0)
+ perror("Flashing failed");
+
+ return err;
+}
+
static int send_ioctl(int fd, struct ifreq *ifr)
{
return ioctl(fd, SIOCETHTOOL, ifr);
--
1.6.0.4
^ permalink raw reply related
* Re: Kernel oops on setting sky2 interfaces down
From: Rene Mayrhofer @ 2009-08-05 12:14 UTC (permalink / raw)
To: Mike McCormack; +Cc: netdev, Richard Leitner, Stephen Hemminger
In-Reply-To: <4A78CA13.6040409@ring3k.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mike McCormack wrote:
>> Again, any hints would be greatly appreciated (and sorry for being
>> persistent about this annoying little bug...).
>
> Thanks for being persistent in testing :-) Looks like you've got a
> fairly unusual piece of hardware, as Stephen indicated.
Indeed, although I didn't think it _that_ unusual. It's just a 19" rack
appliance with 2 expansion slots for 4x LAN ports each. And those are
based around sky2.
But we have had problems before with kernel 2.4.34/.36 as well with that
hardware. They just weren't as easily reproducible but manifested
themselves in occasional malfunctions of the network devices that could
be solved by an ifdown/ifup cycle.
We still have one spare box and will try that one in case the hardware
is really flaky (which would be strange, given how reproducible it is
right now).
> Would you mind adding the phy_lock fix on top of the latest net-2.6
> git version of sky2 and testing that?
Tried it, doesn't fix the issue.
What would be the simplest change to stop disabling phy when the last
device goes down?
best regards,
Rene
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkp5d6AACgkQq7SPDcPCS95OuACggTuTHsZd7m6IqHt0mrqUZbju
G4wAoPfPGr5G05E6HdO9kcKflGaSx7f5
=78yk
-----END PGP SIGNATURE-----
^ 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