Hotplug support!

origin
solomon 2002-08-19 23:07:05 +00:00
parent e22f0821e8
commit f8f19fdcd3
5 changed files with 54 additions and 68 deletions

View File

@ -42,6 +42,7 @@
*
* --------------------------------------------------------------------
-pre4
- Hotplug support for PCI/PLX/USB widgets.
- A compile fix for 2.2.x (x < 18) kernels and PCI adapters
- Support for TMD716C-based "almost but not quite PLX" boards.
- HP-PA support. In theory. Anyone care to test?

1
TODO
View File

@ -50,7 +50,6 @@ Linux WLAN NG TODO
David's overriding our include of the kernel config with his collection
of config items that pcmcia_cs cares about. Unfortunately, there's at
least one item we need (CONFIG_NETLINK) that pcmcia_cs isn't picking up.
- [USB] Integrate with usbmgr and new hotplug subsystem.
- [USB] Remove driver's port-reset when new primary firmware becomes
available.
- [USB] Look into multiple posted URBs

View File

@ -79,5 +79,20 @@ ifeq ($(INSTFIXED), y)
fi; \
cp wlan.conf $(TARGET_ROOT_ON_HOST)/etc && \
chmod 700 $(TARGET_ROOT_ON_HOST)/etc/wlan.conf; \
fi;
if [ -d /etc/hotplug ]; then \
mkdir -p $(TARGET_ROOT_ON_HOST)/etc/hotplug/usb; \
mkdir -p $(TARGET_ROOT_ON_HOST)/etc/hotplug/pci; \
if [ ! -f $(TARGET_ROOT_ON_HOST)/etc/hotplug/usb/prism2_usb ]; then \
ln -s /etc/init.d/wlan /etc/hotplug/usb/prism2_usb; \
fi; \
pushd $(TARGET_ROOT_ON_HOST)/etc/hotplug/pci ; \
if [ ! -f prism2_pci ]; then \
ln -s ../../init.d/wlan prism2_pci; \
fi; \
if [ ! -f prism2_plx ]; then \
ln -s ../../init.d/wlan /etc/hotplug/pci/prism2_plx; \
fi; \
popd; \
fi
endif

View File

@ -539,6 +539,11 @@ typedef struct net_device netdevice_t;
#define MODULE_LICENSE(m) extern int __bogus_decl
#endif
/* TODO: Do we care about this? */
#ifndef MODULE_DEVICE_TABLE
#define MODULE_DEVICE_TABLE(foo,bar)
#endif
#define wlan_minutes2ticks(a) ((a)*(wlan_ticks_per_sec * 60))
#define wlan_seconds2ticks(a) ((a)*(wlan_ticks_per_sec))

View File

