Netdev List
 help / color / mirror / Atom feed
* Re: determine outgoing interface (eth0,eth1) for a packet according to the dest IP
From: Lennert Buytenhek @ 2006-04-30  9:17 UTC (permalink / raw)
  To: Herbert Xu; +Cc: John Que, ak, netdev
In-Reply-To: <E1FYkWm-0003MM-00@gondolin.me.apana.org.au>

On Wed, Apr 26, 2006 at 11:58:00PM +1000, Herbert Xu wrote:

> > I had spent time trying to write something which
> > uses RTA_SRC and RTA_DST and got some problems.
> > (I probably made something stupid.)
> > I googled for such examples and did not get much.
> > I saw that the zebra project and iproute uses
> > netlinks but it is complex.,
> 
> Have a look at
> 
> http://gondor.apana.org.au/~herbert/findsaddr-linux.c
> 
> which I wrote for traceroute some years back.

A fragile and ugly but easier/shorter way of getting the source address
(which I've used a couple of times in the past) is to open a SOCK_DGRAM
socket, connect() it to the intended destination, and then do
getsockname().

(That doesn't give you the interface, though.)


--L

^ permalink raw reply

* Re: IP1000 gigabit nic driver
From: Pekka Enberg @ 2006-04-30  9:26 UTC (permalink / raw)
  To: David Gómez; +Cc: David Vrabel, Francois Romieu, Linux-kernel, netdev
In-Reply-To: <1146342905.11271.3.camel@localhost>

On Sat, 2006-04-29 at 14:21 +0200, David Gómez wrote:
> > I already had it modified, just needed to create the patch... Anyway,
> > have you submitted it to netdev?

On Sat, 2006-04-29 at 23:35 +0300, Pekka Enberg wrote:
> No, I haven't. I don't have the hardware, so I can't test the driver.
> Furthermore, there's plenty of stuff to fix before it's in any shape for
> submission. If someone wants to give this patch a spin, I would love to
> hear the results.

I killed the I/O write/read macros and switched the driver to iomap.

			Pekka

Subject: [PATCH] IP1000 Gigabit Ethernet device driver

This is a cleaned up fork of the IP1000A device driver:

  <http://www.icplus.com.tw/driver-pp-IP1000A.html>

Open issues include but are not limited to:

  - ipg_probe() looks really fishy and doesn't handle all errors
    (e.g. ioremap failing).
  - ipg_nic_do_ioctl() is playing games with user-space pointer.
    We should use ethtool ioctl instead as suggested by Arjan.
  - For multiple devices, the driver uses a global root_dev and
    ipg_remove() play some tricks which look fishy.

I don't have the hardware, so I don't know if I broke anything.
The patch is 138 KB in size, so I am not including it in this
mail. You can find the patch here:

  http://www.cs.helsinki.fi/u/penberg/linux/ip1000-driver.patch

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>


^ permalink raw reply

* Re: [PATCH 3/3] Eleminate HZ from ROSE kernel interfaces
From: Bernard Pidoux @ 2006-04-30  9:35 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: David S. Miller, netdev, linux-hams
In-Reply-To: <20060429141924.GA2941@linux-mips.org>

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]


Ralf Baechle wrote :

> Index: linux-net.git/net/rose/af_rose.c
> ===================================================================
> --- linux-net.git.orig/net/rose/af_rose.c	2006-04-29 01:54:21.000000000 +0100
> +++ linux-net.git/net/rose/af_rose.c	2006-04-29 11:37:34.000000000 +0100

While patching af_rose.c, would you consider the following patch 
ROSE/FPAC users have introduced a year ago with good success.

73 de Bernard, f6bvp

http://f6bvp.org
http://rose.fpac.free.fr/MINI-HOWTO/
http://rose.fpac.free.fr/MINI-HOWTO-FR/


[-- Attachment #2: af_rose.diff --]
[-- Type: text/x-patch, Size: 716 bytes --]

--- linux/net/rose/af_rose.c.orig	2006-04-30 11:30:48.000000000 +0200
+++ linux/net/rose/af_rose.c	2006-04-30 11:27:35.000000000 +0200
@@ -753,6 +753,7 @@
 
 		rose_insert_socket(sk);		/* Finish the bind */
 	}
+rose_try_next_neigh:
 	rose->dest_addr   = addr->srose_addr;
 	rose->dest_call   = addr->srose_call;
 	rose->rand        = ((long)rose & 0xFFFF) + rose->lci;
@@ -810,6 +811,11 @@
 	}
 
 	if (sk->sk_state != TCP_ESTABLISHED) {
+	/* Try next neighbour */
+		rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic);
+		if (rose->neighbour)
+			goto rose_try_next_neigh;
+	/* No more neighbour */
 		sock->state = SS_UNCONNECTED;
 		return sock_error(sk);	/* Always set at this point */
 	}

^ permalink raw reply

* Re: Fw: Bug: PPP dropouts in >=2.6.16
From: theosch @ 2006-04-30 11:43 UTC (permalink / raw)
  To: netdev
In-Reply-To: <Pine.LNX.4.58.0604202217450.4014@pc>


Maybe this is an issue of the e100 driver?

I observed a 1-2 sec stalling behaviour for the complete system every
10 seconds or so _seemingly_ only when my ADSL connection was up. That
was after I had changed the ethernet driver for a card _not_ connected
to the modem from eepro100 to e100.

After a lot of fiddling around with git-bisect trying to find the
erroneous patch I realized I had changed the driver when upgrading the
kernel to 2.6.14. The problem also existed in later kernel versions.
Going back to e100 helped.

Cheers
Arnold


If you have any question, please Cc to theosch at gmx.net as I am not
subscibed to the list.

+ + + + +
Using Kernel pppoe
PCI-Rev: Don't know (well, it says "PCI: PCI BIOS revision 2.10...")

# CONFIG_SMP is not set
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_VOLUNTARY=y
# CONFIG_PREEMPT is not set

First ethernet (connected to ADSL modem): 
PCI: Found IRQ 11 for device 0000:00:0c.0
3c59x: Donald Becker and others. www.scyld.com/network/vortex.html
0000:00:0c.0: 3Com PCI 3c905B Cyclone 100baseTx at e0800000. Vers LK1.1.19

Second ethernet (local LAN):
eepro100.c:v1.09j-t 9/29/99 Donald Becker http://www.scyld.com/network/eepro100.html
eepro100.c: $Revision: 1.36 $ 2000/11/17 Modified by Andrey V. Savochkin <saw@saw.sw.com.sg> and others
PCI: Found IRQ 10 for device 0000:00:0b.0
eth1: 0000:00:0b.0, 00:D0:B7:83:58:26, IRQ 10.
  Board assembly 721383-009, Physical connectors present: RJ45
  Primary interface chip i82555 PHY #1.
  General self-test: passed.
  Serial sub-system self-test: passed.
  Internal registers self-test: passed.
  ROM checksum self-test: passed (0x04f4518b).


^ permalink raw reply

* Re: [AX25, ROSE] Remove useless SET_MODULE_OWNER calls.
From: Dan Williams @ 2006-04-30 12:03 UTC (permalink / raw)
  To: Ralf Baechle DL5RB; +Cc: David S. Miller, netdev, linux-hams
In-Reply-To: <20060429142943.GA4402@linux-mips.org>

