Re: two hotplug issues

From: Andrew Morton (andrewm@uow.edu.au)
Date: Tue Apr 11 2000 - 04:11:34 EST


Jeff Garzik wrote:
>
> Andrew Morton wrote:
> > In earlier kernels, the ioctl(DS_GET_DEVICE_INFO) for pcmcia NICs was
> > returning "eth0" as the name in bind_info_t.name[]. In current kernels
> > it is returning the driver name, as supplied by the driver in its
> > pci_driver.name field - "3c575_cb", for example. This breaks David's
> > pcmcia tools.
> >
> > What's the fix?
>
> request_region and request_mem_region need to be passed the interface
> name returned from init_etherdev.

I _am_ passing this ("eth0") into request_region() and request_irq().
Have been for years! There is no request_mem_region() in this driver.

Take a look at drivers/pcmcia/ds.c:get_device_info(), which is the guts
of ioctl(DS_GET_DEVICE_INFO):

  struct pci_dev *dev;
  ...
  if (dev && dev->driver) {
    strncpy(bind_info->name, dev->driver->name, DEV_NAME_LEN);
    bind_info->name[DEV_NAME_LEN-1] = '\0';
 
That is pretty unambiguously copying the pci_driver.name[] up to
userland.

Perhaps pci_driver needs a new method:

  char * (*devname)(struct pci_dev *dev, int card_idx);

> > When I run 'cardctl suspend', the card is successfully shut down, but I
> > simply can't find a way of bringing it back to life. Also, the driver's
> > pci_driver.suspend and pci_driver.resume methods are never called.
>
> Debugging welcome :)

I wouldn't want to spend time debugging this if it is a known problem
and someone else is beavering away at it.

Is the behaviour I am observing anomalous, or is this a known problem?

-- 
-akpm-

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:15 EST