@ -373,6 +373,8 @@ static struct pci_device_id plx_id_tbl[] = {
}
};
MODULE_DEVICE_TABLE(pci, plx_id_tbl);
/* Function declared here because of ptr reference below */
static int prism2sta_probe_plx(struct pci_dev *pdev,
const struct pci_device_id *id);
@ -406,6 +408,8 @@ static struct pci_device_id pci_id_tbl[] = {
}
};
MODULE_DEVICE_TABLE(pci, pci_id_tbl);
/* Function declared here because of ptr reference below */
static int prism2sta_probe_pci(struct pci_dev *pdev,
const struct pci_device_id *id);
@ -426,6 +430,25 @@ struct pci_driver prism2_pci_drv_id = {
#if (WLAN_HOSTIF == WLAN_USB)
#define PRISM_USB_DEVICE(vid, pid, name) \
USB_DEVICE(vid, pid), \
driver_info: (unsigned long) name
static struct usb_device_id usb_prism_tbl[] = {
{PRISM_USB_DEVICE(0x09aa, 0x3642, "Prism2.x 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE(0x1668, 0x0408, "Actiontec Prism2.5 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE(0x1668, 0x0421, "Actiontec Prism2.5 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE(0x066b, 0x2212, "Linksys WUSB11v2.5 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE(0x067c, 0x1022, "Siemens SpeedStream 1022 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE(0x049f, 0x0033, "Compaq/Intel PRO/Wireless 11Mbps multiport WLAN Adapter")},
{PRISM_USB_DEVICE(0x0411, 0x0016, "Melco WLI-USB-S11 11Mbps WLAN Adapter")},
{PRISM_USB_DEVICE(0x08de, 0x7a01, "PRISM25 IEEE 802.11 Mini USB Adapter")},
{PRISM_USB_DEVICE(0x8086, 0x1111, "Intel PRO/Wireless 2011B LAN USB Adapter")},
{ /* terminator */ }
};
MODULE_DEVICE_TABLE(usb, usb_prism_tbl);
typedef struct usb_prism_dev {
char *name;
UINT16 vendor;
@ -434,61 +457,6 @@ typedef struct usb_prism_dev {
} usb_prism_dev_t;
static usb_prism_dev_t usb_id_tbl[] = {
{
"Prism2.x 11Mbps WLAN USB Adapter",
0x09aa,
0x3642,
0
},
{
"Actiontec Prism2.5 11Mbps WLAN USB Adapter",
0x1668,
0x0408,
0
},
{
"Actiontec Prism2.5 11Mbps WLAN USB Adapter",
0x1668,
0x0421,
0
},
{
"Linksys WUSB11v2.5 11Mbps WLAN USB Adapter",
0x066b,
0x2212,
0
},
{
"Siemens SpeedStream 1022 11Mbps WLAN USB Adapter",
0x067c,
0x1022,
0
},
{
"Compaq/Intel PRO/Wireless 11Mbps multiport WLAN Adapter",
0x049f,
0x0033,
0
},
{
"Melco WLI-USB-S11 11Mbps WLAN Adapter",
0x0411,
0x0016,
0
},
{
"PRISM25 IEEE 802.11 Mini USB Adapter",
0x0d8e,
0x7a01,
0
},
{
"Intel PRO/Wireless 2011B LAN USB Device",
0x8086,
0x1111,
0
},
/* XXXX ATMEL widgets. Unsupported, but listed here so we can detect
and tell the user to look elsewhere for drivers. */
{
@ -562,14 +530,11 @@ static void prism2sta_disconnect_usb(struct usb_device *dev, void *ptr);
static void prism2sta_postdisconnect_usb(UINT32 arg);
struct usb_driver prism2_usb_driver = {
"prism2_usb", /* name */
prism2sta_probe_usb, /* probe */
prism2sta_disconnect_usb, /* disconnect */
{}, /* driver_list */
NULL, /* fops */
0, /* minor */
{}, /* serialize */
NULL /* ioctl */
name: "prism2_usb",
probe: prism2sta_probe_usb,
disconnect: prism2sta_disconnect_usb,
id_table: usb_prism_tbl,
/* fops, minor? */
};
#endif /* WLAN_USB */
@ -3664,7 +3629,7 @@ prism2sta_probe_plx(
unsigned long pccard_ioaddr;
unsigned long pccard_attr_mem;
unsigned int pccard_attr_len;
unsigned char *attr_mem;
unsigned char *attr_mem = NULL;
UINT32 plx_addr;
wlandevice_t *wlandev = NULL;
prism2sta_priv_t *priv = NULL;
@ -3692,7 +3657,7 @@ prism2sta_probe_plx(
return -EIO;
}
WLAN_LOG_INFO2("NDC NCP130 with TMC7160(ASIC) PCI interface device found at io:0x%x, irq:%d\n", pccard_ioaddr, pdev->irq);
WLAN_LOG_INFO2("NDC NCP130 with TMC7160(ASIC) PCI interface device found at io:0x%lx, irq:%d\n", pccard_ioaddr, pdev->irq);
goto init;
}
@ -3935,7 +3900,8 @@ static void *prism2sta_probe_usb(
int result;
DBFENTER;
// XXXXX
#if 0
/* Check to see if we should claim this device */
for ( i = 0; usb_id_tbl[i].name != NULL; i++) {
if (
@ -3953,7 +3919,7 @@ static void *prism2sta_probe_usb(
WLAN_LOG_INFO2("prism2_usb: Attempting to claim device %s "
"with devnum %d\n",
usb_id_tbl[i].name, dev->devnum);
#endif
if ((wlandev = create_wlan()) == NULL) {
WLAN_LOG_ERROR1("%s: Memory allocation failure.\n", dev_info);
result = -EIO;