On Sat, 2006-04-29 at 15:29 +0100, Ralf Baechle DL5RB wrote:
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 
> --
> 
>  net/netrom/nr_dev.c |    1 -
>  net/rose/rose_dev.c |    1 -
>  2 files changed, 2 deletions(-)
> 
> Index: linux-net.git/net/netrom/nr_dev.c
> ===================================================================
> --- linux-net.git.orig/net/netrom/nr_dev.c	2006-04-29 01:43:47.000000000 +0100
> +++ linux-net.git/net/netrom/nr_dev.c	2006-04-29 11:38:00.000000000 +0100
> @@ -185,7 +185,6 @@ static struct net_device_stats *nr_get_s
>  
>  void nr_setup(struct net_device *dev)
>  {
> -	SET_MODULE_OWNER(dev);
>  	dev->mtu		= NR_MAX_PACKET_SIZE;
>  	dev->hard_start_xmit	= nr_xmit;
>  	dev->open		= nr_open;

Are these done by anything else now?  Did something change to make
SET_MODULE_OWNER useless in individual drivers?  I'm asking because I
was fairly sure that SET_MODULE_OWNER set up some sysfs links and such
that HAL depends on to figure out information about the driver and
hardware device, much like SET_NETDEV_DEV.

Dan



^ permalink raw reply

* Re: Fw: Bug: PPP dropouts in >=2.6.16
From: theosch @ 2006-04-30 12:05 UTC (permalink / raw)
  To: netdev
In-Reply-To: <20060430114356.GA9810@ats.dyn.bawue.de>


> Going back to e100 helped

Sorry, I meant: Going back to eepro100 helped


^ permalink raw reply

* Re: wireless-dev: warnings while removing bcm43xx-d80211
From: Jiri Benc @ 2006-04-30 12:15 UTC (permalink / raw)
  To: Johannes Berg; +Cc: netdev, Broadcom Linux
In-Reply-To: <1146308425.5019.38.camel@localhost>

Sat, 29 Apr 2006 13:00:25 +0200, Johannes Berg pise:
> This didn't look too good to me, maybe someone can investigate?
> 
> [24070.841580] Badness in remove_proc_entry at fs/proc/generic.c:732
> [24070.841593] Call Trace:
> [...]

I know about this (also mentioned it at Wireless summit), I'm working on
it.

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs

^ permalink raw reply

* Re: wireless-dev: warnings while removing bcm43xx-d80211
From: Michael Buesch @ 2006-04-30 12:49 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, Broadcom Linux, Johannes Berg
In-Reply-To: <20060430141520.5f0ef66a@logostar.upir.cz>

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

On Sunday 30 April 2006 14:15, you wrote:
> Sat, 29 Apr 2006 13:00:25 +0200, Johannes Berg pise:
> > This didn't look too good to me, maybe someone can investigate?
> > 
> > [24070.841580] Badness in remove_proc_entry at fs/proc/generic.c:732
> > [24070.841593] Call Trace:
> > [...]
> 
> I know about this (also mentioned it at Wireless summit), I'm working on
> it.

Hm, seems like I did not listen to you. :P
How does this happen? I never saw it.

-- 
Greetings Michael.

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply

* Re: determine outgoing interface (eth0,eth1) for a packet according to the dest IP
From: Herbert Xu @ 2006-04-30 12:55 UTC (permalink / raw)
  To: Lennert Buytenhek; +Cc: John Que, ak, netdev
In-Reply-To: <20060430091711.GL24458@xi.wantstofly.org>

On Sun, Apr 30, 2006 at 11:17:11AM +0200, Lennert Buytenhek wrote:
> 
> A fragile and ugly but easier/shorter way of getting the source address
> (which I've used a couple of times in the past) is to open a SOCK_DGRAM
> socket, connect() it to the intended destination, and then do
> getsockname().

Yes you're quite right that this would've been a much simpler solution.
I suppose I was quite fond of the netlink hammer at the time :)
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: [AX25, ROSE] Remove useless SET_MODULE_OWNER calls.
From: Herbert Xu @ 2006-04-30 13:38 UTC (permalink / raw)
  To: Dan Williams; +Cc: ralf, davem, netdev, linux-hams
In-Reply-To: <1146398606.2252.1.camel@localhost.localdomain>

Dan Williams <dcbw@redhat.com> wrote:
> 
> Are these done by anything else now?  Did something change to make
> SET_MODULE_OWNER useless in individual drivers?  I'm asking because I

SET_MODULE_OWNER has been a no-op ever since Dave made live network
device driver modules unloadable nearly three years ago.

> was fairly sure that SET_MODULE_OWNER set up some sysfs links and such
> that HAL depends on to figure out information about the driver and
> hardware device, much like SET_NETDEV_DEV.

For PCI drivers the module information is injected by pci_register_driver.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* Re: Fw: Bug: PPP dropouts in >=2.6.16
From: Nuri Jawad @ 2006-04-30 14:10 UTC (permalink / raw)
  To: netdev
In-Reply-To: <20060430114356.GA9810@ats.dyn.bawue.de>

On Sun, 30 Apr 2006, theosch@gmx.net wrote:

> I observed a 1-2 sec stalling behaviour for the complete system every
> 10 seconds or so _seemingly_ only when my ADSL connection was up.

I had that idea too, but that sounds different from what I have here. I 
have also transfered lots of data at >900 MBits/s with the e1000 and 
never had a single problem. The packets are not vanishing on the wire and 
the system does not stall, there's just nothing appearing on ppp0 tx at 
all. That sounds like an unrelated issue to me. 
BTW, there was no dropout in the last 8 hours, only after I started some 
tx load a while ago one of them came up within minutes.

> erroneous patch I realized I had changed the driver when upgrading the
> kernel to 2.6.14.

What does 2.6.14 have to do with it? The ppp problem appeared exactly with 
*2.6.16*. It looks like it will also be in 2.6.17 because nobody is 
stepping on the brake :/. All this with code that had worked perfectly 
fine for ages. I'm getting a bit frustrated here.

Well, I might try disabling the onboard e1000 and replacing it with a 
"good" old Realtek.

Regards, Nuri

^ permalink raw reply

* VLAN subinterfaces, bridges and udev
From: Marco d'Itri @ 2006-04-30 14:29 UTC (permalink / raw)
  To: netdev

[Please Cc me, I am not subscribed to netdev.]

Can I rely on the presence of the $DEVPATH/driver symlink (e.g.
/sys/class/net/eth0/driver) to check if a network interface is a "real"
device insteaf of a VLAN or a bridge?

----- Forwarded message from Marco d'Itri <md@Linux.IT> -----

To: linux-hotplug-devel@lists.sourceforge.net
Subject: VLAN subinterfaces
From: Marco d'Itri <md@Linux.IT>

I wrote a script to handle persistent rules for network interfaces, but
I noticed that VLAN subinterfaces have the same MAC address of the
parent interface and I could not find in sysfs anything evident which I
could use in a rule. The only difference I noticed is that the VLAN
subinterfaces lack the device and drivers symlinks.
This problem affects anybody using VLANs, is there a good solution?

-- 
ciao,
Marco

----- End forwarded message -----
----- Forwarded message from Marco d'Itri <md@Linux.IT> -----

To: linux-hotplug-devel@lists.sourceforge.net
Subject: Re: VLAN subinterfaces
From: Marco d'Itri <md@Linux.IT>

On Apr 23, Marco d'Itri <md@Linux.IT> wrote:

> I wrote a script to handle persistent rules for network interfaces, but
> I noticed that VLAN subinterfaces have the same MAC address of the
> parent interface and I could not find in sysfs anything evident which I
> could use in a rule. The only difference I noticed is that the VLAN
> subinterfaces lack the device and drivers symlinks.
> This problem affects anybody using VLANs, is there a good solution?
Another user (Debian bug #365248) reported that this applies to bridges
too. Is adding DRIVER=="?*" to the rules the correct workaround?

-- 
ciao,
Marco


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

----- End forwarded message -----

-- 
ciao,
Marco

^ permalink raw reply

* Re: [AX25, ROSE] Remove useless SET_MODULE_OWNER calls.
From: Dan Williams @ 2006-04-30 17:04 UTC (permalink / raw)
  To: Herbert Xu; +Cc: ralf, davem, netdev, linux-hams
In-Reply-To: <E1FaC7e-0003Cj-00@gondolin.me.apana.org.au>

On Sun, 2006-04-30 at 23:38 +1000, Herbert Xu wrote:
> Dan Williams <dcbw@redhat.com> wrote:
> > 
> > Are these done by anything else now?  Did something change to make
> > SET_MODULE_OWNER useless in individual drivers?  I'm asking because I
> 
> SET_MODULE_OWNER has been a no-op ever since Dave made live network
> device driver modules unloadable nearly three years ago.

Ah, thanks for the clarification.

dan



^ permalink raw reply

* [PATCH] Add some new card IDs to hostap_cs
From: Marcin Juszkiewicz @ 2006-04-30 17:22 UTC (permalink / raw)
  To: netdev; +Cc: hostap, Pavel Roskin, Jouni Malinen, linux-kernel


I use two Zaurus palmtops - one run 2.4.18 kernel and second run 2.6.16.
Both are running under control of OpenZaurus distribution (I'm Release
Manager of it).

When I use pcmcia-cs then my Pretec WiFi card is handled by hostap
driver and everything is working fine. Recently I switched to
pcmciautils and after card insert orinoco modules are loaded. I prefer
to use hostap modules because they work the same under 2.4 and 2.6
kernels (with orinoco I have to use 0.13e ones because never ones does
not work under 2.4/arm).

Few weeks ago I sent smaller version to LKML, got response from Pavel 
Roskin (with his patch attached) and then I worked on converting our
(OpenEmbedded one) hostap_cs.conf to one patch which will add every
card which we had there during last years (definitions was collected
by users/developers of Familiar, OpenZaurus and OpenSimpad distributions).

This patch require 24_hostap_cs_id.diff [1] from Pavel Roskin.

Some hashes can be wrong but I want to get info what do you thing about
this patch.

PS I'm not subscribed to those mailinglists - please Cc: me on reply.

1. http://ewi546.ewi.utwente.nl/tmp/hrw/hostap/24-hostap_cs_id.diff

Signed-off-by: Marcin Juszkiewicz <openembedded@hrw.one.pl>

--- linux/drivers/net/wireless/hostap/hostap_cs.c.orig
+++ linux/drivers/net/wireless/hostap/hostap_cs.c
@@ -874,18 +874,25 @@
 static struct pcmcia_device_id hostap_cs_ids[] = {
 	PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7100),
 	PCMCIA_DEVICE_MANF_CARD(0x000b, 0x7300),
+	PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0001), /* "Intel PRO/Wireless 2011" */
 	PCMCIA_DEVICE_MANF_CARD(0x0089, 0x0002),
 	PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777),
 	PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000),
 	PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002),
+	PCMCIA_DEVICE_MANF_CARD(0x01eb, 0x080a), /* "Nortel Networks eMobility 802.11 Wireless Adapter" */
 	PCMCIA_DEVICE_MANF_CARD(0x01ff, 0x0008),
 	PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002),
+	PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* "AirWay 802.11 Adapter (PCMCIA)" */
 	PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030b),
 	PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612),
 	PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613),
+	PCMCIA_DEVICE_MANF_CARD(0x0274, 0x3301), /* "Linksys WCF11 11Mbps 802.11b WLAN Card" */
 	PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0002),
+	PCMCIA_DEVICE_MANF_CARD(0x028a, 0x0673), /* "Linksys Wireless CompactFlash Card WCF12" */
 	PCMCIA_DEVICE_MANF_CARD(0x02aa, 0x0002),
+	PCMCIA_DEVICE_MANF_CARD(0x02ac, 0x0002), /* "SpeedStream SS1021 Wireless Adapter" */
 	PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001),
+	PCMCIA_DEVICE_MANF_CARD(0x1668, 0x0101), /* "Actiontec 802CI2" */
 	PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001),
 	PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300),
 	PCMCIA_DEVICE_MANF_CARD(0x9005, 0x0021),
@@ -893,6 +900,7 @@
 	PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),
 	PCMCIA_DEVICE_MANF_CARD(0xc250, 0x0002),
 	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002),
+	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0004), /* "Sitecom WL-007 WLAN CF Card" */
 	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005),
 	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010),
 	PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "INTERSIL",
@@ -969,6 +977,151 @@
 	PCMCIA_DEVICE_PROD_ID12(
 		"ZoomAir 11Mbps High", "Rate wireless Networking",
 		0x273fe3db, 0x32a1eaee),
