All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Mike_Phillips@URSCorp.com
Cc: netdev@oss.sgi.com
Subject: Re: [PATCH] (5/6) ibmtr -- probe2
Date: Fri, 17 Oct 2003 15:49:21 -0700	[thread overview]
Message-ID: <20031017154921.7afa10f0.shemminger@osdl.org> (raw)
In-Reply-To: <OF5D2BA91F.A6EBFE7D-ON84256DC2.004A9DE9-84256DC2.004ADCCD@urscorp.com>

On Fri, 17 Oct 2003 10:37:41 -0300
Mike_Phillips@URSCorp.com wrote:

> 
> In ibmtr_cs.c:
> 
> >+static int ibmtr_init(struct net_device *dev)
> >+{
> >+    extern int ibmtr_probe1(struct net_device *, int);
> >+
> >+    return ibmtr_probe1(dev, dev->base_addr);
> >+}
> >+
> > /*======================================================================
> 
> >     ibmtr_attach() creates an "instance" of the driver, allocating
> >@@ -194,7 +200,8 @@
> 
> >     link->irq.Instance = info->dev = dev;
> >
> >-    dev->init = &ibmtr_probe;
> >+    dev->init = ibmtr_init;
> >+
> 
> This changes dev->init from calling ibmtr_probe to ibmtr_probe1. The probe
> routines are specifically split into two because of ibmtr_cs. It doesn't
> need to do second probe routing because all the memory spaces get allocated
> by the pcmcia driver. Trying to allocate the same IO mem area will fail
> because its already been allocated by ibmtr_cs.

The probe routine interface needs to change to return the device structure,
and the interface that ibmtr_cs needs is one where the structure is allocated.
If you look at the details,  the new probe1 does pretty much the same thing
the old probe did.  Doesn't the PCMCIA infrastructure give the correct memory
address and set it during the config routine. 

The problem with the structures was a BUG in the existing code!
The PCMCIA code was setting dev->priv to a structure:
	
struct ibmtr_dev_t {
    dev_link_t		link;
    struct net_device	*dev;
    dev_node_t          node;
    window_handle_t     sram_win_handle;
    struct tok_info	ti;
}

and then later when registered, the dev->init callback goes to ibmtr_probe and
then ibmtr_probe1 which expects dev->priv to point to 'struct tok_info'

The code is broken in 2.6.0-test7.
	 

  reply	other threads:[~2003-10-17 22:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-17 13:37 [PATCH] (5/6) ibmtr -- probe2 Mike_Phillips
2003-10-17 22:49 ` Stephen Hemminger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-21  0:50 Mike_Phillips
2003-10-20 14:07 Mike_Phillips
2003-10-17 13:40 Mike_Phillips
2003-10-17 13:34 Mike_Phillips
2003-10-16 22:52 Mike_Phillips
2003-10-16 20:08 ` Stephen Hemminger
2003-10-15 20:48 Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031017154921.7afa10f0.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=Mike_Phillips@URSCorp.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.