* Re: [PATCH 2/2] [CRYPTO] users: Fix up scatterlist conversion errors
From: David Miller @ 2007-10-27 7:52 UTC (permalink / raw)
To: herbert; +Cc: linux-kernel, linux-crypto, netdev
In-Reply-To: <E1IlQfN-0003cW-00@gondolin.me.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 26 Oct 2007 23:00:05 +0800
> [CRYPTO] users: Fix up scatterlist conversion errors
>
> This patch fixes the errors made in the users of the crypto layer during
> the sg_init_table conversion. It also adds a few conversions that were
> missing altogether.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Also applied, thanks Herbert!
^ permalink raw reply
* Re: [0/3] Distributed storage. Mirror algo extension for automatic recovery.
From: Evgeniy Polyakov @ 2007-10-27 10:34 UTC (permalink / raw)
To: Andrew Morton; +Cc: netdev, linux-kernel, linux-fsdevel
In-Reply-To: <20071026135538.d22125a2.akpm@linux-foundation.org>
Hi Andrew.
On Fri, Oct 26, 2007 at 01:55:38PM -0700, Andrew Morton (akpm@linux-foundation.org) wrote:
> > I'm pleased to announce sixth release of the distributed storage
> > subsystem, which allows to form a storage on top of remote and local
> > nodes, which in turn can be exported to another storage as a node to
> > form tree-like storages.
>
> I went back and re-read last month's discussion and I'm not seeing any
> reason why we shouldn't start thinking about merging this.
>
> How close is it to that stage? A peek at your development blog indicates
> that things are still changing at a moderate rate?
I completed storage layer development itself, the only remaining todo item
is to implement new redundancy algorithm, but I did not see major demand
on that, so it will stay for now with low priority.
I will use DST as a transport layer for distributed filesystem, and
probably that will require additional features, I have no clean design so
far, but right now I have nothing in the pipe to commit to DST.
--
Evgeniy Polyakov
^ permalink raw reply
* [PATCH 5/5][ATM]: [br2864] whitespace cleanup
From: chas williams - CONTRACTOR @ 2007-10-27 12:44 UTC (permalink / raw)
To: netdev; +Cc: davem
commit 6b11f93a718dc916198feb1099ae0cef39ce3936
Author: Chas Williams <chas@vger.cmf.nrl.navy.mil>
Date: Sat Oct 27 08:33:40 2007 -0400
[ATM]: [br2864] whitespace cleanup
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index ccdab6c..52bf72a 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -15,7 +15,7 @@
#define BR2684_MEDIA_802_6 (4) /* 802.6 */
/* used only at device creation: */
-#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
+#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
/*
* Is there FCS inbound on this VC? This currently isn't supported.
@@ -45,17 +45,16 @@
#define BR2684_PAYLOAD_ROUTED (0)
#define BR2684_PAYLOAD_BRIDGED (1)
-
/*
* This is for the ATM_NEWBACKENDIF call - these are like socket families:
* the first element of the structure is the backend number and the rest
* is per-backend specific
*/
struct atm_newif_br2684 {
- atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
- int media; /* BR2684_MEDIA_*, flags in upper bits */
- char ifname[IFNAMSIZ];
- int mtu;
+ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+ int media; /* BR2684_MEDIA_*, flags in upper bits */
+ char ifname[IFNAMSIZ];
+ int mtu;
};
/*
@@ -66,10 +65,10 @@ struct atm_newif_br2684 {
#define BR2684_FIND_BYNUM (1)
#define BR2684_FIND_BYIFNAME (2)
struct br2684_if_spec {
- int method; /* BR2684_FIND_* */
+ int method; /* BR2684_FIND_* */
union {
- char ifname[IFNAMSIZ];
- int devnum;
+ char ifname[IFNAMSIZ];
+ int devnum;
} spec;
};
@@ -79,16 +78,16 @@ struct br2684_if_spec {
* is per-backend specific
*/
struct atm_backend_br2684 {
- atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
+ atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
struct br2684_if_spec ifspec;
- int fcs_in; /* BR2684_FCSIN_* */
- int fcs_out; /* BR2684_FCSOUT_* */
- int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
- int encaps; /* BR2684_ENCAPS_* */
- int has_vpiid; /* 1: use vpn_id - Unsupported */
- __u8 vpn_id[7];
- int send_padding; /* unsupported */
- int min_size; /* we will pad smaller packets than this */
+ int fcs_in; /* BR2684_FCSIN_* */
+ int fcs_out; /* BR2684_FCSOUT_* */
+ int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */
+ int encaps; /* BR2684_ENCAPS_* */
+ int has_vpiid; /* 1: use vpn_id - Unsupported */
+ __u8 vpn_id[7];
+ int send_padding; /* unsupported */
+ int min_size; /* we will pad smaller packets than this */
};
/*
@@ -97,8 +96,8 @@ struct atm_backend_br2684 {
* efficient per-if in/out filters, this support will be removed
*/
struct br2684_filter {
- __be32 prefix; /* network byte order */
- __be32 netmask; /* 0 = disable filter */
+ __be32 prefix; /* network byte order */
+ __be32 netmask; /* 0 = disable filter */
};
struct br2684_filter_set {
@@ -107,8 +106,8 @@ struct br2684_filter_set {
};
enum br2684_payload {
- p_routed = BR2684_PAYLOAD_ROUTED,
- p_bridged = BR2684_PAYLOAD_BRIDGED,
+ p_routed = BR2684_PAYLOAD_ROUTED,
+ p_bridged = BR2684_PAYLOAD_BRIDGED,
};
#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index d9bb2a1..f5a3794 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -1,9 +1,10 @@
/*
-Ethernet netdevice using ATM AAL5 as underlying carrier
-(RFC1483 obsoleted by RFC2684) for Linux
-Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
- Eric Kinzie, 2006-2007, US Naval Research Laboratory
-*/
+ * Ethernet netdevice using ATM AAL5 as underlying carrier
+ * (RFC1483 obsoleted by RFC2684) for Linux
+ *
+ * Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
+ * Eric Kinzie, 2006-2007, US Naval Research Laboratory
+ */
#include <linux/module.h>
#include <linux/init.h>
@@ -51,28 +52,24 @@ static void skb_debug(const struct sk_buff *skb)
#define ETHERTYPE_IPV6 0x86, 0xdd
#define PAD_BRIDGED 0x00, 0x00
-static unsigned char ethertype_ipv4[] =
- { ETHERTYPE_IPV4 };
-static unsigned char ethertype_ipv6[] =
- { ETHERTYPE_IPV6 };
+static unsigned char ethertype_ipv4[] = { ETHERTYPE_IPV4 };
+static unsigned char ethertype_ipv6[] = { ETHERTYPE_IPV6 };
static unsigned char llc_oui_pid_pad[] =
- { LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
-static unsigned char llc_oui_ipv4[] =
- { LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
-static unsigned char llc_oui_ipv6[] =
- { LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
+ { LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
+static unsigned char llc_oui_ipv4[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
+static unsigned char llc_oui_ipv6[] = { LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
enum br2684_encaps {
- e_vc = BR2684_ENCAPS_VC,
+ e_vc = BR2684_ENCAPS_VC,
e_llc = BR2684_ENCAPS_LLC,
};
struct br2684_vcc {
- struct atm_vcc *atmvcc;
+ struct atm_vcc *atmvcc;
struct net_device *device;
- /* keep old push,pop functions for chaining */
- void (*old_push)(struct atm_vcc *vcc,struct sk_buff *skb);
- /* void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb); */
+ /* keep old push, pop functions for chaining */
+ void (*old_push) (struct atm_vcc * vcc, struct sk_buff * skb);
+ /* void (*old_pop)(struct atm_vcc *vcc, struct sk_buff *skb); */
enum br2684_encaps encaps;
struct list_head brvccs;
#ifdef CONFIG_ATM_BR2684_IPFILTER
@@ -85,7 +82,7 @@ struct br2684_dev {
struct net_device *net_dev;
struct list_head br2684_devs;
int number;
- struct list_head brvccs; /* one device <=> one vcc (before xmas) */
+ struct list_head brvccs; /* one device <=> one vcc (before xmas) */
struct net_device_stats stats;
int mac_was_set;
enum br2684_payload payload;
@@ -104,7 +101,7 @@ static LIST_HEAD(br2684_devs);
static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev)
{
- return (struct br2684_dev *) net_dev->priv;
+ return (struct br2684_dev *)net_dev->priv;
}
static inline struct net_device *list_entry_brdev(const struct list_head *le)
@@ -114,7 +111,7 @@ static inline struct net_device *list_entry_brdev(const struct list_head *le)
static inline struct br2684_vcc *BR2684_VCC(const struct atm_vcc *atmvcc)
{
- return (struct br2684_vcc *) (atmvcc->user_back);
+ return (struct br2684_vcc *)(atmvcc->user_back);
}
static inline struct br2684_vcc *list_entry_brvcc(const struct list_head *le)
@@ -152,7 +149,7 @@ static struct net_device *br2684_find_dev(const struct br2684_if_spec *s)
* otherwise false
*/
static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
- struct br2684_vcc *brvcc)
+ struct br2684_vcc *brvcc)
{
struct atm_vcc *atmvcc;
int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
@@ -171,21 +168,24 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
if (brvcc->encaps == e_llc) {
if (brdev->payload == p_bridged) {
skb_push(skb, sizeof(llc_oui_pid_pad));
- skb_copy_to_linear_data(skb, llc_oui_pid_pad, sizeof(llc_oui_pid_pad));
+ skb_copy_to_linear_data(skb, llc_oui_pid_pad,
+ sizeof(llc_oui_pid_pad));
} else if (brdev->payload == p_routed) {
unsigned short prot = ntohs(skb->protocol);
skb_push(skb, sizeof(llc_oui_ipv4));
switch (prot) {
- case ETH_P_IP:
- skb_copy_to_linear_data(skb, llc_oui_ipv4, sizeof(llc_oui_ipv4));
- break;
- case ETH_P_IPV6:
- skb_copy_to_linear_data(skb, llc_oui_ipv6, sizeof(llc_oui_ipv6));
- break;
- default:
- dev_kfree_skb(skb);
- return 0;
+ case ETH_P_IP:
+ skb_copy_to_linear_data(skb, llc_oui_ipv4,
+ sizeof(llc_oui_ipv4));
+ break;
+ case ETH_P_IPV6:
+ skb_copy_to_linear_data(skb, llc_oui_ipv6,
+ sizeof(llc_oui_ipv6));
+ break;
+ default:
+ dev_kfree_skb(skb);
+ return 0;
}
}
} else {
@@ -198,13 +198,14 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
if (!atm_may_send(atmvcc, skb->truesize)) {
- /* we free this here for now, because we cannot know in a higher
- layer whether the skb point it supplied wasn't freed yet.
- now, it always is.
- */
+ /*
+ * We free this here for now, because we cannot know in a higher
+ * layer whether the skb pointer it supplied wasn't freed yet.
+ * Now, it always is.
+ */
dev_kfree_skb(skb);
return 0;
- }
+ }
atomic_add(skb->truesize, &sk_atm(atmvcc)->sk_wmem_alloc);
ATM_SKB(skb)->atm_options = atmvcc->atm_options;
brdev->stats.tx_packets++;
@@ -214,10 +215,9 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
}
static inline struct br2684_vcc *pick_outgoing_vcc(struct sk_buff *skb,
- struct br2684_dev *brdev)
+ struct br2684_dev *brdev)
{
- return list_empty(&brdev->brvccs) ? NULL :
- list_entry_brvcc(brdev->brvccs.next); /* 1 vcc/dev right now */
+ return list_empty(&brdev->brvccs) ? NULL : list_entry_brvcc(brdev->brvccs.next); /* 1 vcc/dev right now */
}
static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -241,11 +241,10 @@ static int br2684_start_xmit(struct sk_buff *skb, struct net_device *dev)
/*
* We should probably use netif_*_queue() here, but that
* involves added complication. We need to walk before
- * we can run
+ * we can run.
+ *
+ * Don't free here! this pointer might be no longer valid!
*/
- /* don't free here! this pointer might be no longer valid!
- dev_kfree_skb(skb);
- */
brdev->stats.tx_errors++;
brdev->stats.tx_fifo_errors++;
}
@@ -259,12 +258,11 @@ static struct net_device_stats *br2684_get_stats(struct net_device *dev)
return &BRPRIV(dev)->stats;
}
-
/*
* We remember when the MAC gets set, so we don't override it later with
* the ESI of the ATM card of the first VC
*/
-static int (*my_eth_mac_addr)(struct net_device *, void *);
+static int (*my_eth_mac_addr) (struct net_device *, void *);
static int br2684_mac_addr(struct net_device *dev, void *p)
{
int err = my_eth_mac_addr(dev, p);
@@ -275,7 +273,7 @@ static int br2684_mac_addr(struct net_device *dev, void *p)
#ifdef CONFIG_ATM_BR2684_IPFILTER
/* this IOCTL is experimental. */
-static int br2684_setfilt(struct atm_vcc *atmvcc, void __user *arg)
+static int br2684_setfilt(struct atm_vcc *atmvcc, void __user * arg)
{
struct br2684_vcc *brvcc;
struct br2684_filter_set fs;
@@ -285,13 +283,12 @@ static int br2684_setfilt(struct atm_vcc *atmvcc, void __user *arg)
if (fs.ifspec.method != BR2684_FIND_BYNOTHING) {
/*
* This is really a per-vcc thing, but we can also search
- * by device
+ * by device.
*/
struct br2684_dev *brdev;
read_lock(&devs_lock);
brdev = BRPRIV(br2684_find_dev(&fs.ifspec));
- if (brdev == NULL || list_empty(&brdev->brvccs) ||
- brdev->brvccs.next != brdev->brvccs.prev) /* >1 VCC */
+ if (brdev == NULL || list_empty(&brdev->brvccs) || brdev->brvccs.next != brdev->brvccs.prev) /* >1 VCC */
brvcc = NULL;
else
brvcc = list_entry_brvcc(brdev->brvccs.next);
@@ -309,15 +306,16 @@ static inline int
packet_fails_filter(__be16 type, struct br2684_vcc *brvcc, struct sk_buff *skb)
{
if (brvcc->filter.netmask == 0)
- return 0; /* no filter in place */
+ return 0; /* no filter in place */
if (type == htons(ETH_P_IP) &&
- (((struct iphdr *) (skb->data))->daddr & brvcc->filter.
+ (((struct iphdr *)(skb->data))->daddr & brvcc->filter.
netmask) == brvcc->filter.prefix)
return 0;
if (type == htons(ETH_P_ARP))
return 0;
- /* TODO: we should probably filter ARPs too.. don't want to have
- * them returning values that don't make sense, or is that ok?
+ /*
+ * TODO: we should probably filter ARPs too.. don't want to have
+ * them returning values that don't make sense, or is that ok?
*/
return 1; /* drop */
}
@@ -367,10 +365,17 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
/* accept packets that have "ipv[46]" in the snap header */
if ((skb->len >= (sizeof(llc_oui_ipv4)))
- && (memcmp(skb->data, llc_oui_ipv4, sizeof(llc_oui_ipv4) - BR2684_ETHERTYPE_LEN) == 0)) {
- if (memcmp(skb->data + 6, ethertype_ipv6, sizeof(ethertype_ipv6)) == 0)
+ &&
+ (memcmp
+ (skb->data, llc_oui_ipv4,
+ sizeof(llc_oui_ipv4) - BR2684_ETHERTYPE_LEN) == 0)) {
+ if (memcmp
+ (skb->data + 6, ethertype_ipv6,
+ sizeof(ethertype_ipv6)) == 0)
skb->protocol = __constant_htons(ETH_P_IPV6);
- else if (memcmp(skb->data + 6, ethertype_ipv4, sizeof(ethertype_ipv4)) == 0)
+ else if (memcmp
+ (skb->data + 6, ethertype_ipv4,
+ sizeof(ethertype_ipv4)) == 0)
skb->protocol = __constant_htons(ETH_P_IP);
else {
brdev->stats.rx_errors++;
@@ -380,12 +385,13 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
skb_pull(skb, sizeof(llc_oui_ipv4));
skb_reset_network_header(skb);
skb->pkt_type = PACKET_HOST;
-
- /* let us waste some time for checking the encapsulation.
- Note, that only 7 char is checked so frames with a valid FCS
- are also accepted (but FCS is not checked of course) */
+ /*
+ * Let us waste some time for checking the encapsulation.
+ * Note, that only 7 char is checked so frames with a valid FCS
+ * are also accepted (but FCS is not checked of course).
+ */
} else if ((skb->len >= sizeof(llc_oui_pid_pad)) &&
- (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
+ (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
skb_pull(skb, sizeof(llc_oui_pid_pad));
skb->protocol = eth_type_trans(skb, net_dev);
} else {
@@ -401,7 +407,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
dev_kfree_skb(skb);
return;
}
- skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */
+ skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */
skb->protocol = eth_type_trans(skb, net_dev);
}
@@ -428,11 +434,12 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
netif_rx(skb);
}
-static int br2684_regvcc(struct atm_vcc *atmvcc, void __user *arg)
+/*
+ * Assign a vcc to a dev
+ * Note: we do not have explicit unassign, but look at _push()
+ */
+static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
{
-/* assign a vcc to a dev
-Note: we do not have explicit unassign, but look at _push()
-*/
int err;
struct br2684_vcc *brvcc;
struct sk_buff *skb;
@@ -451,7 +458,7 @@ Note: we do not have explicit unassign, but look at _push()
net_dev = br2684_find_dev(&be.ifspec);
if (net_dev == NULL) {
printk(KERN_ERR
- "br2684: tried to attach to non-existant device\n");
+ "br2684: tried to attach to non-existant device\n");
err = -ENXIO;
goto error;
}
@@ -467,13 +474,15 @@ Note: we do not have explicit unassign, but look at _push()
}
if (be.fcs_in != BR2684_FCSIN_NO || be.fcs_out != BR2684_FCSOUT_NO ||
be.fcs_auto || be.has_vpiid || be.send_padding || (be.encaps !=
- BR2684_ENCAPS_VC && be.encaps != BR2684_ENCAPS_LLC) ||
- be.min_size != 0) {
+ BR2684_ENCAPS_VC
+ && be.encaps !=
+ BR2684_ENCAPS_LLC)
+ || be.min_size != 0) {
err = -EINVAL;
goto error;
}
- pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps,
- brvcc);
+ pr_debug("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc,
+ be.encaps, brvcc);
if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
unsigned char *esi = atmvcc->dev->esi;
if (esi[0] | esi[1] | esi[2] | esi[3] | esi[4] | esi[5])
@@ -486,7 +495,7 @@ Note: we do not have explicit unassign, but look at _push()
brvcc->device = net_dev;
brvcc->atmvcc = atmvcc;
atmvcc->user_back = brvcc;
- brvcc->encaps = (enum br2684_encaps) be.encaps;
+ brvcc->encaps = (enum br2684_encaps)be.encaps;
brvcc->old_push = atmvcc->push;
barrier();
atmvcc->push = br2684_push;
@@ -517,7 +526,7 @@ Note: we do not have explicit unassign, but look at _push()
}
__module_get(THIS_MODULE);
return 0;
- error:
+ error:
write_unlock_irq(&devs_lock);
kfree(brvcc);
return err;
@@ -556,7 +565,7 @@ static void br2684_setup_routed(struct net_device *netdev)
INIT_LIST_HEAD(&brdev->brvccs);
}
-static int br2684_create(void __user *arg)
+static int br2684_create(void __user * arg)
{
int err;
struct net_device *netdev;
@@ -574,7 +583,7 @@ static int br2684_create(void __user *arg)
payload = p_routed;
else
payload = p_bridged;
- ni.media &= 0xffff; /* strip flags */
+ ni.media &= 0xffff; /* strip flags */
if (ni.media != BR2684_MEDIA_ETHERNET || ni.mtu != 1500) {
return -EINVAL;
@@ -583,7 +592,7 @@ static int br2684_create(void __user *arg)
netdev = alloc_netdev(sizeof(struct br2684_dev),
ni.ifname[0] ? ni.ifname : "nas%d",
(payload == p_routed) ?
- br2684_setup_routed : br2684_setup);
+ br2684_setup_routed : br2684_setup);
if (!netdev)
return -ENOMEM;
@@ -612,16 +621,16 @@ static int br2684_create(void __user *arg)
* -ENOIOCTLCMD for any unrecognized ioctl
*/
static int br2684_ioctl(struct socket *sock, unsigned int cmd,
- unsigned long arg)
+ unsigned long arg)
{
struct atm_vcc *atmvcc = ATM_SD(sock);
void __user *argp = (void __user *)arg;
+ atm_backend_t b;
int err;
- switch(cmd) {
+ switch (cmd) {
case ATM_SETBACKEND:
- case ATM_NEWBACKENDIF: {
- atm_backend_t b;
+ case ATM_NEWBACKENDIF:
err = get_user(b, (atm_backend_t __user *) argp);
if (err)
return -EFAULT;
@@ -633,7 +642,6 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
return br2684_regvcc(atmvcc, argp);
else
return br2684_create(argp);
- }
#ifdef CONFIG_ATM_BR2684_IPFILTER
case BR2684_SETFILT:
if (atmvcc->push != br2684_push)
@@ -641,6 +649,7 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
if (!capable(CAP_NET_ADMIN))
return -EPERM;
err = br2684_setfilt(atmvcc, argp);
+
return err;
#endif /* CONFIG_ATM_BR2684_IPFILTER */
}
@@ -648,19 +657,18 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
}
static struct atm_ioctl br2684_ioctl_ops = {
- .owner = THIS_MODULE,
- .ioctl = br2684_ioctl,
+ .owner = THIS_MODULE,
+ .ioctl = br2684_ioctl,
};
-
#ifdef CONFIG_PROC_FS
-static void *br2684_seq_start(struct seq_file *seq, loff_t *pos)
+static void *br2684_seq_start(struct seq_file *seq, loff_t * pos)
{
read_lock(&devs_lock);
return seq_list_start(&br2684_devs, *pos);
}
-static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t * pos)
{
return seq_list_next(v, &br2684_devs, pos);
}
@@ -673,7 +681,7 @@ static void br2684_seq_stop(struct seq_file *seq, void *v)
static int br2684_seq_show(struct seq_file *seq, void *v)
{
const struct br2684_dev *brdev = list_entry(v, struct br2684_dev,
- br2684_devs);
+ br2684_devs);
const struct net_device *net_dev = brdev->net_dev;
const struct br2684_vcc *brvcc;
DECLARE_MAC_BUF(mac);
@@ -686,20 +694,18 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
seq_printf(seq, " vcc %d.%d.%d: encaps=%s payload=%s"
- ", failed copies %u/%u"
- "\n", brvcc->atmvcc->dev->number,
- brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
- (brvcc->encaps == e_llc) ? "LLC" : "VC",
- (brdev->payload == p_bridged) ? "bridged" : "routed",
- brvcc->copies_failed,
- brvcc->copies_needed);
+ ", failed copies %u/%u"
+ "\n", brvcc->atmvcc->dev->number,
+ brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
+ (brvcc->encaps == e_llc) ? "LLC" : "VC",
+ (brdev->payload == p_bridged) ? "bridged" : "routed",
+ brvcc->copies_failed, brvcc->copies_needed);
#ifdef CONFIG_ATM_BR2684_IPFILTER
#define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte]
#define bs(var) b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)
- if (brvcc->filter.netmask != 0)
- seq_printf(seq, " filter=%d.%d.%d.%d/"
- "%d.%d.%d.%d\n",
- bs(prefix), bs(netmask));
+ if (brvcc->filter.netmask != 0)
+ seq_printf(seq, " filter=%d.%d.%d.%d/"
+ "%d.%d.%d.%d\n", bs(prefix), bs(netmask));
#undef bs
#undef b1
#endif /* CONFIG_ATM_BR2684_IPFILTER */
@@ -709,9 +715,9 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
static const struct seq_operations br2684_seq_ops = {
.start = br2684_seq_start,
- .next = br2684_seq_next,
- .stop = br2684_seq_stop,
- .show = br2684_seq_show,
+ .next = br2684_seq_next,
+ .stop = br2684_seq_stop,
+ .show = br2684_seq_show,
};
static int br2684_proc_open(struct inode *inode, struct file *file)
@@ -720,15 +726,15 @@ static int br2684_proc_open(struct inode *inode, struct file *file)
}
static const struct file_operations br2684_proc_ops = {
- .owner = THIS_MODULE,
- .open = br2684_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
+ .owner = THIS_MODULE,
+ .open = br2684_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
.release = seq_release,
};
extern struct proc_dir_entry *atm_proc_root; /* from proc.c */
-#endif
+#endif /* CONFIG_PROC_FS */
static int __init br2684_init(void)
{
^ permalink raw reply related
* Re: [PATCH] ucc_geth: add support for netpoll
From: Sergei Shtylyov @ 2007-10-27 13:09 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: netdev, linuxppc-dev, leoli, linux-kernel
In-Reply-To: <20071011124842.GB13963@localhost.localdomain>
Hello.
Anton Vorontsov wrote:
> This patch adds netpoll support for the QE UCC Gigabit Ethernet
> driver. The approach is very similar to the gianfar driver.
It's rather contrarywise -- this is standard approach and gianfar with its
3 TSEC IRQs has a quite non-standard poll_controller() implementation.
> Tested using netconsole.
KGDBoE is considered a better test (I hope you've also tested with it).
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> index 18a6f48..06807ce 100644
> --- a/drivers/net/ucc_geth.c
> +++ b/drivers/net/ucc_geth.c
> @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
> return IRQ_HANDLED;
> }
>
> +#ifdef CONFIG_NET_POLL_CONTROLLER
> +/*
> + * Polling 'interrupt' - used by things like netconsole to send skbs
> + * without having to re-enable interrupts. It's not called while
> + * the interrupt routine is executing.
> + */
> +static void ucc_netpoll(struct net_device *dev)
> +{
> + struct ucc_geth_private *ugeth = netdev_priv(dev);
> +
> + disable_irq(ugeth->ug_info->uf_info.irq);
> + ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> + enable_irq(ugeth->ug_info->uf_info.irq);
Why not make it less complex (for a reader and gcc too :-) ?
struct ucc_geth_private *ugeth = netdev_priv(dev);
int irq = ugeth->ug_info->uf_info.irq;
disable_irq(irq);
ucc_geth_irq_handler(irq, dev);
enable_irq(irq);
> +}
> +#endif /* CONFIG_NET_POLL_CONTROLLER */
> +
> /* Called when something needs to use the ethernet device */
> /* Returns 0 for success. */
> static int ucc_geth_open(struct net_device *dev)
WBR, Sergei
^ permalink raw reply
* ASUS NX1001 (IP100A, sundance) PHY not powered up
From: Yanko Kaneti @ 2007-10-27 13:04 UTC (permalink / raw)
To: netdev; +Cc: romieu, sorbica, jesse
Hi,
Trying a new ASUS NX1001 adapter (1043:8213) with a IP100A chip
(13f0:0200) (rev 31) on a machine running Fedora development (2.6.23.1 +
some unrelated to sundance patches).
On power up the link appears down (judging by the switch port its
connected to). The normal fedora startup has udev which loads the
sundance driver, dmesg says it has done so, the link still down.
rmmod sundance - still down.
modprobe sundance - still down.
rmmod sundance - link up
modprobe sundance - link down
rmmod sundance - link up
..
?
All these with no indication of error in the logs.
Same make adapter from the same batch appears to function under win2k
after loading the driver from the cd. Again the link appears to be
powered up when the driver is loaded.
The LED on the card is only active on data activity not link status.
Puzzled
Yanko
^ permalink raw reply
* [PATCH 3/5][ATM]: [he] This patch removes the ancient version string.
From: chas williams - CONTRACTOR @ 2007-10-27 12:41 UTC (permalink / raw)
To: netdev; +Cc: davem
commit 41d6b7e20dd6d57bec4f14697f654c8211ff5d57
Author: Adrian Bunk <bunk@stusta.de>
Date: Fri Oct 26 07:29:47 2007 -0400
[ATM]: [he] This patch removes the ancient version string.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index d33aba6..4f1c7e6 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1,5 +1,3 @@
-/* $Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $ */
-
/*
he.c
@@ -99,10 +97,6 @@
#define HPRINTK(fmt,args...) do { } while (0)
#endif /* HE_DEBUG */
-/* version definition */
-
-static char *version = "$Id: he.c,v 1.18 2003/05/06 22:57:15 chas Exp $";
-
/* declarations */
static int he_open(struct atm_vcc *vcc);
@@ -366,7 +360,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent)
struct he_dev *he_dev = NULL;
int err = 0;
- printk(KERN_INFO "he: %s\n", version);
+ printk(KERN_INFO "ATM he driver\n");
if (pci_enable_device(pci_dev))
return -EIO;
@@ -2933,7 +2927,7 @@ he_proc_read(struct atm_dev *dev, loff_t *pos, char *page)
left = *pos;
if (!left--)
- return sprintf(page, "%s\n", version);
+ return sprintf(page, "ATM he driver\n");
if (!left--)
return sprintf(page, "%s%s\n\n",
^ permalink raw reply related
* [PATCH 1/5][ATM]: atm is no longer experimental
From: chas williams - CONTRACTOR @ 2007-10-27 12:37 UTC (permalink / raw)
To: netdev; +Cc: davem
commit f57512af6142cf14bd15012c4c627f9ebef0582a
Author: Robert P. J. Day <rpjday@mindspring.com>
Date: Fri Oct 26 07:27:07 2007 -0400
[ATM]: atm is no longer experimental
From: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
diff --git a/net/atm/Kconfig b/net/atm/Kconfig
index 21ff276..754ea10 100644
--- a/net/atm/Kconfig
+++ b/net/atm/Kconfig
@@ -1,10 +1,9 @@
#
-# Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)
+# Asynchronous Transfer Mode (ATM)
#
config ATM
- tristate "Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)"
- depends on EXPERIMENTAL
+ tristate "Asynchronous Transfer Mode (ATM)"
---help---
ATM is a high-speed networking technology for Local Area Networks
and Wide Area Networks. It uses a fixed packet size and is
@@ -20,7 +19,7 @@ config ATM
further details.
config ATM_CLIP
- tristate "Classical IP over ATM (EXPERIMENTAL)"
+ tristate "Classical IP over ATM"
depends on ATM && INET
help
Classical IP over ATM for PVCs and SVCs, supporting InARP and
@@ -29,7 +28,7 @@ config ATM_CLIP
(LANE)" below.
config ATM_CLIP_NO_ICMP
- bool "Do NOT send ICMP if no neighbour (EXPERIMENTAL)"
+ bool "Do NOT send ICMP if no neighbour"
depends on ATM_CLIP
help
Normally, an "ICMP host unreachable" message is sent if a neighbour
@@ -39,7 +38,7 @@ config ATM_CLIP_NO_ICMP
such neighbours are silently discarded instead.
config ATM_LANE
- tristate "LAN Emulation (LANE) support (EXPERIMENTAL)"
+ tristate "LAN Emulation (LANE) support"
depends on ATM
help
LAN Emulation emulates services of existing LANs across an ATM
@@ -48,7 +47,7 @@ config ATM_LANE
ELAN and Ethernet segments. You need LANE if you want to try MPOA.
config ATM_MPOA
- tristate "Multi-Protocol Over ATM (MPOA) support (EXPERIMENTAL)"
+ tristate "Multi-Protocol Over ATM (MPOA) support"
depends on ATM && INET && ATM_LANE!=n
help
Multi-Protocol Over ATM allows ATM edge devices such as routers,
^ permalink raw reply related
* [PATCH 2/5][ATM]: Convert struct class_device to struct device
From: chas williams - CONTRACTOR @ 2007-10-27 12:40 UTC (permalink / raw)
To: netdev; +Cc: davem
commit 03c544e08cfe22f0c8a952c0aed1265917dca469
Author: Kay Sievers <kay.sievers@vrfy.org>
Date: Fri Oct 26 07:28:29 2007 -0400
[ATM]: Convert struct class_device to struct device
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: Tony Jones <tonyj@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
index 9ef07ed..1b88311 100644
--- a/net/atm/atm_sysfs.c
+++ b/net/atm/atm_sysfs.c
@@ -9,13 +9,15 @@
#define to_atm_dev(cldev) container_of(cldev, struct atm_dev, class_dev)
-static ssize_t show_type(struct class_device *cdev, char *buf)
+static ssize_t show_type(struct device *cdev,
+ struct device_attribute *attr, char *buf)
{
struct atm_dev *adev = to_atm_dev(cdev);
return sprintf(buf, "%s\n", adev->type);
}
-static ssize_t show_address(struct class_device *cdev, char *buf)
+static ssize_t show_address(struct device *cdev,
+ struct device_attribute *attr, char *buf)
{
char *pos = buf;
struct atm_dev *adev = to_atm_dev(cdev);
@@ -28,7 +30,8 @@ static ssize_t show_address(struct class_device *cdev, char *buf)
return pos - buf;
}
-static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
+static ssize_t show_atmaddress(struct device *cdev,
+ struct device_attribute *attr, char *buf)
{
unsigned long flags;
char *pos = buf;
@@ -54,7 +57,8 @@ static ssize_t show_atmaddress(struct class_device *cdev, char *buf)
return pos - buf;
}
-static ssize_t show_carrier(struct class_device *cdev, char *buf)
+static ssize_t show_carrier(struct device *cdev,
+ struct device_attribute *attr, char *buf)
{
char *pos = buf;
struct atm_dev *adev = to_atm_dev(cdev);
@@ -65,7 +69,8 @@ static ssize_t show_carrier(struct class_device *cdev, char *buf)
return pos - buf;
}
-static ssize_t show_link_rate(struct class_device *cdev, char *buf)
+static ssize_t show_link_rate(struct device *cdev,
+ struct device_attribute *attr, char *buf)
{
char *pos = buf;
struct atm_dev *adev = to_atm_dev(cdev);
@@ -90,22 +95,23 @@ static ssize_t show_link_rate(struct class_device *cdev, char *buf)
return pos - buf;
}
-static CLASS_DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
-static CLASS_DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
-static CLASS_DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
-static CLASS_DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
-static CLASS_DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
-
-static struct class_device_attribute *atm_attrs[] = {
- &class_device_attr_atmaddress,
- &class_device_attr_address,
- &class_device_attr_carrier,
- &class_device_attr_type,
- &class_device_attr_link_rate,
+static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
+static DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
+static DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
+static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
+static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
+
+static struct device_attribute *atm_attrs[] = {
+ &dev_attr_atmaddress,
+ &dev_attr_address,
+ &dev_attr_carrier,
+ &dev_attr_type,
+ &dev_attr_link_rate,
NULL
};
-static int atm_uevent(struct class_device *cdev, struct kobj_uevent_env *env)
+
+static int atm_uevent(struct device *cdev, struct kobj_uevent_env *env)
{
struct atm_dev *adev;
@@ -122,7 +128,7 @@ static int atm_uevent(struct class_device *cdev, struct kobj_uevent_env *env)
return 0;
}
-static void atm_release(struct class_device *cdev)
+static void atm_release(struct device *cdev)
{
struct atm_dev *adev = to_atm_dev(cdev);
@@ -131,25 +137,25 @@ static void atm_release(struct class_device *cdev)
static struct class atm_class = {
.name = "atm",
- .release = atm_release,
- .uevent = atm_uevent,
+ .dev_release = atm_release,
+ .dev_uevent = atm_uevent,
};
int atm_register_sysfs(struct atm_dev *adev)
{
- struct class_device *cdev = &adev->class_dev;
+ struct device *cdev = &adev->class_dev;
int i, j, err;
cdev->class = &atm_class;
- class_set_devdata(cdev, adev);
+ dev_set_drvdata(cdev, adev);
- snprintf(cdev->class_id, BUS_ID_SIZE, "%s%d", adev->type, adev->number);
- err = class_device_register(cdev);
+ snprintf(cdev->bus_id, BUS_ID_SIZE, "%s%d", adev->type, adev->number);
+ err = device_register(cdev);
if (err < 0)
return err;
for (i = 0; atm_attrs[i]; i++) {
- err = class_device_create_file(cdev, atm_attrs[i]);
+ err = device_create_file(cdev, atm_attrs[i]);
if (err)
goto err_out;
}
@@ -158,16 +164,16 @@ int atm_register_sysfs(struct atm_dev *adev)
err_out:
for (j = 0; j < i; j++)
- class_device_remove_file(cdev, atm_attrs[j]);
- class_device_del(cdev);
+ device_remove_file(cdev, atm_attrs[j]);
+ device_del(cdev);
return err;
}
void atm_unregister_sysfs(struct atm_dev *adev)
{
- struct class_device *cdev = &adev->class_dev;
+ struct device *cdev = &adev->class_dev;
- class_device_del(cdev);
+ device_del(cdev);
}
int __init atm_sysfs_init(void)
^ permalink raw reply related
* [PATCH 4/5][ATM]: [br2864] routed support
From: chas williams - CONTRACTOR @ 2007-10-27 12:43 UTC (permalink / raw)
To: netdev; +Cc: davem
commit fea6b121bcc150fc91186e5012466c91944ce64d
Author: Eric Kinzie <ekinzie@cmf.nrl.navy.mil>
Date: Fri Oct 26 08:05:08 2007 -0400
[ATM]: [br2864] routed support
From: Eric Kinzie <ekinzie@cmf.nrl.navy.mil>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index 969fb6c..ccdab6c 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -14,6 +14,9 @@
#define BR2684_MEDIA_FDDI (3)
#define BR2684_MEDIA_802_6 (4) /* 802.6 */
+ /* used only at device creation: */
+#define BR2684_FLAG_ROUTED (1<<16) /* payload is routed, not bridged */
+
/*
* Is there FCS inbound on this VC? This currently isn't supported.
*/
@@ -36,13 +39,21 @@
#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */
/*
+ * Is this VC bridged or routed?
+ */
+
+#define BR2684_PAYLOAD_ROUTED (0)
+#define BR2684_PAYLOAD_BRIDGED (1)
+
+
+/*
* This is for the ATM_NEWBACKENDIF call - these are like socket families:
* the first element of the structure is the backend number and the rest
* is per-backend specific
*/
struct atm_newif_br2684 {
atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */
- int media; /* BR2684_MEDIA_* */
+ int media; /* BR2684_MEDIA_*, flags in upper bits */
char ifname[IFNAMSIZ];
int mtu;
};
@@ -95,6 +106,11 @@ struct br2684_filter_set {
struct br2684_filter filter;
};
+enum br2684_payload {
+ p_routed = BR2684_PAYLOAD_ROUTED,
+ p_bridged = BR2684_PAYLOAD_BRIDGED,
+};
+
#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \
struct br2684_filter_set)
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 2096e5c..a3d07c2 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -359,7 +359,7 @@ struct atm_dev {
struct proc_dir_entry *proc_entry; /* proc entry */
char *proc_name; /* proc entry name */
#endif
- struct class_device class_dev; /* sysfs class device */
+ struct device class_dev; /* sysfs device */
struct list_head dev_list; /* linkage */
};
@@ -461,7 +461,7 @@ static inline void atm_dev_put(struct atm_dev *dev)
BUG_ON(!test_bit(ATM_DF_REMOVED, &dev->flags));
if (dev->ops->dev_close)
dev->ops->dev_close(dev);
- class_device_put(&dev->class_dev);
+ put_device(&dev->class_dev);
}
}
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index ba6428f..d9bb2a1 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -1,7 +1,8 @@
/*
-Experimental ethernet netdevice using ATM AAL5 as underlying carrier
-(RFC1483 obsoleted by RFC2684) for Linux 2.4
-Author: Marcell GAL, 2000, XDSL Ltd, Hungary
+Ethernet netdevice using ATM AAL5 as underlying carrier
+(RFC1483 obsoleted by RFC2684) for Linux
+Authors: Marcell GAL, 2000, XDSL Ltd, Hungary
+ Eric Kinzie, 2006-2007, US Naval Research Laboratory
*/
#include <linux/module.h>
@@ -39,9 +40,27 @@ static void skb_debug(const struct sk_buff *skb)
#define skb_debug(skb) do {} while (0)
#endif
+#define BR2684_ETHERTYPE_LEN 2
+#define BR2684_PAD_LEN 2
+
+#define LLC 0xaa, 0xaa, 0x03
+#define SNAP_BRIDGED 0x00, 0x80, 0xc2
+#define SNAP_ROUTED 0x00, 0x00, 0x00
+#define PID_ETHERNET 0x00, 0x07
+#define ETHERTYPE_IPV4 0x08, 0x00
+#define ETHERTYPE_IPV6 0x86, 0xdd
+#define PAD_BRIDGED 0x00, 0x00
+
+static unsigned char ethertype_ipv4[] =
+ { ETHERTYPE_IPV4 };
+static unsigned char ethertype_ipv6[] =
+ { ETHERTYPE_IPV6 };
static unsigned char llc_oui_pid_pad[] =
- { 0xAA, 0xAA, 0x03, 0x00, 0x80, 0xC2, 0x00, 0x07, 0x00, 0x00 };
-#define PADLEN (2)
+ { LLC, SNAP_BRIDGED, PID_ETHERNET, PAD_BRIDGED };
+static unsigned char llc_oui_ipv4[] =
+ { LLC, SNAP_ROUTED, ETHERTYPE_IPV4 };
+static unsigned char llc_oui_ipv6[] =
+ { LLC, SNAP_ROUTED, ETHERTYPE_IPV6 };
enum br2684_encaps {
e_vc = BR2684_ENCAPS_VC,
@@ -69,6 +88,7 @@ struct br2684_dev {
struct list_head brvccs; /* one device <=> one vcc (before xmas) */
struct net_device_stats stats;
int mac_was_set;
+ enum br2684_payload payload;
};
/*
@@ -136,6 +156,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
{
struct atm_vcc *atmvcc;
int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
+
if (skb_headroom(skb) < minheadroom) {
struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
brvcc->copies_needed++;
@@ -146,11 +167,32 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct br2684_dev *brdev,
}
skb = skb2;
}
- skb_push(skb, minheadroom);
- if (brvcc->encaps == e_llc)
- skb_copy_to_linear_data(skb, llc_oui_pid_pad, 10);
- else
- memset(skb->data, 0, 2);
+
+ if (brvcc->encaps == e_llc) {
+ if (brdev->payload == p_bridged) {
+ skb_push(skb, sizeof(llc_oui_pid_pad));
+ skb_copy_to_linear_data(skb, llc_oui_pid_pad, sizeof(llc_oui_pid_pad));
+ } else if (brdev->payload == p_routed) {
+ unsigned short prot = ntohs(skb->protocol);
+
+ skb_push(skb, sizeof(llc_oui_ipv4));
+ switch (prot) {
+ case ETH_P_IP:
+ skb_copy_to_linear_data(skb, llc_oui_ipv4, sizeof(llc_oui_ipv4));
+ break;
+ case ETH_P_IPV6:
+ skb_copy_to_linear_data(skb, llc_oui_ipv6, sizeof(llc_oui_ipv6));
+ break;
+ default:
+ dev_kfree_skb(skb);
+ return 0;
+ }
+ }
+ } else {
+ skb_push(skb, 2);
+ if (brdev->payload == p_bridged)
+ memset(skb->data, 0, 2);
+ }
skb_debug(skb);
ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
@@ -299,7 +341,6 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
struct br2684_vcc *brvcc = BR2684_VCC(atmvcc);
struct net_device *net_dev = brvcc->device;
struct br2684_dev *brdev = BRPRIV(net_dev);
- int plen = sizeof(llc_oui_pid_pad) + ETH_HLEN;
pr_debug("br2684_push\n");
@@ -320,35 +361,50 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
atm_return(atmvcc, skb->truesize);
pr_debug("skb from brdev %p\n", brdev);
if (brvcc->encaps == e_llc) {
+
+ if (skb->len > 7 && skb->data[7] == 0x01)
+ __skb_trim(skb, skb->len - 4);
+
+ /* accept packets that have "ipv[46]" in the snap header */
+ if ((skb->len >= (sizeof(llc_oui_ipv4)))
+ && (memcmp(skb->data, llc_oui_ipv4, sizeof(llc_oui_ipv4) - BR2684_ETHERTYPE_LEN) == 0)) {
+ if (memcmp(skb->data + 6, ethertype_ipv6, sizeof(ethertype_ipv6)) == 0)
+ skb->protocol = __constant_htons(ETH_P_IPV6);
+ else if (memcmp(skb->data + 6, ethertype_ipv4, sizeof(ethertype_ipv4)) == 0)
+ skb->protocol = __constant_htons(ETH_P_IP);
+ else {
+ brdev->stats.rx_errors++;
+ dev_kfree_skb(skb);
+ return;
+ }
+ skb_pull(skb, sizeof(llc_oui_ipv4));
+ skb_reset_network_header(skb);
+ skb->pkt_type = PACKET_HOST;
+
/* let us waste some time for checking the encapsulation.
Note, that only 7 char is checked so frames with a valid FCS
are also accepted (but FCS is not checked of course) */
- if (memcmp(skb->data, llc_oui_pid_pad, 7)) {
+ } else if ((skb->len >= sizeof(llc_oui_pid_pad)) &&
+ (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) {
+ skb_pull(skb, sizeof(llc_oui_pid_pad));
+ skb->protocol = eth_type_trans(skb, net_dev);
+ } else {
brdev->stats.rx_errors++;
dev_kfree_skb(skb);
return;
}
- /* Strip FCS if present */
- if (skb->len > 7 && skb->data[7] == 0x01)
- __skb_trim(skb, skb->len - 4);
} else {
- plen = PADLEN + ETH_HLEN; /* pad, dstmac,srcmac, ethtype */
/* first 2 chars should be 0 */
if (*((u16 *) (skb->data)) != 0) {
brdev->stats.rx_errors++;
dev_kfree_skb(skb);
return;
}
- }
- if (skb->len < plen) {
- brdev->stats.rx_errors++;
- dev_kfree_skb(skb); /* dev_ not needed? */
- return;
+ skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */
+ skb->protocol = eth_type_trans(skb, net_dev);
}
- skb_pull(skb, plen - ETH_HLEN);
- skb->protocol = eth_type_trans(skb, net_dev);
#ifdef CONFIG_ATM_BR2684_IPFILTER
if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) {
brdev->stats.rx_dropped++;
@@ -482,25 +538,52 @@ static void br2684_setup(struct net_device *netdev)
INIT_LIST_HEAD(&brdev->brvccs);
}
+static void br2684_setup_routed(struct net_device *netdev)
+{
+ struct br2684_dev *brdev = BRPRIV(netdev);
+ brdev->net_dev = netdev;
+
+ netdev->hard_header_len = 0;
+ my_eth_mac_addr = netdev->set_mac_address;
+ netdev->set_mac_address = br2684_mac_addr;
+ netdev->hard_start_xmit = br2684_start_xmit;
+ netdev->get_stats = br2684_get_stats;
+ netdev->addr_len = 0;
+ netdev->mtu = 1500;
+ netdev->type = ARPHRD_PPP;
+ netdev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
+ netdev->tx_queue_len = 100;
+ INIT_LIST_HEAD(&brdev->brvccs);
+}
+
static int br2684_create(void __user *arg)
{
int err;
struct net_device *netdev;
struct br2684_dev *brdev;
struct atm_newif_br2684 ni;
+ enum br2684_payload payload;
pr_debug("br2684_create\n");
if (copy_from_user(&ni, arg, sizeof ni)) {
return -EFAULT;
}
+
+ if (ni.media & BR2684_FLAG_ROUTED)
+ payload = p_routed;
+ else
+ payload = p_bridged;
+ ni.media &= 0xffff; /* strip flags */
+
if (ni.media != BR2684_MEDIA_ETHERNET || ni.mtu != 1500) {
return -EINVAL;
}
netdev = alloc_netdev(sizeof(struct br2684_dev),
ni.ifname[0] ? ni.ifname : "nas%d",
- br2684_setup);
+ (payload == p_routed) ?
+ br2684_setup_routed : br2684_setup);
if (!netdev)
return -ENOMEM;
@@ -516,6 +599,7 @@ static int br2684_create(void __user *arg)
}
write_lock_irq(&devs_lock);
+ brdev->payload = payload;
brdev->number = list_empty(&br2684_devs) ? 1 :
BRPRIV(list_entry_brdev(br2684_devs.prev))->number + 1;
list_add_tail(&brdev->br2684_devs, &br2684_devs);
@@ -601,14 +685,14 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
brdev->mac_was_set ? "set" : "auto");
list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
- seq_printf(seq, " vcc %d.%d.%d: encaps=%s"
- ", failed copies %u/%u"
- "\n", brvcc->atmvcc->dev->number,
- brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
- (brvcc->encaps == e_llc) ? "LLC" : "VC"
- , brvcc->copies_failed
- , brvcc->copies_needed
- );
+ seq_printf(seq, " vcc %d.%d.%d: encaps=%s payload=%s"
+ ", failed copies %u/%u"
+ "\n", brvcc->atmvcc->dev->number,
+ brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
+ (brvcc->encaps == e_llc) ? "LLC" : "VC",
+ (brdev->payload == p_bridged) ? "bridged" : "routed",
+ brvcc->copies_failed,
+ brvcc->copies_needed);
#ifdef CONFIG_ATM_BR2684_IPFILTER
#define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte]
#define bs(var) b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3)
^ permalink raw reply related
* Re: [PATCH] ucc_geth: add support for netpoll
From: Anton Vorontsov @ 2007-10-27 14:37 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: linuxppc-dev, netdev, leoli, linux-kernel
In-Reply-To: <4723389F.7010109@ru.mvista.com>
On Sat, Oct 27, 2007 at 05:09:51PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> Anton Vorontsov wrote:
>
> > This patch adds netpoll support for the QE UCC Gigabit Ethernet
> > driver. The approach is very similar to the gianfar driver.
>
> It's rather contrarywise -- this is standard approach and gianfar with its
> 3 TSEC IRQs has a quite non-standard poll_controller() implementation.
Oh.. well, right -- gianfar a bit more comlex in that regard.
>
> > Tested using netconsole.
>
> KGDBoE is considered a better test (I hope you've also tested with it).
At the time of posting it was tested using netconsole only, a few
days later it's was tested using KGDBoE also. So, it works indeed.
> > Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> > diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> > index 18a6f48..06807ce 100644
> > --- a/drivers/net/ucc_geth.c
> > +++ b/drivers/net/ucc_geth.c
> > @@ -3691,6 +3691,22 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
> > return IRQ_HANDLED;
> > }
> >
> > +#ifdef CONFIG_NET_POLL_CONTROLLER
> > +/*
> > + * Polling 'interrupt' - used by things like netconsole to send skbs
> > + * without having to re-enable interrupts. It's not called while
> > + * the interrupt routine is executing.
> > + */
> > +static void ucc_netpoll(struct net_device *dev)
> > +{
> > + struct ucc_geth_private *ugeth = netdev_priv(dev);
> > +
> > + disable_irq(ugeth->ug_info->uf_info.irq);
> > + ucc_geth_irq_handler(ugeth->ug_info->uf_info.irq, dev);
> > + enable_irq(ugeth->ug_info->uf_info.irq);
>
> Why not make it less complex (for a reader and gcc too :-) ?
Yup, I'm agree here but it's too late. Again. ;-)
This patch already accepted into the -mm (a week or so after the
silence), so.. now I'd rather not bother Andrew with such really
cosmetic changes. But if Jeff would directly apply modfied patch,
I'll send it. ;-)
Anyhow, I'm sincerely appreciate your comments.
Thanks,
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: Files, sockets, and closing
From: Andi Kleen @ 2007-10-27 18:03 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, Al Viro, netdev
In-Reply-To: <20071026140319.5bcc8ac0@freepuppy.rosehill>
This particular problem has come up many times over the years. So far
the standard strategy has been to ignore it. It's doubtful that the
complexity needed for a fix is worth it.
Workaround at user space level: call shutdown() first instead of close()
-Andi
^ permalink raw reply
* Re: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer
From: Alan Stern @ 2007-10-27 19:17 UTC (permalink / raw)
To: Maxim Levitsky; +Cc: linux-kernel, netdev, linux-pm
In-Reply-To: <200710261348.42748.maximlevitsky@gmail.com>
On Fri, 26 Oct 2007, Maxim Levitsky wrote:
> > > Looking through the dmfe code, I noticed yet another possible race.
> > > A race between the .suspend, and a timer that serves both as a watchdog, and link state detector.
> > > Again I need to prevent it from running during the suspend/resume, but how?
> > >
> > > I can use del_timer in .suspend, and mod_timer in .resume, but that doesn't protect against
> > > race with already running timer.
> > > I can use del_timer_sync, but it states that it is useless if timer re-enables itself, and I agree with that.
> > > In dmfe case the timer does re-enable itself.
> >
> > That comment isn't right. del_timer_sync works perfectly well even if
> > the timer routine re-enables itself, provided it stops doing so after a
> > small number of iterations.
> Thanks for the info. but....
> Due to the "don't access the hardware, while powered-off" rule, I must know that the timer isn't running.
> and won't be.
> So what function to use (if possible) to be sure that the timer won't run anymore?
> (Taking in the account the fact that it re-enables itself)
Use del_timer_sync(). It guarantees that when it returns, the timer
will be stopped and the timer routine will no longer be running on any
CPU.
Alan Stern
^ permalink raw reply
* Re: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer
From: Maxim Levitsky @ 2007-10-27 19:19 UTC (permalink / raw)
To: Alan Stern; +Cc: linux-kernel, netdev, linux-pm
In-Reply-To: <Pine.LNX.4.44L0.0710271516570.30287-100000@netrider.rowland.org>
On Saturday 27 October 2007 21:17:55 Alan Stern wrote:
> On Fri, 26 Oct 2007, Maxim Levitsky wrote:
>
> > > > Looking through the dmfe code, I noticed yet another possible race.
> > > > A race between the .suspend, and a timer that serves both as a watchdog, and link state detector.
> > > > Again I need to prevent it from running during the suspend/resume, but how?
> > > >
> > > > I can use del_timer in .suspend, and mod_timer in .resume, but that doesn't protect against
> > > > race with already running timer.
> > > > I can use del_timer_sync, but it states that it is useless if timer re-enables itself, and I agree with that.
> > > > In dmfe case the timer does re-enable itself.
> > >
> > > That comment isn't right. del_timer_sync works perfectly well even if
> > > the timer routine re-enables itself, provided it stops doing so after a
> > > small number of iterations.
> > Thanks for the info. but....
> > Due to the "don't access the hardware, while powered-off" rule, I must know that the timer isn't running.
> > and won't be.
> > So what function to use (if possible) to be sure that the timer won't run anymore?
> > (Taking in the account the fact that it re-enables itself)
>
> Use del_timer_sync(). It guarantees that when it returns, the timer
> will be stopped and the timer routine will no longer be running on any
> CPU.
>
Even if the timer re-enables itself, are you sure?
> Alan Stern
>
>
Best regards,
Maxim Levitsky
^ permalink raw reply
* [PATCH] proc_fs.h redux
From: Alexey Dobriyan @ 2007-10-27 19:47 UTC (permalink / raw)
To: akpm, torvalds; +Cc: viro, linux-kernel, netdev, linux-arch
Remove proc_fs.h from headers that doesn't really need it. Typical overkill is
including full header when one can get away with just forward declaration of
"struct proc_dir_entry".
Number of files that are recompiled after touching proc_fs.h drops from 1100
to 513(!) on x86_64 allmodconfig.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
arch/powerpc/kernel/process.c | 1 +
arch/powerpc/kernel/prom.c | 1 +
arch/powerpc/mm/init_32.c | 1 +
arch/powerpc/mm/init_64.c | 1 +
arch/powerpc/platforms/iseries/mf.c | 1 +
arch/powerpc/platforms/pasemi/electra_ide.c | 2 +-
arch/powerpc/sysdev/fsl_soc.c | 1 +
arch/powerpc/sysdev/mv64x60_dev.c | 2 +-
arch/powerpc/sysdev/qe_lib/qe.c | 1 +
arch/sparc/kernel/process.c | 3 ++-
arch/sparc64/kernel/ldc.c | 1 +
arch/sparc64/kernel/mdesc.c | 1 +
arch/sparc64/kernel/viohs.c | 2 +-
drivers/acpi/bay.c | 1 +
drivers/acpi/dock.c | 2 +-
drivers/block/cpqarray.h | 2 +-
drivers/hwmon/ibmpex.c | 2 +-
drivers/isdn/hardware/eicon/platform.h | 1 -
drivers/md/md.c | 1 +
drivers/misc/fujitsu-laptop.c | 1 +
drivers/misc/msi-laptop.c | 1 +
drivers/misc/thinkpad_acpi.c | 2 +-
drivers/misc/thinkpad_acpi.h | 3 ++-
drivers/net/bonding/bonding.h | 3 ++-
drivers/net/cxgb3/t3cdev.h | 2 +-
drivers/parport/parport_serial.c | 2 +-
drivers/sbus/char/envctrl.c | 2 +-
drivers/sbus/char/uctrl.c | 1 +
drivers/scsi/imm.h | 1 -
drivers/scsi/ppa.h | 1 -
drivers/usb/gadget/lh7a40x_udc.h | 1 -
fs/nfs/client.c | 1 +
include/acpi/acpi_bus.h | 2 +-
include/asm-powerpc/prom.h | 3 ++-
include/asm-sparc/prom.h | 4 +++-
include/asm-sparc64/prom.h | 4 +++-
include/linux/atmdev.h | 2 +-
include/linux/crash_dump.h | 3 ++-
include/linux/efi.h | 1 -
include/linux/ipmi.h | 1 -
include/linux/netfilter.h | 2 +-
include/linux/parport.h | 1 -
include/linux/raid/md.h | 1 -
include/linux/sunrpc/cache.h | 4 +++-
include/linux/sunrpc/rpc_pipe_fs.h | 2 ++
include/linux/sunrpc/stats.h | 3 ++-
include/linux/wanrouter.h | 3 ++-
include/net/sctp/sctp.h | 2 +-
net/atm/br2684.c | 1 +
net/atm/resources.h | 2 --
net/irda/irnet/irnet.h | 1 -
net/irda/irnet/irnet_irda.c | 2 +-
net/sctp/objcnt.c | 1 +
net/sctp/proc.c | 1 +
net/sctp/protocol.c | 1 +
net/sunrpc/auth.c | 2 ++
net/sunrpc/auth_unix.c | 2 +-
net/sunrpc/rpcb_clnt.c | 1 +
net/sunrpc/xprt.c | 2 +-
net/wanrouter/wanmain.c | 1 +
net/wanrouter/wanproc.c | 1 +
61 files changed, 66 insertions(+), 38 deletions(-)
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -17,6 +17,7 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
+#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/stddef.h>
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -23,6 +23,7 @@
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/pci.h>
+#include <linux/proc_fs.h>
#include <linux/stringify.h>
#include <linux/delay.h>
#include <linux/initrd.h>
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -30,6 +30,7 @@
#include <linux/highmem.h>
#include <linux/initrd.h>
#include <linux/pagemap.h>
+#include <linux/proc_fs.h>
#include <asm/pgalloc.h>
#include <asm/prom.h>
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -40,6 +40,7 @@
#include <linux/nodemask.h>
#include <linux/module.h>
#include <linux/poison.h>
+#include <linux/proc_fs.h>
#include <asm/pgalloc.h>
#include <asm/page.h>
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -33,6 +33,7 @@
#include <linux/dma-mapping.h>
#include <linux/bcd.h>
#include <linux/rtc.h>
+#include <linux/proc_fs.h>
#include <asm/time.h>
#include <asm/uaccess.h>
--- a/arch/powerpc/platforms/pasemi/electra_ide.c
+++ b/arch/powerpc/platforms/pasemi/electra_ide.c
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+#include <linux/err.h>
#include <linux/platform_device.h>
#include <asm/prom.h>
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -15,6 +15,7 @@
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/err.h>
#include <linux/errno.h>
#include <linux/major.h>
#include <linux/delay.h>
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -8,7 +8,7 @@
* is licensed "as is" without any warranty of any kind, whether express
* or implied.
*/
-
+#include <linux/err.h>
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/init.h>
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -14,6 +14,7 @@
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
+#include <linux/err.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -10,12 +10,13 @@
*/
#include <stdarg.h>
-
+#include <linux/err.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/kallsyms.h>
+#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/ptrace.h>
--- a/arch/sparc64/kernel/ldc.c
+++ b/arch/sparc64/kernel/ldc.c
@@ -8,6 +8,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
+#include <linux/err.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/scatterlist.h>
--- a/arch/sparc64/kernel/mdesc.c
+++ b/arch/sparc64/kernel/mdesc.c
@@ -8,6 +8,7 @@
#include <linux/log2.h>
#include <linux/list.h>
#include <linux/slab.h>
+#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
--- a/arch/sparc64/kernel/viohs.c
+++ b/arch/sparc64/kernel/viohs.c
@@ -2,7 +2,7 @@
*
* Copyright (C) 2007 David S. Miller <davem@davemloft.net>
*/
-
+#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
--- a/drivers/acpi/bay.c
+++ b/drivers/acpi/bay.c
@@ -24,6 +24,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/err.h>
#include <linux/types.h>
#include <linux/notifier.h>
#include <acpi/acpi_bus.h>
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -21,7 +21,7 @@
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
-
+#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
--- a/drivers/block/cpqarray.h
+++ b/drivers/block/cpqarray.h
@@ -28,7 +28,6 @@
#ifdef __KERNEL__
#include <linux/blkdev.h>
#include <linux/slab.h>
-#include <linux/proc_fs.h>
#include <linux/timer.h>
#endif
@@ -57,6 +56,7 @@ typedef struct {
struct ctlr_info;
typedef struct ctlr_info ctlr_info_t;
+struct proc_dir_entry;
struct access_method {
void (*submit_command)(ctlr_info_t *h, cmdlist_t *c);
--- a/drivers/hwmon/ibmpex.c
+++ b/drivers/hwmon/ibmpex.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+#include <linux/err.h>
#include <linux/ipmi.h>
#include <linux/module.h>
#include <linux/hwmon.h>
--- a/drivers/isdn/hardware/eicon/platform.h
+++ b/drivers/isdn/hardware/eicon/platform.h
@@ -24,7 +24,6 @@
#include <linux/sched.h>
#include <linux/skbuff.h>
#include <linux/vmalloc.h>
-#include <linux/proc_fs.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/list.h>
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -41,6 +41,7 @@
#include <linux/sysctl.h>
#include <linux/buffer_head.h> /* for invalidate_bdev */
#include <linux/poll.h>
+#include <linux/proc_fs.h>
#include <linux/mutex.h>
#include <linux/ctype.h>
#include <linux/freezer.h>
--- a/drivers/misc/fujitsu-laptop.c
+++ b/drivers/misc/fujitsu-laptop.c
@@ -46,6 +46,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/err.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/backlight.h>
--- a/drivers/misc/msi-laptop.c
+++ b/drivers/misc/msi-laptop.c
@@ -54,6 +54,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/err.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/backlight.h>
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -81,7 +81,7 @@
* removed fan control, currently useless
* 2004-08-09 0.1 initial release, support for X series
*/
-
+#include <linux/proc_fs.h>
#include "thinkpad_acpi.h"
MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh");
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -33,7 +33,6 @@
#include <linux/mutex.h>
#include <linux/nvram.h>
-#include <linux/proc_fs.h>
#include <linux/sysfs.h>
#include <linux/backlight.h>
#include <linux/fb.h>
@@ -52,6 +51,8 @@
#include <linux/pci_ids.h>
+struct proc_dir_entry;
+
/****************************************************************************
* Main driver
*/
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -16,12 +16,13 @@
#define _LINUX_BONDING_H
#include <linux/timer.h>
-#include <linux/proc_fs.h>
#include <linux/if_bonding.h>
#include <linux/kobject.h>
#include "bond_3ad.h"
#include "bond_alb.h"
+struct proc_dir_entry;
+
#define DRV_VERSION "3.2.1"
#define DRV_RELDATE "October 15, 2007"
#define DRV_NAME "bonding"
--- a/drivers/net/cxgb3/t3cdev.h
+++ b/drivers/net/cxgb3/t3cdev.h
@@ -36,13 +36,13 @@
#include <asm/atomic.h>
#include <asm/semaphore.h>
#include <linux/netdevice.h>
-#include <linux/proc_fs.h>
#include <linux/skbuff.h>
#include <net/neighbour.h>
#define T3CNAMSIZ 16
struct cxgb3_client;
+struct proc_dir_entry;
enum t3ctype {
T3A = 0,
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -16,7 +16,7 @@
* that.
*
*/
-
+#include <linux/err.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/init.h>
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -18,7 +18,7 @@
* DB - Audit every copy_to_user in envctrl_read.
* Daniele Bellucci <bellucda@tiscali.it>
*/
-
+#include <linux/fs.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kthread.h>
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -12,6 +12,7 @@
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
+#include <linux/fs.h>
#include <linux/mm.h>
#include <asm/openprom.h>
--- a/drivers/scsi/imm.h
+++ b/drivers/scsi/imm.h
@@ -71,7 +71,6 @@
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/delay.h>
-#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/blkdev.h>
#include <linux/sched.h>
--- a/drivers/scsi/ppa.h
+++ b/drivers/scsi/ppa.h
@@ -78,7 +78,6 @@
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/delay.h>
-#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/blkdev.h>
#include <linux/sched.h>
--- a/drivers/usb/gadget/lh7a40x_udc.h
+++ b/drivers/usb/gadget/lh7a40x_udc.h
@@ -36,7 +36,6 @@
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/interrupt.h>
-#include <linux/proc_fs.h>
#include <linux/mm.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -29,6 +29,7 @@
#include <linux/nfs_mount.h>
#include <linux/nfs4_mount.h>
#include <linux/lockd/bind.h>
+#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/mount.h>
#include <linux/nfs_idmap.h>
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -55,7 +55,7 @@ acpi_evaluate_reference(acpi_handle handle,
#ifdef CONFIG_ACPI
-#include <linux/proc_fs.h>
+struct proc_dir_entry;
#define ACPI_BUS_FILE_ROOT "acpi"
extern struct proc_dir_entry *acpi_root_dir;
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -16,11 +16,12 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/types.h>
-#include <linux/proc_fs.h>
#include <linux/platform_device.h>
#include <asm/irq.h>
#include <asm/atomic.h>
+struct proc_dir_entry;
+
#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -17,9 +17,11 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/types.h>
-#include <linux/proc_fs.h>
+#include <linux/kref.h>
#include <asm/atomic.h>
+struct proc_dir_entry;
+
#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -17,9 +17,11 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/types.h>
-#include <linux/proc_fs.h>
+#include <linux/kref.h>
#include <asm/atomic.h>
+struct proc_dir_entry;
+
#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 2
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -219,7 +219,7 @@ struct atm_cirange {
#include <asm/atomic.h>
#ifdef CONFIG_PROC_FS
-#include <linux/proc_fs.h>
+struct proc_dir_entry;
extern struct proc_dir_entry *atm_proc_root;
#endif
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -5,7 +5,8 @@
#include <linux/kexec.h>
#include <linux/smp_lock.h>
#include <linux/device.h>
-#include <linux/proc_fs.h>
+
+struct proc_dir_entry;
#define ELFCORE_ADDR_MAX (-1ULL)
extern unsigned long long elfcorehdr_addr;
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -15,7 +15,6 @@
#include <linux/string.h>
#include <linux/time.h>
#include <linux/types.h>
-#include <linux/proc_fs.h>
#include <linux/rtc.h>
#include <linux/ioport.h>
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -226,7 +226,6 @@ struct kernel_ipmi_msg
#include <linux/list.h>
#include <linux/module.h>
#include <linux/device.h>
-#include <linux/proc_fs.h>
/* Opaque type for a IPMI message user. One of these is needed to
send and receive messages. */
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -363,7 +363,7 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family)
}
#ifdef CONFIG_PROC_FS
-#include <linux/proc_fs.h>
+struct proc_dir_entry;
extern struct proc_dir_entry *proc_net_netfilter;
#endif
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -97,7 +97,6 @@ typedef enum {
#ifdef __KERNEL__
#include <linux/jiffies.h>
-#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/irqreturn.h>
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -26,7 +26,6 @@
#include <linux/bitops.h>
#include <linux/module.h>
#include <linux/hdreg.h>
-#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
#include <linux/delay.h>
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -13,9 +13,11 @@
#ifndef _LINUX_SUNRPC_CACHE_H_
#define _LINUX_SUNRPC_CACHE_H_
+#include <linux/kref.h>
#include <linux/slab.h>
#include <asm/atomic.h>
-#include <linux/proc_fs.h>
+
+struct proc_dir_entry;
/*
* Each cache requires:
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -3,6 +3,8 @@
#ifdef __KERNEL__
+#include <linux/fs.h>
+
struct rpc_pipe_msg {
struct list_head list;
void *data;
--- a/include/linux/sunrpc/stats.h
+++ b/include/linux/sunrpc/stats.h
@@ -9,7 +9,8 @@
#ifndef _LINUX_SUNRPC_STATS_H
#define _LINUX_SUNRPC_STATS_H
-#include <linux/proc_fs.h>
+struct file_operations;
+struct proc_dir_entry;
struct rpc_stat {
struct rpc_program * program;
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -453,10 +453,11 @@ typedef struct wanif_conf
/****** Kernel Interface ****************************************************/
#include <linux/fs.h> /* support for device drivers */
-#include <linux/proc_fs.h> /* proc filesystem pragmatics */
#include <linux/netdevice.h> /* support for network drivers */
#include <linux/spinlock.h> /* Support for SMP Locking */
+struct proc_dir_entry;
+
/*----------------------------------------------------------------------------
* WAN device data space.
*/
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -74,7 +74,6 @@
#include <linux/slab.h>
#include <linux/in.h>
#include <linux/tty.h>
-#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/jiffies.h>
#include <linux/idr.h>
@@ -91,6 +90,7 @@
#include <net/sctp/structs.h>
#include <net/sctp/constants.h>
+struct proc_dir_entry;
/* Set SCTP_DEBUG flag via config if not already set. */
#ifndef SCTP_DEBUG
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -18,6 +18,7 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hungary
#include <linux/atm.h>
#include <linux/atmdev.h>
#include <linux/capability.h>
+#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/atmbr2684.h>
--- a/net/atm/resources.h
+++ b/net/atm/resources.h
@@ -18,8 +18,6 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg);
#ifdef CONFIG_PROC_FS
-#include <linux/proc_fs.h>
-
void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos);
void atm_dev_seq_stop(struct seq_file *seq, void *v);
void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos);
--- a/net/irda/irnet/irnet.h
+++ b/net/irda/irnet/irnet.h
@@ -243,7 +243,6 @@
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/tty.h>
-#include <linux/proc_fs.h>
#include <linux/netdevice.h>
#include <linux/miscdevice.h>
#include <linux/poll.h>
--- a/net/irda/irnet/irnet_irda.c
+++ b/net/irda/irnet/irnet_irda.c
@@ -7,7 +7,7 @@
* Basically, we sit on top of IrTTP. We set up IrTTP, IrIAS properly,
* and exchange frames with IrTTP.
*/
-
+#include <linux/proc_fs.h>
#include "irnet_irda.h" /* Private header */
/*
--- a/net/sctp/objcnt.c
+++ b/net/sctp/objcnt.c
@@ -39,6 +39,7 @@
*/
#include <linux/kernel.h>
+#include <linux/proc_fs.h>
#include <net/sctp/sctp.h>
/*
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -35,6 +35,7 @@
*/
#include <linux/types.h>
+#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <net/sctp/sctp.h>
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -50,6 +50,7 @@
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
+#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/bootmem.h>
#include <net/net_namespace.h>
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -7,9 +7,11 @@
*/
#include <linux/types.h>
+#include <linux/dcache.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/slab.h>
+#include <linux/err.h>
#include <linux/errno.h>
#include <linux/sunrpc/clnt.h>
#include <linux/spinlock.h>
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -5,7 +5,7 @@
*
* Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
*/
-
+#include <linux/err.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/module.h>
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -19,6 +19,7 @@
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/kernel.h>
+#include <linux/err.h>
#include <linux/errno.h>
#include <linux/sunrpc/clnt.h>
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -37,7 +37,7 @@
*/
#include <linux/module.h>
-
+#include <linux/err.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -49,6 +49,7 @@
#include <linux/module.h> /* support for loadable modules */
#include <linux/slab.h> /* kmalloc(), kfree() */
#include <linux/mm.h>
+#include <linux/proc_fs.h>
#include <linux/string.h> /* inline mem*, str* functions */
#include <asm/byteorder.h> /* htons(), etc. */
--- a/net/wanrouter/wanproc.c
+++ b/net/wanrouter/wanproc.c
@@ -26,6 +26,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/wanrouter.h> /* WAN router API definitions */
+#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/smp_lock.h>
^ permalink raw reply
* Re: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer
From: Alan Stern @ 2007-10-27 22:24 UTC (permalink / raw)
To: Maxim Levitsky; +Cc: linux-kernel, netdev, linux-pm
In-Reply-To: <200710272119.44574.maximlevitsky@gmail.com>
On Sat, 27 Oct 2007, Maxim Levitsky wrote:
> > Use del_timer_sync(). It guarantees that when it returns, the timer
> > will be stopped and the timer routine will no longer be running on any
> > CPU.
> >
> Even if the timer re-enables itself, are you sure?
Last time I looked at the source code, that's what it did. I'll look
again... Yep, it still does. It checks to see if the timer routine is
currently running; if so then it waits a little while and tries again.
Alan Stern
^ permalink raw reply
* Re: [PATCH] proc_fs.h redux
From: Joe Perches @ 2007-10-27 22:40 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: akpm, torvalds, viro, linux-kernel, netdev, linux-arch
In-Reply-To: <20071027194758.GD9816@martell.zuzino.mipt.ru>
On Sat, 2007-10-27 at 23:47 +0400, Alexey Dobriyan wrote:
> Remove proc_fs.h from headers that doesn't really need it.
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -17,6 +17,7 @@
> #include <linux/errno.h>
> #include <linux/sched.h>
> #include <linux/kernel.h>
> +#include <linux/fs.h>
Your code doesn't match your patch description.
You've got new includes of:
<linux/fs.h>
<linux/proc_fs.h>
<linux/err.h>
<linux/kref.h>
and forward declarations of
struct proc_dir_entry;
struct file_operations;
As a general rule, I think it better to use includes
than use naked forward declarations.
^ permalink raw reply
* Re: [PATCH 1/5][ATM]: atm is no longer experimental
From: David Miller @ 2007-10-28 3:46 UTC (permalink / raw)
To: chas; +Cc: netdev
In-Reply-To: <200710271237.l9RCbHvl002811@cmf.nrl.navy.mil>
Sorry Chas, you'll need to submit ATM changes like this within the
merge window just like everyone else. The merge window for 2.6.24
was open for more than a week, and is now closed.
Please resubmit these during the 2.6.25 merge window.
Thank you.
^ permalink raw reply
* [PATCH] Fix/Rewrite of the mipsnet driver
From: Thiemo Seufer @ 2007-10-28 4:38 UTC (permalink / raw)
To: linux-mips; +Cc: ralf, netdev
Hello All,
currently the mipsnet driver fails after transmitting a number of
packages because SKBs are allocated but never freed. I fixed that
and coudn't refrain from removing the most egregious warts.
- mipsnet.h folded into mipsnet.c, as it doesn't provide any
useful external interface.
- Free SKB after transmission.
- Call free_irq in mipsnet_close, to balance the request_irq in
mipsnet_open.
- Removed duplicate read of rxDataCount.
- Some identifiers are now less verbose.
- Removed dead and/or unnecessarily complex code.
- Code formatting fixes.
Tested on Qemu's mipssim emulation, with this patch it can boot a
Debian NFSroot.
Thiemo
Signed-off-by: Thiemo Seufer <ths@networkno.de>
---
diff --git a/drivers/net/mipsnet.c b/drivers/net/mipsnet.c
index 9853c74..28c66c1 100644
--- a/drivers/net/mipsnet.c
+++ b/drivers/net/mipsnet.c
@@ -4,8 +4,6 @@
* for more details.
*/
-#define DEBUG
-
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -16,11 +14,93 @@
#include <asm/io.h>
#include <asm/mips-boards/simint.h>
-#include "mipsnet.h" /* actual device IO mapping */
+#define MIPSNET_VERSION "2007-10-28"
+
+/*
+ * Net status/control block as seen by sw in the core.
+ */
+struct MIPS_T_NetControl {
+ /*
+ * Device info for probing, reads as MIPSNET%d where %d is some
+ * form of version.
+ */
+ uint64_t devId; /*0x00 */
+
+ /*
+ * read only busy flag.
+ * Set and cleared by the Net Device to indicate that an rx or a tx
+ * is in progress.
+ */
+ uint32_t busy; /*0x08 */
+
+ /*
+ * Set by the Net Device.
+ * The device will set it once data has been received.
+ * The value is the number of bytes that should be read from
+ * rxDataBuffer. The value will decrease till 0 until all the data
+ * from rxDataBuffer has been read.
+ */
+ uint32_t rxDataCount; /*0x0c */
+#define MIPSNET_MAX_RXTX_DATACOUNT (1<<16)
+
+ /*
+ * Settable from the MIPS core, cleared by the Net Device.
+ * The core should set the number of bytes it wants to send,
+ * then it should write those bytes of data to txDataBuffer.
+ * The device will clear txDataCount has been processed (not
+ * necessarily sent).
+ */
+ uint32_t txDataCount; /*0x10 */
-#define MIPSNET_VERSION "2005-06-20"
+ /*
+ * Interrupt control
+ *
+ * Used to clear the interrupted generated by this dev.
+ * Write a 1 to clear the interrupt. (except bit31).
+ *
+ * Bit0 is set if it was a tx-done interrupt.
+ * Bit1 is set when new rx-data is available.
+ * Until this bit is cleared there will be no other RXs.
+ *
+ * Bit31 is used for testing, it clears after a read.
+ * Writing 1 to this bit will cause an interrupt to be generated.
+ * To clear the test interrupt, write 0 to this register.
+ */
+ uint32_t interruptControl; /*0x14 */
+#define MIPSNET_INTCTL_TXDONE ((uint32_t)(1 << 0))
+#define MIPSNET_INTCTL_RXDONE ((uint32_t)(1 << 1))
+#define MIPSNET_INTCTL_TESTBIT ((uint32_t)(1 << 31))
-#define mipsnet_reg_address(dev, field) (dev->base_addr + field_offset(field))
+ /*
+ * Readonly core-specific interrupt info for the device to signal
+ * the core. The meaning of the contents of this field might change.
+ */
+ /* XXX: the whole memIntf interrupt scheme is messy: the device
+ * should have no control what so ever of what VPE/register set is
+ * being used.
+ * The MemIntf should only expose interrupt lines, and something in
+ * the config should be responsible for the line<->core/vpe bindings.
+ */
+ uint32_t interruptInfo; /*0x18 */
+
+ /*
+ * This is where the received data is read out.
+ * There is more data to read until rxDataReady is 0.
+ * Only 1 byte at this regs offset is used.
+ */
+ uint32_t rxDataBuffer; /*0x1c */
+
+ /*
+ * This is where the data to transmit is written.
+ * Data should be written for the amount specified in the
+ * txDataCount register.
+ * Only 1 byte at this regs offset is used.
+ */
+ uint32_t txDataBuffer; /*0x20 */
+};
+
+#define regaddr(dev, field) \
+ (dev->base_addr + offsetof(MIPS_T_NetControl, field))
struct mipsnet_priv {
struct net_device_stats stats;
@@ -34,18 +114,13 @@ static char mipsnet_string[] = "mipsnet";
static int ioiocpy_frommipsnet(struct net_device *dev, unsigned char *kdata,
int len)
{
- uint32_t available_len = inl(mipsnet_reg_address(dev, rxDataCount));
- if (available_len < len)
- return -EFAULT;
+ for (; len > 0; len--, kdata++)
+ *kdata = inb(regaddr(dev, rxDataBuffer));
- for (; len > 0; len--, kdata++) {
- *kdata = inb(mipsnet_reg_address(dev, rxDataBuffer));
- }
-
- return inl(mipsnet_reg_address(dev, rxDataCount));
+ return inl(regaddr(dev, rxDataCount));
}
-static inline ssize_t mipsnet_put_todevice(struct net_device *dev,
+static inline void mipsnet_put_todevice(struct net_device *dev,
struct sk_buff *skb)
{
int count_to_go = skb->len;
@@ -55,19 +130,19 @@ static inline ssize_t mipsnet_put_todevice(struct net_device *dev,
pr_debug("%s: %s(): telling MIPSNET txDataCount(%d)\n",
dev->name, __FUNCTION__, skb->len);
- outl(skb->len, mipsnet_reg_address(dev, txDataCount));
+ outl(skb->len, regaddr(dev, txDataCount));
pr_debug("%s: %s(): sending data to MIPSNET txDataBuffer(%d)\n",
dev->name, __FUNCTION__, skb->len);
for (; count_to_go; buf_ptr++, count_to_go--) {
- outb(*buf_ptr, mipsnet_reg_address(dev, txDataBuffer));
+ outb(*buf_ptr, regaddr(dev, txDataBuffer));
}
mp->stats.tx_packets++;
mp->stats.tx_bytes += skb->len;
- return skb->len;
+ dev_kfree_skb(skb);
}
static int mipsnet_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -75,7 +150,8 @@ static int mipsnet_xmit(struct sk_buff *skb, struct net_device *dev)
pr_debug("%s:%s(): transmitting %d bytes\n",
dev->name, __FUNCTION__, skb->len);
- /* Only one packet at a time. Once TXDONE interrupt is serviced, the
+ /*
+ * Only one packet at a time. Once TXDONE interrupt is serviced, the
* queue will be restarted.
*/
netif_stop_queue(dev);
@@ -84,17 +160,19 @@ static int mipsnet_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}
-static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t count)
+static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t len)
{
struct sk_buff *skb;
- size_t len = count;
struct mipsnet_priv *mp = netdev_priv(dev);
- if (!(skb = alloc_skb(len + 2, GFP_KERNEL))) {
+ if (!len)
+ return len;
+
+ skb = dev_alloc_skb(len + 2);
+ if (!skb) {
mp->stats.rx_dropped++;
return -ENOMEM;
}
-
skb_reserve(skb, 2);
if (ioiocpy_frommipsnet(dev, skb_put(skb, len), len))
return -EFAULT;
@@ -103,70 +181,65 @@ static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t count)
skb->ip_summed = CHECKSUM_UNNECESSARY;
pr_debug("%s:%s(): pushing RXed data to kernel\n",
- dev->name, __FUNCTION__);
+ dev->name, __FUNCTION__);
netif_rx(skb);
mp->stats.rx_packets++;
mp->stats.rx_bytes += len;
- return count;
+ return len;
}
static irqreturn_t mipsnet_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
-
- irqreturn_t retval = IRQ_NONE;
- uint64_t interruptFlags;
-
- if (irq == dev->irq) {
- pr_debug("%s:%s(): irq %d for device\n",
- dev->name, __FUNCTION__, irq);
-
- retval = IRQ_HANDLED;
-
- interruptFlags =
- inl(mipsnet_reg_address(dev, interruptControl));
- pr_debug("%s:%s(): intCtl=0x%016llx\n", dev->name,
- __FUNCTION__, interruptFlags);
-
- if (interruptFlags & MIPSNET_INTCTL_TXDONE) {
- pr_debug("%s:%s(): got TXDone\n",
- dev->name, __FUNCTION__);
- outl(MIPSNET_INTCTL_TXDONE,
- mipsnet_reg_address(dev, interruptControl));
- // only one packet at a time, we are done.
- netif_wake_queue(dev);
- } else if (interruptFlags & MIPSNET_INTCTL_RXDONE) {
- pr_debug("%s:%s(): got RX data\n",
- dev->name, __FUNCTION__);
- mipsnet_get_fromdev(dev,
- inl(mipsnet_reg_address(dev, rxDataCount)));
- pr_debug("%s:%s(): clearing RX int\n",
- dev->name, __FUNCTION__);
- outl(MIPSNET_INTCTL_RXDONE,
- mipsnet_reg_address(dev, interruptControl));
-
- } else if (interruptFlags & MIPSNET_INTCTL_TESTBIT) {
- pr_debug("%s:%s(): got test interrupt\n",
- dev->name, __FUNCTION__);
- // TESTBIT is cleared on read.
- // And takes effect after a write with 0
- outl(0, mipsnet_reg_address(dev, interruptControl));
- } else {
- pr_debug("%s:%s(): no valid fags 0x%016llx\n",
- dev->name, __FUNCTION__, interruptFlags);
- // Maybe shared IRQ, just ignore, no clearing.
- retval = IRQ_NONE;
- }
-
+ struct mipsnet_priv *mp = netdev_priv(dev);
+ u32 int_flags;
+ int ret = IRQ_NONE;
+
+ if (irq != dev->irq)
+ goto out_badirq;
+
+ /* TESTBIT is cleared on read. */
+ int_flags = inl(regaddr(dev, interruptControl));
+ pr_debug("%s:%s(): irq %d intCtl=0x%x\n", dev->name,
+ __FUNCTION__, irq, int_flags);
+
+ if (int_flags & MIPSNET_INTCTL_TESTBIT) {
+ pr_debug("%s:%s(): got test interrupt\n",
+ dev->name, __FUNCTION__);
+ /* TESTBIT takes effect after a write with 0. */
+ outl(0, regaddr(dev, interruptControl));
+ ret = IRQ_HANDLED;
+ } else if (int_flags & MIPSNET_INTCTL_TXDONE) {
+ pr_debug("%s:%s(): got TXDone\n",
+ dev->name, __FUNCTION__);
+ /* Only one packet at a time, we are done. */
+ mp->stats.tx_packets++;
+ netif_wake_queue(dev);
+ pr_debug("%s:%s(): clearing TX int\n",
+ dev->name, __FUNCTION__);
+ outl(MIPSNET_INTCTL_TXDONE,
+ regaddr(dev, interruptControl));
+ ret = IRQ_HANDLED;
+ } else if (int_flags & MIPSNET_INTCTL_RXDONE) {
+ pr_debug("%s:%s(): got RX data\n", dev->name, __FUNCTION__);
+ mipsnet_get_fromdev(dev, inl(regaddr(dev, rxDataCount)));
+ pr_debug("%s:%s(): clearing RX int\n",
+ dev->name, __FUNCTION__);
+ outl(MIPSNET_INTCTL_RXDONE, regaddr(dev, interruptControl));
+ ret = IRQ_HANDLED;
} else {
- printk(KERN_INFO "%s: %s(): irq %d for unknown device\n",
- dev->name, __FUNCTION__, irq);
- retval = IRQ_NONE;
+ pr_debug("%s:%s(): no valid flags 0x%x\n",
+ dev->name, __FUNCTION__, int_flags);
}
- return retval;
-} //mipsnet_interrupt()
+ return ret;
+
+out_badirq:
+ printk(KERN_INFO "%s: %s(): irq %d for unknown device\n",
+ dev->name, __FUNCTION__, irq);
+ return ret;
+}
static int mipsnet_open(struct net_device *dev)
{
@@ -179,7 +252,7 @@ static int mipsnet_open(struct net_device *dev)
if (err) {
pr_debug("%s: %s(): can't get irq %d\n",
dev->name, __FUNCTION__, dev->irq);
- release_region(dev->base_addr, MIPSNET_IO_EXTENT);
+ release_region(dev->base_addr, sizeof(MIPS_T_NetControl));
return err;
}
@@ -189,9 +262,9 @@ static int mipsnet_open(struct net_device *dev)
netif_start_queue(dev);
- // test interrupt handler
+ /* test interrupt handler */
outl(MIPSNET_INTCTL_TESTBIT,
- mipsnet_reg_address(dev, interruptControl));
+ regaddr(dev, interruptControl));
return 0;
@@ -201,6 +274,7 @@ static int mipsnet_close(struct net_device *dev)
{
pr_debug("%s: %s()\n", dev->name, __FUNCTION__);
netif_stop_queue(dev);
+ free_irq(dev->irq, dev);
return 0;
}
@@ -213,7 +287,7 @@ static struct net_device_stats *mipsnet_get_stats(struct net_device *dev)
static void mipsnet_set_mclist(struct net_device *dev)
{
- // we don't do anything
+ /* we don't do anything */
return;
}
@@ -241,13 +315,15 @@ static int __init mipsnet_probe(struct device *dev)
*/
netdev->base_addr = 0x4200;
netdev->irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB0 +
- inl(mipsnet_reg_address(netdev, interruptInfo));
+ inl(regaddr(netdev, interruptInfo));
- // Get the io region now, get irq on open()
- if (!request_region(netdev->base_addr, MIPSNET_IO_EXTENT, "mipsnet")) {
+ /* Get the io region now, get irq on open() */
+ if (!request_region(netdev->base_addr, sizeof(MIPS_T_NetControl),
+ "mipsnet")) {
pr_debug("%s: %s(): IO region {start: 0x%04lux, len: %d} "
- "for dev is not availble.\n", netdev->name,
- __FUNCTION__, netdev->base_addr, MIPSNET_IO_EXTENT);
+ "for dev is not availble.\n", netdev->name,
+ __FUNCTION__, netdev->base_addr,
+ sizeof(MIPS_T_NetControl));
err = -EBUSY;
goto out_free_netdev;
}
@@ -267,7 +343,7 @@ static int __init mipsnet_probe(struct device *dev)
return 0;
out_free_region:
- release_region(netdev->base_addr, MIPSNET_IO_EXTENT);
+ release_region(netdev->base_addr, sizeof(MIPS_T_NetControl));
out_free_netdev:
free_netdev(netdev);
@@ -281,7 +357,7 @@ static int __devexit mipsnet_device_remove(struct device *device)
struct net_device *dev = dev_get_drvdata(device);
unregister_netdev(dev);
- release_region(dev->base_addr, MIPSNET_IO_EXTENT);
+ release_region(dev->base_addr, sizeof(MIPS_T_NetControl));
free_netdev(dev);
dev_set_drvdata(device, NULL);
diff --git a/drivers/net/mipsnet.h b/drivers/net/mipsnet.h
deleted file mode 100644
index 026c732..0000000
--- a/drivers/net/mipsnet.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#ifndef __MIPSNET_H
-#define __MIPSNET_H
-
-/*
- * Id of this Net device, as seen by the core.
- */
-#define MIPS_NET_DEV_ID ((uint64_t) \
- ((uint64_t)'M'<< 0)| \
- ((uint64_t)'I'<< 8)| \
- ((uint64_t)'P'<<16)| \
- ((uint64_t)'S'<<24)| \
- ((uint64_t)'N'<<32)| \
- ((uint64_t)'E'<<40)| \
- ((uint64_t)'T'<<48)| \
- ((uint64_t)'0'<<56))
-
-/*
- * Net status/control block as seen by sw in the core.
- * (Why not use bit fields? can't be bothered with cross-platform struct
- * packing.)
- */
-typedef struct _net_control_block {
- /// dev info for probing
- /// reads as MIPSNET%d where %d is some form of version
- uint64_t devId; /*0x00 */
-
- /*
- * read only busy flag.
- * Set and cleared by the Net Device to indicate that an rx or a tx
- * is in progress.
- */
- uint32_t busy; /*0x08 */
-
- /*
- * Set by the Net Device.
- * The device will set it once data has been received.
- * The value is the number of bytes that should be read from
- * rxDataBuffer. The value will decrease till 0 until all the data
- * from rxDataBuffer has been read.
- */
- uint32_t rxDataCount; /*0x0c */
-#define MIPSNET_MAX_RXTX_DATACOUNT (1<<16)
-
- /*
- * Settable from the MIPS core, cleared by the Net Device.
- * The core should set the number of bytes it wants to send,
- * then it should write those bytes of data to txDataBuffer.
- * The device will clear txDataCount has been processed (not necessarily sent).
- */
- uint32_t txDataCount; /*0x10 */
-
- /*
- * Interrupt control
- *
- * Used to clear the interrupted generated by this dev.
- * Write a 1 to clear the interrupt. (except bit31).
- *
- * Bit0 is set if it was a tx-done interrupt.
- * Bit1 is set when new rx-data is available.
- * Until this bit is cleared there will be no other RXs.
- *
- * Bit31 is used for testing, it clears after a read.
- * Writing 1 to this bit will cause an interrupt to be generated.
- * To clear the test interrupt, write 0 to this register.
- */
- uint32_t interruptControl; /*0x14 */
-#define MIPSNET_INTCTL_TXDONE ((uint32_t)(1<< 0))
-#define MIPSNET_INTCTL_RXDONE ((uint32_t)(1<< 1))
-#define MIPSNET_INTCTL_TESTBIT ((uint32_t)(1<<31))
-#define MIPSNET_INTCTL_ALLSOURCES (MIPSNET_INTCTL_TXDONE|MIPSNET_INTCTL_RXDONE|MIPSNET_INTCTL_TESTBIT)
-
- /*
- * Readonly core-specific interrupt info for the device to signal the core.
- * The meaning of the contents of this field might change.
- */
- /*###\todo: the whole memIntf interrupt scheme is messy: the device should have
- * no control what so ever of what VPE/register set is being used.
- * The MemIntf should only expose interrupt lines, and something in the
- * config should be responsible for the line<->core/vpe bindings.
- */
- uint32_t interruptInfo; /*0x18 */
-
- /*
- * This is where the received data is read out.
- * There is more data to read until rxDataReady is 0.
- * Only 1 byte at this regs offset is used.
- */
- uint32_t rxDataBuffer; /*0x1c */
-
- /*
- * This is where the data to transmit is written.
- * Data should be written for the amount specified in the txDataCount register.
- * Only 1 byte at this regs offset is used.
- */
- uint32_t txDataBuffer; /*0x20 */
-} MIPS_T_NetControl;
-
-#define MIPSNET_IO_EXTENT 0x40 /* being generous */
-
-#define field_offset(field) ((int)&((MIPS_T_NetControl*)(0))->field)
-
-#endif /* __MIPSNET_H */
^ permalink raw reply related
* atl1 developers wanted
From: Chris Snook @ 2007-10-28 6:33 UTC (permalink / raw)
To: atl1-devel, netdev; +Cc: jacliburn, greg
Greetings, netdev!
Since the Linux Driver Project apparently has a glut of talent, I figured I'd
ask for a little help with an existing driver. As some of you may know, Jay
Cliburn and I have been working on atl1 since last summer, and we've gotten the
driver merged and stable. It does the basic things one expects a gigE driver to
do, and it no longer does the things one expects a gigE driver to *not* do, but
there are some hardware features that we don't support very well, or at all.
If you have an atl1 board and want to get your hands dirty, we could use some
help with the following:
Performance features:
TSO -- it works, but it's really slow, so we currently disable it by default
LRO -- would be nice to have
NAPI -- would be nice to have
configurable interrupt coalescing -- we're not currently taking advantage of this
feature testing:
jumbo frames -- last I checked, I could open connections with large MTU, but
we've done very little validation, benchmarking, or optimization
IPv6 -- seems to work, but the hardware doesn't support offloading for IPv6
traffic, so we need to know about the performance to prioritize work on the
aforementioned performance features
other:
make WoLAN work reliably
-- Chris
^ permalink raw reply
* Re: [PATCH] proc_fs.h redux
From: Alexey Dobriyan @ 2007-10-28 7:02 UTC (permalink / raw)
To: Joe Perches; +Cc: akpm, torvalds, viro, linux-kernel, netdev, linux-arch
In-Reply-To: <1193524804.26695.103.camel@localhost>
On Sat, Oct 27, 2007 at 03:40:04PM -0700, Joe Perches wrote:
> On Sat, 2007-10-27 at 23:47 +0400, Alexey Dobriyan wrote:
> > Remove proc_fs.h from headers that doesn't really need it.
>
> > --- a/arch/powerpc/kernel/process.c
> > +++ b/arch/powerpc/kernel/process.c
> > @@ -17,6 +17,7 @@
> > #include <linux/errno.h>
> > #include <linux/sched.h>
> > #include <linux/kernel.h>
> > +#include <linux/fs.h>
>
> Your code doesn't match your patch description.
>
> You've got new includes of:
>
> <linux/fs.h>
> <linux/proc_fs.h>
> <linux/err.h>
> <linux/kref.h>
>
> and forward declarations of
>
> struct proc_dir_entry;
> struct file_operations;
Removal of header A from header B creates compilation breakages for
files which were getting A indirectly. So you have to complensate in all
such cases.
> As a general rule, I think it better to use includes
> than use naked forward declarations.
Well, we also want faster compilation and less time wasted when
test-compiling patches.
^ permalink raw reply
* [PATCH 2.6.24 1/1]S2io: Fixed memory leak by freeing MSI-X local entry memories when vector allocation fails
From: Sivakumar Subramani @ 2007-10-28 8:05 UTC (permalink / raw)
To: jeff, netdev; +Cc: support
- Fixed memory leak by freeing MSI-X local entry memories when vector allocation
fails in s2io_add_isr.
- Added two utility functions do_rem_msix_isr and do_rem_inta_isr to eliminate
code duplication.
Signed-off-by: Veena Parat <veena.parat@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
---
diff -Nurp 2-0-26-6/drivers/net/s2io.c 2-0-26-7/drivers/net/s2io.c
--- 2-0-26-6/drivers/net/s2io.c 2007-10-24 09:20:39.000000000 -0700
+++ 2-0-26-7/drivers/net/s2io.c 2007-10-24 09:46:16.000000000 -0700
@@ -84,7 +84,7 @@
#include "s2io.h"
#include "s2io-regs.h"
-#define DRV_VERSION "2.0.26.6"
+#define DRV_VERSION "2.0.26.7"
/* S2io Driver name & version. */
static char s2io_driver_name[] = "Neterion";
@@ -3775,6 +3775,46 @@ static int __devinit s2io_test_msi(struc
return err;
}
+
+static void do_rem_msix_isr(struct s2io_nic * sp)
+{
+ struct swStat *stats = &sp->mac_control.stats_info->sw_stat;
+ int i;
+ u16 msi_control;
+
+ for (i=1; (sp->s2io_entries[i].in_use ==
+ MSIX_REGISTERED_SUCCESS); i++) {
+ int vector = sp->entries[i].vector;
+ void *arg = sp->s2io_entries[i].arg;
+
+ synchronize_irq(vector);
+ free_irq(vector, arg);
+ }
+
+ kfree(sp->entries);
+ stats->mem_freed +=
+ (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
+ kfree(sp->s2io_entries);
+ stats->mem_freed +=
+ (MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
+ sp->entries = NULL;
+ sp->s2io_entries = NULL;
+
+ pci_read_config_word(sp->pdev, 0x42, &msi_control);
+ msi_control &= 0xFFFE; /* Disable MSI */
+ pci_write_config_word(sp->pdev, 0x42, msi_control);
+
+ pci_disable_msix(sp->pdev);
+}
+
+static void do_rem_inta_isr(struct s2io_nic * sp)
+{
+ struct net_device *dev = sp->dev;
+
+ synchronize_irq(sp->pdev->irq);
+ free_irq(sp->pdev->irq, dev);
+}
+
/* ********************************************************* *
* Functions defined below concern the OS part of the driver *
* ********************************************************* */
@@ -3809,28 +3849,11 @@ static int s2io_open(struct net_device *
int ret = s2io_enable_msi_x(sp);
if (!ret) {
- u16 msi_control;
ret = s2io_test_msi(sp);
/* rollback MSI-X, will re-enable during add_isr() */
- kfree(sp->entries);
- sp->mac_control.stats_info->sw_stat.mem_freed +=
- (MAX_REQUESTED_MSI_X *
- sizeof(struct msix_entry));
- kfree(sp->s2io_entries);
- sp->mac_control.stats_info->sw_stat.mem_freed +=
- (MAX_REQUESTED_MSI_X *
- sizeof(struct s2io_msix_entry));
- sp->entries = NULL;
- sp->s2io_entries = NULL;
-
- pci_read_config_word(sp->pdev, 0x42, &msi_control);
- msi_control &= 0xFFFE; /* Disable MSI */
- pci_write_config_word(sp->pdev, 0x42, msi_control);
-
- pci_disable_msix(sp->pdev);
-
+ do_rem_msix_isr(sp);
}
if (ret) {
@@ -6864,15 +6887,22 @@ static int s2io_add_isr(struct s2io_nic
}
}
if (err) {
+ do_rem_msix_isr(sp);
+
DBG_PRINT(ERR_DBG,"%s:MSI-X-%d registration "
"failed\n", dev->name, i);
- DBG_PRINT(ERR_DBG, "Returned: %d\n", err);
- return -1;
+
+ DBG_PRINT(ERR_DBG, "%s: Defaulting to INTA\n",
+ dev->name);
+ sp->config.intr_type = INTA;
+ break;
}
sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;
}
- printk("MSI-X-TX %d entries enabled\n",msix_tx_cnt);
- printk("MSI-X-RX %d entries enabled\n",msix_rx_cnt);
+ if(!err) {
+ printk("MSI-X-TX %d entries enabled\n",msix_tx_cnt);
+ printk("MSI-X-RX %d entries enabled\n",msix_rx_cnt);
+ }
}
if (sp->config.intr_type == INTA) {
err = request_irq((int) sp->pdev->irq, s2io_isr, IRQF_SHARED,
@@ -6887,40 +6917,10 @@ static int s2io_add_isr(struct s2io_nic
}
static void s2io_rem_isr(struct s2io_nic * sp)
{
- struct net_device *dev = sp->dev;
- struct swStat *stats = &sp->mac_control.stats_info->sw_stat;
-
- if (sp->config.intr_type == MSI_X) {
- int i;
- u16 msi_control;
-
- for (i=1; (sp->s2io_entries[i].in_use ==
- MSIX_REGISTERED_SUCCESS); i++) {
- int vector = sp->entries[i].vector;
- void *arg = sp->s2io_entries[i].arg;
-
- synchronize_irq(vector);
- free_irq(vector, arg);
- }
-
- kfree(sp->entries);
- stats->mem_freed +=
- (MAX_REQUESTED_MSI_X * sizeof(struct msix_entry));
- kfree(sp->s2io_entries);
- stats->mem_freed +=
- (MAX_REQUESTED_MSI_X * sizeof(struct s2io_msix_entry));
- sp->entries = NULL;
- sp->s2io_entries = NULL;
-
- pci_read_config_word(sp->pdev, 0x42, &msi_control);
- msi_control &= 0xFFFE; /* Disable MSI */
- pci_write_config_word(sp->pdev, 0x42, msi_control);
-
- pci_disable_msix(sp->pdev);
- } else {
- synchronize_irq(sp->pdev->irq);
- free_irq(sp->pdev->irq, dev);
- }
+ if (sp->config.intr_type == MSI_X)
+ do_rem_msix_isr(sp);
+ else
+ do_rem_inta_isr(sp);
}
static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
^ permalink raw reply
* Re: [PATCH] proc_fs.h redux
From: Sam Ravnborg @ 2007-10-28 8:44 UTC (permalink / raw)
To: Joe Perches
Cc: Alexey Dobriyan, akpm, torvalds, viro, linux-kernel, netdev,
linux-arch
In-Reply-To: <1193524804.26695.103.camel@localhost>
>
> As a general rule, I think it better to use includes
> than use naked forward declarations.
Quite the opposite - at least in the kernel source.
The general rule is that a .h file shall include the
.h files which contain declarations used by said .h files.
But naked declarations as above is preferred over including
a full header file.
We see the full header dependency thing to blow off when
inline function are used - which is more and more the case.
In several cases we have converted inline functions to macros
just to simplify the nightmare of header dependencies we have.
Arnaldo have a nice script that generate a .ps file
showing all the dependencies.
He lately posted this URL: http://oops.ghostprotocols.net:81/acme/tcp.h.ps
Sam
^ permalink raw reply
* Re: [PATCH] proc_fs.h redux
From: Russell King @ 2007-10-28 10:34 UTC (permalink / raw)
To: Joe Perches
Cc: Alexey Dobriyan, akpm, torvalds, viro, linux-kernel, netdev,
linux-arch
In-Reply-To: <1193524804.26695.103.camel@localhost>
On Sat, Oct 27, 2007 at 03:40:04PM -0700, Joe Perches wrote:
> and forward declarations of
>
> struct proc_dir_entry;
> struct file_operations;
>
> As a general rule, I think it better to use includes
> than use naked forward declarations.
If you go down that route, you end up with _lots_ of circular
dependencies - header file X needs Y needs Z which needs X. We've
been there, several times. It very quickly becomes quite
unmaintainable - you end up with hard to predict behaviour from
include files.
The only realistic solution is to use forward declarations.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply
* Re: [PATCH] proc_fs.h redux
From: Jan Engelhardt @ 2007-10-28 10:43 UTC (permalink / raw)
To: Russell King
Cc: Joe Perches, Alexey Dobriyan, akpm, torvalds, viro, linux-kernel,
netdev, linux-arch
In-Reply-To: <20071028103415.GA12554@flint.arm.linux.org.uk>
On Oct 28 2007 10:34, Russell King wrote:
>On Sat, Oct 27, 2007 at 03:40:04PM -0700, Joe Perches wrote:
>> and forward declarations of
>>
>> struct proc_dir_entry;
>> struct file_operations;
>>
>> As a general rule, I think it better to use includes
>> than use naked forward declarations.
>
>If you go down that route, you end up with _lots_ of circular
>dependencies - header file X needs Y needs Z which needs X. We've
>been there, several times. It very quickly becomes quite
>unmaintainable - you end up with hard to predict behaviour from
>include files.
>
>The only realistic solution is to use forward declarations.
Especially because it reduces the amount of I/O that needs to be done.
^ permalink raw reply
* b44 & ssb link errors on sparc
From: Meelis Roos @ 2007-10-28 10:48 UTC (permalink / raw)
To: netdev
MODPOST 434 modules
ERROR: "ioremap" [drivers/ssb/ssb.ko] undefined!
ERROR: "iounmap" [drivers/ssb/ssb.ko] undefined!
ERROR: "dma_alloc_coherent" [drivers/net/b44.ko] undefined!
ERROR: "dma_get_cache_alignment" [drivers/net/b44.ko] undefined!
ERROR: "dma_free_coherent" [drivers/net/b44.ko] undefined!
ERROR: "dma_mapping_error" [drivers/net/b44.ko] undefined!
ERROR: "dma_map_single" [drivers/net/b44.ko] undefined!
ERROR: "dma_sync_single_for_cpu" [drivers/net/b44.ko] undefined!
ERROR: "dma_sync_single_range_for_cpu" [drivers/net/b44.ko] undefined!
ERROR: "dma_unmap_single" [drivers/net/b44.ko] undefined!
Do SSB and B44 need to depend on DMA API? They can be selected on 32-bit
sparc architecture but do not link. This is 2.6.24-rc1 + yesterdays git.
--
Meelis Roos (mroos@linux.ee)
^ 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