[Linux1394-cvslog] rev 828 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2003-03-08 06:42:42
|
Author: bencollins Date: 2003-03-08 01:41:48 -0500 (Sat, 08 Mar 2003) New Revision: 828 Modified: trunk/ieee1394_core.c trunk/ieee1394_hotplug.h trunk/nodemgr.c trunk/sbp2.c Log: Add irm_id and busmgr_id to fw-host attributes. Export ieee1394_bus_type. Add device_driver member to hpsb_protocol_driver struct. Start of moving hotplug probe/register to driver-model. Modified: trunk/ieee1394_hotplug.h ============================================================================== --- trunk/ieee1394_hotplug.h (original) +++ trunk/ieee1394_hotplug.h 2003-03-08 01:41:49.000000000 -0500 @@ -1,6 +1,8 @@ #ifndef _IEEE1394_HOTPLUG_H #define _IEEE1394_HOTPLUG_H +#include <linux/device.h> + #include "ieee1394_core.h" #include "nodemgr.h" @@ -64,6 +66,8 @@ /* The list of unit directories managed by this driver */ struct list_head unit_directories; + + struct device_driver driver; }; int hpsb_register_protocol(struct hpsb_protocol_driver *driver); Modified: trunk/ieee1394_core.c ============================================================================== --- trunk/ieee1394_core.c (original) +++ trunk/ieee1394_core.c 2003-03-08 01:41:49.000000000 -0500 @@ -1274,6 +1274,7 @@ EXPORT_SYMBOL(hpsb_register_protocol); EXPORT_SYMBOL(hpsb_unregister_protocol); EXPORT_SYMBOL(hpsb_release_unit_directory); +EXPORT_SYMBOL(ieee1394_bus_type); /** csr.c **/ EXPORT_SYMBOL(hpsb_update_config_rom); Modified: trunk/nodemgr.c ============================================================================== --- trunk/nodemgr.c (original) +++ trunk/nodemgr.c 2003-03-08 01:41:49.000000000 -0500 @@ -112,7 +112,7 @@ { \ struct node_entry *ne; \ ne = container_of(dev, struct node_entry, device); \ - return sprintf (buf, format_string, (type)ne->field); \ + return sprintf(buf, format_string, (type)ne->field); \ } \ static struct device_attribute dev_attr_ne_##field = { \ .attr = {.name = __stringify(field), .mode = S_IRUGO }, \ @@ -124,7 +124,7 @@ { \ struct unit_directory *ud; \ ud = container_of(dev, struct unit_directory, device); \ - return sprintf (buf, format_string, (type)ud->field); \ + return sprintf(buf, format_string, (type)ud->field); \ } \ static struct device_attribute dev_attr_ud_##field = { \ .attr = {.name = __stringify(field), .mode = S_IRUGO }, \ @@ -136,7 +136,7 @@ { \ struct hpsb_host *host; \ host = container_of(dev, struct hpsb_host, device); \ - return sprintf (buf, format_string, (type)host->field); \ + return sprintf(buf, format_string, (type)host->field); \ } \ static struct device_attribute dev_attr_host_##field = { \ .attr = {.name = __stringify(field), .mode = S_IRUGO }, \ @@ -176,7 +176,7 @@ { struct node_entry *ne = container_of(dev, struct node_entry, device); - return sprintf (buf, "IRMC(%d) CMC(%d) ISC(%d) BMC(%d) PMC(%d) GEN(%d) " + return sprintf(buf, "IRMC(%d) CMC(%d) ISC(%d) BMC(%d) PMC(%d) GEN(%d) " "LSPD(%d) MAX_REC(%d) CYC_CLK_ACC(%d)\n", ne->busopt.irmc, ne->busopt.cmc, ne->busopt.isc, ne->busopt.bmc, ne->busopt.pmc, ne->busopt.generation, ne->busopt.lnkspd, @@ -188,7 +188,7 @@ static ssize_t fw_ne_show_tlabels_free(struct device *dev, char *buf) { struct node_entry *ne = container_of(dev, struct node_entry, device); - return sprintf (buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1); + return sprintf(buf, "%d\n", atomic_read(&ne->tpool->count.count) + 1); } static DEVICE_ATTR(tlabels_free,S_IRUGO,fw_ne_show_tlabels_free,NULL); @@ -196,7 +196,7 @@ static ssize_t fw_ne_show_tlabels_allocations(struct device *dev, char *buf) { struct node_entry *ne = container_of(dev, struct node_entry, device); - return sprintf (buf, "%u\n", ne->tpool->allocations); + return sprintf(buf, "%u\n", ne->tpool->allocations); } static DEVICE_ATTR(tlabels_allocations,S_IRUGO,fw_ne_show_tlabels_allocations,NULL); @@ -205,14 +205,30 @@ { struct node_entry *ne = container_of(dev, struct node_entry, device); #if (BITS_PER_LONG <= 32) - return sprintf (buf, "0x%08lx%08lx\n", ne->tpool->pool[0], ne->tpool->pool[1]); + return sprintf(buf, "0x%08lx%08lx\n", ne->tpool->pool[0], ne->tpool->pool[1]); #else - return sprintf (buf, "0x%016lx\n", ne->tpool->pool[0]); + return sprintf(buf, "0x%016lx\n", ne->tpool->pool[0]); #endif } static DEVICE_ATTR(tlabels_mask,S_IRUGO,fw_ne_show_tlabels_mask,NULL); +static ssize_t fw_host_show_irm(struct device *dev, char *buf) +{ + struct hpsb_host *host = container_of(dev, struct hpsb_host, device); + return sprintf(buf, NODE_BUS_FMT "\n", NODE_BUS_ARGS(host->irm_id)); +} +static DEVICE_ATTR(irm_id,S_IRUGO,fw_host_show_irm,NULL); + + +static ssize_t fw_host_show_busmgr(struct device *dev, char *buf) +{ + struct hpsb_host *host = container_of(dev, struct hpsb_host, device); + return sprintf(buf, NODE_BUS_FMT "\n", NODE_BUS_ARGS(host->busmgr_id)); +} +static DEVICE_ATTR(busmgr_id,S_IRUGO,fw_host_show_busmgr,NULL); + + static void nodemgr_create_ne_dev_files(struct node_entry *ne) { struct device *dev = &ne->device; @@ -239,6 +255,8 @@ device_create_file(dev, &dev_attr_host_is_cycmst); device_create_file(dev, &dev_attr_host_is_irm); device_create_file(dev, &dev_attr_host_is_busmgr); + device_create_file(dev, &dev_attr_irm_id); + device_create_file(dev, &dev_attr_busmgr_id); } static void nodemgr_create_ud_dev_files(struct unit_directory *ud) @@ -1021,6 +1039,9 @@ if (down_interruptible(&nodemgr_serialize)) return -EINTR; + if (driver->driver.name[0]) + driver_register(&driver->driver); + list_add_tail(&driver->list, &driver_list); INIT_LIST_HEAD(&driver->unit_directories); @@ -1354,7 +1375,7 @@ if (status < 0 || !(be32_to_cpu(bc) & 0x80000000)) { /* The root node does not have a valid BROADCAST_CHANNEL * register and we do, so reset the bus with force_root set */ - HPSB_INFO("Remote root is not IRM capable, resetting..."); + HPSB_DEBUG("Remote root is not IRM capable, resetting..."); hpsb_reset_bus(host, LONG_RESET_FORCE_ROOT); return 0; } Modified: trunk/sbp2.c ============================================================================== --- trunk/sbp2.c (original) +++ trunk/sbp2.c 2003-03-08 01:41:49.000000000 -0500 @@ -480,13 +480,18 @@ #endif static struct hpsb_protocol_driver sbp2_driver = { - .name = "SBP2 Driver", - .id_table = sbp2_id_table, - .probe = sbp2_probe, - .disconnect = sbp2_disconnect, - .update = sbp2_update + .name = "SBP2 Driver", + .id_table = sbp2_id_table, + .probe = sbp2_probe, + .disconnect = sbp2_disconnect, + .update = sbp2_update, + .driver = { + .name = "sbp2", + .bus = &ieee1394_bus_type, + }, }; + /* List of device firmware's that require a forced 36 byte inquiry. */ static u32 sbp2_broken_inquiry_list[] = { 0x00002800, /* Stefan Richter <ric...@ba...> */ |