+
+	/*card "Fulbond Airbond XI-300B"*/
+	PCMCIA_DEVICE_PROD_ID12( " ", "IEEE 802.11 Wireless LAN/PC Card",
+			0x5670ee60, 0x74e6b7c0),
+	/*   manfid 0xd601, 0x0002*/
+
+	/*card "3Com AirConnect"*/
+	PCMCIA_DEVICE_PROD_ID12("3Com", "3CRWE737A AirConnect Wireless LAN PC Card",
+			0x90952d33, 0xfa4f2ce9),
+
+	/*card "D-Link DWL-650"*/
+	PCMCIA_DEVICE_PROD_ID12( "D", "Link DWL-650 11Mbps WLAN Card",
+			0xdfad2f93, 0xaeaf66ea),
+
+	/*card "D-Link DRC-650"*/
+	PCMCIA_DEVICE_PROD_ID12( "D", "Link DRC-650 11Mbps WLAN Card",
+			0x124d5155, 0x62ff301f),
+
+	/*card "HyperLink Wireless PC Card 11Mbps"*/
+	PCMCIA_DEVICE_PROD_ID12( "HyperLink", "Wireless PC Card 11Mbps",
+			0xf2ab1a6b, 0x16a66dec),
+
+	/*card "MELCO WLI-PCM-L11"*/
+	PCMCIA_DEVICE_PROD_ID12( "MELCO", "WLI-PCM-L11",
+			0xc549cac9, 0xc2f6de9b),
+
+	/*card "MELCO WLI-PCM-L11G"*/
+	PCMCIA_DEVICE_PROD_ID12( "MELCO", "WLI-PCM-L11G",
+			0xfebebb55, 0x6db62357),
+
+	/*card "MELCO WLI-PCM-L11G"*/
+	PCMCIA_DEVICE_PROD_ID12( "BUFFALO", "WLI-PCM-L11G",
+			0x6cdab6ea, 0xc364d25d),
+
+	/*card "Buffalo WLI2-CF-S11"*/
+	PCMCIA_DEVICE_PROD_ID12( "BUFFALO", "WLI2-CF-S11",
+			0x798caeca, 0xe38746ab),
+
+	/*card "NCR WaveLAN/IEEE Adapter"*/
+	PCMCIA_DEVICE_PROD_ID12( "NCR", "WaveLAN/IEEE",
+			0x7b03a1a1, 0x1e9b31cf),
+
+	/*card "PLANEX GeoWave GW-CF110"*/
+	PCMCIA_DEVICE_PROD_ID12( "PLANEX", "GeoWave/GW-CF110",
+			0xfc599cd7, 0xbd486a2b),
+
+	/*card "PROXIM LAN PC CARD HARMONY 80211B"*/
+	PCMCIA_DEVICE_PROD_ID12( "PROXIM", "LAN PC CARD HARMONY 80211B",
+			0x73fc1d26, 0x87a9b674),
+
+	/*card "Proxim RangeLAN/DS"*/
+	PCMCIA_DEVICE_PROD_ID12( "PROXIM","RangeLAN-DS/LAN PC CARD",
+			0x2aacece5, 0xf3165e33),
+	/*  manfid 0x0126, 0x8000*/
+
+	/*card "SAMSUNG 11Mbps WLAN Card"*/
+	PCMCIA_DEVICE_PROD_ID12( "SAMSUNG", "11Mbps WLAN Card",
+			0xc621522d, 0x7db4e5f0),
+
+	/*card "SanDisk ConnectPlus w/ Memory"*/
+	PCMCIA_DEVICE_PROD_ID12( "SanDisk", "ConnectPlus",
+			0xeed76820, 0x57dcd73e),
+	/*   manfid 0xd601, 0x0101*/
+
+	/*card "U.S. Robotics IEEE 802.11b PC-CARD"*/
+	PCMCIA_DEVICE_PROD_ID123( "U.S. Robotics", "IEEE 802.11b PC-CARD", 
+			"Version 01.02",
+			0xc274c253, 0x81e83306, 0x753707e3),
+
+	/*card "Longshine LCR-8531 11Mbps WLAN PCMCIA CARD"*/
+	PCMCIA_DEVICE_PROD_ID123( "OEM", "PRISM2 IEEE 802.11 PC-Card", 
+			"Version 01.02",
+			0xc1242b52, 0xe65091b7, 0xb95beace),
+
+	/*card "Level-One WPC-0100"*/
+	PCMCIA_DEVICE_PROD_ID123( "Digital Data Communications", "WPC-0100",
+			"Version 00.00",
+			0x3c4f10c9, 0x963a48e5, 0x6b28acd),
+	/*   manfid 0x0156, 0x0002*/
+
+	/*card "Belkin 802.11b WLAN PCMCIA"*/
+	PCMCIA_DEVICE_PROD_ID123( "Belkin", 
+			"11Mbps Wireless Notebook Network Adapter", "Version 01.02",
+			0x86f06bf4, 0x7f1c625, 0xe3e8328),
+	/*   manfid 0x0156, 0x0002*/
+
+	/*card "Senao SL-2011CD/SL-2011CDPLUS"*/
+	PCMCIA_DEVICE_PROD_ID123( "INTERSIL", "HFA384x/IEEE", "Version 01.02",
+			0xaa245f03, 0xfc153421, 0xc1fb16f9),
+	/*   manfid 0x0156, 0x0002*/
+
+	/*card "Netgear MA401"*/
+	PCMCIA_DEVICE_PROD_ID123( "NETGEAR MA401 Wireless PC", "Card",
+			"Version 01.00",
+			0x2d28b025, 0x6df900aa, 0x1f2b0825),
+
+	/*card "Airvast WL100"*/
+	PCMCIA_DEVICE_PROD_ID123( "AIRVAST", "IEEE 802.11b Wireless PCMCIA Card",
+			"HFA3863",
+			0xdc579992, 0x9c73262e, 0xcc8c8afe),
+	/*   manfid 0x50c2, 0x0001*/
+
+	/*card "Allied Telesyn AT-WCL452"*/
+	PCMCIA_DEVICE_PROD_ID123( "Allied Telesyn",
+			"AT-WCL452 Wireless PCMCIA Radio", "Ver. 1.00",
+			0xc57766a0, 0xca5d9d30, 0xdce3940c),
+	/*   manfid 0xc00f, 0x000*/
+
+	/*card "ASUS WL-100 8011b WLAN PC Card"*/
+	PCMCIA_DEVICE_PROD_ID123("ASUS", "802_11b_PC_CARD_25", "Version 01.00",
+			0x45ae513c, 0x25e956b5, 0x4d4f9549),
+	/*   manfid 0x02aa, 0x0002*/
+
+	/*card "Wireless LAN Adapter Version 01.02"*/
+	PCMCIA_DEVICE_PROD_ID123( "Wireless", "LAN Adapter", "Version 01.02",
+			0x0cc3741d, 0x77846ac8, 0x280d341f),
+
+	/*card "D-Link DWL-650 Rev. P1"*/
+	PCMCIA_DEVICE_PROD_ID1234( "D-Link", "DWL-650 Wireless PC Card RevP",
+			"ISL37101P-10", "A3",
+			0x368662a9, 0x269d73b1, 0xb0136b54, 0xfac1bb25),
+
+	/*card "SonicWALL Long Range Wireless Card"*/
+	PCMCIA_DEVICE_PROD_ID1234( "SonicWALL", "Long Range Wireless Card",
+			"ISL37100P", "1.0",
+			0xfe59b73c, 0xdee96647, 0x2cc2096b, 0x3546bfc1),
+	/*   manfid 0x000b, 0x7100*/
+
+	/*card "Senao NL-2011CD PLUS Ext2 Mercury"*/
+	PCMCIA_DEVICE_PROD_ID1234( "WLAN", "11Mbps_PC-Card_3.0", "ISL37100P",
+			"Eval-RevA",
+			0x8d96f5be, 0xdb4801eb, 0x60ae1479, 0xb3cd1a59),
+	/*   manfid 0x000b, 0x7100*/
+
+	/*card "Microsoft Wireless Notebook Adapter MN-520 1.0.3"*/
+	PCMCIA_DEVICE_PROD_ID1234( "Microsoft", "Wireless Notebook Adapter MN-520",
+			"", "1.0.3",
+			0x51dc9ca9, 0x3684178d, 0x00000000 , 0x87ebda3b),
+	/*   manfid 0x02d2, 0x0001*/
+
+	/*card "NETGEAR MA401RA"*/
+	PCMCIA_DEVICE_PROD_ID1234( "NETGEAR MA401RA Wireless PC", "Card",
+			"ISL37300P", "Eval-RevA",
+			0x76d8b84, 0xb98efcc9, 0x6b5190fc, 0xe48c0c83),
+	/*   manfid 0x000b, 0x7300*/
 	PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids);


-- 
JID: hrw-jabber.org
Palmtop: Sharp Zaurus C760
OpenEmbedded/OpenZaurus developer

           Q:      What's a light-year?
           A:      One-third less calories than a regular year.

^ permalink raw reply

* [PATCH] softmac: make non-operational after being stopped
From: Daniel Drake @ 2006-04-30 17:33 UTC (permalink / raw)
  To: linville; +Cc: johannes, netdev, softmac-dev

zd1211 with softmac and wpa_supplicant revealed an issue with softmac and the
use of workqueues. Some of the work functions actually reschedule themselves,
so this meant that there could still be pending work after
flush_scheduled_work() had been called during ieee80211softmac_stop().

This patch introduces a "running" flag which is used to ensure that
rescheduling does not happen in this situation.

I also used this flag to ensure that softmac's hooks into ieee80211 are
non-operational once the stop operation has been started. This simply makes
softmac a little more robust, because I could crash it easily by receiving
frames in the short timeframe after shutting down softmac and before turning
off the ZD1211 radio. (ZD1211 is now fixed as well!)

Signed-off-by: Daniel Drake <dsd@gentoo.org>

