From e1d118f16dca0f54faba3e8dd5b6adbbf7ac68c8 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 3 Jul 2006 12:02:28 -0400 Subject: [PATCH] ieee1394: coding style and comment fixes in midlayer header files Adjust tabulators, line wraps, empty lines, and comment style. Update comments in ieee1394_transactions.h and highlevel.h. Fix typo in comment in csr.h. Signed-off-by: Stefan Richter Signed-off-by: Ben Collins --- drivers/ieee1394/nodemgr.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'drivers/ieee1394/nodemgr.h') diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h index 0b26616e16c..b35c1b5c8d8 100644 --- a/drivers/ieee1394/nodemgr.h +++ b/drivers/ieee1394/nodemgr.h @@ -44,7 +44,6 @@ struct bus_options { u16 max_rec; /* Maximum packet size node can receive */ }; - #define UNIT_DIRECTORY_VENDOR_ID 0x01 #define UNIT_DIRECTORY_MODEL_ID 0x02 #define UNIT_DIRECTORY_SPECIFIER_ID 0x04 @@ -59,8 +58,8 @@ struct bus_options { * unit directory for each of these protocols. */ struct unit_directory { - struct node_entry *ne; /* The node which this directory belongs to */ - octlet_t address; /* Address of the unit directory on the node */ + struct node_entry *ne; /* The node which this directory belongs to */ + octlet_t address; /* Address of the unit directory on the node */ u8 flags; /* Indicates which entries were read */ quadlet_t vendor_id; @@ -79,11 +78,10 @@ struct unit_directory { int length; /* Number of quadlets */ struct device device; - struct class_device class_dev; struct csr1212_keyval *ud_kv; - u32 lun; /* logical unit number immediate value */ + u32 lun; /* logical unit number immediate value */ }; struct node_entry { @@ -106,7 +104,6 @@ struct node_entry { struct hpsb_tlabel_pool *tpool; struct device device; - struct class_device class_dev; /* Means this node is not attached anymore */ @@ -153,8 +150,8 @@ static inline int hpsb_node_entry_valid(struct node_entry *ne) /* * This will fill in the given, pre-initialised hpsb_packet with the current * information from the node entry (host, node ID, generation number). It will - * return false if the node owning the GUID is not accessible (and not modify the - * hpsb_packet) and return true otherwise. + * return false if the node owning the GUID is not accessible (and not modify + * the hpsb_packet) and return true otherwise. * * Note that packet sending may still fail in hpsb_send_packet if a bus reset * happens while you are trying to set up the packet (due to obsolete generation @@ -170,16 +167,13 @@ int hpsb_node_write(struct node_entry *ne, u64 addr, int hpsb_node_lock(struct node_entry *ne, u64 addr, int extcode, quadlet_t *data, quadlet_t arg); - /* Iterate the hosts, calling a given function with supplied data for each * host. */ int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *)); - int init_ieee1394_nodemgr(void); void cleanup_ieee1394_nodemgr(void); - /* The template for a host device */ extern struct device nodemgr_dev_template_host; -- cgit v1.2.3 From de4394f13cc843fae2a3ba2df752ee20e6e779a8 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 3 Jul 2006 12:02:29 -0400 Subject: [PATCH] ieee1394: update #include directives in midlayer header files Remove unnecessary includes, add missing includes. Use forward type declarations for some structs. Signed-off-by: Stefan Richter Signed-off-by: Ben Collins --- drivers/ieee1394/nodemgr.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'drivers/ieee1394/nodemgr.h') diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h index b35c1b5c8d8..f649c9d321b 100644 --- a/drivers/ieee1394/nodemgr.h +++ b/drivers/ieee1394/nodemgr.h @@ -21,9 +21,15 @@ #define _IEEE1394_NODEMGR_H #include -#include "csr1212.h" +#include + #include "ieee1394_core.h" -#include "ieee1394_hotplug.h" +#include "ieee1394_types.h" + +struct csr1212_csr; +struct csr1212_keyval; +struct hpsb_host; +struct ieee1394_device_id; /* '1' '3' '9' '4' in ASCII */ #define IEEE1394_BUSID_MAGIC __constant_cpu_to_be32(0x31333934) -- cgit v1.2.3 From 9951903e616662e9a5dad5fbd296690e2ebbbc65 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 2 Jul 2006 14:17:00 +0200 Subject: ieee1394: shrink tlabel pools, remove tpool semaphores This patch reduces the size of struct hpsb_host and also removes semaphores from ieee1394_transactions.c. On i386, struct hpsb_host shrinks from 10656 bytes to 6688 bytes. This is accomplished by - using a single wait_queue for hpsb_get_tlabel instead of many instances of semaphores, - using a single lock to serialize access to all tlabel pools (the protected code regions are small, i.e. lock contention very low), - omitting the sysfs attribute tlabels_allocations. Drawback: In the rare case that a process needs to sleep because all transaction labels for the node are temporarily exhausted, it is also woken up if a tlabel for a different node became free, checks for an available tlabel, and is put to sleep again. The check is not costly and the situation occurs extremely rarely. (Tlabels are typically only exhausted if there was no context switch to the khpsbpkt thread which recycles tlables.) Therefore the benefit of reduced tpool size outweighs this drawback. The sysfs attributes tlabels_free and tlabels_mask are not compiled anymore unless CONFIG_IEEE1394_VERBOSEDEBUG is set. The by far biggest member of struct hpsb_host, the struct csr_control csr (5272 bytes on i386), is now placed at the end of struct hpsb_host. Note, hpsb_get_tlabel calls the macro wait_event_interruptible with a condition argument which has a side effect (allocation of a tlabel and manipulation of the packet). This side effect happens only if the condition is true. The patch relies on wait_event_interruptible not evaluating the condition again after it became true. Signed-off-by: Stefan Richter --- drivers/ieee1394/nodemgr.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/ieee1394/nodemgr.h') diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h index f649c9d321b..0e1e7d93078 100644 --- a/drivers/ieee1394/nodemgr.h +++ b/drivers/ieee1394/nodemgr.h @@ -107,7 +107,6 @@ struct node_entry { const char *vendor_oui; u32 capabilities; - struct hpsb_tlabel_pool *tpool; struct device device; struct class_device class_dev; -- cgit v1.2.3