[vortex-bug] HP OmniBook 6000 3c556 failure

Donald Becker becker@scyld.com
Tue, 8 Aug 2000 00:11:48 -0400 (EDT)


On Tue, 8 Aug 2000, Andrew Morton wrote:
> Donald Becker wrote:
> > On Mon, 7 Aug 2000, Frank Sweetser wrote:
> > > > Hmmm, this version should have working suspend/resume code.
> > > >
> > > > Are you using it with cb_shim and pci_scan, or with the old "-DCARDBUS"
> > > > approach?
> > >
> > > pci-scan, but not cb_shim, as it's builtin not on a PCMCIA device - should
> > > I try it with cb_shim loaded as well?
> > 
> > Ahhhh!  The power management events, suspend and resume, aren't being
> > propagated through to the driver.
> > 
> > I'll need to add an APM module to do this for mini-PCI devices.  It can't be
> > added directly into pci-scan, as not all systems have APM enabled.
> 
> Should kernel 2.2 support for this NIC be coming from pcmcia_cs's
> 3c575_cb.c, rather than from 3c59x.c?

No, because the CardBus code in 3c59x.c assumes PCMCIA socket support.

One approach is to modify pci-scan.c as follows:
   - in pci_drv_register(), save a list of all detected devices ('newdev')
   - in pci_drv_unregister(), delete the devices from the list.
   - register to handle APM events in init_module
   - pass APM events to devices where the driver has a
      drv_id->pwr_event(dev, event)  function.

________________
struct drv_id_pair {
	struct drv_id_pair *next;
	struct drv_id_info *did;
	void *dev;
} static *root_drv_id = 0;

static int handle_apm_event(apm_event_t event)
{
	struct drv_id_pair dp;
	int drv_event = -1;
	switch (event) {
	case APM_SYS_SUSPEND:
	case APM_USER_SUSPEND:
		drv_event = DRV_SUSPEND; break;
	case APM_NORMAL_RESUME:
	case APM_CRITICAL_RESUME:
		drv_event = DRV_RESUME; break;
	}
	if (drv_event > 0)
		for (dp = root_dev_id; dp; dp = dp->next)
			if (dp->did->pwr_event)
				dp->did->pwr_event(dp->dev, drv_event);
	}
	return 0;
}
________________

Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Beowulf-II Cluster Distribution
Annapolis MD 21403