Index: linux/net/ieee80211/softmac/ieee80211softmac_module.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_module.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -89,6 +89,8 @@ ieee80211softmac_clear_pending_work(stru
 	ieee80211softmac_wait_for_scan(sm);
 	
 	spin_lock_irqsave(&sm->lock, flags);
+	sm->running = 0;
+
 	/* Free all pending assoc work items */
 	cancel_delayed_work(&sm->associnfo.work);
 	
@@ -204,6 +206,8 @@ void ieee80211softmac_start(struct net_d
 		assert(0);
 	if (mac->txrates_change)
 		mac->txrates_change(dev, change, &oldrates);
+
+	mac->running = 1;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_start);
 
Index: linux/include/net/ieee80211softmac.h
===================================================================
--- linux.orig/include/net/ieee80211softmac.h
+++ linux/include/net/ieee80211softmac.h
@@ -204,7 +204,8 @@ struct ieee80211softmac_device {
 	
 	/* couple of flags */
 	u8 scanning:1, /* protects scanning from being done multiple times at once */
-	   associated:1;
+	   associated:1,
+	   running:1;
 	
 	struct ieee80211softmac_scaninfo *scaninfo;
 	struct ieee80211softmac_assoc_info associnfo;
Index: linux/net/ieee80211/softmac/ieee80211softmac_auth.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -86,6 +86,11 @@ ieee80211softmac_auth_queue(void *data)
 		
 		/* Lock and set flags */
 		spin_lock_irqsave(&mac->lock, flags);
+		if (unlikely(!mac->running)) {
+			/* Prevent reschedule on workqueue flush */
+			spin_unlock_irqrestore(&mac->lock, flags);
+			return;
+		}
 		net->authenticated = 0;
 		net->authenticating = 1;
 		/* add a timeout call so we eventually give up waiting for an auth reply */
@@ -124,6 +129,9 @@ ieee80211softmac_auth_resp(struct net_de
 	unsigned long flags;
 	u8 * data;
 	
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	/* Find correct auth queue item */
 	spin_lock_irqsave(&mac->lock, flags);
 	list_for_each(list_ptr, &mac->auth_queue) {
@@ -338,6 +346,9 @@ ieee80211softmac_deauth_resp(struct net_
 	struct ieee80211softmac_network *net = NULL;
 	struct ieee80211softmac_device *mac = ieee80211_priv(dev);
 	
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	if (!deauth) {
 		dprintk("deauth without deauth packet. eek!n");
 		return 0;
Index: linux/net/ieee80211/softmac/ieee80211softmac_assoc.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -51,11 +51,12 @@ ieee80211softmac_assoc(struct ieee80211s
 	spin_lock_irqsave(&mac->lock, flags);
 	mac->associnfo.associating = 1;
 	mac->associated = 0; /* just to make sure */
-	spin_unlock_irqrestore(&mac->lock, flags);
 
 	/* Set a timer for timeout */
 	/* FIXME: make timeout configurable */
-	schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ);
+	if (likely(mac->running))
+		schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ);
+	spin_unlock_irqrestore(&mac->lock, flags);
 }
 
 void
@@ -319,6 +320,9 @@ ieee80211softmac_handle_assoc_response(s
 	u16 status = le16_to_cpup(&resp->status);
 	struct ieee80211softmac_network *network = NULL;
 	unsigned long flags;
+
+	if (unlikely(!mac->running))
+		return -ENODEV;
 	
 	spin_lock_irqsave(&mac->lock, flags);
 
@@ -377,10 +381,16 @@ ieee80211softmac_handle_disassoc(struct 
 {
 	struct ieee80211softmac_device *mac = ieee80211_priv(dev);
 	unsigned long flags;
+
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN))
 		return 0;
+
 	if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN))
 		return 0;
+
 	dprintk(KERN_INFO PFX "got disassoc framen");
 	netif_carrier_off(dev);
 	spin_lock_irqsave(&mac->lock, flags);
@@ -400,6 +410,9 @@ ieee80211softmac_handle_reassoc_req(stru
 	struct ieee80211softmac_device *mac = ieee80211_priv(dev);
 	struct ieee80211softmac_network *network;
 
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3);
 	if (!network) {
 		dprintkl(KERN_INFO PFX "reassoc request from unknown networkn");
Index: linux/net/ieee80211/softmac/ieee80211softmac_scan.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_scan.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_scan.c
@@ -115,7 +115,15 @@ void ieee80211softmac_scan(void *d)
 			// TODO: is this if correct, or should we do this only if scanning from assoc request?
 			if (sm->associnfo.req_essid.len)
 				ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0);
+
+			spin_lock_irqsave(&sm->lock, flags);
+			if (unlikely(!sm->running)) {
+				/* Prevent reschedule on workqueue flush */
+				spin_unlock_irqrestore(&sm->lock, flags);
+				break;
+			}
 			schedule_delayed_work(&si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY);
+			spin_unlock_irqrestore(&sm->lock, flags);
 			return;
 		} else {
 			dprintk(PFX "Not probing Channel %d (not allowed here)n", si->channels[current_channel_idx].channel);

^ permalink raw reply

* Re: [PATCH] softmac: make non-operational after being stopped
From: Johannes Berg @ 2006-04-30 18:06 UTC (permalink / raw)
  To: Daniel Drake; +Cc: linville, netdev, softmac-dev
In-Reply-To: <20060430173353.16363886AB1@zog.reactivated.net>

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

On Sun, 2006-04-30 at 18:33 +0100, Daniel Drake wrote:
> zd1211 with softmac and wpa_supplicant revealed an issue with softmac and the
> use of workqueues. Some of the work functions actually reschedule themselves,
> so this meant that there could still be pending work after
> flush_scheduled_work() had been called during ieee80211softmac_stop().
> 
> This patch introduces a "running" flag which is used to ensure that
> rescheduling does not happen in this situation.
[...]
> Signed-off-by: Daniel Drake <dsd@gentoo.org>

Acked-by: Johannes Berg <johannes@sipsolutions.net>

Not sure what state 2.6.17 is in now, but I'm thinking it's almost a
miracle people aren't hitting this more with bcm43xx. And it kills the
kernel pretty effectively too ;)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

^ permalink raw reply

* [PATCH] softmac: don't reassociate if user asked for deauthentication
From: Daniel Drake @ 2006-04-30 18:49 UTC (permalink / raw)
  To: linville; +Cc: netdev, johannes, softmac-dev

When wpa_supplicant exits, it uses SIOCSIWMLME to request deauthentication.
softmac then tries to reassociate without any user intervention, which isn't
the desired behaviour of this signal.

This change makes softmac only attempt reassociation if the remote network
itself deauthenticated us.

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>

Index: linux-2.6.17-rc3/net/ieee80211/softmac/ieee80211softmac_auth.c
===================================================================
--- linux-2.6.17-rc3.orig/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ linux-2.6.17-rc3/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -301,8 +301,6 @@ ieee80211softmac_deauth_from_net(struct 
 	
 	/* can't transmit data right now... */
 	netif_carrier_off(mac->dev);
-	/* let's try to re-associate */
-	schedule_work(&mac->associnfo.work);
 	spin_unlock_irqrestore(&mac->lock, flags);
 }
 
@@ -363,5 +361,8 @@ ieee80211softmac_deauth_resp(struct net_
 	}
 
 	ieee80211softmac_deauth_from_net(mac, net);
+
+	/* let's try to re-associate */
+	schedule_work(&mac->associnfo.work);
 	return 0;
 }

^ permalink raw reply

* RtNetlink in wireless.c and netlink_broadcast(uevent_sock,...) - newbie
From: Xu Nakajima @ 2006-04-30 19:14 UTC (permalink / raw)
  To: netdev

Hello,

I saw that in the wireless linux stack, there is usage

of sending messages to user space via the RtNetlink
event channel : 
in net/core/wireless.c,  wireless_send_event() method
calls rtmsg_iwinfo() which calls
netlink_broadcast(rtnl, skb, 0, RTNLGRP_LINK,
GFP_ATOMIC); (it fills a struct with 
rtnetlink_fill_iwinfo before).

On the other hand, I see that for example, in the case
of 
sending messeges to userspace udev socket, the
netlink_broadcast() call is with a different
mecahinsm;  
In lib/kobject_uevent.c, there is the following call
netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);

Is there something special about RtNetlink event
channel
which makes it needed fot wireless.c (for example)? 
While udev can use some other mechanism ?
What is special about RtNetlink event channel
in comaprison to non RtNetlink channels?

Regards,
Xu



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply

* Re: wireless-dev: warnings while removing bcm43xx-d80211
From: Jiri Benc @ 2006-04-30 19:18 UTC (permalink / raw)
  To: Michael Buesch; +Cc: netdev, Broadcom Linux, Johannes Berg
In-Reply-To: <200604301449.46431.mb@bu3sch.de>

Sun, 30 Apr 2006 14:49:45 +0200, Michael Buesch pise:
> Hm, seems like I did not listen to you. :P
> How does this happen? I never saw it.

Usually when a net interface is renamed (by udev for example). The stack
then tries to remove wrong procfs directory.

 Jiri

-- 
Jiri Benc
SUSE Labs

^ permalink raw reply

* Re: [PATCH 2/3] Eleminate HZ from NET/ROM kernel interfaces
From: Bernard Pidoux @ 2006-04-30 19:34 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: David S. Miller, netdev, linux-hams
In-Reply-To: <20060429141613.GA2811@linux-mips.org>

Ralf Baechle wrote :

> Convert all NET/ROM sysctl time values from jiffies to ms as units.
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 

With such extensive patches for netrom and rose modules that will go 
into a future 2.6.x kernel, I think it would be justified to update the 
following banners in af_rose.c and af_netrom.c respectively for they 
appear during boot :

static const char banner[] = KERN_INFO "F6FBB/G4KLX ROSE for Linux. 
Version 0.62 for AX25.037 Linux 2.4\n";

static char banner[] __initdata = KERN_INFO "G4KLX NET/ROM for Linux. 
Version 0.7 for AX25.037 Linux 2.4\n";

73 de Bernard, f6bvp

http://f6bvp.org
http://rose.fpac.free.fr/MINI-HOWTO/
http://rose.fpac.free.fr/MINI-HOWTO-FR/


^ permalink raw reply

* Re: [PATCH] softmac: make non-operational after being stopped
From: Johannes Berg @ 2006-04-30 20:23 UTC (permalink / raw)
  To: Daniel Drake; +Cc: linville, netdev, softmac-dev
In-Reply-To: <20060430173353.16363886AB1@zog.reactivated.net>

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

On Sun, 2006-04-30 at 18:33 +0100, Daniel Drake wrote:
>  		dprintk("deauth without deauth packet. eek!n");

>  	dprintk(KERN_INFO PFX "got disassoc framen");

>  		dprintkl(KERN_INFO PFX "reassoc request from unknown networkn");

>  			dprintk(PFX "Not probing Channel %d (not allowed here)n", si->channels[current_channel_idx].channel);

It seems to have lost some backslashes there, or is that just me? In any
case, it won't apply properly, can you resend?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]

^ permalink raw reply

