patch-2.4.20 linux-2.4.20/drivers/ieee1394/hosts.c
Next file: linux-2.4.20/drivers/ieee1394/hosts.h
Previous file: linux-2.4.20/drivers/ieee1394/highlevel.c
Back to the patch index
Back to the overall index
- Lines: 101
- Date:
Thu Nov 28 15:53:13 2002
- Orig file:
linux-2.4.19/drivers/ieee1394/hosts.c
- Orig date:
Fri Aug 2 17:39:44 2002
diff -urN linux-2.4.19/drivers/ieee1394/hosts.c linux-2.4.20/drivers/ieee1394/hosts.c
@@ -38,7 +38,7 @@
return -1;
}
-static struct hpsb_host_operations dummy_ops = {
+static struct hpsb_host_driver dummy_driver = {
.transmit_packet = dummy_transmit_packet,
.devctl = dummy_devctl
};
@@ -63,7 +63,7 @@
spin_lock_irqsave(&hosts_lock, flags);
list_for_each(lh, &hosts) {
if (host == list_entry(lh, struct hpsb_host, host_list)) {
- host->ops->devctl(host, MODIFY_USAGE, 1);
+ host->driver->devctl(host, MODIFY_USAGE, 1);
host->refcount++;
retval = 1;
break;
@@ -87,7 +87,7 @@
{
unsigned long flags;
- host->ops->devctl(host, MODIFY_USAGE, 0);
+ host->driver->devctl(host, MODIFY_USAGE, 0);
spin_lock_irqsave(&hosts_lock, flags);
host->refcount--;
@@ -128,7 +128,6 @@
h->hostdata = h + 1;
h->driver = drv;
- h->ops = drv->ops;
h->refcount = 1;
INIT_LIST_HEAD(&h->pending_packets);
@@ -152,63 +151,26 @@
unsigned long flags;
spin_lock_irqsave(&hosts_lock, flags);
- host->driver->number_of_hosts++;
- list_add_tail(&host->driver_list, &host->driver->hosts);
list_add_tail(&host->host_list, &hosts);
spin_unlock_irqrestore(&hosts_lock, flags);
highlevel_add_host(host);
- host->ops->devctl(host, RESET_BUS, 0);
+ host->driver->devctl(host, RESET_BUS, 0);
}
void hpsb_remove_host(struct hpsb_host *host)
{
- struct hpsb_host_driver *drv = host->driver;
unsigned long flags;
host->is_shutdown = 1;
- host->ops = &dummy_ops;
+ host->driver = &dummy_driver;
highlevel_remove_host(host);
spin_lock_irqsave(&hosts_lock, flags);
- list_del(&host->driver_list);
list_del(&host->host_list);
- drv->number_of_hosts--;
spin_unlock_irqrestore(&hosts_lock, flags);
}
-
-struct hpsb_host_driver *hpsb_register_lowlevel(struct hpsb_host_operations *op,
- const char *name)
-{
- struct hpsb_host_driver *drv;
-
- drv = kmalloc(sizeof(struct hpsb_host_driver), SLAB_KERNEL);
- if (!drv) return NULL;
-
- INIT_LIST_HEAD(&drv->list);
- INIT_LIST_HEAD(&drv->hosts);
- drv->number_of_hosts = 0;
- drv->name = name;
- drv->ops = op;
-
- spin_lock(&host_drivers_lock);
- list_add_tail(&drv->list, &host_drivers);
- spin_unlock(&host_drivers_lock);
-
- return drv;
-}
-
-void hpsb_unregister_lowlevel(struct hpsb_host_driver *drv)
-{
- spin_lock(&host_drivers_lock);
- list_del(&drv->list);
- spin_unlock(&host_drivers_lock);
-
- kfree(drv);
-}
-
-
/*
* This function calls the given function for every host currently registered.
*/
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)