* [PATCH resend] softmac: make non-operational after being stopped
From: Daniel Drake @ 2006-04-30 21:09 UTC (permalink / raw)
  To: linville; +Cc: netdev, johannes, softmac-dev

zd1211 with softmac and wpa_supplicant revealed an issue with softmac and the
use of workqueues. Some of the work functions actually reschedule themselves,
so this meant that there could still be pending work after
flush_scheduled_work() had been called during ieee80211softmac_stop().

This patch introduces a "running" flag which is used to ensure that
rescheduling does not happen in this situation.

I also used this flag to ensure that softmac's hooks into ieee80211 are
non-operational once the stop operation has been started. This simply makes
softmac a little more robust, because I could crash it easily by receiving
frames in the short timeframe after shutting down softmac and before turning
off the ZD1211 radio. (ZD1211 is now fixed as well!)

Signed-off-by: Daniel Drake <dsd@gentoo.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>

--

Sorry, the first version was mangled by my mailer (backslashes missing). This
one should be better.

Index: linux/net/ieee80211/softmac/ieee80211softmac_module.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_module.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_module.c
@@ -89,6 +89,8 @@ ieee80211softmac_clear_pending_work(stru
 	ieee80211softmac_wait_for_scan(sm);
 	
 	spin_lock_irqsave(&sm->lock, flags);
+	sm->running = 0;
+
 	/* Free all pending assoc work items */
 	cancel_delayed_work(&sm->associnfo.work);
 	
@@ -204,6 +206,8 @@ void ieee80211softmac_start(struct net_d
 		assert(0);
 	if (mac->txrates_change)
 		mac->txrates_change(dev, change, &oldrates);
+
+	mac->running = 1;
 }
 EXPORT_SYMBOL_GPL(ieee80211softmac_start);
 
Index: linux/include/net/ieee80211softmac.h
===================================================================
--- linux.orig/include/net/ieee80211softmac.h
+++ linux/include/net/ieee80211softmac.h
@@ -204,7 +204,8 @@ struct ieee80211softmac_device {
 	
 	/* couple of flags */
 	u8 scanning:1, /* protects scanning from being done multiple times at once */
-	   associated:1;
+	   associated:1,
+	   running:1;
 	
 	struct ieee80211softmac_scaninfo *scaninfo;
 	struct ieee80211softmac_assoc_info associnfo;
Index: linux/net/ieee80211/softmac/ieee80211softmac_auth.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -86,6 +86,11 @@ ieee80211softmac_auth_queue(void *data)
 		
 		/* Lock and set flags */
 		spin_lock_irqsave(&mac->lock, flags);
+		if (unlikely(!mac->running)) {
+			/* Prevent reschedule on workqueue flush */
+			spin_unlock_irqrestore(&mac->lock, flags);
+			return;
+		}
 		net->authenticated = 0;
 		net->authenticating = 1;
 		/* add a timeout call so we eventually give up waiting for an auth reply */
@@ -124,6 +129,9 @@ ieee80211softmac_auth_resp(struct net_de
 	unsigned long flags;
 	u8 * data;
 	
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	/* Find correct auth queue item */
 	spin_lock_irqsave(&mac->lock, flags);
 	list_for_each(list_ptr, &mac->auth_queue) {
@@ -338,6 +346,9 @@ ieee80211softmac_deauth_resp(struct net_
 	struct ieee80211softmac_network *net = NULL;
 	struct ieee80211softmac_device *mac = ieee80211_priv(dev);
 	
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	if (!deauth) {
 		dprintk("deauth without deauth packet. eek!\n");
 		return 0;
Index: linux/net/ieee80211/softmac/ieee80211softmac_assoc.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_assoc.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_assoc.c
@@ -51,11 +51,12 @@ ieee80211softmac_assoc(struct ieee80211s
 	spin_lock_irqsave(&mac->lock, flags);
 	mac->associnfo.associating = 1;
 	mac->associated = 0; /* just to make sure */
-	spin_unlock_irqrestore(&mac->lock, flags);
 
 	/* Set a timer for timeout */
 	/* FIXME: make timeout configurable */
-	schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ);
+	if (likely(mac->running))
+		schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ);
+	spin_unlock_irqrestore(&mac->lock, flags);
 }
 
 void
@@ -319,6 +320,9 @@ ieee80211softmac_handle_assoc_response(s
 	u16 status = le16_to_cpup(&resp->status);
 	struct ieee80211softmac_network *network = NULL;
 	unsigned long flags;
+
+	if (unlikely(!mac->running))
+		return -ENODEV;
 	
 	spin_lock_irqsave(&mac->lock, flags);
 
@@ -377,10 +381,16 @@ ieee80211softmac_handle_disassoc(struct 
 {
 	struct ieee80211softmac_device *mac = ieee80211_priv(dev);
 	unsigned long flags;
+
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN))
 		return 0;
+
 	if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN))
 		return 0;
+
 	dprintk(KERN_INFO PFX "got disassoc frame\n");
 	netif_carrier_off(dev);
 	spin_lock_irqsave(&mac->lock, flags);
@@ -400,6 +410,9 @@ ieee80211softmac_handle_reassoc_req(stru
 	struct ieee80211softmac_device *mac = ieee80211_priv(dev);
 	struct ieee80211softmac_network *network;
 
+	if (unlikely(!mac->running))
+		return -ENODEV;
+
 	network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3);
 	if (!network) {
 		dprintkl(KERN_INFO PFX "reassoc request from unknown network\n");
Index: linux/net/ieee80211/softmac/ieee80211softmac_scan.c
===================================================================
--- linux.orig/net/ieee80211/softmac/ieee80211softmac_scan.c
+++ linux/net/ieee80211/softmac/ieee80211softmac_scan.c
@@ -115,7 +115,15 @@ void ieee80211softmac_scan(void *d)
 			// TODO: is this if correct, or should we do this only if scanning from assoc request?
 			if (sm->associnfo.req_essid.len)
 				ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0);
+
+			spin_lock_irqsave(&sm->lock, flags);
+			if (unlikely(!sm->running)) {
+				/* Prevent reschedule on workqueue flush */
+				spin_unlock_irqrestore(&sm->lock, flags);
+				break;
+			}
 			schedule_delayed_work(&si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY);
+			spin_unlock_irqrestore(&sm->lock, flags);
 			return;
 		} else {
 			dprintk(PFX "Not probing Channel %d (not allowed here)\n", si->channels[current_channel_idx].channel);

^ permalink raw reply

* Re: IP1000 gigabit nic driver
From: David Vrabel @ 2006-04-30 23:40 UTC (permalink / raw)
  To: Pekka Enberg; +Cc: romieu, linux-kernel, netdev, david
In-Reply-To: <1146389171.11524.1.camel@localhost>

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

Pekka Enberg wrote:
> On Sat, 2006-04-29 at 14:21 +0200, David Gómez wrote:
>>> I already had it modified, just needed to create the patch... Anyway,
>>> have you submitted it to netdev?
> 
> On Sat, 2006-04-29 at 23:35 +0300, Pekka Enberg wrote:
>> No, I haven't. I don't have the hardware, so I can't test the driver.
>> Furthermore, there's plenty of stuff to fix before it's in any shape for
>> submission. If someone wants to give this patch a spin, I would love to
>> hear the results.

Thanks for doing this Pekka.  I've fixed up some stuff and given it some 
brief testing on a 100BaseT network and it seems to work now.

> Subject: [PATCH] IP1000 Gigabit Ethernet device driver
> 
> This is a cleaned up fork of the IP1000A device driver:
> 
>   <http://www.icplus.com.tw/driver-pp-IP1000A.html>
> 
> Open issues include but are not limited to:
> 
>   - ipg_probe() looks really fishy and doesn't handle all errors
>     (e.g. ioremap failing).
>   - ipg_nic_do_ioctl() is playing games with user-space pointer.
>     We should use ethtool ioctl instead as suggested by Arjan.

Still pending.  Also:

     - something (PHY reset/auto negotiation?) takes 2-3 seconds and
       appears to be done with interrupts disabled.

>   - For multiple devices, the driver uses a global root_dev and
>     ipg_remove() play some tricks which look fishy.

Killed this.  It was broke and ugly as hell.

Attached is patch with some more changes:

- Remove changelogs
- Remove ether_crc_le() -- use crc32_le() instead.
- No more nonsense with root_dev -- ipg_remove() now works.
- Move PHY and MAC address initialization into the ipg_probe().  It was
   previously filling in the MAC address on open which breaks some user
   space.
- Folded ipg_nic_init into ipg_probe since it was broke otherwise.

Signed-off-by: David Vrabel <dvrabel@cantab.net>

[-- Attachment #2: working --]
[-- Type: text/plain, Size: 22818 bytes --]

Index: linux-source-2.6.16/drivers/net/ipg.c
===================================================================
--- linux-source-2.6.16.orig/drivers/net/ipg.c	2006-04-30 22:26:05.788013667 +0100
+++ linux-source-2.6.16/drivers/net/ipg.c	2006-05-01 00:23:28.358641581 +0100
@@ -13,149 +13,14 @@
  * 408 873 4117
  * www.sundanceti.com
  * craig_rich@sundanceti.com
- *
- * Rev  Date     Description
- * --------------------------------------------------------------
- * 0.1  11/8/99  Initial revision work begins.
- *
- * 0.2  11/12/99  Basic operation achieved, continuing work.
- *
- * 0.3  11/19/99  MAC Loop Back for sync problem testing.
- *
- * 0.4  12/22/99  ioctl for diagnotic program 'hunter' support.
- *
- * 0.5  4/13/00   Updates to
- *
- * 0.6  6/14/00   Slight correction to handling TFDDONE, and
- *                preservation of PHYCTRL polarity bits.
- *
- * 0.7  7/27/00   Modifications to accomodate triple speed
- *                autonegotiation. Also change to ioctl routine
- *                to handle unknown PHY address.
- *
- * 0.8  8/11/00   Added change_mtu function.
- *
- * 0.9  8/15/00   Corrected autonegotiation resolution.
- *
- * 0.10 8/30/00   Changed constants to use IPG in place
- *                of RIO. Also, removed most of debug
- *                code in preparation for production release.
- *
- * 0.11 8/31/00   Utilize 64 bit data types where appropriate.
- *
- * 0.12 9/1/00    Move some constants to include file and utilize
- *                RxDMAInt register.
- *
- * 0.13 10/31/00  Several minor modifications to improve stability.
- *
- * 0.14 11/28/00  Added call to nic_tx_free if TFD not available.
- *
- * 0.15 12/5/00   Corrected problem with receive errors, always set
- *                receive buffer address to NULL. Release RX buffers
- *                on errors.
- *
- * 0.16 12/20/00  Corrected autoneg resolution issue, must detect
- *                speed via PHYCTRL register. Also, perform only 1
- *                loop in the nic_txcleanup routine.
- *
- * 0.17 2/7/01    Changed all references of ST2021 to IPG.
- *                When next TFD not available, return -ENOMEM instead
- *                of 0. Removed references to RUBICON.
- *
- * 0.18 2/14/01   Corrected problem when unexpected jumbo frames are
- *                received (now dropped properly.) Changed
- *                "DROP_ON_ERRORS" breaking out Ethernet errors and
- *                TCP/IP errors serparately. Corrected Gigabit
- *                copper PAUSE autonegotiation.
- *
- * 0.19 2/22/01   Changed interrupt handling of RFD_LIST_END,
- *                INT_REQUESTED, and RX_DMA_COMPLETE. Masked off
- *                RMON statistics and unused MIB statistics.
- *                Make sure *all* statistics are accounted for
- *                (either masked or read in get_stats) to avoid
- *                perpetual UpdateStats interrupt from causing
- *                driver to crash.
- *
- * 0.20 3/2/01    Corrected error in nic_stop. Need to set
- *                TxBuff[] = NULL after freeing TxBuff and
- *                RxBuff[] = NULL after freeing RxBuff.
- *
- * 0.21 3/5/01    Correct 10/100Mbit PAUSE autonegotiation.
- *
- * 0.22 3/16/01   Used TxDMAIndicate for 100/1000Mbps modes. Add
- *                "TFD unavailable" and "RFD list end" counters
- *                to assist with performance measurement. Added
- *                check for maxtfdcnt != 0 to while loop within
- *                txcleanup.
- *
- * 0.23 3/22/01   Set the CurrentTxFrameID to 1 upon detecting
- *                a TxDMAComplete to reduce the number of TxDMAComplete.
- *                Also, indicate IP/TCP/UDP checksum is unneseccary
- *                if IPG indicates checksum validates.
- *
- * 0.24 3/23/01   Changed the txfree routine, eliminating the margin
- *                between the last freed TFD and the current TFD.
- *
- * 0.25 4/3/01    Corrected errors in config_autoneg to deal with
- *                fiber flag properly.
- *
- * 0.26 5/1/01    Port for operation with Linux 2.2 or 2.4 kernel.
- *
- * 0.27 5/22/01   Cleaned up some extraneous comments.
- *
- * 0.28 6/20/01   Added auto IP, TCP, and UDP checksum addition
- *                on transmit based on compilation option.
- *
- * 0.29 7/26/01   Comment out #include <asm/spinlock.h> from ipg.h
- *                for compatibility with RedHat 7.1. Unkown reason.
- *
- * 0.30 8/10/01   Added debug message to each function, print function
- *                name when entered. Added DEBUGCTRL register bit 5 for
- *                Rx DMA Poll Now bug work around. Added ifdef IPG_DEBUG
- *                flags to IPG_TFDlistunabvail and IPG_RFDlistend
- *                counters. Removed clearing of sp->stat struct from
- *                nic_open and added check in get_stats to make sure
- *                NIC is initialized before reading statistic registers.
- *                Corrected erroneous MACCTRL setting for Fiber based
- *                10/100 boards. Corrected storage of phyctrlpolarity
- *                variable.
- *
- * 0.31 8/13/01   Incorporate STI or TMI fiber based NIC detection.
- *                Corrected problem with _pciremove_linux2_4 routine.
- *                Corrected setting of IP/TCP/UDP checksumming on receive
- *                and transmit.
- *
- * 0.32 8/15/01   Changed the tmi_fiber_detect routine.
- *
- * 0.33 8/16/01   Changed PHY reset method in nic_open routine. Added
- *                a chip reset in nic_stop to shut down the IPG.
- *
- * 0.34 9/5/01    Corrected some misuage of dev_kfree_skb.
- *
- * 0.35 10/30/01  Unmap register space (IO or memory) in the nic_stop
- *                routine instead of in the cleanup or remove routines.
- *                Corrects driver up/down/up problem when using IO
- *                register mapping.
- *
- * 0.36 10/31/01  Modify the constant IPG_FRAMESBETWEENTXDMACOMPLETES
- *		  from 0x10 to 1.
- * 0.37 11/05/03  Modify the IPG_PHY_1000BASETCONTROL
- *				  in IP1000A this register is without 1000BPS Ability by default
- *				  so enable 1000BPS ability before PHY RESET/RESTART_AN
- * 0.38 11/05/03  update ipg_config_autoneg routine
- * 0.39 11/05/03  add Vendor_ID=13F0/Device_ID=1023 into support_cards
- * 2.05 10/16/04  Remove IPG_IE_RFD_LIST_END for pass SmartBit test.
- *                (see 20041019Jesse_For_SmartBit.)
- * 2.06 10/27/04 Support for kernel 2.6.x
- * 2.06a 11/03/04 remove some compile warring message.
- * 2.09b 06/03/05 Support 4k jumbo  (IC Plus, Jesse)
- * 2.09d 06/22/05 Support 10k jumbo, more than 4k will using copy mode (IC Plus, Jesse)
  */
 #define JUMBO_FRAME_4k_ONLY
 enum {
 	netdev_io_size = 128
 };
 
+#include <linux/crc32.h>
+
 #include "ipg.h"
 #define DRV_NAME	"ipg"
 
@@ -214,14 +79,12 @@
 static int ipg_nic_hard_start_xmit(struct sk_buff *, struct net_device *);
 static struct net_device_stats *ipg_nic_get_stats(struct net_device *);
 static void ipg_nic_set_multicast_list(struct net_device *);
-static int ipg_nic_init(struct net_device *);
 static int ipg_nic_rx(struct net_device *);
 static int ipg_nic_rxrestore(struct net_device *);
 static int init_rfdlist(struct net_device *);
 static int init_tfdlist(struct net_device *);
 static int ipg_get_rxbuff(struct net_device *, int);
 static int ipg_config_autoneg(struct net_device *);
-static unsigned ether_crc_le(int, unsigned char *);
 static int ipg_nic_do_ioctl(struct net_device *, struct ifreq *, int);
 static int ipg_nic_change_mtu(struct net_device *, int);
 
@@ -1637,60 +1500,12 @@
 	 * by ifconfig.
 	 */
 
-	int phyaddr = 0;
 	int error = 0;
-	int i;
 	void __iomem *ioaddr = ipg_ioaddr(dev);
-	u8 revisionid = 0;
 	struct ipg_nic_private *sp = netdev_priv(dev);
 
 	IPG_DEBUG_MSG("_nic_open\n");
 
-	/* Reset all functions within the IPG. Do not assert
-	 * RST_OUT as not compatible with some PHYs.
-	 */
-	i = IPG_AC_GLOBAL_RESET | IPG_AC_RX_RESET |
-	    IPG_AC_TX_RESET | IPG_AC_DMA |
-	    IPG_AC_FIFO | IPG_AC_NETWORK | IPG_AC_HOST | IPG_AC_AUTO_INIT;
-	/* Read/Write and Reset EEPROM Value Jesse20040128EEPROM_VALUE */
-	/* Read LED Mode Configuration from EEPROM */
-	sp->LED_Mode = read_eeprom(dev, 6);
-
-	error = ipg_reset(dev, i);
-	if (error < 0) {
-		return error;
-	}
-
-	/* Reset PHY. */
-	phyaddr = ipg_find_phyaddr(dev);
-
-	if (phyaddr != -1) {
-		u16 mii_phyctrl, mii_1000cr;
-		mii_1000cr = read_phy_register(dev,
-					       phyaddr,
-					       GMII_PHY_1000BASETCONTROL);
-		write_phy_register(dev, phyaddr,
-				   GMII_PHY_1000BASETCONTROL,
-				   mii_1000cr |
-				   GMII_PHY_1000BASETCONTROL_FULL_DUPLEX |
-				   GMII_PHY_1000BASETCONTROL_HALF_DUPLEX |
-				   GMII_PHY_1000BASETCONTROL_PreferMaster);
-
-		mii_phyctrl = read_phy_register(dev, phyaddr, GMII_PHY_CONTROL);
-		/* Set default phyparam */
-		pci_read_config_byte(sp->pdev, PCI_REVISION_ID, &revisionid);
-		ipg_set_phy_default_param(revisionid, dev, phyaddr);
-
-		/* reset Phy */
-		write_phy_register(dev,
-				   phyaddr, GMII_PHY_CONTROL,
-				   (mii_phyctrl | GMII_PHY_CONTROL_RESET |
-				    MII_PHY_CONTROL_RESTARTAN));
-
-	}
-
-	spin_lock_init(&sp->lock);
-
 	/* Check for interrupt line conflicts, and request interrupt
 	 * line for IPG.
 	 *
@@ -1743,26 +1558,6 @@
 		return error;
 	}
 
-	/* Read MAC Address from EERPOM Jesse20040128EEPROM_VALUE */
-	sp->StationAddr0 = read_eeprom(dev, 16);
-	sp->StationAddr1 = read_eeprom(dev, 17);
-	sp->StationAddr2 = read_eeprom(dev, 18);
-	/* Write MAC Address to Station Address */
-	iowrite16(sp->StationAddr0, ioaddr + IPG_STATIONADDRESS0);
-	iowrite16(sp->StationAddr1, ioaddr + IPG_STATIONADDRESS1);
-	iowrite16(sp->StationAddr2, ioaddr + IPG_STATIONADDRESS2);
-
-	/* Set station address in ethernet_device structure. */
-	dev->dev_addr[0] = ioread16(ioaddr + IPG_STATIONADDRESS0) & 0x00FF;
-	dev->dev_addr[1] =
-	    (ioread16(ioaddr + IPG_STATIONADDRESS0) & 0xFF00) >> 8;
-	dev->dev_addr[2] = ioread16(ioaddr + IPG_STATIONADDRESS1) & 0x00FF;
-	dev->dev_addr[3] =
-	    (ioread16(ioaddr + IPG_STATIONADDRESS1) & 0xFF00) >> 8;
-	dev->dev_addr[4] = ioread16(ioaddr + IPG_STATIONADDRESS2) & 0x00FF;
-	dev->dev_addr[5] =
-	    (ioread16(ioaddr + IPG_STATIONADDRESS2) & 0xFF00) >> 8;
-
 	/* Configure IPG I/O registers. */
 	error = ipg_io_config(dev);
 	if (error < 0) {
@@ -2860,7 +2655,8 @@
 	for (mc_list_ptr = dev->mc_list;
 	     mc_list_ptr != NULL; mc_list_ptr = mc_list_ptr->next) {
 		/* Calculate CRC result for each multicast address. */
-		hashindex = ether_crc_le(ETH_ALEN, mc_list_ptr->dmi_addr);
+		hashindex = crc32_le(0xffffffff, mc_list_ptr->dmi_addr,
+				     ETH_ALEN);
 
 		/* Use only the least significant 6 bits. */
 		hashindex = hashindex & 0x3F;
@@ -2883,86 +2679,79 @@
 		      ioread8(ioaddr + IPG_RECEIVEMODE));
 }
 
-/*
- * The following code fragment was authored by Donald Becker.
- */
-
-/* The little-endian AUTODIN II ethernet CRC calculations.
-   A big-endian version is also available.
-   This is slow but compact code.  Do not use this routine for bulk data,
-   use a table-based routine instead.
-   This is common code and should be moved to net/core/crc.c.
-   Chips may use the upper or lower CRC bits, and may reverse and/or invert
-   them.  Select the endian-ness that results in minimal calculations.
-*/
-static unsigned const ethernet_polynomial_le = 0xedb88320U;
-static unsigned ether_crc_le(int length, unsigned char *data)
+static int ipg_hw_init(struct net_device *dev)
 {
-	unsigned int crc = 0xffffffff;	/* Initial value. */
-	while (--length >= 0) {
-		unsigned char current_octet = *data++;
-		int bit;
-		for (bit = 8; --bit >= 0; current_octet >>= 1) {
-			if ((crc ^ current_octet) & 1) {
-				crc >>= 1;
-				crc ^= ethernet_polynomial_le;
-			} else
-				crc >>= 1;
-		}
-	}
-	return crc;
-}
+	int phyaddr = 0;
+	int error = 0;
+	int i;
+	void __iomem *ioaddr = ipg_ioaddr(dev);
+	u8 revisionid = 0;
+	struct ipg_nic_private *sp = netdev_priv(dev);
 
-/*
- * End of code fragment authored by Donald Becker.
- */
+	/* Reset all functions within the IPG. Do not assert
+	 * RST_OUT as not compatible with some PHYs.
+	 */
+	i = IPG_AC_GLOBAL_RESET | IPG_AC_RX_RESET |
+	    IPG_AC_TX_RESET | IPG_AC_DMA |
+	    IPG_AC_FIFO | IPG_AC_NETWORK | IPG_AC_HOST | IPG_AC_AUTO_INIT;
+	/* Read/Write and Reset EEPROM Value Jesse20040128EEPROM_VALUE */
+	/* Read LED Mode Configuration from EEPROM */
+	sp->LED_Mode = read_eeprom(dev, 6);
 
-static int ipg_nic_init(struct net_device *dev)
-{
-	/* Initialize IPG NIC. */
+	error = ipg_reset(dev, i);
+	if (error < 0) {
+		return error;
+	}
 
-	struct ipg_nic_private *sp = NULL;
+	ioaddr = ipg_ioaddr(dev);
 
-	IPG_DEBUG_MSG("_nic_init\n");
+	/* Reset PHY. */
+	phyaddr = ipg_find_phyaddr(dev);
 
-	/* Register the IPG NIC in the list of Ethernet devices. */
-	dev = alloc_etherdev(sizeof(struct ipg_nic_private));
+	if (phyaddr != -1) {
+		u16 mii_phyctrl, mii_1000cr;
+		mii_1000cr = read_phy_register(dev,
+					       phyaddr,
+					       GMII_PHY_1000BASETCONTROL);
+		write_phy_register(dev, phyaddr,
+				   GMII_PHY_1000BASETCONTROL,
+				   mii_1000cr |
+				   GMII_PHY_1000BASETCONTROL_FULL_DUPLEX |
+				   GMII_PHY_1000BASETCONTROL_HALF_DUPLEX |
+				   GMII_PHY_1000BASETCONTROL_PreferMaster);
 
-	if (dev == NULL) {
-		printk(KERN_INFO "Could not initialize IP1000 based NIC.\n");
-		return -ENODEV;
-	}
+		mii_phyctrl = read_phy_register(dev, phyaddr, GMII_PHY_CONTROL);
+		/* Set default phyparam */
+		pci_read_config_byte(sp->pdev, PCI_REVISION_ID, &revisionid);
+		ipg_set_phy_default_param(revisionid, dev, phyaddr);
 
-	/* Reserve memory for ipg_nic_private structure. */
-	sp = kmalloc(sizeof(struct ipg_nic_private), GFP_KERNEL);
+		/* reset Phy */
+		write_phy_register(dev,
+				   phyaddr, GMII_PHY_CONTROL,
+				   (mii_phyctrl | GMII_PHY_CONTROL_RESET |
+				    MII_PHY_CONTROL_RESTARTAN));
 
-	if (sp == NULL) {
-		printk(KERN_INFO
-		       "%s: No memory available for IP1000 private strucutre.\n",
-		       dev->name);
-		return -ENOMEM;
-	} else {
-		/* Fill the allocated memory space with 0s.
-		 * Essentially sets all ipg_nic_private
-		 * structure fields to 0.
-		 */
-		memset(sp, 0, sizeof(*sp));
-		dev->priv = sp;
 	}
 
-	/* Assign the new device to the list of IPG Ethernet devices. */
-	sp->next_dev = root_dev;
-	root_dev = dev;
+	/* Read MAC Address from EERPOM Jesse20040128EEPROM_VALUE */
+	sp->StationAddr0 = read_eeprom(dev, 16);
+	sp->StationAddr1 = read_eeprom(dev, 17);
+	sp->StationAddr2 = read_eeprom(dev, 18);
+	/* Write MAC Address to Station Address */
+	iowrite16(sp->StationAddr0, ioaddr + IPG_STATIONADDRESS0);
+	iowrite16(sp->StationAddr1, ioaddr + IPG_STATIONADDRESS1);
+	iowrite16(sp->StationAddr2, ioaddr + IPG_STATIONADDRESS2);
 
-	/* Declare IPG NIC functions for Ethernet device methods.
-	 */
-	dev->open = &ipg_nic_open;
-	dev->stop = &ipg_nic_stop;
-	dev->hard_start_xmit = &ipg_nic_hard_start_xmit;
-	dev->get_stats = &ipg_nic_get_stats;
-	dev->set_multicast_list = &ipg_nic_set_multicast_list;
-	dev->do_ioctl = &ipg_nic_do_ioctl;
-	dev->change_mtu = &ipg_nic_change_mtu;
+	/* Set station address in ethernet_device structure. */
+	dev->dev_addr[0] = ioread16(ioaddr + IPG_STATIONADDRESS0) & 0x00FF;
+	dev->dev_addr[1] =
+	    (ioread16(ioaddr + IPG_STATIONADDRESS0) & 0xFF00) >> 8;
+	dev->dev_addr[2] = ioread16(ioaddr + IPG_STATIONADDRESS1) & 0x00FF;
+	dev->dev_addr[3] =
+	    (ioread16(ioaddr + IPG_STATIONADDRESS1) & 0xFF00) >> 8;
+	dev->dev_addr[4] = ioread16(ioaddr + IPG_STATIONADDRESS2) & 0x00FF;
+	dev->dev_addr[5] =
+	    (ioread16(ioaddr + IPG_STATIONADDRESS2) & 0xFF00) >> 8;
 
 	return 0;
 }
@@ -3144,99 +2933,23 @@
 
 static void ipg_remove(struct pci_dev *pdev)
 {
-	/* Remove function called when a IPG device is
-	 * to be shut down.
-	 */
-
-	struct net_device *prev_dev = NULL;
-	struct net_device *dev = NULL;
-	struct net_device *dev_to_remove = NULL;
-	struct ipg_nic_private *prev_sp = NULL;
-	struct ipg_nic_private *sp = NULL;
-	struct ipg_nic_private *sp_to_remove = NULL;
-
-	IPG_DEBUG_MSG("_pciremove_linux2_4\n");
-
-	dev = root_dev;
-
-	/* Move through list of Ethernet devices looking for
-	 * a match.
-	 */
-	while (dev) {
-		sp = netdev_priv(dev);
-
-		if (sp->pdev == pdev) {
-			/* Save the pointer to the previous Ethernet
-			 * device.
-			 */
-			dev_to_remove = dev;
-
-			sp_to_remove = sp;
-
-			break;
-		}
-
-		/* Save the "previous" device in the list. */
-		prev_dev = dev;
-
-		/* Retrieve next Ethernet device to be
-		 * released.
-		 */
-		dev = sp->next_dev;
-	}
-
-	/* Check if there is a device to remove. */
-	if (dev_to_remove == NULL) {
-		/* There are no Ethernet devices to remove. */
-		printk(KERN_INFO
-		       "A device remove request does not match with any Ethernet devices.\n");
-
-		return;
-	}
-
-	/* Check to see if we are removing the root device in the list. */
-	if (root_dev == dev_to_remove) {
-		/* Change the root Ethernet device to the next device to be
-		 * released.
-		 */
-		root_dev = sp_to_remove->next_dev;
-	} else if (sp_to_remove->next_dev != NULL)
-		/* Check if we need to re-link the list of devices. */
-	{
-		/* If the "previous" Ethernet device is NULL,
-		 * the device is at the head of the list, and
-		 * no re-linking is needed.
-		 */
-		prev_sp = netdev_priv(prev_dev);
-
-		prev_sp->next_dev = sp_to_remove->next_dev;
-	}
-
-	/* Free memory associated with Ethernet device's
-	 * private data structure.
-	 */
-	if (sp_to_remove) {
-		kfree(sp_to_remove);
-	}
+	struct net_device *dev = pci_get_drvdata(pdev);
+	struct ipg_nic_private *sp = netdev_priv(dev);
 
-	printk(KERN_INFO "Un-registering Ethernet device %s\n",
-	       dev_to_remove->name);
+	IPG_DEBUG_MSG("_remove\n");
 
 	/* Un-register Ethernet device. */
-	unregister_netdev(dev_to_remove);
+	unregister_netdev(dev);
 
 #ifdef USE_IO_OPS
 	ioport_unmap(ioaddr);
 #else
 	iounmap(sp->ioaddr);
 #endif
-
 	pci_release_regions(pdev);
 
-	/* Free memory associated with Ethernet device. */
-	if (dev_to_remove) {
-		kfree(dev_to_remove);
-	}
+	free_netdev(dev);
+	pci_disable_device(pdev);
 	pci_set_drvdata(pdev, NULL);
 }
 
@@ -3269,13 +2982,31 @@
 		goto out;
 	}
 
-	err = ipg_nic_init(dev);
-	if (err) {
-		printk(KERN_INFO "Could not intialize IP1000 based NIC.\n");
+	/*
+	 * Initialize net device.
+	 */
+	dev = alloc_etherdev(sizeof(struct ipg_nic_private));
+	if (!dev) {
+		printk(KERN_ERR "ipg: alloc_etherdev failed\n");
+		err = -ENOMEM;
 		goto out;
 	}
-	dev = root_dev;
+
+	sp = netdev_priv(dev);
+	spin_lock_init(&sp->lock);
+
+	/* Declare IPG NIC functions for Ethernet device methods.
+	 */
+	dev->open = &ipg_nic_open;
+	dev->stop = &ipg_nic_stop;
+	dev->hard_start_xmit = &ipg_nic_hard_start_xmit;
+	dev->get_stats = &ipg_nic_get_stats;
+	dev->set_multicast_list = &ipg_nic_set_multicast_list;
+	dev->do_ioctl = &ipg_nic_do_ioctl;
+	dev->change_mtu = &ipg_nic_change_mtu;
+
 	SET_MODULE_OWNER(dev);
+	SET_NETDEV_DEV(dev, &pdev->dev);
 
 	err = pci_request_regions(pdev, DRV_NAME);
 	if (err)
@@ -3300,13 +3031,17 @@
 		goto out;
 	}
 #endif
-	sp = netdev_priv(root_dev);
+	sp = netdev_priv(dev);
 	/* Save the pointer to the PCI device information. */
 	sp->ioaddr = ioaddr;
 	sp->pdev = pdev;
 
 	pci_set_drvdata(pdev, dev);
 
+	err = ipg_hw_init(dev);
+	if (err)
+		goto out;
+
 	err = register_netdev(dev);
 	if (err)
 		goto out;
Index: linux-source-2.6.16/drivers/net/ipg.h
===================================================================
--- linux-source-2.6.16.orig/drivers/net/ipg.h	2006-04-30 23:02:09.861345105 +0100
+++ linux-source-2.6.16/drivers/net/ipg.h	2006-05-01 00:11:14.974349454 +0100
@@ -15,85 +15,6 @@
  * 408 873 4117
  * www.sundanceti.com
  * craig_rich@sundanceti.com
- *
- * Rev  Date     Description
- * --------------------------------------------------------------
- * 0.1  11/8/99  Initial revision work begins
- *
- * 0.2  12/1/99  Minor update to modversions.h inclusion.
- *
- * 0.3  12/30/99 Updates to fully comply with IPG spec.
- *
- * 0.4  4/24/00  Updates to allow for removal of FCS generation
- *               and verification.
- * 0.5  8/15/00  Updates for MII PHY registers and fields.
- *
- * 0.6  8/31/00  Updates to change to using 64 bit data types
- *
- * 0.7  10/31/00 Added DDEBUG_MSG to allow for easy activation of
- *               individual DEBUG_MSGs.
- *
- * 0.8  11/06/00 Changed LastFreedRxBuff to LastRestoredRxBuff for
- *               clarity.
- *
- * 0.9  11/10/00 Changed Sundance DeviceID to 0x9020
- *
- * 0.10 2/14/01  Changed "DROP_ON_ERRORS", breaking out Ethernet from
- *               TCP/IP errors.
- *
- * 0.11 3/16/01  Changed "IPG_FRAMESBETWEENTXCOMPLETES" to
- *               "IPG_FRAMESBETWEENTXDMACOMPLETES" since will
- *               be using TxDMAIndicate instead of TxIndicate to
- *               improve performance. Added TFDunavailCount and
- *               RFDlistendCount to aid in performance improvement.
- *
- * 0.12 3/22/01  Removed IPG_DROP_ON_RX_TCPIP_ERRORS.
- *
- * 0.13 3/23/01  Removed IPG_TXQUEUE_MARGIN.
- *
- * 0.14 3/30/01  Broke out sections into multiple files and added
- *               OS version specific detection and settings.
- */
-
-/*
- * Linux header utilization:
- *
- * config.h     For PCI support, namely CONFIG_PCI macro.
- *
- * version.h	For Linux kernel version detection.
- *
- * module.h	For modularized driver support.
- *
- * kernel.h     For 'printk'.
- *
- * pci.h        PCI support, including ID, VENDOR, and CLASS
- *              standard definitions; PCI specific structures,
- *              including pci_dev struct.
- *
- * ioport.h     I/O ports, check_region, request_region,
- *              release_region.
- *
- * errno.h      Standard error numbers, e.g. ENODEV.
- *
- * asm/io.h     For reading/writing I/O ports, and for virt_to_bus
- *		function.
- *
- * delay.h      For milisecond delays.
- *
- * types.h      For specific typedefs (i.e. u32, u16, u8).
- *
- * netdevice.h  For device structure needed for network support.
- *
- * etherdevice.h	For ethernet device support.
- *
- * init.h       For __initfunc.
- *
- * skbuff.h	Socket buffer (skbuff) definition.
- *
- * asm/bitops.h	For test_and_set_bit, clear_bit functions.
- *
- * asm/spinlock.h For spin_lock_irqsave, spin_lock_irqrestore functions.
- *
  */
 #ifndef __LINUX_IPG_H
 #define __LINUX_IPG_H
@@ -1000,9 +921,6 @@
  * End miscellaneous macros.
  */
 
-/* IPG Ethernet device structure, used for removing module. */
-struct net_device *root_dev = NULL;
-
 /* Transmit Frame Descriptor. The IPG supports 15 fragments,
  * however Linux requires only a single fragment. Note, each
  * TFD field is 64 bits wide.
@@ -1054,7 +972,6 @@
 	int RxBuffNotReady;
 	struct pci_dev *pdev;
 	struct net_device_stats stats;
-	struct net_device *next_dev;
 	spinlock_t lock;
 	int tenmbpsmode;
 

^ permalink raw reply

* Re: [PATCH 2/3] Eleminate HZ from NET/ROM kernel interfaces
From: David S. Miller @ 2006-05-01  0:21 UTC (permalink / raw)
  To: pidoux; +Cc: ralf, netdev, linux-hams
In-Reply-To: <44551148.5010503@ccr.jussieu.fr>

From: Bernard Pidoux <pidoux@ccr.jussieu.fr>
Date: Sun, 30 Apr 2006 21:34:32 +0200

> Ralf Baechle wrote :
> 
> > Convert all NET/ROM sysctl time values from jiffies to ms as units.
> > 
> > Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> > 
> 
> With such extensive patches for netrom and rose modules that will go 
> into a future 2.6.x kernel, I think it would be justified to update the 
> following banners in af_rose.c and af_netrom.c respectively for they 
> appear during boot :

It might be worthwhile to remove the messages altogether.

IPV4 and the core networking used to output similar initialization
log messages and it really doesn't really add anything but pollute
the already voluminous kernel log.

So I say we just remove it.

^ permalink raw reply

* Re: [Bugme-new] [Bug 6468] New: sky2 driver doesnt work in 2.6.16-r3, -r4 but was working in 2.6.15-r8
From: Andrew Morton @ 2006-05-01  1:15 UTC (permalink / raw)
  To: a.kulakov; +Cc: netdev, bugme-daemon@kernel-bugs.osdl.org
In-Reply-To: <200605010011.k410BCd1023886@fire-2.osdl.org>


(Please resond via reply-to-all, not via the bugzilla UI)

bugme-daemon@bugzilla.kernel.org wrote:
>
> http://bugzilla.kernel.org/show_bug.cgi?id=6468
> 
>            Summary: sky2 driver doesnt work in 2.6.16-r3,-r4 but was working
>                     in 2.6.15-r8
>     Kernel Version: 2.6.16-r4
>             Status: NEW
>           Severity: high
>              Owner: jgarzik@pobox.com
>          Submitter: a.kulakov@mail.ru
> 
> 
> Most recent kernel where this bug did not occur:
> 2.6.15-r8
> 
> Distribution:
> gentoo
> 
> Hardware Environment:
> Asus A38, Pentium-M 2.0GHz, 1024M RAM, Marvell Technology Group Ltd. 88E8053
> PCI-E Gigabit Ethernet Controller (rev 19)
> 
> Problem Description:
> No packets are received by programs while ifconfig counts them. No iptables
> rules in effect and all chans policies set to ACCEPT.
> dhcpcd fails to get response from server. tcpdump doesnt show any incoming
> packets while shows outgoing. ifconfig indicates that both rx and tx get increased!
> 
> That driver was working for me till 2.6.15-r8. It doesn't work with 2.6.16-r3
> nor -r4. I didn't try earlier 2.6.16 kernels but will do that if needed.
> 
> I tried to load module with disable_msi=1 but it didn't make any difference.
> 
> Steps to reproduce:
> modprobe sky2 debug=16
> dhcpcd eth0
> tcpdump -n -i eth0
> 

I assume that when you say "2.6.16-r4" you actually mean "2.6.16-rc4"?  Or
do you mean 2.6.16.4?  It matters rather a lot.

So, please confirm the earliest known-to-be-broken kernel version and the
latest known-to-be-working version, using the correct release
identification, thanks.


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox